/* ==========================================================================
   云阅书城 — 样式表
   主题：日间 / 护眼 / 夜间，通过 <html data-theme="..."> 切换
   ========================================================================== */

:root {
  --brand: #b5452f;
  --brand-600: #9c3a26;
  --brand-050: #fbeeea;
  --gold: #c9a227;

  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f1ede4;
  --text: #23282f;
  --text-2: #4a5159;
  --muted: #7b8590;
  --border: #e7e2d8;
  --shadow: 0 6px 24px rgba(35, 30, 20, 0.07);
  --shadow-lg: 0 16px 44px rgba(35, 30, 20, 0.14);

  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 64px;
  --reader-size: 19px;
  --reader-font: var(--font-serif);
  --reader-max: min(1280px, 94vw);

  --font-sans: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC",
    "STSong", "SimSun", Georgia, "Times New Roman", serif;
}

html[data-theme="sepia"] {
  --bg: #f0e7d6;
  --surface: #f8f2e5;
  --surface-2: #e9ddc6;
  --text: #3a3126;
  --text-2: #56493a;
  --muted: #8a7c63;
  --border: #ded2b8;
}

html[data-theme="dark"] {
  --bg: #12151a;
  --surface: #1a1e24;
  --surface-2: #232830;
  --text: #ccd3db;
  --text-2: #aab3bd;
  --muted: #7f8894;
  --border: #2a3037;
  --brand-050: #2a1a17;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }

img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------- 顶部导航 ------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand:hover { color: inherit; }
.brand-icon { width: 30px; height: 30px; color: var(--brand); flex-shrink: 0; }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: 0.5px; }
.brand-tag {
  font-size: 12px; color: var(--muted); padding-left: 10px;
  border-left: 1px solid var(--border); white-space: nowrap;
}
.nav { display: flex; gap: 4px; margin-left: 6px; }
.nav a {
  padding: 7px 12px; border-radius: 999px; font-size: 15px; color: var(--text-2);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { color: var(--brand); background: var(--brand-050); font-weight: 600; }

.search-form {
  margin-left: auto; display: flex; align-items: center;
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: 999px; padding: 0 6px 0 14px; height: 40px;
  transition: border-color 0.15s, background 0.15s;
}
.search-form:focus-within { border-color: var(--brand); background: var(--surface); }
.search-form input {
  border: 0; outline: 0; background: transparent; color: var(--text);
  font-size: 14px; width: 190px; font-family: inherit;
}
.search-form input::placeholder { color: var(--muted); }
.search-form button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
}
.search-form button:hover { color: var(--brand); background: var(--brand-050); }
.search-form svg { width: 19px; height: 19px; }

/* --------------------------------- 通用 --------------------------------- */

.section { padding: 42px 0 8px; }
.section-head {
  display: flex; align-items: baseline; gap: 14px;
  border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 22px;
}
.section-head h2 { margin: 0; font-size: 22px; letter-spacing: 0.5px; }
.section-head h2::before {
  content: ""; display: inline-block; width: 4px; height: 18px;
  background: var(--brand); border-radius: 2px; margin-right: 10px;
  transform: translateY(2px);
}
.section-sub { color: var(--muted); font-size: 13px; margin-left: auto; }
.link-btn {
  border: 0; background: none; color: var(--brand); cursor: pointer;
  font-size: 13px; font-family: inherit; padding: 0 0 0 10px;
}
.link-btn:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: 999px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s;
  font-family: inherit; line-height: 1.4;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(181, 69, 47, 0.28); }
.btn-primary:hover { background: var(--brand-600); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { color: var(--brand); border-color: var(--brand); }
.btn.is-disabled { opacity: 0.45; pointer-events: none; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--brand-050); color: var(--brand); font-size: 12px;
}

.empty { padding: 60px 0; text-align: center; color: var(--muted); }
.empty-sub { font-size: 14px; }

/* --------------------------------- 首页 --------------------------------- */

.hero {
  background:
    radial-gradient(900px 380px at 12% -10%, rgba(181, 69, 47, 0.10), transparent 70%),
    var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 46px 0 50px;
}
.hero-inner {
  display: grid; grid-template-columns: 250px 1fr; gap: 44px; align-items: center;
}
.hero-cover { position: relative; }
.hero-cover img {
  width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.badge-status {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px;
  padding: 3px 10px; border-radius: 999px; backdrop-filter: blur(4px);
}
.hero-kicker {
  display: inline-block; margin: 0 0 10px; font-size: 13px; color: var(--brand);
  background: var(--brand-050); padding: 3px 12px; border-radius: 999px; font-weight: 600;
}
.hero-title { margin: 0 0 10px; font-size: 44px; letter-spacing: 4px; font-family: var(--font-serif); }
.hero-author { margin: 0 0 18px; color: var(--text-2); font-size: 15px; }
.hero-author em { font-style: normal; color: var(--brand); font-weight: 600; }
.hero-intro {
  color: var(--text-2); font-size: 15.5px; border-left: 3px solid var(--brand);
  padding-left: 16px; margin-bottom: 26px; max-width: 62ch;
}
.hero-intro p { margin: 0 0 10px; }
.hero-intro p:last-child { margin-bottom: 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 34px; list-style: none; margin: 28px 0 0; padding: 0;
  color: var(--muted); font-size: 13px;
}
.hero-stats span { display: block; color: var(--text); font-size: 19px; font-weight: 700; }

/* 书籍卡片网格 */
.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px;
}
.book-card {
  display: grid; grid-template-columns: 108px 1fr; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; transition: all 0.18s;
}
.book-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--brand); }
.book-card-cover img, .book-card-cover > svg {
  width: 108px; height: auto; border-radius: var(--radius-sm); aspect-ratio: 3 / 4; object-fit: cover;
}
.book-card-body { min-width: 0; display: flex; flex-direction: column; }
.book-card-body h3 { margin: 2px 0 6px; font-size: 19px; }
.book-card-meta { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.book-card-intro {
  margin: 0 0 10px; font-size: 13.5px; color: var(--text-2);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.book-card-foot {
  margin: auto 0 0; display: flex; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--muted); flex-wrap: wrap;
}
.mini-link { color: var(--brand); }

/* 最近更新列表 */
.latest-list { list-style: none; margin: 0; padding: 0; }
.latest-list li { border-bottom: 1px dashed var(--border); }
.latest-list a { display: flex; gap: 14px; padding: 12px 4px; font-size: 15px; }
.latest-list a:hover { background: var(--surface-2); border-radius: 8px; }
.latest-book { flex-shrink: 0; color: var(--muted); font-size: 13.5px; min-width: 66px; }
.latest-chapter { color: var(--text-2); }

/* ------------------------------- 书籍详情页 ------------------------------ */

.breadcrumb {
  display: flex; gap: 8px; align-items: center; padding: 18px 0;
  font-size: 13.5px; color: var(--muted);
}
.breadcrumb .current { color: var(--text); }

.book-detail {
  display: grid; grid-template-columns: 232px 1fr; gap: 40px;
  padding-bottom: 34px; border-bottom: 1px solid var(--border);
}
.detail-cover img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.detail-title { margin: 6px 0 8px; font-size: 34px; letter-spacing: 2px; font-family: var(--font-serif); }
.detail-author { margin: 0 0 18px; color: var(--text-2); font-size: 15px; }
.detail-author a { color: var(--brand); }
.detail-meta {
  list-style: none; margin: 0 0 24px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px;
}
.detail-meta li { background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 12px; }
.detail-meta .k { display: block; font-size: 12px; color: var(--muted); }
.detail-meta .v { display: block; font-size: 14.5px; font-weight: 600; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.intro-section .prose { color: var(--text-2); font-size: 15.5px; max-width: 80ch; }
.intro-section .prose p { margin: 0 0 12px; }

/* 目录手风琴 */
.catalog { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.volume + .volume { border-top: 1px solid var(--border); }
.volume-head {
  width: 100%; display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 0; cursor: pointer;
  padding: 14px 18px; font-family: inherit; color: var(--text);
  font-size: 15.5px; font-weight: 700; text-align: left;
}
.volume-head:hover { color: var(--brand); }
.volume-meta { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.chev { width: 18px; height: 18px; color: var(--muted); transition: transform 0.2s; }
.volume-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.chapter-list {
  list-style: none; margin: 0; padding: 6px 0;
  columns: 2; column-gap: 0; background: var(--surface);
}
.chapter-list[hidden] { display: none; }
.chapter-list li { break-inside: avoid; border-bottom: 1px solid var(--border); }
.chapter-list a { display: flex; align-items: center; gap: 10px; padding: 10px 18px; font-size: 14.5px; }
.chapter-list a:hover { background: var(--surface-2); color: var(--brand); }
.chapter-list .cnum { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.chapter-list .ctitle {
  color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chapter-list .cwords { margin-left: auto; color: var(--muted); font-size: 12px; flex-shrink: 0; }
.chapter-list a.is-current { background: var(--brand-050); }
.chapter-list a.is-current .ctitle { color: var(--brand); font-weight: 600; }

/* -------------------------------- 阅读页 -------------------------------- */

.reader-page { background: var(--bg); }

.reader-bar {
  position: sticky; top: 0; z-index: 60;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.reader-bar-inner {
  max-width: var(--reader-max); margin: 0 auto; padding: 0 16px;
  min-height: 56px; display: flex; align-items: center; gap: 14px;
}
.reader-back {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-2); font-size: 14.5px; flex-shrink: 0;
}
.reader-back svg { width: 18px; height: 18px; }
.reader-back:hover { color: var(--brand); }
.reader-heading {
  min-width: 0; display: flex; flex-direction: column; line-height: 1.25;
  border-left: 1px solid var(--border); padding-left: 14px;
}
.rh-book { font-size: 12px; color: var(--muted); }
.rh-chapter {
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 46vw;
}
.reader-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tool-btn {
  min-width: 36px; height: 34px; padding: 0 9px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 13.5px; cursor: pointer; font-family: inherit;
}
.tool-btn:hover { color: var(--brand); border-color: var(--brand); }
.tool-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.theme-switch { display: flex; gap: 4px; padding: 0 4px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); margin: 0 4px; }
.font-switch { display: flex; gap: 4px; padding: 0 4px; border-right: 1px solid var(--border); margin: 0 4px; }

.reader-progress { height: 3px; background: var(--surface-2); }
.reader-progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.1s linear; }

.reader-wrap {
  width: 100%; max-width: var(--reader-max); margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 48px) 70px;
}

.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.pager-top { margin-bottom: 34px; }
.pager-bottom { margin-top: 34px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.pager-link {
  display: flex; flex-direction: column; gap: 2px; padding: 11px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; min-width: 0;
}
.pager-link:hover { border-color: var(--brand); }
.pager-link.is-next { text-align: right; }
.pager-link.is-disabled { opacity: 0.45; pointer-events: none; }
.pager-mid { justify-content: center; align-items: center; color: var(--text-2); }
.pager-dir { font-size: 12px; color: var(--muted); }
.pager-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chapter {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 44px 52px 48px; box-shadow: var(--shadow);
}
.chapter-head { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 28px; }
.chapter-title {
  margin: 0 0 10px; font-size: 27px; font-family: var(--reader-font); letter-spacing: 1px;
}
.chapter-sub { margin: 0; font-size: 13px; color: var(--muted); }

.chapter-content {
  font-family: var(--reader-font);
  font-size: var(--reader-size);
  line-height: 1.95;
  color: var(--text);
}
.chapter-content p { margin: 0 0 1.15em; text-indent: 2em; }
.chapter-content p:last-child { margin-bottom: 0; }
.chapter-content em {
  display: block; text-align: center; text-indent: 0;
  font-style: normal; color: var(--muted); font-size: 0.86em;
  margin: 2em 0 0; letter-spacing: 2px;
}
.chapter-content strong { font-weight: 700; }
.chapter-content hr { border: 0; border-top: 1px solid var(--border); margin: 2em auto; width: 40%; }

.end-mark { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0 0; letter-spacing: 3px; }
.reader-hint { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 26px; }

/* 目录抽屉 */
.drawer { position: fixed; inset: 0; z-index: 90; }
.drawer[hidden] { display: none; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(400px, 88vw);
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: drawer-in 0.22s ease;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700;
}
.drawer-body { overflow-y: auto; padding: 8px 0 24px; }
.drawer-volume { padding: 12px 16px 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.drawer-body a {
  display: flex; gap: 10px; padding: 9px 16px; font-size: 14.5px; color: var(--text-2);
}
.drawer-body a:hover { background: var(--surface-2); color: var(--brand); }
.drawer-body a.is-current { background: var(--brand-050); color: var(--brand); font-weight: 600; }
.drawer-body .cnum { color: var(--muted); font-size: 12.5px; flex-shrink: 0; }
.drawer-loading { padding: 20px 16px; color: var(--muted); font-size: 14px; }

/* -------------------------------- 搜索页 -------------------------------- */

.result-group { margin: 26px 0 14px; font-size: 17px; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { border-bottom: 1px solid var(--border); }
.result-list a { display: block; padding: 14px 8px; }
.result-list a:hover { background: var(--surface-2); border-radius: 8px; }
.result-title { display: block; font-size: 15.5px; margin-bottom: 4px; }
.result-title em { font-style: normal; color: var(--brand); }
.result-snippet {
  display: block; font-size: 13.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --------------------------------- 错误页 -------------------------------- */

.error-page { text-align: center; padding: 90px 20px; }
.error-code { font-size: 90px; font-weight: 800; color: var(--brand); margin: 0; line-height: 1; }
.error-msg { color: var(--muted); margin: 14px 0 30px; font-size: 16px; }
.error-page .hero-actions { justify-content: center; }

/* --------------------------------- 页脚 --------------------------------- */

.site-footer {
  margin-top: 60px; background: var(--surface); border-top: 1px solid var(--border);
  padding: 34px 0; color: var(--muted); font-size: 13.5px;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px 40px; align-items: flex-start; }
.footer-brand strong { font-size: 16px; color: var(--text); }
.footer-brand p { margin: 4px 0 0; }
.footer-links { display: flex; gap: 18px; }
.footer-copy { width: 100%; margin: 8px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.footer-copy .icp { margin-left: 10px; }

/* --------------------------- 顶部用户区 / 登录注册 --------------------------- */

.user-menu { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.menu-link {
  font-size: 14.5px; color: var(--text-2); padding: 6px 9px; border-radius: 8px;
}
.menu-link:hover { color: var(--brand); background: var(--brand-050); }
.menu-link.as-button {
  border: 0; background: none; font-family: inherit; cursor: pointer; line-height: inherit;
}
.logout-form { display: inline; margin: 0; }
.btn-sm { padding: 7px 16px; font-size: 14px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 3px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 14px; color: var(--text-2);
}
.user-chip:hover { border-color: var(--brand); color: var(--brand); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 700;
}

/* ------------------------------ 登录 / 注册 / 账号 ------------------------------ */

.auth-wrap { max-width: 460px; margin: 0 auto; padding: 54px 20px 30px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 32px; box-shadow: var(--shadow);
}
.auth-title { margin: 0 0 6px; font-size: 27px; letter-spacing: 2px; font-family: var(--font-serif); }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.auth-section {
  margin: 30px 0 16px; font-size: 18px; padding-top: 22px; border-top: 1px solid var(--border);
}

.form-field { margin-bottom: 16px; }
.form-field label {
  display: block; font-size: 13.5px; color: var(--text-2); font-weight: 600; margin-bottom: 6px;
}
.form-field input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
  font-size: 15px; font-family: inherit; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:focus {
  outline: none; border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-050);
}
.form-actions { margin-top: 22px; }
.form-actions .btn { width: 100%; }

.auth-foot { margin: 18px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.auth-foot a { color: var(--brand); font-weight: 600; }
.account-admin-link { display: inline-block; margin-top: 4px; color: var(--brand); font-size: 14px; font-weight: 600; }
.account-meta {
  list-style: none; margin: 0 0 10px; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.account-meta li { background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 12px; }
.account-meta .k { display: block; font-size: 12px; color: var(--muted); }
.account-meta .v { display: block; font-size: 14.5px; font-weight: 600; }

.alert { border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; margin: 0 0 18px; line-height: 1.5; }
.alert-error { background: #fdecea; color: #9c3a26; border: 1px solid #f3c9c2; }
.alert-ok { background: #eaf6ec; color: #1c6b34; border: 1px solid #c4e3cc; }
html[data-theme="dark"] .alert-error { background: #3a1d19; color: #f0a99c; border-color: #5a2a22; }
html[data-theme="dark"] .alert-ok { background: #16301d; color: #8fd6a3; border-color: #245231; }

/* -------------------------------- 用户管理表 ------------------------------- */

.table-wrap {
  overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.users-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.users-table th, .users-table td {
  padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.users-table th { background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; }
.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table tbody tr:hover { background: var(--surface-2); }
.self-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--brand-050); color: var(--brand); font-size: 11px;
}
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.status-approved { background: #eaf6ec; color: #1c6b34; }
.status-pending { background: #fdf3e2; color: #b9772a; }
.status-rejected { background: #fdecea; color: #9c3a26; }
html[data-theme="dark"] .status-approved { background: #16301d; color: #8fd6a3; }
html[data-theme="dark"] .status-pending { background: #33280f; color: #e0b465; }
html[data-theme="dark"] .status-rejected { background: #3a1d19; color: #f0a99c; }
.row-actions { display: flex; gap: 6px; }
.row-actions form { margin: 0; }
.mini-btn {
  padding: 5px 12px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 13px; font-family: inherit; cursor: pointer;
}
.mini-btn:hover { border-color: var(--brand); color: var(--brand); }
.mini-ok { border-color: #b9dcc4; color: #1c6b34; }
.mini-ok:hover { border-color: #1c6b34; color: #1c6b34; }
.mini-danger:hover { border-color: #c0392b; color: #c0392b; }

.new-user {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 22px;
}
.new-user > summary {
  cursor: pointer; padding: 14px 18px; font-weight: 700; font-size: 15.5px;
  color: var(--text); list-style: none; display: flex; align-items: center; gap: 8px;
}
.new-user > summary::-webkit-details-marker { display: none; }
.new-user > summary::before { content: "＋"; color: var(--brand); font-weight: 700; }
.new-user[open] > summary { border-bottom: 1px solid var(--border); }
.new-user[open] > summary::before { content: "－"; }
.new-user-form { padding: 20px 18px 22px; max-width: 540px; }
.new-user-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text);
  font-size: 15px; font-family: inherit;
}
.form-field select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050);
}
.new-user .form-actions { margin-top: 4px; }
.new-user .form-actions .btn { width: auto; padding: 10px 28px; }

/* -------------------------------- 响应式 -------------------------------- */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 200px 1fr; gap: 30px; }
  .hero-title { font-size: 36px; }
  .book-detail { grid-template-columns: 180px 1fr; gap: 26px; }
  .chapter-list { columns: 1; }
}

@media (max-width: 720px) {
  .brand-tag { display: none; }
  .header-inner { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .search-form { order: 3; width: 100%; margin-left: 0; }
  .search-form input { width: 100%; }
  .nav { margin-left: auto; }
  .user-name { display: none; }
  .menu-admin { padding: 6px; }
  .auth-wrap { padding-top: 34px; }
  .auth-card { padding: 26px 20px; }
  .account-meta { grid-template-columns: 1fr; }
  .new-user-row { grid-template-columns: 1fr; gap: 0; }

  .hero { padding: 28px 0 34px; }
  .hero-inner { grid-template-columns: 130px 1fr; gap: 20px; }
  .hero-title { font-size: 27px; letter-spacing: 2px; }
  .hero-intro { font-size: 14.5px; padding-left: 12px; }
  .hero-stats { gap: 20px; margin-top: 20px; }
  .hero-stats span { font-size: 16px; }
  .hero-cover img { box-shadow: var(--shadow); }

  .book-detail { grid-template-columns: 118px 1fr; gap: 18px; }
  .detail-title { font-size: 25px; }
  .detail-meta { grid-template-columns: repeat(2, 1fr); }

  .book-grid { grid-template-columns: 1fr; }

  .reader-bar-inner { gap: 8px; flex-wrap: wrap; row-gap: 6px; padding-bottom: 8px; }
  .reader-heading { padding-left: 10px; flex: 1 1 auto; }
  .rh-chapter { max-width: 30vw; }
  .reader-tools { flex-wrap: wrap; justify-content: flex-end; }
  .theme-switch { padding: 0 2px; margin: 0 2px; }
  .font-switch { padding: 0 2px; margin: 0 2px; }
  .reader-wrap { padding: 16px 12px 50px; }
  .chapter { padding: 26px 20px 30px; border-radius: 10px; }
  .chapter-title { font-size: 21px; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager-mid { display: none; }
  .pager-bottom .btn { flex: 1; padding: 10px 12px; font-size: 14px; }
}

@media (max-width: 420px) {
  .hero-inner { grid-template-columns: 104px 1fr; }
  .hero-title { font-size: 23px; }
  .brand-name { font-size: 18px; }
  .tool-btn { min-width: 32px; padding: 0 7px; font-size: 12.5px; }
}
