:root {
    --bg: #ffffff;
    --bg-alt: #f5f7fa;
    --surface: #ffffff;
    --text: #1d2129;
    --muted: #5f6672;
    --border: #e1e5eb;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-text: #ffffff;
    --accent-bg: #ecf3ff;
    --code-bg: #f1f3f6;
    --shadow: rgba(15, 23, 42, 0.18);
    --grid-dot: rgba(15, 23, 42, 0.09);
    --ink: #1d2129;
    --ink-text: #ffffff;
    --ink-hover: #374151;

    /* 插图配色：界面示意跟随深浅色，试卷纸面始终是浅色 */
    --ill-window: #ffffff;
    --ill-chrome: #f3f5f8;
    --ill-border: #dfe3ea;
    --ill-line: #dde2e9;
    --ill-line-strong: #b4bcc8;
    --ill-ink: #1d2129;
    --ill-muted: #6b7280;
    --ill-accent: #2563eb;
    --ill-accent-soft: #e3ecff;
    --ill-green: #16a34a;
    --ill-green-soft: #dcf5e4;
    --ill-orange: #e07b00;
    --ill-orange-soft: #ffeedb;
    --ill-red: #dc2626;
    --ill-red-soft: #fde4e4;
    --ill-paper: #ffffff;
    --ill-paper-line: #d3d8e0;
    --ill-paper-ink: #2b3038;
    --ill-mark: #d93025;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #15171b;
        --bg-alt: #1a1d22;
        --surface: #1f2228;
        --text: #e6e8eb;
        --muted: #a0a7b1;
        --border: #313640;
        --primary: #4f8cff;
        --primary-hover: #6b9eff;
        --primary-text: #0b1220;
        --accent-bg: #1b2a44;
        --code-bg: #2a2e36;
        --shadow: rgba(0, 0, 0, 0.6);
        --grid-dot: rgba(255, 255, 255, 0.07);
        --ink: #e6e8eb;
        --ink-text: #15171b;
        --ink-hover: #ffffff;

        --ill-window: #1f2329;
        --ill-chrome: #272b33;
        --ill-border: #383e49;
        --ill-line: #353b45;
        --ill-line-strong: #5c6573;
        --ill-ink: #e6e8eb;
        --ill-muted: #9aa1ab;
        --ill-accent: #6b9eff;
        --ill-accent-soft: #233658;
        --ill-green: #4ade80;
        --ill-green-soft: #173a26;
        --ill-orange: #f5a524;
        --ill-orange-soft: #3d2d12;
        --ill-red: #f87171;
        --ill-red-soft: #401f1f;
        --ill-paper: #eceff3;
        --ill-paper-line: #c4cad4;
    }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: var(--code-bg);
    padding: 1px 5px;
    border-radius: 4px;
    overflow-wrap: anywhere;
}

h1, h2, h3 { line-height: 1.3; }
h2 { font-size: 30px; margin: 0 0 10px; letter-spacing: -0.02em; }
h3 { font-size: 17px; margin: 0; }

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

.icon {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 顶栏 */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: 17px;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; }
.brand-tag {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 8px;
    line-height: 18px;
    white-space: nowrap;
}

.nav { display: flex; gap: 22px; }
.nav a { color: var(--muted); font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.button:hover { text-decoration: none; transform: translateY(-1px); }

.button.primary {
    background: var(--primary);
    color: var(--primary-text);
}
.button.primary:hover { background: var(--primary-hover); }

.section-lead { color: var(--muted); margin: 0 auto; max-width: 40em; }

/* 更新日志 */
.wrap.narrow { max-width: 780px; }
.releases { padding: 56px 0 72px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 36px; margin: 0 0 8px; }
.page-head .section-lead { margin: 0; }

.version-index { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.version-index a {
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
}
.version-index a:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

.release {
    border-top: 1px solid var(--border);
    padding: 32px 0 8px;
    margin-top: 24px;
    scroll-margin-top: 64px;
}
.release-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.release-head h2 { font-size: 26px; margin: 0; }
.release-head time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.badge {
    display: inline-block;
    vertical-align: middle;
    font-size: 12px;
    font-weight: 600;
    color: var(--ill-orange);
    background: var(--ill-orange-soft);
    padding: 1px 8px;
    border-radius: 999px;
    margin-left: 4px;
}
.release-summary { color: var(--muted); margin: 8px 0 0; }
.release h3 { font-size: 15px; margin: 22px 0 6px; color: var(--primary); }
.release h4 { font-size: 14px; margin: 16px 0 4px; color: var(--muted); }
.release p { margin: 8px 0 0; }
.release code { font-size: 0.92em; }
.release ul { margin: 0; padding-left: 1.2em; }
.release li { margin-top: 6px; }
.release li strong { font-weight: 600; }

/* 安装包未上传提示页 */
.notice { padding: 96px 0 120px; text-align: center; }
.notice h1 { font-size: 30px; margin: 18px 0 8px; }
.notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--accent-bg);
    color: var(--primary);
}
.notice-icon .icon { width: 30px; height: 30px; }
.notice-links { display: flex; justify-content: center; gap: 24px; margin-top: 28px; }

/* 账号页：登录 / 注册 / 忘记密码按设计稿是居中的一张圆角卡片 */
:root {
    --auth-primary: #3d7ef7;
    --auth-primary-hover: #3169d5;
    --auth-primary-disabled: #a9c4fb;
    --auth-input-border: #e2e8f0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --auth-primary: #5b86f8;
        --auth-primary-hover: #7096fa;
        --auth-primary-disabled: #2e3f68;
        --auth-input-border: #3a404b;
    }
}

.account { padding: 48px 0 80px; background: var(--bg-alt); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.auth-card {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 40px 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 24px 48px -32px var(--shadow);
}
.auth-noscript { max-width: 680px; margin: 0 auto 16px; }

.auth-logo {
    display: block;
    margin: 0 auto 20px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #ffffff;
}
.auth-card > h1 { text-align: center; font-size: 32px; font-weight: 700; margin: 0 0 8px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 16px; margin: 0 0 32px; }

.auth-form { display: grid; gap: 22px; }
.field { display: grid; gap: 10px; }
.field > span, .field > label { font-size: 16px; font-weight: 700; color: var(--text); }

.auth-card input:not([type="checkbox"]),
.auth-card select {
    font: inherit;
    font-size: 16px;
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--auth-input-border);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-card input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.auth-card input:focus,
.auth-card select:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-primary) 18%, transparent);
}

.code-input { display: flex; gap: 12px; }
.code-input input { flex: 1; min-width: 0; }
.send-code {
    flex: none;
    height: 56px;
    padding: 0 20px;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--auth-input-border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}
.send-code:hover:not(:disabled) { border-color: var(--auth-primary); color: var(--auth-primary); }
.send-code:disabled { color: var(--muted); cursor: not-allowed; }
.captcha-image {
    flex: none;
    width: 152px;
    height: 56px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--auth-input-border);
    background: var(--surface);
    overflow: hidden;
    cursor: pointer;
}
.captcha-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.captcha-image:hover:not(:disabled) { border-color: var(--auth-primary); }
.captcha-image:disabled { cursor: not-allowed; opacity: 0.6; }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-row a { color: var(--auth-primary); font-size: 15px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); }
.check input { width: 16px; height: 16px; accent-color: var(--auth-primary); }

.auth-submit {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 8px;
    background: var(--auth-primary);
    color: #ffffff;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.auth-submit:hover:not(:disabled) { background: var(--auth-primary-hover); }
.auth-submit:disabled { background: var(--auth-primary-disabled); cursor: not-allowed; }
.auth-submit.inline { width: auto; height: 56px; padding: 0 22px; flex: none; font-size: 16px; }

.auth-switch { text-align: center; color: var(--muted); font-size: 15px; margin: 28px 0 0; }
.auth-switch a, .auth-switch .link-button { color: var(--auth-primary); font-size: 15px; }
.auth-closed {
    text-align: center;
    color: var(--muted);
    padding: 20px;
    border-radius: 8px;
    background: var(--bg-alt);
    margin: 0;
}
.field-hint { color: var(--muted); font-size: 13px; margin: -8px 0 0; }

.msg { font-size: 14px; margin: 0; padding: 10px 12px; border-radius: 8px; }
.msg.error { color: var(--ill-red); background: var(--ill-red-soft); }
.msg.ok { color: var(--ill-green); background: var(--ill-green-soft); }
.auth-card > .msg { margin: -12px 0 20px; }

.button.secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--auth-input-border);
}
button.button { font: inherit; font-weight: 600; cursor: pointer; justify-content: center; }
.button.secondary:hover { border-color: var(--auth-primary); }
.button.small { padding: 7px 14px; font-size: 14px; }
.link-button {
    font: inherit;
    font-size: 14px;
    border: 0;
    padding: 0;
    background: none;
    color: var(--auth-primary);
    cursor: pointer;
}
button:disabled { cursor: not-allowed; }

.usage { font-size: 13px; margin: 10px 0 0; }

.issued {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 10px;
    background: var(--accent-bg);
    animation: rise 0.4s ease both;
}
.issued p { margin: 6px 0 0; font-size: 14px; }
.issued-label { font-weight: 600; color: var(--primary); margin-top: 0 !important; }
.hint { color: var(--text); }

.code-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.code {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    word-break: break-all;
    user-select: all;
}

.history { list-style: none; margin: 8px 0 0; padding: 0; }
.history-item { padding: 14px 0; border-top: 1px solid var(--border); }
.history-item:first-child { border-top: 0; }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.history-item p { margin: 4px 0 6px; }
.badge.active { color: var(--ill-green); background: var(--ill-green-soft); }
.badge.expired { color: var(--muted); background: var(--bg-alt); }

/* 页脚 */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    font-size: 14px;
    color: var(--muted);
}

.footer-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 20px;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }
.footer .quiet { margin-left: auto; opacity: 0.7; }

/* ---------- 动画：只动 transform 与 opacity ---------- */
@keyframes rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

/* 滚动进入视口时渐显（site.js 加 js-reveal；不支持或减少动态效果时内容直接显示） */
.js-reveal .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }
.js-reveal .reveal-group > .reveal:nth-child(2) { transition-delay: 0.08s; }
.js-reveal .reveal-group > .reveal:nth-child(3) { transition-delay: 0.16s; }
.js-reveal .reveal-group > .reveal:nth-child(4) { transition-delay: 0.24s; }
.js-reveal .reveal-group > .reveal:nth-child(5) { transition-delay: 0.32s; }
.js-reveal .reveal-group > .reveal:nth-child(6) { transition-delay: 0.4s; }

/* 插图离开视口时暂停动画；进入视口前停在第一帧 */
.js-reveal .illus:not(.is-playing),
.js-reveal .illus:not(.is-playing) * { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* 平板与手机 */
@media (max-width: 600px) {
    .brand-tag { display: none; }
    .nav { gap: 14px; }
    .nav a { font-size: 14px; }
    .account { padding: 24px 0 48px; }
    .account .wrap { padding: 0 16px; }
    .auth-card { padding: 32px 20px 28px; border-radius: 14px; }
    .auth-card > h1 { font-size: 28px; }
    .auth-sub { margin-bottom: 24px; }
    .auth-form { gap: 18px; }
    .send-code { padding: 0 14px; font-size: 15px; }
    .captcha-image { width: 132px; }
    .auth-submit.inline { width: 100%; height: 52px; }
    .code { font-size: 13px; }
}

@media (max-width: 420px) {
    .nav-optional { display: none; }
}
