/* ============================================================
   鲸屿小说网 · 基础设计系统
   纸墨 / 朱砂 / 松烟，editorial reading aesthetic
   ============================================================ */

:root {
  --paper: #ffffff;
  --paper-2: #f2f9ff;
  --paper-3: #e3f3ff;
  --card: #ffffff;
  --ink: #123a52;
  --ink-2: #2b5876;
  --ink-3: #5b7f99;
  --ink-4: #8fadc2;
  --vermilion: #2ea8e6;
  --vermilion-deep: #1a7fb5;
  --jade: #2aa7c4;
  --gold: #6fbce8;
  --line: rgba(18, 58, 82, 0.14);
  --line-soft: rgba(18, 58, 82, 0.07);
  --shadow: 0 26px 60px -34px rgba(18, 58, 82, 0.28);
  --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', STSong, SimSun, 'Times New Roman', serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.38'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
}

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

::selection {
  background: var(--vermilion);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(18, 58, 82, 0.18);
  border-radius: 8px;
  border: 3px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(18, 58, 82, 0.32);
}

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

.hidden {
  display: none !important;
}

.serif {
  font-family: var(--font-serif);
}

.muted {
  color: var(--ink-3);
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* ------------------------------- 按钮 ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
  white-space: nowrap;
  background: transparent;
  color: var(--ink);
}

.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--vermilion);
  color: #ffffff;
  box-shadow: 0 12px 24px -16px rgba(46, 168, 230, 0.9);
}
.btn-primary:hover {
  background: var(--vermilion-deep);
  box-shadow: 0 16px 30px -16px rgba(26, 127, 181, 0.8);
}

.btn-ink {
  background: var(--ink);
  color: var(--paper);
}
.btn-ink:hover {
  background: #000;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(18, 58, 82, 0.04);
}

.btn-light {
  background: rgba(18, 58, 82, 0.1);
  border-color: rgba(18, 58, 82, 0.24);
  color: var(--paper);
}
.btn-light:hover {
  background: rgba(18, 58, 82, 0.18);
}

.btn-danger {
  background: var(--vermilion);
  color: #fff;
}
.btn-danger-ghost {
  border-color: rgba(46, 168, 230, 0.35);
  color: var(--vermilion);
}
.btn-danger-ghost:hover {
  background: rgba(46, 168, 230, 0.08);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.btn-xs {
  padding: 5px 10px;
  font-size: 11.5px;
  letter-spacing: 0.03em;
}
.btn-block {
  width: 100%;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: 2px;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(18, 58, 82, 0.04);
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}
.icon-btn.danger:hover {
  border-color: var(--vermilion);
  color: var(--vermilion);
  background: rgba(46, 168, 230, 0.06);
}

/* ------------------------------- 表单 ------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > label,
.field-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  font-weight: 500;
}

.field .hint {
  font-size: 11.5px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.input,
.select,
.textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--ink);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  outline: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-4);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--ink-2);
  background: var(--paper-2);
  box-shadow: 0 0 0 3px rgba(18, 58, 82, 0.07);
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.8;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236f6657' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid .span-2 {
  grid-column: 1 / -1;
}
.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.checkbox-line input {
  accent-color: var(--vermilion);
  width: 15px;
  height: 15px;
}

.choice-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice:hover {
  border-color: var(--ink-3);
}
.choice:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* ------------------------------- 标签 / 徽章 ------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  border-radius: 2px;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-short {
  background: rgba(46, 168, 230, 0.09);
  color: var(--vermilion);
  border-color: rgba(46, 168, 230, 0.2);
}
.badge-long {
  background: rgba(42, 167, 196, 0.09);
  color: var(--jade);
  border-color: rgba(42, 167, 196, 0.22);
}
.badge-published {
  background: rgba(42, 167, 196, 0.09);
  color: var(--jade);
}
.badge-draft {
  background: rgba(18, 58, 82, 0.06);
  color: var(--ink-3);
}
.badge-banned {
  background: rgba(46, 168, 230, 0.1);
  color: var(--vermilion);
}
.badge-free {
  background: rgba(42, 167, 196, 0.09);
  color: var(--jade);
}
.badge-paid {
  background: rgba(111, 188, 232, 0.14);
  color: #2b7fa8;
}
.badge-early {
  background: rgba(111, 188, 232, 0.16);
  color: #1a7fb5;
  border-color: rgba(46, 168, 230, 0.24);
}
.badge-translation {
  background: rgba(42, 167, 196, 0.1);
  color: var(--jade);
  border-color: rgba(42, 167, 196, 0.22);
}
.badge-male {
  background: rgba(47, 74, 96, 0.1);
  color: #38536a;
}
.badge-female {
  background: rgba(46, 168, 230, 0.08);
  color: #1a7fb5;
}
.badge-editor {
  background: rgba(111, 188, 232, 0.14);
  color: #2b7fa8;
}
.badge-admin {
  background: rgba(46, 168, 230, 0.1);
  color: var(--vermilion);
}
.badge-user {
  background: rgba(18, 58, 82, 0.06);
  color: var(--ink-3);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--ink-2);
}
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.chip small {
  opacity: 0.55;
  font-size: 10px;
}
.chip--tag {
  border-style: dashed;
}

/* ------------------------------- 面板 / 封面 ------------------------------- */

.panel {
  background: var(--card);
  border: 1px solid var(--line-soft);
  box-shadow: 0 20px 50px -44px rgba(18, 58, 82, 0.7);
}

.cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 12% 6%, rgba(255, 246, 225, 0.22) 0%, transparent 46%),
    radial-gradient(90% 80% at 88% 95%, rgba(0, 0, 0, 0.42) 0%, transparent 58%),
    linear-gradient(158deg, var(--c1, #2f7fa8) 0%, var(--c2, #1b5574) 100%);
  color: #eaf6ff;
  box-shadow:
    0 18px 34px -22px rgba(18, 58, 82, 0.7),
    inset 0 0 0 1px rgba(244, 236, 219, 0.08);
  container-type: inline-size;
  border-radius: 6px;
  isolation: isolate;
}

.cover--img::before,
.cover--img::after {
  display: none;
}
.cover--img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 有封面图时：书名艺术字压在封面上 */
.cover--img .cover__img-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    270deg,
    rgba(3, 16, 24, 0.72) 0%,
    rgba(3, 16, 24, 0.32) 32%,
    rgba(3, 16, 24, 0) 58%
  );
}

.cover--img .cover__art-title {
  position: absolute;
  top: 14%;
  right: 9%;
  z-index: 4;
  max-height: 62%;
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: clamp(9px, 10.5cqw, 30px);
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.18;
  color: #f8fcff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  border-left: 1px solid rgba(244, 236, 219, 0.5);
  padding-left: 7px;
  overflow: hidden;
}

.cover--img .cover__seal {
  z-index: 5;
}

.cover--img.cover--horizontal .cover__img-scrim {
  background: linear-gradient(
    180deg,
    rgba(3, 16, 24, 0) 42%,
    rgba(3, 16, 24, 0.62) 72%,
    rgba(3, 16, 24, 0.86) 100%
  );
}

.cover--img.cover--horizontal .cover__art-title {
  writing-mode: horizontal-tb;
  top: auto;
  left: 9%;
  right: 9%;
  bottom: 11%;
  max-height: none;
  font-size: clamp(10px, 7cqw, 24px);
  letter-spacing: 0.04em;
  line-height: 1.3;
  border-left: 0;
  border-top: 1px solid rgba(244, 236, 219, 0.5);
  padding-left: 0;
  padding-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cover--img.cover--horizontal .cover__seal {
  top: 8%;
  right: 8%;
  bottom: auto;
}

.cover::before {
  content: '';
  position: absolute;
  width: 78cqw;
  height: 78cqw;
  right: -28cqw;
  top: -20cqw;
  border-radius: 50%;
  border: 1px solid rgba(244, 236, 219, 0.14);
  box-shadow:
    0 0 0 12cqw rgba(244, 236, 219, 0.03),
    0 0 0 26cqw rgba(244, 236, 219, 0.02);
  z-index: 0;
}

.cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--noise);
  opacity: 0.16;
  mix-blend-mode: soft-light;
  z-index: 3;
  pointer-events: none;
}

.cover__frame {
  position: absolute;
  inset: 7.5%;
  border: 1px solid rgba(244, 236, 219, 0.2);
  z-index: 2;
}
.cover__frame::before,
.cover__frame::after {
  content: '';
  position: absolute;
  width: 18%;
  height: 1px;
  background: rgba(244, 236, 219, 0.4);
}
.cover__frame::before {
  left: -1px;
  top: 14%;
}
.cover__frame::after {
  right: -1px;
  bottom: 14%;
}

.cover__title {
  position: absolute;
  top: 15%;
  right: 15.5%;
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: 11.5cqw;
  letter-spacing: 0.16em;
  line-height: 1.18;
  font-weight: 600;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  max-height: 62%;
  z-index: 4;
}

.cover__author {
  position: absolute;
  left: 16%;
  bottom: 17%;
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-size: 3.4cqw;
  letter-spacing: 0.22em;
  color: rgba(244, 236, 219, 0.68);
  z-index: 4;
}

.cover__seal {
  position: absolute;
  right: 13%;
  bottom: 13%;
  width: 11cqw;
  height: 11cqw;
  min-width: 22px;
  min-height: 22px;
  display: grid;
  place-items: center;
  background: var(--vermilion);
  color: #eaf6ff;
  font-family: var(--font-serif);
  font-size: 3.6cqw;
  line-height: 1;
  letter-spacing: 0;
  border-radius: 1px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  z-index: 5;
}

.cover__seal--long {
  background: var(--jade);
}

.cover--thumb {
  aspect-ratio: auto;
  width: 44px;
  height: 60px;
  flex: none;
}
.cover--thumb .cover__title {
  writing-mode: horizontal-tb;
  position: static;
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 17px;
  letter-spacing: 0;
  max-height: none;
  padding: 4px;
}
.cover--thumb .cover__author,
.cover--thumb .cover__seal,
.cover--thumb .cover__frame,
.cover--thumb::before {
  display: none;
}

/* 非中日文封面：书名横排，长译文不再竖成一列 */
.cover--horizontal.cover .cover__title,
html[lang]:not([lang='zh-CN']):not([lang='zh-TW']):not([lang='ja']) .cover:not(.cover--thumb) .cover__title {
  writing-mode: horizontal-tb;
  top: 12%;
  left: 11%;
  right: 11%;
  max-height: 54%;
  font-size: clamp(11px, 6.8cqw, 23px);
  line-height: 1.25;
  letter-spacing: 0;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  text-align: start;
}
.cover--horizontal.cover .cover__author,
html[lang]:not([lang='zh-CN']):not([lang='zh-TW']):not([lang='ja']) .cover:not(.cover--thumb) .cover__author {
  writing-mode: horizontal-tb;
  left: 11%;
  right: 24%;
  bottom: 9%;
  max-width: none;
  font-size: clamp(8px, 3cqw, 12px);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: start;
}
.cover--horizontal.cover .cover__seal {
  right: 9%;
  bottom: 8%;
}

/* 阿拉伯语：版式保持左到右，仅正文按从右到左排版 */
html[lang='ar'] {
  direction: ltr;
}
html.lang-ar :where(
  .hero h1,
  .hero__intro,
  .book-hero h1,
  .book-intro,
  .book-card__title,
  .book-card__intro,
  .read-content,
  .comment__body p,
  .doc-body,
  .doc-sub,
  .footer-brand p
),
html.lang-ar :where(.read-content, .doc-body) p {
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: start;
}

.cover--lg {
  box-shadow:
    0 40px 70px -36px rgba(18, 58, 82, 0.75),
    inset 0 0 0 1px rgba(244, 236, 219, 0.08);
}

/* ------------------------------- 页面头部 ------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 120;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid rgba(18, 58, 82, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 30px;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.logo__seal {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--vermilion);
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1;
  border-radius: 2px;
  box-shadow: 0 6px 14px -8px rgba(46, 168, 230, 0.9);
}

.logo__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.logo__name {
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 0.16em;
  line-height: 1;
}
.logo__sub {
  font-size: 7.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(18, 58, 82, 0.42);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 13.5px;
  color: rgba(18, 58, 82, 0.66);
  letter-spacing: 0.08em;
}
.header-nav a {
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}
.header-nav a:hover {
  color: var(--paper);
}
.header-nav a.active {
  color: var(--paper);
}
.header-nav a.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 18px;
  height: 2px;
  margin-left: -9px;
  background: var(--vermilion);
}

.header-search {
  position: relative;
  margin-left: auto;
  width: 270px;
  max-width: 32vw;
}
.header-search input {
  width: 100%;
  background: rgba(18, 58, 82, 0.07);
  border: 1px solid rgba(18, 58, 82, 0.16);
  color: var(--paper);
  border-radius: 999px;
  padding: 9px 38px 9px 15px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  outline: none;
  transition: all 0.25s ease;
}
.header-search input::placeholder {
  color: rgba(18, 58, 82, 0.4);
}
.header-search input:focus {
  background: rgba(18, 58, 82, 0.12);
  border-color: rgba(18, 58, 82, 0.4);
  width: 100%;
}
.header-search button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: rgba(18, 58, 82, 0.6);
}
.header-search button:hover {
  color: var(--paper);
}
.header-search svg {
  width: 15px;
  height: 15px;
}

.header-author-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid rgba(18, 58, 82, 0.2);
  border-radius: 2px;
  color: rgba(18, 58, 82, 0.72);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.header-author-link:hover {
  color: var(--paper);
  border-color: rgba(18, 58, 82, 0.5);
}
.header-author-link svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.user-menu {
  position: relative;
  flex: none;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.header-auth a {
  color: rgba(18, 58, 82, 0.7);
  transition: color 0.2s ease;
}
.header-auth a:hover {
  color: var(--paper);
}
.header-auth .header-signup {
  padding: 7px 14px;
  border: 1px solid rgba(18, 58, 82, 0.3);
  color: var(--paper);
  border-radius: 2px;
  transition: all 0.2s ease;
}
.header-auth .header-signup:hover {
  border-color: var(--vermilion);
  background: rgba(46, 168, 230, 0.16);
}
.user-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: none;
  color: var(--paper);
  padding: 4px;
}
.user-trigger.has-notice .avatar {
  position: relative;
}
.user-trigger.has-notice .avatar::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e4572e;
  border: 1.5px solid var(--paper);
}
.user-notice-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e4572e;
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(18, 58, 82, 0.12);
  border: 1px solid rgba(18, 58, 82, 0.24);
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--paper);
  flex: none;
}
.avatar--jade {
  background: var(--jade);
  border-color: transparent;
}
.user-trigger__name {
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: rgba(18, 58, 82, 0.82);
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 208px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s ease;
  z-index: 50;
}
.user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-dropdown__head {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}
.user-dropdown__head strong {
  font-family: var(--font-serif);
  font-size: 15px;
  display: block;
  margin-bottom: 3px;
}
.user-dropdown__head span {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}
.user-dropdown a,
.user-dropdown button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
  transition: background 0.2s ease;
}
.user-dropdown a:hover,
.user-dropdown button:hover {
  background: rgba(18, 58, 82, 0.05);
  color: var(--ink);
}
.user-dropdown svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}
.user-dropdown .divider {
  height: 1px;
  background: var(--line-soft);
  margin: 6px 0;
}

/* ------------------------------- 弹窗 / 提示 ------------------------------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(18, 58, 82, 0.66);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: maskIn 0.22s ease;
}

.modal {
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-top: 3px solid var(--vermilion);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.7);
  animation: modalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal--wide {
  width: min(940px, 100%);
}
.modal--narrow {
  width: min(420px, 100%);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.modal__head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.modal__head p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.modal__close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  flex: none;
}
.modal__close:hover {
  border-color: var(--ink);
}
.modal__close svg {
  width: 14px;
  height: 14px;
}
.modal__body {
  padding: 24px 26px;
  overflow: auto;
}
.modal__foot {
  padding: 16px 26px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes maskIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 220px;
  max-width: 360px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  border-left: 3px solid var(--jade);
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.7);
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast--error {
  border-left-color: var(--vermilion);
}
.toast--warn {
  border-left-color: var(--gold);
}
.toast svg {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 2px;
  opacity: 0.85;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------- 表格 / 后台 ------------------------------- */

.admin-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--paper);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: var(--paper);
  padding: 24px 16px 20px;
  border-right: 1px solid rgba(18, 58, 82, 0.08);
  overflow-y: auto;
}

.sidebar .logo {
  padding: 0 8px 4px;
}
.sidebar__role {
  margin: 18px 8px 22px;
  padding: 9px 12px;
  border: 1px solid rgba(18, 58, 82, 0.12);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(18, 58, 82, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar__role b {
  color: var(--paper);
  font-weight: 500;
  letter-spacing: 0.05em;
  font-size: 11px;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar__nav button,
.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  color: rgba(18, 58, 82, 0.58);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-align: left;
  transition: all 0.2s ease;
}
.sidebar__nav button:hover,
.sidebar__nav a:hover {
  color: var(--paper);
  background: rgba(18, 58, 82, 0.05);
}
.sidebar__nav button.active {
  color: var(--paper);
  background: rgba(18, 58, 82, 0.07);
  border-left-color: var(--vermilion);
}
.sidebar__nav svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex: none;
}
.sidebar__nav .nav-badge {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(18, 58, 82, 0.45);
  border: 1px solid rgba(18, 58, 82, 0.16);
  padding: 1px 5px;
}

.sidebar__label {
  padding: 20px 12px 8px;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(18, 58, 82, 0.3);
}

.sidebar__foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(18, 58, 82, 0.1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 8px;
}
.sidebar__user-name {
  font-size: 12.5px;
  line-height: 1.5;
}
.sidebar__user-name small {
  display: block;
  color: rgba(18, 58, 82, 0.4);
  font-size: 10px;
  letter-spacing: 0.08em;
}
.sidebar__foot button,
.sidebar__foot a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: rgba(18, 58, 82, 0.5);
  font-size: 12px;
  text-align: left;
}
.sidebar__foot button:hover,
.sidebar__foot a:hover {
  color: var(--paper);
  background: rgba(18, 58, 82, 0.05);
}
.sidebar__foot svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.admin-main {
  min-width: 0;
  padding: 0 38px 64px;
}

.admin-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.admin-top__title .eyebrow {
  display: block;
  margin-bottom: 9px;
}
.admin-top__title h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.admin-top__title p {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.admin-top__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  position: relative;
  padding: 20px 22px 18px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  right: -22px;
  bottom: -30px;
  width: 92px;
  height: 92px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
}
.stat-card__label {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
}
.stat-card__label svg {
  width: 13px;
  height: 13px;
  opacity: 0.5;
}
.stat-card__value {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1;
  margin: 14px 0 7px;
  letter-spacing: 0.02em;
}
.stat-card__hint {
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
.stat-card--accent {
  background: var(--ink);
  color: var(--paper);
}
.stat-card--accent .stat-card__label,
.stat-card--accent .stat-card__hint {
  color: rgba(18, 58, 82, 0.55);
}
.stat-card--accent::after {
  border-color: rgba(18, 58, 82, 0.12);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.panel-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.panel-head h2::before {
  content: '';
  width: 3px;
  height: 15px;
  background: var(--vermilion);
}
.panel-head .sub {
  font-size: 11.5px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
}
.panel-body {
  padding: 22px;
}
.panel-body--flush {
  padding: 0;
}

.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  padding: 11px 14px;
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: rgba(18, 58, 82, 0.02);
}
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--ink-2);
}
.table tbody tr {
  transition: background 0.18s ease;
}
.table tbody tr:hover {
  background: rgba(18, 58, 82, 0.025);
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table .book-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 210px;
}
.table .book-cell__title {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
}
.table .book-cell__meta {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 3px;
}
.table .actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}
.table .num {
  font-variant-numeric: tabular-nums;
}

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--ink-3);
}
.empty__char {
  font-family: var(--font-serif);
  font-size: 40px;
  color: var(--line);
  display: block;
  margin-bottom: 12px;
}
.empty p {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.06em;
}
.empty .btn {
  margin-top: 18px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tab {
  position: relative;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.06em;
  transition: all 0.2s ease;
}
.tab:hover {
  color: var(--ink);
}
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--vermilion);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.filter-bar .input,
.filter-bar .select {
  width: auto;
  min-width: 150px;
  padding: 8px 12px;
  font-size: 12.5px;
  background: var(--paper);
}
.filter-bar .input {
  min-width: 220px;
}
.filter-bar .spacer {
  flex: 1;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.pager__btns {
  display: flex;
  gap: 6px;
}
.pager button {
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
}
.pager button:hover:not(:disabled) {
  border-color: var(--ink);
}
.pager button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.pager button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* 权限勾选 */
.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.35);
}
.perm-item input {
  accent-color: var(--vermilion);
  width: 14px;
  height: 14px;
}
.perm-item:has(input:checked) {
  border-color: var(--ink-2);
  background: rgba(42, 167, 196, 0.05);
}

/* ------------------------------- 加载 / 骨架 ------------------------------- */

.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid var(--line);
  border-top-color: var(--vermilion);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-block {
  display: grid;
  place-items: center;
  padding: 80px 0;
  gap: 14px;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.skeleton {
  background: linear-gradient(90deg, rgba(18, 58, 82, 0.05) 25%, rgba(18, 58, 82, 0.09) 37%, rgba(18, 58, 82, 0.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  from {
    background-position: 100% 50%;
  }
  to {
    background-position: 0 50%;
  }
}

.fade-up {
  animation: fadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .admin-main {
    padding: 0 24px 50px;
  }
}

@media (max-width: 900px) {
  .wrap {
    padding: 0 20px;
  }
  .header-nav {
    display: none;
  }
  .header-inner {
    gap: 14px;
  }
  .header-search {
    width: 190px;
    max-width: 42vw;
  }
  .user-trigger__name {
    display: none;
  }
  .header-author-link span {
    display: none;
  }
  .header-author-link {
    padding: 6px 8px;
  }
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    padding: 14px 12px;
  }
  .sidebar__role,
  .sidebar__label {
    display: none;
  }
  .sidebar__nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 2px;
    padding-bottom: 4px;
  }
  .sidebar__nav button,
  .sidebar__nav a {
    width: auto;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 8px 11px;
    font-size: 12px;
  }
  .sidebar__nav button.active {
    border-left: none;
    border-bottom-color: var(--vermilion);
  }
  .sidebar__nav .nav-badge {
    display: none;
  }
  .sidebar__foot {
    display: none;
  }
  .admin-main {
    padding: 0 16px 40px;
  }
  .admin-top {
    padding-top: 20px;
  }
  .admin-top__title h1 {
    font-size: 24px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span-2 {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .site-header .header-inner {
    height: 60px;
    gap: 10px;
  }
  .site-header .logo__text {
    display: none;
  }
  .site-header .header-search {
    flex: 1;
    width: auto;
    max-width: none;
    margin-left: 4px;
  }
  .site-header .header-search input {
    padding-left: 12px;
    font-size: 12px;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .stat-card {
    padding: 15px 14px;
  }
  .stat-card__value {
    font-size: 27px;
  }
  .filter-bar {
    padding: 12px 14px;
  }
  .filter-bar .input {
    min-width: 100%;
  }
  .modal-mask {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    width: 100%;
    max-height: 92vh;
    border-top-width: 3px;
  }
  .modal__body {
    padding: 18px;
  }
  .modal__head,
  .modal__foot {
    padding-left: 18px;
    padding-right: 18px;
  }
  .toast-stack {
    right: 12px;
    left: 12px;
    bottom: 12px;
    align-items: stretch;
  }
  .toast {
    max-width: none;
  }
}

/* 系统开启「减少动态效果」时，停掉持续重绘的装饰动画 */
@media (prefers-reduced-motion: reduce) {
  .auth-bg .blob,
  .hero__kicker .dot,
  .imm-status i,
  .imm-typing i {
    animation: none !important;
  }
  .skeleton {
    animation: none;
  }
}

/* ------------------------------- 会员与积分 ------------------------------- */

.member-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.member-stat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.member-stat > div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(18, 58, 82, 0.03);
}
.member-stat span {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-4);
}
.member-stat strong {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.06em;
}
.member-tip {
  margin: 0;
  padding-left: 10px;
  border-left: 2px solid var(--gold);
  font-size: 11px;
  line-height: 1.9;
  color: var(--ink-3);
}
.member-block h4 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.member-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 12px;
  text-align: left;
  border: 1px solid var(--line);
  background: transparent;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}
.member-card:hover {
  border-color: var(--vermilion);
  background: rgba(46, 168, 230, 0.045);
}
.member-card strong {
  font-size: 12.5px;
  letter-spacing: 0.06em;
}
.member-card span {
  font-size: 11px;
  color: var(--ink-3);
}
.member-card em {
  font-style: normal;
  font-size: 10px;
  color: var(--vermilion);
}
.member-foot {
  margin: 0;
  font-size: 10px;
  color: var(--ink-4);
  text-align: center;
}

/* 签约审核详情 */
.contract-review {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contract-review p {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}
.contract-review strong {
  font-weight: 500;
  color: var(--ink-4);
}

/* 我的书架 */
.shelf-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
}
.shelf-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  background: rgba(18, 58, 82, 0.025);
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}
.shelf-item:hover {
  border-color: var(--vermilion);
  background: rgba(46, 168, 230, 0.04);
}
.shelf-item__title {
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: 0.04em;
}
.shelf-item__meta {
  font-size: 10.5px;
  color: var(--ink-4);
}
.shelf-empty {
  margin: 0;
  padding: 30px 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-4);
}

/* 评论管理单元格 */
.comment-cell {
  max-width: 420px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--ink-2);
}

/* ------------------------------- PWA / 移动端 ------------------------------- */

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

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

.install-hint {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 8000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-top: 2px solid var(--vermilion);
  background: rgba(255, 255, 255, 0.95);
  color: var(--paper);
  font-size: 11.5px;
  line-height: 1.7;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
}
.install-hint span {
  flex: 1;
}
.install-hint__btn {
  flex: none;
  padding: 6px 12px;
  border: none;
  background: var(--vermilion);
  color: #ffffff;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.install-hint__close {
  flex: none;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: rgba(18, 58, 82, 0.5);
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

@media (min-width: 720px) {
  .install-hint {
    left: auto;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    max-width: 360px;
  }
}

@media (max-width: 720px) {
  .wrap {
    padding: 0 18px;
  }
  .modal-mask {
    padding: 12px;
    align-items: flex-end;
  }
  .modal {
    width: 100% !important;
    max-height: 92dvh;
    overflow-y: auto;
  }
  .toast-stack {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------------------------- 语言切换 / 设置 ---------------------------- */

.yc-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin-left: 8px;
}

.yc-lang__gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  opacity: 0.62;
  cursor: pointer;
  text-decoration: none;
  transition:
    opacity 0.2s ease,
    transform 0.3s ease,
    background 0.2s ease;
}
.yc-lang__gear svg {
  width: 15px;
  height: 15px;
}
.yc-lang__gear:hover {
  opacity: 1;
  background: rgba(128, 128, 128, 0.08);
  transform: rotate(35deg);
}

.yc-lang__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  opacity: 0.62;
  transition:
    opacity 0.2s ease,
    background 0.2s ease;
}
.yc-lang__trigger:hover {
  opacity: 1;
  background: rgba(128, 128, 128, 0.08);
}
.yc-lang__trigger svg {
  width: 14px;
  height: 14px;
}
.yc-lang__code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px;
}

.yc-lang__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 9600;
  width: 272px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 16px 16px 14px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 70px -30px rgba(20, 18, 14, 0.5);
}
.yc-lang__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.yc-lang__head strong {
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.08em;
}
.yc-lang__close {
  border: none;
  background: transparent;
  color: var(--ink-4);
  font-size: 12px;
  padding: 2px 4px;
  line-height: 1;
}
.yc-lang__close:hover {
  color: var(--ink);
}
.yc-lang__label {
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--ink-4);
  margin-bottom: 8px;
}
.yc-lang__auto-btn {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.yc-lang__auto-btn:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}
.yc-lang__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.yc-lang__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  color: var(--ink-2);
  text-align: left;
  transition: background 0.16s ease;
}
.yc-lang__item:hover {
  background: rgba(18, 58, 82, 0.05);
}
.yc-lang__item.is-active {
  background: rgba(46, 168, 230, 0.08);
  color: var(--vermilion);
}
.yc-lang__item small {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-4);
}
.yc-lang__note {
  margin-top: 10px;
  font-size: 10px;
  line-height: 1.7;
  color: var(--ink-3);
}
.yc-lang__note:empty {
  display: none;
}

/* 全局减少动效 */
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-delay: 0ms !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* 故事背景折叠 */
.world-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.world-head h3 {
  margin: 0;
}
.world-toggle {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  white-space: nowrap;
  transition:
    color 0.18s ease,
    border-color 0.18s ease;
}
.world-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}
.chat-side.is-collapsed .world-body {
  display: none;
}

@media (max-width: 640px) {
  .yc-lang__panel {
    position: fixed;
    top: 60px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: 68dvh;
  }
}
