/* Paul 交流社区 · 主页 / 登录 / 注册 */

:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --glow-a: rgba(37, 99, 235, 0.14);
  --glow-b: rgba(99, 102, 241, 0.12);
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --text: #0f172a;
  --text-soft: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff4ff;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --shadow-lg: 0 30px 80px rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --font: "Inter", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b14;
  --glow-a: rgba(59, 130, 246, 0.22);
  --glow-b: rgba(129, 140, 248, 0.16);
  --surface: #0f1624;
  --surface-muted: #131c2d;
  --text: #e6edf7;
  --text-soft: #b6c2d4;
  --muted: #8b9ab0;
  --line: #1e2a3d;
  --line-strong: #2b3a52;
  --accent: #6ea0ff;
  --accent-strong: #8ab4ff;
  --accent-soft: #14213a;
  --ok: #34d399;
  --ok-soft: #0c2a22;
  --danger: #fb7185;
  --danger-soft: #2a1218;
  --warn: #fbbf24;
  --warn-soft: #2a2110;
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(620px 420px at 8% -6%, var(--glow-a), transparent 70%),
    radial-gradient(760px 520px at 104% 104%, var(--glow-b), transparent 72%);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

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

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.icon-moon {
  display: none;
}

html[data-theme="dark"] .icon-sun {
  display: none;
}

html[data-theme="dark"] .icon-moon {
  display: block;
}

/* 固定在视口最右上角的深浅色开关 */
.theme-fab {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------------- 品牌 */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .avatar {
  color: #07111f;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-name em {
  margin-left: 4px;
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

.brand-word {
  font-family: "Segoe UI Black", "Arial Black", "Inter", var(--font);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: 18px;
}

.topnav a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms ease;
}

.topnav a:hover {
  color: var(--text);
  text-decoration: none;
}

.entry-cta {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}

.login-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 0 24px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.26);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.login-bar:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.32);
  text-decoration: none;
}

html[data-theme="dark"] .login-bar {
  color: #07111f;
  box-shadow: 0 12px 28px rgba(110, 160, 255, 0.22);
}

html[data-theme="dark"] .login-bar:hover {
  box-shadow: 0 16px 34px rgba(110, 160, 255, 0.3);
}

.entry-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.entry-hint a {
  font-weight: 650;
}

.button.login-submit {
  min-height: 54px;
  border-radius: 13px;
  font-size: 15px;
}

/* ---------------------------------------------------------------- 邮箱验证弹窗 */

.auth-modal {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  max-width: none;
  max-height: none;
}

.auth-modal::backdrop {
  background: rgba(4, 10, 22, 0.58);
  backdrop-filter: blur(6px);
}

.auth-modal-card {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.auth-modal-close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.qq-profile {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding-top: 6px;
  text-align: center;
}

.qq-avatar-wrap {
  display: block;
  width: 64px;
  height: 64px;
}

.qq-avatar {
  display: block;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-muted);
  object-fit: cover;
}

.qq-avatar-fallback {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.qq-profile strong {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
}

.qq-profile > span:last-child {
  color: var(--muted);
  font-size: 12.5px;
  word-break: break-all;
}

.verify-form {
  margin-top: 22px;
}

.otp-label {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.otp-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.otp-digit {
  width: 44px;
  height: 52px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.otp-digit::placeholder {
  color: var(--muted);
  opacity: 0.45;
  font-weight: 500;
}

.otp-digit:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.otp-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.resend-link {
  display: block;
  margin: 8px auto 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.resend-link:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.verify-form .dev-code {
  margin-top: 14px;
}

.verify-form .form-message {
  margin-top: 12px;
}

.verify-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
}

/* ---------------------------------------------------------------- 登录 / 注册布局 */

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: clamp(18px, 3vw, 40px);
  align-items: stretch;
  align-content: center;
  width: 100%;
  max-width: 1320px;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 40px);
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(28px, 4.2vw, 58px);
  border-radius: 28px;
  color: #f8fbff;
  background:
    radial-gradient(520px 360px at 88% 8%, rgba(96, 165, 250, 0.28), transparent 70%),
    radial-gradient(460px 320px at 4% 96%, rgba(129, 140, 248, 0.24), transparent 72%),
    linear-gradient(158deg, #08182d 0%, #0f2d55 52%, #174887 100%);
  box-shadow: var(--shadow-lg);
}

.brand-panel::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -130px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(255, 255, 255, 0.035),
    0 0 0 86px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.brand-panel .brand-name em {
  color: rgba(226, 238, 255, 0.68);
}

.brand-panel-main {
  position: relative;
  z-index: 1;
}

.brand-copy {
  margin-top: clamp(42px, 8vh, 92px);
}

.brand-copy .eyebrow {
  color: rgba(191, 219, 254, 0.85);
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 48px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.brand-lede {
  max-width: 30em;
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.8;
  color: rgba(220, 234, 255, 0.78);
}

.brand-points {
  display: grid;
  gap: 12px;
  margin: clamp(32px, 6vh, 60px) 0 0;
  padding: 0;
  list-style: none;
}

.brand-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(226, 238, 255, 0.86);
}

.tick {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
}

.brand-foot {
  position: relative;
  z-index: 1;
  margin: 36px 0 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(191, 219, 254, 0.5);
}

.form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.form-toolbar {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  max-width: 480px;
  margin-bottom: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, background 160ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-1px);
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  min-height: 700px;
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-head .eyebrow {
  margin-bottom: 8px;
}

.card-head h2 {
  margin: 0;
  font-size: clamp(23px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card-head > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 14.5px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input::placeholder {
  color: var(--muted);
  opacity: 0.82;
}

.field textarea {
  width: 100%;
  min-height: 76px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  resize: vertical;
}

.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.82;
}

.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field input:hover {
  border-color: var(--line-strong);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field input.readonly-input,
.field input.readonly-input:hover,
.field input.readonly-input:focus {
  border-style: dashed;
  border-color: var(--line-strong);
  background: var(--line);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.strength-track {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.strength-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--danger);
  transition: width 220ms ease, background 220ms ease;
}

.strength-label {
  min-width: 52px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  transition: color 220ms ease;
}

.password-strength[data-level="1"] .strength-fill {
  width: 33%;
  background: #ef4444;
}

.password-strength[data-level="1"] .strength-label {
  color: #ef4444;
}

.password-strength[data-level="2"] .strength-fill {
  width: 66%;
  background: #f59e0b;
}

.password-strength[data-level="2"] .strength-label {
  color: #f59e0b;
}

.password-strength[data-level="3"] .strength-fill {
  width: 100%;
  background: #10b981;
}

.password-strength[data-level="3"] .strength-label {
  color: #10b981;
}

.qq-input {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.qq-input:hover {
  border-color: var(--line-strong);
}

.qq-input:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.qq-input input {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  flex: 1;
  min-width: 0;
}

.qq-input input:focus {
  box-shadow: none;
  background: transparent;
}

.qq-suffix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--text) 3%, transparent);
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.code-row .button {
  min-height: 48px;
  white-space: nowrap;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
}

.button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.3);
}

html[data-theme="dark"] .button.primary {
  color: #07111f;
  box-shadow: 0 10px 24px rgba(110, 160, 255, 0.22);
}

html[data-theme="dark"] .button.primary:hover {
  box-shadow: 0 14px 30px rgba(110, 160, 255, 0.3);
}

html[data-theme="dark"] .button.primary[data-loading="true"]::after {
  border-color: rgba(7, 17, 31, 0.25);
  border-top-color: #07111f;
}

.button.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text-soft);
}

.button.ghost:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.button.tiny {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
  background: var(--surface);
  border-color: var(--warn);
  color: var(--warn);
}

.button.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.button[data-loading="true"] {
  color: transparent;
}

.button[data-loading="true"] .button-label {
  visibility: hidden;
}

.button[data-loading="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid color-mix(in srgb, var(--text) 25%, transparent);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button.primary[data-loading="true"]::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.submit-button {
  width: 100%;
  min-height: 50px;
  margin-top: 2px;
}

.form-message {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.form-message.is-error {
  display: block;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
  background: var(--danger-soft);
  color: var(--danger);
}

.form-message.is-success {
  display: block;
  border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent);
  background: var(--ok-soft);
  color: var(--ok);
}

.dev-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent);
  border-radius: 10px;
  background: var(--warn-soft);
}

.dev-code-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dev-code-copy strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--warn);
}

.dev-code-copy span {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text);
}

.switch {
  margin: 22px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.switch a {
  font-weight: 650;
}

.auth-note {
  max-width: 480px;
  margin: 16px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.auth-note b {
  font-weight: 600;
  color: var(--text-soft);
}

/* ---------------------------------------------------------------- 主页 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  /* 右侧给固定的深浅色按钮留出空间 */
  padding: 13px 76px 13px 24px;
}

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

.topbar-actions:empty {
  display: none;
}

/* 品牌 P + Paul 位于顶栏最右边（登录后主页与分页共用） */
.topbar-brand-right .brand {
  order: 3;
  margin-left: auto;
}

.topbar-brand-right .topnav {
  margin-left: 0;
}

/* ---------------------------------------------------------------- 左侧滑出菜单 */

.menu-button {
  flex: none;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(4, 10, 22, 0.52);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(3px);
  transition: opacity 240ms ease, visibility 240ms;
}

.menu-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  width: min(320px, 84vw);
  padding: 20px 16px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 280ms;
}

.menu-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

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

.menu-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.menu-brand .brand-mark {
  width: 34px;
  height: 34px;
  font-size: 17px;
  border-radius: 10px;
}

.menu-brand strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.menu-close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.menu-nav {
  display: grid;
  gap: 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.menu-item:hover {
  background: var(--surface-muted);
  color: var(--text);
  text-decoration: none;
}

.menu-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.menu-item-admin {
  color: var(--accent);
}

.menu-admin-badge {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.menu-divider {
  height: 1px;
  margin: 10px 6px;
  background: var(--line);
}

.menu-user-slot {
  margin-top: auto;
  padding-top: 18px;
}

.menu-user {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.menu-user::before {
  content: "";
  position: absolute;
  inset: 5px -5px -5px 5px;
  z-index: -1;
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent-soft), color-mix(in srgb, var(--accent) 8%, transparent));
}

a.menu-user:hover {
  border-color: var(--line-strong);
  text-decoration: none;
}

.menu-user-static {
  cursor: default;
}

.menu-user-avatar-wrap {
  position: relative;
  z-index: 0;
  width: 44px;
  height: 44px;
  flex: none;
}

.menu-user-avatar-wrap::before {
  content: "";
  position: absolute;
  inset: 3px -3px -3px 3px;
  z-index: -1;
  border-radius: 14px;
  background: var(--accent);
  opacity: 0.16;
}

.menu-user-avatar {
  display: block;
  width: 44px;
  height: 44px;
  border: 2px solid var(--surface);
  border-radius: 14px;
  background: var(--surface-muted);
  object-fit: cover;
}

.menu-user-avatar-guest {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.menu-user-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.menu-user-copy strong {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-user-copy small {
  color: var(--muted);
  font-size: 11.5px;
}

.menu-user-loading {
  opacity: 0.7;
}

.menu-logout {
  margin-top: 10px;
}

.menu-logout-button {
  width: 100%;
  justify-content: center;
}

body.menu-open {
  overflow: hidden;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.user-chip-name {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-form {
  display: inline;
  margin: 0;
}

.home {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px) 24px 56px;
}

.announcement-card {
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-left: 4px solid var(--accent);
  border-radius: 16px;
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.announcement-card .eyebrow {
  margin: 0 0 4px;
}

.announcement-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.announcement-content {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
  padding: clamp(28px, 4.5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(540px 280px at 92% 6%, var(--glow-a), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.hero-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.hero-avatar {
  width: clamp(112px, 12vw, 152px);
  height: clamp(112px, 12vw, 152px);
  flex: none;
  border: 1px solid var(--line);
  border-radius: clamp(22px, 2.2vw, 30px);
  background: var(--surface-muted);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* 公开主页首屏不再套卡片：文字直接落在页面背景上 */
.hero.hero-plain {
  padding: 0 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.hero.hero-no-mark .hero-mark {
  display: none;
}

.hero h1 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.hero-lede {
  max-width: 44em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.hero-meta:empty {
  display: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid color-mix(in srgb, var(--ok) 26%, transparent);
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
  font-weight: 650;
}

.hero-email {
  color: var(--text-soft);
  font-size: 13px;
  word-break: break-all;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.45;
}

.dot.ok {
  background: var(--ok);
  opacity: 1;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent);
}

.hero-mark {
  display: grid;
  place-items: center;
  width: clamp(84px, 11vw, 132px);
  height: clamp(84px, 11vw, 132px);
  flex: none;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 28px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  transform: rotate(-4deg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.account-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.reset-form {
  display: grid;
  gap: 14px;
}

.reset-submit {
  width: 100%;
  margin-top: 4px;
}

.card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card h2 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
}

.info-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.info-list > div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.info-list dt {
  color: var(--muted);
  font-size: 12.5px;
}

.info-list dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  word-break: break-all;
}

.status-list {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text-soft);
}

.status-list em {
  margin-left: auto;
  color: var(--ok);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.status-list em.muted {
  color: var(--muted);
  font-weight: 500;
}

.card-note,
.card-lede {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.card-lede {
  margin-top: 0;
  margin-bottom: 18px;
}

.foot {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 36px;
  color: var(--muted);
  font-size: 12px;
}

.section-block {
  margin-top: clamp(36px, 5vw, 56px);
}

.section-divider {
  height: 1px;
  margin: clamp(30px, 4vw, 44px) 0 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line) 6%, var(--line) 94%, transparent);
}

.section-divider + .section-block {
  margin-top: clamp(24px, 3vw, 32px);
}

.section-page-head {
  padding-top: clamp(12px, 3vw, 24px);
}

.section-page-head h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.section-page-head > p:last-child {
  max-width: 44em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.section-placeholder {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-placeholder strong {
  font-size: 16px;
}

.section-placeholder p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.section-placeholder .button {
  margin-top: 6px;
}

/* ---------------------------------------------------------------- 社区聊天 */

.chat-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

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

.chat-head-copy {
  display: grid;
  gap: 3px;
}

.chat-head-copy strong {
  font-size: 15px;
  font-weight: 700;
}

.chat-head-copy span {
  color: var(--muted);
  font-size: 12px;
}

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.chat-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.45;
}

.chat-status.is-live::before {
  background: var(--ok);
  opacity: 1;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 16%, transparent);
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: min(52vh, 520px);
  padding: 22px;
  overflow-y: auto;
  background: var(--surface-muted);
}

.chat-empty {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.chat-row.self {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  object-fit: cover;
}

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(72%, 560px);
  min-width: 0;
}

.chat-row.self .chat-body {
  align-items: flex-end;
}

.chat-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.chat-bubble {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-row.other .chat-bubble {
  border-top-left-radius: 4px;
}

.chat-row.self .chat-bubble {
  border-color: #10b981;
  border-top-right-radius: 4px;
  background: #10b981;
  color: #fff;
}

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

.chat-form {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.chat-form input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 14px;
}

.chat-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.chat-form .button {
  min-height: 44px;
  padding: 0 20px;
}

.chat-login-hint,
.chat-error {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.chat-error {
  color: var(--danger);
}

.chat-error:empty {
  display: none;
}

/* ---------------------------------------------------------------- 公开文件 */

.public-file-list {
  display: grid;
  gap: 12px;
}

.public-file-item {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.public-file-item .public-file {
  flex: 1;
  min-width: 0;
}

.public-file-delete {
  flex: none;
  align-self: center;
}

.public-file {
  display: grid;
  grid-template-columns: 54px minmax(160px, 0.9fr) minmax(0, 1.6fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, border-color 160ms ease;
}

.public-file:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  text-decoration: none;
}

.file-paper {
  position: relative;
  width: 48px;
  height: 60px;
  flex: none;
}

.file-paper svg {
  display: block;
  width: 100%;
  height: 100%;
}

.file-ext {
  position: absolute;
  right: -4px;
  bottom: 4px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 8.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.file-paper-archive .file-ext {
  background: #d97706;
}

.public-file-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.public-file-name {
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-file-uploader {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.public-file-uploader img {
  width: 20px;
  height: 20px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.public-file-desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.file-empty,
.file-login-hint {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.file-login-hint a {
  font-weight: 600;
}

.file-upload-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.file-upload-panel .form-message {
  grid-column: 1 / -1;
}

.file-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.file-pick:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.file-pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.file-desc-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 13.5px;
}

.file-desc-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.file-upload-panel .button {
  min-height: 44px;
}

.file-preview-modal {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  max-width: none;
  max-height: none;
}

.file-preview-modal::backdrop {
  background: rgba(4, 10, 22, 0.58);
  backdrop-filter: blur(6px);
}

.file-preview-card {
  display: flex;
  flex-direction: column;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

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

.file-preview-head strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.file-preview-close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.file-preview-content .file-preview-image,
.file-preview-image {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  margin: 0 auto;
  border-radius: 10px;
  object-fit: contain;
}

.file-preview-content {
  margin: 0;
  padding: 20px;
  overflow: auto;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.download-confirm-modal {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  max-width: none;
  max-height: none;
}

.download-confirm-modal::backdrop {
  background: rgba(4, 10, 22, 0.58);
  backdrop-filter: blur(6px);
}

.download-confirm-card {
  width: min(400px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.download-confirm-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}

.download-confirm-name {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.download-confirm-actions {
  display: flex;
  gap: 10px;
}

.download-confirm-actions .button {
  flex: 1;
}

/* ---------------------------------------------------------------- 管理后台 */

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.admin-stat {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.admin-stat span {
  color: var(--muted);
  font-size: 12.5px;
}

.admin-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.admin-table-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.admin-table th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-avatar {
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-muted);
  object-fit: cover;
}

.admin-balance-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-balance-form input {
  width: 92px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 13px;
}

.admin-balance-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.admin-balance-form .button {
  min-height: 34px;
}

.admin-role {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-role.is-admin {
  background: var(--accent-soft);
  color: var(--accent);
}

.admin-file-ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.admin-file-name {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-empty {
  color: var(--muted);
  text-align: center;
}

.button.tiny.danger {
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
}

.admin-page .form-message {
  margin-top: 14px;
}

/* ---------------------------------------------------------------- 导入参数 */

.import-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.import-profile-avatar {
  display: block;
  width: 52px;
  height: 52px;
  flex: none;
  border: 2px solid var(--surface);
  border-radius: 14px;
  background: var(--surface-muted);
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.import-profile-avatar-guest {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.import-profile-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.import-profile-copy strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-profile-copy small {
  color: var(--muted);
  font-size: 11.5px;
}

.import-profile-quota {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: auto;
  text-align: right;
}

.import-profile-quota span {
  color: var(--muted);
  font-size: 11px;
}

.import-profile-quota strong {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.import-profile-quota small {
  color: var(--muted);
  font-size: 10.5px;
}

.import-profile .button {
  flex: none;
}

.import-config > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  list-style: none;
  cursor: pointer;
}

.import-config > summary::-webkit-details-marker {
  display: none;
}

.import-config > summary span {
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

.import-config > summary small {
  color: var(--muted);
  font-size: 12px;
}

.import-config > summary::after {
  content: "展开";
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.import-config[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.import-config[open] > summary::after {
  content: "收起";
}

.import-config .import-form {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 0;
}

.import-form {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.import-form .field code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
}

.import-form select {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 14.5px;
}

.import-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.import-coordinates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.import-coordinates input {
  width: 100%;
  min-width: 0;
}

.import-advanced {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.import-advanced summary {
  padding: 12px 14px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.import-advanced-body {
  padding: 0 14px 16px;
}

.import-advanced-body .import-grid {
  gap: 14px;
}

.import-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin-top: 16px;
}

.import-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.5;
  cursor: pointer;
}

.import-check input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.import-check code {
  padding: 1px 3px;
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
}

.import-preview {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.import-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.import-command {
  max-height: 220px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: var(--text);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.import-actions .field-hint {
  margin: 0;
}

.import-form .form-message {
  margin-top: 12px;
}

.import-check.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.import-task {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.import-task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.import-task-head strong {
  flex: 1 1 200px;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-task-head .button {
  margin-left: auto;
}

.import-task-status {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.import-task-status[data-status="starting"],
.import-task-status[data-status="running"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.import-task-status[data-status="succeeded"] {
  background: var(--ok-soft);
  color: var(--ok);
}

.import-task-status[data-status="failed"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.import-task-status[data-status="stopped"] {
  background: var(--warn-soft);
  color: var(--warn);
}

.import-task-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.import-task-progress progress {
  flex: 1;
  height: 8px;
  accent-color: var(--accent);
}

.import-task-progress span {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.import-task-log {
  max-height: 320px;
  min-height: 72px;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.import-task-log:empty::before {
  content: "等待进程输出…";
  color: var(--muted);
}

.import-files {
  margin-top: 18px;
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.import-files-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.import-files-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.import-files-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.import-files-usage {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.import-upload {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.import-upload-name {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}

.import-upload .form-message {
  grid-column: 1 / -1;
  margin: 0;
}

.import-file-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.import-file-item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.import-file-ext {
  display: grid;
  place-items: center;
  width: 46px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.import-file-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.import-file-meta strong {
  overflow: hidden;
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-file-meta small {
  color: var(--muted);
  font-size: 11.5px;
}

.import-file-actions {
  display: flex;
  gap: 6px;
}

@media (max-width: 720px) {
  .import-form {
    padding: 16px;
  }

  .import-grid,
  .import-check-grid {
    grid-template-columns: 1fr;
  }

  .import-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .import-profile {
    flex-wrap: wrap;
  }

  .import-profile-copy {
    flex: 1 1 140px;
  }

  .import-config > summary small {
    display: none;
  }

  .import-upload {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .import-upload .file-pick {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .import-file-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .import-file-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .import-files-usage {
    margin-left: 0;
  }
}

.section-title {
  margin-bottom: 18px;
}

.section-title .eyebrow {
  margin-bottom: 6px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-title > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.board-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, border-color 160ms ease;
}

.board-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.board-index {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.board-card h3 {
  margin: 12px 0 7px;
  font-size: 16px;
  font-weight: 650;
}

.board-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.rules-panel,
.about-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.rules-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rules-list li {
  display: grid;
  gap: 3px;
  padding-left: 14px;
  border-left: 2px solid var(--accent-soft);
}

.rules-list b {
  font-size: 14px;
  font-weight: 650;
}

.rules-list span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.about-panel p {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.85;
}

.about-panel p:last-child {
  margin-bottom: 0;
}

.about-panel p.muted {
  color: var(--muted);
}

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

@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid:not(.account-grid) .card:last-child {
    grid-column: 1 / -1;
  }

  .board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topnav {
    display: none;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 14px;
  }

  .brand-panel {
    padding: 24px 26px;
    border-radius: 22px;
  }

  .brand-copy {
    margin-top: 24px;
  }

  .brand-copy h1 {
    font-size: clamp(24px, 5vw, 32px);
  }

  .brand-lede {
    margin-top: 10px;
    font-size: 13.5px;
  }

  .brand-points {
    display: none;
  }

  .brand-foot {
    display: none;
  }

  .form-panel {
    padding: 18px 0 40px;
  }

  .auth-card {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    padding: 11px 68px 11px 16px;
  }

  .board-grid,
  .rules-list {
    grid-template-columns: 1fr;
  }

  .user-chip-name {
    display: none;
  }

  .user-chip {
    padding: 4px;
    border: 0;
    background: transparent;
  }

  .home {
    padding: 22px 16px 40px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .hero-profile {
    align-items: flex-start;
    gap: 14px;
  }

  .hero-avatar {
    width: 88px;
    height: 88px;
    border-radius: 20px;
  }

  .hero-mark {
    display: none;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .grid .card:last-child {
    grid-column: auto;
  }

  .chat-list {
    height: 58vh;
    padding: 16px;
  }

  .chat-body {
    max-width: 78%;
  }

  .chat-avatar {
    width: 34px;
    height: 34px;
  }

  .chat-head,
  .chat-form {
    padding-left: 14px;
    padding-right: 14px;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .public-file {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
  }

  .public-file-desc {
    grid-column: 2;
    -webkit-line-clamp: 3;
  }

  .file-upload-panel {
    grid-template-columns: 1fr;
  }

  .file-upload-panel .button,
  .file-pick {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .theme-fab {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .topbar-inner {
    padding-right: 62px;
  }

  .auth-layout {
    padding: 10px;
  }

  .auth-card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .auth-modal-card {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .otp-row {
    gap: 6px;
  }

  .otp-digit {
    width: 38px;
    height: 48px;
    font-size: 18px;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .code-row .button {
    width: 100%;
  }

  .topbar .brand-name em {
    display: none;
  }
}

/* 商店 */
.store-page {
  display: grid;
  gap: 18px;
}

.store-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.store-account-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.store-account-card span {
  color: var(--muted);
  font-size: 12px;
}

.store-account-card strong {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.store-plan {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12.5px;
}

.store-panel {
  margin-top: 0;
}

.store-recharge-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.store-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.store-form-actions .field-hint {
  margin: 0;
}

.pay-method-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pay-method-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.pay-method-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pay-method-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 14.5px;
  font-weight: 600;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.pay-method-option:hover .pay-method-box {
  border-color: var(--line-strong);
}

.pay-method-option input:checked + .pay-method-box {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pay-method-option input:focus-visible + .pay-method-box {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.store-package-list {
  display: grid;
  gap: 12px;
}

.store-package {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.store-package-image {
  width: 52px;
  height: 52px;
  flex: none;
  padding: 8px;
  border-radius: 14px;
  background: var(--accent-soft);
  object-fit: contain;
}

.store-package-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.store-package-desc {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.store-package-copy strong {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-package-copy span {
  color: var(--muted);
  font-size: 12px;
}

.store-package-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.store-package-price {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}

/* 文件市场 */
.market-upload-form {
  display: grid;
  grid-template-columns: auto minmax(140px, 180px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.market-upload-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.market-upload-actions .field-hint {
  margin: 0;
}

.market-progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 6px;
  accent-color: var(--accent);
}

.market-upload-form .form-message {
  grid-column: 1 / -1;
  margin: 0;
}

.official-file-list,
.market-file-list,
.market-order-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.market-balance {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.admin-settings-form > .market-progress,
.admin-settings-form > .form-message {
  grid-column: 1 / -1;
  margin: 0;
}

.admin-official-tools {
  margin-top: 14px;
}

.official-category {
  display: grid;
  gap: 10px;
}

.official-category-title {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.official-category-files {
  display: grid;
  gap: 12px;
}

.official-more {
  justify-self: center;
}

/* 单页应用视图切换 */
.spa-view[hidden],
.topbar[hidden],
.foot[hidden] {
  display: none !important;
}

@keyframes spa-view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spa-view.is-entering {
  animation: spa-view-in 0.22s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .spa-view.is-entering {
    animation: none;
  }
}

/* 首页投票 */
.poll-list {
  display: grid;
  gap: 12px;
}

.poll-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.poll-question {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.poll-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.poll-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 96px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.poll-choice:hover:not(:disabled) {
  border-color: var(--accent);
}

.poll-choice.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.poll-choice:disabled {
  cursor: default;
  opacity: 0.85;
}

.poll-count {
  font-variant-numeric: tabular-nums;
}

.poll-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.poll-login {
  margin: 12px 0 0;
}

.admin-official-more-cell {
  text-align: center;
}

.market-file,
.market-order {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.market-file-ext {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.market-file-copy,
.market-order-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.market-file-copy strong,
.market-order-copy strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-file-copy small,
.market-order-copy small {
  color: var(--muted);
  font-size: 11.5px;
}

.market-file-copy p,
.market-order-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.market-file-actions,
.market-order-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
}

.market-price {
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

.market-own {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* 管理后台：支付设置与套餐 */
.admin-settings-form,
.admin-package-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.admin-form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.admin-settings-form .field-span-2,
.admin-package-form .field-span-2 {
  grid-column: 1 / -1;
}

.admin-package-desc {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.admin-form-actions .form-message {
  margin: 0;
}

/* 管理后台：免费模式开关 */
.admin-switch-row {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.switch-field {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.switch-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  transition: background-color 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}

.switch-field input:checked + .switch-track {
  background: var(--accent);
}

.switch-field input:checked + .switch-track::after {
  transform: translateX(20px);
}

.switch-field input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch-field input:disabled + .switch-track {
  opacity: 0.6;
}

.switch-copy {
  display: grid;
  gap: 2px;
}

.switch-copy small {
  color: var(--muted);
  font-size: 12px;
}

.admin-switch-row .form-message {
  margin: 0;
}

@media (max-width: 720px) {
  .store-overview {
    grid-template-columns: 1fr;
  }

  .store-recharge-form,
  .admin-settings-form,
  .admin-package-form {
    grid-template-columns: 1fr;
  }

  .store-form-actions,
  .admin-form-actions {
    grid-column: auto;
  }

  .store-package {
    align-items: flex-start;
    flex-direction: column;
  }

  .store-package-actions {
    width: 100%;
    justify-content: space-between;
  }

  .market-upload-form {
    grid-template-columns: 1fr;
  }

  .market-file,
  .market-order {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .market-file-actions,
  .market-order-actions {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 720px) {
  .public-file-item {
    flex-direction: column;
  }

  .public-file-delete {
    align-self: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 聊天禁言 */
.chat-avatar.is-pressable {
  cursor: pointer;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.chat-row.is-muted .chat-avatar {
  opacity: 0.45;
  filter: grayscale(1);
}

.chat-muted-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1200;
  max-width: min(90vw, 420px);
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  border-color: var(--danger);
  color: var(--danger);
}

/* 首页服务器推广 */
.promo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.promo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.promo-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--accent-soft);
}

.promo-copy {
  display: grid;
  gap: 6px;
  padding: 14px 16px 16px;
}

.promo-copy h3 {
  margin: 0;
  font-size: 15px;
}

.promo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.admin-promo-thumb {
  display: block;
  width: 72px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.admin-settings-form .file-pick.field-span-2 {
  grid-column: 1 / -1;
}
