:root {
  --bg: #F6EFE3;
  --card: #FFFDF6;
  --red: #C03A2B;
  --red-deep: #7E1510;
  --gold: #D9A441;
  --gold-cream: #E8C887;
  --gold-light: #F2D8A0;
  --gold-soft: #F7E7C0;
  --ink: #3A2A1E;
  --ink-2: #6B5D4F;
  --muted: #9A8B78;
  --muted-2: #8C7B6B;
  --input-bg: #F7F1E6;
  --input-border: #E8DCC3;
  --placeholder: #B8A88F;
  --tag-red-bg: #FBEDE7;
  --tag-gray-bg: #F3EEE5;
  --shadow: 0 4px 12px rgba(58,42,30,0.06);
  --r: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  background: #2A2520;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 0;
}
.page {
  width: 100%;
  max-width: 840px;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ====== Hero ====== */
.hero {
  background: linear-gradient(to bottom, #BF3024, #7E1510);
  padding: 24px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  color: #F6EFE3;
}
.hero-nav {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hero-brand { font-size: 22px; font-weight: 700; color: var(--gold-light); }
.hero-loc { display: flex; align-items: center; gap: 4px; }
.hero-loc-text { font-size: 14px; font-weight: 500; color: var(--gold-light); }
.hero-date {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.hero-seal {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--gold);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
}
.hero-seal-text { font-size: 22px; font-weight: 700; color: var(--gold-cream); line-height: 1; }
.hero-lunar-big { font-size: 40px; font-weight: 700; color: var(--gold-soft); line-height: 1.1; }
.hero-lunar-sub { font-size: 13px; font-weight: 500; color: var(--gold-cream); }
.hero-solar { font-size: 15px; font-weight: 500; color: #F6EFE3; }
.hero-chips { display: flex; gap: 10px; align-items: center; }
.chip {
  display: flex; align-items: center;
  padding: 6px 12px;
  border-radius: var(--r);
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.chip-yi { background: rgba(255,255,255,0.14); border: 1px solid rgba(242,216,160,0.7); color: #FFE9C4; }
.chip-ji { background: rgba(0,0,0,0.18); border: 1px solid rgba(255,255,255,0.25); color: #E4D3BC; }
.hero-ganzhi { font-size: 12px; color: #E3CDAF; }

/* ====== Content ====== */
.content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
  align-items: start;
  flex: 1;
}
.card {
  background: var(--card);
  border-radius: var(--r);
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.card-title-row {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%;
}
.card-title-left { display: flex; align-items: center; gap: 8px; }
.title-bar { width: 4px; height: 18px; border-radius: 2px; background: var(--red); }
.card-title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0; }
.card-title-tag { font-size: 12px; font-weight: 500; color: var(--placeholder); }

/* 视觉隐藏但搜索引擎/屏幕阅读器可见（用于首页 h1） */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* 首页底部内链区（热门专题/月份/年度/搜索词）—— 与主题 .tag 配色一致 */
.home-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}
.home-links a {
  display: block;
  padding: 9px 12px;
  background: var(--tag-gray-bg);
  border-radius: var(--r);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .15s, color .15s, border-color .15s;
}
.home-links a:hover {
  background: var(--tag-red-bg);
  color: var(--red);
  border-color: var(--gold);
}
.home-links a:active { opacity: 0.7; }
@media (min-width: 768px) {
  .home-links { grid-template-columns: repeat(4, 1fr); }
}

.home-faq { width: 100%; }
.faq-item { padding: 10px 0; border-bottom: 1px dashed var(--input-border); }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 6px; line-height: 1.5; }
.faq-q::before { content: "Q "; color: var(--red); font-weight: 700; }
.faq-a { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.faq-a p { margin: 0 0 8px; }
.faq-more { display: inline-block; margin-top: 4px; color: var(--red); font-size: 13px; font-weight: 500; text-decoration: none; }

/* 快捷功能 */
.quick-grid {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%;
}
.quick-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.quick-tile svg { width: 24px; height: 24px; }
.quick-tile-label { font-size: 12px; font-weight: 500; color: var(--ink); }

/* 宜忌 */
.yiji-cols { display: flex; gap: 12px; width: 100%; }
.yiji-col { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.tag-label {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: var(--r);
  font-size: 13px; font-weight: 700; color: #FFFDF6;
  align-self: flex-start;
}
.tag-label-yi { background: var(--red); }
.tag-label-ji { background: var(--ink); }
.tag-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 5px 10px; border-radius: var(--r);
  font-size: 12px; font-weight: 500;
}
.tag-yi { background: var(--tag-red-bg); color: var(--red); }
.tag-ji { background: var(--tag-gray-bg); color: var(--muted-2); }

/* 生肖运势 / 吉神凶煞 */
.zodiac-row { display: flex; gap: 16px; align-items: center; }
.zodiac-badge {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--tag-red-bg);
  border: 1.5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.zodiac-badge-text { font-size: 28px; font-weight: 700; color: var(--red); }
.zodiac-info { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.zodiac-title { font-size: 13px; font-weight: 500; color: var(--muted); }
.zodiac-score-row { display: flex; align-items: baseline; gap: 4px; }
.zodiac-score { font-size: 30px; font-weight: 700; color: var(--red); line-height: 1; }
.zodiac-score-unit { font-size: 13px; color: var(--muted); }
.zodiac-luck { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* 吉时 */
.jishi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.jishi-item {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--r);
  padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.jishi-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.jishi-name { font-size: 15px; font-weight: 700; color: var(--ink); }
.jishi-time { font-size: 11px; color: var(--muted); margin-top: 1px; }
.jishi-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  white-space: nowrap; flex-shrink: 0;
}
.jishi-badge-ji { background: var(--tag-red-bg); color: var(--red); }
.jishi-badge-xiong { background: var(--tag-gray-bg); color: var(--muted-2); }
.jishi-row { font-size: 11px; color: var(--muted-2); line-height: 1.5; }
.jishi-row b { color: var(--ink-2); font-weight: 500; }
.jishi-row .lbl { color: var(--muted); }
.jishi-yi { color: var(--red); }
.jishi-ji-text { color: var(--muted-2); }

/* 黄历详情 */
.info-cols { display: flex; gap: 16px; width: 100%; }
.info-col { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-label { font-size: 11px; color: var(--muted); }
.info-value { font-size: 14px; font-weight: 500; color: var(--ink); }

/* 表单 */
.form-block { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.form-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input-row { display: flex; gap: 8px; width: 100%; }
.input {
  flex: 1; height: 34px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--r);
  padding: 0 12px;
  font-size: 13px; color: var(--ink);
  line-height: 32px; /* 34px - 上下 border 各 1px，保证文字垂直居中 */
}
.input::placeholder { color: var(--placeholder); }
.input-row .input { width: 100%; }

/* input / select 原生元素微调：统一高度、行高与垂直对齐 */
input.input, select.input {
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  font-family: inherit;
  min-width: 0;
  display: block;
  height: 34px;
  line-height: 32px;
  vertical-align: middle;
}
input.input:focus, select.input:focus { border-color: var(--red); }
select.input {
  cursor: pointer;
  padding: 0 32px 0 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%239A8B78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}
input[type="date"].input { -webkit-appearance: none; }

.dropdown { display: flex; justify-content: space-between; }
.dropdown svg { width: 16px; height: 16px; }
.btn-primary {
  width: 100%; height: 35px;
  background: linear-gradient(to right, #BF3024, #991F16);
  border: none; border-radius: var(--r);
  color: var(--card);
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-top: 8px;
}

/* 择日结果 */
.result-block { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.result-item {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--r);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 5px;
}
.result-top { display: flex; justify-content: space-between; align-items: center; }
.result-date { font-size: 15px; font-weight: 700; color: var(--red); }
.result-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px;
  white-space: nowrap;
}
.badge-ji { background: var(--tag-red-bg); color: var(--red); }
.badge-xiong { background: var(--tag-gray-bg); color: var(--muted-2); }
.result-sub { font-size: 12px; color: var(--muted); }
.result-yi { font-size: 12px; color: var(--ink-2); }
.result-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 10px; }
.form-result { width: 100%; display: flex; flex-direction: column; gap: 12px; }

/* ====== 择日标签切换 ====== */
.ziji-tabs {
  display: flex; gap: 6px; width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--r);
  padding: 4px;
}
.ziji-tab {
  flex: 1; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 14px; font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.ziji-tab-active {
  background: linear-gradient(to right, #BF3024, #991F16);
  color: var(--card);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(122,25,16,0.25);
}
.ziji-panel { display: none; flex-direction: column; gap: 12px; width: 100%; }
.ziji-panel-active { display: flex; }

/* 合婚评估 */
.hehun-block {
  width: 100%;
  background: var(--tag-red-bg);
  border: 1px solid var(--gold);
  border-radius: var(--r);
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.hehun-title { font-size: 14px; font-weight: 700; color: var(--red); }
.hehun-score-row { display: flex; align-items: baseline; gap: 10px; }
.hehun-level { font-size: 22px; font-weight: 700; color: var(--red); line-height: 1; }
.hehun-score { font-size: 15px; font-weight: 700; color: var(--gold); }
.hehun-reasons { font-size: 12px; color: var(--ink-2); line-height: 1.6; }

/* ====== Bottom Nav ====== */
.bottom-nav {
  width: 100%;
  padding: 8px 10px 12px;
}
.nav-pill {
  width: 100%; height: 40px;
  background: var(--card);
  border: 1px solid #E8DCC3;
  border-radius: var(--r);
  display: flex; gap: 4px;
  padding: 4px;
  align-items: center;
  box-shadow: 0 4px 16px rgba(58,42,30,0.08);
}
.nav-tab {
  flex: 1; height: 100%;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 10px; font-weight: 500;
  color: var(--muted);
}
.nav-tab-active {
  background: linear-gradient(to right, #BF3024, #991F16);
  color: var(--card);
}
.nav-tab svg { width: 18px; height: 18px; }
/* 快捷功能与底部导航交互 */
.quick-tile { cursor: pointer; }
.quick-tile:active { opacity: 0.7; }
.nav-tab { cursor: pointer; }
.nav-tab svg, .nav-tab svg * { stroke: #9A8B78; }
.nav-tab-active svg, .nav-tab-active svg * { stroke: #FFFDF6; }

/* ====== 日期翻页导航 ====== */
.date-nav {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%;
}
.date-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 14px;
  border-radius: var(--r);
  border: 1px solid rgba(242,216,160,0.7);
  background: rgba(255,255,255,0.12);
  color: #FFE9C4;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.date-nav-btn:hover { background: rgba(255,255,255,0.2); }
.date-nav-form { display: flex; }
.date-nav-input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(242,216,160,0.7);
  border-radius: var(--r);
  background: rgba(255,255,255,0.9);
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.date-nav-today {
  display: inline-flex; align-items: center;
  font-size: 12px; color: var(--gold-light);
  text-decoration: none;
  margin-top: -6px;
}
.date-nav-today:hover { text-decoration: underline; }

/* ====== 滚轮选择器 ====== */
.picker-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 34px;
  padding: 0 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--r);
  cursor: pointer;
  flex: 1; min-width: 0;
}
.picker-trigger-text {
  font-size: 13px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.picker-trigger-text.is-placeholder { color: var(--placeholder); }
.picker-trigger svg { width: 16px; height: 16px; flex-shrink: 0; }

.wheel-mask {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 9999;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.wheel-mask-show { opacity: 1; visibility: visible; }
.wheel-panel {
  width: 100%; max-width: 840px;
  background: var(--card);
  border-radius: var(--r) var(--r) 0 0;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  overflow: hidden;
}
.wheel-mask-show .wheel-panel { transform: translateY(0); }
.wheel-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--input-border);
}
.wheel-btn { font-size: 15px; cursor: pointer; }
.wheel-cancel { color: var(--muted); }
.wheel-confirm { color: var(--red); font-weight: 700; }
.wheel-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.wheel-body {
  position: relative;
  padding: 16px 0;
}
.wheel-columns { display: flex; }
.wheel-col {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.wheel-list {
  will-change: transform;
}
.wheel-item {
  height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}
.wheel-item-active {
  color: var(--ink);
  font-weight: 700;
  font-size: 18px;
}
.wheel-indicator {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  border-top: 1px solid var(--input-border);
  border-bottom: 1px solid var(--input-border);
  pointer-events: none;
}

/* ====== 吉日专题入口（与列表页「更多吉日专题」统一样式） ====== */
.topic-entry { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.topic-entry a {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 12px;
  border-radius: var(--r);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.topic-entry a:hover { border-color: var(--red); color: var(--red); }

/* 全年吉日入口按钮 */
.year-link-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 5px 12px;
  border-radius: 14px;
  background: linear-gradient(to right, #BF3024, #991F16);
  color: #FFFDF6;
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(122,25,16,0.25);
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}
.year-link-btn:hover { opacity: 0.88; }

/* ====== 响应式布局（H5 自适应，单列） ====== */
/* 平板及以上：加宽内边距，保持单列 */
@media (min-width: 768px) {
  .content {
    padding: 24px;
    gap: 14px;
  }
  .card { padding: 18px; }
  .hero { padding: 32px 24px 36px; }
  .bottom-nav { padding: 16px 20px 20px; }
  .nav-pill { height: 52px; }
  .nav-tab { font-size: 13px; }
  .topic-entry { grid-template-columns: repeat(8, 1fr); gap: 10px; }
  .topic-entry a { padding: 8px 4px; font-size: 12px; }
}
