/* ========== 熊熊信箱 · 玻璃拟态 v3 ========== */
:root {
  --bg: #eef4ff;
  --accent: #7ba7f7;
  --accent-deep: #3f6fd8;
  --accent-soft: rgba(123, 167, 247, .14);
  --glass: rgba(255, 255, 255, .55);
  --glass-strong: rgba(255, 255, 255, .75);
  --border: rgba(255, 255, 255, 0.4);
  --border-glass: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.2));
  --ink: #1c2b4d;
  --ink-2: #4e6390;
  --ink-3: #8a9fc4;
  --red: #e5484d;
  --red-soft: rgba(229, 72, 77, .1);
  --green: #2f9e6e;
  --green-soft: rgba(47, 158, 110, .12);
  --amber: #d98a1f;
  --shadow-glow: 0 0 20px rgba(123, 167, 247, 0.2);
  --shadow: 0 18px 50px rgba(63, 111, 216, .12), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  --shadow-sm: 0 8px 24px rgba(63, 111, 216, .08), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --nav-h: 66px;
  --rail-w: 232px;
  --sans: "LXGW WenKai", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, "Segoe UI", sans-serif;
  --serif: "LXGW WenKai", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: radial-gradient(circle at 15% 50%, rgba(207, 224, 255, 0.6), transparent 50%),
              radial-gradient(circle at 85% 30%, rgba(230, 246, 255, 0.7), transparent 50%),
              radial-gradient(circle at 50% 80%, rgba(240, 230, 255, 0.5), transparent 50%),
              linear-gradient(150deg, #eff5ff 0%, #f6faff 45%, #eaefff 100%);
  min-height: 100dvh;
  overflow-x: hidden;
}
.hidden { display: none !important; }
.mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; }
.small { font-size: 12px; }

/* ---------- 背景光斑 (True Liquid Glass) ---------- */
.bg { 
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(circle at top left, rgba(207, 224, 255, 0.8), transparent 60%),
              radial-gradient(circle at bottom right, rgba(230, 246, 255, 0.9), transparent 60%),
              linear-gradient(135deg, #f0f4ff 0%, #e2eeff 100%);
  pointer-events: none;
}
.blob { 
  position: absolute; border-radius: 50%; filter: blur(50px); 
  mix-blend-mode: normal; opacity: 0.8;
  will-change: transform; transform: translateZ(0);
  pointer-events: none;
}
.b1 { width: 50vw; height: 50vw; background: rgba(162, 194, 255, 0.4); top: -10%; left: -10%; animation: drift 25s ease-in-out infinite alternate; }
.b2 { width: 60vw; height: 60vw; background: rgba(208, 191, 255, 0.3); bottom: -15%; right: -10%; animation: drift 28s ease-in-out infinite alternate-reverse; }
.b3 { width: 45vw; height: 45vw; background: rgba(204, 231, 255, 0.4); top: 30%; left: 20%; animation: drift 30s ease-in-out infinite alternate; }
.b4 { width: 40vw; height: 40vw; background: rgba(255, 235, 245, 0.4); top: 15%; right: 15%; animation: drift 22s ease-in-out infinite alternate-reverse; }

@keyframes drift {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { transform: translate(8vw, -6vw) scale(1.1) rotate(15deg); }
}
.float { animation: float 4s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- 玻璃卡片 (True Liquid Glass) ---------- */
.glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 100%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--r-lg);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  box-shadow: 0 16px 40px rgba(63, 111, 216, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.8), inset 0 -1px 2px rgba(255, 255, 255, 0.2);
  position: relative;
}
.glass::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.glass-strong {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.5) 100%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--r-lg);
  backdrop-filter: blur(50px) saturate(220%);
  -webkit-backdrop-filter: blur(50px) saturate(220%);
  box-shadow: 0 24px 60px rgba(63, 111, 216, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.95);
  position: relative;
}
.glass-strong::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,1), rgba(255,255,255,0.4));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 图标 ---------- */
[data-icon] {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.18em;
  flex-shrink: 0;
}
[data-icon] svg {
  width: 100%; height: 100%;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 熊 ---------- */
img.kumamon { display: inline-block; vertical-align: middle; border-radius: 999px; object-fit: cover; background: #fff; }
.kumamon-wrap { display: block; text-align: center; margin-bottom: 12px; }
.bear-big img { box-shadow: 0 12px 30px rgba(35, 35, 35, .18); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1));
  backdrop-filter: blur(20px) saturate(150%);
  color: var(--accent-deep); font-size: 15px; font-weight: 700;
  padding: 13px 22px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(63, 111, 216, 0.15), inset 0 1px 1px rgba(255,255,255,1), inset 0 0 0 1px rgba(255,255,255,0.5);
  transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .2s, filter .2s, background .2s;
  position: relative; overflow: hidden;
}
.btn::before {
  content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.6), transparent); opacity: 0; transition: opacity .2s; pointer-events: none;
}
.btn:hover:not(:disabled) { 
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.3));
  box-shadow: 0 14px 32px rgba(63, 111, 216, 0.25), inset 0 1px 1px rgba(255,255,255,1), inset 0 0 0 1px rgba(255,255,255,0.8);
  transform: translateY(-2px) scale(1.02);
}
.btn:hover:not(:disabled)::before { opacity: 1; }
.btn:active { transform: scale(.96) translateY(0); box-shadow: 0 4px 12px rgba(63, 111, 216, 0.1); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.small { padding: 8px 14px; font-size: 13.5px; }
.btn.ghost {
  background: rgba(255, 255, 255, .65);
  border: 1px solid var(--border);
  color: var(--accent-deep);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(255, 255, 255, .9); }
.btn.danger { background: linear-gradient(135deg, #f0736f, #e5484d); box-shadow: 0 10px 24px rgba(229, 72, 77, .3); }

/* ---------- 输入 ---------- */
.field {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(16px);
  padding: 12px 15px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.04), 0 2px 8px rgba(255,255,255,0.5);
  transition: border-color .25s, box-shadow .25s, background .25s, transform .25s;
}
.field:focus {
  border-color: rgba(255,255,255,1);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.6), 0 8px 24px rgba(123, 167, 247, 0.15), inset 0 2px 4px rgba(0,0,0,0.01);
  background: rgba(255,255,255,0.7);
  transform: translateY(-2px);
}
textarea.field { resize: vertical; min-height: 120px; line-height: 1.8; }
.field::placeholder { color: var(--ink-3); }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.badge.pending { background: var(--amber); color: #fff; }
.badge.replied { background: var(--green-soft); color: var(--green); border: 1px solid rgba(47, 158, 110, .25); }
.badge.rejected { background: var(--red-soft); color: var(--red); border: 1px solid rgba(229, 72, 77, .25); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(92vw, 420px);
}
.toast-item {
  background: var(--glass-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  padding: 11px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--ink);
  box-shadow: var(--shadow-sm);
  animation: toast-in .25s ease;
  max-width: 100%;
}
.toast-item.err { color: var(--red); border-color: rgba(229, 72, 77, .4); }
.toast-item.ok { color: var(--green); border-color: rgba(47, 158, 110, .35); }
.toast-item.out { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- 顶部玻璃液态通知 ---------- */
#notif {
  position: fixed; top: 14px; left: 0; right: 0;
  z-index: 900; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 14px;
}
.notif-card {
  pointer-events: auto;
  width: min(94vw, 420px);
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  background: linear-gradient(120deg, rgba(255,255,255,.86), rgba(245,249,255,.78));
  border: 1px solid rgba(123, 167, 247, .35);
  border-radius: 18px;
  backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: 0 14px 40px rgba(63, 111, 216, .22), inset 0 0 0 1px rgba(255,255,255,.6);
  cursor: pointer;
  transform: translateY(-140%) scale(.92);
  opacity: 0;
  position: relative;
  overflow: hidden;
}
.notif-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #7ba7f7, #4a7ce0);
}
.notif-card.in {
  transform: none;
  opacity: 1;
  animation: notif-spring .55s cubic-bezier(.34, 1.56, .64, 1);
}
.notif-card.out {
  animation: notif-out .35s ease forwards;
}
@keyframes notif-spring {
  0% { transform: translateY(-140%) scale(.92); opacity: 0; }
  60% { transform: translateY(8px) scale(1.01); opacity: 1; }
  80% { transform: translateY(-4px); }
  100% { transform: none; }
}
@keyframes notif-out {
  to { transform: translateY(-120%) scale(.95); opacity: 0; }
}
.notif-ico {
  width: 44px; height: 44px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--accent-soft); color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgba(123, 167, 247, .25);
}
.notif-ico img { width: 44px; height: 44px; border-radius: 50%; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notif-body b { font-size: 14.5px; font-weight: 800; color: var(--ink); }
.notif-body small {
  font-size: 12px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-x {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--ink-3);
  background: rgba(255, 255, 255, .7);
}
.notif-x:hover { color: var(--ink); }

/* ---------- 隐私确认弹窗 ---------- */
.privacy-head { text-align: center; margin-bottom: 8px; }
.privacy-head img { width: 76px; height: 76px; box-shadow: 0 12px 30px rgba(35,35,35,.2); }
.privacy-sub { text-align: center; color: var(--ink-2); font-size: 13px; margin: 6px 0 16px; }
.privacy-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.privacy-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .65);
  border: 1px solid var(--border);
  font-size: 13.5px; line-height: 1.7; color: var(--ink-2);
}
.privacy-list li span[data-icon] {
  color: var(--accent-deep); margin-top: 3px; font-size: 17px;
}
.privacy-list li b { color: var(--ink); }

/* ---------- 备用手机号 ---------- */
.phone-box {
  margin-top: 16px; text-align: left;
  padding: 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .6);
  border: 1px dashed rgba(123, 167, 247, .4);
}
.phone-row { display: flex; align-items: center; gap: 8px; }
.phone-row .field { flex: 1; }
.phone-ico { color: var(--ink-3); display: inline-flex; }
.phone-hint { font-size: 11.5px; color: var(--ink-3); margin: 8px 0 0; line-height: 1.7; }

/* ---------- 意见反馈 ---------- */
.feedback-box { margin-top: 14px; }
.feedback-box .panel { padding: 20px; }
.feedback-box .field { min-height: 96px; }
.fb-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.fb-item {
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--border);
}
.fb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.fb-when { font-size: 11px; color: var(--ink-3); }
.fb-text { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }

/* ---------- Skeleton ---------- */
.skeleton {
  height: 88px; border-radius: var(--r-md);
  background: linear-gradient(110deg, rgba(255,255,255,0.4) 40%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,0.4) 60%);
  background-size: 200% 100%;
  animation: shim 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6);
}
@keyframes shim { to { background-position: -200% 0; } }

/* ================= 登录弹窗 (Lazy Login Modal) ================= */
.login-modal-mask {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(238, 244, 255, 0.3);
  backdrop-filter: blur(28px) saturate(1.8);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .3s, backdrop-filter .3s, visibility .3s;
}
.login-modal-mask.hidden { opacity: 0; pointer-events: none; backdrop-filter: blur(0px); visibility: hidden; }
.login-wrap {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px;
  transform: translateY(0) scale(1);
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.login-modal-mask.hidden .login-wrap { transform: translateY(20px) scale(0.95); }
.login-hero img {
  width: min(92vw, 440px);
  height: auto;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(35, 35, 35, .18);
  margin-bottom: 18px;
  display: block;
}
.login-title { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: 2px; background: linear-gradient(135deg, #1c2b4d, #3f6fd8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-sub { margin: 6px 0 26px; color: var(--ink-2); font-size: 14px; }
.login-card {
  width: min(92vw, 400px);
  padding: 26px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-field { position: relative; }
.login-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3);
}
.login-field .field { padding-left: 42px; }
.login-extra { display: flex; gap: 8px; }
.login-extra .field { flex: 1; }
.login-hint { font-size: 13px; color: var(--ink-2); text-align: center; }
.login-hint a { color: var(--accent-deep); text-decoration: none; font-weight: 600; }
.login-foot { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 26px; }
.login-card h2 { margin: 0 0 4px; font-size: 20px; text-align: center; }
.login-card .sub { text-align: center; color: var(--ink-2); font-size: 13px; margin: 0 0 6px; }
.login-ai { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: -4px; }

/* ================= 主应用 ================= */
.app-shell { min-height: 100dvh; padding-bottom: calc(var(--nav-h) + 24px); }

/* 顶栏(桌面 + 移动共用结构,内容自适应) */
.app-top {
  position: sticky; top: 0; z-index: 30;
  background: rgba(238, 244, 255, .75);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid rgba(123, 167, 247, .14);
}
.top-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 38px; height: 38px; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; background: linear-gradient(135deg, #1c2b4d, #3f6fd8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* 顶部标签组(桌面) */
.top-tabs {
  display: none;
  align-items: center; gap: 4px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  backdrop-filter: blur(18px) saturate(1.4);
}
.rail-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: background .15s, color .15s;
  position: relative; white-space: nowrap;
}
.rail-item:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.rail-item.active { background: var(--accent-soft); color: var(--accent-deep); }
.rail-item .dot { top: 3px; right: 4px; }

/* 顶栏右侧用户区(桌面) */
.top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-user {
  display: flex;
  align-items: center; gap: 10px;
  padding: 5px 14px 5px 6px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(1.4);
}
.rail-avatar img, .rail-avatar { border-radius: 999px; }
.rail-avatar { display: inline-flex; }
.rail-avatar img { width: 34px; height: 34px; box-shadow: var(--shadow-sm); }
.rail-info { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.rail-info b { font-size: 13.5px; }
.rail-info small { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav {
  position: fixed; left: 12px; right: 12px; bottom: 10px;
  height: calc(var(--nav-h) - 8px);
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 22px;
  backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 14px 40px rgba(63, 111, 216, .18);
  display: flex; z-index: 50;
  padding: 4px;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: none; background: none; cursor: pointer;
  color: var(--ink-3); font-size: 10.5px; font-weight: 600;
  border-radius: 18px;
  transition: background .15s, color .15s, transform .15s;
  position: relative;
}
.nav-item span[data-icon] { font-size: 21px; }
.nav-item.active { color: var(--accent-deep); background: var(--accent-soft); }
.nav-item:active { transform: scale(.94); }

/* 未读圆点 */
.dot {
  position: absolute; top: 7px; right: calc(50% - 24px);
  min-width: 18px; height: 18px; padding: 0 4px;
  background: linear-gradient(135deg, #f0736f, #e5484d); color: #fff;
  font-size: 10px; font-weight: 800;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(229, 72, 77, .4);
  border: 1.5px solid #fff;
  animation: dot-pulse 2s infinite;
}
@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}
.rail-item .dot { top: 6px; right: 10px; }

/* 内容区 */
.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 8px 16px;
}
.letter-text {
  font-size: 15.5px; line-height: 2.1; color: #2e3c5a;
  white-space: pre-wrap; word-break: break-word;
  font-family: var(--serif); letter-spacing: 0.3px;
}
.view { display: none; animation: view-in .3s ease; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Tab 标题 */
.tab-title { display: flex; align-items: center; gap: 12px; margin: 6px 2px 16px; }
.tab-title img { width: 56px; height: 56px; border-radius: 50%; box-shadow: var(--shadow-sm); }
.tab-title h2 { margin: 0; font-size: 24px; font-weight: 800; background: linear-gradient(135deg, #1c2b4d, #3f6fd8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.tab-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-2); }

/* 写信 */
.compose-form { display: flex; flex-direction: column; gap: 14px; padding: 20px 18px; }
.c-title-row { position: relative; }
.c-count {
  position: absolute; right: 14px; bottom: 12px;
  font-size: 11px; color: var(--ink-3); pointer-events: none;
}
.compose-anon {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--ink-2);
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--accent-soft);
}
.compose-anon b { color: var(--accent-deep); }

/* 寄出成功 */
.send-done {
  text-align: center; padding: 34px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.send-done .btn { margin-top: 14px; }

/* 信件卡片 */
.letter-list { display: flex; flex-direction: column; gap: 14px; }
.letter-card {
  width: 100%;
  text-align: left;
  border: none; cursor: pointer;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .25s, background .25s;
  animation: fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.letter-card:hover { 
  transform: translateY(-4px) scale(1.01); 
  box-shadow: var(--shadow), var(--shadow-glow); 
  background: rgba(255, 255, 255, 0.65);
}
.letter-card:active { transform: scale(.985); box-shadow: var(--shadow-sm); }
.letter-card.is-pending { border-left: 4px solid var(--amber); }
.letter-card.rejected-card { border-left: 4px solid var(--red) !important; background: rgba(229, 72, 77, 0.05); }
.letter-card .l-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.l-title {
  font-size: 16px; font-weight: 800; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.l-preview {
  font-size: 13.5px; color: var(--ink-2); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.l-meta { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap; margin-top: 2px; }

/* 空状态 */
.empty {
  text-align: center; color: var(--ink-2);
  padding: 40px 20px; font-size: 14.5px; line-height: 1.9;
  animation: fade-up 0.5s ease both;
}
.empty .kumamon-wrap { margin-bottom: 10px; display: inline-block; animation: float 4s ease-in-out infinite; }
.empty img { width: 92px; height: 92px; filter: drop-shadow(0 10px 15px rgba(35,35,35,0.1)); }

/* ================= 信件详情 ================= */
.letter-page {
  max-width: 680px; margin: 0 auto;
  min-height: 100dvh;
  /* 信件详情展示时底栏已隐藏，仅留固定下边距 */
  padding: 18px 16px 40px;
}
.letter-top {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
}
.letter-top button {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  cursor: pointer; color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform .15s;
}
.letter-top button:active { transform: scale(.92); }
.letter-top h1 { margin: 0; font-size: 20px; font-weight: 800; background: linear-gradient(135deg, #1c2b4d, #3f6fd8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.letter-paper { padding: 24px 22px; }
.paper-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.paper-head h2 {
  margin: 0; font-size: 22px; font-weight: 800; line-height: 1.5;
  font-family: var(--serif); letter-spacing: 0.5px; color: var(--ink);
}
.when {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3); margin-bottom: 16px;
}
/* .content 布局规则已在上方定义，此处不重复，避免覆盖 */
.reply-box { margin-top: 14px; padding: 20px; }
.reply-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.rb-avatar { display: inline-flex; }
.rb-avatar img { width: 30px; height: 30px; border-radius: 50%; }
.reply-form { display: flex; flex-direction: column; gap: 10px; position: relative; }
.reply-form .field { min-height: 120px; padding-right: 90px; }
.count-hint { position: absolute; right: 14px; bottom: 56px; font-size: 11px; color: var(--ink-3); }
.reply-form .btn { align-self: flex-end; }

/* ================= 我的 ================= */
.me-card { padding: 24px 22px; text-align: center; }
.me-avatar-wrap { position: relative; display: inline-block; margin-bottom: 12px; }
.me-avatar-wrap img {
  width: 84px; height: 84px;
  border-radius: 50%;
  box-shadow: 0 14px 36px rgba(35, 35, 35, .18), 0 0 0 5px rgba(255, 255, 255, .7);
}
.avatar-edit {
  position: absolute; right: -4px; bottom: 2px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--accent-deep); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.avatar-edit:active { transform: scale(.9); }
.me-card h2 { margin: 0; font-size: 20px; font-weight: 800; }
.me-meta { color: var(--ink-2); font-size: 13px; margin: 6px 0 0; }
.role-chip {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 5px 14px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--green-soft); color: var(--green);
  border: 1px solid rgba(47, 158, 110, .25);
}
.me-stats { display: flex; margin-top: 14px; border-radius: var(--r-md); overflow: hidden; background: var(--accent-soft); }
.me-stats .ms { flex: 1; padding: 12px 4px; text-align: center; }
.me-stats .ms + .ms { border-left: 1px solid var(--border); }
.me-stats b { display: block; font-size: 19px; color: var(--accent-deep); }
.me-stats small { font-size: 11px; color: var(--ink-2); }
.me-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }

/* ================= 管理后台 ================= */
.admin-body { background: linear-gradient(150deg, #eef4ff, #f6faff 50%, #eaf1ff); }
.login-wrap { padding-top: 8vh; }
.admin-shell { max-width: 1080px; margin: 0 auto; padding: 22px 16px 60px; }
.admin-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.admin-top h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 19px; font-weight: 800; }
.admin-bear img { width: 40px; height: 40px; border-radius: 50%; box-shadow: var(--shadow-sm); }
.admin-tabs {
  display: flex; gap: 4px; padding: 6px;
  margin-bottom: 18px; border-radius: var(--r-md);
}
.atab {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px;
  border: none; background: none; cursor: pointer;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.atab:hover { background: rgba(255, 255, 255, .6); }
.atab.active { background: var(--accent-deep); color: #fff; box-shadow: 0 6px 16px rgba(63, 111, 216, .3); }
.admin-view { display: none; animation: view-in .3s ease; }
.admin-view.active { display: block; }

.panel { padding: 20px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 14px; font-size: 15px; font-weight: 800; }
.panel h3::before { content: ""; display: inline-block; width: 4px; height: 15px; background: var(--accent); border-radius: 4px; margin-right: 9px; vertical-align: -2px; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat-card { padding: 18px 16px; }
.sc-ico { display: inline-flex; width: 42px; height: 42px; border-radius: 14px; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-deep); margin-bottom: 10px; font-size: 22px; }
.stat-card .num { font-size: 27px; font-weight: 800; line-height: 1.1; }
.stat-card .lbl { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

.csv-box { min-height: 130px; font-family: var(--sans); }
.csv-hint { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.8; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .field { flex: 1; min-width: 160px; position: relative; padding-left: 40px; }
.t-search { position: relative; margin-left: 14px; color: var(--ink-3); font-size: 16px; }

table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th {
  text-align: left; padding: 10px 10px;
  font-size: 12px; color: var(--ink-3); font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.list td { padding: 11px 10px; border-bottom: 1px solid rgba(123, 167, 247, .14); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: rgba(255, 255, 255, .45); }
.td-avatar { width: 52px; }
.row-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: var(--shadow-sm); }
.row-avatar-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--ink-3); }
.td-ops { white-space: nowrap; text-align: right; }
.op {
  border: none; cursor: pointer;
  width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s, background .12s;
}
.op:active { transform: scale(.9); }
.op.view { background: var(--accent-soft); color: var(--accent-deep); }
.op.del { background: var(--red-soft); color: var(--red); margin-left: 4px; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.switch input { display: none; }
.switch span {
  position: absolute; inset: 0;
  background: rgba(147, 163, 196, .35);
  border-radius: 999px;
  transition: background .2s;
}
.switch span::after {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .2s;
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }

.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(43, 58, 92, .35);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 40px;
  overflow-y: auto;
  animation: fade-in .2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(92vw, 620px);
  padding: 22px 22px 26px;
  background: var(--glass-strong);
  position: relative;
  animation: view-in .25s ease;
}
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal .letter-paper { box-shadow: none; margin-top: 12px; }
.modal-x {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255, 255, 255, .8);
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}

/* ================= Kaomoji & Extra ================= */
.privacy-btn { width: 100%; margin: 14px auto 0; display: flex; }
.kaomoji { display: inline-flex; align-items: center; justify-content: center; font-family: var(--sans); font-weight: 800; color: var(--accent-deep); letter-spacing: -1px; font-size: 1.5em; line-height: 1.2; }

/* ================= 桌面布局 ================= */
@media (min-width: 900px) {
  .app-top { border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .7); }
  .top-inner { padding: 12px 28px; }
  .top-tabs { display: flex; }
  .nav { display: none; }
  .app-shell { padding-bottom: 48px; }
  .letter-page { padding-top: 40px; padding-bottom: 48px; }
  .content { max-width: 900px; padding: 30px 28px 60px; }
  .tab-title { margin: 2px 2px 20px; }
  .tab-title img { width: 48px; height: 48px; }
  .letter-list { gap: 14px; }
  .login-wrap { padding-top: 6vh; }

  /* 各面板桌面居中限宽,统一 admin 卡片风格 */
  #tab-compose .compose-form,
  #tab-compose .send-done { max-width: 640px; margin-left: auto; margin-right: auto; }
  #tab-reply .letter-list,
  #tab-review .letter-list,
  #tab-inbox .letter-list { max-width: 760px; margin-left: auto; margin-right: auto; }
  #tab-me .me-card,
  #tab-me .feedback-box,
  #tab-me .me-actions,
  #tab-me .privacy-btn { max-width: 640px; margin-left: auto; margin-right: auto; }
  .me-card { padding: 30px 28px; }
  .feedback-box { padding: 22px 24px; }
  .letter-card { padding: 18px 20px; }
  .compose-form .field[type="text"] { font-size: 16px; }
  .compose-form textarea.field { min-height: 220px; }
}
@media (max-width: 899px) {
  .top-user { display: none; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(123, 167, 247, .4); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 写信页追加 ---------- */
.c-type-toggle { display: flex; gap: 10px; margin-bottom: 12px; }
.c-type-lbl { flex: 1; position: relative; cursor: pointer; }
.c-type-lbl input { position: absolute; opacity: 0; pointer-events: none; }
.c-type-btn { 
  display: block; text-align: center; padding: 10px; font-size: 14px; font-weight: 600; 
  color: var(--ink-2); background: rgba(255,255,255,0.4); border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,0.6);
  transition: all .2s;
}
.c-type-lbl input:checked + .c-type-btn {
  background: var(--accent-deep); color: #fff;
  border-color: var(--accent-deep);
  box-shadow: 0 4px 12px rgba(63, 111, 216, 0.2);
}


/* ========== v11 新增:深色模式 / 心理支持 / 无障碍 ========== */

/* ---------- 无障碍基础 ---------- */
.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 20000;
  padding: 10px 16px; border-radius: 12px;
  background: var(--accent-deep); color: #fff; text-decoration: none;
  font-size: 14px; transition: top .2s ease;
}
.skip-link:focus { top: 12px; outline: 3px solid var(--ink); }
:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 2px; border-radius: 8px; }
.theme-btn { padding: 6px 9px; line-height: 1; }
@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}

/* ---------- 写信页:草稿提示 / 温和提示 ---------- */
.draft-hint { min-height: 18px; margin: 8px 2px 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.care-hint {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  margin: 12px 0 0; padding: 12px 14px; font-size: 13px; color: var(--ink-2);
  border-radius: 14px; border: 1px solid var(--border); background: var(--glass);
}
.care-hint.hidden { display: none; }

/* ---------- 温和求助资源卡 ---------- */
.care-card { max-width: 460px; }
.care-head { text-align: center; }
.care-title { text-align: center; margin: 8px 0 10px; font-size: 19px; }
.care-text { font-size: 14px; color: var(--ink-2); line-height: 1.75; margin: 0 0 14px; }
.care-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.care-list li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid var(--border);
}
.care-name { font-weight: 600; font-size: 13.5px; }
.care-phone { font-family: "JetBrains Mono", Consolas, monospace; font-size: 15px; font-weight: 700; color: var(--accent-deep); letter-spacing: .3px; }
.care-list small { width: 100%; font-size: 12px; color: var(--ink-3); }
.care-extra { font-size: 12.5px; color: var(--ink-3); line-height: 1.7; margin: 0 0 16px; }
.care-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 首次进入引导 ---------- */
.guide-card { max-width: 440px; }
.guide-head { text-align: center; }
.guide-title { text-align: center; margin: 8px 0 6px; font-size: 19px; }
.guide-text { font-size: 14px; color: var(--ink-2); line-height: 1.75; text-align: center; margin: 0 0 14px; }
.guide-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.guide-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.guide-list li span[data-icon] { color: var(--accent-deep); flex-shrink: 0; margin-top: 1px; }
.guide-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.guide-foot { text-align: center; font-size: 12.5px; margin: 12px 0 0; }
.guide-foot a { color: var(--ink-3); }

/* ---------- 回信台:暖心模板 / 超时提醒 ---------- */
.tpl-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.tpl-chip {
  border: 1px solid var(--border); background: var(--accent-soft); color: var(--accent-deep);
  font: inherit; font-size: 12.5px; line-height: 1.4; padding: 6px 10px; border-radius: 999px;
  cursor: pointer; text-align: left; max-width: 100%;
  transition: transform .15s ease, background .15s ease;
}
.tpl-chip:hover { background: var(--glass-strong); transform: translateY(-1px); }
.tpl-hint { font-size: 12px; color: var(--ink-3); margin: 0 0 10px; }
.overdue-banner {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.6;
  color: var(--ink-2); border-color: rgba(217, 138, 31, .45); background: rgba(217, 138, 31, .1);
}
.overdue-banner span[data-icon] { color: var(--amber); flex-shrink: 0; margin-top: 2px; }

/* ---------- 隐私说明 / 服务条款页 ---------- */
.legal-page { max-width: 880px; margin: 0 auto; padding: 28px 18px 64px; position: relative; z-index: 1; }
.legal-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.legal-updated { font-size: 12.5px; color: var(--ink-3); }
.legal-card {
  padding: 28px clamp(18px, 4vw, 40px); border-radius: var(--r-lg);
  line-height: 1.85; font-size: 15px; color: var(--ink-2);
}
.legal-card h1 { color: var(--ink); font-size: clamp(22px, 4vw, 28px); margin: 0 0 10px; }
.legal-card h2 { color: var(--ink); font-size: 19px; margin: 32px 0 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.legal-card h3 { color: var(--ink); font-size: 15.5px; margin: 18px 0 6px; }
.legal-lead {
  font-size: 14.5px; color: var(--ink-2); background: var(--accent-soft);
  border-radius: 14px; padding: 14px 16px; margin: 0 0 18px;
}
.legal-nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.legal-nav a {
  font-size: 13px; color: var(--accent-deep); text-decoration: none;
  padding: 5px 12px; border-radius: 999px; background: var(--accent-soft);
}
.legal-card ul { padding-left: 20px; margin: 8px 0 14px; }
.legal-card li { margin: 6px 0; }
.legal-card a { color: var(--accent-deep); }
.legal-hotlines { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.legal-hotlines li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0;
  padding: 12px 14px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid var(--border);
}
.legal-hotlines b { width: 100%; font-size: 13.5px; color: var(--ink); }
.legal-hotlines span { font-family: "JetBrains Mono", Consolas, monospace; font-size: 16px; font-weight: 700; color: var(--accent-deep); }
.legal-hotlines small { width: 100%; font-size: 12px; color: var(--ink-3); }
.legal-note { font-size: 13px; color: var(--ink-3); }
.legal-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; padding-top: 18px; border-top: 1px dashed var(--border); }

/* ---------- 深色模式(html[data-theme] 由首屏内联脚本初始化,支持手动切换) ---------- */
html[data-theme="dark"] {
  --bg: #0e1522;
  --accent: #7fa9f8;
  --accent-deep: #9cc0ff;
  --accent-soft: rgba(127, 169, 248, .16);
  --glass: rgba(28, 40, 60, .62);
  --glass-strong: rgba(24, 35, 54, .9);
  --border: rgba(255, 255, 255, .12);
  --ink: #e8eefb;
  --ink-2: #b3c2dd;
  --ink-3: #8496b6;
  --red: #ff7b7f;
  --red-soft: rgba(255, 123, 127, .16);
  --green: #5ad39b;
  --green-soft: rgba(90, 211, 155, .16);
  --amber: #f0b25a;
  --shadow-glow: 0 0 22px rgba(127, 169, 248, .18);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35), inset 0 1px 1px rgba(255, 255, 255, .06);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .28), inset 0 1px 1px rgba(255, 255, 255, .06);
}
html[data-theme="dark"] body {
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 50%, rgba(48, 74, 120, .45), transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(40, 66, 90, .5), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(70, 56, 96, .4), transparent 50%),
    linear-gradient(150deg, #0c1220 0%, #101827 45%, #0d1526 100%);
}
html[data-theme="dark"] .bg {
  background:
    radial-gradient(circle at top left, rgba(40, 60, 90, .7), transparent 60%),
    radial-gradient(circle at bottom right, rgba(30, 48, 70, .8), transparent 60%),
    linear-gradient(135deg, #0b111d 0%, #101a2b 100%);
}
html[data-theme="dark"] .b1 { background: rgba(48, 74, 120, .35); }
html[data-theme="dark"] .b2 { background: rgba(74, 58, 110, .3); }
html[data-theme="dark"] .b3 { background: rgba(38, 68, 96, .35); }
html[data-theme="dark"] .b4 { background: rgba(96, 52, 74, .25); }
html[data-theme="dark"] .glass {
  background: linear-gradient(135deg, rgba(34, 48, 70, .66) 0%, rgba(24, 36, 54, .5) 100%);
  border-color: rgba(255, 255, 255, .09);
}
html[data-theme="dark"] .glass-strong { background: rgba(22, 33, 50, .92); border-color: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .glass::before,
html[data-theme="dark"] .glass-strong::before { opacity: .35; }
html[data-theme="dark"] .field,
html[data-theme="dark"] input.field,
html[data-theme="dark"] textarea.field,
html[data-theme="dark"] select.field {
  background: rgba(14, 22, 34, .72);
  color: var(--ink);
  border-color: rgba(255, 255, 255, .14);
}
html[data-theme="dark"] .field::placeholder { color: var(--ink-3); }
html[data-theme="dark"] .field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
html[data-theme="dark"] .btn { background: linear-gradient(135deg, #4a7ce0, #7ba7f7); color: #fff; }
html[data-theme="dark"] .btn.ghost { background: rgba(255, 255, 255, .07); color: var(--ink); }
html[data-theme="dark"] .btn.ghost:hover { background: rgba(255, 255, 255, .14); }
html[data-theme="dark"] .nav, html[data-theme="dark"] .app-top { background: rgba(18, 28, 44, .84); border-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .letter-card,
html[data-theme="dark"] .letter-paper,
html[data-theme="dark"] .reply-box,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .me-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .compose-form,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .notif-card,
html[data-theme="dark"] .toast-item {
  background: rgba(24, 36, 54, .84);
  border-color: rgba(255, 255, 255, .09);
  color: var(--ink);
}
html[data-theme="dark"] .toast-item.err { color: var(--red); }
html[data-theme="dark"] .toast-item.ok { color: var(--green); }
html[data-theme="dark"] .l-title, html[data-theme="dark"] .paper-head h2 { color: var(--ink); }
html[data-theme="dark"] .l-preview, html[data-theme="dark"] .letter-text { color: var(--ink-2); }
html[data-theme="dark"] .l-meta, html[data-theme="dark"] .when { color: var(--ink-3); }
html[data-theme="dark"] .empty { color: var(--ink-2); }
html[data-theme="dark"] table.list th { color: var(--ink-2); }
html[data-theme="dark"] table.list td { border-color: rgba(255, 255, 255, .07); color: var(--ink-2); }
html[data-theme="dark"] table.list tr:hover td { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .badge.pending { background: rgba(240, 178, 90, .16); color: var(--amber); }
html[data-theme="dark"] .badge.replied { background: var(--green-soft); color: var(--green); }
html[data-theme="dark"] .badge.rejected { background: var(--red-soft); color: var(--red); }

/* ---------- 深色模式:渐变标题与悬停修正 ---------- */
html[data-theme="dark"] .brand h1,
html[data-theme="dark"] .tab-title h2,
html[data-theme="dark"] .letter-top h1,
html[data-theme="dark"] .login-title {
  background: linear-gradient(135deg, #e8eefb, #9cc0ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
html[data-theme="dark"] .rail-item:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
html[data-theme="dark"] .letter-card:hover { background: rgba(34, 48, 70, .9); }
html[data-theme="dark"] .s-avatar { border-color: rgba(255, 255, 255, .15); }

