:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #141a2a;
  --muted: #5d667c;
  --line: #e2e6ef;
  --accent: #3d63f2;
  --accent-2: #18b4e6;
  --accent-ink: #ffffff;
  --accent-soft: #e8edff;
  --ok: #1f9d55;
  --ok-soft: #e3f6ea;
  --warn: #c2410c;
  --warn-soft: #fdeee4;
  --danger: #d92d3a;
  --shadow: 0 1px 2px rgba(20, 26, 42, .05), 0 8px 24px rgba(20, 26, 42, .06);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1320;
    --surface: #171c2b;
    --surface-2: #1e2436;
    --text: #e8ebf3;
    --muted: #98a1b8;
    --line: #2a3145;
    --accent: #6f8dff;
    --accent-2: #3cc7f0;
    --accent-ink: #0d1120;
    --accent-soft: #232c4d;
    --ok: #4ccf86;
    --ok-soft: #173326;
    --warn: #ff9a62;
    --warn-soft: #3a2518;
    --danger: #ff6b76;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1320; --surface: #171c2b; --surface-2: #1e2436; --text: #e8ebf3; --muted: #98a1b8; --line: #2a3145;
  --accent: #6f8dff; --accent-2: #3cc7f0; --accent-ink: #0d1120; --accent-soft: #232c4d; --ok: #4ccf86; --ok-soft: #173326;
  --warn: #ff9a62; --warn-soft: #3a2518; --danger: #ff6b76; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
code { font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer;
  text-decoration: none !important; transition: background .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: default; pointer-events: none; }

/* 顶栏 */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; text-decoration: none !important; }
.brand img { border-radius: 7px; }
.nav-links { display: flex; gap: 22px; flex: 1; }
.nav-links a { color: var(--muted); font-size: 15px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-actions { display: flex; gap: 8px; margin-left: auto; min-width: 0; }

/* 首屏 */
.hero { padding: 72px 0 64px; background: radial-gradient(900px 420px at 85% 10%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%), radial-gradient(700px 400px at 10% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: 48px; font-weight: 800; letter-spacing: -.02em; }
.lead { font-size: 18px; color: var(--muted); margin-top: 18px; max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.req { margin-top: 14px; font-size: 13px; color: var(--muted); }
.hero-art { display: flex; justify-content: center; }
.art-window { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 60px -20px rgba(30, 50, 120, .25), var(--shadow); overflow: hidden; }
.art-bar { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.art-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.art-bar i:nth-child(2) { background: #febc2e; }
.art-bar i:nth-child(3) { background: #28c840; }
.art-bar span { margin-left: 8px; }
.art-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 2px 10px; border-radius: 999px; }
.art-pill em { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.art-screen { aspect-ratio: 16 / 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), color-mix(in srgb, var(--accent-2) 22%, var(--surface))); }
.art-screen img { border-radius: 28px; filter: drop-shadow(0 12px 22px rgba(30, 60, 160, .3)); }
.art-screen p { font-size: 14px; font-weight: 600; color: var(--text); opacity: .75; }

/* 区块 */
.section { padding: 72px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { font-size: 30px; font-weight: 800; }
.section-lead { color: var(--muted); margin-top: 8px; }
.grid { display: grid; gap: 16px; }
.features { grid-template-columns: repeat(3, 1fr); margin-top: 32px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.section-alt .card { box-shadow: none; }
.feature svg { width: 34px; height: 34px; padding: 6px; border-radius: 10px; background: var(--accent-soft); stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 17px; margin-top: 14px; }
.feature p { color: var(--muted); font-size: 15px; margin-top: 6px; }

.steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.steps li { display: flex; gap: 14px; }
.steps b { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 15px; }
.steps h3 { font-size: 16px; margin-top: 3px; }
.steps p { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.steps-compact { grid-template-columns: 1fr; gap: 18px; margin-top: 24px; }
.steps-compact p { margin-top: 4px; }

details { border-bottom: 1px solid var(--line); padding: 4px 0; }
details summary { cursor: pointer; list-style: none; padding: 14px 28px 14px 0; font-weight: 600; position: relative; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
details p { color: var(--muted); padding: 0 0 16px; }
#faq h2 { margin-bottom: 16px; }

.release { padding: 18px 0; border-bottom: 1px solid var(--line); }
.release header { display: flex; align-items: baseline; gap: 12px; }
.release header b { font-size: 18px; }
.release ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.release li { margin: 3px 0; }
#changelog h2 { margin-bottom: 8px; }

.footer { padding: 28px 0 40px; font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* 登录注册 */
.auth { min-height: calc(100vh - 160px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.auth-card > img { align-self: center; border-radius: 15px; }
.auth-card h1 { text-align: center; font-size: 24px; margin-top: 4px; }
.auth-card > p.muted { text-align: center; font-size: 14px; margin-top: -6px; margin-bottom: 6px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input, textarea {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; height: 44px; padding: 0 12px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; border-color: var(--accent); }
.form-error { color: var(--danger); font-size: 14px; }
.form-ok { color: var(--ok); font-size: 14px; }
.auth-alt { text-align: center; font-size: 14px; color: var(--muted); }

/* 我的账号 */
.page { padding-top: 40px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 16px; }
.account-head { display: flex; align-items: center; gap: 16px; }
.account-head img { border-radius: 13px; }
.account-head h1 { font-size: 24px; }
.badge { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 1px 9px; border-radius: 999px; }
.badge-ok { color: var(--ok); background: var(--ok-soft); }
.badge-off { color: var(--warn); background: var(--warn-soft); }
.badge-admin { color: var(--accent); background: var(--accent-soft); }
.badge-new { color: var(--warn); background: var(--warn-soft); }
details.card { padding: 6px 22px; }
.stack { display: flex; flex-direction: column; gap: 12px; padding-bottom: 18px; }
.stack .btn { align-self: flex-start; }

/* 后台 */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-head h1 { font-size: 26px; }
.tabs { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 11px; gap: 2px; }
.tabs button, .seg button { font: inherit; font-size: 14px; font-weight: 600; border: 0; background: transparent; color: var(--muted); height: 34px; padding: 0 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.toolbar input[type="search"] { max-width: 280px; height: 38px; }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 11px; gap: 2px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.row.is-off { opacity: .72; }
.who { display: flex; flex-direction: column; min-width: 0; }
.who b { font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who span, .meta span { font-size: 13px; color: var(--muted); }
.meta { display: flex; flex-direction: column; min-width: 0; }
.meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.fb { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.fb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fb-head b { font-size: 16px; }
.fb-head .actions { margin-left: auto; }
.fb-text { white-space: pre-wrap; word-break: break-word; }
.fb-env { font-size: 12.5px; color: var(--muted); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs button { border: 1px solid var(--line); padding: 0; border-radius: 8px; overflow: hidden; cursor: zoom-in; background: var(--surface-2); }
.thumbs img { display: block; height: 96px; max-width: 180px; object-fit: cover; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }
.viewer { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.viewer::backdrop { background: rgba(5, 8, 16, .78); }
.viewer img { display: block; max-width: 94vw; max-height: 84vh; border-radius: 10px; }
.viewer .btn { margin: 12px auto 0; display: flex; background: var(--surface); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 50; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* 平板 */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
/* 手机 */
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .page { padding-top: 24px; }
  .nav-actions .btn { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
  .nav-links { display: none; }
  .nav-inner { gap: 12px; }
  .hero { padding: 44px 0 40px; }
  .hero h1 { font-size: 32px; }
  .lead { font-size: 16px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .section { padding: 48px 0; }
  .section h2 { font-size: 24px; }
  .features, .steps { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .auth-card { padding: 24px 20px; }
  .row { grid-template-columns: 1fr; gap: 10px; }
  .actions { justify-content: flex-start; }
  .admin-head { flex-direction: column; align-items: stretch; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; padding: 0 8px; }
  .toolbar input[type="search"] { max-width: none; }
  .fb-head .actions { margin-left: 0; width: 100%; }
}
