/* 圈言 · 样式 */
:root {
  --bg: #ffffff;
  --bg-soft: #f4f4f4;
  --card: #ffffff;
  --ink: #161616;
  --ink-2: #555555;
  --muted: #6f6f6f;
  --line: rgba(0, 0, 0, 0.10);
  --accent: #a55e5b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(165, 94, 91, 0.10);
  --gold: #8a7a63;
  --shadow: 0 16px 40px -26px rgba(0, 0, 0, 0.38);
  --glow-a: rgba(0, 0, 0, 0);
  --glow-b: rgba(0, 0, 0, 0);
  --font-ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --tab-h: 62px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

:root[data-theme="dark"] {
  --accent-ink: #1c1c1c;
  --bg: #222222;
  --bg-soft: #2a2a2a;
  --card: #2c2c2c;
  --ink: #ececec;
  --ink-2: #b2b2b2;
  --muted: #9b9b9b;
  --line: rgba(255, 255, 255, 0.10);
  --accent: #c98d84;
  --accent-soft: rgba(201, 141, 132, 0.14);
  --gold: #a99a83;
  --shadow: 0 14px 36px -22px rgba(0, 0, 0, 0.65);
  --glow-a: rgba(0, 0, 0, 0);
  --glow-b: rgba(0, 0, 0, 0);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent-ink: #1c1c1c;
    --bg: #222222;
    --bg-soft: #2a2a2a;
    --card: #2c2c2c;
    --ink: #ececec;
    --ink-2: #b2b2b2;
    --muted: #9b9b9b;
    --line: rgba(255, 255, 255, 0.10);
    --accent: #c98d84;
    --accent-soft: rgba(201, 141, 132, 0.14);
    --gold: #a99a83;
    --shadow: 0 14px 36px -22px rgba(0, 0, 0, 0.65);
    --glow-a: rgba(0, 0, 0, 0);
    --glow-b: rgba(0, 0, 0, 0);
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: none;
  z-index: 0;
}

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

button { cursor: pointer; }

::selection { background: var(--accent-soft); }

.app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* 顶栏：固定在视口顶部，不随页面滚动 */
.topbar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: 100%;
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 20px 10px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.brand { display: flex; align-items: baseline; gap: 8px; }

.brand-seal {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1;
  transform: translateY(3px);
  box-shadow: 0 4px 10px -4px var(--accent);
}

.brand-word {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.16em;
  margin-left: 2px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 12.5px;
  max-width: 46%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.user-chip.is-in .user-dot { background: var(--accent); }

/* 主体 */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: calc(58px + var(--safe-top)) 18px calc(var(--tab-h) + 34px + var(--safe-bottom));
}

.view { animation: viewIn 0.28s ease both; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* 分类胶囊 */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  transition: all 0.18s ease;
}

.chip.is-active {
  color: var(--accent-ink);
  border-color: var(--accent);
  background: var(--accent);
}

/* 句子卡片 */
.quote-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(56vh, 440px);
  padding: 48px 26px 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quote-card:active { transform: scale(0.994); }

.quote-card.is-dragging {
  transition: none;
  cursor: grabbing;
}

.quote-card.is-loading .quote-text { opacity: 0.55; }

.quote-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 60% at 100% 0%, var(--accent-soft), transparent 55%);
  opacity: 0.55;
}

.quote-glyph {
  position: absolute;
  top: 6px;
  left: 16px;
  font-family: var(--font-serif);
  font-size: 104px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.16;
  pointer-events: none;
}

.quote-tag {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--card);
}

.quote-text {
  position: relative;
  z-index: 1;
  margin: auto 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(21px, 5.9vw, 27px);
  line-height: 1.95;
  letter-spacing: 0.015em;
  color: var(--ink);
  word-break: break-word;
}

.quote-card.is-swapping .quote-text {
  animation: quoteIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.quote-card.swap-next.is-swapping .quote-text { animation-name: quoteInNext; }
.quote-card.swap-prev.is-swapping .quote-text { animation-name: quoteInPrev; }

@keyframes quoteIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes quoteInNext {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}

@keyframes quoteInPrev {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: none; }
}

.quote-meta {
  position: relative;
  z-index: 1;
  margin: 0 0 20px;
  min-height: 18px;
  text-align: right;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.quote-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 9px;
  font-size: 12.5px;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.action svg { width: 18px; height: 18px; }

.action:hover, .action:active { background: var(--bg-soft); }

.action.is-on { color: var(--accent); }
.action.is-on svg { fill: currentColor; }

.hint {
  margin: 14px 0 18px;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.write-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 16px;
  background: transparent;
  color: var(--accent);
  font-size: 13.5px;
  letter-spacing: 0.06em;
}

.write-plus { font-size: 17px; line-height: 1; }

.home-foot {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* 搜索 */
.searchbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.searchbar svg { width: 17px; height: 17px; color: var(--muted); flex: none; }

.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 7px 0;
  font-size: 16px;
}

.searchbar input::placeholder { color: var(--muted); }

/* 分段 */
.seg-row {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--bg-soft);
}

.seg {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 12.5px;
  transition: all 0.18s ease;
}

.seg.is-active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.35);
}

.seg-small { margin: 0; }
.seg-small .seg { padding: 9px 13px; font-size: 12px; }

/* 列表 */
.quote-list { display: flex; flex-direction: column; gap: 12px; }

.list-item {
  padding: 17px 18px 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  animation: viewIn 0.3s ease both;
}

.list-tag {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.list-text {
  margin: 7px 0 10px;
  font-family: var(--font-serif);
  font-size: 17.5px;
  line-height: 1.85;
  word-break: break-word;
}

.list-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-meta {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-fav {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  padding: 9px 9px;
}

.mini-fav.is-on { color: var(--accent); }
.mini-fav .mini-heart { font-size: 15px; line-height: 1; }
.mini-fav:active { transform: scale(0.94); }

.empty {
  margin: 34px 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}

.load-more {
  display: block;
  width: 100%;
  margin: 16px 0 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 2px 12px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}

.section-head span { font-size: 11.5px; color: var(--muted); }

/* 我的 */
.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 24px;
}

.profile-main { flex: 1; min-width: 0; }

.profile-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }

.me-tip {
  margin: 12px 2px 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* 账号与登录 */
.auth-tabs { display: flex; gap: 8px; margin: 4px 0 14px; }
.auth-tabs .seg { flex: 1; min-height: 44px; font-size: 14px; }
.auth-error { margin: 10px 2px 0; font-size: 12.5px; line-height: 1.6; color: var(--accent); }
.auth-tip { margin: 12px 2px 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); text-align: center; }
.modal input + input { margin-top: 10px; }
.account {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.account-line { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--ink-2); }
.account-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.build-tag { margin: 10px 0 0; font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); text-align: center; }

.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 12.5px;
}

.ghost.small { padding: 8px 12px; font-size: 12px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 15px 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.stat b { font-family: var(--font-serif); font-size: 24px; font-weight: 600; }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }

.sub-list { display: flex; flex-direction: column; gap: 10px; }

.sub-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
}

.sub-text { font-family: var(--font-serif); font-size: 15.5px; line-height: 1.8; }

.sub-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  background: var(--bg-soft);
  color: var(--ink-2);
}

.badge.pending { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.badge.approved { color: #4a7a52; background: rgba(74, 122, 82, 0.13); }
.badge.rejected { color: var(--muted); background: var(--bg-soft); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
}

.setting-row.link { text-decoration: none; color: var(--ink-2); }
.setting-label { letter-spacing: 0.04em; }
.chev { color: var(--muted); }

.about {
  margin: 26px 0 6px;
  text-align: center;
  font-size: 11.5px;
  line-height: 2;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* 底栏 */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: 100%;
  max-width: 560px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 10px calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid var(--line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  transition: color 0.18s ease;
}

.tab svg { width: 22px; height: 22px; }

.tab.is-active { color: var(--accent); }

/* 弹层 */
.sheet-mask, .modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  background: rgba(20, 14, 8, 0.48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: maskIn 0.22s ease both;
}

.sheet-mask { align-items: flex-end; }

@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 10px 20px calc(22px + var(--safe-bottom));
  border-radius: 26px 26px 0 0;
  background: var(--card);
  box-shadow: 0 -20px 60px -30px rgba(0, 0, 0, 0.6);
  animation: sheetUp 0.32s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

@keyframes sheetUp {
  from { transform: translateY(40px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.sheet-grip {
  width: 40px;
  height: 4px;
  margin: 2px auto 14px;
  border-radius: 999px;
  background: var(--line);
}

.sheet h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 0.08em;
}

.sheet-sub { margin: 0 0 16px; font-size: 12px; color: var(--muted); }

.sheet textarea, .sheet input, .sheet select, .modal input, .admin-form input, .admin-form textarea, .admin-form select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg-soft);
  outline: 0;
  font-size: 16px;
  resize: none;
  transition: border-color 0.18s ease;
}

.sheet textarea:focus, .sheet input:focus, .sheet select:focus, .modal input:focus, .admin-form input:focus, .admin-form textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.counter {
  margin: 5px 3px 12px;
  text-align: right;
  font-size: 11.5px;
  color: var(--muted);
}

.select-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 4px;
  font-size: 13px;
  color: var(--ink-2);
}

.select-row select { flex: 1; }

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.sheet-actions.three .btn { font-size: 12.5px; padding: 11px 8px; }

.btn {
  flex: 1;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.05em;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.985); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 24px -16px var(--accent); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn.wide { width: 100%; margin-top: 14px; }
.btn:disabled { opacity: 0.5; }

.share-preview {
  display: flex;
  justify-content: center;
  padding: 4px 0 2px;
}

.share-preview canvas {
  width: min(100%, 340px);
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* 加入弹窗 */
.modal-mask { align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }

.modal {
  width: 100%;
  max-width: 360px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 28px 24px 20px;
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: sheetUp 0.3s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.modal-seal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 13px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 24px;
  box-shadow: 0 12px 26px -14px var(--accent);
}

.modal h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.1em;
}

.modal p { margin: 0 0 18px; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.modal input { text-align: center; }

.text-btn {
  display: block;
  margin: 12px auto 0;
  padding: 9px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 26px + var(--safe-bottom));
  transform: translateX(-50%) translateY(8px);
  z-index: 80;
  max-width: 80vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  white-space: nowrap;
}

.toast.show { opacity: 0.95; transform: translateX(-50%) translateY(0); }

/* 管理后台 */
.admin-body { background: var(--bg); }

.admin-shell {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: calc(22px + var(--safe-top)) 20px 60px;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-serif);
  font-size: 19px;
  letter-spacing: 0.08em;
}

.admin-head-actions { display: flex; gap: 8px; }
.admin-head-actions a { text-decoration: none; display: inline-flex; align-items: center; }

.admin-login {
  max-width: 360px;
  margin: 70px auto 0;
  text-align: center;
}

.admin-login h2 { font-family: var(--font-serif); font-size: 20px; letter-spacing: 0.1em; }

.admin-login input { padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg-soft); width: 100%; font-size: 16px; outline: 0; }

.admin-tip { font-size: 12px; line-height: 1.8; color: var(--muted); margin: 10px 0 18px; }

.admin-error { margin-top: 12px; font-size: 12.5px; color: var(--accent); }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.admin-stat {
  padding: 14px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-align: center;
}

.admin-stat b { display: block; font-family: var(--font-serif); font-size: 22px; }
.admin-stat span { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.admin-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  font-size: 13.5px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.admin-tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.admin-list { display: flex; flex-direction: column; gap: 12px; }

.admin-item {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.admin-quote {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.85;
}

.admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.admin-actions select { width: auto; min-width: 90px; padding: 7px 10px; font-size: 12.5px; }
.admin-actions .btn { flex: none; padding: 7px 14px; font-size: 12.5px; }
.admin-actions .danger { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.admin-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.admin-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.admin-form-row { display: flex; gap: 12px; }
.admin-form-row label { flex: 1; }

.admin-search { margin-bottom: 14px; }

.admin-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; }

@media (max-width: 420px) {
  .brand-sub { display: none; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .quote-card.is-swapping .quote-text { animation: none; }
}

/* 主题切换：旧配色整页淡出，避免颜色硬跳 */
.theme-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.26s ease;
}

.theme-mask.is-out { opacity: 0; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.26s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ================= v12：同感 / 评论 / 主页 / 订阅 / 消息 / 媒体 ================= */

/* 顶栏消息铃 */
.bell {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-2);
}

.bell svg { width: 19px; height: 19px; }
.bell:active { transform: scale(0.94); }

.bell-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--card);
}

/* 首页卡片：配图 / 音频 / 作者 / 同感 */
.quote-media { margin: 4px 0 14px; display: grid; gap: 10px; }

.card-img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.card-audio {
  width: 100%;
  height: 38px;
  filter: saturate(0.9);
}

.quote-owner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 12px;
  padding: 5px 10px 5px 5px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  min-height: 34px;
}

.quote-owner img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.quote-owner .owner-go { color: var(--muted); font-size: 11px; }
.quote-owner:active { transform: scale(0.98); }

.action.is-on { color: var(--accent); }
.action.is-on svg { stroke: var(--accent); }

/* 列表卡片：作者、图片、音频、同感/评论 */
.list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.list-owner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 72%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
}

.list-owner.ghost { color: var(--muted); }
.list-owner span:not(.list-avatar) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
}

.list-avatar img, .comment-avatar img, .notice-avatar img, .people-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  margin: 4px 0 8px;
  border-radius: 13px;
  border: 1px solid var(--line);
}

.list-audio { width: 100%; height: 34px; margin: 2px 0 8px; }

.list-actions { display: inline-flex; align-items: center; gap: 2px; flex: none; }

.mini-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.mini-act .mini-thumb, .mini-act .mini-bubble { font-size: 11px; opacity: 0.85; }
.mini-act.is-on { color: var(--accent); }
.mini-act:active { transform: scale(0.94); }

/* 页面头（二级页） */
.page-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
}

.page-bar h2 {
  flex: 1;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.08em;
}

.back-btn, .icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-2);
}

.back-btn svg { width: 18px; height: 18px; }
.icon-btn { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); }

.text-btn.small { padding: 8px 6px; font-size: 12px; color: var(--accent); }

/* 成员主页 */
.user-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}

.avatar.big { width: 64px; height: 64px; font-size: 28px; overflow: hidden; }
.avatar.has-img img, .user-hero .avatar img, .avatar-edit .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.user-hero-main { flex: 1; min-width: 0; }

.user-hero h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-bio {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.user-hero .btn.small { flex: none; width: auto; padding: 9px 14px; font-size: 12.5px; }

.stats.four { grid-template-columns: repeat(4, 1fr); }
.stats.four .stat b { font-size: 19px; }

.profile-bio {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 我的页入口 */
.me-links {
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
}

.me-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  text-align: left;
}

.me-link:last-child { border-bottom: 0; }
.me-link .chev { color: var(--muted); font-size: 15px; }
.link-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

/* 发现页 feed 空态 */
.feed-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 34px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.feed-empty .btn.small { width: auto; padding: 9px 16px; }

/* 评论弹层 */
.sheet-mask { align-items: flex-end; }

.sheet-comments {
  display: flex;
  flex-direction: column;
  max-height: 88dvh;
  padding-bottom: calc(10px + var(--safe-bottom));
  overflow: hidden;
}

.comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
}

.comments-head h3 { margin: 0; font-family: var(--font-serif); font-size: 18px; letter-spacing: 0.08em; }
.comments-head h3 span { font-family: var(--font-ui); font-size: 12px; color: var(--muted); letter-spacing: 0; }

.comments-quote {
  margin: 2px 0 10px;
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--bg-soft);
  color: var(--ink-2);
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.comments-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.comment-list { display: grid; gap: 2px; }

.comment-item {
  display: flex;
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}

.comment-avatar-btn, .people-main { border: 0; background: transparent; padding: 0; }

.comment-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.comment-main { flex: 1; min-width: 0; }

.comment-top { display: flex; align-items: baseline; gap: 8px; }

.comment-name {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.comment-time { font-size: 10.5px; color: var(--muted); }

.comment-reply {
  margin: 5px 0 0;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

.comment-text { margin: 4px 0 0; font-size: 13.5px; line-height: 1.75; word-break: break-word; }

.comment-foot { display: flex; align-items: center; gap: 4px; margin-top: 4px; }

.comment-mini {
  padding: 7px 8px 7px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
}

.comment-mini.danger { color: var(--accent); opacity: 0.8; }

.comment-like {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
  padding: 7px 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
}

.comment-like.is-on { color: var(--accent); }
.comment-heart { font-size: 13px; }

.reply-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
}

.comment-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.comment-input-row input {
  flex: 1;
  width: auto;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  outline: 0;
  font-size: 16px;
}

.comment-input-row .btn.small { flex: none; width: auto; padding: 10px 18px; font-size: 13px; }

.empty.compact { margin: 20px 0; }

/* 粉丝 / 订阅 */
.sheet-people { max-height: 80dvh; }

.people-tabs { display: flex; gap: 8px; margin-bottom: 10px; }

.seg-small-btn {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
}

.seg-small-btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.people-list { display: grid; gap: 2px; }

.people-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.people-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-align: left;
}

.people-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
}

.people-text { min-width: 0; display: grid; gap: 2px; }
.people-text b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-text small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-item .btn.small { flex: none; width: auto; padding: 8px 14px; font-size: 12px; }

/* 消息列表 */
.notice-list { display: grid; gap: 2px; }

.notice-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 13px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  color: var(--ink);
}

.notice-item.is-unread { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.notice-item:active { transform: scale(0.995); }

.notice-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
  color: var(--accent);
  font-size: 15px;
}

.notice-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.notice-text { font-size: 13px; line-height: 1.5; }
.notice-text b { font-weight: 600; }
.notice-time { font-size: 10.5px; color: var(--muted); }

.notice-quote {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 编辑资料 */
.avatar-edit { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.avatar-edit .btn.small { width: auto; padding: 9px 14px; font-size: 12.5px; }
.sheet textarea { min-height: 58px; }

/* 投稿媒体 */
.media-row { display: flex; gap: 10px; margin: 16px 0 4px; }

.media-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
}

.media-btn svg { width: 18px; height: 18px; }
.media-btn:active { background: var(--bg-soft); }

.media-preview { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 2px; }

.media-thumb {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.media-thumb img { width: 100%; height: 100%; object-fit: cover; }

.media-audio {
  position: relative;
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}

.media-audio audio { flex: 1; height: 32px; }

.media-clear {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.media-audio .media-clear { position: static; flex: none; box-shadow: none; }

.media-tip { margin: 8px 2px 0; font-size: 11.5px; color: var(--accent); }

@media (max-width: 360px) {
  .stats.four .stat b { font-size: 17px; }
  .user-hero { padding: 14px; gap: 10px; }
  .avatar.big { width: 54px; height: 54px; }
  .comment-input-row .btn.small { padding: 10px 12px; }
}

/* ---------- v14：一言式首页 ---------- */
.view-home { display: flex; flex-direction: column; align-items: center; }
.view-home[hidden] { display: none; }
.home-stage { width: 100%; display: flex; justify-content: center; padding-top: 2px; }

.view-home .quote-card {
  width: min(100%, 342px);
  height: clamp(400px, calc(100dvh - 188px), 620px);
  min-height: 0;
  padding: 16px 18px 0;
  border-radius: 20px;
  cursor: pointer;
  touch-action: pan-y;
}

.view-home .quote-media {
  flex: 0 0 auto;
  margin: 0 0 12px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
}
.view-home .quote-media img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 12px;
}
.view-home .quote-media audio {
  display: block;
  width: 100%;
  height: 34px;
  margin: 4px 0;
}

.view-home .quote-body {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 4px 2px;
}
.view-home .quote-glyph {
  position: absolute;
  top: -18px;
  right: 0;
  left: auto;
  font-size: 78px;
  line-height: 1;
  opacity: 0.1;
}
.view-home .quote-text {
  position: relative;
  z-index: 1;
  margin: 0;
  width: 100%;
  font-size: 23px;
  line-height: 1.72;
  letter-spacing: 0.02em;
  text-align: left;
}

.view-home .quote-foot {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  padding-bottom: 4px;
}
.quote-tag-line {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.view-home .quote-meta {
  margin: 8px 0 0;
  text-align: right;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.view-home .quote-owner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
}
.view-home .quote-owner img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  object-fit: cover;
}
.view-home .quote-owner img[hidden] { display: none; }
.view-home .owner-go { color: var(--muted); font-size: 11.5px; }
.view-home .quote-sep { height: 1px; background: var(--line); margin: 12px 0 0; }
.view-home .quote-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 2px 0 0;
  border-top: 0;
}
.view-home .action {
  justify-content: center;
  gap: 5px;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 12.5px;
}
.view-home .action svg { width: 17px; height: 17px; }

.quote-share {
  position: absolute;
  border: 1px solid var(--line);
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  color: var(--ink-2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.quote-share svg { width: 17px; height: 17px; }

.view-home .quote-glyph { display: none; }
.view-home .hint { margin: 12px 0 0; font-size: 11px; letter-spacing: 0.2em; }

/* 5 图标底栏 */
.tabbar { grid-template-columns: repeat(5, 1fr); padding: 4px 6px calc(6px + var(--safe-bottom)); }
.tab { position: relative; gap: 0; justify-content: center; min-height: 44px; padding: 9px 0; }
.tab svg { width: 23px; height: 23px; }
.tab-write svg { width: 25px; height: 25px; }
.tab-write { color: var(--accent); }
.tab-dot {
  position: absolute;
  top: 7px;
  left: calc(50% + 7px);
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg);
}
.tab-dot[hidden] { display: none; }

@media (max-height: 700px) {
  .view-home .quote-card { height: clamp(360px, calc(100dvh - 196px), 566px); padding: 14px 16px 0; }
  .view-home .quote-text { line-height: 1.64; }
  .view-home .quote-media img { max-height: 104px; }
  .view-home .hint { margin-top: 9px; }
}

@media (max-width: 380px) {
  .view-home .quote-text { font-size: 21px; }
  .view-home .quote-card { padding: 14px 16px 0; }
}

/* ---------- v15：白/中性配色 + 多卡横滑 ---------- */
.view-home {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
}
.view-home[hidden] { display: none; }
.view-home .hint { margin: 2px 0 14px; font-size: 11px; letter-spacing: 0.16em; }

.card-deck {
  --cw: clamp(252px, 76vw, 318px);
  --ch: clamp(392px, calc(100dvh - 236px), 548px);
  position: relative;
  width: 100%;
  height: calc(var(--ch) + 32px);
  margin: 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.card-deck::-webkit-scrollbar { display: none; }
.deck-track {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 8px calc(50% - var(--cw) / 2) 24px;
}
.view-home .quote-card {
  flex: 0 0 var(--cw);
  width: var(--cw);
  height: var(--ch);
  min-height: 0;
  padding: 18px 18px 0;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  touch-action: pan-x pan-y;
}
.view-home .quote-card:active { transform: none; }
.view-home .quote-card::after { display: none; }
.view-home .quote-card.is-empty {
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: default;
}
.quote-empty {
  padding: 0 14px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.8;
  color: var(--muted);
}
.view-home .quote-media { max-height: 148px; }
.view-home .quote-media img { max-height: 148px; }
.view-home .quote-body { min-height: 0; }
.view-home .quote-text { font-size: 23px; line-height: 1.7; }
.view-home .quote-foot { padding-bottom: 2px; }
.view-home .quote-meta { margin: 7px 0 0; font-size: 12.5px; }
.view-home .quote-owner { margin-top: 8px; min-height: 34px; font-size: 12px; }
.view-home .quote-owner img { width: 20px; height: 20px; }
.view-home .quote-sep { margin: 10px 0 0; }
.view-home .quote-actions { padding: 0; }
.view-home .action { min-height: 40px; padding: 6px 0; font-size: 12px; }
.view-home .quote-share {
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: var(--card);
  opacity: 0.88;
}
.view-home .quote-share svg { width: 15px; height: 15px; }
.view-home .quote-tag-line { font-size: 10.5px; letter-spacing: 0.14em; }
@media (max-height: 700px) {
  .view-home .quote-text { font-size: 21px; line-height: 1.64; }
  .view-home .quote-media img { max-height: 110px; }
  .view-home .quote-meta { margin-top: 5px; font-size: 12px; }
  .view-home .action { min-height: 36px; }
}
@media (max-width: 380px) {
  .view-home .quote-card { padding: 16px 16px 0; }
  .view-home .quote-text { font-size: 21px; }
}

/* v15：标签行与卡片内分享按钮、正文上下留白 */
.quote-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.view-home .quote-tag-row { margin-bottom: 2px; }
.view-home .quote-body { padding: 16px 0 0; }
.view-home .quote-card.is-empty .quote-body { padding: 0; }
.view-home .quote-share {
  position: static;
  top: auto;
  right: auto;
  width: 36px;
  height: 36px;
  margin: -8px -8px -8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  opacity: 0.72;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.view-home .quote-share svg { width: 15px; height: 15px; }

/* ---------- v16：一言式卡片翻页（硬吸附、无橡皮筋） ---------- */
.card-deck {
  --cw: clamp(236px, 78vw, 300px);
  --ch: calc(var(--cw) * 5 / 3);
  height: calc(var(--ch) + 34px);
  overflow: hidden;
  overscroll-behavior: none;
  scroll-snap-type: none;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.deck-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: max-content;
  min-width: 100%;
  height: 100%;
  padding: 8px calc(50% - var(--cw) / 2) 24px;
  transition: none;
  will-change: transform;
  touch-action: pan-y;
}
.deck-track.is-animating,
.deck-track.is-animating .quote-card {
  transition: transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.card-deck.is-dragging,
.card-deck.is-dragging .quote-card { cursor: grabbing; }
.view-home .quote-card {
  flex: 0 0 var(--cw);
  width: var(--cw);
  height: var(--ch);
  padding: 16px 20px 0;
  -webkit-touch-callout: none;
  border-radius: 16px;
  transform-origin: 50% 50%;
  transition: none;
  touch-action: pan-y;
  will-change: transform;
}
.view-home .quote-card:active { transform: none; }
.view-home .quote-body { padding: 8px 0 0; }
.view-home .quote-text { font-size: 22px; line-height: 1.7; }
.view-home .quote-tag-row { margin-bottom: 0; }
.view-home .quote-tag-line { padding-left: 4px; font-size: 10.5px; letter-spacing: 0.1em; }
.view-home .quote-meta {
  margin: 6px 0 0;
  padding: 0 4px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.view-home .quote-owner { min-height: 30px; margin-top: 7px; font-size: 11.5px; }
.view-home .quote-owner img { width: 18px; height: 18px; }
.view-home .quote-sep { height: 0.5px; margin: 7px 4px 0; }
.view-home .quote-actions { height: 36px; }
.view-home .action { min-height: 36px; padding: 0; gap: 7px; font-size: 10.5px; }
.view-home .action svg { width: 15px; height: 15px; }
.view-home .quote-foot { padding-bottom: 0; }
.deck-track img { -webkit-user-drag: none; }
@media (max-height: 700px) {
  .view-home .quote-text { font-size: 20px; line-height: 1.62; }
  .view-home .quote-media img { max-height: 110px; }
}
@media (max-width: 380px) {
  .view-home .quote-card { padding: 14px 18px 0; }
  .view-home .quote-text { font-size: 21px; }
}

@media (max-height: 700px) {
  .card-deck {
    --cw: min(78vw, calc((100dvh - 260px) * 3 / 5));
    --ch: calc(var(--cw) * 5 / 3);
    height: calc(var(--ch) + 22px);
  }
  .deck-track { padding: 2px calc(50% - var(--cw) / 2) 12px; }
  .view-home .hint { margin: 0 0 8px; }
}

/* ---------- v19：外观、书签字体与日期 ---------- */
@font-face {
  font-family: 'QyYueSong';
  src: url('/qy-yuesong.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

body {
  transition: background-color 0.22s ease;
}

/* 亮度只作用在内容与弹层上，避免 filter 给 fixed 顶栏/底栏造出滚动容器 */
.main, .sheet-mask, .modal-mask {
  filter: brightness(var(--brightness, 1));
}

.quote-text,
.list-text,
.appearance-preview {
  font-family: var(--font-quote, var(--font-serif));
}

.view-home .quote-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}

.view-home .quote-date {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.view-home .quote-no { font-size: 8.5px; letter-spacing: 0.12em; opacity: 0.72; }

.view-home .quote-share {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: -8px -8px -8px 0;
  position: static;
  opacity: 0.7;
}

.view-home .quote-media { margin-top: 10px; }
.view-home .quote-media .card-art {
  display: block;
  width: 100%;
  height: 108px;
  object-fit: cover;
  border-radius: 10px;
  opacity: 0.96;
}
[data-theme="dark"] .view-home .quote-media .card-art { opacity: 0.78; }
.view-home .quote-media .card-img { max-height: 138px; }

.view-home .quote-meta { font-family: var(--font-ui); }

button.setting-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.setting-value { color: var(--muted); font-size: 12px; }

.appearance-modal { text-align: left; padding: 22px 20px 16px; }
.appearance-modal h2,
.appearance-modal .auth-sub,
.appearance-modal .modal-seal { text-align: center; }
.appearance-modal h2 { margin-bottom: 4px; }
.appearance-modal .auth-sub { margin-bottom: 10px; }
.setting-block { margin: 11px 0; }
.setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.setting-line > span:last-child { color: var(--muted); font-size: 11.5px; }

.palette-row { display: flex; flex-wrap: wrap; gap: 8px; }
.palette {
  flex: 1 1 46px;
  min-width: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.palette i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sw-bg);
  box-shadow: inset 0 0 0 6px var(--sw-card), 0 0 0 1px var(--line);
}
.palette.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}
.sw-paper { --sw-bg: #ffffff; --sw-card: #ffffff; }
.sw-rice { --sw-bg: #ead7b3; --sw-card: #fbf3dc; }
.sw-celadon { --sw-bg: #cfe2d8; --sw-card: #eff9f4; }
.sw-mist { --sw-bg: #d3e0ee; --sw-card: #f1f7fd; }
.sw-lotus { --sw-bg: #f0d5db; --sw-card: #fdf2f5; }
.sw-dusk { --sw-bg: #ddd7e8; --sw-card: #f6f3fb; }

.range {
  display: block;
  width: 100%;
  height: 30px;
  margin: 0;
  accent-color: var(--accent);
}
.font-row { display: flex; margin: 0; }
.font-row .seg { flex: 1; min-height: 39px; }

.appearance-preview {
  margin: 11px 0 12px;
  padding: 13px 12px 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg-soft);
  text-align: center;
  color: var(--ink);
  font-size: calc(17px * var(--quote-scale, 1));
  line-height: 1.75;
}
.appearance-preview small {
  display: block;
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* v20：纯白纸色、3×2 纸色网格、紧凑外观弹层 */
.palette-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.palette { flex: none; min-width: 0; }
.sw-paper { --sw-bg: #ffffff; --sw-card: #ffffff; }
.appearance-modal .setting-block { margin: 9px 0; }
.appearance-preview { margin: 9px 0 10px; padding: 11px 12px 9px; font-size: 16px; line-height: 1.65; }
.appearance-modal { padding: 18px 18px 14px; }
.appearance-modal .modal-seal { width: 42px; height: 42px; margin-bottom: 10px; font-size: 22px; }
.appearance-modal h2 { font-size: 19px; }
.appearance-modal .auth-sub { margin-bottom: 6px; }
.appearance-modal .setting-block { margin: 7px 0; }
.appearance-modal .setting-line { margin-bottom: 6px; }
.appearance-modal .palette { padding: 6px 4px 5px; gap: 4px; }
.appearance-modal .palette i { width: 26px; height: 26px; }
.appearance-modal .range { height: 26px; }
.appearance-modal .appearance-preview { margin: 7px 0 8px; padding: 9px 10px 7px; font-size: 15px; line-height: 1.6; }
.appearance-modal .appearance-preview small { margin-top: 5px; }
#appearanceDone { margin-top: 4px; }

/* v21：配图卡片给正文留出空间，长句在小屏也不裁切 */
.view-home .quote-media .card-img { max-height: 120px; }
@media (max-height: 700px) {
  .view-home .quote-media .card-img { max-height: 88px; }
}


