/* 命格查询网站 - 古典神秘风格 */

/* 基础配置 */
:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --border-color: #2a2a4a;
  --gold: #ffd700;
  --gold-dark: #c9a227;
  
  /* 五行专属色 */
  --wuxing-gold: #ffd700;
  --wuxing-wood: #4a7c59;
  --wuxing-water: #4a90d9;
  --wuxing-fire: #ff6b35;
  --wuxing-earth: #c9a227;
}

/* 饰品建议分区样式 */
.suggestion-section {
  margin-bottom: 0.8rem;
  padding: 0.6rem;
  background: rgba(22, 33, 62, 0.5);
  border-radius: 0.5rem;
}

.section-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-color);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', '微软雅黑', 'Noto Sans SC', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* 导航栏 */
.navbar {
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--gold);
  color: var(--bg-primary);
}

/* 主容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* 卡片样式 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  color: var(--gold);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

/* 表单样式 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-input,
.form-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--gold);
}

/* 按钮 */
.btn {
  background: var(--gold);
  color: var(--bg-primary);
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.btn:hover {
  background: var(--gold-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--gold);
  border: 1px solid var(--gold);
}

.btn-secondary:hover {
  background: var(--gold);
  color: var(--bg-primary);
}

.btn-center {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

/* 五行颜色标签 */
.wuxing-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.wuxing-tag.gold { background: var(--wuxing-gold); color: var(--bg-primary); }
.wuxing-tag.wood { background: var(--wuxing-wood); color: white; }
.wuxing-tag.water { background: var(--wuxing-water); color: white; }
.wuxing-tag.fire { background: var(--wuxing-fire); color: white; }
.wuxing-tag.earth { background: var(--wuxing-earth); color: var(--bg-primary); }

/* 五行分布图 */
.wuxing-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0;
}

.wuxing-bar-label {
  width: 60px;
  font-weight: 600;
}

.wuxing-bar-track {
  flex: 1;
  height: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 0.75rem;
  overflow: hidden;
}

.wuxing-bar-fill {
  height: 100%;
  border-radius: 0.75rem;
  transition: width 0.5s ease;
}

.wuxing-bar-fill.gold { background: linear-gradient(90deg, var(--wuxing-gold), #fff700); }
.wuxing-bar-fill.wood { background: linear-gradient(90deg, var(--wuxing-wood), #6b9b6b); }
.wuxing-bar-fill.water { background: linear-gradient(90deg, var(--wuxing-water), #6ba0e9); }
.wuxing-bar-fill.fire { background: linear-gradient(90deg, var(--wuxing-fire), #ff8b5b); }
.wuxing-bar-fill.earth { background: linear-gradient(90deg, var(--wuxing-earth), #d9b237); }

.wuxing-bar-value {
  width: 40px;
  text-align: right;
  color: var(--text-secondary);
}

/* 时辰对照表 */
.time-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.time-item {
  background: var(--bg-secondary);
  padding: 0.5rem;
  border-radius: 0.5rem;
  text-align: center;
  font-size: 0.85rem;
}

.time-item span {
  color: var(--gold);
}

/* 八字展示 */
.bazi-display {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
  margin-bottom: 1rem;
}

.bazi-column {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.5rem;
}

.bazi-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.bazi-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.bazi-value.gan { color: var(--gold); }
.bazi-value.zhi { color: var(--text-primary); }

/* 建议卡片 */
.suggestion-card {
  background: var(--bg-secondary);
  padding: 0.6rem;
  border-radius: 0.5rem;
  margin: 0.3rem 0;
}

.suggestion-card h4 {
  color: var(--gold);
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

.suggestion-card p {
  margin: 0.2rem 0;
  font-size: 0.85rem;
}

.suggestion-card ul {
  list-style: none;
  padding-left: 0;
}

.suggestion-card li {
  padding: 0.25rem 0;
  color: var(--text-secondary);
}

.suggestion-card li::before {
  content: "• ";
  color: var(--gold);
}

/* 时辰折叠 */
.time-collapse {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.time-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: background 0.3s ease;
}

.time-header:hover {
  background: var(--bg-tertiary);
}

.time-header span:first-child {
  color: var(--gold);
  font-weight: 500;
}

.time-arrow {
  color: var(--gold);
  transition: transform 0.3s ease;
}

.time-arrow.open {
  transform: rotate(90deg);
}

.time-content {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

/* 饰品搭配原因 */
.reason-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px dashed var(--border);
}

/* 材质/颜色查询 */
.query-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.query-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
}

.query-result {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

/* 饰品列表 */
.accessory-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.accessory-item {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.5rem;
  border-left: 3px solid;
}

.accessory-item.gold { border-left-color: var(--wuxing-gold); }
.accessory-item.wood { border-left-color: var(--wuxing-wood); }
.accessory-item.water { border-left-color: var(--wuxing-water); }
.accessory-item.fire { border-left-color: var(--wuxing-fire); }
.accessory-item.earth { border-left-color: var(--wuxing-earth); }

.accessory-item h4 {
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.accessory-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 描述文本 */
.description {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 0.5rem;
  white-space: pre-wrap;
  line-height: 1.8;
  color: var(--text-primary);
}

/* 底部 */
.footer {
  background: var(--bg-secondary);
  padding: 1rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.footer-brand {
  color: var(--gold);
  font-weight: 600;
}

.footer-icp {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.footer-notice {
  font-size: 0.8rem;
  color: #ff6b35;
  opacity: 0.8;
}
/* 响应式 */
@media (max-width: 768px) {
  .navbar {
    justify-content: center;
    text-align: center;
  }
  
  .logo {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .bazi-display {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .time-table {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .container {
    padding: 1rem;
  }
  
  .card {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .bazi-display {
    grid-template-columns: 1fr 1fr;
  }
  
  .bazi-value {
    font-size: 1.2rem;
  }
  
  .btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .nav-links a {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* 行内输入框样式 */
.inline-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.inline-input {
  width: 70px;
  padding: 0.6rem 0.5rem;
  border: 2px solid rgba(255,215,0,0.3);
  border-radius: 0.375rem;
  background: linear-gradient(135deg, rgba(30,30,40,0.9) 0%, rgba(20,20,30,0.95) 100%);
  color: var(--gold);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.inline-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2), inset 0 1px 3px rgba(0,0,0,0.3);
  background: linear-gradient(135deg, rgba(40,40,50,0.9) 0%, rgba(30,30,40,0.95) 100%);
}

.inline-input::placeholder {
  color: rgba(255,215,0,0.4);
}

.input-unit {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  margin: 0 0.3rem;
}

/* 响应式：小屏幕输入框 */
@media (max-width: 480px) {
  .inline-input {
    width: 55px;
    font-size: 0.95rem;
    padding: 0.5rem 0.3rem;
  }
  
  .input-unit {
    font-size: 0.8rem;
    margin: 0 0.2rem;
  }
}

/* 八字一行显示样式 */
.bazi-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  padding: 1rem 0.5rem;
  overflow-x: auto;
}

.bazi-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, rgba(255,215,0,0.15) 0%, rgba(30,30,40,0.8) 100%);
  border: 2px solid rgba(255,215,0,0.4);
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  min-width: 50px;
  flex-shrink: 1;
}

.bazi-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.bazi-content {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.bazi-gan {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
}

.bazi-zhi {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* 响应式：小屏幕缩小宽度 */
@media (max-width: 480px) {
  .bazi-inline {
    gap: 0.3rem;
    padding: 0.8rem 0.3rem;
  }
  
  .bazi-pill {
    min-width: 42px;
    padding: 0.3rem 0.5rem;
  }
  
  .bazi-label {
    font-size: 0.65rem;
  }
  
  .bazi-gan, .bazi-zhi {
    font-size: 1rem;
  }
}

/* 出生日期和时辰输入框样式 */
.form-row-section {
  margin-bottom: 1.2rem;
}

.form-label-section {
  display: block;
  font-size: 0.9rem;
  color: #d4af37;
  margin-bottom: 0.5rem;
  text-align: center;
  letter-spacing: 0.1em;
}

.form-inline-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-input-small {
  width: 65px;
  height: 38px;
  padding: 0.5rem;
  font-size: 1rem;
  font-family: 'Noto Serif SC', serif;
  color: #d4af37;
  text-align: center;
  background: linear-gradient(135deg, #2a1a0a 0%, #1a0f05 100%);
  border: 1px solid #d4af37;
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
  outline: none;
  transition: all 0.3s ease;
}

.form-input-small:focus {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(212, 175, 37, 0.4), inset 0 1px 3px rgba(0,0,0,0.3);
  background: linear-gradient(135deg, #3a2515 0%, #2a1a0a 100%);
}

.form-input-small::placeholder {
  color: rgba(212, 175, 37, 0.5);
  font-size: 0.75rem;
}

.form-unit {
  color: #b8960f;
  font-size: 0.85rem;
  padding: 0 0.2rem;
}

/* 小型下拉选择框 */
.form-select-small {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--gold);
  border-radius: 0.3rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.form-select-small:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* 响应式：小屏幕调整 */
@media (max-width: 480px) {
  .form-input-small {
    width: 55px;
    height: 34px;
    font-size: 0.9rem;
  }
  
  .form-label-section {
    font-size: 0.85rem;
  }
  
  .form-unit {
    font-size: 0.75rem;
  }
  
  .form-inline-row {
    gap: 0.3rem;
  }
}

/* 今日运势卡片样式 - 与其他模块保持一致 */
.fortune-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.fortune-title {
  font-size: 1.25rem;
  color: #ffd700;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #2a2a4a;
  padding-bottom: 0.5rem;
  text-align: center;
}

.fortune-date {
  text-align: center;
  color: #a0a0a0;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.fortune-jianchu {
  text-align: center;
  color: #d4af37;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.fortune-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.fortune-item {
  background: rgba(42, 42, 74, 0.3);
  border-radius: 6px;
  padding: 0.75rem;
}

.fortune-item-title {
  font-size: 0.9rem;
  color: #ffd700;
  margin-bottom: 0.4rem;
}

.fortune-item-content {
  color: #e8e8e8;
  font-size: 0.85rem;
  line-height: 1.5;
}

.fortune-yi {
  color: #4ade80;
}

.fortune-ji {
  color: #f87171;
}

.fortune-level {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.fortune-level-good {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border: 1px solid #4ade80;
}

.fortune-level-normal {
  background: rgba(212, 175, 55, 0.2);
  color: #d4af37;
  border: 1px solid #d4af37;
}

.fortune-level-bad {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
  border: 1px solid #f87171;
}

.fortune-tips {
  background: rgba(212, 175, 55, 0.15);
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.75rem;
  color: #c9b896;
  font-size: 0.85rem;
  line-height: 1.5;
}

.fortune-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.fortune-tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

@media (max-width: 768px) {
  .fortune-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .fortune-card {
    padding: 1rem;
  }
  
  .fortune-title {
    font-size: 1.1rem;
  }
}

/* 错误提示框 */
.error-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 50, 0.95);
  border: 1px solid #ff6b35;
  border-radius: 8px;
  padding: 12px 24px;
  color: #fff;
  font-size: 0.95rem;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  opacity: 1;
  transition: opacity 0.3s ease;
}