/* ============================================================
 * Tervion Pay — 功能服务视觉规范
 * 来源：glass-20261027（官网共用值 + 功能服务补充设计）
 * 本文件仅服务前台兑换页、发票助手与后台登录页。
 * ============================================================ */

:root {
    /* 官网共用变量 */
    --surface: #171e20;
    --raised: #252e30;
    --ink: #f1f3ef;
    --muted: #bbc5c2;
    --line: #556461;
    --mint: #d0e98d;
    --paper: #e8eceb;
    --ease: cubic-bezier(.22, 1, .36, 1);

    /* 官网语义别名 */
    --td-primary-text: #202819;
    --td-primary-hover: #e4f5b6;
    --td-secondary-hover: #36423b;
    --td-control-border: #8c9b8c;
    --td-footer-text: #8f9e93;
    --td-logo-bg: #f4f7fa;
    --td-font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Microsoft YaHei", sans-serif;
    --td-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;

    /* 功能服务补充建议 */
    --td-content-max: 1000px;
    --td-page-gutter: 24px;
    --td-card-padding: 24px;
    --td-space-1: 4px;
    --td-space-2: 8px;
    --td-space-3: 12px;
    --td-space-4: 16px;
    --td-space-6: 24px;
    --td-space-8: 32px;
    --td-radius-control: 4px;
    --td-radius-panel: 6px;
    --td-disabled-bg: #252e30;
    --td-disabled-text: #bbc5c2;
    --td-disabled-border: #556461;
    --td-error: #ff8f86;
    --td-error-bg: #362527;
    --td-warning: #e5b668;
    --td-warning-bg: #332b1e;
    --td-success: #b9df9f;
    --td-success-bg: #263528;
    --td-chart-1: #d0e98d;
    --td-chart-2: #8fc9d1;
    --td-chart-3: #e5b668;
    --td-chart-4: #d6b2e8;
    --td-duration-ui: 160ms;

    /* 兼容现有类名与 JS 状态类的语义映射 */
    --primary: var(--mint);
    --primary-hover: var(--td-primary-hover);
    --primary-soft: var(--td-success-bg);
    --primary-glow: rgba(208, 233, 141, 0.18);
    --accent: var(--mint);
    --accent-soft: var(--td-success-bg);
    --accent-glow: rgba(208, 233, 141, 0.18);
    --bg-page: var(--surface);
    --bg-dark: var(--surface);
    --surface-hover: var(--td-secondary-hover);
    --glass: var(--raised);
    --glass-border: var(--line);
    --border-strong: var(--td-control-border);
    --divider: var(--line);
    --text-main: var(--ink);
    --text-secondary: var(--muted);
    --text-dim: var(--muted);
    --text-muted: var(--td-footer-text);
    --success: var(--td-success);
    --success-soft: var(--td-success-bg);
    --error: var(--td-error);
    --error-soft: var(--td-error-bg);
    --warning: var(--td-warning);
    --warning-soft: var(--td-warning-bg);
    --info: var(--td-chart-2);
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: none;
    --shadow-focus: 0 0 0 4px rgba(208, 233, 141, 0.18);
    --radius-sm: 3px;
    --radius: var(--td-radius-control);
    --radius-lg: var(--td-radius-panel);
    --radius-xl: var(--td-radius-panel);
}

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

html {
    color-scheme: dark;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--surface);
    font-family: var(--td-font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

h1 {
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 600;
    line-height: 1.25;
}

h2 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.35;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

p {
    margin: 0 0 16px;
}

a {
    color: var(--mint);
    text-underline-offset: 4px;
}

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

img,
svg {
    max-width: 100%;
}

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

::selection {
    color: #0c0e0f;
    background: var(--mint);
}

code {
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--mint);
    background: var(--surface);
    font-family: var(--td-font-mono);
    font-size: 0.92em;
    overflow-wrap: anywhere;
}

/* ============ 布局与品牌页头 ============ */

.td-container {
    width: min(var(--td-content-max), calc(100% - 2 * var(--td-page-gutter)));
    margin-inline: auto;
    min-width: 0;
}

.td-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.td-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    min-height: 68px;
    padding-block: 10px;
}

.td-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--ink);
    text-decoration: none;
}

.td-brand-logo {
    display: block;
    width: 40px;
    height: 40px;
    padding: 4px;
    border-radius: 6px;
    background: var(--td-logo-bg);
    object-fit: contain;
    flex: none;
}

.td-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.td-brand-name {
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
}

.td-brand-accent {
    color: var(--mint);
}

.td-brand-service {
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.td-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 20px;
}

.td-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.td-nav a:hover,
.td-nav a[aria-current] {
    color: var(--ink);
    border-bottom-color: var(--mint);
}

.page-shell {
    width: min(var(--td-content-max), calc(100% - 2 * var(--td-page-gutter)));
    margin-inline: auto;
    padding: 24px 0 48px;
}

.td-footer {
    margin-top: 32px;
    padding-block: 20px;
    border-top: 1px solid var(--line);
    color: var(--td-footer-text);
    font-size: 14px;
}

.td-footer .td-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 16px;
}

/* ============ 页面标题与营销区块 ============ */

.site-hero {
    margin-bottom: 24px;
    text-align: left;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--mint);
    background: transparent;
    font-size: 13px;
    font-weight: 600;
}

.site-hero h1 {
    margin: 12px 0 8px;
    font-size: clamp(24px, 2.5vw, 32px);
    font-weight: 600;
    line-height: 1.25;
}

.hero-subtitle {
    max-width: 65ch;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.feature-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    box-shadow: none;
}

.feature-badge svg {
    width: 15px;
    height: 15px;
    color: var(--mint);
    flex: none;
}

.feature-badge.feature-link {
    text-decoration: none;
    transition: border-color var(--td-duration-ui), color var(--td-duration-ui);
}

.feature-badge.feature-link:hover {
    color: var(--ink);
    border-color: var(--mint);
}

.plan-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.plan-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-panel);
    background: var(--raised);
    box-shadow: none;
}

.plan-card.highlight {
    border-color: var(--mint);
    background: var(--raised);
}

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

.plan-card h3 {
    font-size: 16px;
    font-weight: 600;
}

.plan-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.plan-tag {
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--muted);
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.plan-tag.pro {
    border-color: var(--mint);
    color: var(--mint);
    background: var(--td-success-bg);
}

.region-hint {
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 14px;
    text-align: left;
}

/* ============ 表单卡片 ============ */

.recharge-card,
.subscription-card {
    width: min(100%, 760px);
    margin-inline: auto;
    padding: var(--td-card-padding);
    border: 1px solid var(--line);
    border-radius: var(--td-radius-panel);
    background: var(--raised);
    box-shadow: none;
}

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

.card-head h2 {
    margin-bottom: 4px;
    font-size: 20px;
    font-weight: 600;
}

.card-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.field-hint {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

input,
textarea,
select {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--td-control-border);
    border-radius: var(--td-radius-control);
    color: var(--ink);
    background: var(--surface);
    font-size: 16px;
    line-height: 1.5;
    box-shadow: none;
    outline: none;
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--ink);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--mint);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 1;
}

input:disabled,
textarea:disabled,
select:disabled {
    color: var(--td-disabled-text);
    background: var(--td-disabled-bg);
    border-color: var(--td-disabled-border);
    cursor: not-allowed;
    opacity: 1;
}

textarea {
    min-height: 140px;
    line-height: 1.6;
    resize: vertical;
}

#tokenInput,
#sessionInput {
    min-height: 160px;
    padding-bottom: 52px;
}

.textarea-wrapper {
    position: relative;
    display: flex;
    width: 100%;
}

.get-token-btn-floating {
    position: absolute;
    right: 10px;
    bottom: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--mint);
    border-radius: 3px;
    color: var(--td-primary-text) !important;
    background: var(--mint);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: none;
    user-select: none;
    transition: background-color var(--td-duration-ui), border-color var(--td-duration-ui);
}

.get-token-btn-floating:hover {
    border-color: var(--td-primary-hover);
    color: var(--td-primary-text) !important;
    background: var(--td-primary-hover);
}

.get-token-btn-floating:focus-visible {
    outline: 2px solid var(--mint);
    outline-offset: 3px;
}

.get-token-btn-floating svg {
    width: 14px;
    height: 14px;
}

/* ============ 按钮 ============ */

button,
.btn-primary,
.btn-secondary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    max-width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--td-control-border);
    border-radius: 3px;
    color: var(--ink);
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
    box-shadow: none;
    transition:
        background-color var(--td-duration-ui),
        border-color var(--td-duration-ui),
        color var(--td-duration-ui);
}

button:hover,
.btn-secondary:hover {
    color: var(--ink);
    background: var(--td-secondary-hover);
}

.btn-primary {
    border-color: var(--mint);
    color: var(--td-primary-text);
    background: var(--mint);
}

.btn-primary:hover {
    border-color: var(--td-primary-hover);
    color: var(--td-primary-text);
    background: var(--td-primary-hover);
}

button:active,
.btn-primary:active,
.btn-secondary:active {
    transform: none;
}

button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
button[aria-disabled="true"] {
    border-color: var(--td-disabled-border);
    color: var(--td-disabled-text);
    background: var(--td-disabled-bg);
    cursor: not-allowed;
    opacity: 1;
}

.btn-lg {
    min-height: 48px;
    padding: 12px 18px;
    font-size: 16px;
}

button.is-loading .btn-text {
    opacity: 0.85;
}

.action-link-btn {
    width: 100%;
    text-decoration: none;
}

.action-link-btn:hover {
    color: var(--td-primary-text);
}

.loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex: none;
}

button.is-loading .loader {
    display: block;
}

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

/* ============ 状态、徽标与提示 ============ */

.flow-badge,
.td-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.flow-badge.pending {
    color: var(--muted);
    border-color: var(--line);
    background: var(--surface);
}

.flow-badge.cdk_ok {
    color: var(--muted);
    border-color: var(--line);
    background: var(--surface);
}

.flow-badge.running {
    color: var(--mint);
    border-color: var(--mint);
    background: var(--td-success-bg);
}

.flow-badge.success {
    color: var(--td-success);
    border-color: var(--td-success);
    background: var(--td-success-bg);
}

.flow-badge.failed,
.flow-badge.manual {
    color: var(--td-error);
    border-color: var(--td-error);
    background: var(--td-error-bg);
}

.status-message {
    display: none;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-control);
    color: var(--ink);
    background: var(--surface);
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    overflow-wrap: anywhere;
}

.status-message.success {
    color: var(--td-success);
    border-color: var(--td-success);
    background: var(--td-success-bg);
}

.status-message.error {
    color: var(--td-error);
    border-color: var(--td-error);
    background: var(--td-error-bg);
}

.status-message.status-success {
    color: var(--td-success);
    border-color: var(--td-success);
    background: var(--td-success-bg);
}

.status-message.status-error {
    color: var(--td-error);
    border-color: var(--td-error);
    background: var(--td-error-bg);
}

.status-message.status-info {
    color: var(--ink);
    border-color: var(--line);
    background: var(--surface);
}

.status-success {
    color: var(--td-success);
    background: var(--td-success-bg);
    border: 1px solid var(--td-success);
}

.status-error {
    color: var(--td-error);
    background: var(--td-error-bg);
    border: 1px solid var(--td-error);
}

.status-unused { color: var(--td-success) !important; }
.status-used { color: var(--td-error) !important; }
.status-processing { color: var(--td-warning) !important; }

.notice-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-control);
    background: var(--surface);
}

.notice-banner svg {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--mint);
    flex: none;
}

.notice-banner p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.notice-box {
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid var(--td-warning);
    border-radius: var(--td-radius-control);
    background: var(--td-warning-bg);
}

.notice-box p,
.notice-box b {
    color: var(--td-warning) !important;
    font-size: 14px !important;
    line-height: 1.6;
}

.cdk-confirmed,
.plan-confirmed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: var(--td-radius-control);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.cdk-confirmed {
    border: 1px solid var(--td-success);
    color: var(--td-success);
    background: var(--td-success-bg);
}

.cdk-confirmed code {
    border-color: var(--td-success);
    color: var(--td-success);
    background: transparent;
}

.plan-confirmed {
    border: 1px solid var(--mint);
    color: var(--mint);
    background: var(--td-success-bg);
}

/* ============ 步骤与标签页 ============ */

.stepper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-control);
    background: var(--surface);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--td-control-border);
    border-radius: 50%;
    color: var(--muted);
    background: var(--surface);
    font-size: 12px;
    font-weight: 700;
    flex: none;
}

.step-item.active .step-num {
    border-color: var(--mint);
    color: var(--td-primary-text);
    background: var(--mint);
}

.step-item.done .step-num {
    border-color: var(--td-success);
    color: var(--td-primary-text);
    background: var(--td-success);
}

.step-item.active,
.step-item.done {
    color: var(--ink);
}

.step-line {
    width: 36px;
    height: 1px;
    margin: 0 8px;
    background: var(--line);
    flex: none;
}

.tab-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-control);
    background: var(--surface);
}

.tab-btn {
    flex: 1;
    min-height: 44px;
    padding: 8px 16px;
    border: 0;
    border-radius: 3px;
    color: var(--muted);
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
}

.tab-btn:hover {
    color: var(--mint);
    background: #ffffff1c;
}

.tab-btn.active {
    color: var(--mint);
    background: #ffffff1c;
    box-shadow: inset 0 -2px var(--mint);
}

.tab-btn:disabled {
    color: var(--td-disabled-text);
    background: transparent;
}

/* ============ 进度 ============ */

.task-progress {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-control);
    background: var(--surface);
}

.task-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

.task-progress-header b {
    color: var(--ink);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.task-progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--surface);
}

.task-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--mint);
    transition: width 160ms var(--ease);
}

.task-progress-bar.error {
    background: var(--td-error);
}

.task-progress-text {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

/* ============ 查询结果 ============ */

.query-result-card {
    padding: 4px 14px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-control);
    background: var(--surface);
    text-align: left;
}

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

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

.query-row span {
    color: var(--muted);
    white-space: nowrap;
}

.query-row strong {
    min-width: 0;
    color: var(--ink);
    font-family: var(--td-font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

/* ============ 运行状态面板 ============ */

.public-runtime-panel {
    width: min(100%, 760px);
    margin: 20px auto 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-control);
    background: var(--surface);
    box-shadow: none;
}

.public-runtime-layout {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

.public-runtime-title {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.public-runtime-value {
    color: var(--ink);
    font-size: 24px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: left;
}

.public-runtime-meta {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.public-slot-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
}

.public-slot-box {
    height: 10px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--surface);
}

.public-slot-box.occupied {
    border-color: var(--mint);
    background: var(--mint);
}

.public-runtime-panel.load-low .public-runtime-value {
    color: var(--td-success);
}

.public-runtime-panel.load-mid .public-runtime-value {
    color: var(--td-warning);
}

.public-runtime-panel.load-mid .public-slot-box.occupied {
    border-color: var(--td-warning);
    background: var(--td-warning);
}

.public-runtime-panel.load-high .public-runtime-value {
    color: var(--td-error);
}

.public-runtime-panel.load-high .public-slot-box.occupied {
    border-color: var(--td-error);
    background: var(--td-error);
}

/* ============ 常见问题 / 发票助手 ============ */

.faq-panel,
.subscription-guide-panel {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-control);
    background: var(--surface);
    color: var(--muted);
    box-shadow: none;
}

.faq-panel summary,
.subscription-guide-panel summary {
    padding-block: 10px;
    cursor: pointer;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.faq-panel ul {
    margin: 12px 0 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

.subscription-guide-panel[open] summary {
    margin-bottom: 12px;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 16px 0;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.guide-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: var(--td-primary-text);
    background: var(--mint);
    font-size: 13px;
    font-weight: 700;
    flex: none;
}

.guide-step h3 {
    margin-bottom: 4px;
    font-size: 16px;
}

.guide-step p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.subscription-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subscription-query-section {
    margin-top: 4px;
}

.subscription-field-hint {
    margin-top: 8px;
    margin-bottom: 14px;
}

.subscription-query-actions button {
    width: 100%;
}

.subscription-result {
    margin-top: 18px;
}

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

.subscription-result-head h2 {
    margin: 0;
    font-size: 18px;
}

.subscription-billing-actions {
    margin-top: 14px;
}

.back-home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
}

.back-home-link:hover {
    color: var(--ink);
}

.compact-hero {
    margin-bottom: 20px;
}

/* ============ 后台登录页 ============ */

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--surface);
}

.login-page .card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-panel);
    background: var(--raised);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.login-brand .td-brand-logo {
    width: 44px;
    height: 44px;
}

.login-page h1 {
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 600;
}

.login-page p {
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.login-page label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.login-page input {
    margin-bottom: 14px;
}

.login-page .step > button {
    width: 100%;
    margin-top: 6px;
    border-color: var(--mint);
    color: var(--td-primary-text);
    background: var(--mint);
}

.login-page .step > button:hover {
    border-color: var(--td-primary-hover);
    color: var(--td-primary-text);
    background: var(--td-primary-hover);
}

.login-page .step > button.secondary {
    border-color: var(--td-control-border);
    color: var(--ink);
    background: transparent;
}

.login-page .step > button.secondary:hover {
    border-color: var(--td-control-border);
    color: var(--ink);
    background: var(--td-secondary-hover);
}

.login-page .method-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--td-radius-control);
    background: var(--surface);
}

.login-page .method-tab {
    flex: 1;
    min-height: 40px;
    margin: 0;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 3px;
    color: var(--muted);
    background: transparent;
    font-size: 13px;
    font-weight: 600;
}

.login-page .method-tab.active {
    border-color: var(--mint);
    color: var(--mint);
    background: #ffffff1c;
}

.login-page .method-single {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid var(--td-success);
    border-radius: var(--td-radius-control);
    color: var(--td-success);
    background: var(--td-success-bg);
    font-size: 13px;
    font-weight: 600;
}

.login-page .method-hint {
    margin: -6px 0 14px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.login-page .message {
    min-height: 22px;
    margin-top: 14px;
    color: var(--td-error);
    font-size: 13px;
}

.login-page .message:not(:empty) {
    padding: 10px 12px;
    border: 1px solid var(--td-error);
    border-radius: var(--td-radius-control);
    background: var(--td-error-bg);
}

.login-page .message.success {
    color: var(--td-success);
}

.login-page .message.success:not(:empty) {
    border-color: var(--td-success);
    background: var(--td-success-bg);
}

.login-page .hint {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.login-page .step {
    display: none;
}

.login-page .step.active {
    display: block;
}

/* ============ 响应式 ============ */

@media (max-width: 800px) {
    :root {
        --td-page-gutter: 20px;
        --td-card-padding: 20px;
    }

    .plan-showcase {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .td-header-row {
        align-items: flex-start;
    }

    .page-shell {
        padding-top: 20px;
    }
}

@media (max-width: 540px) {
    :root {
        --td-page-gutter: 16px;
        --td-card-padding: 16px;
    }

    .td-brand-name {
        font-size: 18px;
    }

    .td-brand-logo {
        width: 36px;
        height: 36px;
    }

    .td-nav {
        gap: 0 16px;
    }

    .site-hero h1 {
        font-size: 24px;
    }

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

    .step-label {
        font-size: 12px;
    }

    .step-line {
        width: 20px;
    }

    .subscription-query-actions button,
    .input-group > button {
        width: 100%;
    }

    .td-footer .td-container {
        flex-direction: column;
    }
}

@media (max-width: 370px) {
    .td-brand-service {
        display: none;
    }

    .td-brand-name {
        font-size: 17px;
    }

    .feature-badge {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0s !important;
    }
}

/* ============ glass-20261027：功能服务视觉扩展 ============ */
:root {
    --surface: #343532;
    --raised: #454442;
    --ink: #f6f5ec;
    --muted: #d2d0c8;
    --line: #ffffff30;
    --mint: #f5f6df;
    --paper: #efeee4;
    --td-primary-text: #30312b;
    --td-primary-hover: #fffef1;
    --td-secondary-hover: #ffffff20;
    --td-control-border: #e1e1d58c;
    --td-footer-text: #d2d0c8;
    --td-logo-bg: #efeee4;
    --td-content-max: 1240px;
    --td-radius-control: 12px;
    --td-radius-panel: 26px;
    --td-disabled-bg: #454442;
    --td-disabled-text: #c0bfb7;
    --td-disabled-border: #ffffff40;
    --td-chart-1: #f5f6df;
    --primary-glow: #f5f6df1f;
    --accent-glow: #f5f6df1f;
    --shadow-focus: 0 0 0 4px #f5f6df20;
    --radius-sm: 8px;
    --td-duration-ui: 200ms;
}

html { scroll-padding-top: 110px; }

body {
    isolation: isolate;
    background: #292827;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 2% 52%, #8b665a80, transparent 48%),
        radial-gradient(ellipse at 93% 13%, #c5cec26b, transparent 46%),
        radial-gradient(ellipse at 68% 95%, #a6a49a38, transparent 42%),
        linear-gradient(130deg, #322c2b, #242626 70%);
}

:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #f5f6df;
    outline-offset: 4px;
}

.td-header {
    top: 12px;
    width: min(1440px, calc(100% - 64px));
    margin: 24px auto 0;
    border: 1px solid #ffffff38;
    border-radius: 28px;
    background: #41413fe8;
    box-shadow: inset 0 1px #ffffff24, 0 12px 40px #0000001f;
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
}
.td-header.is-scrolled { background: #363735f5; }

.td-header-row {
    width: 100%;
    min-height: 72px;
    padding: 12px 24px;
    flex-wrap: nowrap;
}

.td-brand-logo {
    border-radius: 50%;
    padding: 6px;
}

.td-brand-name { font-size: 21px; }

.td-nav {
    gap: 2px;
    padding: 5px;
    border: 1px solid #ffffff2e;
    border-radius: 999px;
    background: linear-gradient(#ffffff1c, #ffffff08);
    box-shadow: inset 0 1px #ffffff1c;
}

.td-nav a {
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    color: #eeede6;
    font-size: 14px;
    line-height: 1.4;
    transition: background-color .2s, color .2s;
}

.td-nav a:hover { color: #f6f5ec; background: #ffffff1c; }
.td-nav a[aria-current] { color: #30312b; background: #f5f6df; }
.td-mobile-menu { display: none; position: relative; flex: none; }
.td-mobile-menu summary { list-style: none; cursor: pointer; }
.td-mobile-menu summary::-webkit-details-marker { display: none; }

.page-shell {
    width: min(1440px, calc(100% - 64px));
    margin: 24px auto 0;
    padding: 40px clamp(28px, 4vw, 64px) 48px;
    border: 1px solid #ffffff38;
    border-radius: 40px;
    background: linear-gradient(145deg, #ffffff12, #ffffff04), #3c3d3bc9;
    box-shadow: inset 0 1px #ffffff24, 0 32px 80px #0003;
}

.td-footer {
    width: min(1440px, calc(100% - 64px));
    margin: 16px auto 0;
    padding: 10px 0 32px;
    border: 0;
}
.td-footer .td-container { width: 100%; padding-inline: 24px; }

body.recharge-page .site-hero { max-width: 100%; }
body.recharge-page p { overflow-wrap: anywhere; }
body.recharge-page .hero-compact h1,
body.recharge-page .site-hero h1 {
    margin: 10px 0 12px;
    font-size: clamp(28px, 3.1vw, 40px);
    font-weight: 500;
    line-height: 1.16;
    letter-spacing: -.025em;
}
body.recharge-page .hero-kicker { color: var(--mint); letter-spacing: .06em; }
body.recharge-page .hero-subtitle { max-width: 75ch; line-height: 1.75; }
body.recharge-page .feature-badge {
    min-height: 32px;
    padding: 5px 11px;
    border: 1px solid #ffffff36;
    border-radius: 999px;
    color: #eeede4;
    background: #ffffff08;
}

.recharge-card,
.subscription-card,
body.recharge-page .side-card,
.login-page .card,
.plan-card {
    border: 1px solid #ffffff30;
    border-radius: 26px;
    background: linear-gradient(145deg, #ffffff17, #ffffff08);
    box-shadow: inset 0 1px #ffffff20, 0 10px 26px #0000000d;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.recharge-card, .subscription-card { padding: 28px; }
body.recharge-page .side-card { padding: 24px; }
body.recharge-page .front-side .faq-panel { padding: 24px; background: linear-gradient(145deg, #ffffff17, #ffffff08); }
body.recharge-page .card-head h2 { font-weight: 500; font-size: 22px; }
body.recharge-page .side-card-head h2 { font-size: 17px; font-weight: 500; }

body.recharge-page .support-strip { padding-block: 14px 20px; border-color: #ffffff30; }
body.recharge-page .plan-chip { background: #ffffff0c; border-color: #ffffff30; }
body.recharge-page .recharge-modes { gap: 12px; }
body.recharge-page .recharge-mode {
    min-height: 76px;
    justify-content: flex-start;
    padding: 16px 20px;
    border: 1px solid #ffffff30;
    border-radius: 20px;
    background: #ffffff08;
    box-shadow: inset 0 1px #ffffff12;
}
body.recharge-page .recharge-mode.active {
    border-color: #f5f6dfb3;
    background: #ffffff1f;
    box-shadow: inset 0 1px #ffffff30;
}
body.recharge-page .mode-badge { width: 34px; height: 34px; }
body.recharge-page .recharge-mode.active .mode-badge { color: #30312b; background: #f5f6df; }
body.recharge-page .mode-copy strong { font-size: 15px; }
body.recharge-page .mode-copy small { font-size: 13px; }
body.recharge-page .flow-note { border-radius: 0 12px 12px 0; background: #272826aa; }
body.recharge-page .credit-auth-tabs { border-radius: 999px; background: #292a28; }
body.recharge-page .credit-auth-tab { border-radius: 999px; }
body.recharge-page .credit-auth-tab.active {
    color: #30312b;
    background: #f5f6df;
    box-shadow: none;
}
body.recharge-page .table-scroll { max-width: 100%; overflow-x: auto; }

input, textarea, select { background: #292a28; border-radius: 12px; }
input:disabled, textarea:disabled, select:disabled { background: #454442; }
button, .btn-primary, .btn-secondary, .get-token-btn-floating {
    min-height: 46px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
}
.btn-secondary { background: #ffffff08; }
.btn-primary, .login-page .step > button:not(.secondary) { background: #f5f6df; color: #30312b; }
.btn-primary:hover, .login-page .step > button:not(.secondary):hover { background: #fffef1; color: #30312b; }
button:disabled, .btn-primary:disabled, .btn-secondary:disabled { background: #454442; color: #c0bfb7; }
.get-token-btn-floating { min-height: 38px; }
.flow-badge, .td-badge, .plan-tag { border-radius: 999px; }
.task-progress, .stepper, .notice-banner, .query-result-card,
.faq-panel, .subscription-guide-panel, .credit-account-bar { border-radius: 16px; }
.task-progress, .stepper, .notice-banner, .query-result-card { background: #292a28cc; }
.task-progress-track { border-radius: 999px; overflow: hidden; }
.task-progress-bar { border-radius: inherit; }
.login-page { background: transparent; }
.login-page .card { padding: 32px; }
.login-page .method-tabs { border-radius: 999px; }
.login-page .method-tab { border-radius: 999px; }
.login-page .method-tab.active { color: #30312b; background: #f5f6df; }

@media (hover: hover) and (pointer: fine) {
    body.recharge-page .recharge-mode:hover { border-color: #f5f6dfb3; background: #ffffff1f; }
}

@media (max-width: 1319px) {
    .td-desktop-nav { display: none; }
    .td-mobile-menu { display: block; }
    .td-mobile-menu summary {
        display: inline-flex;
        align-items: center;
        gap: 12px;
        min-height: 44px;
        padding: 8px 15px;
        border: 1px solid #ffffff38;
        border-radius: 999px;
        background: #ffffff0d;
        color: #f6f5ec;
        font-size: 14px;
    }
    .td-mobile-menu[open] summary { background: #ffffff20; }
    .td-mobile-menu .td-nav {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        min-width: 190px;
        padding: 8px;
        border-radius: 20px;
        background: #41423ff5;
        box-shadow: 0 12px 40px #0004;
    }
    .td-mobile-menu .td-nav a { min-height: 44px; }
}

@media (max-width: 800px) {
    .td-header-row { align-items: center; }
    .page-shell { padding: 30px 24px 36px; border-radius: 32px; }
    body.recharge-page .front-grid { gap: 16px; }
    body.recharge-page .recharge-card, body.recharge-page .side-card { padding: 22px; }
}

@media (max-width: 540px) {
    html { scroll-padding-top: 88px; }
    .td-header, .page-shell, .td-footer { width: calc(100% - 20px); }
    .td-header { top: 8px; margin-top: 10px; border-radius: 20px; }
    .td-header-row { min-height: 64px; padding: 8px 14px; }
    .td-brand-name { font-size: 18px; }
    .page-shell { margin-top: 12px; padding: 24px 18px 28px; border-radius: 28px; }
    body.recharge-page .hero-compact h1, body.recharge-page .site-hero h1 { font-size: 28px; }
    body.recharge-page .feature-badge { width: auto; }
    body.recharge-page .recharge-mode { min-height: 68px; }
    .td-footer .td-container { padding-inline: 12px; }
    button, .btn-primary, .btn-secondary { min-height: 44px; font-size: 14px; }
}

@media (max-width: 370px) {
    .td-brand-name { font-size: 16px; }
    .td-brand { gap: 8px; }
    body.recharge-page .hero-compact h1, body.recharge-page .site-hero h1 { font-size: 26px; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .td-header, .td-header.is-scrolled, .page-shell { background: #41413f; }
}

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