@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700;900&family=ZCOOL+XiaoWei&family=Ma+Shan+Zheng&display=swap');

:root {
  --red: #8B0000;
  --red-light: #A52A2A;
  --gold: #D4AF37;
  --gold-light: #E8D48B;
  --cream: #FFF8E7;
  --cream-dark: #F5E6C8;
  --ink: #2C2C2C;
  --ink-light: #555;
  --border: #C9A96E;
  --shadow: rgba(139, 0, 0, 0.1);
}

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

body {
  font-family: 'Noto Serif SC', 'SimSun', serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(139, 0, 0, 0.05) 0%, transparent 50%);
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--red) 0%, #6B0000 100%);
  color: var(--gold);
  text-align: center;
  padding: 1.5rem 1rem;
  position: relative;
  border-bottom: 3px solid var(--gold);
}
.header::before, .header::after {
  content: '☰';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  opacity: 0.3;
}
.header::before { left: 2rem; }
.header::after { right: 2rem; }
.header h1 {
  font-family: 'Ma Shan Zheng', 'ZCOOL XiaoWei', serif;
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 0.8rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.header .subtitle {
  font-size: 0.9rem;
  margin-top: 0.3rem;
  color: var(--gold-light);
  letter-spacing: 0.2rem;
}
.header .user-info {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--gold-light);
}
.header .user-info a {
  color: var(--gold-light);
  cursor: pointer;
  text-decoration: underline;
  margin-left: 0.5rem;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* Card */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px var(--shadow);
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20px;
  right: 20px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--red);
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed var(--border);
  letter-spacing: 0.3rem;
}

/* Auth Page */
.auth-card {
  max-width: 420px;
  margin: 3rem auto;
}
.auth-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 0.8rem;
  text-align: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink-light);
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.auth-tab.active {
  color: var(--red);
  border-bottom-color: var(--red);
  font-weight: 600;
}

/* Form */
.form-group {
  margin-bottom: 1.2rem;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 0.4rem;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--cream);
  transition: border-color 0.3s;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(139,0,0,0.1);
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);
  color: var(--gold);
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.2rem;
  transition: all 0.3s;
  width: 100%;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,0,0,0.3);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-outline {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-outline:hover {
  background: var(--red);
  color: var(--gold);
}
.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  width: auto;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.mode-btn {
  padding: 0.8rem 2rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s;
  color: var(--ink-light);
}
.mode-btn.active {
  border-color: var(--red);
  background: linear-gradient(135deg, rgba(139,0,0,0.05), rgba(139,0,0,0.1));
  color: var(--red);
  font-weight: 600;
}
.mode-btn .icon { font-size: 1.5rem; display: block; margin-bottom: 0.3rem; }

/* ===== Art title (书法风格) ===== */
.art-title {
  font-family: 'Ma Shan Zheng', 'ZCOOL XiaoWei', 'Noto Serif SC', serif !important;
  font-size: 1.6rem !important;
  letter-spacing: 0.5rem !important;
}

/* ===== Input Card ===== */
.input-card {
  padding: 1.5rem 1.5rem 2rem;
}

/* Person form */
.person-section {
  border: 1px solid var(--cream-dark);
  border-radius: 10px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  background: linear-gradient(to bottom, var(--cream), white);
}
.person-label {
  font-family: 'Ma Shan Zheng', 'ZCOOL XiaoWei', serif;
  font-size: 1.15rem !important;
  color: var(--red);
  margin-bottom: 0.8rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--red);
}

/* 性别 + 历法 同一行 */
.input-top-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

/* 性别按钮组 */
.gender-toggle {
  display: flex;
  gap: 0;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.gender-btn {
  cursor: pointer;
  margin: 0;
}
.gender-btn input { display: none; }
.gender-btn span {
  display: block;
  padding: 0.4rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-light);
  background: white;
  transition: all 0.2s;
  border-right: 1px solid var(--border);
  letter-spacing: 0.1rem;
}
.gender-btn:last-child span { border-right: none; }
.gender-btn input:checked + span {
  background: var(--red);
  color: var(--gold);
}

/* 历法切换 */
.calendar-toggle {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.calendar-toggle label {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.calendar-toggle label span {
  display: block;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-light);
  background: white;
  transition: all 0.2s;
  border-right: 1px solid var(--border);
}
.calendar-toggle label:last-child span { border-right: none; }
.calendar-toggle input:checked + span {
  color: white;
  background: var(--gold);
  font-weight: 600;
}
.calendar-toggle input { display: none; }

/* 年月日时辰 四列 */
.date-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1.5fr;
  gap: 0.6rem;
  align-items: end;
}
.date-row .form-group {
  margin-bottom: 0;
}
.date-row .form-group label {
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-bottom: 0.25rem;
  display: block;
}
.date-row .form-group input,
.date-row .form-group select {
  padding: 0.55rem 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.05rem;
}
.date-row .form-group input::placeholder {
  color: #ccc;
  font-weight: 400;
}
.date-row .hour-group select {
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
}

/* 分析按钮 */
.analyze-btn {
  font-family: 'Ma Shan Zheng', 'ZCOOL XiaoWei', serif;
  font-size: 1.2rem !important;
  letter-spacing: 0.3rem !important;
  padding: 0.9rem 2rem;
  margin-top: 0.5rem;
}

/* Legacy form-row for non-input areas */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
}
.form-row .form-group { margin-bottom: 0.5rem; }

/* Result */
.result-section { display: none; }
.result-section.active { display: block; }

/* Bazi Display */
.bazi-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  text-align: center;
}
.bazi-table th {
  background: linear-gradient(135deg, var(--red), var(--red-light));
  color: var(--gold);
  padding: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1rem;
}
.bazi-table td {
  padding: 0.5rem 0.3rem;
  border: 1px solid var(--cream-dark);
  vertical-align: middle;
}
.bazi-table .row-label {
  font-size: 0.8rem;
  color: var(--ink-light);
  white-space: nowrap;
}
.bazi-table .gan {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--red);
}
.bazi-table .gan.day-master {
  color: var(--gold);
  background: var(--red);
  border-radius: 4px;
}
.bazi-table .zhi {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}
.bazi-table .nayin {
  font-size: 0.8rem;
  color: var(--ink-light);
}
.bazi-table .shishen {
  font-size: 0.75rem;
  color: var(--gold);
  background: var(--red);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  display: inline-block;
}
.bazi-table .shishen-day {
  background: var(--gold);
  color: var(--red);
}
/* 五行小标签 */
.wx-tag {
  font-size: 0.6rem;
  margin-left: 1px;
  font-weight: 400;
  vertical-align: baseline;
}
.wx-tag.wx-jin { color: #999; }
.wx-tag.wx-mu { color: #228B22; }
.wx-tag.wx-shui { color: #4682B4; }
.wx-tag.wx-huo { color: #CC0000; }
.wx-tag.wx-tu { color: #8B7355; }

/* 藏干 */
.canggan-cell {
  padding: 0.3rem !important;
}
.cg-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 2px;
  line-height: 1.2;
}
.cg-gan {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.cg-ss {
  font-size: 0.6rem;
  color: var(--ink-light);
}

/* 五行分析区 */
.wuxing-section {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--cream);
  border-radius: 8px;
  border: 1px solid var(--cream-dark);
}
.wuxing-header {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 0.5rem;
  align-items: center;
}
.strength-tag {
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
}
.strength-tag.strong { background: #FDE8E8; color: #CC0000; }
.strength-tag.weak { background: #E8F0FE; color: #1E3A5F; }

/* Wuxing bar */
.wuxing-bars {
  display: flex;
  gap: 0.8rem;
  margin: 0.8rem 0;
  align-items: flex-end;
  height: 100px;
  justify-content: center;
}
.wuxing-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 55px;
  position: relative;
}
.wuxing-bar .bar {
  width: 38px;
  border-radius: 4px 4px 0 0;
  transition: height 0.5s;
  min-height: 5px;
}
.wuxing-bar .label {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  font-weight: 700;
}
.wuxing-bar .count { font-size: 0.75rem; color: var(--ink-light); }
.wuxing-bar .xy-tag {
  font-size: 0.6rem;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  background: var(--red);
  color: white;
  margin-top: 2px;
}
.wuxing-bar .xy-tag.yong { background: var(--gold); color: var(--ink); }
.wuxing-bar.xi-mark .bar { box-shadow: 0 0 0 2px var(--red); }
.wuxing-bar.yong-mark .bar { box-shadow: 0 0 0 2px var(--gold); }
.wx-jin .bar { background: linear-gradient(to top, #C0C0C0, #E8E8E8); }
.wx-jin .label { color: #999; }
.wx-mu .bar { background: linear-gradient(to top, #228B22, #3CB371); }
.wx-mu .label { color: #228B22; }
.wx-shui .bar { background: linear-gradient(to top, #1E3A5F, #4682B4); }
.wx-shui .label { color: #1E3A5F; }
.wx-huo .bar { background: linear-gradient(to top, #CC0000, #FF4444); }
.wx-huo .label { color: #CC0000; }
.wx-tu .bar { background: linear-gradient(to top, #8B7355, #C4A35A); }
.wx-tu .label { color: #8B7355; }

/* 五行缺失/过旺提示 */
.wuxing-tips {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.tip-miss {
  color: #1E3A5F;
  background: #E8F0FE;
  padding: 0.2rem 0.8rem;
  border-radius: 3px;
  margin: 0 0.3rem;
}
.tip-excess {
  color: #CC0000;
  background: #FDE8E8;
  padding: 0.2rem 0.8rem;
  border-radius: 3px;
  margin: 0 0.3rem;
}

/* 神煞区 */
.shensha-section {
  text-align: center;
  margin-top: 0.8rem;
  padding-top: 0.5rem;
}
.shensha-label {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-right: 0.3rem;
}
.shensha-tag {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  margin: 0.2rem;
  border: 1px solid var(--gold);
  border-radius: 3px;
  font-size: 0.8rem;
  color: var(--gold);
  background: rgba(212,175,55,0.08);
  font-weight: 600;
}

/* Score */
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1rem auto;
  background: linear-gradient(135deg, var(--red), #6B0000);
  color: var(--gold);
}
.score-circle .number { font-size: 2rem; font-weight: 900; }
.score-circle .unit { font-size: 0.8rem; }

/* 合盘详情 */
.compat-details {
  max-width: 500px;
  margin: 0 auto;
  font-size: 0.9rem;
}
.compat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--cream-dark);
}
.compat-row.sub { padding-left: 1.5rem; font-size: 0.85rem; color: var(--ink-light); }
.compat-label { font-weight: 600; color: var(--ink-light); min-width: 80px; }

/* 大运时间线 */
.dayun-timeline {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}
.dayun-item {
  flex: 0 0 auto;
  width: 90px;
  text-align: center;
  padding: 0.6rem 0.3rem;
  border-right: 1px solid var(--cream-dark);
  position: relative;
  transition: background 0.2s;
}
.dayun-item:last-child { border-right: none; }
.dayun-item.current {
  background: linear-gradient(to bottom, rgba(139,0,0,0.08), rgba(139,0,0,0.02));
  border-radius: 6px;
}
.dayun-gz {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--red);
}
.dayun-nayin {
  font-size: 0.7rem;
  color: var(--ink-light);
  margin: 0.2rem 0;
}
.dayun-ss {
  font-size: 0.7rem;
  color: var(--gold);
  background: var(--red);
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  display: inline-block;
  margin: 0.2rem 0;
}
.dayun-age {
  font-size: 0.75rem;
  color: var(--ink);
  font-weight: 600;
}
.dayun-year {
  font-size: 0.65rem;
  color: var(--ink-light);
}
.dayun-now {
  font-size: 0.6rem;
  color: white;
  background: var(--red);
  border-radius: 8px;
  padding: 0.1rem 0.4rem;
  position: absolute;
  top: 2px;
  right: 2px;
}

/* 流年网格 */
.liunian-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
}
.liunian-item {
  text-align: center;
  padding: 0.6rem 0.3rem;
  border: 1px solid var(--cream-dark);
  border-radius: 6px;
  transition: all 0.2s;
}
.liunian-item.current {
  border-color: var(--red);
  background: rgba(139,0,0,0.05);
  box-shadow: 0 2px 8px rgba(139,0,0,0.1);
}
.ln-year {
  font-size: 0.8rem;
  color: var(--ink-light);
  font-weight: 600;
}
.liunian-item.current .ln-year { color: var(--red); }
.ln-gz {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0.2rem 0;
}
.ln-nayin {
  font-size: 0.7rem;
  color: var(--ink-light);
}
.ln-ss {
  font-size: 0.65rem;
  color: var(--gold);
  background: var(--red);
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  display: inline-block;
  margin-top: 0.2rem;
}

/* AI Output */
.ai-output {
  line-height: 1.9;
  font-size: 0.95rem;
  white-space: pre-wrap;
}
.ai-output h3 {
  color: var(--red);
  margin: 1.5rem 0 0.8rem;
  font-size: 1.1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--cream-dark);
}
.ai-output h4 {
  color: var(--ink);
  margin: 1rem 0 0.5rem;
}
.ai-output p { margin-bottom: 0.8rem; }
.ai-output strong { color: var(--red); }
.ai-output ul, .ai-output ol { margin: 0.5rem 0 0.5rem 1.5rem; }
.ai-output li { margin-bottom: 0.3rem; }

/* Loading */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--ink-light);
}
.loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--cream-dark);
  border-top: 3px solid var(--red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cursor-blink::after {
  content: '|';
  animation: blink 0.8s infinite;
  color: var(--red);
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* History */
.history-list { list-style: none; }
.history-item {
  padding: 1rem;
  border-bottom: 1px solid var(--cream-dark);
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.history-item:hover { background: var(--cream); }
.history-item .info { flex: 1; }
.history-item .mode-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  background: var(--red);
  color: var(--gold);
}
.history-item .date { font-size: 0.8rem; color: var(--ink-light); }

/* Nav tabs */
.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.nav-tab {
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  background: white;
  color: var(--ink-light);
  transition: all 0.3s;
}
.nav-tab.active {
  background: var(--red);
  color: var(--gold);
  border-color: var(--red);
}

/* Error */
.error-msg {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* Free hint */
.free-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-top: 0.8rem;
}

/* Pay Card */
.pay-card {
  background: linear-gradient(135deg, #FFF8E7 0%, #FFF0D0 100%);
  border: 2px solid var(--gold);
  text-align: center;
}
.pay-card::before {
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}
.pay-header { margin-bottom: 1rem; }
.pay-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.pay-title { font-size: 1.2rem; font-weight: 700; color: var(--red); letter-spacing: 0.1rem; }
.pay-desc { font-size: 0.85rem; color: var(--ink-light); margin-top: 0.3rem; }
.pay-price { margin: 1rem 0; }
.price-symbol { font-size: 1.2rem; color: var(--red); font-weight: 600; vertical-align: top; }
.price-num { font-size: 2.5rem; font-weight: 900; color: var(--red); }
.pay-btn {
  max-width: 300px;
  margin: 0 auto;
  display: block;
  font-size: 1.1rem;
  padding: 0.9rem 2rem;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,0,0,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(139,0,0,0); }
}

/* 已付费标签 */
.paid-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 600;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-close {
  position: absolute;
  top: 0.8rem; right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink-light);
  line-height: 1;
}
.modal-title {
  font-size: 1.2rem;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.modal-price {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--red);
  margin-bottom: 1rem;
}
.qr-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.qr-tab {
  padding: 0.4rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  background: white;
  color: var(--ink-light);
  transition: all 0.2s;
}
.qr-tab.active {
  background: var(--red);
  color: white;
  border-color: var(--red);
}
.qr-container {
  margin: 0 auto 1rem;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--cream-dark);
  border-radius: 8px;
  overflow: hidden;
}
.qr-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (max-width: 400px) {
  .qr-container {
    width: 260px;
    height: 260px;
  }
}
.qr-placeholder {
  color: var(--ink-light);
  font-size: 0.9rem;
}
.pay-steps {
  text-align: left;
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-bottom: 1.2rem;
  line-height: 1.8;
  padding-left: 0.5rem;
}
.pay-steps .step::before {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  background: var(--gold);
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}

/* Transaction ID help */
.tid-help {
  margin: 0.8rem 0;
  font-size: 0.8rem;
}
.tid-help summary {
  color: var(--red);
  cursor: pointer;
  text-decoration: underline;
}
.tid-help-content {
  margin-top: 0.5rem;
  padding: 0.8rem;
  background: var(--cream);
  border-radius: 6px;
  line-height: 1.8;
  color: var(--ink-light);
  font-size: 0.8rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.75rem;
  color: var(--ink-light);
  border-top: 1px solid var(--cream-dark);
  margin-top: 2rem;
}

/* Responsive */
@media (max-width: 600px) {
  .header h1 { font-size: 1.5rem; letter-spacing: 0.3rem; }
  .header::before, .header::after { display: none; }
  .header .user-info { position: static; transform: none; margin-top: 0.5rem; }
  .card { padding: 1rem; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .date-row { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .input-top-row { gap: 0.6rem; }
  .mode-toggle { flex-direction: row; }
  .mode-btn { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
  .bazi-table .gan, .bazi-table .zhi { font-size: 1.1rem; }
  .dayun-item { width: 75px; }
  .dayun-gz { font-size: 1rem; }
  .liunian-grid { grid-template-columns: repeat(3, 1fr); }
  .wuxing-header { font-size: 0.8rem; gap: 0.5rem; }
  .compat-details { font-size: 0.85rem; }
  .city-select-row { flex-direction: column; }
  .city-select-row select { min-width: 100%; }
  .solar-detail { flex-wrap: wrap; font-size: 0.85rem; }
}

/* ======== 真太阳时 ======== */
.true-solar-row {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--cream-dark);
}

.solar-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.solar-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.solar-toggle-label {
  font-size: 0.9rem;
  color: var(--ink-light);
  font-weight: 600;
}

.solar-toggle input:checked ~ .solar-toggle-label {
  color: var(--red);
}

.solar-options {
  margin-top: 0.6rem;
  padding: 0.8rem;
  background: rgba(139, 0, 0, 0.03);
  border-radius: 8px;
  border: 1px solid var(--cream-dark);
}

.city-select-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.city-select-row select {
  flex: 1;
  padding: 0.5rem 0.6rem;
  border: 1.5px solid var(--cream-dark);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
}

.city-select-row select:focus {
  border-color: var(--gold);
}

.solar-result {
  margin-top: 0.5rem;
}

.solar-detail {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.solar-arrow {
  color: var(--ink-light);
}

.solar-arrow-icon {
  color: var(--gold);
  font-weight: bold;
}

.solar-true-time {
  color: var(--red);
  font-weight: 700;
}

.solar-shichen {
  color: var(--gold);
  font-weight: 600;
}

.solar-breakdown {
  font-size: 0.78rem;
  color: var(--ink-light);
  margin-top: 0.3rem;
  opacity: 0.8;
}

.solar-hint {
  font-size: 0.85rem;
  color: var(--ink-light);
  opacity: 0.7;
}

/* 精确时间输入 */
.exact-time-input {
  display: flex;
  align-items: center;
  gap: 2px;
}

.exact-time-input .time-num {
  width: 48px;
  padding: 0.55rem 0.3rem;
  border: 1.5px solid var(--cream-dark);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  text-align: center;
  outline: none;
}

.exact-time-input .time-num:focus {
  border-color: var(--gold);
}

.exact-time-input .time-sep {
  font-size: 1.2rem;
  color: var(--ink-light);
  font-weight: bold;
  padding: 0 2px;
}

/* 结果页真太阳时标记 */
.true-solar-badge {
  background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(139,0,0,0.05));
  border: 1px solid var(--gold-light);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  color: var(--ink-light);
  margin-bottom: 0.8rem;
  line-height: 1.5;
}
