/* ========================================
   振华经方 · 统一设计令牌层 (zhenhua.css)
   桂林古本《伤寒杂病论》 — 纯CSS变量方案
   零依赖 · 暗底暖金 · 古籍宋体美学
   ======================================== */

/* ── 设计令牌 ── */
:root {
  /* 金色系 */
  --gold:          #f0d060;
  --gold-light:    #f7e48c;
  --gold-dark:     #8b6914;
  --gold-dim:      #6b5010;

  /* 底色系 */
  --bg:            #1a1410;
  --surface:       #241e16;
  --surface-hover: #2e261c;
  --overlay:       rgba(0, 0, 0, 0.5);

  /* 文字系 */
  --text:          #d4c5b2;
  --text-secondary:#b8a080;
  --text-muted:    #9a8a74;

  /* 边框/分隔 */
  --border:        #3d3226;
  --border-gold:   #8b6914;

  /* 字体栈 — 宋体优先，古籍韵味 */
  --font-serif:    'Noto Serif SC', 'STSong', 'Songti SC', 'Source Han Serif SC', 'SimSun', serif;

  /* 圆角 */
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --radius-pill:   50px;

  /* 阴影 */
  --shadow-sm:     0 2px 8px  rgba(0, 0, 0, 0.3);
  --shadow-md:     0 4px 20px rgba(139, 105, 20, 0.4);
  --shadow-gold:   0 4px 20px rgba(240, 208, 96, 0.3);

  /* 过渡 */
  --transition:    0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-serif);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.8;
  font-size: 16px;
}

/* ── 导航（最小JS汉堡）── */
/* ═══ 导航栏 · 最小可靠方案 ═══ */
.nav {
  background: #140e08;
  border-bottom: 1px solid rgba(201,168,76,.15);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  color: #f0d060;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .15em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links a {
  color: #b8a080;
  text-decoration: none;
  font-size: .85rem;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all .3s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px; left: 50%; right: 50%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #f0d060, transparent);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  opacity: 0;
}
.nav-links a:hover::after,
.nav-links a.active::after {
  left: 12px; right: 12px;
  opacity: 1;
}
.nav-links a:hover,
.nav-links a.active {
  color: #f0d060;
  background: rgba(240,208,96,.08);
}

/* 汉堡按钮 - 桌面隐藏 */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 102;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #c9a84c;
  margin: 5px 0;
  border-radius: 2px;
  transition: all .3s cubic-bezier(.4,0,.2,1);
}
/* 汉堡→X动画 */
.nav-toggle.open span:nth-child(1),
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2),
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.open span:nth-child(3),
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── 移动端 ── */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
    position: relative;
    z-index: 103;
  }
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #100a06;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    z-index: 102;
    overflow-y: auto;
    padding: 56px 20px 40px;
  }
  .nav-links.open,
  .nav-links.active {
    display: flex;
  }
  /* 关闭按钮 */
  .nav-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b6914;
    font-size: 1.3rem;
    cursor: pointer;
    border: 1px solid rgba(201,168,76,.18);
    border-radius: 8px;
    background: rgba(26,20,16,.8);
    transition: all 0.3s;
    line-height: 1;
  }
  .nav-close:hover,
  .nav-close:active {
    color: #f0d060;
    border-color: #c9a84c;
    background: rgba(201,168,76,.1);
  }
  .nav-links a {
    font-size: 1.15rem;
    padding: 14px 28px;
    color: #c9a84c;
    letter-spacing: .1em;
  }
  .nav-links a:active {
    color: #f0d060;
    background: rgba(240,208,96,.1);
  }
}


.zhenhua-nav {
  background: linear-gradient(180deg, rgba(36,30,22,0.98), rgba(26,20,16,0.95));
  border-bottom: 1px solid var(--gold-dark);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 100;
}
.zhenhua-nav a {
  color: var(--text-muted);
  text-decoration: none; font-size: 14px;
  padding: 4px 10px; border-radius: 4px;
  transition: all 0.2s;
}
.zhenhua-nav a:hover, .zhenhua-nav a.active {
  color: var(--gold);
  background: rgba(240,208,96,0.08);
}
.zhenhua-nav .nav-brand {
  font-family: var(--font-serif);
  color: var(--gold); font-size: 16px;
  letter-spacing: 2px; margin-right: auto;
}
.zhenhua-nav .nav-toggle { display: none; }
@media (max-width: 768px) {
  .zhenhua-nav { flex-wrap: wrap; }
  .zhenhua-nav .nav-toggle {
    display: flex; flex-direction: column; gap: 4px;
    cursor: pointer; padding: 4px;
  }
  .zhenhua-nav .nav-toggle span {
    width: 20px; height: 2px; background: var(--gold);
    transition: 0.3s;
  }
  .zhenhua-nav .nav-links {
    display: none; width: 100%; flex-direction: column; gap: 4px;
  }
  .zhenhua-nav .nav-links.open,
  .zhenhua-nav .nav-links.active { display: flex; }
}

/* ── 面包屑 ── */
.breadcrumb {
  padding: 12px 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--gold-dark);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { color: var(--gold); }

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

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── 标题层级 ── */
h1 {
  color: var(--gold);
  font-size: 2rem;
  text-align: center;
  letter-spacing: 3px;
  margin-bottom: 0.8rem;
  font-weight: normal;
}

h2 {
  color: var(--gold);
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  font-weight: normal;
}

h3 {
  color: var(--gold);
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  font-weight: normal;
}

p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* ── 卡片 · 通用 ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  display: block;
}

.card:hover {
  border-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card h3 {
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.card p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* ── 卡片网格 ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* ── 按钮 · 通用 ── */
.btn,
button {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold-dark), #a8821e);
  color: var(--bg);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-serif);
  text-decoration: none;
  letter-spacing: 1px;
}

.btn:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dark);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-serif);
  text-decoration: none;
}

.btn-outline:hover {
  background: rgba(139, 105, 20, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── 输入框 · 通用 ── */
input[type="text"],
input[type="search"],
textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-size: 1rem;
  width: 100%;
  transition: all var(--transition);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(240, 208, 96, 0.15);
}

::placeholder {
  color: var(--text-muted);
}

/* ── 标签 ── */
.tag {
  display: inline-block;
  background: rgba(139, 105, 20, 0.15);
  color: var(--gold-dark);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  border: 1px solid rgba(139, 105, 20, 0.25);
}

/* ── 引用块 ── */
blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--gold-dark);
  background: rgba(139, 105, 20, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* ── 表格 ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.95rem;
}

th {
  background: rgba(139, 105, 20, 0.2);
  color: var(--gold);
  font-weight: normal;
}

/* ── 分隔线 ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── 辅助文字 ── */
.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
  line-height: 1.8;
}

.text-muted { color: var(--text-muted); }
.text-gold  { color: var(--gold); }
.text-center { text-align: center; }

/* ── 链接通用 ── */
a {
  color: var(--gold-dark);
  transition: color var(--transition);
}
a:hover {
  color: var(--gold);
}

/* ── 图片 ── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── 页脚 · 统一 ── */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.site-footer p {
  margin: 0.3rem 0;
  color: var(--text-muted);
}

/* ── 响应式 ── */
@media (max-width: 768px) {

  .container,
  .container-narrow {
    padding: 1.5rem 1rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }

  .cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.4rem; letter-spacing: 2px; }
  .card { padding: 1.2rem; }
}

/* ── 打印 ── */
@media print {
  .nav, .site-footer { display: none; }
  body { background: white; color: black; }
}

/* ── 焦点可见（无障碍） ── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── 动画 ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* ══════════════════════════════════════════════════════════════
   合并自 style.css — Hero / Section / Walls
   ══════════════════════════════════════════════════════════════ */

/* Hero区域 */
.hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  background: linear-gradient(180deg, var(--bg), var(--surface));
}
.hero h1 {
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(240, 208, 96, 0.3);
  font-weight: normal;
}
.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}
.hero .btn {
  display: inline-block;
  padding: 1rem 3rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg);
  font-size: 1.3rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}
.hero .btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

/* 通用区块 */
.section {
  padding: 3rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.section h2 {
  color: var(--gold);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: normal;
}
.section h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--gold-dark);
  margin: 1rem auto;
}

/* 壁垒样式 */
.walls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.wall {
  background: rgba(42, 31, 20, 0.6);
  border-left: 3px solid var(--gold-dark);
  padding: 1rem;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.wall:hover {
  border-left-color: var(--gold);
  background: rgba(42, 31, 20, 0.8);
}
.wall strong {
  color: var(--gold);
  display: block;
  margin-bottom: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════
   合并自 wechat-theme.css — 聊天/选中/六经/标签/动画
   ══════════════════════════════════════════════════════════════ */

/* 聊天气泡 */
.bubble-self {
  background: #3d2e1a;
  color: var(--text);
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
  padding: 10px 14px;
  max-width: 75%;
  align-self: flex-end;
}
.bubble-other {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
  padding: 10px 14px;
  max-width: 75%;
  align-self: flex-start;
}

/* 选中态 */
.selected {
  background: var(--gold) !important;
  color: var(--bg) !important;
  border-color: var(--gold) !important;
}

/* 标签变体 */
.tag-green {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 12px;
}
.tag-gold {
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold-light);
  border: 1px solid rgba(139, 105, 20, 0.3);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  font-size: 12px;
}

/* 卡片强调 */
.card-accent { border-left: 3px solid var(--gold); }
.card-gold   { border-left: 3px solid var(--gold); }

/* 六经区块（金色梯度） */
.jing-taiyang  { border-color: #f0d060; background: rgba(240, 208, 96, 0.08); }
.jing-taiyang h2, .jing-taiyang .meridian-name { color: #f0d060; }
.jing-yangming { border-color: #dcc050; background: rgba(220, 192, 80, 0.08); }
.jing-yangming h2, .jing-yangming .meridian-name { color: #dcc050; }
.jing-shaoyang { border-color: #c9a84c; background: rgba(201, 168, 76, 0.08); }
.jing-shaoyang h2, .jing-shaoyang .meridian-name { color: #c9a84c; }
.jing-taiyin   { border-color: #a88838; background: rgba(168, 136, 56, 0.08); }
.jing-taiyin h2, .jing-taiyin .meridian-name { color: #a88838; }
.jing-shaoyin  { border-color: #8b6914; background: rgba(139, 105, 20, 0.08); }
.jing-shaoyin h2, .jing-shaoyin .meridian-name { color: #8b6914; }
.jing-jueyin   { border-color: #6b5010; background: rgba(107, 80, 16, 0.08); }
.jing-jueyin h2, .jing-jueyin .meridian-name { color: #6b5010; }

/* 载入动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.loading-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(26, 20, 16, 0.92); z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.loading-icon {
  width: 48px; height: 48px;
  border: 3px solid rgba(240, 208, 96, 0.2);
  border-top: 3px solid var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 24px;
}
.loading-title { color: var(--gold); font-size: 1.2rem; margin-bottom: 8px; }
.loading-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; }
.loading-dots { display: flex; gap: 8px; margin-bottom: 16px; }
.loading-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); animation: pulse 1.4s ease-in-out infinite;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }
.loading-step { color: var(--text-muted); font-size: 0.85rem; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

/* 时间分隔 */
.time-divider {
  text-align: center; font-size: 11px; color: var(--text-muted);
  padding: 6px 0;
}

/* 发送按钮 */
.send-btn {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--bg);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.send-btn:hover { box-shadow: var(--shadow-md); }
.send-btn:active { transform: scale(0.94); }
.send-btn:disabled {
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--surface);
  box-shadow: none;
}

/* 语音按钮 */
.voice-btn {
  background: none; border: 1px solid var(--border);
  color: var(--gold); border-radius: 50%;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

/* 倒计时 */
.countdown {
  font-size: 13px; color: var(--text-secondary);
  padding: 4px 0; text-align: center;
}

/* 医生消息 */
.doctor-msg { color: var(--text); }
.patient-msg { color: var(--text); }

/* 移动端全屏菜单优化 */
@media (max-width: 768px) {
  .nav-links a {
    display: block; width: 80%; text-align: center;
    font-size: 1.2rem; padding: 16px 24px;
    border: 1px solid rgba(201,168,76,.15);
    border-radius: 12px;
    color: #c9a84c; letter-spacing: .12em;
    transition: all .3s;
  }
  .nav-links a:active, .nav-links a.active {
    background: rgba(240,208,96,.12);
    border-color: #f0d060;
    color: #f0d060;
  }
}

/* ══════ 卡片hover金辉 ══════ */
.card {
  transition: transform .3s cubic-bezier(.4,0,.2,1),
              box-shadow .3s cubic-bezier(.4,0,.2,1),
              border-color .3s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(201,168,76,.12);
  border-color: rgba(201,168,76,.3);
}
