/*!
 * XpnPortal 主题样式（原生 CSS，无需构建）
 */

/* ---------------------------------------------------------------- *
 * 设计变量与基础
 * ---------------------------------------------------------------- */

:root {
    color-scheme: dark;

    --bg: #0f1115;
    --bg-soft: #13161d;
    --card: #191e28;
    --card-2: #1f2531;
    --border: #262c3a;
    --border-strong: #333b4d;
    --text: #e6e8eb;
    --text-soft: #c3c8d1;
    --muted: #8b93a3;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-soft: rgba(59, 130, 246, 0.14);
    --primary-on-soft: #3b82f6;
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.14);
    --warn: #f59e0b;
    --warn-soft: rgba(245, 158, 11, 0.14);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --danger-solid: #ef4444;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --header-h: 64px;
    --container: 1140px;
    /* iOS 安全区：刘海屏 / 底部 Home 指示条，避免页脚与浮层被遮挡 */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --footer-bg: rgba(10, 12, 16, 0.6);
    --footer-link-bg: var(--hover);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    /* 主题化辅助变量：明暗两套取值，避免散落硬编码色值 */
    --body-glow: rgba(59, 130, 246, 0.14);
    --header-bg: rgba(15, 17, 21, 0.82);
    --spinner-track: rgba(255, 255, 255, 0.15);
    --hover: rgba(255, 255, 255, 0.04);
    --hover-strong: rgba(255, 255, 255, 0.06);
    --hover-stronger: rgba(255, 255, 255, 0.07);
    --fill-subtle: rgba(255, 255, 255, 0.015);
    --fill-soft: rgba(255, 255, 255, 0.03);
    --btn-solid: #262e3b;
    --field-bg: #12161e;
    --code-bg: #0c0f14;
    --placeholder: #6b7383;
    --link-hover: #60a5fa;
    --border-soft: rgba(38, 44, 58, 0.6);
    --overlay: rgba(5, 7, 10, 0.72);
    --modal-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    --on-primary: #fff;
    --tag-text: var(--muted);
}

[data-theme="light"] {
    color-scheme: light;

    --bg: #f5f7fb;
    --bg-soft: #ffffff;
    --card: #ffffff;
    --card-2: #f1f4f9;
    --border: #e2e7f0;
    --border-strong: #ccd4e2;
    --text: #1a2130;
    --text-soft: #3d4759;
    /* 次要文字加深，保证在 card-2 / bg 这类浅灰底上仍 ≥ 4.5:1 */
    --muted: #5d6577;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.1);
    /* primary-soft 底上的文字色：需比 --primary 再深一档才够 4.5:1 */
    --primary-on-soft: #1d4ed8;
    /* 语义色文字统一加深一档：软色底(badge/alert)上的正文对比度需 ≥ 4.5:1 */
    --success: #116c34;
    --success-soft: rgba(21, 128, 61, 0.1);
    --warn: #8f4208;
    --warn-soft: rgba(180, 83, 9, 0.1);
    --danger: #b91c1c;
    --danger-soft: rgba(220, 38, 38, 0.09);
    /* 实心按钮背景独立取值，避免与「文字用语义色」互相牵制 */
    --danger-solid: #dc2626;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);

    --body-glow: rgba(59, 130, 246, 0.1);
    --header-bg: rgba(255, 255, 255, 0.86);
    --spinner-track: rgba(15, 23, 42, 0.12);
    --hover: rgba(15, 23, 42, 0.045);
    --hover-strong: rgba(15, 23, 42, 0.06);
    --hover-stronger: rgba(15, 23, 42, 0.08);
    --fill-subtle: rgba(15, 23, 42, 0.015);
    --fill-soft: rgba(15, 23, 42, 0.03);
    --btn-solid: #e7ecf5;
    --field-bg: #ffffff;
    --code-bg: #f6f8fc;
    --placeholder: #98a1b3;
    --link-hover: #1d4ed8;
    --border-soft: rgba(226, 231, 240, 0.9);
    --overlay: rgba(15, 23, 42, 0.45);
    --modal-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    --on-primary: #fff;

    --footer-bg: #eef1f7;
    --footer-link-bg: rgba(15, 23, 42, 0.05);
}

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

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

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 50% -200px, var(--body-glow), transparent 70%) no-repeat,
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body.modal-open,
body.nav-open {
    overflow: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--link-hover);
}

img {
    max-width: 100%;
    display: block;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--text);
    line-height: 1.3;
    font-weight: 650;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 26px;
}

h2 {
    font-size: 18px;
}

h3 {
    font-size: 16px;
}

p {
    margin: 0 0 8px;
}

p:last-child {
    margin-bottom: 0;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

code,
.mono {
    font-family: var(--mono);
    font-size: 13px;
}

::selection {
    background: rgba(59, 130, 246, 0.35);
}

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

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.danger-text {
    color: var(--danger) !important;
}

/* ---------------------------------------------------------------- *
 * 启动 / 加载态
 * ---------------------------------------------------------------- */

.boot-loading,
.page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
}

.boot-loading {
    min-height: 100vh;
    flex-direction: column;
}

.page-loading {
    min-height: 50vh;
}

.boot-noscript {
    padding: 40px 20px;
    text-align: center;
    color: var(--warn);
}

.spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--spinner-track);
    border-top-color: var(--primary);
    animation: xpn-spin 0.8s linear infinite;
    display: inline-block;
}

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

/* ---------------------------------------------------------------- *
 * 顶部导航
 * ---------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: calc(var(--header-h) + var(--safe-top));
    padding-top: var(--safe-top);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 17px;
    white-space: nowrap;
}

.brand:hover {
    color: var(--text);
    opacity: 0.9;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: var(--on-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: contain;
    background: var(--card);
}

.brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.nav-link {
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 14px;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text);
    background: var(--hover);
}

.nav-link.active {
    color: var(--primary-on-soft);
    background: var(--primary-soft);
}

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

.nav-toggle {
    display: none;
    width: 38px;
    height: 38px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text-soft);
    cursor: pointer;
    /* iOS Safari 对 button 的 flex 布局与空 span 宽度支持不稳定：图标改用固定尺寸 SVG，按钮本身走块级布局 */
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle svg {
    display: block;
    width: 20px;
    height: 20px;
    margin: 0 auto;
    pointer-events: none;
}

.site-main {
    display: block;
    min-height: calc(100vh - var(--header-h) - var(--safe-top) - 200px);
}

/* ---------------------------------------------------------------- *
 * 按钮 / 标签 / 徽章 / 表单元素
 * ---------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--card-2);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 550;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.06s ease,
        opacity 0.15s ease;
}

.btn:hover {
    color: var(--text);
    background: var(--btn-solid);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

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

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

.btn.ghost {
    background: transparent;
    border-color: var(--border-strong);
    color: var(--text-soft);
}

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

.btn.danger {
    background: var(--danger-solid);
    border-color: var(--danger-solid);
    color: var(--on-primary);
}

.btn.danger:hover {
    filter: brightness(0.92);
}

.btn.sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
}

.btn.lg {
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 12px;
}

.btn.block {
    display: flex;
    width: 100%;
}

.link {
    color: var(--primary);
    font-size: 14px;
}

.link:hover {
    text-decoration: underline;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.icon-btn:hover {
    color: var(--text);
    background: var(--hover-strong);
}

/* 明暗主题切换按钮 */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
    color: var(--text);
    background: var(--hover);
}

.theme-toggle svg {
    display: block;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* 深色下显示太阳（点击切到明亮），明亮下显示月亮 */
.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--hover-strong);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 550;
    line-height: 1.7;
    white-space: nowrap;
}

.badge.info {
    background: var(--primary-soft);
    color: var(--primary-on-soft);
}

.badge.success {
    background: var(--success-soft);
    color: var(--success);
}

.badge.warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.badge.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge.muted {
    background: var(--hover-strong);
    color: var(--muted);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 1px 8px;
    border-radius: 6px;
    background: var(--hover);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--field-bg);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
    color: var(--placeholder);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.input[readonly] {
    color: var(--text-soft);
    background: var(--bg-soft);
}

/* ---------------------------------------------------------------- *
 * 通用布局工具
 * ---------------------------------------------------------------- */

.row {
    display: flex;
    align-items: center;
}

.row.gap {
    gap: 10px;
}

.row.wrap {
    flex-wrap: wrap;
}

.row.between {
    justify-content: space-between;
}

.span-2 {
    grid-column: span 2;
}

.hide-mobile {
    display: inline-flex;
}

.page {
    padding: 36px 20px 64px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.page-head h1 {
    font-size: 26px;
}

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

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.section {
    padding: 56px 0;
}

.section.alt {
    background: linear-gradient(180deg, transparent, var(--fill-subtle) 20%, transparent);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.section-head h2 {
    font-size: 22px;
}

.section-head p {
    margin: 4px 0 0;
    font-size: 14px;
}

/* ---------------------------------------------------------------- *
 * 卡片通用
 * ---------------------------------------------------------------- */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    min-width: 0;
}

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

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

.card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

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

.kv-grid.single {
    grid-template-columns: minmax(0, 1fr);
}

.kv {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-strong);
    font-size: 14px;
}

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

.kv-label {
    color: var(--muted);
    white-space: nowrap;
}

.kv-value {
    color: var(--text);
    text-align: right;
    word-break: break-all;
}

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

.stat-grid.five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 22px;
}

.stat-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text);
}

a.stat-tile:hover {
    color: var(--text);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-all;
}

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

/* ---------------------------------------------------------------- *
 * 空状态 / 提示条
 * ---------------------------------------------------------------- */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 36px 20px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--fill-subtle);
    text-align: center;
}

.empty-lg {
    padding: 72px 20px;
}

.empty-icon {
    color: var(--border-strong);
    font-size: 30px;
    line-height: 1.2;
    font-weight: 700;
}

.empty-lg .empty-icon {
    font-size: 44px;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-soft);
}

.empty-desc {
    margin: 0;
    max-width: 460px;
    color: var(--muted);
    font-size: 13.5px;
}

.empty-action {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 12px;
}

.alert {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text-soft);
    font-size: 13.5px;
    margin-bottom: 14px;
}

.alert.info {
    border-left-color: var(--primary);
    background: var(--primary-soft);
}

.alert.warn {
    border-left-color: var(--warn);
    background: var(--warn-soft);
    color: var(--warn);
}

.alert.danger {
    border-left-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
}

.alert.success {
    border-left-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
}

.form-error {
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    background: var(--danger-soft);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: var(--danger);
    font-size: 13.5px;
}

.form-error[hidden] {
    display: none;
}

/* ---------------------------------------------------------------- *
 * 首页 Hero
 * ---------------------------------------------------------------- */

.hero {
    position: relative;
    padding: 78px 0 64px;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -40% 30% auto;
    height: 420px;
    background: radial-gradient(closest-side, rgba(139, 92, 246, 0.22), transparent);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.hero-title {
    font-size: 42px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    max-width: 900px;
    word-break: break-word;
}

.hero-sub {
    max-width: 640px;
    color: var(--muted);
    font-size: 16px;
    margin: 0;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.hero-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    max-width: var(--container);
    margin: 0 auto 0;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    font-size: 14px;
}

/* ---------------------------------------------------------------- *
 * 套餐
 * ---------------------------------------------------------------- */

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.plan-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    position: relative;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.plan-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* 标签悬浮在卡片左上角，价格悬浮在右上角，二者同处顶部区域互不遮挡 */
.plan-badges {
    position: absolute;
    top: 14px;
    left: 16px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 55%;
    pointer-events: none;
}

.plan-badges .tag {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    border: 1px solid var(--primary);
    color: var(--primary-on-soft);
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.plan-price {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 2;
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: nowrap;
    max-width: 45%;
    justify-content: flex-end;
}

.plan-price .price {
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.02em;
    /* 价格落在卡片底色上，必须跟随正文色，不能写死白字 */
    color: var(--text);
    line-height: 1.1;
}

.plan-price .price-unit {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.plan-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* 顶部预留悬浮标签与价格的空间，避免标题被遮挡 */
    padding-top: 26px;
}

.plan-head h3 {
    font-size: 18px;
    word-break: break-word;
}

.spec-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}

.spec-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
}

.spec-list li::before {
    content: "✓";
    color: var(--success);
    font-size: 12px;
}

.period-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.chip {
    padding: 5px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--text);
}

.chip.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-on-soft);
}

.plan-content {
    color: var(--muted);
    font-size: 13.5px;
}

.plan-content img {
    border-radius: 8px;
}

.plan-card .btn.block {
    margin-top: auto;
}

/* ---------------------------------------------------------------- *
 * 公告 / 帮助文档列表
 * ---------------------------------------------------------------- */

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.notice-list,
.kb-list {
    display: flex;
    flex-direction: column;
}

.notice-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 14px;
}

.notice-item:last-child {
    border-bottom: 0;
}

.notice-item:hover {
    color: var(--text);
}

.notice-item:hover .notice-title {
    color: var(--primary);
}

.notice-date {
    flex: none;
    color: var(--muted);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
}

.notice-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-arrow {
    flex: none;
    color: var(--border-strong);
    transition: transform 0.15s ease, color 0.15s ease;
}

.notice-item:hover .notice-arrow,
.notice-card:hover .notice-arrow {
    transform: translateX(3px);
    color: var(--primary);
}

.notice-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.notice-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text);
    transition: border-color 0.18s ease, transform 0.18s ease;
}

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

.notice-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.notice-card h3 {
    font-size: 16px;
    word-break: break-word;
}

.notice-card p {
    color: var(--muted);
    font-size: 13.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 13px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    transition: color 0.15s ease;
}

.kb-card:last-child {
    border-bottom: 0;
}

.kb-head {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

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

.kb-card:hover .kb-title {
    color: var(--primary);
}

.kb-list .kb-card + .kb-card {
    margin-top: 2px;
}

.kb-cat {
    display: inline-block;
    margin-right: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--primary);
    font-size: 12px;
    line-height: inherit;
}

.kb-cat::after {
    content: "·";
    margin-left: 8px;
    color: var(--border-strong);
}

.kb-title {
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.45;
    word-break: break-word;
    transition: color 0.15s ease;
}

.kb-meta {
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
}

.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.kb-group {
    margin-bottom: 28px;
}

.kb-group > h2 {
    font-size: 16px;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}

.search-row {
    margin-bottom: 22px;
    max-width: 520px;
}

.back-link {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13.5px;
}

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

/* ---------------------------------------------------------------- *
 * 文章（公告 / 文档详情）
 * ---------------------------------------------------------------- */

.article {
    padding: 30px;
}

.article-head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.article-head h1 {
    font-size: 26px;
    word-break: break-word;
}

.article-body {
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.85;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
    margin: 24px 0 10px;
}

.article-body h1 {
    font-size: 22px;
}

.article-body h2 {
    font-size: 19px;
}

.article-body h3 {
    font-size: 16.5px;
}

.article-body p {
    margin: 0 0 12px;
}

.article-body ul,
.article-body ol {
    margin: 0 0 12px;
    padding-left: 22px;
}

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body li {
    margin: 4px 0;
}

.article-body a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body img {
    max-width: 100%;
    border-radius: 10px;
    margin: 8px 0;
}

.article-body blockquote {
    margin: 12px 0;
    padding: 8px 16px;
    border-left: 3px solid var(--border-strong);
    background: var(--fill-soft);
    border-radius: 0 8px 8px 0;
    color: var(--muted);
}

.article-body pre {
    margin: 12px 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--code-bg);
    overflow: auto;
    font-size: 13px;
    line-height: 1.6;
}

.article-body code {
    padding: 1px 6px;
    border-radius: 5px;
    background: var(--hover-stronger);
}

.article-body pre code {
    padding: 0;
    background: none;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13.5px;
}

.article-body th,
.article-body td {
    padding: 8px 10px;
    border: 1px solid var(--border);
    text-align: left;
}

.article-body th {
    background: var(--bg-soft);
}

.article-body hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ---------------------------------------------------------------- *
 * 登录 / 注册 / 找回密码
 * ---------------------------------------------------------------- */

.auth-page {
    display: flex;
    justify-content: center;
    padding-top: 56px;
    padding-bottom: 80px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 30px;
}

.auth-card h1 {
    font-size: 24px;
    margin-bottom: 6px;
}

.auth-card > p.muted {
    margin-bottom: 20px;
    font-size: 14px;
}

.auth-alt {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13.5px;
    color: var(--text-soft);
}

.field > span:first-child {
    color: var(--muted);
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
}

.form-row.between {
    justify-content: space-between;
    flex-wrap: wrap;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 13.5px;
    cursor: pointer;
    user-select: none;
}

.check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.input-row {
    display: flex;
    gap: 8px;
}

.input-row .input {
    flex: 1;
    min-width: 0;
}

/* ---------------------------------------------------------------- *
 * 人机验证（Turnstile / reCAPTCHA）
 * 容器负责留白与状态提示，第三方 iframe 只做尺寸与边缘收拢，
 * 避免组件加载瞬间表单高度跳动。
 * ---------------------------------------------------------------- */

.captcha-slot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 2px 0;
    min-width: 0;
    /* 预留一行提示的高度，加载态与就绪态之间不抖动 */
    min-height: 26px;
}

/* 加载 / 提示态：与 .field > span 的说明文字同级，纯文字不绘制边框与底色 */
.captcha-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.captcha-hint.is-error {
    color: var(--danger);
}

/* 组件就绪后隐藏提示 */
.captcha-slot.is-ready > .captcha-hint {
    display: none;
}

.captcha-widget {
    min-height: 0;
    max-width: 100%;
}

.captcha-widget:empty {
    display: none;
}

/* 第三方 iframe 宽度固定（Turnstile 300px / reCAPTCHA 304px），
   窄屏下等比收拢而不是溢出卡片 */
.captcha-widget > div,
.captcha-widget iframe {
    max-width: 100%;
}

@media (max-width: 380px) {
    .captcha-widget iframe {
        transform: scale(0.94);
        transform-origin: left top;
    }
}

/* ---------------------------------------------------------------- *
 * 用户中心
 * ---------------------------------------------------------------- */

.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.traffic {
    padding: 4px 0 8px;
}

.traffic-head,
.traffic-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.traffic-head {
    margin-bottom: 8px;
}

.traffic-head span:last-child,
.traffic-foot span:last-child {
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
}

.traffic-foot {
    margin-top: 6px;
    font-size: 12.5px;
}

.progress {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: var(--hover-stronger);
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    transition: width 0.4s ease;
}

.progress > span.danger {
    background: linear-gradient(90deg, #f97316, var(--danger));
}

.sub-card .card-actions {
    margin-top: 14px;
}

.account-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: var(--on-primary);
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
}

.account-email {
    font-size: 15px;
    font-weight: 550;
    word-break: break-all;
}

.copy-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.copy-row .input {
    flex: 1;
    min-width: 0;
}

.subscribe-block .row {
    margin-top: 12px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    align-items: start;
}

/* ---------------------------------------------------------------- *
 * 订单
 * ---------------------------------------------------------------- */

.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: 6px 14px;
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 13.5px;
    white-space: nowrap;
}

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

.tab.active {
    color: var(--primary-on-soft);
    background: var(--primary-soft);
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 5px 13px;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px;
}

.order-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.order-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 15px;
    min-width: 0;
}

.order-title b {
    font-weight: 600;
    word-break: break-word;
}

.order-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.order-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    color: var(--muted);
    font-size: 13px;
}

.order-meta span {
    word-break: break-all;
}

.order-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------- *
 * 邀请
 * ---------------------------------------------------------------- */

.invite-card {
    margin-top: 4px;
}

.invite-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invite-item {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 10px 16px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
}

.invite-code {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    word-break: break-all;
}

.invite-meta {
    grid-column: 1 / -1;
}

.invite-item .copy-row {
    grid-column: 2;
    grid-row: 1;
}

/* ---------------------------------------------------------------- *
 * 弹层 / Toast
 * ---------------------------------------------------------------- */

#modal-root,
#toast-root {
    position: relative;
    z-index: 1000;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: xpn-fade 0.15s ease;
}

.modal {
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--modal-shadow);
    animation: xpn-pop 0.16s ease;
    overflow: hidden;
}

.modal.modal-wide {
    max-width: 620px;
}

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

.modal-head h3 {
    font-size: 16px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
}

.confirm-text {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.7;
}

.pay-summary {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
}

.pay-summary .kv {
    border-bottom: 0;
    padding: 3px 0;
}

.pay-summary .amount {
    font-size: 18px;
    color: var(--text);
}

.pay-methods > p {
    margin-bottom: 10px;
}

.pay-method {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}

.pay-method input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pay-method-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    color: var(--text-soft);
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pay-method:hover .pay-method-body {
    border-color: var(--primary);
    color: var(--text);
}

.pay-method input[type="radio"]:checked + .pay-method-body {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--text);
}

.pay-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.pay-emoji {
    font-size: 18px;
    line-height: 1;
}

.pay-result-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pay-result-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.pay-code {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--code-bg);
    max-height: 180px;
    overflow: auto;
}

.pay-code code {
    color: var(--primary);
    word-break: break-all;
    white-space: pre-wrap;
    font-size: 12.5px;
}

#toast-root {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.toast {
    max-width: min(360px, calc(100vw - 36px));
    padding: 10px 16px;
    border: 1px solid var(--border-strong);
    border-left-width: 3px;
    border-radius: var(--radius-sm);
    background: var(--card-2);
    color: var(--text);
    font-size: 13.5px;
    box-shadow: var(--shadow);
    animation: xpn-slide-in 0.18s ease;
    word-break: break-word;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.warn {
    border-left-color: var(--warn);
}

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

.toast.info {
    border-left-color: var(--primary);
}

.toast-out {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes xpn-fade {
    from {
        opacity: 0;
    }
}

@keyframes xpn-pop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
}

@keyframes xpn-slide-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* ---------------------------------------------------------------- *
 * 页脚
 * ---------------------------------------------------------------- */

.site-footer {
    margin-top: 40px;
    /* 底部追加安全区高度，避免内容被 iOS Home 指示条 / 安卓手势条压住 */
    padding: 36px 0 calc(28px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    background: var(--footer-bg);
    font-size: 13.5px;
    color: var(--muted);
    overflow-wrap: break-word;
    word-break: break-word;
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 24px;
    align-items: start;
}

.footer-brand {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.footer-brand-block {
    min-width: 0;
}

.footer-brand-block p {
    max-width: 420px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    min-width: 0;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    /* 移动端把点击热区做到 32px，方便手指点按 */
    min-height: 32px;
    padding: 0 2px;
    border-radius: 6px;
    color: var(--muted);
    transition: color 0.15s ease, background 0.15s ease;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-links a:active {
    background: var(--footer-link-bg);
}

.footer-copy {
    text-align: right;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}

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

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

    .dash-grid .span-2 {
        grid-column: auto;
    }

    .stat-grid.five {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .footer-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .footer-copy {
        text-align: left;
    }

    /* 中等宽度下页脚文案不铺满整行，避免长副标题撑出横向滚动 */
    .footer-brand-block p {
        max-width: 100%;
    }

    .invite-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .invite-item .copy-row {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 760px) {
    .site-header .header-inner {
        gap: 12px;
    }

    .nav-toggle {
        display: block;
    }

    /* 移动端只保留图标：站点标题最长可达十余字，同处一行会把右上角菜单按钮挤出可视区 */
    .brand {
        min-width: 0;
        gap: 0;
    }

    .brand-text {
        display: none;
    }

    .hide-mobile {
        display: none !important;
    }

    .site-nav {
        position: fixed;
        top: calc(var(--header-h) + var(--safe-top));
        left: 0;
        right: 0;
        z-index: 49;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px 16px 18px;
        background: var(--bg-soft);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    }

    body.nav-open .site-nav {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-link {
        padding: 11px 12px;
        border-radius: var(--radius-sm);
    }

    .hero {
        padding: 52px 0 44px;
    }

    .hero-title {
        font-size: 30px;
    }

    .hero-sub {
        font-size: 14.5px;
    }

    .section {
        padding: 36px 0;
    }

    .page {
        padding: 24px 16px 48px;
    }

    .card {
        padding: 18px;
    }

    .article {
        padding: 20px;
    }

    .article-head h1 {
        font-size: 21px;
    }

    .auth-page {
        padding-top: 28px;
        padding-bottom: 48px;
    }

    .auth-card {
        padding: 22px;
    }

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

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

    .plan-grid,
    .kb-grid,
    .notice-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .copy-row {
        flex-wrap: wrap;
    }

    .copy-row .input {
        flex-basis: 100%;
    }

    .modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        max-width: none;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 92vh;
    }

    #toast-root {
        left: 12px;
        right: 12px;
        /* 浮层同样避让底部安全区，避免提示条被 Home 指示条盖住 */
        bottom: calc(12px + var(--safe-bottom));
        align-items: stretch;
    }

    .toast {
        max-width: none;
    }

    /* 移动端页脚：压缩留白，链接横行铺满，版权独占一行 */
    .site-footer {
        margin-top: 28px;
        padding: 24px 0 calc(20px + var(--safe-bottom));
        font-size: 13px;
    }

    .footer-inner {
        gap: 14px;
    }

    .footer-brand {
        font-size: 15px;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 4px 8px;
        margin: 0 -2px;
    }

    .footer-links a {
        /* 移动端点击热区 ≥ 40px，符合触控可用性建议 */
        min-height: 40px;
        padding: 0 8px;
    }

    .footer-copy {
        padding-top: 4px;
        border-top: 1px solid var(--border);
        font-size: 12.5px;
        line-height: 1.6;
        opacity: 0.85;
    }
}

@media (max-width: 420px) {
    .hero-title {
        font-size: 26px;
    }

    .stat-grid,
    .stat-grid.five {
        grid-template-columns: minmax(0, 1fr);
    }
}

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