/* ============================================
   划火柴 · 风水命理工具
   移动端优先 · 竖屏卡片式（快手/抖音风格）
   ============================================ */

/* ===== 设计变量 ===== */
:root {
  --bg:        #F5F1EA;   /* 暖米白 */
  --card:      #FFFFFF;   /* 卡片白 */
  --ink:       #2B2622;   /* 墨黑主文字 */
  --ink-2:     #6E6459;   /* 次级文字 */
  --ink-3:     #A89E91;   /* 弱化文字 */
  --line:      #ECE5DA;   /* 分割线 */
  --accent:    #C0392B;   /* 朱砂红（火柴火光） */
  --accent-2:  #E8A33D;   /* 暖橙（火苗） */
  --soft:      #FBF8F3;   /* 浅底 */
  --good:      #2E7D32;
  --bad:       #C0392B;
  --mid:       #B8860B;
  --warm-beige:#F5EBDC;   /* 暖米色（表格表头） */
  --text-secondary:#6E6459; /* 次级文字 */
  --text-light:#A89E91;   /* 弱化文字 */
  --border:    #ECE5DA;   /* 分割线 */
  --radius:    16px;
  --header-h:  56px;
  --tab-h:     44px;
  --footer-h:  52px;
  --safe-top:  env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}


/* ===== 大字号模式（50-80岁人群适配） ===== */
html.font-large { font-size: 20px; }
html.font-large .mod-tab { font-size: 0.95rem; }
html.font-large .mod-btn { font-size: 1.1rem; }
html.font-large .mod-input-row input,
html.font-large .mod-input-row select { font-size: 1.1rem; }
html.font-large .dot { width: 8px; height: 8px; }
html.font-large .dot.active { width: 22px; }
/* 大字号下正文与标题层级同步放大，保证可读性 */
html.font-large .mod-panel h3 { font-size: 1.6rem; }
html.font-large .mod-panel h3 small { font-size: 1.05rem; }
html.font-large .mod-panel > p,
html.font-large .analysis-note,
html.font-large .term-item p,
html.font-large .mod-panel .gujing-note,
html.font-large .mod-panel .gujing-src { font-size: 1.12rem; }
html.font-large .mod-panel .gujing-box { line-height: 2.05; }

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans CJK SC", "MiSans", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 1.15rem;
  line-height: 1.72;
  letter-spacing: 0.012em;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
  color: var(--ink);
  background: var(--bg);
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  -webkit-user-select: none;
}
input, select, textarea, button { font-family: inherit; user-select: auto; -webkit-user-select: auto; touch-action: manipulation; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }

/* ===== 顶部品牌栏 ===== */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(245,241,234,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-top: var(--safe-top);
  border-bottom: 1px solid var(--line);
}
.brand-bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(192,57,43,0.3);
}
.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.brand-sub {
  font-size: 0.85rem;
  color: var(--ink-3);
  letter-spacing: 0.18em;
  line-height: 1.2;
}
.brand-tag {
  font-size: 0.9rem;
  color: var(--accent);
  border: 1px solid rgba(192,57,43,0.35);
  background: rgba(192,57,43,0.06);
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ===== 工具分类 tab（默认网格看全 + 可折叠横向滚动） ===== */
.cat-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  position: relative;
}
.cat-tabs-scroll {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.mod-tab {
  border: none;
  background: #fff;
  color: var(--ink-2);
  font-size: 0.95rem;
  padding: 8px 2px;
  border-radius: 10px;
  cursor: pointer;
  white-space: normal;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 1px 4px rgba(43,38,34,0.06);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.mod-tab.active {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(43,38,34,0.25);
}
/* 折叠成一行横向滚动 */
.cat-tabs.collapsed .cat-tabs-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-tabs.collapsed .cat-tabs-scroll::-webkit-scrollbar { display: none; }
.cat-tabs.collapsed .mod-tab {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 1rem;
  padding: 6px 14px;
  border-radius: 20px;
}
/* 全部/收起按钮 */
.tab-all {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(43,38,34,0.06);
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}
.tab-all.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== 竖屏卡片容器 ===== */
.cards {
  position: fixed;
  top: calc(var(--header-h) + var(--tab-h) + var(--safe-top));
  bottom: calc(var(--footer-h) + var(--safe-bottom));
  left: 0; right: 0;
  overflow: hidden;
}
.mod-panel {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  padding: 18px 18px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  contain: layout paint style;
  opacity: 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.3, 1), opacity 0.24s ease;
  pointer-events: none;
  visibility: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(184,134,11,0.35) transparent;
}
.mod-panel.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}
/* 滑动中的相邻卡片 */
.mod-panel.prev { transform: translateY(-100%); }
.mod-panel.next { transform: translateY(100%); }
/* 面板内滚动条（WebKit） */
.mod-panel::-webkit-scrollbar { width: 5px; }
.mod-panel::-webkit-scrollbar-thumb { background: rgba(184,134,11,0.35); border-radius: 4px; }
.mod-panel::-webkit-scrollbar-track { background: transparent; }
/* 切换动画期间临时提升合成层（app.js goTo 动态添加/移除） */
.mod-panel.gx-anim { will-change: transform, opacity; }

/* ===== 卡片内容排版 ===== */
.mod-panel h3 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-wrap: balance;
  margin-bottom: 2px;
}
.mod-panel h3 small {
  display: block;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--ink-3);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.mod-panel > p {
  font-size: 1rem;
  color: var(--ink-2);
  margin: 10px 0 16px;
  line-height: 1.85;
  letter-spacing: 0.012em;
  overflow-wrap: break-word;
}

/* ===== 输入区 ===== */
.mod-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 2px 12px rgba(43,38,34,0.05);
  margin-bottom: 14px;
}
.mod-input-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.95rem;
  color: var(--ink-2);
  flex: 1 1 auto;
  min-width: 90px;
}
.mod-input-row label > span { font-size: 0.95rem; color: var(--ink-2); }
.mod-input-row input,
.mod-input-row select {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--soft);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1.15rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.mod-input-row select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236E6459' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.mod-input-row input:focus,
.mod-input-row select:focus { border-color: var(--accent); }

/* ===== 按钮 ===== */
.mod-btn {
  flex: 1 1 100%;
  border: none;
  background: linear-gradient(135deg, var(--accent), #D9534F);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 13px 20px;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 14px rgba(192,57,43,0.28);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.mod-btn:active { transform: scale(0.97); }
.mod-btn-red {
  background: linear-gradient(135deg, var(--accent), #D9534F);
}
.mod-btn[style*="linear-gradient"] { background: linear-gradient(135deg, #6B4E0A, #8B6914) !important; }

/* ===== 输出区 ===== */
#bazi-output, #jinsuo-output, #fashi-output, #zhuyou-output,
#fulu-output, #flying-output, #zeri-output, #bazhai-output,
#sanyao-output, #zibai-output, #sanhe-output, #cuiguan-output,
#ershibaxiu-output, #luopan-output, #sanyuan-output {
  margin-top: 4px;
}
#fulu-output { text-align: center; }

/* ===== 底部指示器 ===== */
.app-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(245,241,234,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding-bottom: var(--safe-bottom);
  border-top: 1px solid var(--line);
}
.footer-inner {
  height: var(--footer-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.dots {
  display: flex;
  gap: 5px;
  align-items: center;
  overflow: hidden;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 3px;
  background: #D8D0C4;
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.dot.active {
  width: 18px;
  background: var(--accent);
}
.footer-note {
  font-size: 0.9rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.footer-note b { color: var(--accent); font-weight: 600; }

/* ===== 底部当前模块名 ===== */
.footer-modname {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 首屏滑动引导 ===== */
.swipe-hint {
  position: fixed;
  top: calc(var(--header-h) + var(--tab-h) + var(--safe-top) + 30px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(43,38,34,0.85);
  color: #fff;
  border-radius: 999px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(43,38,34,0.3);
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.swipe-hint.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.swipe-hint.hide { opacity: 0; transform: translateX(-50%) translateY(-10px); }
.swipe-hint-arrow {
  font-size: 1.3rem;
  animation: swipe-bounce 1.2s ease-in-out infinite;
}
@keyframes swipe-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ===== 最近使用快捷栏 ===== */
.recent-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 8px;
  overflow: hidden;
}
.recent-label {
  flex-shrink: 0;
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.recent-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.recent-list::-webkit-scrollbar { display: none; }
.recent-chip {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 0.95rem;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(43,38,34,0.06);
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}
.recent-chip:active { background: var(--soft); }
.recent-chip .recent-chip-x {
  margin-left: 4px;
  color: var(--ink-3);
  font-size: 0.9rem;
}

/* ===== 术语白话速查面板 ===== */
.term-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 240;
  background: rgba(43,38,34,0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.term-mask.open { opacity: 1; visibility: visible; pointer-events: auto; }

.term-panel {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 250;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(43,38,34,0.2);
  transform: translateY(105%);
  transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
}
.term-panel.open { transform: translateY(0); }
.term-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.term-panel-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 18px 20px;
}
.term-item {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.term-item:last-child { border-bottom: none; }
.term-item b {
  color: var(--accent);
  font-size: 1.05rem;
  display: block;
  margin-bottom: 2px;
}
.term-item p {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.7;
}



/* ===== 罗盘模块 ===== */
#mod-luopan2 canvas {
  border-radius: 50%;
  box-shadow: 0 6px 24px rgba(43,38,34,0.18);
  max-width: 100%;
  touch-action: none;
}
#lp2-detail {
  background: var(--card) !important;
  border-radius: 12px !important;
  padding: 14px !important;
  font-size: 1rem !important;
  line-height: 1.9 !important;
  box-shadow: 0 2px 10px rgba(43,38,34,0.06);
}
#lp2-indicator, #lp2-orientation-note {
  font-size: 0.95rem !important;
  color: var(--ink-3) !important;
  text-align: center;
  margin-top: 8px;
}

/* ===== 算法输出通用样式 ===== */
.analysis-note {
  background: var(--soft);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 1rem;
  color: var(--ink-2);
  margin: 10px 0;
}
.tag-good { color: var(--good); font-weight: 600; }
.tag-bad  { color: var(--bad);  font-weight: 600; }
.tag-mid  { color: var(--mid);  font-weight: 600; }

/* 八字 */
.bazi-result {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 12px rgba(43,38,34,0.05);
  margin-top: 12px;
}
.bazi-pillar {
  display: flex;
  justify-content: space-around;
  text-align: center;
  margin: 10px 0;
}
.bazi-label {
  font-size: 0.95rem;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.bazi-tg {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--accent);
}
.bazi-dz {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
}
.five-ele-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  margin: 4px 0 10px;
}
.five-ele-bar > div {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* 飞星九宫 */
.flying-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 2px 12px rgba(43,38,34,0.05);
  margin-top: 12px;
}
.flying-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  border-radius: 10px;
  font-size: 1rem;
  color: var(--ink-2);
}
.flying-cell .star-num {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
}
.flying-cell .star-num[style*="red"], .flying-cell .star-num[style*="Red"] { color: var(--bad) !important; }
.flying-cell .star-num[style*="blue"], .flying-cell .star-num[style*="Blue"] { color: #1E5AA8 !important; }

/* 金锁玉关 */
.shanshui-verse {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 12px rgba(43,38,34,0.05);
  margin-top: 12px;
  font-size: 1.05rem;
  line-height: 2;
}

/* 祝由术 */
.zhu-card {
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(43,38,34,0.04);
  cursor: pointer;
  transition: all 0.2s;
}
.zhu-card:active { transform: scale(0.98); }
.zhu-sub {
  font-size: 0.95rem;
  color: var(--ink-3);
  margin-top: 2px;
}
.zhu-body {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.9;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

/* 择日表格 */
.zeri-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(43,38,34,0.05);
  margin-top: 12px;
  font-size: 1rem;
}
.zeri-table th, .zeri-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.zeri-table th {
  background: var(--soft);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 0.95rem;
}

/* 灵符 */
.talisman-canvas {
  max-width: 100%;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(43,38,34,0.1);
}

/* 方向 */
.dir { font-weight: 700; color: var(--accent); }

/* ===== 桌面端适配（居中手机宽度） ===== */
@media (min-width: 560px) {
  body { background: #E8E1D6; }
  .app-header, .app-footer, .cards {
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
  }
  .app-header, .app-footer {
    box-shadow: 0 0 30px rgba(43,38,34,0.12);
  }
  .cards {
    box-shadow: 0 0 40px rgba(43,38,34,0.15);
    background: var(--bg);
  }
}

/* ============================================
   叠加模块样式（古籍问答 · 科普文章 · 语音播报）
   仅新增，不影响源站 16 模块布局
   ============================================ */

/* 通用卡片（科普文章列表 / 欢迎区） */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 14px;
  box-shadow: 0 2px 10px rgba(43,38,34,0.06);
  margin-bottom: 12px;
}

/* 通用标签 */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  line-height: 1.5;
  vertical-align: middle;
}
.tag-free  { background: var(--soft);   color: var(--ink-2); border: 1px solid var(--line); }
.tag-vip   { background: var(--accent); color: #fff; }

/* 通用表单控件 */
.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
}
.form-control:focus { border-color: var(--accent-2); }

/* 通用按钮 */
.btn {
  display: inline-block;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.4;
  cursor: pointer;
  text-align: center;
  background: var(--soft);
  color: var(--ink);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-gold    { background: var(--accent-2); color: #fff; }
.btn-sm      { padding: 6px 12px; font-size: 0.9rem; border-radius: 8px; }

/* 布局工具 */
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.page-title   { font-size: 17px; font-weight: 700; color: var(--ink); }
.text-light   { color: var(--ink-3); }
.empty        { text-align: center; color: var(--ink-3); padding: 24px 0; font-size: 0.95rem; }
.hidden       { display: none !important; }
.mt16         { margin-top: 16px; }

/* 分类筛选条 */
.cat-filter, #cat-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  font-size: 13px;
  padding-bottom: 2px;
}
#cat-filter .tag { cursor: pointer; }

/* 古籍问答 */
.qa-input-row { display: flex; gap: 8px; }
.qa-result    { margin-top: 12px; }
.qa-question  {
  font-weight: 600;
  color: var(--ink);
  background: var(--soft);
  border-left: 3px solid var(--accent-2);
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  font-size: 0.98rem;
}
.qa-answer {
  margin-top: 10px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.85;
  white-space: normal;
  word-break: break-word;
}
.qa-tts-wrap { margin-top: 12px; }

/* 语音播报控件（tts.js GX_TTS） */
.tts-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.tts-btn {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
}
.tts-rate {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.tts-rate input[type="range"] { width: 90px; accent-color: var(--accent); }
.tts-voice {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.85rem;
  background: #fff;
  color: var(--ink);
  max-width: 140px;
}
/* 重播按钮：大尺寸 + 高亮配色，视觉强化 */
.tts-replay {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
  padding: 10px 22px;
  font-size: 1.05rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(192,57,43,0.35);
  margin-left: auto;
}

/* 底部免责声明（renderFooter 动态生成） */
.footer-disclaimer {
  padding: 12px 16px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: center;
  background: var(--soft);
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

/* ============================================================
   体验优化层（2026-08-21，仅叠加，不改动上方原有规则）
   目标：中文可读性 + 操作流畅度。整体风格与内容保持不变。
   ============================================================ */
/* 通用按钮：补充点击反馈（轻按回弹），与 mod-btn 手感统一 */
.btn { transition: transform 0.16s ease, box-shadow 0.22s ease, background-color 0.22s ease; }
.btn:active, .tab-all:active { transform: scale(0.95); }
.mod-tab:active { transform: scale(0.94); }
.tts-btn:active { transform: scale(0.93); }
.recent-chip:active { transform: scale(0.95); }

/* 弹出面板/提示：合成层提升，动画更顺滑 */
.term-panel, .term-mask, .swipe-hint { will-change: transform, opacity; }
.term-panel-body { overscroll-behavior: contain; }

/* 会员面板：全屏遮罩 + 卡片淡入上浮（显隐行为不变，仅加过渡） */
#member-panel { opacity: 0; visibility: hidden; transition: opacity 0.25s ease, visibility 0.25s ease; }
#member-panel.open { opacity: 1; visibility: visible; }
#member-panel > div { transform: scale(0.94) translateY(12px); transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1); }
#member-panel.open > div { transform: scale(1) translateY(0); }

/* 细滚动条：滚动手感与视觉统一（PC 端可见，移动端隐藏滚动条） */
.mod-panel::-webkit-scrollbar, .term-panel-body::-webkit-scrollbar { width: 6px; height: 6px; }
.mod-panel::-webkit-scrollbar-thumb, .term-panel-body::-webkit-scrollbar-thumb { background: #d8cdbb; border-radius: 999px; }
.mod-panel::-webkit-scrollbar-track, .term-panel-body::-webkit-scrollbar-track { background: transparent; }
@media (hover: none) {
  .mod-panel::-webkit-scrollbar, .term-panel-body::-webkit-scrollbar { display: none; }
}

/* 滑动切换卡片：动画期间合成层已由 .gx-anim 提升，此处补过渡的负向缓冲起点，手感更跟手 */
.mod-panel { transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.3s ease; }

/* 页脚版权行与备案号占位（privacy.html / terms.html / index.html 通用） */
.footer-copyright { margin-top: 0.5rem; font-size: 0.92rem; color: var(--text-light); }
.footer-links { margin-top: 0.5rem; font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.footer-links a { color: var(--accent); text-decoration: none; }
.footer-beian { margin-top: 0.3rem; font-size: 0.85rem; color: var(--text-light); }
.footer-beian a { color: var(--text-light); text-decoration: none; }
