/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", "SimHei", "STKaiti", serif;
}

body {
  background-color: #f8f4e9;
  color: #333;
  line-height: 1.6;
  font-size: 16px;
  min-height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23d2691e' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 中国风头部样式 */
.app-header {
  background: linear-gradient(135deg, #5D4037 0%, #8B4513 100%) !important;
  color: #FFF8DC;
  padding: 18px 15px;
  margin-bottom: 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: none;
  border-bottom: 3px solid #D2691E;
  position: relative;
}

/* 移除伪元素，避免影响头部底部样式 */

.app-header h1 {
  font-size: 1.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.app-header h1 i {
  margin-right: 10px;
  font-size: 1.8rem;
  color: #FFD700;
}

.app-header .subtitle {
  font-size: 1rem;
  opacity: 0.95;
  margin-top: 5px;
  color: #FFF8DC;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info span {
  font-size: 0.95rem;
  font-weight: 500;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* 中国风卡片样式 */
.card {
  background: linear-gradient(135deg, #FFF8DC 0%, #FFEBCD 100%) !important;
  border-radius: 15px !important;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.15) !important;
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid #D2691E !important;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(139, 69, 19, 0.25) !important;
}

.input-card h2, .result-card h2 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 3px solid #D2691E;
  display: flex;
  align-items: center;
  color: #8B4513;
  font-weight: bold;
}

.input-card h2 i, .result-card h2 i {
  margin-right: 10px;
  color: #8B4513;
  font-size: 1.4rem;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #8B4513;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
}

.form-group label i {
  margin-right: 8px;
  color: #8B4513;
  min-width: 20px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #D2691E;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: #FFF8DC;
  color: #333;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #8B4513;
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.15);
  background-color: #FFF8DC;
}

.form-row {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* 中国风按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
  color: #FFF8DC !important;
  border: 2px solid #8B4513 !important;
  border-radius: 25px !important;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  min-height: 48px;
  box-shadow: 0 4px 6px rgba(139, 69, 19, 0.2);
}

.btn i {
  margin-right: 8px;
  font-size: 1.1rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-small {
  padding: 10px 16px;
  font-size: 0.9rem;
  min-height: 40px;
}

.btn-primary {
  background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%) !important;
  border: 2px solid #8B4513 !important;
  color: #FFF8DC !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #A0522D 0%, #D2691E 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(139, 69, 19, 0.3) !important;
  border-color: #A0522D !important;
}

.btn-outline {
  background: transparent !important;
  border: 2px solid #8B4513 !important;
  color: #8B4513 !important;
  padding: 8px 16px !important;
}

.btn-outline:hover {
  background-color: rgba(139, 69, 19, 0.1) !important;
  border-color: #A0522D !important;
  color: #A0522D !important;
}

.btn-danger {
  background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%) !important;
  color: white !important;
  border: 2px solid #d32f2f !important;
}

/* 单选框与复选框 */
.radio-group, .checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* 新的样式：将单选框放在同一个框内 */
.radio-group.single-box {
  border: 2px solid #D2691E;
  border-radius: 8px;
  padding: 0;
  gap: 0;
  background-color: #FFF8DC;
}

.radio-label, .checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 12px 18px;
  border: 2px solid #D2691E;
  border-radius: 8px;
  flex: 1;
  min-width: calc(50% - 6px);
  transition: all 0.3s ease;
  background-color: #FFF8DC;
}

/* 新的样式：单选框在同一个框内时的标签样式 */
.radio-group.single-box .radio-label {
  border: none;
  border-radius: 0;
  flex: 1;
  min-width: auto;
  background-color: transparent;
  padding: 8px 18px;
}

.radio-label:hover, .checkbox-label:hover {
  border-color: #8B4513;
  background-color: #f5e7d3;
}

/* 新的样式：单选框在同一个框内时的悬停效果 */
.radio-group.single-box .radio-label:hover {
  background-color: rgba(139, 69, 19, 0.1);
  border: none;
}

/* 五行选择红色样式 */
.checkbox-label input:checked ~ span {
  color: #FF0000 !important;
  font-weight: bold !important;
}

.checkbox-label input:checked {
  border-color: #FF0000 !important;
}

/* 五行图表样式 - 不同颜色 */
.wuxing-chart {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8f4e9;
  border-radius: 10px;
  border: 2px solid #D2691E;
}

.wuxing-item {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.wuxing-item span {
  min-width: 60px;
  font-weight: bold;
  color: #333;
  font-size: 1rem;
}

.wuxing-bar {
  height: 20px;
  border-radius: 10px;
  margin-left: 15px;
  flex: 1;
  transition: width 1s ease-in-out;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 五行颜色定义 */
.wuxing-bar.jin {
  background: linear-gradient(90deg, #FFFFFF 0%, #F0F0F0 100%) !important;
  border: 1px solid #ccc;
  color: #333 !important;
}

.wuxing-bar.mu {
  background: linear-gradient(90deg, #228B22 0%, #32CD32 100%) !important;
  color: white !important;
}

.wuxing-bar.shui {
  background: linear-gradient(90deg, #000080 0%, #1E90FF 100%) !important;
  color: white !important;
}

.wuxing-bar.huo {
  background: linear-gradient(90deg, #FF4500 0%, #FF6347 100%) !important;
  color: white !important;
}

.wuxing-bar.tu {
  background: linear-gradient(90deg, #D2691E 0%, #F4A460 100%) !important;
  color: white !important;
}

.wuxing-bar::after {
  content: attr(data-value);
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 结果区域样式 */
.result-section {
  margin-top: 20px;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.bazi-grid, .wuge-grid, .sancai-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #f8f4e9 0%, #f0ead6 100%);
  border-radius: 10px;
  border: 2px solid #D2691E;
}

.bazi-item, .wuge-item, .sancai-item {
  padding: 12px 15px;
  background-color: #FFF8DC;
  border-radius: 8px;
  border-left: 4px solid #8B4513;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 应用底部 */
.app-footer {
  text-align: center;
  padding: 15px;
  color: #8B4513;
  font-size: 0.9rem;
  border-top: 2px solid #D2691E;
  margin-top: auto;
  background: linear-gradient(135deg, #FFF8DC 0%, #FFEBCD 100%);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .app-header h1 {
    font-size: 1.5rem;
  }
  
  .bazi-grid, .wuge-grid, .sancai-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app-header h1 {
    font-size: 1.3rem;
  }
  
  .card {
    padding: 15px;
  }
}

/* 人工辅助起名页面特殊样式 */
.character-item {
  transition: all 0.3s ease;
  border: 2px solid #D2691E;
}

.character-item:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

.character-item.selected {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.2) 0%, rgba(210, 105, 30, 0.2) 100%) !important;
  border-color: #FF0000 !important;
  transform: scale(1.05);
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background: linear-gradient(135deg, #FFF8DC 0%, #FFEBCD 100%);
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  border: 3px solid #8B4513;
}

.modal-header {
  padding: 25px 30px;
  border-bottom: 3px solid #D2691E;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
  color: #FFF8DC;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  color: #FFF8DC;
  display: flex;
  align-items: center;
}

.modal-header h3 i {
  margin-right: 10px;
  color: #FFD700;
}

.modal-body {
  padding: 30px;
}

/* 三才五格详细解析样式 */
.wuge-analysis-section {
  background: linear-gradient(135deg, #f8f4e9 0%, #f0ead6 100%);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  border: 2px solid #D2691E;
}

.wuge-analysis-section h3 {
  color: #8B4513;
  border-bottom: 2px solid #D2691E;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.wuge-number-meaning {
  background: #FFF8DC;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  border-left: 4px solid #8B4513;
}

.wuge-number-meaning h5 {
  color: #8B4513;
  margin-bottom: 5px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #A0522D 0%, #D2691E 100%);
}