/* ===== 少女骑士病 · 沉浸式阅读器 ===== */
:root {
  /* 浅色主题（默认）—— 清冷文学 */
  --bg: #F4F2EC;
  --bg-soft: #FCFBF7;
  --surface: #FFFFFF;
  --surface-2: #F7F5EF;
  --ink: #23292E;
  --ink-2: #4A5158;
  --ink-3: #8A9099;
  --line: #E3DFD4;
  --line-strong: #CFC9BA;
  --accent: #5B7A99;      /* 雪原冷蓝 */
  --accent-soft: #A9BFD3;
  --gold: #B08A4A;
  --danger: #C0392B;
  --shadow: 0 8px 40px rgba(91,122,153,0.10);
  --shadow-lg: 0 20px 60px rgba(35,41,46,0.14);
  --reader-bg: #F6F3EB;
  --reader-ink: #2B3138;
  --serif: "Noto Serif SC","Songti SC",STSong,"Source Han Serif SC",serif;
  --sans: "Inter","PingFang SC","Microsoft YaHei",sans-serif;
}
:root[data-theme="dark"] {
  /* 深色主题 —— 暗夜沉浸 */
  --bg: #0E141B;
  --bg-soft: #131A22;
  --surface: #18212B;
  --surface-2: #1E2833;
  --ink: #E6EAF0;
  --ink-2: #B4BDC8;
  --ink-3: #6E7A88;
  --line: #26313D;
  --line-strong: #33404E;
  --accent: #7FA6CC;
  --accent-soft: #3C556E;
  --gold: #C9A45E;
  --danger: #E0574B;
  --shadow: 0 8px 40px rgba(0,0,0,0.35);
  --shadow-lg: 0 24px 70px rgba(0,0,0,0.55);
  --reader-bg: #10171F;
  --reader-ink: #D3DAE3;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .5s ease, color .5s ease;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; cursor: pointer; }
.brand .crest { width: 30px; height: 30px; }
.brand .crest path, .brand .crest circle, .brand .crest line { stroke: var(--accent); }
.brand .name {
  font-family: var(--serif); font-weight: 700; font-size: 20px;
  letter-spacing: 3px; color: var(--ink);
}
.brand .name em { font-style: normal; color: var(--accent); }
.brand-port {
  font-family: var(--sans); font-size: 13px; letter-spacing: 2px;
  color: var(--ink-3); padding-left: 14px; margin-left: 4px;
  border-left: 1px solid var(--line-strong); align-self: center;
}
/* 编辑范围切换（本地 / 站点）：位于 OP文学社 标志正下方 */
.mode-switch {
  flex-basis: 100%; display: flex; align-items: center; gap: 6px;
  margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line);
}
.mode-cap { font-family: var(--sans); font-size: 11px; color: var(--ink-3); letter-spacing: 1px; }
.mode-btn {
  font-family: var(--sans); font-size: 12px; line-height: 1;
  padding: 3px 11px; border-radius: 20px; cursor: pointer;
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line-strong);
}
.mode-btn:hover { border-color: var(--accent); color: var(--accent); }
.mode-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.mode-btn:disabled { opacity: .4; cursor: not-allowed; }
.mode-btn:disabled:hover { border-color: var(--line-strong); color: var(--ink-2); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
  color: var(--ink-2); transition: all .25s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- 管理员按钮 + 弹窗 ---------- */
.admin-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 14px; border-radius: 21px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-family: var(--sans); font-size: 13px; letter-spacing: 1px; cursor: pointer;
  transition: all .25s ease;
}
.admin-btn svg { width: 18px; height: 18px; }
.admin-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.admin-btn.on {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 14px rgba(91,122,153,.35);
}
.admin-btn.on svg { stroke: #fff; }
.admin-btn.admin-initial {
  background: linear-gradient(135deg, #f0a830, #e07b39);
  border-color: #e07b39; color: #fff;
  box-shadow: 0 4px 14px rgba(224,123,57,.35);
}
.admin-btn.admin-initial svg { stroke: #fff; }
.admin-btn.admin-certified {
  background: linear-gradient(135deg, #2f9e8f, #1f7fa6);
  border-color: #1f7fa6; color: #fff;
  box-shadow: 0 4px 14px rgba(31,127,166,.35);
}
.admin-btn.admin-certified svg { stroke: #fff; }
/* 「终端管理」按钮：与 admin 按钮相邻，默认隐藏，仅初始管理员显示 */
#deviceMgrBtn {
  background: var(--surface); border-color: var(--line); color: var(--ink-2);
}
#deviceMgrBtn:hover { border-color: var(--accent); color: var(--accent); }

/* 终端管理弹窗 */
.device-mgr-modal { max-width: 520px; width: 92%; }
.device-list { margin: 6px 0 4px; max-height: 56vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.device-loading { color: var(--ink-3); font-size: 13px; padding: 14px 2px; text-align: center; }
.device-row {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.dev-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dev-note-row { display: flex; align-items: center; gap: 8px; }
.dev-note { flex: 1 1 auto; min-width: 0; font-size: 12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.dev-note:focus { outline: none; border-color: var(--accent); }
.dev-note-save { flex: 0 0 auto; font-size: 12px; padding: 6px 14px; border-radius: 8px; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: #fff; transition: all .2s ease; }
.dev-note-save:hover { opacity: .9; }
.dev-note-save:disabled { opacity: .6; cursor: default; }
.dev-main { min-width: 0; }
.dev-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.dev-meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dev-badge { font-size: 11px; padding: 1px 8px; border-radius: 9px; letter-spacing: .5px; }
.dev-badge.init { background: rgba(224,123,57,.16); color: #e07b39; }
.dev-badge.cert { background: rgba(31,127,166,.16); color: #1f7fa6; }
.dev-badge.normal { background: var(--line); color: var(--ink-3); }
.dev-act-wrap { flex: 0 0 auto; }
.dev-act { font-size: 12px; padding: 6px 14px; border-radius: 16px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); transition: all .2s ease; }
.dev-act.grant { border-color: #1f7fa6; color: #1f7fa6; }
.dev-act.grant:hover { background: #1f7fa6; color: #fff; }
.dev-act.revoke { border-color: #d05a5a; color: #d05a5a; }
.dev-act.revoke:hover { background: #d05a5a; color: #fff; }
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20,26,32,.45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  width: min(360px, 90vw); background: var(--surface); border-radius: 16px;
  padding: 30px 28px 24px; box-shadow: var(--shadow-lg);
  animation: fadeUp .35s ease;
}
.modal-title { font-family: var(--serif); font-size: 22px; letter-spacing: 2px; color: var(--ink); }
.modal-sub { font-size: 13px; color: var(--ink-3); margin: 8px 0 18px; }
.modal-body { font-family: var(--sans); font-size: 14px; color: var(--ink-2); line-height: 1.6; margin: 12px 0 20px; }
.modal-input {
  width: 100%; font-family: var(--sans); font-size: 15px; letter-spacing: 3px; text-align: center;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink);
  background: var(--bg-soft); transition: border-color .2s ease;
}
.modal-input:focus { border-color: var(--accent); }
.modal-err { min-height: 18px; margin-top: 8px; font-size: 12px; color: #C0584E; text-align: center; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
#adminHint {
  position: absolute; top: 52px; right: 18px; background: var(--accent); color: #fff;
  font-size: 12px; padding: 7px 14px; border-radius: 20px; opacity: 0; transition: opacity .3s ease;
  pointer-events: none; box-shadow: var(--shadow);
}
#adminHint.show { opacity: 1; }

/* ---------- 通用容器 ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 40px; }
.view { display: none; animation: fadeUp .6s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px);} to { opacity:1; transform: none; } }

/* ---------- 书架 ---------- */
.shelf-hero {
  padding: 72px 0 40px; text-align: center;
}
.shelf-hero .eyebrow {
  font-size: 13px; letter-spacing: 6px; color: var(--ink-3);
  text-transform: uppercase; margin-bottom: 18px;
}
.shelf-hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(38px, 6vw, 68px); letter-spacing: 6px; color: var(--ink);
  margin-bottom: 16px;
}
.shelf-hero .sub {
  color: var(--ink-2); font-size: 16px; letter-spacing: 2px;
}
.shelf-hero .divider {
  width: 60px; height: 2px; background: var(--accent);
  margin: 28px auto 0;
}

.shelf-label {
  display: flex; align-items: center; gap: 16px;
  margin: 40px 0 28px;
}
.shelf-label span {
  font-family: var(--serif); font-size: 22px; letter-spacing: 3px; color: var(--ink);
}
.shelf-label .rule { flex: 1; height: 1px; background: var(--line); }

.shelf-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 40px; padding-bottom: 90px;
}
.book-card { cursor: pointer; }
.book-cover {
  position: relative; aspect-ratio: 2/3; border-radius: 10px;
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s ease;
  background: linear-gradient(155deg, #DCE4EC 0%, #C4D0DC 45%, #AAB9C8 100%);
}
:root[data-theme="dark"] .book-cover {
  background: linear-gradient(155deg, #26333F 0%, #1B2731 55%, #12191F 100%);
}
.book-card:hover .book-cover { transform: translateY(-10px) rotate(-1deg); box-shadow: var(--shadow-lg); }
.book-cover .cv-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 26px; text-align: center;
}
.book-cover .cv-crest { width: 46px; height: 26px; margin-bottom: 20px; opacity: .8; }
.book-cover .cv-crest path, .book-cover .cv-crest circle, .book-cover .cv-crest line { stroke: var(--reader-ink); }
.book-cover .cv-title {
  font-family: var(--serif); font-weight: 700; font-size: 34px;
  letter-spacing: 4px; color: #23292E; line-height: 1.35;
  writing-mode: vertical-rl; text-orientation: upright; margin: 0 auto;
}
:root[data-theme="dark"] .book-cover .cv-title { color: #E6EAF0; }
.book-cover .cv-en {
  position: absolute; bottom: 22px; left: 0; right: 0;
  font-size: 10px; letter-spacing: 3px; color: rgba(35,41,46,.55); text-transform: uppercase;
}
:root[data-theme="dark"] .book-cover .cv-en { color: rgba(230,234,240,.5); }
.book-cover .cv-line {
  position: absolute; top: 16px; left: 16px; right: 16px; bottom: 16px;
  border: 1px solid rgba(35,41,46,.18); border-radius: 4px; pointer-events: none;
}
:root[data-theme="dark"] .book-cover .cv-line { border-color: rgba(230,234,240,.15); }
.book-info { margin-top: 16px; }
.book-info .t { font-family: var(--serif); font-size: 18px; letter-spacing: 2px; color: var(--ink); }
.book-info .a { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.book-info .m {
  display: inline-block; margin-top: 10px; font-size: 11px; letter-spacing: 1px;
  color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 20px; padding: 3px 12px;
}
/* 作品状态徽标 */
.status-badge {
  display: inline-block; margin-top: 8px; margin-left: 8px; font-size: 11px; letter-spacing: 1px;
  border-radius: 20px; padding: 3px 12px; font-family: var(--sans);
}
.status-badge.ongoing { color: #5B7A99; background: rgba(91,122,153,.12); border: 1px solid rgba(91,122,153,.3); }
.status-badge.done { color: #B08A4A; background: rgba(176,138,74,.12); border: 1px solid rgba(176,138,74,.3); }
/* 书架「新建作品」卡片 */
.add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 2/3; max-height: 340px;
  border: 2px dashed var(--line-strong); border-radius: 10px; background: var(--surface-2);
  transition: all .3s ease; }
.add-card:hover { border-color: var(--accent); background: var(--surface); transform: translateY(-6px); box-shadow: var(--shadow); }
.add-plus { font-size: 46px; color: var(--accent-soft); line-height: 1; transition: color .3s ease; }
.add-card:hover .add-plus { color: var(--accent); }
.add-t { margin-top: 12px; font-family: var(--serif); font-size: 15px; letter-spacing: 1px; color: var(--ink-2); }
  color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 20px; padding: 3px 12px;
}

/* ---------- 书架筛选 ---------- */
.shelf-filter {
  display: flex; flex-direction: column; gap: 13px;
  margin: 32px 0 6px; padding: 18px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow);
}
.filter-eyebrow {
  font-family: var(--serif); font-size: 13px; letter-spacing: 4px; color: var(--gold);
}
.filter-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px 26px;
}
.filter-group { display: flex; align-items: center; gap: 10px; }
.filter-label {
  font-family: var(--serif); font-size: 14px; letter-spacing: 2px; color: var(--ink-2);
}
.filter-select {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg-soft); cursor: pointer; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease; min-width: 150px;
}
.filter-select:hover { border-color: var(--accent); }
.filter-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.filter-seg { gap: 6px; }
.filter-seg button { flex: 0 0 auto; padding: 8px 16px; font-size: 13.5px; }
.filter-reset {
  font-family: var(--sans); font-size: 13px; letter-spacing: 1px; color: var(--ink-2);
  padding: 8px 16px; border: 1px dashed var(--line-strong); border-radius: 10px;
  background: transparent; cursor: pointer; transition: color .2s ease, border-color .2s ease;
}
.filter-reset:hover { color: var(--danger); border-color: var(--danger); }
.filter-count {
  margin-left: auto; font-size: 13px; letter-spacing: 1px; color: var(--ink-3);
  font-family: var(--sans);
}
.shelf-empty {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px;
  color: var(--ink-3); font-family: var(--serif); font-size: 17px; letter-spacing: 2px;
}
/* ---------- 评分 ---------- */
.book-rating {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; font-size: 13px; letter-spacing: 1px;
  color: var(--gold); font-family: var(--serif); font-weight: 700;
}
.book-rating .rc { color: var(--ink-3); font-weight: 400; font-family: var(--sans); font-size: 11px; letter-spacing: 0; }
.book-rating.none { color: var(--ink-3); font-weight: 400; }

/* 详情页评分区 */
.detail-rating {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  margin: 22px 0 30px; padding: 16px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.detail-rating .dr-score { display: flex; align-items: baseline; gap: 10px; }
.detail-rating .dr-avg {
  font-family: var(--serif); font-weight: 700; font-size: 26px; letter-spacing: 1px;
  color: var(--gold);
}
.detail-rating .dr-avg.none { color: var(--ink-3); font-size: 18px; }
.detail-rating .dr-count { font-size: 13px; color: var(--ink-3); letter-spacing: 1px; }
.detail-rating .dr-input { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-rating .dr-label { font-size: 13px; color: var(--ink-2); letter-spacing: 1px; }
.detail-rating .rate-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-rating .rate-btn {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--ink-2); font-family: var(--sans); font-size: 14px; font-weight: 600;
  transition: all .18s ease;
}
.detail-rating .rate-btn:hover {
  border-color: var(--gold); color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  transform: translateY(-2px);
}
.detail-rating .rate-btn:active { transform: scale(.92); }
.detail-rating .rate-btn.selected {
  border-color: var(--gold); color: #fff;
  background: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--gold) 35%, transparent);
}
.detail-rating .rate-clear-btn {
  margin-left: 10px; height: 34px; padding: 0 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--ink-3); font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: 1px; transition: all .18s ease; white-space: nowrap;
}
.detail-rating .rate-clear-btn:hover {
  border-color: var(--danger); color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}
.detail-rating .rate-clear-btn:active { transform: scale(.94); }
.detail-rating .dr-mine { font-weight: 700; color: var(--gold); margin: 0 4px; }
.detail-rating .dr-tip { font-size: 11px; color: var(--ink-3); letter-spacing: .5px; }

/* ---------- 书籍详情 ---------- */
.detail-hero {
  display: grid; grid-template-columns: 300px 1fr; gap: 56px;
  padding: 60px 0 48px; align-items: start;
}
.detail-hero .book-cover { max-width: 300px; }
.detail-meta .kicker { font-size: 13px; letter-spacing: 5px; color: var(--ink-3); text-transform: uppercase; }
.detail-meta h2 {
  font-family: var(--serif); font-weight: 700; font-size: 52px;
  letter-spacing: 4px; margin: 14px 0 10px; color: var(--ink);
}
.detail-meta .by { color: var(--ink-2); font-size: 15px; letter-spacing: 1px; }
.detail-meta .tags { margin: 22px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-meta .detail-modified { font-size: 12px; letter-spacing: .5px; color: var(--ink-3); margin: 4px 0 2px; }
.detail-meta .tag { font-size: 12px; letter-spacing: 1px; color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 20px; padding: 5px 14px; }
.detail-meta .desc {
  font-family: var(--serif); font-size: 17px; line-height: 1.95; color: var(--ink-2);
  max-width: 640px; margin-bottom: 30px;
}
.detail-actions { display: flex; gap: 14px; }
.btn {
  font-family: var(--sans); font-size: 15px; letter-spacing: 2px; cursor: pointer;
  border-radius: 40px; padding: 14px 34px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); transition: all .25s ease;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0E141B; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn.primary:hover { filter: brightness(1.06); }

.toc-section { padding-bottom: 90px; }
.toc-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.toc-head span { font-family: var(--serif); font-size: 22px; letter-spacing: 3px; }
.toc-head .rule { flex: 1; height: 1px; background: var(--line); }
.toc-head .count { font-size: 13px; color: var(--ink-3); }
.toc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px,1fr)); gap: 14px; }
.toc-item {
  display: flex; align-items: center; gap: 18px; cursor: pointer;
  padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); transition: all .25s ease;
}
.toc-item:hover { border-color: var(--accent); transform: translateX(4px); box-shadow: var(--shadow); }
.toc-item .num {
  font-family: var(--serif); font-size: 26px; color: var(--accent);
  min-width: 52px; text-align: center; font-weight: 700;
}
.toc-item .ti-body .ti-t { font-family: var(--serif); font-size: 18px; letter-spacing: 2px; color: var(--ink); }
.toc-item .ti-body .ti-s { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.toc-item .ti-read { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.toc-item.reading { border-color: var(--accent); background: var(--surface-2); }
.toc-item.reading .ti-read { color: var(--accent); }

/* ---------- 阅读器 ---------- */
#view-reader.active { display: block; }
.reader-shell { background: var(--reader-bg); min-height: 100vh; transition: background .5s ease; }
.reader-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px; background: color-mix(in srgb, var(--reader-bg) 85%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.reader-topbar .rt-left { display: flex; align-items: center; gap: 16px; }
.reader-topbar .rt-title { font-family: var(--serif); font-size: 15px; letter-spacing: 2px; color: var(--ink-2); }
.reader-topbar .rt-title b { color: var(--ink); }
.progress-track { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: transparent; z-index: 60; }
.progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width .1s linear; }

.reader-cover {
  max-width: 480px; margin: 28px auto 0; border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); aspect-ratio: 2/3;
  position: relative; background: linear-gradient(155deg,#DCE4EC 0%,#C4D0DC 45%,#AAB9C8 100%);
}
.reader-cover .cv-inner {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 26px; text-align: center;
}
.reader-cover .cv-crest { width: 46px; height: 26px; margin-bottom: 20px; opacity: .8; }
.reader-cover .cv-crest path, .reader-cover .cv-crest circle, .reader-cover .cv-crest line { stroke: var(--reader-ink); }
.reader-cover .cv-title {
  font-family: var(--serif); font-weight: 700; font-size: 34px; letter-spacing: 4px;
  color: #23292E; line-height: 1.35; writing-mode: vertical-rl; text-orientation: upright; margin: 0 auto;
}
:root[data-theme="dark"] .reader-cover .cv-title { color: #E6EAF0; }
.reader-cover .cv-en {
  position: absolute; bottom: 22px; left: 0; right: 0; font-size: 10px; letter-spacing: 3px;
  color: rgba(35,41,46,.55); text-transform: uppercase;
}
:root[data-theme="dark"] .reader-cover .cv-en { color: rgba(230,234,240,.5); }
.reader-cover .cv-line {
  position: absolute; top: 16px; left: 16px; right: 16px; bottom: 16px;
  border: 1px solid rgba(35,41,46,.18); border-radius: 4px; pointer-events: none;
}
:root[data-theme="dark"] .reader-cover .cv-line { border-color: rgba(230,234,240,.15); }
.reader-body { max-width: 720px; margin: 0 auto; padding: 46px 32px 140px; }
.reader-body .ch-num { text-align: center; font-size: 13px; letter-spacing: 6px; color: var(--ink-3); text-transform: uppercase; }
.reader-body .ch-title {
  text-align: center; font-family: var(--serif); font-weight: 700;
  font-size: 40px; letter-spacing: 5px; color: var(--reader-ink); margin: 16px 0 8px;
}
.reader-body .ch-sub { text-align: center; font-family: var(--serif); font-size: 16px; color: var(--ink-3); font-style: italic; }
.reader-body .ch-ornament { display: flex; justify-content: center; margin: 34px 0 50px; }
.reader-body .ch-ornament svg { width: 90px; height: 20px; }
.reader-body .ch-ornament path, .reader-body .ch-ornament circle { stroke: var(--accent-soft); }
.reader-content p {
  font-family: var(--serif);
  font-size: var(--fs, 20px);
  line-height: var(--lh, 2.05);
  color: var(--reader-ink);
  margin-bottom: 1.4em;
  text-align: justify;
  transition: color .5s ease;
}
.reader-content p.scene-break {
  text-align: center; color: var(--ink-3); letter-spacing: 8px; margin: 2.4em 0; font-size: 18px;
}
.reader-content p.pov-break {
  text-align: center; color: var(--accent); letter-spacing: 4px; margin: 2.2em 0 1.4em;
  font-size: 14px; font-family: var(--serif); opacity: .85;
}
.reader-content p.first-para::first-letter {
  font-size: 3.2em; float: left; line-height: .9; padding: 6px 12px 0 0;
  font-weight: 700; color: var(--accent); font-family: var(--serif);
}

.reader-nav {
  max-width: 720px; margin: 0 auto; padding: 40px 32px 100px;
  display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line);
}
.reader-nav button {
  flex: 1; padding: 20px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; text-align: left; transition: all .25s ease; color: var(--ink);
}
.reader-nav button:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.reader-nav button:disabled { opacity: .35; cursor: not-allowed; }
.reader-nav button.next { text-align: right; }
.reader-nav .rn-label { font-size: 12px; letter-spacing: 2px; color: var(--ink-3); }
.reader-nav .rn-title { font-family: var(--serif); font-size: 16px; color: var(--ink); margin-top: 6px; }

/* ---------- 侧边目录抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 360px; max-width: 84vw;
  background: var(--surface); z-index: 91; box-shadow: var(--shadow-lg);
  transform: translateX(-100%); transition: transform .35s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { padding: 26px 26px 18px; border-bottom: 1px solid var(--line); }
.drawer-head .dh-t { font-family: var(--serif); font-size: 22px; letter-spacing: 3px; color: var(--ink); }
.drawer-head .dh-s { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.drawer-list { flex: 1; overflow-y: auto; padding: 12px; }
.drawer-item {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px;
  border-radius: 10px; cursor: pointer; transition: background .2s ease;
}
.drawer-item:hover { background: var(--surface-2); }
.drawer-item.active { background: var(--surface-2); }
.drawer-item.active .di-t { color: var(--accent); }
.drawer-item .di-num { font-family: var(--serif); font-size: 18px; color: var(--accent); min-width: 40px; text-align: center; }
.drawer-item .di-t { font-family: var(--serif); font-size: 16px; letter-spacing: 1px; color: var(--ink); }
.drawer-item .di-s { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

/* ---------- 阅读设置面板 ---------- */
.settings-pop {
  position: fixed; top: 70px; right: 32px; z-index: 80; width: 300px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 22px; opacity: 0; transform: translateY(-10px);
  pointer-events: none; transition: all .25s ease;
}
.settings-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.settings-pop h4 { font-family: var(--serif); font-size: 16px; letter-spacing: 2px; margin-bottom: 18px; color: var(--ink); }
.set-row { margin-bottom: 20px; }
.set-row .sl { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; display: flex; justify-content: space-between; }
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; padding: 9px; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 9px; cursor: pointer; color: var(--ink-2); font-size: 13px; transition: all .2s ease;
}
.seg button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
:root[data-theme="dark"] .seg button.active { color: #0E141B; }
.theme-toggle-row { display: flex; gap: 10px; }
.theme-chip {
  flex: 1; padding: 12px; border-radius: 10px; cursor: pointer; text-align: center;
  border: 2px solid var(--line); font-size: 13px; transition: all .2s ease;
}
.theme-chip.active { border-color: var(--accent); }
.theme-chip .swatch { width: 100%; height: 30px; border-radius: 6px; margin-bottom: 8px; }
.theme-chip.light .swatch { background: linear-gradient(135deg,#F6F3EB,#E3DFD4); }
.theme-chip.dark .swatch { background: linear-gradient(135deg,#18212B,#0E141B); }

.footer a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.footer { text-align: center; padding: 40px; color: var(--ink-3); font-size: 12px; letter-spacing: 2px; border-top: 1px solid var(--line); }

/* ==================== 移动端全面适配（≤760px）==================== */
@media (max-width: 760px) {
  /* ---- 全局容器 & 顶栏 ---- */
  .topbar {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .wrap { padding-left: 14px; padding-right: 14px; }

  /* 品牌：缩小 logo + 字号 */
  .brand { gap: 8px; }
  .brand .crest { width: 22px; height: 22px; }
  .brand .name { font-size: 15px; letter-spacing: 2px; }
  /* 移动端隐藏 IP 副标题，节省纵向空间 */
  .brand-port { display: none; }

  /* 模式切换：更紧凑 */
  .mode-switch { margin-top: 3px; padding-top: 3px; gap: 4px; }
  .mode-cap { font-size: 10px; }
  .mode-btn { font-size: 11px; padding: 2px 9px; border-radius: 14px; }

  /* 右侧操作按钮：缩小 */
  .top-actions { gap: 6px; }
  .icon-btn {
    width: 34px; height: 34px;
  }
  .icon-btn svg { width: 17px; height: 17px; }
  .admin-btn {
    height: 34px; padding: 0 10px; border-radius: 17px; font-size: 12px;
  }
  .admin-btn svg { width: 15px; height: 15px; }

  /* ---- 筛选栏：紧凑防换行 ---- */
  .shelf-filter {
    padding: 12px 14px; margin: 20px 0 4px; gap: 10px; border-radius: 12px;
  }
  .filter-eyebrow { font-size: 12px; letter-spacing: 3px; }
  .filter-row { gap: 10px 14px; }
  .filter-label { font-size: 12px; letter-spacing: 1px; }
  .filter-select {
    font-size: 12px; padding: 6px 10px; min-width: 110px; border-radius: 8px;
  }
  .filter-seg { gap: 5px; }
  .filter-seg button {
    padding: 5px 10px; font-size: 12px; border-radius: 14px;
    white-space: nowrap;
  }
  .filter-reset {
    font-size: 12px; padding: 5px 12px; border-radius: 8px; letter-spacing: .5px;
  }
  .filter-count { font-size: 12px; }

  /* ---- 书架 Hero 区：大幅压缩 ---- */
  .shelf-hero { padding: 36px 0 24px; }
  .shelf-hero .eyebrow { font-size: 11px; letter-spacing: 4px; margin-bottom: 10px; }
  .shelf-hero h1 { font-size: clamp(26px, 7vw, 40px); letter-spacing: 4px; margin-bottom: 8px; }
  .shelf-hero .sub { font-size: 13px; letter-spacing: 1px; }
  .shelf-hero .divider { margin: 16px auto 0; width: 40px; }

  /* 书架分区标题 */
  .shelf-label { margin: 28px 0 18px; gap: 10px; }
  .shelf-label span { font-size: 18px; letter-spacing: 2px; }

  /* ---- 书架网格：移动端 2 列 + 缩间距 ---- */
  .shelf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 12px;
    padding-bottom: 60px;
  }
  /* 封面：缩小内边距与文字 */
  .book-cover .cv-inner { padding: 14px; }
  .book-cover .cv-crest { width: 30px; height: 17px; margin-bottom: 12px; }
  .book-cover .cv-title { font-size: 22px; letter-spacing: 3px; }
  .book-cover .cv-en { bottom: 10px; font-size: 8px; letter-spacing: 2px; }
  .book-cover .cv-line { inset: 8px; border-radius: 3px; }

  /* 卡片信息区压缩 */
  .book-info { margin-top: 10px; }
  .book-info .t { font-size: 14px; letter-spacing: 1px; }
  .book-info .a { font-size: 11px; margin-top: 2px; }
  .book-info .m { font-size: 10px; padding: 2px 8px; margin-top: 6px; }
  .status-badge { font-size: 10px; padding: 2px 8px; margin-top: 5px; margin-left: 4px; }

  /* 新建卡片 */
  .add-card { max-height: 220px; }
  .add-plus { font-size: 32px; }
  .add-t { font-size: 13px; margin-top: 8px; }

  /* 评分 */
  .book-rating { margin-bottom: 5px; font-size: 12px; gap: 4px; }
  .book-rating .rc { font-size: 10px; }

  /* 空状态 */
  .shelf-empty { padding: 36px 14px; font-size: 14px; letter-spacing: 1px; }

  /* ---- 详情页 ---- */
  .detail-hero { grid-template-columns: 1fr; gap: 24px; padding: 40px 0 32px; }
  .detail-hero .book-cover { max-width: 180px; }
  .detail-meta h2 { font-size: 32px; letter-spacing: 3px; }
  .detail-meta .kicker { font-size: 11px; letter-spacing: 3px; }
  .detail-meta .by { font-size: 13px; }
  .detail-meta .tag { font-size: 11px; padding: 4px 10px; }
  .detail-meta .desc { font-size: 15px; line-height: 1.8; }
  .detail-actions { flex-wrap: wrap; }
  .btn { font-size: 13px; padding: 10px 24px; letter-spacing: 1px; }

  /* 评分输入 */
  .detail-rating { margin: 16px 0 22px; padding: 12px 14px; gap: 10px; }
  .detail-rating .dr-avg { font-size: 22px; }
  .detail-rating .dr-avg.none { font-size: 16px; }
  .detail-rating .dr-count, .detail-rating .dr-label { font-size: 12px; }
  .detail-rating .rate-btn { width: 30px; height: 30px; font-size: 13px; }
  .detail-rating .rate-clear-btn { height: 30px; padding: 0 12px; font-size: 12px; }

  /* ---- 目录列表：移动端单列 ---- */
  .toc-list { grid-template-columns: 1fr; gap: 10px; }
  .toc-item { padding: 14px 16px; gap: 12px; }
  .toc-item .num { font-size: 20px; min-width: 36px; }
  .toc-item .ti-body .ti-t { font-size: 15px; letter-spacing: 1px; }
  .toc-item .ti-body .ti-s { font-size: 12px; }
  .toc-head { gap: 10px; margin-bottom: 16px; }
  .toc-head span { font-size: 18px; letter-spacing: 2px; }

  /* ---- 阅读器 ---- */
  .reader-body { padding: 36px 16px 100px; }
  .reader-content p { font-size: var(--fs-m, 17px); }
  .reader-body .ch-title { font-size: 30px; letter-spacing: 3px; }
  .reader-body .ch-sub { font-size: 14px; }
  .reader-nav { padding: 24px 16px 80px; gap: 12px; }
  .reader-nav button { padding: 14px; }
  .reader-nav .rn-title { font-size: 14px; }
  .reader-cover { max-width: 280px; margin: 20px auto 0; }
  .reader-cover .cv-title { font-size: 26px; letter-spacing: 3px; }

  /* ---- 站点公告：移动端改为顶部小条（不遮挡内容，点击展开浮窗）---- */
  .ann-widget {
    top: 58px; right: auto; left: 10px; bottom: auto;
    width: auto; max-width: calc(100vw - 20px);
    padding: 7px 12px; border-radius: 22px;
    display: flex; align-items: center; gap: 7px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
  }
  .ann-widget-head { margin-bottom: 0; flex: 0 0 auto; gap: 6px; }
  .ann-widget-ico { font-size: 13px; }
  .ann-widget-h { display: none; }
  .ann-widget-title {
    font-size: 12px; margin-bottom: 0; flex: 1 1 auto; min-width: 0;
    -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; display: -webkit-box;
  }
  .ann-widget-preview { display: none; }
  .ann-widget-more { margin-top: 0; flex: 0 0 auto; font-size: 11px; white-space: nowrap; }
  .ann-collapse { height: 22px; padding: 0 8px; font-size: 11px; margin-left: 2px; }
  /* 移动端收起态：仅留图标 + 展开按钮 */
  .ann-widget.collapsed { padding: 6px 10px; }
  .ann-widget.collapsed .ann-widget-title,
  .ann-widget.collapsed .ann-widget-more { display: none; }
  .ann-widget.collapsed .ann-widget-h { display: none; }
  .ann-modal { width: min(480px, 94vw); padding: 20px 20px 16px; }
  .ann-modal-title { font-size: 19px; }
  .ann-content { font-size: 14px; line-height: 1.8; }

  /* ---- 弹窗 ---- */
  .modal { padding: 24px 20px 18px; width: min(320px, 88vw); }
  .modal-title { font-size: 19px; letter-spacing: 1px; }
  .modal-sub { font-size: 12px; }
  .modal-input { font-size: 14px; padding: 10px; }

  /* ---- 终端管理弹窗 ---- */
  .device-mgr-modal { max-width: 95vw; }
  .dev-id { font-size: 11px; }
  .dev-meta { font-size: 11px; }
  .dev-note { font-size: 11px; padding: 5px 8px; }
  .dev-note-save { font-size: 11px; padding: 5px 10px; }
  .dev-badge { font-size: 10px; padding: 1px 6px; }
  .dev-act { font-size: 11px; padding: 5px 10px; }

  /* ---- 抽屉 ---- */
  .drawer { max-width: 82vw; }
  .drawer-head { padding: 18px 18px 14px; }
  .drawer-head .dh-t { font-size: 19px; }
  .drawer-head .dh-s { font-size: 12px; }
  .drawer-item { padding: 12px 14px; gap: 10px; }
  .drawer-item .di-num { font-size: 16px; min-width: 32px; }
  .drawer-item .di-t { font-size: 14px; }

  /* ---- 设置面板 ---- */
  .settings-pop { top: 56px; right: 12px; left: 12px; width: auto; }
  .settings-pop h4 { font-size: 14px; margin-bottom: 14px; }
  .seg button { padding: 7px; font-size: 12px; }
  .theme-chip { padding: 8px; font-size: 12px; }

  /* ---- 页脚 ---- */
  .footer { padding: 24px 14px; font-size: 11px; }
}

/* 多作品书封渐变（按 work id 区分） */
.book-cover--shao-nv-qi-shi-bing {
  background: linear-gradient(155deg, #DCE4EC 0%, #C4D0DC 45%, #AAB9C8 100%);
}
.book-cover--ye-shi-xi-de-tui {
  background: linear-gradient(155deg, #2A2140 0%, #3B2C5A 50%, #52407E 100%);
}
:root[data-theme="dark"] .book-cover--ye-shi-xi-de-tui {
  background: linear-gradient(155deg, #1A1430 0%, #2A2046 55%, #15101F 100%);
}
:root[data-theme="dark"] .book-cover--shao-nv-qi-shi-bing {
  background: linear-gradient(155deg, #26333F 0%, #1B2731 55%, #12191F 100%);
}
.book-cover--dear-stardust {
  background: linear-gradient(155deg, #26333F 0%, #1B2731 55%, #12191F 100%);
}
.book-cover--flore-yuanwei-yuxingui {
  background: linear-gradient(155deg, #F0DDEC 0%, #E2C3D8 45%, #CDA6C2 100%);
}
.book-cover--buxing-zhi-si-qianzhuan {
  background: linear-gradient(155deg, #CFD6DD 0%, #B3BCC6 45%, #94A0AD 100%);
}
.book-cover--guixiang-zhuan {
  background: linear-gradient(155deg, #F2E6CF 0%, #E4CFA6 45%, #CFA877 100%);
}
.book-cover--hai-bian-bei-ying {
  background: linear-gradient(155deg, #DCE4EC 0%, #C4D0DC 45%, #AAB9C8 100%);
}
.book-cover--jing-xiang-hui-sheng {
  background: linear-gradient(155deg, #DED4EC 0%, #C9BBE0 45%, #AD9CCB 100%);
}
:root[data-theme="dark"] .book-cover--jing-xiang-hui-sheng {
  background: linear-gradient(155deg, #1F1A2E 0%, #2A2440 55%, #15101F 100%);
}

/* ---------- 站点公告：右侧小窗 + 浮窗 ---------- */
.ann-widget {
  position: fixed; right: 18px; top: 116px; z-index: 60;
  width: 224px; padding: 16px 16px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  animation: fadeUp .6s ease;
}
.ann-widget:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.ann-widget-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; position: relative; }
.ann-widget-ico { font-size: 15px; line-height: 1; }
/* 收起 / 展开按钮：醒目的主题色胶囊 */
.ann-collapse {
  margin-left: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 1px;
  height: 24px; padding: 0 10px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); font-size: 12px; font-weight: 600; line-height: 1;
  border-radius: 20px; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ann-collapse::before { content: '‹'; font-size: 14px; line-height: 1; margin-right: 1px; }
.ann-collapse:hover { background: var(--accent); color: #fff; }
.ann-widget.collapsed .ann-collapse::before { content: '›'; }
.ann-widget-h {
  font-family: var(--serif); font-size: 15px; letter-spacing: 3px; color: var(--accent);
}
.ann-widget-title {
  font-family: var(--serif); font-size: 17px; letter-spacing: 1px;
  color: var(--ink); margin-bottom: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ann-widget-preview {
  font-size: 13px; line-height: 1.7; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ann-widget-more { margin-top: 10px; font-size: 12px; color: var(--accent); letter-spacing: 1px; }
/* 收起态：右侧小窗缩为图标竖条，点击展开 */
.ann-widget.collapsed {
  width: 44px; padding: 14px 0; text-align: center; align-items: stretch;
}
.ann-widget.collapsed .ann-widget-head { flex-direction: column; gap: 6px; margin-bottom: 0; }
.ann-widget.collapsed .ann-widget-ico { font-size: 16px; }
.ann-widget.collapsed .ann-widget-h,
.ann-widget.collapsed .ann-widget-title,
.ann-widget.collapsed .ann-widget-preview,
.ann-widget.collapsed .ann-widget-more { display: none; }
.ann-widget.collapsed .ann-collapse { margin: 2px auto 0; padding: 0 7px; background: transparent; border-color: var(--line); color: var(--ink-3); }
.ann-widget.collapsed .ann-collapse:hover { background: var(--surface-2); color: var(--accent); }
.ann-widget.collapsed .ann-collapse-txt { display: none; }

/* 浮窗（modal-mask 复用全局遮罩样式） */
.ann-modal {
  width: min(520px, 92vw); max-height: 82vh; overflow: auto;
  background: var(--surface); border-radius: 16px;
  padding: 26px 28px 20px; box-shadow: var(--shadow-lg);
  animation: fadeUp .35s ease; text-align: left;
}
.ann-modal-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 16px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.ann-modal-title {
  font-family: var(--serif); font-size: 22px; letter-spacing: 2px;
  color: var(--ink); flex: 1;
}
.ann-modal-tools { display: flex; align-items: center; gap: 8px; }
.ann-edit-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-family: var(--sans); font-size: 13px;
  letter-spacing: 1px; cursor: pointer; transition: all .2s ease;
}
.ann-edit-btn:hover { border-color: var(--accent); color: var(--accent); }
.ann-close {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-3); font-size: 22px;
  line-height: 1; cursor: pointer; transition: all .2s ease;
}
.ann-close:hover { border-color: var(--danger); color: var(--danger); }
.ann-modal-body { min-height: 80px; }
.ann-content {
  font-family: var(--sans); font-size: 15px; line-height: 1.9;
  color: var(--ink-2); white-space: normal; word-break: break-word;
}
.ann-empty {
  font-size: 14px; color: var(--ink-3); text-align: center;
  padding: 20px 0; line-height: 1.8;
}
.ann-title-input, .ann-content-input {
  width: 100%; font-family: var(--sans); font-size: 15px;
  color: var(--ink); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 10px;
  outline: none; padding: 12px 14px; transition: border-color .2s ease; text-align: left;
}
.ann-title-input { margin-bottom: 12px; }
.ann-title-input:focus, .ann-content-input:focus { border-color: var(--accent); }
/* 公告正文：可编辑富文本框（contenteditable） */
.ann-content-input {
  min-height: 180px; max-height: 46vh; overflow: auto;
  line-height: 1.8; white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word;
}
.ann-content-input:empty::before {
  content: attr(data-placeholder); color: var(--ink-3); pointer-events: none;
}
.ann-edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
/* 富文本工具条：选中文字后设置字号 / 颜色 */
.ann-rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 12px; }
.ann-rt-hint { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; }
.ann-rt-fs button { min-width: 38px; }
.ann-rt-color { margin-left: -4px; }
.ann-rt-clear {
  height: 32px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-family: var(--sans); font-size: 13px; letter-spacing: 1px; cursor: pointer; transition: all .15s ease;
}
.ann-rt-clear:hover { border-color: var(--accent); color: var(--accent); }
/* 图片插入按钮 + 弹出层 */
.ann-rt-img {
  height: 32px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-family: var(--sans); font-size: 13px; letter-spacing: 1px; cursor: pointer; transition: all .15s ease;
}
.ann-rt-img:hover { border-color: var(--accent); color: var(--accent); }
.ann-img-panel {
  flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 4px; padding: 10px 12px; border: 1px dashed var(--line);
  border-radius: 10px; background: var(--bg-soft);
}
.ann-img-file {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-family: var(--sans); font-size: 13px; letter-spacing: 1px; cursor: pointer; transition: all .15s ease;
}
.ann-img-file:hover { border-color: var(--accent); color: var(--accent); }
.ann-img-file input[type="file"] { display: none; }
.ann-img-url {
  flex: 1 1 180px; min-width: 160px; height: 32px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: var(--sans); font-size: 13px; outline: none; transition: border-color .15s ease;
}
.ann-img-url:focus { border-color: var(--accent); }
/* 富文本 class：字号 f-* / 颜色 c-*（应用到正文与编辑框，便于所见即所得） */
.ann-content .f-s, .ann-content-input .f-s { font-size: 14px; }
.ann-content .f-m, .ann-content-input .f-m { font-size: 16px; }
.ann-content .f-l, .ann-content-input .f-l { font-size: 19px; }
.ann-content .f-xl, .ann-content-input .f-xl { font-size: 23px; }
.ann-content .c-black, .ann-content-input .c-black { color: #1a1a1a; }
.ann-content .c-white, .ann-content-input .c-white { color: #f3f3f3; }
.ann-content .c-red, .ann-content-input .c-red { color: #d23b3b; }
/* 公告图片渲染（浮窗正文 + 编辑框，所见即所得） */
.ann-content img, .ann-content-input img {
  display: block; max-width: 100%; height: auto;
  border-radius: 8px; margin: 8px 0; border: 1px solid var(--line);
}
/* 右侧小窗预览仅取颜色（保持小字号，不被 f-* 撑大） */
.ann-widget-preview .c-black { color: #1a1a1a; }
.ann-widget-preview .c-white { color: #f3f3f3; }
.ann-widget-preview .c-red { color: #d23b3b; }
/* 颜色分段：带色点 */
.ann-color-seg { display: inline-flex; gap: 6px; }
.ann-color-seg button {
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 40px; height: 32px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-family: var(--sans); font-size: 13px; letter-spacing: 1px; cursor: pointer; transition: all .15s ease;
}
.ann-color-seg button::before {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.ann-color-seg button[data-color="black"]::before { background: #1a1a1a; }
.ann-color-seg button[data-color="white"]::before { background: #f3f3f3; }
.ann-color-seg button[data-color="red"]::before   { background: #d23b3b; }
.ann-color-seg button:hover { border-color: var(--accent); }
.ann-color-seg button.active {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}
.ann-modal-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-3); letter-spacing: 1px; text-align: right;
}

/* 平板（761–1100px）隐藏右侧小窗，避免遮挡；手机（≤760px）改为顶部小条 */
@media (min-width: 761px) and (max-width: 1100px) {
  .ann-widget { display: none !important; }
}
