/* ============ 墨韵诗声 · 水墨中国风 ============ */

/* 内置书法字体（SIL OFL 1.1，见 fonts/ 内授权文件） */
@font-face {
  font-family: "墨韵行书";
  src: url("fonts/ZhiMangXing-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "墨韵草书";
  src: url("fonts/LiuJianMaoCao-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --paper: #f4efe3;
  --paper-2: #ece5d3;
  --paper-card: #faf6ec;
  --ink: #2b2620;
  --ink-soft: #5c554a;
  --ink-faint: #8f887a;
  --accent: #a63d2f;      /* 朱砂 */
  --accent-soft: #c25e4e;
  --gold: #8a6d3b;
  --line: rgba(43, 38, 32, .16);
  --poem-font: "Kaiti SC", "STKaiti", "KaiTi", serif;
  --shadow: 0 2px 18px rgba(43, 38, 32, .08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -5%, rgba(166, 61, 47, .05), transparent 60%),
    radial-gradient(900px 420px at -10% 30%, rgba(90, 84, 74, .07), transparent 55%),
    radial-gradient(700px 500px at 110% 80%, rgba(138, 109, 59, .06), transparent 60%),
    var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: .02em;
}

a { color: inherit; text-decoration: none; }

/* ============ 顶栏 ============ */

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 32px;
  background: rgba(244, 239, 227, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar::after { /* 顶部墨线 */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, transparent, rgba(43,38,32,.35) 15%, rgba(43,38,32,.35) 85%, transparent);
  opacity: .35; pointer-events: none;
}

.logo { display: flex; align-items: center; gap: 12px; }
.seal {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  background: var(--accent);
  color: #f7f2e6; font-size: 24px; font-weight: 700;
  border-radius: 6px;
  transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px rgba(247, 242, 230, .55), inset 0 0 0 4px var(--accent), var(--shadow);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text { font-size: 21px; font-weight: 700; letter-spacing: .12em; }
.logo-text small { font-size: 11px; color: var(--ink-faint); letter-spacing: .28em; font-weight: 400; }

.nav { display: flex; gap: 6px; flex: 1; }
.nav a {
  padding: 7px 16px; border-radius: 999px; font-size: 16px;
  color: var(--ink-soft); transition: all .18s;
}
.nav a:hover { color: var(--ink); background: rgba(43, 38, 32, .06); }
.nav a.active { color: var(--accent); background: rgba(166, 61, 47, .08); }

.top-actions { display: flex; align-items: center; gap: 14px; }

.font-picker {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 6px 4px 12px; background: var(--paper-card);
}
.font-picker-label { font-size: 14px; color: var(--ink-faint); }
#font-select {
  border: none; background: transparent; color: var(--ink);
  font-family: inherit; font-size: 14px; outline: none; cursor: pointer;
  max-width: 110px;
}
#font-select option { font-family: inherit; }

/* ============ 通用 ============ */

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 32px 64px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 22px; border-radius: 8px;
  border: 1px solid var(--ink);
  background: transparent; color: var(--ink);
  font-family: inherit; font-size: 15px; letter-spacing: .08em;
  cursor: pointer; transition: all .18s;
  white-space: nowrap;
}
.btn:hover { background: rgba(43, 38, 32, .07); transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--paper-card); }
.btn-primary:hover { background: #403a32; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #f7f2e6; }
.btn-accent:hover { background: var(--accent-soft); }
.btn-sm { padding: 5px 14px; font-size: 13px; border-radius: 6px; }
.btn-ghost { border-color: var(--line); color: var(--ink-soft); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

input[type=text], input[type=password], input[type=file], textarea, select.field {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper-card); color: var(--ink);
  font-family: inherit; font-size: 15px; outline: none;
  transition: border .18s;
}
input:focus, textarea:focus, select.field:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: .1em; }

.tag {
  display: inline-block; padding: 2px 10px; border-radius: 4px;
  font-size: 12px; background: rgba(138, 109, 59, .12); color: var(--gold);
  letter-spacing: .06em;
}
.tag-red { background: rgba(166, 61, 47, .1); color: var(--accent); }

.vip-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px; font-size: 12px;
  background: linear-gradient(120deg, #b8860b, #d4a843);
  color: #fff8e6; letter-spacing: .1em;
}

.muted { color: var(--ink-faint); }
.small { font-size: 13px; }

.empty {
  text-align: center; color: var(--ink-faint); padding: 60px 0;
  font-size: 15px; letter-spacing: .2em;
}

/* ============ 首页 ============ */

.hero {
  position: relative; overflow: hidden;
  padding: 56px 48px; margin-bottom: 36px;
  background: linear-gradient(135deg, rgba(250,246,236,.9), rgba(236,229,211,.75));
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
}
.hero h1 {
  font-size: 40px; letter-spacing: .18em; margin-bottom: 10px;
  font-weight: 700;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--ink-soft); font-size: 16px; letter-spacing: .14em; margin-bottom: 26px; }
.hero .search-row { display: flex; gap: 12px; max-width: 520px; }
.hero-bg {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; text-orientation: upright;
  font-size: 24px; color: rgba(43, 38, 32, .1); letter-spacing: .5em;
  pointer-events: none; user-select: none;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }

.poem-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 22px 22px 18px;
  background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
  cursor: pointer; transition: all .2s;
}
.poem-card:hover { transform: translateY(-3px); border-color: rgba(166, 61, 47, .4); box-shadow: 0 8px 26px rgba(43,38,32,.12); }
.poem-card h3 { font-size: 20px; letter-spacing: .1em; }
.poem-card .meta { font-size: 13px; color: var(--ink-faint); }
.poem-card .first-line {
  font-family: var(--poem-font);
  font-size: 15px; color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.poem-card .card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.rec-count { font-size: 13px; color: var(--accent); }

.section-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 22px; letter-spacing: .16em; margin: 8px 0 20px;
}
.section-title::before { content: ""; width: 6px; height: 22px; background: var(--accent); border-radius: 2px; transform: rotate(4deg); }
.dynasty-total {
  font-size: 13px; font-weight: 400; letter-spacing: .06em;
  color: var(--ink-faint); margin-left: 4px;
}

/* 朝代筛选 */
.dynasty-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 22px; }
.dynasty-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper-card); color: var(--ink-soft);
  font-family: inherit; font-size: 14px; letter-spacing: .06em;
  cursor: pointer; transition: all .18s; white-space: nowrap;
}
.dynasty-tab:hover { border-color: var(--accent); color: var(--ink); }
.dynasty-tab.active { background: var(--accent); border-color: var(--accent); color: #f7f2e6; }
.dynasty-tab .n { font-size: 12px; opacity: .68; font-family: system-ui, sans-serif; }

/* ============ 诗歌详情 ============ */

.poem-detail { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .poem-detail { grid-template-columns: 1fr; } }

.poem-paper {
  padding: 34px 30px;
  background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow);
  position: relative; overflow: auto;
}
.poem-paper .paper-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.poem-paper h2 { font-size: 28px; letter-spacing: .1em; }
.poem-paper .author { color: var(--ink-soft); font-size: 15px; }
.poem-body {
  font-family: var(--poem-font);
  writing-mode: vertical-rl; text-orientation: upright;
  height: 380px; overflow: auto; margin: 22px 0;
  font-size: 26px; line-height: 2; letter-spacing: .35em;
  color: var(--ink);
}
.poem-body p { margin-left: 26px; } /* 竖排：行间距 */
.poem-intro {
  border-top: 1px dashed var(--line); padding-top: 14px;
  font-size: 14px; color: var(--ink-faint); line-height: 1.9;
}

.rec-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 12px;
  background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 10px;
  transition: all .18s;
}
.rec-item:hover { border-color: rgba(166, 61, 47, .35); }
.rec-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  background: rgba(166, 61, 47, .1); color: var(--accent);
  flex-shrink: 0;
}
.rec-main { flex: 1; min-width: 0; }
.rec-main .who { font-size: 15px; }
.rec-main .sub { font-size: 12.5px; color: var(--ink-faint); margin-top: 3px; }
.rec-note { font-size: 13px; color: var(--ink-soft); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-actions { display: flex; gap: 8px; align-items: center; }

/* ============ 播放页（卡拉OK书写） ============ */

.player-wrap { max-width: 980px; margin: 0 auto; }

.player-head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 18px;
}
.player-head h2 { font-size: 26px; letter-spacing: .08em; }
.player-head .by { color: var(--ink-faint); font-size: 14px; }

.k-stage {
  position: relative;
  background: linear-gradient(160deg, #faf6ec, #f0e9d7);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 42px 34px;
  min-height: 420px;
  display: flex; align-items: center;
}
.k-poem {
  font-family: var(--poem-font);
  writing-mode: vertical-rl; text-orientation: upright;
  overflow-x: auto; overflow-y: auto;
  max-height: 480px; margin: 0 auto;
  font-size: 34px; line-height: 1.9; letter-spacing: .3em;
  padding: 10px 6px;
  scrollbar-width: thin;
}
/* 不设 nowrap：长句在列高用尽后自动折到下一列，避免半句被裁 */
.k-line { margin-left: 30px; }
.k-char {
  display: inline-block;
  opacity: .13;
  color: var(--ink);
  transition: opacity .3s;
}
.k-char.on { animation: ink-write .5s cubic-bezier(.2,.7,.3,1) forwards; }
.k-char.past { opacity: .55; }
.k-char.now { color: var(--accent); opacity: 1; }
@keyframes ink-write {
  0%   { opacity: 0; transform: scale(1.7) rotate(-10deg); filter: blur(8px); }
  60%  { opacity: .9; filter: blur(1px); }
  100% { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); }
}

.player-bar { display: flex; align-items: center; gap: 16px; margin: 20px 0 8px; }
.play-btn {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: #f7f2e6; border: none;
  font-size: 20px; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(166, 61, 47, .35);
  transition: transform .15s;
}
.play-btn:hover { transform: scale(1.06); }
.progress {
  flex: 1; height: 6px; border-radius: 3px;
  background: rgba(43, 38, 32, .12); cursor: pointer; position: relative;
}
.progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--ink), var(--accent));
  border-radius: 3px; width: 0;
}
.time { font-size: 13px; color: var(--ink-faint); min-width: 100px; text-align: right; font-variant-numeric: tabular-nums; }

/* ============ 评论 ============ */

.comments { margin-top: 30px; }
.comment-item { display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px dashed var(--line); }
.comment-item .who { font-size: 14px; color: var(--accent); }
.comment-item .txt { font-size: 15px; margin-top: 4px; line-height: 1.7; }
.comment-item .time { min-width: 0; text-align: left; margin-top: 4px; }
.comment-form { display: flex; gap: 10px; margin: 14px 0 6px; }
.comment-form textarea { min-height: 66px; }

/* ============ 弹窗 ============ */

.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(43, 38, 32, .4);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  animation: fadein .2s;
}
@keyframes fadein { from { opacity: 0; } }
.modal {
  width: min(520px, calc(100vw - 40px));
  max-height: 86vh; overflow: auto;
  background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 60px rgba(43, 38, 32, .3);
  padding: 28px;
  animation: pop .25s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes pop { from { transform: scale(.92) translateY(10px); opacity: 0; } }
.modal h3 { font-size: 20px; letter-spacing: .12em; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; }
.modal-close { cursor: pointer; font-size: 22px; color: var(--ink-faint); background: none; border: none; font-family: inherit; }
.modal-close:hover { color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button {
  flex: 1; padding: 8px; border: 1px solid var(--line); background: transparent;
  border-radius: 8px; font-family: inherit; font-size: 15px; cursor: pointer; color: var(--ink-soft);
}
.tabs button.active { background: var(--ink); color: var(--paper-card); border-color: var(--ink); }

/* ============ 录音 ============ */

.recorder-state { text-align: center; padding: 18px 0; }
.rec-dot {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--ink-faint); cursor: pointer; position: relative;
  transition: background .2s;
}
.rec-dot.recording { background: var(--accent); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(166,61,47,.4);} 50% { box-shadow: 0 0 0 16px rgba(166,61,47,0);} }
.rec-timer { font-size: 26px; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.rec-hint { font-size: 13px; color: var(--ink-faint); margin-top: 6px; }

/* ============ 朗诵提词器 + 全屏沉浸 ============ */

/* 诗笺底部操作区、全屏按钮 */
.paper-foot {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap; margin-top: 18px;
}
.orient-btn { margin-left: auto; white-space: nowrap; }
.fs-btn { margin-left: 8px; white-space: nowrap; }
.fs-float {
  position: absolute; top: 14px; right: 16px; z-index: 3;
  padding: 6px 12px; border-radius: 7px; border: 1px solid var(--line);
  background: rgba(250, 246, 236, .9); color: var(--ink-soft);
  font-family: inherit; font-size: 13px; letter-spacing: .05em;
  cursor: pointer; white-space: nowrap;
}
.fs-float:hover, .fs-float.is-full { color: var(--accent); border-color: var(--accent); }

/* 朗诵弹窗：左提词 / 右录制 */
.modal-wide { width: min(1080px, calc(100vw - 40px)); max-height: 92vh; padding: 24px; }
.recite-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: stretch; }
.teleprompt {
  display: flex; flex-direction: column; height: 470px; min-height: 0; min-width: 0;
  overflow: hidden;
  padding: 16px 18px; border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #faf6ec, #f2ebd9);
}
.tele-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.tele-title { font-size: 16px; letter-spacing: .08em; color: var(--ink); }
.tele-title small { display: block; margin-top: 3px; font-size: 12px; letter-spacing: 0; color: var(--ink-faint); }
.tele-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tool-btn {
  padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-soft);
  font-family: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.tool-btn:hover, .tool-btn.is-full { color: var(--accent); border-color: var(--accent); }
.tool-fs { color: var(--ink); border-color: var(--ink); }
.tele-size-label { width: 20px; text-align: center; font-size: 12px; color: var(--ink-faint); }

.tele-body {
  flex: 1; min-height: 0; height: auto;
  overflow-x: auto; overflow-y: auto; padding: 16px 8px;
  scrollbar-width: thin;
}
.tele-poem {
  font-family: var(--poem-font);
  writing-mode: vertical-rl; text-orientation: upright;
  font-size: calc(var(--tele-size, 30px) * var(--tele-scale, 1));
  line-height: 1.85; letter-spacing: .22em; color: var(--ink);
  min-width: max-content;
}
.tele-line {
  margin-left: 24px; cursor: pointer;
  padding: 2px 5px; border-radius: 6px;
  transition: background .2s, color .2s;
}
.tele-line:hover { background: rgba(166, 61, 47, .08); }
.tele-line.cur { background: rgba(166, 61, 47, .13); color: var(--accent); box-shadow: inset -3px 0 0 var(--accent); }
.tele-body.horizontal { overflow-x: hidden; overflow-y: auto; }
.tele-body.horizontal .tele-poem { writing-mode: horizontal-tb; text-orientation: mixed; min-width: 0; }
.tele-body.horizontal .tele-line { margin: 0 0 .45em; text-align: center; white-space: normal; }
.tele-body.horizontal .tele-line.cur { box-shadow: inset 0 -3px 0 var(--accent); }
.tele-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 10px; margin-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-faint);
}
#tele-status { min-width: 132px; color: var(--accent); }
.tele-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.recite-panel { display: flex; flex-direction: column; min-width: 0; }

/* 诗笺全屏读诗 */
.poem-paper:fullscreen {
  width: 100vw; height: 100vh; max-height: none; box-sizing: border-box;
  border: none; border-radius: 0;
  padding: clamp(22px, 4vh, 48px) clamp(20px, 6vw, 90px);
  overflow: hidden; display: flex; flex-direction: column;
  background: var(--paper-card);
}
.poem-paper:fullscreen h2 { font-size: 34px; }
.poem-paper:fullscreen .poem-body {
  flex: 1; height: auto; min-height: 0; max-width: 100%; overflow: auto;
  font-size: clamp(30px, 3.4vw, 56px); line-height: 1.8; margin: 20px 0;
}
.poem-paper:fullscreen .poem-intro { display: none; }
/* 长篇横排：整句连贯，不再被竖排列高折碎 */
.poem-body.horizontal {
  writing-mode: horizontal-tb; text-orientation: mixed;
  height: auto; max-height: 46vh; overflow-x: hidden; overflow-y: auto;
  font-size: 25px; line-height: 1.9; letter-spacing: .12em;
}
.poem-body.horizontal p { margin: 0 0 .3em; text-align: center; }
.poem-paper:fullscreen .poem-body.horizontal {
  flex: 1; height: auto; max-height: none; min-height: 0;
  font-size: clamp(28px, 2.8vw, 46px);
}

/* 播放页全屏欣赏（舞台 + 播放条一并全屏，节奏书写不中断） */
.k-screen:fullscreen {
  width: 100vw; height: 100vh; box-sizing: border-box; overflow: hidden;
  display: flex; flex-direction: column;
  padding: clamp(14px, 3vh, 34px) clamp(14px, 4vw, 60px);
  background: linear-gradient(160deg, #faf6ec, #f0e9d7);
}
.k-screen:fullscreen .k-stage {
  flex: 1; min-height: 0; padding: 34px clamp(14px, 4vw, 56px);
  border: none; border-radius: 0; box-shadow: none;
}
.k-screen:fullscreen .k-poem {
  height: 100%; max-height: none; max-width: 100%;
  font-size: clamp(34px, 3.6vw, 62px);
}
.k-screen:fullscreen .player-bar { margin: 14px 0 0; }
.k-screen:fullscreen .fs-float { top: 12px; right: 20px; }

/* 朗诵弹窗全屏提词 */
.recite-modal:fullscreen {
  width: 100vw; height: 100vh; max-height: none; box-sizing: border-box;
  border: none; border-radius: 0;
  padding: clamp(16px, 3vh, 34px) clamp(16px, 4vw, 64px);
  display: flex; flex-direction: column; overflow: hidden;
  --tele-scale: 1.35;
}
.recite-modal:fullscreen h3 { margin-bottom: 14px; }
.recite-modal:fullscreen .recite-layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.recite-modal:fullscreen .teleprompt { height: auto; }
.recite-modal:fullscreen .tele-body { height: auto; flex: 1; }
.recite-modal:fullscreen .recite-panel { overflow: auto; }

@media (max-width: 900px) {
  .recite-layout { grid-template-columns: 1fr; }
  .modal-wide { width: min(560px, calc(100vw - 24px)); }
  .teleprompt { height: 320px; }
  .tele-body { height: auto; }
  .recite-modal:fullscreen .recite-layout { grid-template-columns: 1.2fr 1fr; }
}

/* ============ 我的 / 支付 ============ */

.me-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .me-grid { grid-template-columns: 1fr; } }
.me-card {
  padding: 26px; text-align: center;
  background: var(--paper-card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
}
.me-card .big-avatar {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center; font-size: 32px;
  background: rgba(166, 61, 47, .1); color: var(--accent);
}
.me-card h3 { font-size: 22px; margin-bottom: 6px; }
.me-card .vip-line { margin: 12px 0 18px; font-size: 14px; color: var(--ink-soft); }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin: 24px 0; }
.plan {
  padding: 26px 22px; text-align: center;
  background: var(--paper-card); border: 1.5px solid var(--line); border-radius: 14px;
  cursor: pointer; transition: all .2s; position: relative;
}
.plan:hover { transform: translateY(-3px); border-color: var(--accent); }
.plan .p-name { font-size: 18px; letter-spacing: .1em; }
.plan .p-price { font-size: 38px; color: var(--accent); margin: 10px 0; font-weight: 700; }
.plan .p-price small { font-size: 15px; }
.plan .p-desc { font-size: 13px; color: var(--ink-faint); }
.plan .p-badge {
  position: absolute; top: -10px; right: 14px;
  background: var(--accent); color: #f7f2e6;
  font-size: 12px; padding: 2px 10px; border-radius: 999px;
}
.plan.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(166,61,47,.15); }

.pay-box {
  max-width: 420px; margin: 30px auto; text-align: center;
  padding: 30px; background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.pay-box img { width: 260px; height: 260px; border-radius: 10px; margin: 14px 0; background: #fff; padding: 10px; }
.pay-status { font-size: 15px; color: var(--ink-soft); letter-spacing: .1em; }

/* ============ 管理后台 ============ */

.admin-tabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.admin-tabs button {
  padding: 8px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-soft); font-family: inherit;
  font-size: 15px; cursor: pointer;
}
.admin-tabs button.active { background: var(--accent); border-color: var(--accent); color: #f7f2e6; }

.table { width: 100%; border-collapse: collapse; background: var(--paper-card); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 12px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.table th { background: rgba(43, 38, 32, .05); color: var(--ink-soft); font-weight: 400; letter-spacing: .08em; }
.table tr:last-child td { border-bottom: none; }
.table .op { display: flex; gap: 6px; }
.badge { padding: 2px 10px; border-radius: 4px; font-size: 12px; }
.badge-paid { background: rgba(38, 122, 62, .12); color: #26773e; }
.badge-pending { background: rgba(138, 109, 59, .14); color: var(--gold); }
.badge-closed { background: rgba(43, 38, 32, .08); color: var(--ink-faint); }

/* ============ toast / footer ============ */

#toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  z-index: 200; padding: 12px 26px;
  background: var(--ink); color: var(--paper-card);
  border-radius: 999px; font-size: 14px; letter-spacing: .1em;
  box-shadow: 0 8px 30px rgba(43, 38, 32, .35);
  animation: toast-in .25s;
  max-width: 80vw;
}
#toast.error { background: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

.footer {
  padding: 22px 32px; text-align: center;
  color: var(--ink-faint); font-size: 13px; letter-spacing: .2em;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}

/* ============ 响应式 ============ */

@media (max-width: 720px) {
  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .logo-text small { display: none; }
  .font-picker { display: none; }
  main { padding: 20px 16px 48px; }
  .hero { padding: 34px 22px; }
  .hero h1 { font-size: 28px; }
  .dynasty-bar { gap: 6px; margin-bottom: 16px; }
  .dynasty-tab { padding: 5px 10px; font-size: 13px; }
  .hero-bg { display: none; }
  .k-poem { font-size: 24px; }
  .k-stage { padding: 24px 14px; min-height: 340px; }
}
