/**
 * 潮汐量化 · 品牌设计系统
 * 覆盖 style.css 默认 token，去 AI 味，偏专业金融科技
 */

:root {
    --bg-primary: #070b10;
    --bg-secondary: #0c1219;
    --bg-card: #111922;
    --bg-elevated: #161f2b;
    --bg-hover: #1c2735;
    --text-primary: #eef2f7;
    --text-secondary: #93a3b8;
    --text-muted: #5f7188;
    --accent: #2ea88a;
    --accent-hover: #3bc4a3;
    --accent-soft: rgba(46, 168, 138, 0.12);
    --accent-glow: rgba(46, 168, 138, 0.25);
    --gold: #c9a962;
    --gold-hover: #dbbe78;
    --gold-soft: rgba(201, 169, 98, 0.14);
    --vip-purple: #7c6cbf;
    --success: #2ea88a;
    --warning: #c9a962;
    --danger: #d46b6b;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);
    --radius: 10px;
    --radius-lg: 14px;
    --radius-sm: 6px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.45);
    --font-display: "DM Sans", "Noto Sans SC", system-ui, sans-serif;
    --font-body: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
    --layout-max-width: 1280px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(46, 168, 138, 0.08), transparent),
        var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.01em;
}

h1, h2, h3, h4, .navbar-brand, .page-header h1 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

a {
    color: var(--accent);
    transition: color 0.2s ease;
}
a:hover {
    color: var(--accent-hover);
}

/* —— 导航 —— */
.navbar {
    height: 60px;
    background: rgba(12, 18, 25, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.navbar-inner {
    height: 60px;
}
.navbar-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.navbar-brand span {
    color: var(--accent);
    font-weight: 600;
}
.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    padding: 4px 0;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}
.nav-links a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
}
.nav-search-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
}
.nav-search-box:focus-within {
    border-color: rgba(46, 168, 138, 0.45);
    background: rgba(255, 255, 255, 0.05);
}

.nav-vip-btn {
    background: linear-gradient(135deg, var(--gold), #a88642);
    border-radius: var(--radius-sm);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(201, 169, 98, 0.25);
}
.nav-vip-btn:hover {
    box-shadow: 0 4px 16px rgba(201, 169, 98, 0.35);
    color: #fff;
}

.nav-member-vip {
    background: linear-gradient(135deg, #6b5b95, #52467a);
    box-shadow: 0 2px 10px rgba(107, 91, 149, 0.3);
}
.nav-member-svip {
    background: linear-gradient(135deg, var(--gold), #9a7b3c);
    box-shadow: 0 2px 10px rgba(201, 169, 98, 0.3);
}
.nav-member-badge .member-icon {
    display: none;
}
.nav-member-badge .member-text::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.9;
}

.nav-wallet-btn {
    border-color: var(--border);
    background: transparent;
    color: var(--text-secondary);
}
.nav-wallet-btn:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

/* —— 按钮 —— */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active {
    transform: translateY(1px) scale(0.99);
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-outline {
    border-color: var(--border-strong);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.btn-success {
    background: #248f6e;
}
.btn-success:hover {
    background: #2ea88a;
}

/* —— 卡片与面板 —— */
.card,
.stat-card,
.auth-card,
.checkout-panel,
.plan-card,
.strategy-home-card,
.favorite-tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}
.card:hover,
.stat-card-link:hover,
.strategy-home-card:hover,
.favorite-tool-card:hover {
    border-color: rgba(46, 168, 138, 0.25);
    box-shadow: var(--shadow-hover);
}

.plan-card.selected {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent), 0 8px 32px var(--accent-glow) !important;
}
.plan-card .plan-tag {
    background: linear-gradient(135deg, var(--gold), #9a7b3c);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.plan-card .plan-name-gold {
    color: var(--gold);
}
.plan-card .plan-features li .ck {
    color: var(--accent);
}

/* —— 策略卡片 —— */
.strategy-home-card {
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.strategy-home-card:hover {
    transform: translateY(-3px);
}
.strategy-home-card .cover-placeholder {
    font-size: 0 !important;
    background: linear-gradient(145deg, var(--bg-elevated), var(--bg-hover));
}
.strategy-home-card .cover-placeholder::after {
    content: "EA";
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}
.strategy-home-card .view-cta {
    color: var(--accent);
    font-weight: 600;
}

/* —— 侧栏布局 —— */
.layout-sidebar .sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
}
.sidebar-menu a {
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}
.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--accent-soft);
    color: var(--accent);
}

/* —— 认证页 —— */
.auth-page {
    min-height: calc(100dvh - 60px);
    background:
        radial-gradient(circle at 20% 30%, rgba(46, 168, 138, 0.06), transparent 45%),
        var(--bg-primary);
}
.auth-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-card);
    max-width: 420px;
}
.auth-card h2 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.auth-brand {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}
.badge-svip {
    background: linear-gradient(135deg, var(--gold), #9a7b3c) !important;
    color: #fff !important;
}
.badge-vip {
    background: linear-gradient(135deg, var(--vip-purple), #5a4d8a) !important;
    color: #fff !important;
}
.stat-tier-svip { color: var(--gold); }
.stat-tier-vip { color: var(--vip-purple); }
.stat-tier-admin { color: var(--vip-purple); }
.wallet-stat .value.green,
.text-positive { color: var(--accent) !important; }
.text-negative { color: var(--danger) !important; }
.badge-main {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
}
.badge-curated {
    background: rgba(124, 108, 191, 0.12) !important;
    color: var(--vip-purple) !important;
}

/* —— 表单 —— */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: rgba(46, 168, 138, 0.5);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* —— 徽章 —— */
.badge-active,
.badge-paid {
    background: var(--accent-soft);
    color: var(--accent);
}
.badge-pending {
    background: rgba(201, 169, 98, 0.12);
    color: var(--gold);
}
.badge-awaiting_review {
    background: rgba(201, 169, 98, 0.12);
    color: var(--gold);
}

/* —— 页脚 —— */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.footer-logo span {
    color: var(--accent);
}
.footer-col h4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.footer-legal {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
}
.footer-legal-label {
    color: var(--accent);
    font-weight: 600;
}

/* —— 表格 —— */
table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.table-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* —— 首页区块 —— */
.home-section-heading h2 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.home-section-more {
    color: var(--accent);
    font-weight: 600;
}
.home-strategy-empty {
    border-style: solid;
    border-color: var(--border);
    background: var(--bg-card);
}

/* —— 会员页 —— */
.checkout-panel {
    border-radius: var(--radius-lg);
    top: 72px;
}
.pay-item.selected {
    border-color: var(--accent) !important;
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
}
.member-welcome-banner {
    background: var(--accent-soft);
    border-color: rgba(46, 168, 138, 0.2);
}
.member-welcome-banner.svip-banner {
    background: var(--gold-soft);
    border-color: rgba(201, 169, 98, 0.25);
}

/* —— 定价 CTA / 空状态 —— */
.alert-success {
    background: var(--accent-soft);
    border-color: rgba(46, 168, 138, 0.3);
    color: var(--accent);
}
.alert-danger {
    background: rgba(212, 107, 107, 0.1);
    border-color: rgba(212, 107, 107, 0.25);
}

/* —— 管理后台 drop-zone —— */
.drop-zone:hover,
.drop-zone.drag-over,
.drop-zone:focus {
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* —— 页面标题 —— */
.page-header {
    text-align: center;
    padding: 48px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(26px, 3.5vw, 32px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.page-header p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

/* —— 筛选侧栏 —— */
.filter-sidebar .filter-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.filter-sidebar h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.filter-sidebar label {
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    margin: 0 -8px;
}
.filter-sidebar label:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}
.filter-sidebar input[type="radio"]:checked + *,
.filter-sidebar label:has(input:checked) {
    color: var(--accent);
}
.filter-clear {
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
}

/* —— 内容卡片网格 —— */
.lib-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.lib-card:hover {
    transform: translateY(-3px);
    border-color: rgba(46, 168, 138, 0.25);
    box-shadow: var(--shadow-hover);
}
.lib-card-img {
    background: var(--bg-elevated);
    aspect-ratio: 16 / 10;
}
.lib-card-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.lib-card-more {
    color: var(--accent);
    font-weight: 600;
}
.lib-card-placeholder,
.strategy-home-card .cover-placeholder {
    font-size: 0 !important;
    background: linear-gradient(145deg, var(--bg-elevated), var(--bg-hover)) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.lib-card-placeholder::after,
.strategy-home-card .cover-placeholder::after {
    content: "EA";
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}
.tools-grid .lib-card-img > div {
    font-size: 0 !important;
    background: linear-gradient(145deg, var(--bg-elevated), var(--bg-hover));
}
.tools-grid .lib-card-img > div::after {
    content: "TOOL";
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

/* —— 等级徽章 —— */
.tag-tier-svip,
.badge.tag-tier-svip {
    background: linear-gradient(135deg, var(--gold), #9a7b3c) !important;
    color: #fff !important;
    font-weight: 600;
    border: none;
}
.tag-tier-vip,
.badge.tag-tier-vip {
    background: linear-gradient(135deg, var(--vip-purple), #5a4d8a) !important;
    color: #fff !important;
    font-weight: 600;
    border: none;
}
.tag-tier-free,
.badge.tag-tier-free {
    background: var(--bg-hover) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border);
}

.tag-badge.tag-low { background: var(--accent-soft); color: var(--accent); }
.tag-badge.tag-mid { background: rgba(201, 169, 98, 0.12); color: var(--gold); }
.tag-badge.tag-high { background: rgba(212, 107, 107, 0.12); color: var(--danger); }
.tag-badge.tag-platform { background: rgba(46, 168, 138, 0.1); color: var(--accent); }
.tag-badge.tag-type { background: rgba(124, 108, 191, 0.12); color: var(--vip-purple); }

/* —— 详情页标签 —— */
.tag-risk-low { background: var(--accent-soft); color: var(--accent); }
.tag-risk-mid { background: rgba(201, 169, 98, 0.12); color: var(--gold); }
.tag-risk-high { background: rgba(212, 107, 107, 0.12); color: var(--danger); }
.detail-tags .tag-platform { background: rgba(46, 168, 138, 0.1); color: var(--accent); }
.detail-tags .tag-type { background: rgba(124, 108, 191, 0.12); color: var(--vip-purple); }

/* —— 信息提示框 —— */
.info-box,
.auth-notice-key {
    background: var(--accent-soft) !important;
    border: 1px solid rgba(46, 168, 138, 0.22) !important;
    border-radius: var(--radius-sm);
}
.auth-notice-free {
    background: rgba(46, 168, 138, 0.06) !important;
    border: 1px solid rgba(46, 168, 138, 0.18) !important;
}
.quota-box {
    background: var(--accent-soft);
    border: 1px solid rgba(46, 168, 138, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* —— 空状态 —— */
.content-empty {
    text-align: center;
    padding: 64px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.content-empty-icon {
    font-size: 0;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    position: relative;
}
.content-empty-icon::after {
    content: "—";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-muted);
}

/* —— 会员定价页覆盖 —— */
.vip-header h1 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}
.plan-card:hover { border-color: rgba(46, 168, 138, 0.35); }
.plan-card.selected {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent), 0 8px 32px var(--accent-glow) !important;
}
.plan-card-subscribed,
.plan-card-renew {
    border-color: rgba(46, 168, 138, 0.45) !important;
    background: var(--accent-soft) !important;
}
.plan-card-renew.selected,
.plan-card-subscribed.selected {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent), 0 4px 24px var(--accent-glow) !important;
}
.plan-status-badge.subscribed { background: var(--accent-soft); color: var(--accent); }
.plan-status-badge.renew { background: rgba(46, 168, 138, 0.15); color: var(--accent); }
.plan-status-badge.upgrade { background: var(--gold-soft); color: var(--gold); }
.plan-card .plan-features li .ck { color: var(--accent); }
.pay-item:hover { border-color: rgba(46, 168, 138, 0.35); }
.pay-item.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}
.benefit-icon {
    background: var(--accent-soft) !important;
    font-size: 0 !important;
}
.benefit-icon::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}
.plan-row-label {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.text-accent { color: var(--accent); }

/* —— 工具栏 —— */
.content-toolbar,
.section-toolbar {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    margin-bottom: 24px;
}
.toolbar-search-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
}
.toolbar-search-box:focus-within {
    border-color: rgba(46, 168, 138, 0.45);
}

/* —— 资源列表 —— */
.resource-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.resource-list-item:hover {
    border-color: rgba(46, 168, 138, 0.25);
    box-shadow: var(--shadow-card);
}
.resource-list-arrow {
    color: var(--accent);
}

/* —— 弹窗 —— */
.tier-modal-inner {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-hover);
}
.tier-modal-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--gold-soft);
    border: 1px solid rgba(201, 169, 98, 0.3);
    position: relative;
}
.tier-modal-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 16px;
    border: 2px solid var(--gold);
    border-radius: 3px 3px 5px 5px;
}

/* —— 法律文档（独立页 + 弹窗共用） —— */
.legal-page { padding: 48px 0 80px; max-width: 820px; margin: 0 auto; }
.legal-back { font-size: 14px; color: var(--text-muted); text-decoration: none; display: inline-block; margin-bottom: 24px; }
.legal-back:hover { color: var(--accent); }
.legal-header { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.legal-header h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.legal-meta { font-size: 13px; color: var(--text-muted); line-height: 1.8; }
.legal-doc { font-size: 14px; color: var(--text-secondary); line-height: 1.85; }
.legal-doc h2 { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 28px 0 10px; }
.legal-doc h2:first-of-type { margin-top: 0; }
.legal-doc p { margin-bottom: 10px; }
.legal-doc ol, .legal-doc ul { margin: 0 0 10px 1.25em; padding: 0; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc strong { color: var(--text-primary); font-weight: 600; }
.legal-highlight {
    background: var(--accent-soft);
    border: 1px solid rgba(46, 168, 138, 0.22);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.75;
}
.legal-highlight strong { color: var(--accent); }

/* —— 会员协议弹窗 —— */
.agreement-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.agreement-modal.is-open {
    display: flex;
}
.agreement-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.agreement-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 640px;
    max-height: min(85vh, 780px);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    animation: agreementModalIn 0.2s ease-out;
}
@keyframes agreementModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.agreement-modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.agreement-modal-header h2 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    padding-right: 8px;
}
.agreement-modal-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}
.agreement-modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}
.agreement-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    -webkit-overflow-scrolling: touch;
}
.agreement-modal-body .legal-doc { font-size: 13px; }
.agreement-modal-body .legal-doc h2 { font-size: 14px; margin-top: 22px; }
.agreement-modal-footer {
    flex-shrink: 0;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
}
.agreement-modal-footer .btn { width: 100%; }
body.agreement-modal-open { overflow: hidden; }
a[data-agreement-open] { cursor: pointer; }

/* —— 移动端布局（覆盖固定高度导航，避免元素重叠）—— */
@media (max-width: 768px) {
    .navbar,
    .navbar-inner {
        height: auto !important;
        min-height: 0;
    }

    .navbar-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand actions"
            "links links"
            "search search";
        gap: 8px 10px;
        padding: 10px var(--layout-padding-x, 16px) 12px;
        align-items: center;
    }

    .nav-left {
        display: contents;
    }

    .navbar-brand {
        grid-area: brand;
        font-size: 16px;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-links {
        grid-area: links;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 14px;
        width: 100%;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links li {
        flex-shrink: 0;
    }

    .nav-spacer {
        display: none !important;
    }

    .nav-search-form {
        grid-area: search;
        width: 100% !important;
        order: unset !important;
        flex: unset !important;
    }

    .nav-right {
        grid-area: actions;
        margin-left: 0 !important;
        width: auto !important;
        flex-shrink: 1;
        min-width: 0;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 6px;
        white-space: nowrap;
    }

    /* 超管顶栏入口保留（普通用户仍隐藏重复链接） */
    body.is-super-admin .nav-right .nav-right-link[href="/admin"] {
        display: inline !important;
        font-size: 12px;
    }

    body.is-super-admin .nav-right .nav-member-badge {
        display: inline-flex !important;
        align-items: center;
        max-width: none;
        padding: 4px 10px;
        font-size: 11px;
    }

    body.is-super-admin .nav-right .nav-member-badge .member-text {
        max-width: none;
    }

    /* 管理/用户后台：侧栏改为顶部横向滑动菜单 */
    .layout-sidebar:has(.sidebar-menu a[href="/admin/strategies"]),
    .layout-sidebar:has(.sidebar-menu a[href="/user/dashboard"]) {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        min-height: auto;
    }

    .layout-sidebar:has(.sidebar-menu a[href="/admin/strategies"]) .sidebar,
    .layout-sidebar:has(.sidebar-menu a[href="/user/dashboard"]) .sidebar {
        display: block;
        position: sticky;
        top: 0;
        z-index: 90;
        padding: 10px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-right: none;
        border-bottom: 1px solid var(--border);
        background: var(--bg-secondary);
        scrollbar-width: none;
    }

    .layout-sidebar:has(.sidebar-menu a[href="/admin/strategies"]) .sidebar::-webkit-scrollbar,
    .layout-sidebar:has(.sidebar-menu a[href="/user/dashboard"]) .sidebar::-webkit-scrollbar {
        display: none;
    }

    .layout-sidebar:has(.sidebar-menu a[href="/admin/strategies"]) .sidebar-menu,
    .layout-sidebar:has(.sidebar-menu a[href="/user/dashboard"]) .sidebar-menu {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        padding: 0 12px;
        width: max-content;
        min-width: 100%;
    }

    .layout-sidebar:has(.sidebar-menu a[href="/admin/strategies"]) .sidebar-menu li,
    .layout-sidebar:has(.sidebar-menu a[href="/user/dashboard"]) .sidebar-menu li {
        flex-shrink: 0;
    }

    .layout-sidebar:has(.sidebar-menu a[href="/admin/strategies"]) .sidebar-menu a,
    .layout-sidebar:has(.sidebar-menu a[href="/user/dashboard"]) .sidebar-menu a {
        padding: 8px 14px;
        border-radius: var(--radius-sm);
        white-space: nowrap;
        background: rgba(255, 255, 255, 0.04);
        border-left: none;
        border-right: none;
    }

    .layout-sidebar:has(.sidebar-menu a[href="/admin/strategies"]) .sidebar-menu a.active,
    .layout-sidebar:has(.sidebar-menu a[href="/user/dashboard"]) .sidebar-menu a.active {
        background: var(--accent-soft);
        color: var(--accent);
        border-left: none;
        border-right: none;
    }

    .layout-sidebar:has(.sidebar-menu a[href="/admin/strategies"]) .sidebar-menu .sidebar-divider,
    .layout-sidebar:has(.sidebar-menu a[href="/user/dashboard"]) .sidebar-menu .sidebar-divider {
        display: none;
    }

    .nav-member-badge {
        max-width: 96px;
        padding: 4px 8px;
        font-size: 11px;
    }

    .nav-member-badge .member-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
        max-width: 80px;
    }

    .nav-user-trigger {
        max-width: 88px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
        padding: 5px 8px;
    }

    body.is-super-admin .nav-user-trigger {
        max-width: 72px;
    }

    .nav-vip-btn {
        font-size: 12px;
        padding: 5px 10px;
    }

    .nav-wallet-btn {
        font-size: 12px;
        padding: 5px 8px;
    }

    .nav-right .btn-sm {
        padding: 5px 12px;
        font-size: 12px;
    }

    .nav-user-menu {
        right: 0;
        left: auto;
        max-width: min(280px, calc(100vw - 32px));
    }

    .auth-page {
        min-height: calc(100vh - 120px);
        padding: 24px 0;
    }

    .auth-card {
        width: calc(100% - 32px);
        max-width: 420px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .nav-right .nav-right-link[href="/user/dashboard"] {
        font-size: 12px;
        padding: 5px 8px;
    }

    .nav-member-badge {
        max-width: 84px;
        padding: 4px 7px;
        font-size: 10px;
    }

    .nav-member-badge .member-text {
        max-width: 68px;
    }

    .nav-wallet-btn {
        font-size: 11px;
        padding: 5px 7px;
    }

    body.is-super-admin .nav-right .nav-member-badge {
        max-width: none;
    }

    body.is-super-admin .nav-right .nav-member-badge .member-text {
        max-width: none;
    }

    .nav-user-trigger {
        max-width: 72px;
    }
}
