/* ==========================================================
   古文观止 · 青少年绘本读本  —— 设计系统
   风格：多彩绘本风 / 圆角卡片 / 柔和投影 / 暖纸色底
   ========================================================== */

:root {
  --paper: #FDF6EC;
  --paper-deep: #F6EBD8;
  --ink: #3D3226;
  --ink-soft: #6B5D4B;
  --primary: #E2684A;
  --primary-deep: #C94F33;
  --green: #3E8E6E;
  --gold: #E4A933;
  --blue: #4A7FC1;
  --purple: #8A6FB8;
  --red: #D9534F;
  --card: #FFFFFF;
  --line: #EADFCB;
  --radius: 18px;
  --radius-sm: 10px;
  --shadow: 0 4px 14px rgba(61, 50, 38, .08);
  --shadow-lift: 0 10px 24px rgba(61, 50, 38, .14);

  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background:
    radial-gradient(1200px 500px at 85% -5%, #FBE9D0 0%, transparent 60%),
    radial-gradient(900px 400px at -10% 20%, #EAF2DC 0%, transparent 55%),
    var(--paper);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 246, 236, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); }
.brand .seal {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--red));
  color: #fff; display: grid; place-items: center;
  font-size: 15px; font-weight: 700; box-shadow: var(--shadow);
}
.brand .title { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.brand .sub { font-size: 11px; color: var(--ink-soft); letter-spacing: 1px; }

.top-nav { display: flex; align-items: center; gap: 22px; }
.top-nav a { font-size: 15px; color: var(--ink-soft); padding: 4px 2px; border-bottom: 2px solid transparent; }
.top-nav a:hover { color: var(--primary); border-color: var(--primary); }
.top-nav a.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* ---------- 搜索框 ---------- */
.search-box { position: relative; }
.search-box input {
  width: 220px; padding: 8px 34px 8px 14px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: #fff; font-size: 14px; outline: none; transition: .2s;
}
.search-box input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(228,169,51,.15); }
.search-box .icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }
.search-results {
  position: absolute; right: 0; top: 44px; width: 360px; max-height: 420px; overflow: auto;
  background: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-lift);
  border: 1px solid var(--line); display: none; z-index: 60;
}
.search-results.open { display: block; }
.search-results a { display: block; padding: 10px 14px; border-bottom: 1px dashed var(--line); }
.search-results a:hover { background: var(--paper); }
.search-results .r-title { font-weight: 600; }
.search-results .r-meta { font-size: 12px; color: var(--ink-soft); }

/* ---------- 首页 Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
  padding: 56px 0 40px;
}
.hero h1 { font-family: var(--serif); font-size: 46px; line-height: 1.25; letter-spacing: 2px; }
.hero h1 .accent { color: var(--primary); }
.hero p.desc { margin-top: 16px; font-size: 17px; color: var(--ink-soft); max-width: 520px; }
.hero .chips { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: #fff; border: 1.5px solid var(--line); box-shadow: var(--shadow); cursor: default;
}
.chip i { font-style: normal; color: var(--primary); }
.hero-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lift); }
.hero-cover img { width: 100%; height: 320px; object-fit: cover; display: block; }

.cta-row { margin-top: 28px; display: flex; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 999px; font-size: 16px; font-weight: 600;
  background: var(--primary); color: #fff; box-shadow: var(--shadow); transition: .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }

/* ---------- 区块标题 ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-family: var(--serif); font-size: 28px; display: flex; align-items: center; gap: 10px; }
.section-head h2::before {
  content: ""; display: inline-block; width: 8px; height: 26px;
  border-radius: 4px; background: var(--gold);
}
.section-head .more { color: var(--blue); font-size: 14px; }
.section-head .more:hover { text-decoration: underline; }

/* ---------- 卷次卡片 ---------- */
.vol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.vol-card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: .25s; position: relative; overflow: hidden; cursor: pointer;
}
.vol-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.vol-card .vol-num {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-family: var(--serif); font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 12px;
}
.vol-card h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 4px; }
.vol-card .vol-attr { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.vol-card .vol-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.vol-card .vol-count {
  position: absolute; top: 18px; right: 18px; font-size: 12px;
  background: var(--paper-deep); color: var(--ink-soft);
  padding: 3px 10px; border-radius: 999px;
}

/* ---------- 朝代时间轴 ---------- */
.timeline { display: flex; gap: 0; overflow-x: auto; padding-bottom: 8px; }
.tl-node { flex: 1; min-width: 130px; text-align: center; position: relative; padding-top: 26px; text-decoration: none; color: inherit; cursor: pointer; transition: .2s; border-radius: var(--radius); padding-left: 8px; padding-right: 8px; }
.tl-node:hover { transform: translateY(-2px); }
.tl-node:hover .tl-era { color: var(--brand) !important; }
.tl-node::before {
  content: ""; position: absolute; top: 10px; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--primary), var(--purple), var(--blue), var(--green));
  border-radius: 2px; opacity: .5;
}
.tl-node::after {
  content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 4px solid var(--gold); box-shadow: var(--shadow);
}
.tl-node .tl-era { font-family: var(--serif); font-weight: 700; font-size: 16px; }
.tl-node .tl-range { font-size: 12px; color: var(--ink-soft); }

/* ---------- 名句金句 ---------- */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.quote-card {
  background: var(--card); border-radius: var(--radius); padding: 22px 24px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  border-left: 5px solid var(--gold); position: relative;
}
.quote-card .q-text { font-family: var(--serif); font-size: 19px; line-height: 1.8; margin-bottom: 10px; }
.quote-card .q-src { font-size: 13px; color: var(--ink-soft); }
.quote-card .q-src b { color: var(--blue); }

/* ---------- 作者墙 ---------- */
.author-strip { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; }
.author-card {
  min-width: 130px; text-align: center; background: var(--card);
  border-radius: var(--radius); padding: 18px 10px; box-shadow: var(--shadow);
  border: 1px solid var(--line); cursor: pointer; transition: .2s;
}
.author-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.author-card .avatar {
  width: 58px; height: 58px; margin: 0 auto 8px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-family: var(--serif);
  font-size: 24px; font-weight: 700; box-shadow: var(--shadow);
}
.author-card .a-name { font-weight: 600; }
.author-card .a-era { font-size: 12px; color: var(--ink-soft); }

/* ---------- 卷目录页 ---------- */
.vol-header {
  padding: 34px 0 26px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.vol-header .big-seal {
  width: 84px; height: 84px; border-radius: 20px; display: grid; place-items: center;
  color: #fff; font-family: var(--serif); font-size: 30px; font-weight: 700; box-shadow: var(--shadow-lift);
}
.vol-header h1 { font-family: var(--serif); font-size: 34px; }
.vol-header .vol-meta { color: var(--ink-soft); font-size: 15px; }

.article-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 60px; }
.article-row {
  display: flex; align-items: center; gap: 16px; background: var(--card);
  border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow);
  border: 1px solid var(--line); transition: .2s;
}
.article-row:hover { transform: translateX(4px); border-color: var(--primary); }
.article-row .idx {
  width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--paper-deep); font-family: var(--serif); font-weight: 700; color: var(--ink-soft);
}
.article-row .ar-title { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.article-row .ar-title .vol-tag { font-size: 12px; font-weight: 400; color: var(--ink-soft); margin-right: 8px; }
.article-row .ar-src { font-size: 13px; color: var(--ink-soft); }
.article-row .ar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.difficulty { display: flex; gap: 3px; }
.difficulty .star { color: var(--gold); font-size: 15px; }
.difficulty .star.off { color: #E5DCCB; }

/* ---------- 阅读页 ---------- */
.reader-head { padding: 28px 0 8px; }
.crumbs { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.crumbs a:hover { color: var(--primary); }
.reader-title-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.reader-title-row h1 { font-family: var(--serif); font-size: 34px; letter-spacing: 1px; }
.reader-title-row .tag {
  padding: 4px 12px; border-radius: 999px; font-size: 13px; color: #fff; font-weight: 600;
}
.tag.elementary { background: var(--green); }
.tag.junior { background: var(--blue); }
.tag.senior { background: var(--red); }

.reader-toolbar {
  margin: 18px 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.tool-btn {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer; transition: .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.tool-btn:hover { border-color: var(--gold); }
.tool-btn.on { background: var(--green); color: #fff; border-color: var(--green); }

.reader-cover {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lift);
  margin-bottom: 24px; max-height: 360px;
}
.reader-cover img { width: 100%; height: 100%; object-fit: cover; display: block; max-height: 360px; }
.cover-wrap { position: relative; }
.cover-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 26px 18px;
  background: linear-gradient(to top, rgba(20,28,24,.72), rgba(20,28,24,0));
  color: #fff; pointer-events: none;
}
.cover-cap h2 { margin: 0; font-size: 26px; letter-spacing: 3px; text-shadow: 0 2px 10px rgba(0,0,0,.55); }
.cover-cap span { font-size: 14px; opacity: .92; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.ar-cover {
  width: 88px; height: 62px; object-fit: cover; border-radius: 9px;
  flex: 0 0 auto; box-shadow: var(--shadow-lift); background: #eee;
}
.article-row { align-items: center; }
.article-row .ar-cover { margin-right: 4px; }

.reader-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; padding-bottom: 60px; }
.reader-side { display: flex; flex-direction: column; gap: 26px; }

.panel {
  background: var(--card); border-radius: var(--radius); padding: 24px 26px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.panel h2 {
  font-family: var(--serif); font-size: 20px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.panel h2::before { content: ""; width: 7px; height: 22px; border-radius: 3px; background: var(--primary); }

.para { margin-bottom: 18px; }
.para-label {
  display: inline-block; font-size: 12px; color: #fff; background: var(--gold);
  padding: 2px 10px; border-radius: 999px; margin-bottom: 8px; font-weight: 600;
}
.sentences .sent { cursor: pointer; border-radius: 6px; transition: background .15s; }
.sentences .sent:hover { background: #FDF1DC; }
.sent .hanzi { font-family: var(--serif); font-size: 18.5px; line-height: 2; }
.sent .hanzi ruby { ruby-position: over; }
.sent .hanzi ruby rt { font-size: 10.5px; color: var(--blue); font-weight: 400; }
.sent .yiyi {
  display: block; font-size: 14.5px; color: var(--ink-soft);
  border-left: 3px solid var(--paper-deep); padding-left: 10px; margin: 6px 0 10px;
  line-height: 1.8;
}

.reading-nav { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 60px; }
.reading-nav a {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 18px; box-shadow: var(--shadow); max-width: 45%;
  font-size: 14px;
}
.reading-nav a:hover { border-color: var(--gold); }
.reading-nav .dir { font-size: 12px; color: var(--ink-soft); }
.reading-nav .t { font-family: var(--serif); font-weight: 700; font-size: 16px; }

/* ---------- Tab 区（注释/赏析/作者） ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
  padding: 9px 22px; border-radius: 999px; font-size: 15px; font-weight: 600;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer; transition: .2s;
}
.tab-btn.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.tab-panel { display: none; }
.tab-panel.on { display: block; }

.notes-list .note { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-start; }
.notes-list .n-term {
  flex: none; font-family: var(--serif); font-weight: 700; color: var(--primary);
  background: #FCE9E2; padding: 2px 10px; border-radius: 6px; font-size: 15px;
}
.notes-list .n-desc { font-size: 15px; color: var(--ink); }

.appreciation p { font-size: 15.5px; margin-bottom: 12px; text-align: justify; }
.appreciation .topic {
  background: var(--paper-deep); border-radius: 10px; padding: 12px 16px; margin-bottom: 12px;
  font-size: 15px;
}
.appreciation .topic b { color: var(--primary); }

.author-box { display: flex; gap: 18px; align-items: flex-start; }
.author-box .avatar {
  width: 72px; height: 72px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-family: var(--serif);
  font-size: 30px; font-weight: 700; box-shadow: var(--shadow);
}
.author-box h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 4px; }
.author-box .a-era { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.author-box p { font-size: 15px; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 40px; border-top: 1px solid var(--line);
  padding: 30px 0 40px; text-align: center; color: var(--ink-soft); font-size: 13.5px;
}
.site-footer .brand-line { font-family: var(--serif); font-size: 18px; color: var(--ink); margin-bottom: 6px; }

/* ---------- 阅读页补充 ---------- */
.sent.reading .hanzi { background: #FDF1DC; border-radius: 6px; box-shadow: inset 0 -4px 0 rgba(228,169,51,.35); }
.fact-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.fact { display: flex; gap: 12px; align-items: baseline; }
.fact .fk { flex: none; width: 62px; color: var(--ink-soft); font-size: 13px; }
.fact .fv { font-size: 14.5px; font-family: var(--serif); }
.synopsis {
  background: var(--paper-deep); border-radius: 10px; padding: 12px 16px;
  font-size: 14.5px; color: var(--ink); line-height: 1.8;
}
.vol-pager { margin: 0 0 24px; }

/* ---------- 作者墙页 ---------- */
.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; padding-bottom: 40px; }
.author-tile {
  background: var(--card); border-radius: var(--radius); padding: 20px 14px;
  box-shadow: var(--shadow); border: 1px solid var(--line); text-align: center;
  transition: .2s; cursor: pointer;
}
.author-tile:hover { transform: translateY(-4px); border-color: var(--gold); }
.author-tile .avatar {
  width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-family: var(--serif);
  font-size: 25px; font-weight: 700; box-shadow: var(--shadow);
}
.author-tile .a-name { font-weight: 600; font-family: var(--serif); font-size: 17px; }
.author-tile .a-era { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.author-tile .a-count { font-size: 12px; color: var(--primary); margin-top: 4px; }

.author-detail {
  background: var(--card); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 28px;
  display: flex; gap: 20px; align-items: flex-start;
}
.author-detail .avatar {
  width: 80px; height: 80px; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font-family: var(--serif);
  font-size: 34px; font-weight: 700; box-shadow: var(--shadow-lift);
}
.author-detail h2 { font-family: var(--serif); font-size: 24px; }
.author-detail .a-era { color: var(--ink-soft); font-size: 14px; margin-bottom: 8px; }
.author-detail p { font-size: 15px; line-height: 1.9; }
.author-works { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.author-works a {
  font-size: 13px; background: var(--paper-deep); padding: 4px 12px; border-radius: 999px;
  color: var(--ink); transition: .15s;
}
.author-works a:hover { background: var(--gold); color: #fff; }

/* ---------- 金句页 ---------- */
.quote-detail {
  background: var(--card); border-radius: var(--radius); padding: 34px 40px;
  box-shadow: var(--shadow); border: 1px solid var(--line); text-align: center;
  margin-bottom: 26px;
}
.quote-detail .q-big { font-family: var(--serif); font-size: 30px; line-height: 2; color: var(--ink); }
.quote-detail .q-src { color: var(--ink-soft); margin-top: 10px; }

/* ---------- 进度页 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 22px; text-align: center;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.stat-card .num { font-family: var(--serif); font-size: 40px; font-weight: 700; color: var(--primary); }
.stat-card .lab { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.progress-bar {
  height: 14px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; margin: 18px 0 8px;
}
.progress-bar .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--primary)); width: 0; transition: width .5s; }
.progress-hint { font-size: 13px; color: var(--ink-soft); }

/* ---------- 空状态 / 工具 ---------- */
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.text-center { text-align: center; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .reader-layout { grid-template-columns: 1fr; }
  .top-nav { display: none; }
  .search-box input { width: 150px; }
  .hero h1 { font-size: 34px; }
}

/* ---------- 卷页工具条 ---------- */
.vol-tools{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 18px;padding:12px 16px;
  background:var(--card);border:1px solid var(--line);border-radius:var(--radius)}
.tool-btn{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:999px;
  background:linear-gradient(135deg,#4A7FC1,#5BA0E0);color:#fff;font-size:13px;font-weight:600;
  text-decoration:none;transition:.2s}
.tool-btn:hover{filter:brightness(1.1);transform:translateY(-1px)}
.tool-btn i{font-size:10px}
.vol-tools-sep{color:var(--line)}

/* 小屏优化：防止框小截断 */
@media (max-width: 900px) {
  .vol-grid{grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
  .vol-card{padding:16px}
  .vol-card h3{font-size:18px}
  .vol-desc{font-size:13px;line-height:1.5}
  .vol-attr{font-size:12.5px}
  .cta-row{flex-wrap:wrap}
  .ar-title{font-size:16px}
  .ar-src{font-size:12.5px}
  .article-row{padding:12px 16px;gap:12px}
}
@media (max-width: 600px){
  .vol-grid{grid-template-columns:1fr}
  .vol-header{flex-direction:column;align-items:flex-start;gap:12px}
  .vol-meta{font-size:13.5px}
}
