/* ============================================================
 * HOVER 前台样式（卡密自助兑换页：ChatGPT 开通 + X 赠礼）
 * 视觉语言对齐主站 hoverk.com（Tokyo 主题）：
 *   浅灰底 #f0f0f3、纯白圆角卡片、黑色胶囊按钮、小号彩色标签、Inter 字体
 * 自动深色模式（跟随系统，可手动切换）；无外部字体 / 无外部脚本
 * ============================================================ */

:root {
    color-scheme: light;

    /* 页面与卡片 */
    --bg: #f0f0f3;
    --surface: #ffffff;
    --surface-2: #f7f8fa;
    --surface-3: #ececf0;
    --nav-bg: rgba(240, 240, 243, 0.88);
    --nav-border: rgba(224, 225, 230, 0.95);
    --border: #e0e1e6;
    --border-strong: #d9d9e0;

    /* 文字 */
    --text: #1c2024;
    --text-2: #60646c;
    --text-3: #8b8f98;
    --brand-line-rgb: 28, 32, 36;

    /* 主按钮（黑色胶囊） */
    --btn-bg: #000000;
    --btn-bg-hover: #1c2024;
    --btn-fg: #ffffff;
    --focus: #1c2024;
    --ring: 0 0 0 4px rgba(28, 32, 36, 0.08);

    /* 语义色（取自主站标签配色） */
    --link: #0d74ce;
    --info: #0d74ce;
    --info-soft: rgba(13, 116, 206, 0.10);
    --success: #127b3c;
    --success-soft: rgba(26, 162, 81, 0.10);
    --error: #ce2c31;
    --error-soft: rgba(206, 44, 49, 0.12);
    --warning: #9a6a12;
    --warning-soft: rgba(186, 145, 47, 0.14);

    /* 进度条 */
    --bar: #1c2024;
    --bar-shine: #60646c;

    /* 阴影与圆角 */
    --shadow-soft: 0 3px 6px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.07);
    --shadow-elevated: 0 10px 20px rgba(0, 0, 0, 0.10), 0 3px 6px rgba(0, 0, 0, 0.05);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --pill: 9999px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1114;
    --surface: #17191d;
    --surface-2: #1e2126;
    --surface-3: #262a30;
    --nav-bg: rgba(23, 25, 29, 0.88);
    --nav-border: rgba(58, 62, 70, 0.9);
    --border: #2a2e35;
    --border-strong: #383d45;

    --text: #f2f3f5;
    --text-2: #b3b8c2;
    --text-3: #7f858f;
    --brand-line-rgb: 242, 243, 245;

    --btn-bg: #f2f3f5;
    --btn-bg-hover: #ffffff;
    --btn-fg: #111318;
    --focus: #f2f3f5;
    --ring: 0 0 0 4px rgba(242, 243, 245, 0.10);

    --link: #5aa8f5;
    --info: #5aa8f5;
    --info-soft: rgba(90, 168, 245, 0.14);
    --success: #3fbf75;
    --success-soft: rgba(63, 191, 117, 0.14);
    --error: #f0736f;
    --error-soft: rgba(240, 115, 111, 0.14);
    --warning: #e0b35a;
    --warning-soft: rgba(224, 179, 90, 0.14);

    --bar: #f2f3f5;
    --bar-shine: #9aa0aa;

    --shadow-soft: 0 3px 6px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-elevated: 0 10px 20px rgba(0, 0, 0, 0.45), 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* ============ 基础 ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, p {
    margin: 0;
}

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

a:hover {
    text-decoration: underline;
}

button,
input,
textarea {
    font: inherit;
    color: inherit;
}

code {
    font-family: var(--mono);
    font-size: 0.92em;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface-3);
    color: var(--text);
}

::selection {
    background: var(--text);
    color: var(--bg);
}

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

.icon {
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
    vertical-align: -0.15em;
}

/* ============ 顶部导航（悬浮胶囊条，同主站） ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 14px 24px 0;
}

.nav-shell {
    max-width: 1180px;
    margin: 0 auto;
    height: 64px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: var(--pill);
    background: var(--nav-bg);
    border: 1px solid var(--nav-border);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    margin-right: 6px;
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: var(--pill);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.brand-word {
    display: inline-block;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    line-height: 1.1;
    color: var(--text);
}

/* 字标下的渐变线，与主站 .tokyo-brand-chip::after 相同的渐变节点 */
.brand-word::after {
    content: "";
    display: block;
    width: 100%;
    min-width: 54px;
    height: 3px;
    margin-top: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        rgba(var(--brand-line-rgb), 0.9) 0%,
        rgba(var(--brand-line-rgb), 0.58) 38%,
        rgba(var(--brand-line-rgb), 0.18) 74%,
        rgba(var(--brand-line-rgb), 0) 100%);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border-radius: var(--pill);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.nav-link:hover {
    text-decoration: none;
    color: var(--text);
    background: var(--surface-3);
}

.nav-link.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    font-weight: 600;
}

.nav-link .icon {
    width: 16px;
    height: 16px;
}

.chip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    padding: 0 14px;
    border-radius: var(--pill);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.chip-btn:hover {
    text-decoration: none;
    background: var(--surface-2);
    border-color: var(--text-3);
}

.chip-btn:active {
    transform: scale(0.97);
}

.chip-btn .icon {
    width: 16px;
    height: 16px;
}

.chip-btn.square {
    width: 42px;
    padding: 0;
}

.chip-btn .icon-sun { display: none; }
.chip-btn .icon-moon { display: block; }
[data-theme="dark"] .chip-btn .icon-sun { display: block; }
[data-theme="dark"] .chip-btn .icon-moon { display: none; }

/* ============ 页面骨架 ============ */
.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 24px 28px;
    animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.side {
    display: grid;
    gap: 20px;
    position: sticky;
    top: 92px;
}

/* ============ 卡片 ============ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 22px 24px;
}

.card-main {
    padding: 24px 28px 28px;
}

.eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: 6px;
}

.card-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.card-head h1,
.card-head h2 {
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.card-head .sub {
    margin-top: 6px;
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.6;
    max-width: 560px;
}

.card-head.compact {
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.card-head.compact h2 {
    font-size: 17px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

/* 小号彩色标签（主站 tokyo-pill 风格） */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 9px;
    border-radius: var(--pill);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--surface-3);
    color: var(--text-2);
}

.tag .icon { width: 12px; height: 12px; }
.tag.blue { background: var(--info-soft); color: var(--info); }
.tag.green { background: var(--success-soft); color: var(--success); }
.tag.red { background: var(--error-soft); color: var(--error); }
.tag.amber { background: var(--warning-soft); color: var(--warning); }

/* 流程状态徽章 */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 11px;
    border-radius: var(--pill);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--surface-3);
    color: var(--text-2);
    flex-shrink: 0;
}

.pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
}

.pill.pending { color: var(--text-2); }
.pill.cdk_ok,
.pill.confirm { background: var(--info-soft); color: var(--info); }
.pill.running { background: var(--info-soft); color: var(--info); }
.pill.running::before { animation: blink 1.2s ease-in-out infinite; }
.pill.success { background: var(--success-soft); color: var(--success); }
.pill.failed { background: var(--error-soft); color: var(--error); }
.pill.manual { background: var(--warning-soft); color: var(--warning); }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* ============ 分段 Tab ============ */
.segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: var(--pill);
    background: var(--surface-3);
    margin-bottom: 20px;
}

.segmented [role="tab"] {
    height: 38px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--pill);
    background: transparent;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.segmented [role="tab"]:hover:not(:disabled) {
    color: var(--text);
}

.segmented [role="tab"][aria-selected="true"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.segmented [role="tab"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ============ 步骤条 ============ */
.stepper {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 600;
    min-width: 0;
}

.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.step-num .icon {
    width: 13px;
    height: 13px;
    display: none;
}

.step.active {
    color: var(--text);
}

.step.active .step-num {
    background: var(--btn-bg);
    color: var(--btn-fg);
    box-shadow: 0 0 0 4px var(--surface-3);
}

.step.done {
    color: var(--text-2);
}

.step.done .step-num {
    background: var(--success);
    color: #fff;
}

.step.done .step-num .num { display: none; }
.step.done .step-num .icon { display: block; }

.step-line {
    flex: 1;
    height: 2px;
    margin: 0 12px;
    background: var(--border-strong);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    min-width: 14px;
}

.step-line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--success);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.step-line.done::after {
    transform: scaleX(1);
}

/* ============ 提示条 ============ */
.notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.notice .icon {
    width: 17px;
    height: 17px;
    margin-top: 2px;
}

.notice.info {
    background: var(--info-soft);
    color: var(--info);
}

.notice strong {
    font-weight: 700;
}

/* ============ 表单 ============ */
.field {
    margin-bottom: 16px;
}

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.input,
.textarea {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-3);
}

.input:hover,
.textarea:hover {
    border-color: var(--text-3);
}

.input:focus,
.textarea:focus {
    border-color: var(--focus);
    box-shadow: var(--ring);
}

.input.is-invalid,
.textarea.is-invalid {
    border-color: var(--error);
}

.input.is-valid,
.textarea.is-valid {
    border-color: var(--success);
}

/* 胶囊输入 + 黑色按钮组合（主站搜索框样式） */
.input-row {
    display: flex;
    gap: 8px;
    padding: 5px;
    border-radius: var(--pill);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-row:focus-within {
    border-color: var(--focus);
    box-shadow: var(--ring);
}

.input-row .input {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: var(--pill);
    padding: 10px 14px;
    background: transparent;
    box-shadow: none !important;
}

.input-row .btn {
    flex-shrink: 0;
    height: 44px;
    padding: 0 20px;
}

.input-cdk {
    font-family: var(--mono);
    letter-spacing: 0.04em;
}

.textarea {
    min-height: 150px;
    resize: vertical;
    font-family: var(--mono);
    font-size: 13px;
    padding-bottom: 54px;
}

.textarea-wrap {
    position: relative;
}

.textarea-float {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: var(--pill);
    background: var(--btn-bg);
    color: var(--btn-fg) !important;
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
    transition: background 0.2s, transform 0.1s;
    user-select: none;
}

.textarea-float:hover {
    text-decoration: none;
    background: var(--btn-bg-hover);
}

.textarea-float:active {
    transform: scale(0.97);
}

.textarea-float .icon {
    width: 13px;
    height: 13px;
}

.field-hint {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-3);
    line-height: 1.55;
}

.field-feedback {
    display: none;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.5;
}

.field-feedback .icon {
    width: 14px;
    height: 14px;
    margin-top: 2px;
}

.field-feedback.ok { display: flex; color: var(--success); }
.field-feedback.bad { display: flex; color: var(--error); }

/* Session 获取指引 */
.howto {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-2);
}

.howto summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.howto summary::-webkit-details-marker {
    display: none;
}

.howto summary .icon {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.howto[open] summary .icon.chev {
    transform: rotate(180deg);
}

.howto ol {
    margin: 0;
    padding: 0 14px 12px 34px;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.7;
}

.howto kbd {
    font-family: var(--mono);
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 5px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
}

/* ============ 按钮（胶囊） ============ */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 20px;
    border-radius: var(--pill);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.1s;
    user-select: none;
}

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

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--btn-bg);
    color: var(--btn-fg);
    border-color: var(--btn-bg);
}

.btn-primary:hover:not(:disabled) {
    background: var(--btn-bg-hover);
    border-color: var(--btn-bg-hover);
    box-shadow: var(--shadow-soft);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--text-3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-3);
    color: var(--text);
}

.btn-lg {
    height: 50px;
    padding: 0 24px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

.btn .spinner {
    display: none;
}

.btn.is-loading .spinner {
    display: inline-block;
}

.btn.is-loading .btn-label {
    opacity: 0.85;
}

.spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin 0.75s linear infinite;
    flex: 0 0 auto;
}

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

.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

/* 已验证信息块 */
.verified-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.verified-item {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    min-width: 0;
}

.verified-item .k {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 4px;
}

.verified-item .v {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.verified-item .v code {
    background: transparent;
    padding: 0;
    font-size: 13px;
}

.verified-item.accent {
    background: var(--info-soft);
    border-color: transparent;
}

.verified-item.accent .k,
.verified-item.accent .v {
    color: var(--info);
}

/* ============ 第三步：账号确认 ============ */
.account-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-size: 22px;
    font-weight: 800;
    border: 2px solid var(--surface);
    box-shadow: var(--shadow-soft);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar img[hidden] {
    display: none;
}

.account-main {
    min-width: 0;
    flex: 1;
}

.account-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-email {
    font-size: 13.5px;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--mono);
}

.account-card .tags {
    margin-top: 8px;
}

.account-facts {
    margin-bottom: 12px;
}

.account-facts .kv-cell .v.mono {
    font-family: var(--mono);
    font-size: 13px;
}

.sub-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-2);
    line-height: 1.55;
}

.sub-check .spinner,
.sub-check .icon {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.sub-check .icon { display: none; }
.sub-check.ok,
.sub-check.warn,
.sub-check.muted { border-color: transparent; }
.sub-check.ok .spinner,
.sub-check.warn .spinner,
.sub-check.muted .spinner { display: none; }
.sub-check.ok .icon,
.sub-check.warn .icon,
.sub-check.muted .icon { display: block; }
.sub-check.ok { background: var(--success-soft); color: var(--success); }
.sub-check.warn { background: var(--warning-soft); color: var(--warning); }
.sub-check.muted { background: var(--surface-3); color: var(--text-2); }

/* ============ 进度面板 ============ */
.progress-panel {
    margin-top: 18px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    animation: rise 0.35s ease both;
}

.progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.progress-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.progress-title .spinner {
    width: 14px;
    height: 14px;
    color: var(--text-2);
}

.progress-panel.state-success .progress-title .spinner,
.progress-panel.state-error .progress-title .spinner {
    display: none;
}

.progress-pct {
    font-variant-numeric: tabular-nums;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.progress-panel.state-success .progress-pct { color: var(--success); }
.progress-panel.state-error .progress-pct { color: var(--error); }

.progress-track {
    height: 10px;
    border-radius: var(--pill);
    background: var(--surface-3);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--bar) 0%, var(--bar-shine) 50%, var(--bar) 100%);
    background-size: 200% 100%;
    animation: flow 1.6s linear infinite;
    transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes flow {
    from { background-position: 0% 0; }
    to { background-position: -200% 0; }
}

.progress-panel.state-success .progress-bar {
    background: var(--success);
    animation: none;
}

.progress-panel.state-error .progress-bar {
    background: var(--error);
    animation: none;
}

.progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--text-3);
}

.progress-msg {
    color: var(--text-2);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-extra {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ws-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ws-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-3);
}

.ws-dot.online::before { background: var(--success); }
.ws-dot.offline::before { background: var(--warning); animation: blink 1s infinite; }
.ws-dot:empty { display: none; }

/* ============ 结果 / 状态消息 ============ */
.status {
    display: none;
    gap: 10px;
    align-items: flex-start;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    animation: rise 0.3s ease both;
}

.status.show {
    display: flex;
}

.status .icon {
    width: 17px;
    height: 17px;
    margin-top: 3px;
}

.status.success { background: var(--success-soft); color: var(--success); }
.status.error { background: var(--error-soft); color: var(--error); }
.status.info { background: var(--info-soft); color: var(--info); }
.status.warning { background: var(--warning-soft); color: var(--warning); }

.result-hero {
    margin-top: 18px;
    padding: 26px 20px;
    border-radius: var(--radius-md);
    text-align: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    animation: rise 0.4s ease both;
}

.result-hero .ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    color: #fff;
}

.result-hero .ring .icon {
    width: 28px;
    height: 28px;
}

.result-hero h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
}

.result-hero p {
    color: var(--text-2);
    font-size: 14px;
    max-width: 460px;
    margin: 0 auto;
}

.result-hero.success { background: var(--success-soft); border-color: transparent; }
.result-hero.success .ring { background: var(--success); }
.result-hero.success h3 { color: var(--success); }
.result-hero.error { background: var(--error-soft); border-color: transparent; }
.result-hero.error .ring { background: var(--error); }
.result-hero.error h3 { color: var(--error); }
.result-hero.manual { background: var(--warning-soft); border-color: transparent; }
.result-hero.manual .ring { background: var(--warning); }
.result-hero.manual h3 { color: var(--warning); }

.result-hero .actions {
    margin-top: 18px;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
}

/* 键值表 */
.kv {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    overflow: hidden;
}

.kv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.kv-row:last-child {
    border-bottom: 0;
}

.kv-row .k {
    color: var(--text-2);
    flex-shrink: 0;
}

.kv-row .v {
    font-weight: 600;
    text-align: right;
    word-break: break-all;
    min-width: 0;
}

.kv-row .v.mono {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
}

.kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.kv-cell {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    min-width: 0;
}

.kv-cell .k {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 4px;
}

.kv-cell .v {
    display: block;
    font-size: 14px;
    font-weight: 700;
    word-break: break-all;
}

.kv-cell.wide {
    grid-column: 1 / -1;
}

/* ============ 侧栏：系统状态 ============ */
.runtime-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.runtime-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--success);
    line-height: 1;
}

.runtime-value small {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-3);
    margin-left: 2px;
}

.runtime-meta {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    text-align: right;
}

.slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22px, 1fr));
    gap: 6px;
    margin-bottom: 14px;
}

.slot {
    height: 10px;
    border-radius: var(--pill);
    background: var(--surface-3);
    transition: background 0.3s;
}

.slot.busy {
    background: var(--success);
}

.runtime.load-mid .runtime-value { color: var(--warning); }
.runtime.load-mid .slot.busy { background: var(--warning); }
.runtime.load-high .runtime-value { color: var(--error); }
.runtime.load-high .slot.busy { background: var(--error); }

.runtime-foot {
    display: grid;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-2);
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.runtime-foot span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.runtime-foot .icon {
    width: 14px;
    height: 14px;
    color: var(--text-3);
}

/* ============ FAQ ============ */
.faq {
    display: grid;
}

.faq[hidden] {
    display: none;
}

/* hidden 属性优先于任何 display 规则（商品卡图标、FAQ 分组等靠它切换） */
[hidden] {
    display: none !important;
}

.faq details {
    border-bottom: 1px solid var(--border);
}

.faq details:last-child {
    border-bottom: 0;
}

.faq summary {
    cursor: pointer;
    list-style: none;
    padding: 11px 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary .icon {
    width: 14px;
    height: 14px;
    color: var(--text-3);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.faq details[open] summary .icon {
    transform: rotate(180deg);
}

.faq details p {
    padding: 0 0 12px;
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.65;
}

/* ============ 商品卡（卡密识别后） ============ */
.product-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    margin-bottom: 18px;
    animation: rise 0.3s ease both;
}

.product-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.product-icon .icon {
    width: 24px;
    height: 24px;
}

.product-icon.chatgpt {
    background: linear-gradient(135deg, #12b58a, #0b8a68);
}

.product-icon.x {
    background: #000;
    color: #fff;
}

[data-theme="dark"] .product-icon.x {
    background: #f2f3f5;
    color: #0f1114;
}

.x-mark {
    font-family: var(--font);
    font-weight: 900;
    font-size: 22px;
    letter-spacing: -0.06em;
    line-height: 1;
}

.product-main {
    min-width: 0;
    flex: 1;
}

.product-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 3px;
}

.product-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.product-desc {
    margin-top: 3px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-2);
}

.product-cdk {
    flex-shrink: 0;
    text-align: right;
}

.product-cdk .k {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 5px;
}

.product-cdk code {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: 0.03em;
    padding: 5px 9px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

/* @ 前缀的用户名输入框 */
.input-row-prefix {
    align-items: center;
}

.input-prefix {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-left: 3px;
    border-radius: var(--pill);
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
}

.input-row-prefix .input {
    padding-left: 8px;
}

/* X 赠送确认卡 */
.avatar.x-avatar {
    background: #000;
    color: #fff;
}

[data-theme="dark"] .avatar.x-avatar {
    background: #f2f3f5;
    color: #0f1114;
}

.avatar.x-avatar .x-mark {
    font-size: 24px;
}

.notice.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

/* ============ 侧栏：支持的商品 ============ */
.products {
    list-style: none;
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-2);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.product-row .product-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    box-shadow: none;
}

.product-row .product-icon .icon {
    width: 18px;
    height: 18px;
}

.product-row .x-mark {
    font-size: 17px;
}

.product-text {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.product-text strong {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.3;
}

.product-text small {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-2);
}

.product-row.active {
    border-color: var(--focus);
    box-shadow: var(--ring);
}

/* ============ 页脚（白色圆角条，同主站） ============ */
.site-footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 32px;
}

.foot-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 16px 20px;
    text-align: center;
    color: var(--text-2);
    font-size: 12.8px;
    line-height: 1.7;
}

.foot-card a {
    color: var(--text-2);
    font-weight: 600;
}

.foot-card a:hover {
    color: var(--text);
}

/* ============ Toast ============ */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    padding: 11px 16px;
    border-radius: var(--pill);
    background: var(--text);
    color: var(--bg);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-elevated);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============ 响应式 ============ */
@media (max-width: 960px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .main {
        order: -1;
    }

    .side {
        position: static;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 14.5px;
    }

    .site-header {
        padding: 10px 12px 0;
    }

    .nav-shell {
        height: 58px;
        padding: 8px 10px;
        gap: 6px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .nav-link {
        height: 38px;
        padding: 0 11px;
    }

    .nav-link .nav-text,
    .chip-btn .chip-text {
        display: none;
    }

    .chip-btn {
        width: 38px;
        height: 38px;
        padding: 0;
    }

    .page {
        padding: 14px 12px 20px;
    }

    .layout {
        gap: 14px;
    }

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

    .card-main {
        padding: 20px 16px 22px;
    }

    .card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card-head h1,
    .card-head h2 {
        font-size: 20px;
    }

    .segmented {
        display: flex;
    }

    .segmented [role="tab"] {
        flex: 1;
        padding: 0 10px;
    }

    .stepper {
        padding: 12px;
    }

    .step {
        font-size: 12px;
        gap: 7px;
        white-space: nowrap;
    }

    /* 窄屏只显示当前步骤的文字，其余步骤只留圆点，避免换行挤压 */
    .step:not(.active) > span:last-child {
        display: none;
    }

    .step-num {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .step-line {
        margin: 0 6px;
    }

    .input-row {
        flex-direction: column;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none !important;
        gap: 10px;
    }

    .input-row .input {
        border: 1px solid var(--border-strong);
        background: var(--surface);
        padding: 12px 16px;
    }

    .input-row .input:focus {
        border-color: var(--focus);
        box-shadow: var(--ring) !important;
    }

    .input-row .btn {
        height: 46px;
        width: 100%;
    }

    .input-row-prefix {
        flex-direction: row;
        gap: 6px;
        padding: 4px;
        border: 1px solid var(--border-strong);
        background: var(--surface);
    }

    .input-row-prefix .input {
        border: 0;
        background: transparent;
        padding: 10px 8px;
    }

    .input-row-prefix .input:focus {
        box-shadow: none !important;
    }

    .product-card {
        flex-wrap: wrap;
    }

    .product-cdk {
        width: 100%;
        text-align: left;
    }

    .verified-box,
    .kv-grid {
        grid-template-columns: 1fr;
    }

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

    .account-card {
        padding: 14px;
    }

    .avatar {
        width: 48px;
        height: 48px;
        font-size: 19px;
    }

    .progress-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .result-hero {
        padding: 22px 14px;
    }

    .site-footer {
        padding: 0 12px 24px;
    }
}

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