/* ==================== 九宫飞星系统 - 藏山幽齋风格样式表 ==================== */
/* 版本：V2.0 | 日期：2026-05-02 | 作者：藏山老师 */

/* ==================== 字体引入 ==================== */
@font-face {
  font-family: 'Noto Serif SC';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('assets/fonts/noto-serif-sc-chinese-simplified-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Noto Serif SC';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('assets/fonts/noto-serif-sc-chinese-simplified-700-normal.woff2') format('woff2');
}

/* ==================== 基础重置 ==================== */
*, *::before, *::after { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

html { 
  font-size: 16px; 
}

body {
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  color: #d4c5a0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #110d06;
  background-image:
    radial-gradient(ellipse at 50% 20%, rgba(180,140,60,0.04) 0%, transparent 55%),
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.5) 100%);
}

/* ==================== 暖光效果 ==================== */
.warm-glow {
  position: fixed;
  top: -8%; 
  left: 50%; 
  transform: translateX(-50%);
  width: 100vw; 
  height: 35vh;
  background: radial-gradient(ellipse, rgba(201,168,76,0.06) 0%, transparent 70%);
  pointer-events: none; 
  z-index: 0;
}

/* ==================== 容器布局 ==================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 0.6rem 1.5rem;
  position: relative; 
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== 返回导航 ==================== */
.back-nav {
  position: absolute;
  top: 1rem; 
  left: 1rem;
  z-index: 100;
}

.back-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: #a09070;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.6rem;
  border-radius: 3px;
  background: rgba(30,22,12,0.6);
  border: 1px solid #4a4028;
  transition: color 0.2s, border-color 0.2s;
}

.back-nav a:hover {
  color: #c9a84c;
  border-color: rgba(201,168,76,0.5);
}

/* ==================== 头部样式 ==================== */
.header {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
  position: relative;
}

.header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #5a4a2a, transparent);
}

.header h1 {
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #c9a84c;
  letter-spacing: 0.15em;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 0.9rem;
  color: #a09070;
  letter-spacing: 0.1em;
}

/* ==================== 卡片通用样式（线装书效果） ==================== */
.card {
  background: linear-gradient(180deg, #1e160c, #1a1208);
  border: 1px solid #2a2014;
  border-radius: 6px;
  padding: 1.2rem 1rem 1rem;
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}

/* 顶部金色光线 */
.card::before {
  content: "";
  position: absolute;
  top: 0; 
  left: 0; 
  right: 0; 
  height: 2px;
  background: linear-gradient(90deg, transparent, #5a4a2a, transparent);
}

/* 左侧装订线 */
.card::after {
  content: "";
  position: absolute;
  top: 8px; 
  left: 6px; 
  bottom: 8px; 
  width: 2px;
  background: linear-gradient(180deg, transparent 5%, rgba(201,168,76,0.15) 30%, rgba(201,168,76,0.25) 50%, rgba(201,168,76,0.15) 70%, transparent 95%);
  border-radius: 1px;
}

/* ==================== 表单样式 ==================== */
.form {
  padding: 0 0.5rem;
}

.form-group {
  margin-bottom: 1.2rem;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.95rem;
  color: #c9a84c;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  padding-left: 0.5rem;
  font-weight: 500;
}

.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 0.9rem;
  color: #d4c5a0;
  background: rgba(17,13,6,0.6);
  border: 1px solid #3a2e1a;
  border-radius: 4px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239a8a5a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-group select:focus {
  outline: none;
  border-color: #5a4a2a;
}

.form-group select option {
  background: #1a1208;
  color: #d4c5a0;
}

/* 单选按钮组 */
.radio-group {
  display: flex;
  gap: 1rem;
}

.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0.7rem 1.5rem;
  background: rgba(17,13,6,0.6);
  border: 1px solid #3a2e1a;
  border-radius: 4px;
  flex: 1;
  transition: all 0.2s;
}

.radio-label:hover {
  border-color: #5a4a2a;
}

.radio-label input[type="radio"] {
  display: none;
}

.radio-label span {
  font-size: 1rem;
  color: #b0a080;
  transition: color 0.2s;
}

.radio-label:has(input[type="radio"]:checked) {
  background: rgba(201,168,76,0.1);
  border-color: #c9a84c;
}

.radio-label:has(input[type="radio"]:checked) span {
  color: #c9a84c;
}

/* 高级选项 */
.advanced-section {
  margin-top: 0.5rem;
}

.advanced-toggle {
  width: 100%;
  padding: 0.8rem;
  background: none;
  border: none;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 0.9rem;
  color: #a09070;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

.advanced-toggle:hover {
  color: #c9a84c;
}

.toggle-icon {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.advanced-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.advanced-content.expanded {
  max-height: 150px;
}

.help-text {
  font-size: 0.8rem;
  color: #8a8060;
  margin-top: 0.4rem;
  padding-left: 0.5rem;
}

/* 提交按钮 */
.submit-btn {
  width: 100%;
  padding: 1rem;
  margin-top: 1.5rem;
  background: linear-gradient(180deg, rgba(201,168,76,0.12), rgba(201,168,76,0.04));
  color: #c9a84c;
  border: 1px solid rgba(201,168,76,0.4);
  border-radius: 4px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.5), transparent);
}

.submit-btn:hover {
  background: linear-gradient(180deg, rgba(201,168,76,0.2), rgba(201,168,76,0.08));
  border-color: #c9a84c;
}

.submit-btn:active {
  transform: translateY(1px);
}

/* ==================== 加载动画 ==================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17,13,6,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-content {
  text-align: center;
}

.taiji-container {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.taiji {
  width: 100%;
  height: 100%;
  animation: rotate 3s linear infinite;
}

.taiji circle {
  stroke: #c9a84c;
}

.taiji path {
  fill: #c9a84c;
}

.taiji circle:last-of-type {
  fill: #110d06;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1rem;
  color: #c9a84c;
  letter-spacing: 0.1em;
}

/* ==================== 报告页面样式 ==================== */
.main-content {
  flex: 1;
  padding: 0 0.5rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #c9a84c;
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
  padding-left: 0.8rem;
  border-left: 3px solid #c9a84c;
}

.section-tip {
  font-size: 0.85rem;
  color: #908060;
  margin-bottom: 0.8rem;
  padding-left: 0.8rem;
}

/* ==================== 九宫飞星盘 ==================== */
.chart-section {
  margin-bottom: 1rem;
}

.jiugong-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.5rem;
}

.jiugong-cell {
  aspect-ratio: 1;
  background: rgba(17,13,6,0.4);
  border: 1px solid #3a2e1a;
  border-radius: 4px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.jiugong-cell:hover {
  border-color: #5a4a2a;
  transform: scale(1.03);
}

.cell-direction {
  font-size: 0.75rem;
  color: #a09070;
  margin-bottom: 0.2rem;
}

.cell-star {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f0e0c0;
  margin-bottom: 0.2rem;
}

.cell-name {
  font-size: 0.7rem;
  color: #b0a080;
  text-align: center;
  line-height: 1.2;
}

/* 吉凶样式 - 古韵+科技感（低饱和高级色） */
/* 大吉：墨绿微光（财位8白）- 稳重富贵 */
.nature-daji {
  background: linear-gradient(145deg, rgba(45,65,50,0.35) 0%, rgba(20,35,28,0.5) 100%);
  border-color: #5a8060;
  box-shadow: inset 0 0 30px rgba(90,128,96,0.1), 0 2px 8px rgba(0,0,0,0.3);
}

/* 吉：暖金通透（9紫、1白、6白）- 温润祥和 */
.nature-ji {
  background: linear-gradient(145deg, rgba(65,58,40,0.3) 0%, rgba(30,26,18,0.45) 100%);
  border-color: #7a6040;
  box-shadow: inset 0 0 25px rgba(138,112,64,0.08), 0 2px 8px rgba(0,0,0,0.3);
}

/* 平：石青灰（4绿文昌）- 中性雅致 */
.nature-ban {
  background: linear-gradient(145deg, rgba(40,45,55,0.3) 0%, rgba(22,25,32,0.45) 100%);
  border-color: #4a5560;
  box-shadow: inset 0 0 20px rgba(74,85,96,0.06), 0 2px 8px rgba(0,0,0,0.3);
}

/* 凶：暗赭红（2黑、3碧、7赤）- 克制警示 */
.nature-xiong {
  background: linear-gradient(145deg, rgba(75,40,40,0.32) 0%, rgba(35,20,20,0.48) 100%);
  border-color: #704040;
  box-shadow: inset 0 0 25px rgba(112,64,64,0.08), 0 2px 8px rgba(0,0,0,0.3);
}

/* 大凶：深赭警示（5黄煞位）- 沉稳警示 */
.nature-daxiong {
  background: linear-gradient(145deg, rgba(85,45,30,0.4) 0%, rgba(40,22,12,0.55) 100%);
  border-color: #905030;
  box-shadow: inset 0 0 35px rgba(144,80,48,0.12), 0 2px 8px rgba(0,0,0,0.3);
}

/* ==================== 命卦卡片 ==================== */
.minggua-section {
  margin-bottom: 1rem;
}

.minggua-card {
  padding: 1rem 0.8rem;
}

.minggua-info {
  margin-bottom: 0.8rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px dashed #2a2014;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.9rem;
  color: #a09070;
}

.info-value {
  font-size: 1rem;
  color: #f0e0c0;
}

.match-level {
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
}

.match-high {
  background: rgba(76,175,80,0.15);
  color: #81c784;
}

.match-low {
  background: rgba(244,67,54,0.15);
  color: #e57373;
}

.minggua-desc {
  font-size: 1rem;
  color: #f0e0c0;
  padding: 0.8rem;
  background: rgba(17,13,6,0.4);
  border-radius: 4px;
  margin-bottom: 0.6rem;
  border-left: 3px solid #c9a84c;
}

.minggua-suggestion {
  font-size: 0.9rem;
  color: #b0a080;
  padding: 0.8rem;
  background: rgba(201,168,76,0.08);
  border-radius: 4px;
  border-left: 3px solid rgba(201,168,76,0.4);
}

/* ==================== 优先建议 ==================== */
.priority-section {
  margin-bottom: 1rem;
}

.priority-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.priority-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.8rem;
  background: rgba(17,13,6,0.4);
  border: 1px solid #2a2014;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.priority-item:hover {
  border-color: #3a2e1a;
}

.priority-number {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #4a4028, #3a3018);
  color: #f0d090;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.priority-content {
  flex: 1;
}

.priority-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.priority-direction {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0d090;
}

.priority-title {
  font-size: 0.85rem;
  color: #a09070;
}

.priority-advice {
  font-size: 0.95rem;
  color: #f0e0c0;
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

.priority-avoid {
  font-size: 0.85rem;
  color: #c07070;
}

/* ==================== 详细建议网格 ==================== */
.detail-section {
  margin-bottom: 1rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.5rem;
}

.detail-item {
  padding: 0.7rem;
  background: rgba(17,13,6,0.4);
  border: 1px solid #2a2014;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.detail-item:hover {
  border-color: #3a2e1a;
  background: rgba(17,13,6,0.6);
}

.detail-direction {
  font-size: 0.8rem;
  color: #a09070;
  margin-bottom: 0.2rem;
}

.detail-star {
  font-size: 0.9rem;
  color: #f0e0c0;
}

/* ==================== 重新测算按钮 ==================== */
.restart-btn {
  width: 100%;
  padding: 1rem;
  margin: 1.5rem 0;
  background: transparent;
  color: #a09070;
  border: 1px solid #5a4a2a;
  border-radius: 4px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}

.restart-btn:hover {
  border-color: #c9a84c;
  color: #c9a84c;
  background: rgba(201,168,76,0.08);
}

/* ==================== 详情弹窗 ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(180deg, #1e160c, #1a1208);
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  border-radius: 12px 12px 0 0;
  padding: 1.2rem;
  position: relative;
  transform: translateY(100%);
  transition: transform 0.3s;
  overflow-y: auto;
  border-top: 2px solid #5a4a2a;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: rgba(17,13,6,0.8);
  border: 1px solid #5a4a2a;
  border-radius: 50%;
  font-size: 1.2rem;
  color: #a09070;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  border-color: #c9a84c;
  color: #c9a84c;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #2a2014;
}

.modal-header h3 {
  font-size: 1rem;
  color: #c9a84c;
  letter-spacing: 0.05em;
}

.modal-nature {
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
}

.modal-section {
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  border-left: 2px solid #2a2014;
}

.modal-section h4 {
  font-size: 0.9rem;
  color: #c9a84c;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.modal-description,
.modal-advice,
.modal-avoid,
.modal-suitable {
  font-size: 1rem;
  color: #f0e0c0;
  line-height: 1.6;
}

.modal-avoid {
  color: #d08080;
}

/* ==================== 底部署名 ==================== */
.footer {
  text-align: center;
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer p {
  font-size: 0.85rem;
  color: #8a8060;
  letter-spacing: 0.05em;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 360px) {
  .container {
    padding: 0 0.4rem 1rem;
  }
  
  .header h1 {
    font-size: 1.3rem;
  }
  
  .jiugong-cell {
    padding: 0.3rem;
  }
  
  .cell-star {
    font-size: 1.1rem;
  }
  
  .cell-name {
    font-size: 0.55rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 600px;
  }
  
  .jiugong-grid {
    gap: 0.6rem;
  }
  
  .jiugong-cell {
    padding: 0.8rem;
  }
  
  .cell-star {
    font-size: 1.6rem;
  }
}
