/* 九年级上册古诗文 · 大字拼音版 —— 米黄宣纸护眼风格 */
:root {
  --bg: #f4ecd6;
  --bg-deep: #eadfc4;
  --ink: #3b2e1d;
  --ink-soft: #6b5a3f;
  --accent: #8a5a3b;
  --accent-dark: #6f452c;
  --line: #d9c9a3;
  --btn-disabled-bg: #ddd3ba;
  --btn-disabled-fg: #a4967c;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  min-height: 100vh;
}

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px calc(110px + env(safe-area-inset-bottom));
}

/* ---------- 顶部标题 ---------- */
.page-head {
  text-align: center;
  margin: 4px 0 22px;
}

.page-head .site-title {
  margin: 0;
  font-size: clamp(28px, 8vw, 36px);
  letter-spacing: 0.06em;
  color: var(--accent-dark);
}

.page-head .art-title {
  margin: 0;
  font-size: clamp(26px, 7.5vw, 34px);
  letter-spacing: 0.05em;
  line-height: 1.35;
  color: var(--ink);
}

.page-head .sub {
  margin: 8px 0 0;
  font-size: clamp(19px, 5vw, 22px);
  color: var(--ink-soft);
}

.page-head .progress {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 18px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 20px;
  color: var(--accent-dark);
  background: #faf5e6;
}

/* ---------- 目录页 ---------- */
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 18px 14px;
  margin-bottom: 12px;
  background: #fbf6e8;
  border: 2px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 2px 0 rgba(139, 111, 65, 0.08);
  -webkit-tap-highlight-color: transparent;
}

.toc-item:active {
  background: var(--bg-deep);
  transform: translateY(1px);
}

.toc-title {
  font-size: clamp(24px, 6.5vw, 30px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.toc-author {
  font-size: clamp(17px, 4.5vw, 20px);
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- 正文页（大字 + 拼音在字上方） ---------- */
.text-page {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "FangSong", "SimSun", serif;
  font-size: clamp(32px, 10.5vw, 40px);
  letter-spacing: 0.06em;
  color: var(--ink);
}

.text-page .line {
  line-height: 2.35;
  margin-bottom: 20px;
  text-align: left;
}

.text-page ruby {
  ruby-position: over;
  ruby-align: center;
}

.text-page rt {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 0.44em;
  letter-spacing: 0;
  line-height: 1.15;
  color: #7a5c3a;
  transform: translateY(0.08em);
}

/* ---------- 底部固定按钮栏 ---------- */
.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(244, 236, 214, 0.97);
  border-top: 2px solid var(--line);
}

.nav-btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 230px;
  height: 62px;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: clamp(22px, 5.8vw, 27px);
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 0 4px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(111, 69, 44, 0.25);
  -webkit-tap-highlight-color: transparent;
}

.nav-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(111, 69, 44, 0.25);
  background: var(--accent-dark);
}

.nav-btn:disabled {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-fg);
  box-shadow: none;
  cursor: default;
}

.toc-indicator {
  flex: 0 0 auto;
  font-size: 22px;
  color: var(--ink-soft);
  padding: 0 6px;
  white-space: nowrap;
}

/* ---------- 电脑端微调 ---------- */
@media (min-width: 640px) {
  .text-page .line {
    text-align: center;
  }

  .bottom-bar {
    gap: 16px;
  }
}
