:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #1c1c1c;
  --ink-soft: #5c5c5c;
  --ink-mute: #8a8a8a;
  --line: #e6e2da;
  --brand: #1f3a5f;
  --brand-light: #eaf0f7;
  --accent: #b08d47;
  --accent-soft: #f6efe0;
  --danger: #b22d2d;
  --ok: #2f7d4f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 8px 24px rgba(20, 20, 20, .06);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Songti SC", "SimSun", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; margin: 0 0 .5em; letter-spacing: .2px; }
p { margin: 0 0 .8em; }
ul { margin: 0 0 .8em; padding-left: 1.2em; }

.container { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }
.section { margin: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; margin: 0; }
.section-head .more { font-size: 13px; color: var(--ink-mute); }

/* 顶部导航 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 245, 241, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: 1px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-family: var(--serif); font-size: 17px;
}
.nav-links { display: flex; gap: 18px; font-size: 14px; }
.nav-links a { color: var(--ink-soft); padding: 6px 0; }
.nav-links a.active, .nav-links a:hover { color: var(--brand); }
.nav-search { flex: 1; max-width: 320px; position: relative; }
.nav-search input {
  width: 100%; height: 38px; border-radius: 19px; border: 1px solid var(--line);
  padding: 0 16px; background: var(--surface); font-size: 14px; outline: none;
}
.nav-search input:focus { border-color: var(--brand); }
.nav-right { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-light); display: grid; place-items: center; color: var(--brand); font-weight: 600; }
.mobile-tab { display: none; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { color: #fff; background: #16304f; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn.ghost:hover { background: var(--brand-light); color: var(--brand); }
.btn.subtle { background: var(--accent-soft); color: #6b5322; border-color: #e6d7b6; }
.btn.danger { background: var(--danger); }
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* 卡片与网格 */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card.tight { padding: 14px; }
.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

/* 作品卡片 */
.work-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.work-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(20,20,20,.10); }
.work-cover { position: relative; aspect-ratio: 3 / 4; background: linear-gradient(135deg, #23395b, #4a6a8f); overflow: hidden; }
.work-cover img { width: 100%; height: 100%; object-fit: cover; }
.work-cover .fallback {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 14px;
  color: #fff; font-family: var(--serif); font-size: 18px; line-height: 1.35;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 55%), linear-gradient(160deg, #1f3a5f, #2f5378 60%, #8a6f3d);
}
.work-cover .badge { position: absolute; top: 10px; left: 10px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.92); color: var(--brand); font-size: 12px; font-weight: 600; }
.badge.paid { background: var(--accent-soft); color: #7a5c1f; }
.badge.free { background: #e8f4ec; color: var(--ok); }
.badge.type { background: rgba(255,255,255,.9); color: #333; }
.work-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.work-title { font-size: 15px; font-weight: 700; margin: 0; color: var(--ink); }
.work-title a { color: inherit; }
.work-meta { font-size: 12px; color: var(--ink-mute); display: flex; flex-wrap: wrap; gap: 8px; }
.work-intro { font-size: 13px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price-tag { font-size: 13px; color: var(--accent); font-weight: 700; }

/* 首页 */
.hero { padding: 32px 0 10px; }
.hero h1 { font-size: 34px; margin-bottom: 10px; font-family: var(--serif); }
.hero p { color: var(--ink-soft); max-width: 640px; }
.hero-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.banner-strip { display: grid; gap: 14px; grid-template-columns: 2fr 1fr; }
.banner-card { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 210px; background: linear-gradient(135deg, #1f3a5f, #3d6288); color: #fff; display: flex; align-items: flex-end; padding: 22px; }
.banner-card h3 { color: #fff; font-size: 22px; margin: 0 0 6px; }
.banner-card p { color: rgba(255,255,255,.82); margin: 0; font-size: 13px; }
.banner-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.banner-card .inner { position: relative; }
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-item { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.rank-item:last-child { border-bottom: 0; }
.rank-no { width: 24px; font-weight: 800; color: var(--accent); font-style: italic; }
.rank-item .t { flex: 1; font-size: 14px; }
.rank-item .n { font-size: 12px; color: var(--ink-mute); }

/* 列表页 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip:hover { border-color: var(--brand); }
.pager { display: flex; gap: 8px; justify-content: center; margin: 26px 0; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; padding: 0 10px; }
.pager .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 详情页 */
.detail-hero { display: grid; grid-template-columns: 240px 1fr; gap: 26px; padding: 26px 0 10px; }
.detail-cover { border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4; background: linear-gradient(150deg, #1f3a5f, #4c6f92); position: relative; }
.detail-cover .fallback { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 18px; color: #fff; font-family: var(--serif); font-size: 20px; }
.detail-title { font-family: var(--serif); font-size: 30px; margin: 0 0 8px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--ink-mute); font-size: 13px; margin-bottom: 14px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 26px; margin: 16px 0; }
.stat-row .s { display: flex; flex-direction: column; }
.stat-row .s b { font-size: 20px; }
.stat-row .s span { font-size: 12px; color: var(--ink-mute); }
.intro-block { color: var(--ink-soft); font-size: 14px; }
.purchase-box { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.price-big { font-size: 26px; font-weight: 800; color: var(--accent); }
.chapter-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 18px; }
.chapter-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 4px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.chapter-row .lock { color: var(--accent); font-size: 12px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding: 10px 2px; font-size: 14px; color: var(--ink-soft); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }

/* 阅读器 */
.reader { background: #f4efe4; min-height: 100vh; }
.reader-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: rgba(244,239,228,.94); backdrop-filter: blur(8px); border-bottom: 1px solid #e3dbc9; font-size: 13px; }
.reader-top .title { flex: 1; text-align: center; font-weight: 600; color: #5c5344; }
.reader-shell { max-width: 780px; margin: 0 auto; padding: 28px 22px 80px; background: #fbf8f1; min-height: 100vh; box-shadow: 0 0 40px rgba(120,100,60,.06); }
.reader-chapter-title { font-family: var(--serif); font-size: 24px; text-align: center; margin: 10px 0 6px; color: #2b2b2b; }
.reader-chapter-sub { text-align: center; color: #9a8f79; font-size: 12px; margin-bottom: 26px; }
.reader-content { font-family: var(--serif); font-size: 18px; line-height: 2; color: #2c2c2c; }
.reader-content p { text-indent: 2em; margin: 0 0 1em; }
.reader-content.scene p { text-indent: 0; }
.reader-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; }
.paywall { max-width: 640px; margin: 60px auto; text-align: center; background: #fff; border-radius: 16px; padding: 34px 26px; border: 1px solid #eee3cf; }
.paywall h2 { font-family: var(--serif); }
.reader-settings { position: fixed; right: 16px; bottom: 20px; z-index: 30; display: flex; gap: 8px; }
.reader-settings button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid #ded3bd; background: #fff; cursor: pointer; font-size: 15px; }

/* 表单 */
.form-row { margin-bottom: 14px; }
label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,58,95,.08); }
textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
.hint { font-size: 12px; color: var(--ink-mute); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkline input { width: auto; }

/* 提示 */
.alert { padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.alert.success { background: #e8f4ec; color: #26603c; border: 1px solid #cbe6d5; }
.alert.error { background: #fbe9e9; color: #8c2626; border: 1px solid #f2cccc; }
.empty { text-align: center; color: var(--ink-mute); padding: 40px 16px; font-size: 14px; }

/* 数据表 */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #faf8f4; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.table tr:hover td { background: #fcfbf8; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* 后台布局 */
.admin { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; background: #f4f6f9; }
.admin-side { background: #12263f; color: #c9d6e5; padding: 18px 12px; }
.admin-side .brand { color: #fff; margin-bottom: 22px; padding: 0 8px; }
.admin-side .brand .mark { background: #b08d47; }
.admin-nav a { display: block; padding: 9px 12px; border-radius: 8px; color: #c9d6e5; font-size: 13.5px; margin-bottom: 2px; }
.admin-nav a.active, .admin-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #6d829b; padding: 16px 12px 6px; }
.admin-main { padding: 24px 28px 60px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.admin-head h1 { font-size: 20px; margin: 0; }
.kpi { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.kpi .card { padding: 16px; }
.kpi .label { font-size: 12px; color: var(--ink-mute); }
.kpi .value { font-size: 24px; font-weight: 800; margin-top: 6px; }
.kpi .value small { font-size: 12px; color: var(--ink-mute); font-weight: 500; }

/* 认证页 */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-visual { background: linear-gradient(160deg, #1f3a5f, #31537a 55%, #8a6f3d); color: #fff; padding: 54px; display: flex; flex-direction: column; justify-content: center; }
.auth-visual h1 { font-family: var(--serif); font-size: 34px; }
.auth-visual p { color: rgba(255,255,255,.8); max-width: 420px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.auth-box { width: 100%; max-width: 380px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tabs button { flex: 1; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; }
.auth-tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-mute); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* AI 编辑器 */
.ai-shell { display: grid; grid-template-columns: 300px 1fr; height: 100vh; background: #f6f5f1; }
.ai-side { background: #fff; border-right: 1px solid var(--line); overflow-y: auto; padding: 16px; }
.ai-main { overflow-y: auto; padding: 20px 24px 70px; }
.ai-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.panel-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.panel-tabs button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; }
.panel-tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.panel-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 420px; }
.panel-item { border-bottom: 1px dashed var(--line); padding: 10px 0; }
.panel-item:last-child { border-bottom: 0; }
.panel-item .k { font-weight: 700; font-size: 14px; }
.panel-item .v { font-size: 13px; color: var(--ink-soft); }
.stream-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-height: 260px; max-height: min(60vh, 560px); overflow-y: auto; overscroll-behavior: contain; font-size: 14px; line-height: 1.9; white-space: pre-wrap; }
.stream-box:empty::before { content: "生成内容将在这里实时出现…"; color: var(--ink-mute); }
.meter { height: 6px; background: #ece8df; border-radius: 3px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); }

.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; color: var(--ink-mute); font-size: 13px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* 后台移动端顶部导航（桌面端隐藏） */
.admin-mobile-nav { display: none; gap: 6px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.admin-mobile-nav a, .admin-mobile-nav button {
  flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-soft); font-size: 12px; cursor: pointer; white-space: nowrap;
}
.admin-mobile-nav a:hover, .admin-mobile-nav button:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 1024px) {
  .admin-mobile-nav { display: flex; }
}

/* 移动端 */
@media (max-width: 1024px) {
  .grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-hero { grid-template-columns: 180px 1fr; }
  .chapter-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin { grid-template-columns: 1fr; }
  .admin-side { display: none; }
  .ai-shell { grid-template-columns: 1fr; }
  .ai-side { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
}

@media (max-width: 768px) {
  body { font-size: 14px; }
  .container { width: calc(100% - 28px); }
  .nav { height: 56px; gap: 12px; }
  .nav-links, .nav-search { display: none; }
  .nav-right .btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .hero { padding: 18px 0 0; }
  .hero h1 { font-size: 24px; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2, .grid.auto { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .banner-strip { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-cover { max-width: 200px; margin: 0 auto; }
  .detail-title { font-size: 24px; }
  .chapter-list { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .reader-shell { padding: 20px 16px 90px; }
  .reader-content { font-size: 17px; }
  .table th, .table td { padding: 8px 10px; }
  .mobile-tab {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255,255,255,.96); border-top: 1px solid var(--line); padding: 6px 0 max(6px, env(safe-area-inset-bottom));
    backdrop-filter: blur(10px);
  }
  .mobile-tab a { flex: 1; text-align: center; font-size: 11px; color: var(--ink-mute); display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 4px 0; }
  .mobile-tab a.active { color: var(--brand); }
  .mobile-tab .ico { font-size: 17px; line-height: 1; }
  body { padding-bottom: 56px; }

  /* 表格在窄屏不压缩文字：改为横向滚动，避免列被挤成竖排或右侧裁切 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 720px; }
  .table th, .table td { white-space: nowrap; }
  .table td .hint { white-space: normal; }

  /* 后台在窄屏隐藏侧栏后，补充顶部操作条，保证退出登录等入口可见 */
  .admin-main { padding: 16px 14px 70px; }
  .admin-head { flex-wrap: wrap; }
  .admin-head h1 { font-size: 18px; }
}
/* ---------- 阅读器增强：进度条 / 目录抽屉 / 回位提示 ---------- */
.reader-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: rgba(0,0,0,.06); z-index: 60; }
.reader-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2f6bff, #7aa7ff); transition: width .12s linear; }

.reader-drawer {
  position: fixed; top: 0; bottom: 0; right: 0; width: min(380px, 88vw); z-index: 70;
  background: #fff; box-shadow: -12px 0 32px rgba(0,0,0,.12); padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateX(102%); transition: transform .22s ease; display: flex; flex-direction: column;
}
.reader-drawer.open { transform: translateX(0); }
.reader-drawer-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.reader-drawer-list { overflow: auto; margin-top: 4px; }
.reader-drawer-list a {
  display: flex; justify-content: space-between; gap: 8px; padding: 9px 6px; border-bottom: 1px dashed #eee;
  font-size: 13px; color: #333; text-decoration: none; border-radius: 6px;
}
.reader-drawer-list a:hover { background: #f5f7fb; }
.reader-drawer-list a.active { color: #2f6bff; font-weight: 600; background: #f0f5ff; }
.reader-drawer-list a small { color: #9a9a9a; }

.reader-resume {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 65;
  display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-radius: 999px;
  background: rgba(28,31,36,.92); color: #fff; font-size: 12px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.reader-resume.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.reader-resume button { border: 0; background: transparent; color: #9ec1ff; font-size: 12px; cursor: pointer; }

/* ---------- 本地 SVG 图标 ---------- */
.icon { display: inline-block; vertical-align: -0.16em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon--fill { fill: currentColor; stroke: none; }

.nav-links a { display: inline-flex; align-items: center; gap: 6px; }
.nav-links a .icon { opacity: .78; }
.nav-links a.active .icon { opacity: 1; }

.admin-nav a { display: flex; align-items: center; gap: 8px; }
.admin-nav a .icon { opacity: .8; }
.admin-nav a.active .icon { opacity: 1; }

.mobile-tab a .icon { margin-bottom: 2px; }

/* 搜索框内的图标 */
.nav-search { position: relative; }
.nav-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #98a2b3; }
.nav-search input { padding-left: 32px; }

/* ---------- 首页：站内搜索 / 频道入口 / 快捷筛选 ---------- */
.hero-search {
  display: flex; align-items: center; gap: 10px; margin-top: 18px;
  max-width: 620px; padding: 8px 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 999px;
  box-shadow: 0 6px 20px rgba(20, 30, 60, .06);
}
.hero-search .icon { color: #98a2b3; margin-left: 6px; }
.hero-search input { flex: 1; border: 0; outline: 0; background: transparent; height: 34px; font-size: 14px; }
.hero-search .btn { border-radius: 999px; }
.hero-hot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.channel-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.channel-card {
  position: relative; padding: 18px 18px 16px; border-radius: 16px; color: #fff;
  text-decoration: none; overflow: hidden; min-height: 118px;
  background: linear-gradient(135deg, #2c4a7c, #4f74a8);
  transition: transform .15s ease, box-shadow .15s ease;
}
.channel-card.female { background: linear-gradient(135deg, #7b3f5e, #b06c8e); }
.channel-card.general { background: linear-gradient(135deg, #3c5a52, #6f8f80); }
.channel-card.all { background: linear-gradient(135deg, #2b2f38, #555f6f); }
.channel-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(20, 30, 60, .16); }
.channel-card .channel-count { font-size: 12px; opacity: .8; }
.channel-card .channel-name { font-family: var(--serif); font-size: 26px; font-weight: 700; margin-top: 6px; }
.channel-card .channel-desc { font-size: 12px; opacity: .78; margin-top: 6px; }

mark { background: #ffe58a; color: inherit; padding: 0 1px; border-radius: 3px; }

@media (max-width: 760px) {
  .channel-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .channel-card { min-height: 96px; padding: 14px; }
  .channel-card .channel-name { font-size: 21px; }
  .hero-search { border-radius: 14px; }
}

.work-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.chip.mini { font-size: 11px; padding: 1px 7px; border-radius: 999px; }

/* 章节清单编辑（创作页） */
.ch-row { display: grid; grid-template-columns: 40px 1.1fr 1.7fr 1fr 96px; gap: 6px; align-items: center; padding: 6px 8px; border-bottom: 1px dashed var(--line); }
.ch-row:last-child { border-bottom: 0; }
.ch-row input { font-size: 12px; padding: 6px 8px; }
.ch-row .ch-no { font-size: 12px; color: var(--ink-mute); }
.ch-row .ch-ops { display: flex; gap: 4px; justify-content: flex-end; }
@media (max-width: 760px) {
  .ch-row { grid-template-columns: 28px 1fr; }
  .ch-row .ch-summary, .ch-row .ch-conflict { grid-column: 2 / 3; }
  .ch-row .ch-ops { grid-column: 1 / 3; justify-content: flex-start; }
}

/* 首页功能板块：图标 + 渐变底 + 悬浮反馈 */
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.feature-tile { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(160deg, #fff, #faf8f4); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; overflow: hidden; }
.feature-tile::after { content: ""; position: absolute; right: -34px; bottom: -46px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, rgba(31,58,95,.10), transparent 70%); pointer-events: none; }
.feature-tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(31,58,95,.12); border-color: #d8d2c6; }
.feature-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #1f3a5f, #4a6a8f); margin-bottom: 6px; box-shadow: 0 6px 14px rgba(31,58,95,.18); }
.feature-tile.male .feature-icon { background: linear-gradient(135deg, #1f3a5f, #3f6f9c); }
.feature-tile.female .feature-icon { background: linear-gradient(135deg, #8a4b6b, #c07a94); }
.feature-tile.convert .feature-icon { background: linear-gradient(135deg, #2f5d63, #5aa0a0); }
.feature-tile.buyout .feature-icon { background: linear-gradient(135deg, #8a6f3d, #b08d47); }
.feature-tile strong { font-size: 15px; }
.feature-tile span:last-child { font-size: 12px; color: var(--ink-mute); line-height: 1.65; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .feature-grid { grid-template-columns: 1fr; } }

/* 排行榜：移动端不再强制 720px，简介在格内换行，次要列收起 */
.rank-table .rank-intro { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; overflow-wrap: anywhere; }
@media (max-width: 768px) {
  .rank-table { min-width: 0 !important; }
  .rank-table th, .rank-table td { white-space: normal; padding: 8px 6px; }
  .rank-table .col-author, .rank-table .col-buy, .rank-table .col-rating { display: none; }
  .rank-table td:nth-child(2) { max-width: 0; width: 100%; }
  .rank-table thead th:nth-child(2) { width: 100%; }
}

/* 生成按钮加载态：禁用 + 旋转动画，避免重复点击 */
.btn.is-loading { position: relative; padding-left: 34px; opacity: .85; pointer-events: none; cursor: progress; }
.btn.is-loading::before { content: ""; position: absolute; left: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: moyue-spin .7s linear infinite; }
.btn.ghost.is-loading::before, .btn.subtle.is-loading::before { border-color: rgba(31,58,95,.22); border-top-color: #1f3a5f; }
@keyframes moyue-spin { to { transform: rotate(360deg); } }
/* 慢任务（AI 出图）生成期提示：离开页面会中断生成 */
.busy-warn { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; background: #fff7e6; border: 1px solid #f0d9a8; color: #7a5a1e; font-size: 12.5px; line-height: 1.6; }
.busy-warn::before { content: "!"; flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; background: #e0a53c; color: #fff; font-size: 12px; font-weight: 700; line-height: 16px; text-align: center; }
.stream-box.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.75; }

.grid .span-all { grid-column: 1 / -1; }
@media (max-width: 768px) { .grid .span-all { grid-column: auto; } }


/* 写作技能标签与选择器（智能创作页配置面板） */
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 26px; }
.skill-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border: 1px solid rgba(35,65,110,.16); border-radius: 999px; background: rgba(35,65,110,.06); color: var(--brand); font-size: 12px; }
.skill-tag b { font-weight: 600; }
.skill-tag-x { border: 0; background: transparent; color: var(--brand); opacity: .55; cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 50%; }
.skill-tag-x:hover { opacity: 1; background: rgba(35,65,110,.12); }
.skill-picker { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; max-height: 220px; overflow: auto; box-shadow: 0 10px 24px rgba(24,34,52,.08); }
.skill-option { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-bottom: 1px solid rgba(0,0,0,.04); background: transparent; cursor: pointer; }
.skill-option:last-child { border-bottom: 0; }
.skill-option:hover { background: rgba(35,65,110,.05); }
.skill-option span { font-size: 13px; font-weight: 600; color: var(--ink); }
.skill-option em { font-style: normal; font-size: 11px; color: var(--brand); background: rgba(35,65,110,.07); border-radius: 999px; padding: 1px 8px; align-self: start; }
.skill-option small { grid-column: 1 / -1; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }

/* ============================================================
   v1.10.4 首页改版：书卷气 + 高密度卡片（桌面 / 手机双端）
   ============================================================ */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr);
  gap: 44px;
  align-items: center;
  padding: 46px 0 34px;
  border-bottom: 1px solid var(--line);
  overflow-x: clip;
}
.home-hero::before {
  content: "";
  position: absolute; inset: -60px -40vw 0;
  background:
    radial-gradient(520px 260px at 18% 12%, rgba(31,58,95,.10), transparent 65%),
    radial-gradient(420px 240px at 82% 0%, rgba(176,141,71,.13), transparent 70%);
  pointer-events: none; z-index: -1;
}
.home-hero-copy .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(31,58,95,.16);
  background: rgba(255,255,255,.7); color: var(--brand); font-size: 12px; letter-spacing: .4px;
}
.home-hero h1 {
  font-family: var(--serif); font-size: clamp(30px, 3.6vw, 52px); line-height: 1.14;
  letter-spacing: 1px; margin: 16px 0 14px;
}
.home-hero h1 em { font-style: normal; color: var(--accent); }
.home-hero .lead { max-width: 520px; color: var(--ink-soft); font-size: 15px; margin: 0 0 4px; }
.home-search { max-width: 540px; margin-top: 20px; }
.home-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.home-hero-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.home-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 460px; margin: 26px 0 0; padding: 0; }
.home-stats div { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.68); border: 1px solid var(--line); }
.home-stats dt { font-size: 11px; color: var(--ink-mute); letter-spacing: .5px; }
.home-stats dd { margin: 2px 0 0; font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.home-stats dd small { font-family: var(--font); font-size: 11px; color: var(--ink-mute); font-weight: 400; }

.home-hero-panel {
  position: relative; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px;
  padding: 18px; border-radius: 20px; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 18px 46px rgba(24,34,52,.12);
}
.home-hero-panel::after {
  content: ""; position: absolute; inset: 10px -10px -10px 10px; border-radius: 20px;
  border: 1px solid rgba(31,58,95,.08); z-index: -1;
}
.panel-label {
  position: absolute; top: -11px; left: 18px; display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; letter-spacing: .5px;
}
.panel-cover { display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 4; background: linear-gradient(160deg, #1f3a5f, #8a6f3d); }
.panel-cover img { width: 100%; height: 100%; object-fit: cover; }
.panel-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.panel-copy h3 { font-family: var(--serif); font-size: 19px; margin: 0; }
.panel-copy h3 a { color: var(--ink); }
.panel-copy p { font-size: 12px; color: var(--ink-soft); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.panel-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--ink-mute); }
.panel-price { color: var(--accent); font-weight: 700; }
.panel-btn { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; }

.section.home-section { padding: 26px 0 0; }
.section.home-section.tight { padding-top: 18px; }
.head-note { display: block; font-size: 12px; color: var(--ink-mute); margin-top: 2px; }
.home-section .section-head h2 { display: inline-flex; align-items: center; gap: 7px; font-size: 21px; }
.home-section .section-head .more { display: inline-flex; align-items: center; gap: 4px; }
.home-section .section-head .more:hover { color: var(--accent); }

/* 入口卡：横向紧凑卡片，代替整块大白卡 */
.feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.feature-tile {
  flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(20,20,20,.02);
}
.feature-tile::after { display: none; }
.feature-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(31,58,95,.10); border-color: rgba(31,58,95,.18); }
.feature-icon { width: 38px; height: 38px; border-radius: 11px; margin: 0; flex: none; }
.feature-icon .icon { width: 20px; height: 20px; }
.feature-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.feature-body strong { font-size: 14px; }
.feature-body span { font-size: 11px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feature-count { margin-left: auto; font-size: 11px; color: var(--ink-mute); white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.feature-arrow { position: absolute; top: 10px; right: 10px; color: rgba(31,58,95,.35); opacity: 0; transition: opacity .15s ease; }
.feature-tile:hover .feature-arrow { opacity: 1; }

/* 筛选条 */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.7); border: 1px solid var(--line); }
.filter-label { flex: none; white-space: nowrap; font-size: 11px; color: var(--ink-mute); letter-spacing: .5px; margin-right: 2px; }
.filter-bar .chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; font-size: 12px; }
.filter-bar .chip:not(.active) { background: #fff; }
.filter-bar .chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.filter-bar .chip .icon { opacity: .75; }
.filter-bar select { height: 34px; padding: 0 30px 0 10px; font-size: 13px; line-height: 32px; background-color: #fff; }
.filter-bar input[type="text"], .filter-bar input[type="search"] { height: 34px; padding: 0 10px; font-size: 13px; }
.filter-bar form { align-items: center; }


/* 三张活动卡：等高、紧凑 */
.home-banners { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.banner-card.compact::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,14,24,.05) 0%, rgba(8,14,24,.55) 62%, rgba(8,14,24,.78) 100%);
  pointer-events: none;
}
.banner-card.compact .inner, .banner-card.compact .banner-icon, .banner-card.compact .banner-arrow { position: relative; z-index: 1; }
.banner-card.compact .banner-icon, .banner-card.compact .banner-arrow { position: absolute; }
.banner-card.compact {
  min-height: 128px; padding: 18px; border-radius: 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  background: linear-gradient(135deg, #24405f, #43688d);
}
.banner-card.compact.convert { background: linear-gradient(135deg, #24405f, #3f6f8d); }
.banner-card.compact.buyout { background: linear-gradient(135deg, #7d6438, #b08d47); }
.banner-card.compact.deconstruct { background: linear-gradient(135deg, #3a2f4f, #6b4f8a); }
.banner-card.compact h3 { font-size: 18px; margin: 0; }
.banner-card.compact p { font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.banner-icon { position: absolute; top: 14px; left: 16px; width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.16); display: grid; place-items: center; color: #fff; }
.banner-arrow { position: absolute; top: 14px; right: 14px; color: rgba(255,255,255,.8); }

/* 书架栅格：一屏能看到更多书 */
.grid.home-shelf { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.home-shelf .work-body { padding: 10px 12px 12px; gap: 5px; }
.home-shelf .work-title { font-size: 14px; }
.home-shelf .work-intro { font-size: 12px; -webkit-line-clamp: 2; }

/* 榜单：双列紧凑 */
.home-rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rank-card { padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.rank-card .section-head { margin-bottom: 8px; }
.rank-card .section-head h2 { font-size: 17px; display: inline-flex; align-items: center; gap: 6px; }
.rank-list { display: flex; flex-direction: column; }
.rank-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px dashed var(--line); color: inherit; }
.rank-item:last-child { border-bottom: 0; }
.rank-item:hover { background: rgba(31,58,95,.03); border-radius: 8px; }
.rank-no { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--ink-mute); background: rgba(0,0,0,.035); }
.rank-item.top .rank-no { color: #fff; background: linear-gradient(135deg, #b08d47, #d8b46a); }
.rank-item .t { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.rank-title { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rank-item .n { font-size: 11px; color: var(--ink-mute); }
.rank-value { font-size: 11px; color: var(--ink-mute); white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }

/* 题材区 */
.category-panel { padding: 20px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.category-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.category-cloud .chip { padding: 6px 13px; font-size: 12.5px; background: #fbfaf7; }

/* ---------- 首页 手机端（≤760px）：紧凑两列，去掉大留白 ---------- */
@media (max-width: 760px) {
  .home-hero { grid-template-columns: 1fr; gap: 18px; padding: 18px 0 16px; }
  .home-hero h1 { font-size: 30px; margin: 12px 0 10px; letter-spacing: .5px; }
  .home-hero .lead { font-size: 13.5px; line-height: 1.6; margin-bottom: 0; }
  .home-hero-copy .eyebrow { font-size: 11px; padding: 4px 9px; }
  .home-search { margin-top: 14px; border-radius: 12px; padding: 6px 8px; }
  .home-hero-actions { gap: 8px; margin-top: 12px; }
  .home-hero-actions .btn { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .home-stats { margin-top: 14px; gap: 8px; }
  .home-stats div { padding: 8px 9px; border-radius: 10px; }
  .home-stats dd { font-size: 19px; }
  .home-stats dt { font-size: 10px; }
  .home-hero-panel { grid-template-columns: 78px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 16px; }
  .home-hero-panel::after { display: none; }
  .panel-copy h3 { font-size: 16px; }
  .panel-copy p { -webkit-line-clamp: 2; font-size: 11.5px; }
  .panel-btn { height: 30px; padding: 0 10px; font-size: 12px; }

  .section.home-section { padding: 18px 0 0; }
  .section.home-section.tight { padding-top: 12px; }
  .home-section .section-head { margin-bottom: 10px; }
  .home-section .section-head h2 { font-size: 17px; }
  .head-note { font-size: 11px; }
  .more { font-size: 11.5px; }

  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .feature-tile { padding: 10px; gap: 8px; border-radius: 12px; }
  .feature-icon { width: 32px; height: 32px; border-radius: 9px; }
  .feature-icon .icon { width: 17px; height: 17px; }
  .feature-body strong { font-size: 13px; }
  .feature-body span { font-size: 10px; }
  .feature-count { font-size: 10px; margin-left: 0; }
  .feature-arrow { display: none; }

  .filter-bar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 8px 10px; gap: 6px; scrollbar-width: none; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-bar .chip { flex: none; padding: 4px 10px; font-size: 11.5px; }

  .home-banners { display: flex; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 2px; }
  .home-banners::-webkit-scrollbar { display: none; }
  .banner-card.compact { flex: 0 0 78%; min-height: 108px; padding: 14px; border-radius: 14px; scroll-snap-align: start; }
  .banner-card.compact h3 { font-size: 15px; }
  .banner-card.compact p { font-size: 11px; -webkit-line-clamp: 2; }
  .banner-icon { width: 26px; height: 26px; top: 12px; left: 14px; }

  .grid.home-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .home-shelf .work-body { padding: 8px 8px 10px; gap: 3px; }
  .home-shelf .work-title { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .home-shelf .work-intro, .home-shelf .work-tags, .home-shelf .work-meta:last-child { display: none; }
  .home-shelf .work-meta { font-size: 10px; gap: 4px; }
  .home-shelf .badge { font-size: 10px; padding: 1px 5px; }
  .home-shelf .price-tag { display: none; }

  .home-rank-grid { grid-template-columns: 1fr; gap: 10px; }
  .rank-card { padding: 14px; border-radius: 14px; }
  .rank-card .section-head h2 { font-size: 15px; }
  .rank-item { padding: 7px 2px; gap: 8px; }
  .rank-no { width: 20px; height: 20px; font-size: 11px; border-radius: 6px; }
  .rank-title { font-size: 12.5px; }
  .rank-item .badge { display: none; }
  .rank-value { font-size: 10.5px; }

  .category-panel { padding: 14px; border-radius: 14px; }
  .category-cloud { gap: 6px; }
  .category-cloud .chip { padding: 5px 10px; font-size: 11.5px; }
}

/* 平板：入口卡两列、榜单两列、书架四列 */
@media (min-width: 761px) and (max-width: 1024px) {
  .home-hero { gap: 28px; padding: 32px 0 24px; }
  .home-hero h1 { font-size: 38px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.home-shelf { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .home-banners { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .banner-card.compact { min-height: 118px; }
}

/* ============================================================
   v1.10.6 首页信息架构：功能入口优先 + 分层分类导航
   ============================================================ */
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tool-card {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: 14px; border: 1px solid var(--line); background: #fff;
  box-shadow: 0 1px 0 rgba(20,20,20,.02); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(31,58,95,.10); border-color: rgba(31,58,95,.18); }
.tool-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, #24405f, #4a6a8f); }
.tool-card.convert .tool-icon { background: linear-gradient(135deg, #2f6b63, #4d9a8a); }
.tool-card.deconstruct .tool-icon { background: linear-gradient(135deg, #5a4770, #7d6399); }
.tool-card.buyout .tool-icon { background: linear-gradient(135deg, #8a6f3d, #b08d47); }
.tool-card.creator .tool-icon { background: linear-gradient(135deg, #6b4a3a, #a3765c); }
.tool-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-body strong { font-size: 14px; color: var(--ink); }
.tool-body span { font-size: 11px; color: var(--ink-mute); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-tag { position: absolute; top: 10px; right: 10px; font-size: 10px; color: var(--ink-mute); background: rgba(0,0,0,.04); border-radius: 999px; padding: 1px 7px; }
.tool-card.ai { border-color: rgba(31,58,95,.22); background: linear-gradient(150deg, #fff, #f4f7fb); }
.tool-card.ai .tool-tag { color: var(--brand); background: rgba(31,58,95,.09); }
.tool-card.buyout .tool-body strong, .tool-card.convert .tool-body strong { letter-spacing: .2px; }

.category-nav { padding: 6px 18px 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.cat-group { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.cat-group:last-child { border-bottom: 0; padding-bottom: 4px; }
.cat-label { font-size: 12px; color: var(--ink-mute); line-height: 30px; letter-spacing: .5px; }
.cat-items { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-items .chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cat-items .chip:not(.active) { background: #fbfaf7; }
.cat-items .chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-items .chip:hover { background: #fff; }
.cat-items .chip em { font-style: normal; font-size: 10.5px; color: var(--ink-mute); background: rgba(0,0,0,.05); border-radius: 999px; padding: 0 6px; line-height: 16px; }
.cat-group.quick .chip { background: #fff; }

.genre-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.genre-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(150deg, #fff, #faf8f4); }
.genre-card:hover { border-color: rgba(31,58,95,.2); box-shadow: 0 8px 20px rgba(31,58,95,.08); }
.genre-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, #24405f, #4a6a8f); }
.genre-card.script .genre-icon { background: linear-gradient(135deg, #2f6b63, #4d9a8a); }
.genre-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.genre-body strong { font-size: 15px; }
.genre-body span { font-size: 11px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genre-count { margin-left: auto; font-size: 11px; color: var(--ink-mute); white-space: nowrap; }
.cat-group .script-types { grid-column: 2; margin-top: 8px; }
.script-types .chip.mini { white-space: nowrap; }
.script-types .chip.mini { background: #fff; }

/* 手机：功能两列、分类单列标签、体裁上下排列 */
@media (max-width: 760px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tool-card { padding: 10px; gap: 9px; border-radius: 12px; }
  .tool-icon { width: 32px; height: 32px; border-radius: 9px; }
  .tool-icon .icon { width: 17px; height: 17px; }
  .tool-body strong { font-size: 13px; }
  .tool-body span { font-size: 10px; -webkit-line-clamp: 2; }
  .tool-tag { top: 7px; right: 8px; font-size: 9px; padding: 0 6px; }

  .category-nav { padding: 2px 12px 10px; border-radius: 14px; }
  .cat-group { grid-template-columns: 1fr; gap: 6px; padding: 11px 0; }
  .cat-label { line-height: 1.4; font-size: 11px; }
  .cat-items { gap: 6px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: none; }
  .cat-items::-webkit-scrollbar { display: none; }
  .cat-items .chip { flex: none; padding: 4px 10px; font-size: 11.5px; }
  .cat-items .chip em { font-size: 10px; }
  .genre-row { grid-template-columns: 1fr; gap: 8px; }
  .genre-card { padding: 10px 12px; }
  .genre-icon { width: 32px; height: 32px; }
  .genre-body strong { font-size: 14px; }
  .genre-body span { font-size: 10.5px; }
  .cat-group .script-types { grid-column: auto; margin-top: 6px; }
}

@media (min-width: 761px) and (max-width: 1024px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* 余额不足充值引导 */
.recharge-cta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 10px 0; padding: 10px 14px; border-radius: 12px; background: #fff7e6; border: 1px solid #f0d9a8; color: #7a5a1e; font-size: 13px; }
.recharge-cta .btn { background: var(--accent); border-color: var(--accent); }
.recharge-cta .btn:hover { background: #9c7a38; }

/* ---------- 剧本阅读：场次 / 人物 / 时间线 ---------- */
.script-reader {
  --sp-bg: #eef1f6;
  --sp-card: #ffffff;
  --sp-ink: #1a1d24;
  --sp-soft: #6b7280;
  --sp-line: #e6e9ef;
  --sp-tint: #f5f7fb;
  --sp-accent: #2f6bff;
  --sp-shadow: 0 18px 46px rgba(23, 34, 58, .07);
  background: var(--sp-bg);
}
body.script-reader .reader-top {
  background: rgba(238, 241, 246, .92);
  border-bottom-color: #dfe3eb;
  color: #4b5563;
}
body.script-reader .reader-top .title { color: #202431; }
body.script-reader .reader-top a { color: #4b5563; }
.script-shell {
  max-width: 1160px;
  padding: 24px 24px 96px;
  background: transparent;
  box-shadow: none;
  color: var(--sp-ink);
}
.script-head { margin: 0 0 22px; }
.script-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--sp-soft);
  letter-spacing: .02em;
}
.script-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 7px;
  background: #171a22;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
}
body[data-reader-theme="dark"] .script-badge { background: #2f6bff; }
.script-soft {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sp-tint);
  border: 1px solid var(--sp-line);
  color: var(--sp-soft);
}
.script-title {
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: .01em;
  margin: 12px 0 8px;
  color: var(--sp-ink);
}
.script-sub {
  margin: 0 0 16px;
  font-size: 12.5px;
  color: var(--sp-soft);
  letter-spacing: .02em;
}
.script-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: baseline;
  margin: 0 0 16px;
}
.script-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
  color: var(--sp-soft);
}
.script-stats b {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  color: var(--sp-ink);
  font-weight: 700;
}
.script-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.script-tools button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--sp-line);
  background: var(--sp-card);
  color: #3b4250;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.script-tools button:hover { border-color: #c7d2e4; box-shadow: 0 6px 16px rgba(31, 45, 76, .08); }
.script-tools button b {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sp-tint);
  color: var(--sp-accent);
  font-size: 11px;
  line-height: 20px;
  text-align: center;
}
.script-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 24px;
  align-items: start;
}
.script-main {
  min-width: 0;
  background: var(--sp-card);
  border: 1px solid var(--sp-line);
  border-radius: 20px;
  box-shadow: var(--sp-shadow);
  padding: 30px 38px 34px;
}
.scene-jumpbar {
  position: sticky;
  top: 43px;
  z-index: 6;
  background: var(--sp-card);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 16px;
  margin: 0 0 6px;
  border-bottom: 1px dashed var(--sp-line);
  scrollbar-width: none;
}
.scene-jumpbar::-webkit-scrollbar { display: none; }
.scene-jumpbar a {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--sp-line);
  color: var(--sp-soft);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: all .15s;
}
.scene-jumpbar a:hover { color: var(--sp-ink); border-color: #c7d2e4; }
.scene-jumpbar a.active { background: #171a22; border-color: #171a22; color: #fff; }
body[data-reader-theme="dark"] .scene-jumpbar a.active { background: var(--sp-accent); border-color: var(--sp-accent); }
.scene { padding: 26px 0 0; scroll-margin-top: 72px; }
.scene + .scene { margin-top: 8px; border-top: 1px dashed var(--sp-line); }
.scene-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 13px;
  background: var(--sp-tint);
  border: 1px solid var(--sp-line);
}
.scene-no {
  flex: none;
  padding: 4px 10px;
  border-radius: 8px;
  background: #171a22;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
}
body[data-reader-theme="dark"] .scene-no { background: var(--sp-accent); }
.scene-place { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.scene-sep {
  font-style: normal;
  font-size: 11px;
  color: var(--sp-soft);
  opacity: .5;
}
.scene-place b {
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--sp-ink);
  letter-spacing: .02em;
}
.scene-place span { font-size: 12px; color: var(--sp-soft); }
.scene-cast { display: flex; flex-wrap: wrap; gap: 5px; margin-left: auto; }
.cast-chip {
  border: 0;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
  color: var(--c, #46506a);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 30, 50, .08);
  transition: transform .12s, box-shadow .12s;
}
.cast-chip:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px rgba(20, 30, 50, .18); }
.sp-body { padding: 18px 0 6px; }
.sp-action {
  margin: 0 0 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: var(--serif);
  font-size: .98em;
  line-height: 1.95;
  color: #3b414e;
  white-space: normal;
}
.sp-note {
  margin: 15px 0;
  text-align: center;
  font-size: .76em;
  color: var(--sp-soft);
  font-style: italic;
  line-height: 1.7;
}
.sp-note span { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--sp-tint); }
.sp-transition {
  margin: 20px 0 4px;
  text-align: right;
  font-size: .72em;
  letter-spacing: .12em;
  color: var(--sp-soft);
  font-weight: 600;
}
.sp-line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  margin: 15px 0;
  transition: opacity .18s;
}
.sp-who::after {
  content: "：";
  margin-left: 1px;
  opacity: .32;
  font-weight: 400;
}
.sp-who {
  padding-top: 3px;
  text-align: right;
  font-family: var(--font);
  font-size: .8em;
  font-weight: 700;
  color: var(--c, #2f6bff);
  letter-spacing: .02em;
  word-break: break-word;
}
.sp-say { min-width: 0; }
.sp-paren {
  display: inline-block;
  margin-right: 5px;
  font-size: .78em;
  font-style: italic;
  color: var(--sp-soft);
}
.sp-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: var(--serif);
  font-size: 1em;
  line-height: 1.9;
  color: var(--sp-ink);
}
.sp-line.voice .sp-who { color: #8b93a3; font-weight: 600; }
.sp-line.voice .sp-text { color: #5b6374; font-style: italic; }
.sp-line.is-dim { opacity: .24; }
.sp-empty { padding: 30px 0; text-align: center; color: var(--sp-soft); font-size: 13px; }
.scene-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--sp-line);
  font-size: 11.5px;
  color: var(--sp-soft);
}
.scene-foot a { color: var(--sp-accent); text-decoration: none; }
.script-rail {
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 84px);
  overflow: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.rail-card {
  background: var(--sp-card);
  border: 1px solid var(--sp-line);
  border-radius: 16px;
  padding: 15px 15px 13px;
  box-shadow: 0 10px 26px rgba(23, 34, 58, .05);
}
.rail-card h2 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--sp-ink);
}
.rail-card h2 span { font-size: 11px; font-weight: 400; color: var(--sp-soft); letter-spacing: 0; }
.rail-cast { display: flex; flex-direction: column; gap: 2px; }
.cast-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sp-ink);
  text-align: left;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.cast-item:hover { background: var(--sp-tint); }
.cast-item.in-chapter { background: #f4f8ff; }
body[data-reader-theme="dark"] .cast-item.in-chapter { background: #1d2637; }
.cast-item.is-focus { box-shadow: inset 0 0 0 1px var(--sp-accent); background: #eef4ff; }
body[data-reader-theme="dark"] .cast-item.is-focus { background: #1b2740; }
.cast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #2f6bff); }
.cast-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-meta { font-size: 10.5px; color: var(--sp-soft); white-space: nowrap; }
.rail-hint { margin: 9px 2px 0; font-size: 10.5px; line-height: 1.6; color: var(--sp-soft); }
.rail-empty { margin: 6px 2px; font-size: 12px; color: var(--sp-soft); }
.timeline { list-style: none; margin: 2px 0 0; padding: 0; }
.tl-item { position: relative; padding-left: 16px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  bottom: -2px;
  width: 1px;
  background: var(--sp-line);
}
.tl-item:last-child::before { display: none; }
.tl-item a {
  position: relative;
  display: block;
  padding: 7px 2px 7px 0;
  color: inherit;
  text-decoration: none;
}
.tl-dot {
  position: absolute;
  left: -18px;
  top: 13px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9d0dd;
  box-shadow: 0 0 0 3px var(--sp-card);
}
.tl-body b {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--sp-ink);
  line-height: 1.5;
}
.tl-body small { display: block; margin-top: 2px; font-size: 10.5px; line-height: 1.55; color: var(--sp-soft); }
.tl-item.current .tl-dot { background: var(--sp-accent); }
.tl-item.current b { color: var(--sp-accent); }
.tl-item.current small { color: #5a6375; }
.tl-item.locked { opacity: .55; }
.script-drawer-body { overflow: auto; margin-top: 8px; }
.script-drawer .cast-item { grid-template-columns: 10px minmax(0, 1fr) auto; padding: 10px 8px; }
.script-drawer .timeline { padding: 4px 0 0 18px; }

/* 人物配色：与 .sp-cN 对应 */
.sp-c1 { --c: #2f6bff; }
.sp-c2 { --c: #e0574d; }
.sp-c3 { --c: #1f9d72; }
.sp-c4 { --c: #a260e0; }
.sp-c5 { --c: #d68a1d; }
.sp-c6 { --c: #0f8fa8; }
.sp-c7 { --c: #c7478c; }
.sp-c8 { --c: #5d6b82; }

/* 护眼米黄 */
body[data-reader-theme="sepia"].script-reader {
  --sp-bg: #efe6d3;
  --sp-card: #fbf4e4;
  --sp-ink: #2f2a22;
  --sp-soft: #84775f;
  --sp-line: #e4d8c0;
  --sp-tint: #f4ead6;
  --sp-shadow: 0 18px 46px rgba(120, 95, 40, .08);
}
body[data-reader-theme="sepia"] .sp-action { color: #4a4233; }

/* 夜间 */
body[data-reader-theme="dark"].script-reader {
  --sp-bg: #0f1116;
  --sp-card: #171a21;
  --sp-ink: #dde2ec;
  --sp-soft: #8c95a6;
  --sp-line: #262c37;
  --sp-tint: #1e232c;
  --sp-accent: #6d9bff;
  --sp-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
body[data-reader-theme="dark"] .reader-top {
  background: rgba(15, 17, 22, .94);
  border-bottom-color: #242a35;
  color: #aab3c4;
}
body[data-reader-theme="dark"] .reader-top .title,
body[data-reader-theme="dark"] .reader-top a { color: #d7dce8; }
body[data-reader-theme="dark"] .sp-action { color: #c4cad6; }
body[data-reader-theme="dark"] .sp-line.voice .sp-text { color: #98a2b5; }
body[data-reader-theme="dark"] .cast-chip { background: #20262f; box-shadow: inset 0 0 0 1px #303744; }
body[data-reader-theme="dark"] .script-tools button {
  background: #191d25;
  border-color: #2a313d;
  color: #c7cfdd;
}
body[data-reader-theme="dark"] .script-tools button b { background: #232a36; }
body[data-reader-theme="dark"] .scene-jumpbar a { border-color: #2a313d; color: #9aa4b6; }
body[data-reader-theme="dark"] .scene-jumpbar a:hover { color: #e0e5ef; border-color: #3a4453; }
body[data-reader-theme="dark"] .tl-item.current small { color: #a6afc0; }

@media (max-width: 1024px) {
  .script-shell { max-width: 100%; padding: 18px 16px 96px; }
  .script-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .script-rail { display: none; }
  .script-main { padding: 24px 26px 28px; }
  .script-title { font-size: 27px; }
}
@media (max-width: 720px) {
  .script-shell { padding: 12px 10px 92px; }
  .script-head { margin-bottom: 14px; }
  .script-title { font-size: 23px; margin: 10px 0 6px; }
  .script-sub { margin-bottom: 12px; }
  .script-stats { gap: 14px; margin-bottom: 12px; }
  .script-stats b { font-size: 18px; }
  .script-main { padding: 16px 14px 22px; border-radius: 15px; }
  .scene { padding-top: 20px; }
  .scene-head { padding: 9px 11px; border-radius: 11px; }
  .scene-place b { font-size: 14.5px; }
  .scene-cast { width: 100%; margin-left: 0; }
  .sp-line { grid-template-columns: minmax(0, 1fr); gap: 3px; margin: 13px 0; }
  .sp-who { text-align: left; padding-top: 0; font-size: .78em; }
  .sp-say { padding-left: 10px; border-left: 2px solid var(--c, #2f6bff); }
  .sp-text { font-size: 1em; line-height: 1.85; }
  .sp-action { font-size: .95em; line-height: 1.9; }
  .sp-note { text-align: left; }
  .sp-transition { text-align: left; }
  .scene-foot { flex-wrap: wrap; }
  .script-drawer { width: min(420px, 92vw); }
  .reader-settings { right: 10px; bottom: 14px; gap: 6px; }
  .reader-settings button { width: 38px; height: 38px; }
}
@media print {
  body.script-reader { background: #fff; }
  .reader-top, .reader-progress, .reader-settings, .reader-nav, .scene-jumpbar,
  .script-tools, .script-rail, .reader-drawer, .scene-foot a, .reader-resume { display: none !important; }
  .script-shell { padding: 0; max-width: none; }
  .script-layout { display: block; }
  .script-main { border: 0; box-shadow: none; padding: 0; }
  .scene { break-inside: avoid; }
  .sp-line, .sp-action { break-inside: avoid; }
  .scene-head { background: #f2f2f2; }
}
.reader-nav .btn.is-disabled { opacity: .32; pointer-events: none; }
body[data-reader-theme="dark"] .reader-settings button {
  background: #1b1f27;
  border-color: #2a313d;
  color: #cfd6e4;
}
/* 剧本页把字号/配色收进顶部工具条，避免固定悬浮按钮压住正文 */
body.script-reader .reader-settings { display: none; }
.script-typo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
  padding-left: 9px;
  border-left: 1px solid var(--sp-line);
}
.script-tools .script-typo button {
  width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
}
@media (max-width: 720px) {
  .script-typo { margin-left: 0; padding-left: 0; border-left: 0; }
}

/* 拉卡拉收银台：二维码与支付状态 */
.lakala-qr {
  width: 200px;
  max-width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.lakala-qr svg { display: block; width: 100%; height: auto; }

/* 后台支付配置：按支付方式切换，避免所有渠道混在一起 */
.pay-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pay-tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: var(--ink); font-size: 12.5px; cursor: pointer;
}
.pay-tab:hover { border-color: #c7d2e4; }
.pay-tab.active { background: #1f2937; border-color: #1f2937; color: #fff; }
.pay-tab .badge { font-size: 10px; padding: 1px 6px; }
.pay-tab.active .badge.free { background: rgba(31,157,114,.2); color: #b7f5dd; }
.pay-tab.active .badge.paid { background: rgba(217,83,79,.24); color: #ffd6d4; }
.pay-panel { display: none; }
.pay-panel.active { display: block; }
.pay-current {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline;
  margin-bottom: 12px; padding: 8px 10px; border-radius: 10px;
  background: #faf8f4; color: var(--ink-soft); font-size: 12px;
}
.pay-current code { font-family: monospace; font-size: 11px; color: var(--ink); }
.pay-current .ok { color: #1f9d72; }
.pay-current .miss { color: #d9534f; }

/* ---------- 剧本编辑器（结构化场次 / 台词） ---------- */
.script-editor { margin: 4px 0 18px; }
.se-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #faf8f4;
  margin-bottom: 12px;
}
.se-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.se-stats { font-size: 11.5px; color: var(--ink-mute); white-space: nowrap; }
.se-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 16px; align-items: start; }
.se-main { min-width: 0; }
.se-side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 10px; }
.se-side-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.se-side-card h4 { margin: 0 0 8px; font-size: 12.5px; letter-spacing: .04em; color: var(--ink); }
.se-side-card .btn { width: 100%; margin-bottom: 6px; }
.se-scene {
  border: 1px solid var(--line); border-radius: 14px; background: #fff;
  padding: 12px 14px 10px; margin-bottom: 12px;
}
.se-scene-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.se-no {
  flex: none; width: 24px; height: 24px; border-radius: 7px; background: #171a22; color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.se-input {
  height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px;
  font-size: 12.5px; color: var(--ink); background: #fff;
}
.se-label { width: 88px; font-weight: 600; }
.se-location { flex: 1 1 140px; min-width: 110px; }
.se-time { width: 66px; }
.se-ie { width: 78px; padding-right: 4px; }
.se-flex { flex: 1; }
.se-mini {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft); border-radius: 6px;
  min-width: 24px; height: 24px; padding: 0 5px; font-size: 11px; cursor: pointer;
}
.se-mini:hover { background: #f5f7fb; color: var(--ink); }
.se-mini.danger { color: #c34b4b; }
.se-blocks { margin: 10px 0 6px; display: flex; flex-direction: column; gap: 8px; }
.se-block { border-left: 3px solid #d8dee9; border-radius: 8px; padding: 7px 9px 7px 10px; background: #fcfbf8; }
.se-block.se-action { border-left-color: #8794aa; }
.se-block.se-dialogue { border-left-color: #2f6bff; background: #f7faff; }
.se-block.se-note { border-left-color: #d4a33a; background: #fffaf0; }
.se-block.se-transition { border-left-color: #9aa3b2; background: #f7f7f9; }
.se-block-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.se-badge { font-size: 10.5px; color: var(--ink-mute); letter-spacing: .08em; }
.se-block-actions { display: flex; gap: 2px; }
.se-dialogue-grid { display: grid; grid-template-columns: 105px 125px minmax(0, 1fr); gap: 6px; align-items: start; }
.se-text {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 8px; font-size: 13px; line-height: 1.7; font-family: var(--serif); color: var(--ink);
  background: #fff; resize: vertical;
}
.se-block.se-note .se-text { font-style: italic; color: var(--ink-soft); }
.se-block.se-transition .se-text, .se-block.se-transition .se-input { font-size: 12px; color: var(--ink-mute); }
.se-scene-foot { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; }
.se-add-mini {
  border: 1px dashed #d8d2c4; background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 4px 9px; font-size: 11px; cursor: pointer;
}
.se-add-mini:hover { border-color: #b9ad95; color: var(--ink); background: #faf8f4; }
.se-cast { display: flex; flex-wrap: wrap; gap: 5px; }
.se-cast-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  background: #f3f7ff; color: #2f6bff; font-size: 11px;
}
.se-cast-chip small { color: var(--ink-mute); font-size: 10px; }
.se-preview {
  margin-top: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; white-space: pre-wrap; font-family: var(--serif); font-size: 13.5px;
  line-height: 1.9; color: var(--ink); max-height: 520px; overflow: auto;
}
.se-empty { padding: 30px 12px; text-align: center; color: var(--ink-mute); font-size: 13px; border: 1px dashed var(--line); border-radius: 12px; }
@media (max-width: 900px) {
  .se-layout { grid-template-columns: minmax(0, 1fr); }
  .se-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (max-width: 640px) {
  .se-scene { padding: 10px 10px 8px; }
  .se-label { width: 76px; }
  .se-location { flex-basis: 100%; order: 2; }
  .se-time, .se-ie { width: 74px; }
  .se-dialogue-grid { grid-template-columns: 1fr 1fr; }
  .se-dialogue-grid .se-text { grid-column: 1 / -1; }
  .se-toolbar { align-items: flex-start; }
  .se-stats { white-space: normal; }
}

/* 收银台：拉卡拉支付弹层（同一页面内嵌 iframe，不跳转） */
body.pay-modal-open { overflow: hidden; }
.pay-modal {
  position: fixed; inset: 0; z-index: 120; display: none;
  align-items: center; justify-content: center; padding: 24px;
}
.pay-modal.open { display: flex; }
.pay-modal-backdrop {
  position: absolute; inset: 0; background: rgba(15, 20, 30, .55);
  backdrop-filter: blur(2px);
}
.pay-modal-panel {
  position: relative; z-index: 1; width: min(580px, 94vw); height: min(760px, 86vh);
  background: #fff; border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.pay-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: #faf8f4;
}
.pay-modal-head strong { font-size: 14px; }
.pay-modal-close {
  border: 0; background: transparent; color: var(--ink-soft); font-size: 22px;
  line-height: 1; cursor: pointer; padding: 0 4px;
}
.pay-modal-body { flex: 1; min-height: 0; background: #eef1f6; }
.pay-modal-body iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.pay-modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 14px; border-top: 1px solid var(--line); background: #faf8f4;
}
.pay-modal-foot .hint { font-size: 11.5px; }
@media (max-width: 640px) {
  .pay-modal { padding: 0; }
  .pay-modal-panel { width: 100vw; height: 100vh; border-radius: 0; }
  .pay-modal-foot { flex-wrap: wrap; }
}

/* 后台作品管理：统计卡、筛选条、批量栏、行内运营操作 */
.work-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.work-stat {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; color: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
.work-stat:hover { border-color: var(--brand); }
.work-stat.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31, 58, 95, .1); }
.work-stat .k { display: block; font-size: 12px; color: var(--ink-mute); }
.work-stat .v { display: block; font-size: 20px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }

.works-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.works-filter input[type="search"] { width: 240px; }
.works-filter input[type="search"], .works-filter select { height: 34px; padding: 0 10px; font-size: 13px; }
.works-filter select { width: auto; min-width: 100px; }

.bulk-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 12px;
}
.bulk-bar .count { font-size: 12.5px; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.bulk-bar .bulk-sep { width: 1px; height: 20px; background: var(--line); }
.btn.mini { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 4px; }

.works-table td { padding: 10px 12px; }
.work-cell { display: flex; gap: 10px; align-items: center; min-width: 210px; }
.work-cell .thumb { width: 38px; height: 50px; border-radius: 6px; object-fit: cover; background: #ece8df; flex: none; }
.work-cell .t { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.work-cell .no { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.work-flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.work-flags .badge { font-size: 10.5px; padding: 1px 6px; }
.work-ops { display: flex; flex-wrap: wrap; gap: 4px; }
.work-weight { display: flex; gap: 4px; align-items: center; }
.work-weight input[type="number"] { width: 58px; height: 26px; padding: 0 6px; font-size: 12px; border-radius: 7px; }
tr.is-trash td { background: #fbfaf8; }

@media (max-width: 1200px) { .work-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .work-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .works-filter input[type="search"] { width: 100%; }
}

/* 后台作品管理：窄屏下 grid 容器必须允许收缩，否则宽表格会把整页撑出横向滚动 */
.admin-main { min-width: 0; }
.works-table { min-width: 980px; }
@media (max-width: 640px) {
  .work-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .works-filter input[type="search"] { width: 100%; }
}



/* 作品表格：列宽、状态不换行、删除类操作视觉区分 */
.work-cell .t a { white-space: nowrap; }
.works-table th, .works-table td { padding-left: 10px; padding-right: 10px; }
.works-table .col-check { width: 34px; }
.works-table .col-channel { width: 104px; }
.works-table .col-status { width: 78px; white-space: nowrap; }
.works-table .col-num { width: 116px; }
.works-table .col-weight { width: 124px; }
.works-table .col-ops { width: 286px; }
.works-table .work-ops .btn.link-danger { color: var(--danger); border-color: rgba(180, 42, 42, .3); }

/* 后台编辑作品：两栏信息布局 */
.work-edit-grid { display: grid; grid-template-columns: 1.25fr .95fr; gap: 16px; align-items: start; }
@media (max-width: 1024px) { .work-edit-grid { grid-template-columns: 1fr; } }

/* 后台支付配置：前台启用开关 */
.pay-switch {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  border: 1px solid var(--line); background: #faf8f4; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 14px;
}
.pay-switch.off { background: #fdf2f2; border-color: #f0cccc; }
.pay-switch .hint { margin: 0; flex: 1; min-width: 220px; font-size: 11.5px; }
.pay-switch.off .checkline { color: var(--danger); }

/* 创作中心：手机端单列布局、头部可换行、底部导航留白 */
@media (max-width: 768px) {
  .grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid > * { min-width: 0; }
  .table-wrap { max-width: 100%; }
  .section-head { flex-wrap: wrap; align-items: flex-start; row-gap: 8px; }
  .section-head > div { flex-wrap: wrap; row-gap: 6px; }
  .section-head h2 { font-size: 19px; line-height: 1.4; }
  .section-head .more { font-size: 12px; overflow-wrap: anywhere; }
  .card { padding: 16px; }
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .btn:not(.mini) { min-height: 42px; }
  .card .table-wrap { margin: 0 -2px; }
}

/* 手机端列表：精简列，避免必须横向拖动才能点到操作 */
@media (max-width: 768px) {
  .table.mobile-fit { min-width: 0; width: 100%; }
  .table.mobile-fit th, .table.mobile-fit td { white-space: normal; }
  .table.mobile-fit .hide-sm { display: none; }
}

/* 手机端表单：16px 字号避免 iOS 聚焦自动放大，点按区域更稳 */
@media (max-width: 768px) {
  .card input[type="text"], .card input[type="search"], .card input[type="number"],
  .card input[type="email"], .card input[type="password"], .card input[type="tel"],
  .card select, .card textarea { font-size: 16px; }
}

/* 阅读页：复制本章 / 打印本章 */
.reader-actions { position: fixed; right: 16px; bottom: 72px; z-index: 31; display: flex; gap: 8px; }
.reader-actions button {
  height: 36px; padding: 0 14px; border-radius: 19px; border: 1px solid #ded3bd;
  background: #fff; color: #5c5344; font-size: 12.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 18px rgba(120, 100, 60, .12);
}
.reader-actions button:hover { border-color: #b08d47; color: #8a6d36; }
.reader-actions button:disabled { opacity: .6; cursor: default; }
body.script-reader .reader-actions { bottom: 20px; }
body.script-reader .reader-actions button {
  border-color: var(--sp-line); background: #fff; color: #3b4250;
  box-shadow: 0 8px 20px rgba(23, 34, 58, .1);
}
body[data-reader-theme="dark"] .reader-actions button { background: #1b1f27; border-color: #2a313d; color: #cfd6e4; }
.reader-toast {
  position: fixed; left: 50%; bottom: 126px; transform: translate(-50%, 12px); z-index: 80;
  max-width: 86vw; padding: 9px 16px; border-radius: 999px; background: rgba(28, 31, 36, .92);
  color: #fff; font-size: 12.5px; line-height: 1.5; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.reader-toast.show { opacity: 1; transform: translate(-50%, 0); }
.print-head { display: none; }

@media (max-width: 768px) {
  .reader-actions { right: 10px; bottom: 68px; gap: 6px; }
  .reader-actions button { height: 34px; padding: 0 12px; font-size: 12px; }
  body.script-reader .reader-actions { bottom: 14px; }
  .reader-toast { bottom: 112px; font-size: 12px; }
}

@media print {
  .reader-actions, .reader-toast, .reader-settings, .reader-resume, .reader-drawer, .mobile-tab { display: none !important; }
  .print-head { display: block !important; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid #ddd; }
  .print-head h1 { font-size: 20pt; margin: 0 0 4px; }
  .print-head p { font-size: 10.5pt; color: #555; margin: 0; }
  body, .reader-shell { background: #fff !important; box-shadow: none !important; }
  .reader-shell { max-width: none !important; padding: 0 !important; min-height: 0; }
  .reader-content { color: #000 !important; font-size: 12pt !important; line-height: 1.9 !important; }
  .reader-content p { text-indent: 2em; margin: 0 0 .8em; }
  .reader-chapter-title { color: #000 !important; font-size: 16pt; margin: 0 0 4px; }
  .reader-chapter-sub { color: #666 !important; font-size: 10pt; margin-bottom: 14px; }
  .script-head, .script-main, .script-title { color: #000 !important; }
}

@media print {
  @page { margin: 16mm 14mm; }
  body { margin: 0; }
}

@media (max-width: 768px) {
  .reader-actions { bottom: calc(68px + env(safe-area-inset-bottom)); }
  body.script-reader .reader-actions { bottom: calc(14px + env(safe-area-inset-bottom)); }
  .reader-toast { bottom: calc(112px + env(safe-area-inset-bottom)); }
}

/* 作品详情：简介下方的主要人物名称列表 */
.work-cast { margin: 14px 0 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfaf7; }
.work-cast-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.work-cast-head h2 { font-size: 14.5px; margin: 0; letter-spacing: .02em; }
.work-cast-head span { font-size: 12px; color: var(--ink-mute); }
.work-cast-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cast-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.cast-pill b { font-weight: 600; color: var(--ink); white-space: nowrap; }
.cast-pill em { font-style: normal; font-size: 11px; color: #7a5c1f; background: var(--accent-soft); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.cast-pill small { font-size: 11.5px; color: var(--ink-mute); overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .work-cast { padding: 12px; }
  .work-cast-list { gap: 6px; }
  .cast-pill { font-size: 12.5px; padding: 5px 9px; }
}

@media print {
  .scene { padding: 0; margin: 0 0 10pt; }
  .scene + .scene { margin-top: 6pt; }
  .scene-head { margin: 0 0 6pt; padding: 4pt 6pt; }
  .sp-line { margin: 3pt 0; }
  .sp-action { margin: 0 0 4pt; }
  .sp-text, .sp-action { line-height: 1.55; }
  .scene-foot { margin-top: 6pt; padding-top: 4pt; }
}


/* 页脚：资质证照与备案 */
.site-footer .foot-beian {
  flex: 1 0 100%;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.site-footer .foot-lic { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.site-footer .foot-lic a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--ink-mute);
  font-size: 11px;
}
.site-footer .foot-lic img {
  width: 120px;
  height: 80px;
  object-fit: contain;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color .18s ease;
}
.site-footer .foot-lic a:hover img { border-color: var(--brand); }
.site-footer .foot-lic a span {
  max-width: 120px;
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-footer .foot-beian-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: #9a9a9a;
}
.site-footer .foot-beian-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #8a8a8a;
  text-decoration: none;
}
.site-footer .foot-beian-links a:hover { color: var(--brand); }

/* 阅读页底部备案（独立页面） */
.reader-beian {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 14px 16px 26px;
  color: #9a9488;
  font-size: 11.5px;
}
.reader-beian a { color: #9a9488; text-decoration: none; }
.reader-beian a:hover { color: #7a5b22; }
@media print { .reader-beian { display: none !important; } }
