/* ThunderVPN 官网设计系统 — 配色取自 LightVpn iOS App */

:root {
    --color-bg: #FFFFFF;
    --color-bg-soft: #F5F9FF;
    --color-surface: #EBF3FA;
    --color-surface-hover: #DDE9F5;
    --color-text-primary: #192128;
    --color-text-secondary: #4B6884;
    --color-text-muted: #8AA0B8;
    --color-accent: #5F9EFF;
    --color-accent-hover: #4A8CF0;
    --color-accent-soft: rgba(95, 158, 255, 0.12);
    --color-purple: #A8B5FF;
    --color-vip: #FF9A2E;
    --color-svip: #FF7A29;
    --color-danger: #E74C3C;
    --color-danger-soft: rgba(231, 76, 60, 0.10);
    --color-success: #2ECC71;
    --color-divider: #E5EDF5;

    --gradient-hero: linear-gradient(180deg, #E8F1FF 0%, #F5F9FF 50%, #FFFFFF 100%);
    --gradient-card: linear-gradient(135deg, #EFF5FD 0%, #E2ECF8 100%);
    --gradient-accent: linear-gradient(135deg, #5F9EFF 0%, #A8B5FF 100%);

    --shadow-sm: 0 2px 8px rgba(95, 158, 255, 0.08);
    --shadow-md: 0 4px 16px rgba(95, 158, 255, 0.12);
    --shadow-lg: 0 8px 32px rgba(95, 158, 255, 0.16);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
                   "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --content-max: 1200px;
    --content-narrow: 720px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    color: var(--color-text-primary);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    color: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: 14px;
}

/* ========== 顶栏 ========== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--color-divider);
}
.site-header__inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.site-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
}
.site-header__brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}
.site-footer__brand .site-header__brand-logo {
    width: 28px; height: 28px;
}
.site-header__nav {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    margin-left: 32px;
}
.site-header__nav a {
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}
.site-header__nav a:hover,
.site-header__nav a.active { color: var(--color-text-primary); }
.site-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.lang-switch {
    display: inline-flex;
    border: 1px solid var(--color-divider);
    border-radius: var(--radius-pill);
    overflow: hidden;
    font-size: 12px;
}
.lang-switch button {
    padding: 6px 12px;
    color: var(--color-text-secondary);
    transition: all 0.15s;
}
.lang-switch button.active {
    background: var(--color-accent);
    color: #fff;
}
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: 22px;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.btn--primary {
    background: var(--gradient-accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn--primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); color: #fff; }
.btn--ghost {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-divider);
}
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn--soft {
    background: var(--color-surface);
    color: var(--color-text-primary);
}
.btn--soft:hover { background: var(--color-surface-hover); }
.btn--danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}
.btn--danger:hover { background: rgba(231, 76, 60, 0.18); }
.btn--lg { padding: 14px 32px; font-size: 16px; }
.btn--block { width: 100%; }
.btn[disabled],
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========== 输入框 ========== */
.field {
    display: block;
    margin-bottom: 18px;
}
.field__label {
    display: block;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}
.input {
    width: 100%;
    padding: 13px 16px;
    background: var(--color-surface);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--color-text-primary);
    transition: border-color 0.15s, background 0.15s;
    outline: none;
}
.input::placeholder { color: var(--color-text-muted); }
.input:focus {
    border-color: var(--color-accent);
    background: #fff;
}
.input--with-action {
    padding-right: 130px;
}
.field__group {
    position: relative;
    display: flex;
    align-items: stretch;
}
.field__group > .input {
    flex: 1;
    min-width: 0;
}
.field__group .field__action {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    height: auto;
    padding: 0 18px;
    border-radius: var(--radius-pill);
    background: var(--gradient-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(95,158,255,0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.15s, opacity 0.15s, background 0.15s;
}
.field__group .field__action:hover { box-shadow: 0 3px 10px rgba(95,158,255,0.35); }
.field__group .field__action[disabled] {
    background: var(--color-text-muted);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.85;
}
.field--label-inside .field__label {
    margin-bottom: 0;
    position: absolute;
    pointer-events: none;
}
.field__hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
}
.field__error {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-danger);
}

/* ========== 卡片 / 区段 ========== */
.card {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-divider);
}
.card--soft {
    background: var(--color-surface);
    border-color: transparent;
}
.section {
    padding: 64px 24px;
}
.section--narrow {
    max-width: var(--content-narrow);
    margin: 0 auto;
}
.section__inner {
    max-width: var(--content-max);
    margin: 0 auto;
}
.section__title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--color-text-primary);
    text-align: center;
}
.section__subtitle {
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0 0 40px;
    font-size: 16px;
}

/* ========== 顶部 Hero ========== */
.hero {
    position: relative;
    padding: 80px 24px 100px;
    background: var(--gradient-hero);
    overflow: hidden;
    text-align: center;
}
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}
.hero::before {
    width: 320px; height: 320px;
    background: #B8D4FF;
    top: -100px; left: -80px;
}
.hero::after {
    width: 280px; height: 280px;
    background: #D4C5FF;
    bottom: -100px; right: -60px;
}
.hero__inner {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}
.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}
.hero__title {
    font-size: 48px;
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 20px;
    color: var(--color-text-primary);
    letter-spacing: -0.5px;
}
.hero__title .highlight {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero__subtitle {
    font-size: 18px;
    color: var(--color-text-secondary);
    margin: 0 0 36px;
}
.hero__cta {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========== 特性网格 ========== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 32px;
}
.feature {
    padding: 28px 24px;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-divider);
    transition: transform 0.18s, box-shadow 0.18s;
}
.feature:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.feature__icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}
.feature__title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px;
}
.feature__text {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin: 0;
}

/* ========== 国家展示 ========== */
.region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 32px;
}
.region {
    padding: 14px 16px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}
.region__flag {
    font-size: 20px;
}

/* ========== 表单页（登录/注册） ========== */
.auth-page {
    min-height: calc(100vh - 64px);
    background: var(--gradient-hero);
    padding: 48px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-md);
}
.auth-card__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    text-align: center;
}
.auth-card__subtitle {
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0 0 28px;
    font-size: 14px;
}
.tab-switch {
    display: flex;
    border-bottom: 1px solid var(--color-divider);
    margin-bottom: 24px;
}
.tab-switch button {
    flex: 1;
    padding: 12px 0;
    color: var(--color-text-secondary);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    transition: color 0.15s;
}
.tab-switch button.active {
    color: var(--color-text-primary);
    font-weight: 600;
}
.tab-switch button.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 32px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 2px;
    transform: translateX(-50%);
}
.auth-card__footer {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-secondary);
}
.auth-card__footer a { font-weight: 600; }
.auth-card__inline-action {
    display: flex;
    justify-content: space-between;
    margin: -8px 0 18px;
    font-size: 13px;
}
.auth-card__inline-action a { color: var(--color-text-secondary); }
.auth-card__inline-action a:hover { color: var(--color-accent); }

/* ========== 个人中心布局 ========== */
.account-page {
    background: var(--gradient-hero);
    min-height: calc(100vh - 64px);
}
.account-page__inner {
    max-width: 920px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}
.account-summary {
    background: linear-gradient(135deg, #EFF5FD 0%, #DCE8FA 100%);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
}
.account-summary__avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--gradient-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}
.account-summary__info { flex: 1; min-width: 0; }
.account-summary__email {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 6px;
    word-break: break-all;
}
.account-summary__exp {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 2px 0;
}
.account-summary__badge {
    position: absolute;
    top: 14px;
    right: 16px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--color-svip), var(--color-vip));
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.account-summary__badge--vip {
    background: linear-gradient(135deg, var(--color-vip), #FFB85C);
}
.account-summary__badge--free {
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.account-section {
    margin-bottom: 28px;
}
.account-section__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin: 0 0 12px;
    padding-left: 4px;
}
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.account-tile {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 18px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    border: 1px solid var(--color-divider);
    transition: transform 0.15s, box-shadow 0.15s;
    color: var(--color-text-primary);
    font-size: 15px;
    font-weight: 500;
    width: 100%;
}
.account-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    color: var(--color-text-primary);
}
.account-tile__icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.account-tile__icon--danger {
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

/* ========== 设备列表 ========== */
.device-list {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.device-row {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 14px;
}
.device-row + .device-row {
    border-top: 1px solid rgba(255,255,255,0.6);
}
.device-row__icon {
    width: 36px; height: 36px;
    background: rgba(95, 158, 255, 0.16);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    flex-shrink: 0;
}
.device-row__main { flex: 1; min-width: 0; }
.device-row__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.device-row__time {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-size: 11px;
    font-weight: 600;
}

/* ========== 邀请页 ========== */
.invite-card {
    text-align: center;
    background: linear-gradient(135deg, #5F9EFF 0%, #A8B5FF 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    box-shadow: var(--shadow-md);
}
.invite-card h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #fff;
}
.invite-card__desc {
    opacity: 0.92;
    font-size: 14px;
    margin: 0 0 22px;
}
.invite-code-box {
    background: rgba(255,255,255,0.18);
    border: 1px dashed rgba(255,255,255,0.5);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
}
.invite-card__btn {
    background: #fff;
    color: var(--color-accent);
    padding: 12px 28px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
}
.invite-card__btn:hover { background: #F5F9FF; color: var(--color-accent); }

.invite-records {
    margin-top: 28px;
}
.invite-record {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    margin-bottom: 8px;
    font-size: 14px;
}

/* ========== 法律 / 文档 长文 ========== */
.doc-page {
    background: var(--color-bg-soft);
    min-height: calc(100vh - 64px);
}
.doc-content {
    max-width: var(--content-narrow);
    margin: 0 auto;
    padding: 48px 24px 64px;
}
.doc-content h1 {
    font-size: 32px;
    margin: 0 0 12px;
}
.doc-content .updated {
    color: var(--color-text-muted);
    font-size: 13px;
    margin: 0 0 28px;
}
.doc-content h2 {
    font-size: 20px;
    margin: 32px 0 12px;
    color: var(--color-text-primary);
}
.doc-content h3 {
    font-size: 16px;
    margin: 20px 0 8px;
}
.doc-content p, .doc-content li {
    color: var(--color-text-primary);
    font-size: 15px;
    line-height: 1.75;
}
.doc-content ul, .doc-content ol {
    padding-left: 22px;
    margin: 8px 0 16px;
}

/* ========== FAQ 折叠 ========== */
.faq-section {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.faq-section h2 {
    font-size: 18px;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-surface);
}
.faq-item {
    border-bottom: 1px solid var(--color-divider);
}
.faq-item:last-child { border-bottom: none; }
.faq-item__title {
    width: 100%;
    text-align: left;
    padding: 14px 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-item__title::after {
    content: "+";
    font-size: 22px;
    font-weight: 400;
    color: var(--color-text-muted);
    transition: transform 0.18s;
    margin-left: 12px;
}
.faq-item.open .faq-item__title::after {
    content: "−";
}
.faq-item__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    color: var(--color-text-secondary);
    font-size: 14px;
    line-height: 1.75;
}
.faq-item.open .faq-item__body {
    max-height: 1200px;
    padding-bottom: 16px;
}
.faq-item__body p { margin: 0 0 8px; }

/* ========== 客服聊天 ========== */
.support-page {
    height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    background: var(--color-bg-soft);
}
.support-bar {
    background: #fff;
    padding: 14px 24px;
    border-bottom: 1px solid var(--color-divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.support-bar__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.support-bar__status {
    font-size: 12px;
    color: var(--color-success);
    margin-top: 2px;
}
.support-bar__status::before {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--color-success);
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.support-chat {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}
.chat-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeUp 0.25s ease-out;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 14px;
}
.chat-msg.user .chat-avatar {
    background: var(--gradient-accent);
}
.chat-bubble {
    max-width: 78%;
    background: #fff;
    border-radius: 12px;
    border-top-left-radius: 4px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--color-text-primary);
    box-shadow: var(--shadow-sm);
}
.chat-msg.user .chat-bubble {
    background: var(--color-accent);
    color: #fff;
    border-top-left-radius: 12px;
    border-top-right-radius: 4px;
}
.chat-bubble p { margin: 0 0 6px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.chat-chip {
    background: #F0F7FF;
    color: var(--color-accent);
    border: 1px solid #D6E6FA;
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.chat-chip:hover { background: #E0EEFF; }
.chat-chip--cat {
    background: #fff;
    color: var(--color-text-secondary);
    border-color: var(--color-divider);
}
.support-input {
    background: #fff;
    border-top: 1px solid var(--color-divider);
    padding: 10px 14px;
    display: flex;
    gap: 10px;
}
.support-input input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    outline: none;
    font-size: 14px;
}
.support-input input:focus { border-color: var(--color-accent); background: #fff; }
.support-input button {
    flex-shrink: 0;
    background: var(--gradient-accent);
    color: #fff;
    padding: 0 22px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

/* ========== 嵌入模式（App 内 WebView，?embed=1） ========== */
/* 不依赖 vh/dvh 视口单位（在 SwiftUI sheet 装 WKWebView 时不稳）。
   做法：html/body 100% 跟随 WebView frame；body 自己作 flex column，
   .support-page 用 flex:1 填满，靠盒模型继承自然适配键盘。 */
html, body.embed { height: 100%; }
body.embed {
    margin: 0;
    display: flex;
    flex-direction: column;
}
body.embed .support-page {
    flex: 1;
    height: auto;     /* 覆盖默认的 calc(100vh - 64px) */
    min-height: 0;    /* 允许 .support-chat 内部正常 overflow scroll */
}

/* 顶栏 / 输入栏防水平溢出：窄屏 iPhone 下 nowrap+大 padding 会撑出视口，
   导致右侧按钮被截。压缩 padding、允许文字省略，flex-shrink:0 锁住按钮。 */
body.embed .support-bar { padding: 10px 12px; }
body.embed .support-bar > div:first-child {
    flex: 1;
    min-width: 0;
}
body.embed .support-bar__title,
body.embed .support-bar__status {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.embed .support-bar .btn {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 12px;
}
body.embed .support-input { padding: 10px 12px; }
body.embed .support-input button { padding: 0 16px; }

/* ========== 页脚 ========== */
.site-footer {
    background: #0F1A26;
    color: #B6C2D2;
    padding: 48px 24px 24px;
    margin-top: 64px;
}
.site-footer__inner {
    max-width: var(--content-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 40px;
}
.site-footer__col h4 {
    color: #fff;
    font-size: 14px;
    margin: 0 0 14px;
}
.site-footer__col a {
    display: block;
    color: #B6C2D2;
    font-size: 13px;
    margin-bottom: 8px;
    transition: color 0.15s;
}
.site-footer__col a:hover { color: #fff; }
.site-footer__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}
.site-footer__copy {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    color: #6F7E91;
    text-align: center;
}

/* ========== 通用工具 ========== */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--color-text-secondary);
}
.empty-state__icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    background: rgba(25, 33, 40, 0.92);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast--error { background: var(--color-danger); }
.toast--success { background: var(--color-success); }

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
.spinner--blue {
    border: 2px solid rgba(95,158,255,0.18);
    border-top-color: var(--color-accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .site-header__inner { padding: 12px 16px; gap: 12px; }
    .site-header__nav {
        position: fixed;
        top: 64px; left: 0; right: 0;
        flex-direction: column;
        background: #fff;
        padding: 16px;
        gap: 0;
        margin-left: 0;
        border-bottom: 1px solid var(--color-divider);
        display: none;
    }
    .site-header__nav.open { display: flex; }
    .site-header__nav a {
        width: 100%;
        padding: 12px 8px;
        border-bottom: 1px solid var(--color-divider);
    }
    .menu-toggle { display: flex; align-items: center; justify-content: center; }
    .hero { padding: 56px 20px 80px; }
    .hero__title { font-size: 32px; }
    .hero__subtitle { font-size: 15px; }
    .section { padding: 48px 16px; }
    .section__title { font-size: 24px; }
    .auth-page { padding: 24px 16px; min-height: calc(100vh - 56px); }
    .auth-card { padding: 28px 20px; }
    .account-page__inner { padding: 20px 16px 48px; }
    .account-summary { padding: 18px; gap: 12px; }
    .account-summary__badge { top: 10px; right: 10px; }
    .doc-content { padding: 32px 18px 48px; }
    .doc-content h1 { font-size: 24px; }
    .site-footer { padding: 36px 20px 20px; }
    .site-footer__inner { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 480px) {
    .hero__cta { flex-direction: column; align-items: stretch; }
    .hero__cta .btn { width: 100%; }
    .feature-grid { grid-template-columns: 1fr; }
}
