/* ============================================================
   校园万能墙 3.0 · 设计系统
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bg: #f4f5fb;
  --bg-glow: #e9e6ff;
  --surface: #ffffff;
  --surface-2: #f4f5fa;
  --surface-3: #eceef6;
  --text: #15161c;
  --text-2: #4b5063;
  --muted: #7b8194;
  --line: #e6e8f1;
  --accent: #6d5efc;
  --accent-2: #a855f7;
  --accent-soft: rgba(109, 94, 252, .1);
  --love: #ff5f7e;
  --ok: #12b886;
  --danger: #f03e3e;
  --warn: #f59f00;
  --shadow-sm: 0 1px 2px rgba(17, 20, 45, .04), 0 2px 8px rgba(17, 20, 45, .04);
  --shadow-md: 0 8px 30px rgba(17, 20, 45, .08);
  --shadow-lg: 0 20px 60px rgba(17, 20, 45, .12);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --header-h: 72px;
  --maxw: 1180px;
}

[data-theme="dark"] {
  --bg: #0d0f14;
  --bg-glow: #1a1533;
  --surface: #151821;
  --surface-2: #1b1f2a;
  --surface-3: #232838;
  --text: #e9ecf5;
  --text-2: #c3c9d8;
  --muted: #8b93a8;
  --line: #252a38;
  --accent: #8b7dff;
  --accent-2: #c084fc;
  --accent-soft: rgba(139, 125, 255, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .45);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 60vh;
  background: radial-gradient(60% 60% at 30% 0%, var(--bg-glow) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
  opacity: .9;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.dot { opacity: .4; margin: 0 6px; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.icon { width: 20px; height: 20px; flex: none; }
.icon-lg { width: 34px; height: 34px; }

/* ---------- layout ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; }

.brand-col { display: flex; flex-direction: column; gap: 1px; }
.app-link {
  display: inline-flex; align-items: center; gap: 4px;
  align-self: flex-start;
  font-size: 11px; font-weight: 700; color: var(--accent);
  padding: 2px 8px 2px 6px; border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  transition: .16s;
}
.app-link:hover { opacity: 1; }
.app-link .icon { width: 12px; height: 12px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px rgba(109, 94, 252, .35);
}
.brand-mark .icon { width: 18px; height: 18px; }

.search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 40px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--muted);
  transition: .18s;
}
.search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { border: 0; background: none; outline: none; flex: 1; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--muted); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 12px;
  background: transparent; color: var(--text-2);
  cursor: pointer; transition: .16s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.theme-toggle .only-dark { display: none; }
[data-theme="dark"] .theme-toggle .only-light { display: none; }
[data-theme="dark"] .theme-toggle .only-dark { display: inline-grid; }

.avatar-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--surface-2); font-size: 14px; font-weight: 600;
  transition: .16s;
}
.avatar-chip:hover { background: var(--surface-3); }
.avatar-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }

.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 20px 80px;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr) 292px;
  gap: 24px;
  align-items: start;
}

.feed { min-width: 0; }

.sidebar-left { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 16px; }
.sidebar-right { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 16px; }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 600; font-size: 14.5px;
  transition: .16s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }

.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.side-card h4 { font-size: 14px; margin-bottom: 6px; }
.side-card p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.side-card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.side-card-title .icon { width: 16px; height: 16px; }
.side-card.announcement { background: linear-gradient(160deg, var(--accent-soft), transparent 70%), var(--surface); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.stats span { font-size: 11.5px; color: var(--muted); }

/* ---------- feed ---------- */
.feed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.feed-head h1 { font-size: 26px; letter-spacing: -.03em; }
.feed-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.segmented {
  display: inline-flex; padding: 4px; gap: 2px;
  background: var(--surface-2); border-radius: 999px;
}
.segmented a {
  padding: 7px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: .16s; white-space: nowrap;
}
.segmented a:hover { color: var(--text); }
.segmented a.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }

/* 发布框 */
.composer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.composer-row { display: flex; gap: 12px; }
.composer textarea {
  flex: 1; min-height: 86px; resize: vertical;
  border: 0; outline: none; background: transparent;
  font: inherit; color: var(--text); line-height: 1.7;
}
.composer textarea::placeholder { color: var(--muted); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid transparent;
  cursor: pointer; transition: .16s;
}
.chip:hover { border-color: var(--line); }
.chip.is-active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.counter { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 帖子卡片 */
.posts { display: flex; flex-direction: column; gap: 14px; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 10px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  animation: rise .32s ease both;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }

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

.post-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; }
.post-meta { min-width: 0; }
.post-name { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; }

.badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; line-height: 1.7; }
.badge-anon { background: var(--surface-3); color: var(--muted); }
.badge-pin { background: rgba(245, 159, 0, .14); color: #d9480f; }
.badge-admin { background: var(--accent-soft); color: var(--accent); }

.post-body { padding: 12px 0 4px 54px; }
.post-text { white-space: normal; color: var(--text); line-height: 1.75; word-break: break-word; font-size: 15px; }
.post-text a { color: inherit; }

.post-images { display: grid; gap: 6px; margin-top: 12px; grid-template-columns: repeat(2, 1fr); }
.post-images.count-1 { grid-template-columns: 1fr; }
.post-images.count-1 img { max-height: 380px; object-fit: cover; }
.post-images img { width: 100%; height: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius-sm); }

.post-actions { display: flex; align-items: center; gap: 4px; margin-left: 54px; padding: 6px 0 4px; }
.action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; border: 0; background: none;
  color: var(--muted); font-size: 13.5px; cursor: pointer; transition: .16s;
}
.action:hover { background: var(--surface-2); color: var(--text); }
.action.is-active { color: var(--love); }
.action.is-active .icon { fill: var(--love); stroke: var(--love); }
.action .icon { width: 18px; height: 18px; }
.report-btn { margin-left: auto; opacity: .55; }
.report-btn:hover { opacity: 1; color: var(--danger); }

.post-del { margin-left: auto; display: flex; }
.post-del .icon-btn:hover { color: var(--danger); background: rgba(240, 62, 62, .08); }

/* 锁定卡片 */
.locked-card {
  position: relative;
  border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  background:
    radial-gradient(80% 120% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--surface);
  padding: 34px 22px;
  text-align: center;
  overflow: hidden;
}
.locked-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 60%, transparent));
  pointer-events: none;
}
.locked-inner { position: relative; z-index: 1; display: grid; justify-items: center; gap: 8px; }
.locked-inner .icon-lg { color: var(--accent); }
.locked-inner h3 { font-size: 19px; }
.locked-inner p { color: var(--muted); font-size: 14px; max-width: 380px; }
.locked-actions { display: flex; gap: 10px; margin-top: 8px; }

/* 空状态 */
.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state .icon-lg { margin: 0 auto 12px; color: var(--accent); }
.empty-state h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 14.5px; font-weight: 700;
  cursor: pointer; transition: .16s; white-space: nowrap;
}
.btn .icon { width: 18px; height: 18px; }
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 20px rgba(109, 94, 252, .28); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 24px rgba(109, 94, 252, .34); }
.btn-ghost { background: var(--surface-2); border-color: var(--line); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: rgba(240, 62, 62, .1); color: var(--danger); }
.btn-danger:hover { background: rgba(240, 62, 62, .16); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.input, .textarea, select.input {
  width: 100%; padding: 12px 15px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; font: inherit; color: var(--text);
  outline: none; transition: .16s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus, select.input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.7; }

/* ---------- flash ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.flash {
  padding: 11px 15px; border-radius: 12px; font-size: 14px; font-weight: 600;
  animation: rise .25s ease both;
}
.flash-success { background: rgba(18, 184, 134, .12); color: #0b7a5a; }
.flash-error { background: rgba(240, 62, 62, .1); color: #c92a2a; }
[data-theme="dark"] .flash-success { color: #63e6be; }
[data-theme="dark"] .flash-error { color: #ff8787; }

/* ---------- auth ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-art {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #5b4bff 0%, #8b5cf6 45%, #ec4899 100%);
  color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-art::before {
  content: ""; position: absolute; inset: -20%;
  background: radial-gradient(40% 40% at 70% 20%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(35% 35% at 20% 80%, rgba(255, 255, 255, .25), transparent 60%);
}
.auth-art h2 { position: relative; font-size: 40px; line-height: 1.2; letter-spacing: -.03em; max-width: 10em; }
.auth-art p { position: relative; opacity: .85; max-width: 22em; margin-top: 16px; }
.auth-art .brand { position: relative; }
.auth-art .brand-mark { background: rgba(255, 255, 255, .18); box-shadow: none; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.auth-switch a { color: var(--accent); font-weight: 700; }
.auth-back { position: absolute; top: 22px; left: 22px; color: #fff; opacity: .8; z-index: 2; }

/* ---------- profile ---------- */
.profile-hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.profile-hero .avatar { width: 76px; height: 76px; }
.profile-hero h1 { font-size: 24px; letter-spacing: -.03em; }
.profile-hero .meta { color: var(--muted); font-size: 13.5px; }
.profile-hero .grow { flex: 1; min-width: 180px; }
.profile-stats { display: flex; gap: 22px; margin-top: 10px; }
.profile-stats strong { font-size: 17px; }
.profile-stats span { font-size: 12px; color: var(--muted); margin-left: 4px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 16px; margin-bottom: 14px; }

/* ---------- detail ---------- */
.detail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.comment-list { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.comment { display: flex; gap: 12px; }
.comment .avatar { width: 34px; height: 34px; }
.comment-body { background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 10px 14px; flex: 1; }
.comment-body .name { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.comment-body .text { font-size: 14px; line-height: 1.65; word-break: break-word; }
.comment-form { display: flex; gap: 10px; margin-top: 18px; }
.comment-form input { flex: 1; }
.comment-form .btn { flex: none; }

/* ---------- admin ---------- */
.admin-body { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.admin-side {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .brand { padding: 0 8px 18px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 11px; color: var(--text-2); font-size: 14px; font-weight: 600; transition: .16s;
}
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.is-active { background: var(--accent-soft); color: var(--accent); }
.admin-main { padding: 26px 32px 60px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-head h1 { font-size: 24px; letter-spacing: -.03em; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.stat-card span { color: var(--muted); font-size: 12.5px; }
.stat-card strong { display: block; font-size: 26px; letter-spacing: -.03em; margin-top: 4px; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
table.data th { text-align: left; padding: 12px 14px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
table.data .actions { display: flex; gap: 6px; flex-wrap: wrap; }
table.data form { display: inline; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.tag-ok { background: rgba(18, 184, 134, .12); color: #0b7a5a; }
.tag-warn { background: rgba(245, 159, 0, .14); color: #b45309; }
.tag-bad { background: rgba(240, 62, 62, .1); color: #c92a2a; }

/* ---------- toast ---------- */
.toast-stack { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; }
.toast {
  padding: 11px 18px; border-radius: 999px; color: #fff; font-size: 14px; font-weight: 600;
  background: rgba(21, 22, 28, .92); box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease both;
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- footer / bottom nav ---------- */
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0 40px; }

.bottom-nav { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 188px minmax(0, 1fr); }
  .sidebar-right { display: none; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding: 16px 14px 96px; }
  .sidebar-left { display: none; }
  .search { display: none; }
  .only-desktop { display: none !important; }
  .feed-head h1 { font-size: 22px; }
  .post-body { padding-left: 0; }
  .post-actions { margin-left: 0; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .post-images { grid-template-columns: repeat(2, 1fr); }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: 62px; padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .bottom-nav .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 11px; color: var(--muted); font-weight: 600;
  }
  .bottom-nav .tab.is-active { color: var(--accent); }
  .bottom-nav .tab-publish {
    flex: none; width: 62px; margin: -22px 8px 0;
    height: 52px; width: 52px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; box-shadow: 0 10px 24px rgba(109, 94, 252, .4);
  }
  .bottom-nav .tab-publish .icon { width: 24px; height: 24px; }

  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav { flex-direction: row; overflow-x: auto; }
  .admin-main { padding: 18px 16px 60px; }
}

@media (max-width: 420px) {
  .topbar-inner { padding: 0 14px; gap: 10px; }
  .brand-text { font-size: 15px; }
}

/* 打印/降级 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 验证码 ---------- */
.captcha { margin-bottom: 16px; }
.captcha-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-question {
  flex: none; min-width: 96px; padding: 10px 12px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 12px; font-weight: 800; font-size: 15px;
  text-align: center; letter-spacing: .06em; font-variant-numeric: tabular-nums;
  user-select: none;
}
.captcha-input { flex: 1; min-width: 0; }
.captcha-row .btn { flex: none; }

/* ---------- 邮箱后缀 ---------- */
.email-row { display: flex; gap: 8px; }
.email-row .input { flex: 1; min-width: 0; }
.email-row .input.suffix { flex: 0 0 132px; }
.email-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.email-chip {
  padding: 4px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid transparent; cursor: pointer;
  transition: .16s;
}
.email-chip:hover { border-color: var(--line); }
.email-chip.is-active { background: var(--accent-soft); color: var(--accent); }

.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; }
.code-row .btn { flex: none; min-width: 112px; }

.badge-id { background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 协议弹层 ---------- */
.agreement-modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(12, 14, 22, .55); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.agreement-modal.is-open { display: flex; }
.agreement-box {
  background: var(--surface); border-radius: var(--radius-lg);
  width: min(640px, 100%); max-height: 80vh; overflow: auto;
  padding: 26px; box-shadow: var(--shadow-lg);
}
.agreement-box h3 { margin-bottom: 12px; }
.agreement-body { white-space: pre-wrap; font-size: 14px; line-height: 1.85; color: var(--text-2); }
.agreement-close { float: right; }

/* ---------- App 下载页 ---------- */
.app-hero {
  text-align: center; padding: 40px 20px 28px;
  background: linear-gradient(160deg, var(--accent-soft), transparent 70%);
  border-radius: var(--radius-lg); border: 1px solid var(--line);
}
.app-hero h1 { font-size: 30px; letter-spacing: -.03em; margin-bottom: 8px; }
.app-hero p { color: var(--muted); }
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.app-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.app-card h3 { font-size: 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.app-card ol { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; line-height: 1.9; }

/* ---------- 同步中心 ---------- */
.sync-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.sync-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.sync-card span { color: var(--muted); font-size: 12.5px; }
.sync-card strong { display: block; font-size: 18px; margin-top: 4px; letter-spacing: -.02em; }
.sync-card code { font-size: 12px; color: var(--text-2); }

/* 页面切换过渡（跨文档） */
@view-transition { navigation: auto; }

/* ---------- 表单网格 / 登录辅助链接 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.auth-links { text-align: center; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.auth-links a { color: var(--accent); font-weight: 600; }
.auth-link { color: var(--accent); font-weight: 600; }

/* ---------- 顶部「公告」入口 ---------- */
.top-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--text-2);
  background: var(--surface-2); transition: .16s;
}
.top-link:hover { color: var(--accent); background: var(--accent-soft); }
.top-link .icon { width: 16px; height: 16px; }

/* ---------- 公告卡片（历史页） ---------- */
.ann-card { animation: rise .3s ease both; }
.ann-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ann-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
}
.ann-badge .icon { width: 14px; height: 14px; }
.ann-title { font-size: 17px; margin-bottom: 8px; letter-spacing: -.01em; }
.ann-body { color: var(--text-2); font-size: 14.5px; line-height: 1.85; white-space: normal; word-break: break-word; }

/* ---------- 新公告弹窗 ---------- */
.ann-modal {
  position: fixed; inset: 0; z-index: 400;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(12, 14, 22, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ann-modal.is-open { display: flex; }
.ann-box {
  width: min(440px, 100%);
  max-height: 80vh; overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: annIn .28s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes annIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.ann-box.is-closing {
  animation: annOut .34s cubic-bezier(.4, 0, .2, 1) both;
  transform-origin: top left;
}
@keyframes annOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translate(-38vw, -38vh) scale(.12); }
}
.ann-box .ann-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.ann-box .ann-actions .btn { width: 100%; }

/* ---------- 移动端公告条 ---------- */
.mobile-ann {
  display: none;
  align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  background: linear-gradient(120deg, var(--accent-soft), transparent 80%), var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.mobile-ann-icon { color: var(--accent); display: inline-flex; }
.mobile-ann-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mobile-ann-text strong { font-size: 14px; }
.mobile-ann-text span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-ann-more { color: var(--accent); font-size: 12.5px; font-weight: 700; flex: none; }

@media (max-width: 1080px) {
  .mobile-ann { display: flex; }
}
@media (max-width: 860px) {
  .top-link span { display: none; }
  .top-link { padding: 7px 9px; }
}
/* ---------- App 下载 ---------- */
.app-download-box { margin-top: 18px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 999px; }
.btn-lg .icon { width: 20px; height: 20px; }