/* =========================================================
   KiiChain — 主样式表
   包含：变量 / 导航栏 / Hero / Ticker / 功能卡片 /
         Hybrid Engine / Stats / Ecosystem / Dev Resources /
         Community / Footer / Modal / 子页面通用 / FAQ /
         Staking / Bridge / Utils
   ========================================================= */

/* =========================================================
   1. CSS 变量
   ========================================================= */
:root {
    --bg:         #0a0a1a;
    --bg-2:       #0f0f24;
    --bg-3:       #060612;
    --primary:    #6366f1;
    --primary-2:  #8b5cf6;
    --accent:     #22d3ee;
    --text:       #e2e8f0;
    --text-dim:   #94a3b8;
    --text-muted: #64748b;
    --border:     rgba(255,255,255,0.08);
    --glass:      rgba(255,255,255,0.04);
    --radius:     16px;
    --success:    #10b981;
    --danger:     #ef4444;
    --warning:    #f59e0b;
    --header-h:   72px;
}

/* =========================================================
   2. 基础重置
   ========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font-family: inherit; }

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =========================================================
   3. HEADER / 顶部导航栏
   ========================================================= */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: var(--header-h);
    background: rgba(10,10,26,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background .3s;
}
.site-header.scrolled { background: rgba(10,10,26,0.95); }

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* 左侧：Logo + 导航 */
.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
    flex: 1;
    min-width: 0;
}
.header-logo { flex-shrink: 0; }
.header-logo img {
    display: block;
    height: 32px;
    width: auto;
}

/* 导航菜单 */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all .2s;
    white-space: nowrap;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.nav-link:hover { color: var(--text); background: var(--glass); }
.nav-link.active { color: var(--text); }

/* 下拉容器 */
.nav-item { position: relative; }

.nav-trigger { color: var(--text-dim); }
.nav-trigger:hover { color: var(--text); background: var(--glass); }
.nav-item.open .nav-trigger { color: var(--text); background: var(--glass); }

.nav-arrow {
    transition: transform .25s;
    opacity: .6;
}
.nav-item.open .nav-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* 下拉面板 */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: rgba(15, 15, 36, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .22s cubic-bezier(.4, 0, .2, 1);
    z-index: 100;
}
.nav-item.open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13.5px;
    border-radius: 8px;
    transition: all .15s;
    white-space: nowrap;
}
.dropdown-link:hover {
    background: rgba(99,102,241,0.12);
    color: var(--text);
}
.dropdown-link svg { opacity: .4; flex-shrink: 0; }
.dropdown-link:hover svg { opacity: .8; }

/* 右侧操作区 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* 语言切换 */
.lang-switcher { position: relative; }
.lang-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.03);
    color: var(--text-dim);
    border: 1px solid var(--border);
    padding: 7px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all .2s;
}
.lang-btn:hover {
    color: var(--text);
    border-color: rgba(99,102,241,0.4);
    background: rgba(99,102,241,0.08);
}
.lang-globe { opacity: .8; }
.lang-code {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 12px;
    text-transform: lowercase;
}
.lang-name { color: var(--text); font-weight: 500; }
.lang-arrow { opacity: .6; transition: transform .2s; }
.lang-switcher.open .lang-arrow { transform: rotate(180deg); }

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    list-style: none;
    background: rgba(15, 15, 36, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-width: 160px;
    padding: 6px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    z-index: 50;
}
.lang-switcher.open .lang-menu { display: block; }
.lang-menu a {
    display: block;
    padding: 9px 14px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: all .15s;
}
.lang-menu a:hover {
    background: rgba(99,102,241,0.12);
    color: var(--text);
}

/* 连接钱包按钮 */
.btn-wallet {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: none;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .25s;
    box-shadow: 0 4px 16px rgba(139,92,246,0.3);
    white-space: nowrap;
}
.btn-wallet:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(139,92,246,0.5);
}
.btn-wallet.connected {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}

/* 启动应用程序按钮 */
.btn-launch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #a78bfa 0%, #22d3ee 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all .25s;
    box-shadow: 0 4px 18px rgba(139,92,246,0.35);
    white-space: nowrap;
}
.btn-launch:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(139,92,246,0.55);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all .3s;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* 移动端菜单 */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: rgba(10,10,26,0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link { display: block; padding: 12px 0; font-size: 15px; }
.mobile-menu .btn-block { width: 100%; margin-top: 10px; }

/* 移动端导航折叠 */
.mobile-nav-group { border-bottom: 1px solid var(--border); }
.mobile-nav-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}
.mobile-nav-children {
    display: none;
    padding: 0 0 10px 14px;
    flex-direction: column;
    gap: 2px;
}
.mobile-nav-group.open .mobile-nav-children { display: flex; }
.mobile-nav-children .dropdown-link {
    padding: 9px 12px;
    font-size: 14px;
}

/* =========================================================
   4. BUTTONS
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .25s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99,102,241,0.5);
}
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: var(--glass);
    border-color: var(--primary);
}
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
}

/* =========================================================
   5. HERO 区域
   ========================================================= */
.hero-section {
    position: relative;
    padding: calc(var(--header-h) + 80px) 0 60px;
    min-height: 520px;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
}
.hero-glow-1 {
    width: 600px; height: 600px;
    background: rgba(99,102,241,0.25);
    top: -200px; left: 50%;
    transform: translateX(-50%);
}
.hero-glow-2 {
    width: 400px; height: 400px;
    background: rgba(139,92,246,0.15);
    top: 100px; right: -100px;
}
.hero-content {
    position: relative;
    text-align: center;
    z-index: 2;
}
.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
}
.hero-sub {
    color: var(--text-dim);
    font-size: 18px;
    max-width: 640px;
    margin: 0 auto 36px;
    line-height: 1.7;
}
.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================================================
   6. TICKER 汇率跑马灯
   ========================================================= */
.ticker-section {
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    background: rgba(255,255,255,0.01);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.ticker-track {
    display: flex;
    gap: 48px;
    animation: tickerScroll 60s linear infinite;
    white-space: nowrap;
    width: max-content;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes tickerScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.ticker-code {
    color: var(--text-dim);
    font-weight: 700;
    font-size: 13px;
}
.ticker-name {
    color: var(--text-muted);
    font-size: 12px;
    margin-right: 4px;
}
.ticker-price {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text);
    font-weight: 500;
}
.ticker-change { font-size: 12px; font-weight: 600; }
.ticker-change.up   { color: var(--success); }
.ticker-change.down { color: var(--danger); }

/* =========================================================
   7. SECTIONS 通用
   ========================================================= */
.section { padding: 100px 0; }
.section-dark { background: var(--bg-2); }

.section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 60px;
}
.section-eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 14px;
}
.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}
.section-sub {
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1.7;
}

/* =========================================================
   8. GLASS 通用卡片
   ========================================================= */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* =========================================================
   9. FEATURES 功能卡片网格
   ========================================================= */
.features-section { background: var(--bg); }
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.feature-card {
    position: relative;
    padding: 28px 26px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .3s;
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity .3s;
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99,102,241,0.35);
    box-shadow: 0 16px 48px rgba(99,102,241,0.12);
}
.feature-card:hover::before { opacity: 1; }
.feature-card-top { margin-bottom: 16px; }
.feature-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
}
.status-live { color: var(--success); }
.status-soon { color: var(--warning); }
.feature-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}
.feature-card-desc {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.65;
}

/* =========================================================
   10. HYBRID ENGINE 展示
   ========================================================= */
.hybrid-section {
    background: var(--bg-2);
    position: relative;
    overflow: hidden;
}
.hybrid-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.hybrid-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.15;
}
.hybrid-desc {
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 28px;
}
.hybrid-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hybrid-orb {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hybrid-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(99,102,241,0.3);
    animation: ringPulse 4s ease-in-out infinite;
}
.ring-1 { width: 100%; height: 100%; animation-delay: 0s; }
.ring-2 { width: 75%;  height: 75%;  animation-delay: .5s; border-color: rgba(139,92,246,0.3); }
.ring-3 { width: 50%;  height: 50%;  animation-delay: 1s; border-color: rgba(34,211,238,0.3); }
@keyframes ringPulse {
    0%, 100% { transform: scale(1);    opacity: .6; }
    50%      { transform: scale(1.06); opacity: 1;  }
}
.hybrid-core {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 0 60px rgba(99,102,241,0.6);
    z-index: 2;
}

/* =========================================================
   11. STATS 统计
   ========================================================= */
.stats-section { background: var(--bg); }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 50px;
}
.stat-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .3s;
}
.stat-card:hover {
    border-color: rgba(99,102,241,0.3);
    transform: translateY(-3px);
}
.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 52px;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}
.stat-label {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.5;
}
.otc-block {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
    padding: 32px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.otc-text {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.8;
}

/* =========================================================
   12. ECOSYSTEM 生态系统
   ========================================================= */
.ecosystem-section { background: var(--bg-2); }
.ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
.ecosystem-card {
    display: block;
    padding: 32px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all .3s;
    position: relative;
}
.ecosystem-card:hover {
    border-color: rgba(99,102,241,0.4);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(99,102,241,0.12);
}
.ecosystem-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(99,102,241,0.15);
    color: var(--primary);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 16px;
}
.ecosystem-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}
.ecosystem-desc {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
}
.ecosystem-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    transition: gap .2s;
}
.ecosystem-card:hover .ecosystem-link { gap: 10px; }

/* =========================================================
   13. DEV RESOURCES 开发者资源
   ========================================================= */
.dev-section { background: var(--bg); }
.dev-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.dev-card {
    display: block;
    padding: 26px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all .3s;
}
.dev-card:hover {
    border-color: rgba(34,211,238,0.35);
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(34,211,238,0.08);
}
.dev-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(34,211,238,0.1);
    color: var(--accent);
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    margin-bottom: 14px;
}
.dev-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}
.dev-desc {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.65;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dev-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    transition: gap .2s;
}
.dev-card:hover .dev-link { gap: 9px; }

/* =========================================================
   14. COMMUNITY 社区
   ========================================================= */
.community-section { background: var(--bg-2); }
.community-inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 60px;
    align-items: center;
}
.community-text .section-title { text-align: left; }
.community-text .section-sub { text-align: left; margin-bottom: 28px; }
.community-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.community-cards { display: grid; gap: 20px; }
.community-card {
    padding: 28px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .3s;
}
.community-card:hover { border-color: rgba(99,102,241,0.3); }
.community-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}
.community-card p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}
.community-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.community-socials { display: flex; gap: 12px; }
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 18px;
    text-decoration: none;
    transition: all .2s;
}
.social-link:hover {
    border-color: var(--primary);
    background: rgba(99,102,241,0.1);
}

/* =========================================================
   15. CTA BOX
   ========================================================= */
.cta-box {
    padding: 60px 40px;
    text-align: center;
}
.cta-box h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    margin-bottom: 12px;
}
.cta-box p {
    color: var(--text-dim);
    margin-bottom: 28px;
}

/* =========================================================
   16. FOOTER 页脚
   ========================================================= */
.site-footer {
    background: var(--bg-3);
    border-top: 1px solid var(--border);
    padding: 64px 0 32px;
}
.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 60px;
    margin-bottom: 48px;
}
.footer-brand img { margin-bottom: 16px; }
.footer-brand p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
    max-width: 320px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.footer-col h4 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.footer-col a {
    display: block;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    padding: 5px 0;
    transition: color .2s;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 16px;
}
.copyright { color: var(--text-muted); font-size: 13px; }
.footer-legal { display: flex; gap: 24px; }
.footer-legal a {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: color .2s;
}
.footer-legal a:hover { color: var(--text-dim); }

/* =========================================================
   17. MODAL 弹窗
   ========================================================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.show { display: flex; }
.modal-content {
    position: relative;
    max-width: 420px;
    width: 100%;
    padding: 32px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 18px;
    animation: modalIn .25s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.modal-content h3 {
    font-size: 20px;
    margin-bottom: 20px;
    font-family: 'Space Grotesk', sans-serif;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all .2s;
}
.modal-close:hover {
    background: var(--glass);
    color: var(--text);
}
.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.wallet-opt {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    color: var(--text);
    text-align: left;
    font-family: inherit;
    transition: all .2s;
}
.wallet-opt:hover {
    border-color: var(--primary);
    background: rgba(99,102,241,0.1);
    transform: translateX(2px);
}
.wallet-icon { font-size: 26px; }
.wallet-opt small {
    display: block;
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 2px;
}

/* =========================================================
   18. PAGE HERO 子页面通用头部
   ========================================================= */
.page-hero {
    padding: calc(var(--header-h) + 80px) 0 40px;
    text-align: center;
    position: relative;
}
.page-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 600px; height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.2), transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: -1;
}
.page-hero .section-title { margin-bottom: 12px; }

/* =========================================================
   19. FAQ 手风琴
   ========================================================= */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.faq-item {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all .25s;
}
.faq-item:hover { border-color: rgba(99,102,241,0.3); }
.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 24px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    gap: 16px;
}
.faq-question svg {
    transition: transform .25s;
    flex-shrink: 0;
}
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease, padding .3s ease;
    padding: 0 24px;
}
.faq-item.open .faq-answer {
    max-height: 500px;
    padding: 0 24px 20px;
}
.faq-answer p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.75;
}

/* =========================================================
   20. STAKING 质押
   ========================================================= */
.staking-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}
.staking-card {
    padding: 32px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .3s;
}
.staking-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99,102,241,0.4);
}
.staking-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    margin-bottom: 12px;
}
.staking-card p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
}

/* =========================================================
   21. BRIDGE 跨链桥
   ========================================================= */
.bridge-chains {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}
.bridge-chain {
    padding: 14px 28px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    transition: all .25s;
}
.bridge-chain:hover {
    border-color: var(--primary);
    background: rgba(99,102,241,0.1);
    transform: translateY(-2px);
}

/* =========================================================
   22. PROSE 富文本
   ========================================================= */
.prose {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.85;
}
.prose h2,
.prose h3 {
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    margin: 24px 0 12px;
}
.prose p { margin-bottom: 14px; }
.prose a { color: var(--accent); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose ul,
.prose ol { margin-left: 22px; margin-bottom: 14px; }
.prose code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* =========================================================
   23. UTILS 工具类
   ========================================================= */
.mono {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
}
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* 表格通用 */
.table-wrap {
    overflow-x: auto;
    padding: 4px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.table-wrap table {
    width: 100%;
    border-collapse: collapse;
}
.table-wrap th,
.table-wrap td {
    padding: 14px 18px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.table-wrap th {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.table-wrap tbody tr:hover { background: var(--glass); }
.table-wrap tbody tr:last-child td { border-bottom: none; }

/* 通用 tag */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.tag-live   { background: rgba(16,185,129,0.15); color: var(--success); }
.tag-coming { background: rgba(245,158,11,0.15); color: var(--warning); }
/* =========================================================
   Header — 用户菜单
   ========================================================= */
.header-user {
    position: relative;
}

.btn-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    white-space: nowrap;
}
.btn-user:hover {
    border-color: rgba(99,102,241,0.4);
    background: rgba(99,102,241,0.08);
}

.header-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.header-user-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: rgba(15, 15, 36, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .2s;
}
.header-user.open .header-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-user-menu-head {
    padding: 10px 14px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}
.header-user-menu-head strong {
    display: block;
    font-size: 13px;
    color: var(--text);
}
.header-user-menu-head small {
    color: var(--text-muted);
    font-size: 11px;
    word-break: break-all;
}

.header-user-menu a {
    display: block;
    padding: 9px 14px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: all .15s;
}
.header-user-menu a:hover {
    background: rgba(99,102,241,0.12);
    color: var(--text);
}
.header-user-menu a.danger { color: #ef4444; }
.header-user-menu a.danger:hover { background: rgba(239,68,68,0.12); }

.header-user-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

@media (max-width: 900px) {
    .header-user { display: none; }
}
/* 语言菜单选项 */
.lang-menu a.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: all .15s;
}
.lang-menu a.lang-option:hover {
    background: rgba(99,102,241,0.12);
    color: var(--text);
}
.lang-menu a.lang-option.active {
    background: rgba(99,102,241,0.15);
    color: var(--text);
}
.lang-option-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 18px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: .5px;
    flex-shrink: 0;
}
.lang-option.active .lang-option-code {
    background: rgba(99,102,241,0.3);
    color: #fff;
}
.lang-option-name { flex: 1; }
.lang-check { color: var(--accent); flex-shrink: 0; }

/* 移动端语言切换 */
.mobile-lang-switcher {
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.mobile-lang-switcher > span {
    color: var(--text-muted);
    font-size: 13px;
}
.mobile-lang-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.mobile-lang-option {
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}
.mobile-lang-option.active {
    background: rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.5);
    color: #fff;
}
/* =========================================================
   手机端顶部导航栏（匹配截图）
   ========================================================= */

/* 显示/隐藏辅助类 */
.show-mobile { display: none; }
.hide-mobile { display: initial; }

@media (max-width: 900px) {
    /* -------- Header 基础 -------- */
    :root { --header-h: 60px; }

    .site-header {
        height: var(--header-h);
        background: rgba(10,10,26,0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .header-inner {
        padding: 0 14px;
        gap: 8px;
        height: 100%;
        max-width: 100%;
    }

    /* Logo 缩小 */
    .header-logo img {
        height: 26px;
        width: auto;
    }

    /* header-left 只显示 Logo */
    .header-left { flex: 0 1 auto; gap: 0; }
    .header-nav  { display: none; }

    /* -------- header-actions 布局 -------- */
    .header-actions {
        display: flex !important;
        align-items: center;
        gap: 8px;
        margin-left: auto;
        flex-shrink: 0;
    }

    /* 显示 / 隐藏辅助类 */
    .show-mobile { display: inline !important; }
    .hide-mobile { display: none !important; }

    /* -------- 语言切换按钮（圆形图标） -------- */
    .lang-switcher { display: block !important; }

    .lang-btn {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
        background: rgba(255,255,255,0.05) !important;
        border: 1px solid rgba(255,255,255,0.1) !important;
        gap: 0 !important;
    }
    .lang-btn .lang-code,
    .lang-btn .lang-name,
    .lang-btn .lang-arrow {
        display: none !important;
    }
    .lang-btn .lang-globe {
        width: 18px !important;
        height: 18px !important;
        opacity: .9;
    }

    /* -------- 登录 / 注册 按钮（紫色圆形） -------- */
    .header-actions .btn-wallet {
        display: inline-flex !important;
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
        align-items: center !important;
        background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
        box-shadow: 0 2px 14px rgba(139,92,246,0.5) !important;
    }
    .header-actions .btn-wallet svg {
        width: 17px !important;
        height: 17px !important;
    }

    /* -------- 用户徽章（已登录） -------- */
    .header-actions .header-user { display: block !important; }
    .header-actions .btn-user {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
        background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
        border: none !important;
    }
    .header-actions .header-user-avatar {
        width: 100% !important;
        height: 100% !important;
        font-size: 14px !important;
    }

    /* -------- App 按钮（紫青渐变胶囊） -------- */
    .header-actions .btn-launch {
        display: inline-flex !important;
        height: 38px !important;
        padding: 0 18px !important;
        border-radius: 19px !important;
        background: linear-gradient(135deg, #a78bfa 0%, #22d3ee 100%) !important;
        color: #fff !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        letter-spacing: 0 !important;
        box-shadow: 0 2px 14px rgba(139,92,246,0.5) !important;
        gap: 0 !important;
        align-items: center;
        justify-content: center;
    }

    /* -------- 汉堡菜单 -------- */
    .hamburger {
        display: flex !important;
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        align-items: center;
        justify-content: center;
        background: transparent !important;
        border: none !important;
    }
    .hamburger span {
        width: 18px !important;
        height: 2px !important;
        background: #e2e8f0 !important;
    }

    /* -------- 移动端菜单（全屏抽屉） -------- */
    .mobile-menu {
        top: var(--header-h);
        padding: 20px 18px 24px;
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-menu .nav-link {
        padding: 14px 0;
        font-size: 16px;
        font-weight: 500;
        border-bottom: 1px solid var(--border);
    }

    .mobile-nav-trigger {
        padding: 14px 0;
        font-size: 16px;
        font-weight: 500;
        border-bottom: 1px solid var(--border);
    }

    .mobile-nav-children {
        padding: 6px 0 10px 16px;
    }
    .mobile-nav-children .dropdown-link {
        padding: 10px 12px;
        font-size: 14px;
    }

    .mobile-menu-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid var(--border);
    }
    .mobile-menu-actions .btn { justify-content: center; }
}

/* 兼容更小屏（480px 以下） */
@media (max-width: 420px) {
    .header-inner { padding: 0 10px; gap: 6px; }
    .header-logo img { height: 24px; }
    .header-actions { gap: 6px; }

    .lang-btn,
    .header-actions .btn-wallet,
    .header-actions .btn-user,
    .hamburger {
        width: 34px !important;
        height: 34px !important;
    }
    .header-actions .btn-launch {
        height: 34px !important;
        padding: 0 14px !important;
        font-size: 13px !important;
        border-radius: 17px !important;
    }
}

/* =========================================================
   手机端页脚（规整化）
   ========================================================= */
@media (max-width: 768px) {
    .site-footer {
        padding: 40px 0 24px;
    }

    .footer-top {
        display: block;
        text-align: center;
        margin-bottom: 28px;
    }

    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 28px;
    }
    .footer-brand img {
        margin: 0 auto 12px;
        height: 26px;
    }
    .footer-brand p {
        max-width: 100%;
        font-size: 13px;
        text-align: center;
        color: var(--text-dim);
        line-height: 1.7;
        padding: 0 8px;
    }

    /* 三列并排（或两列 + 一列） */
    .footer-cols {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 24px 12px;
        text-align: center;
        padding-top: 28px;
        border-top: 1px solid var(--border);
    }

    .footer-col h4 {
        font-size: 11px;
        letter-spacing: 1px;
        margin-bottom: 12px;
        color: var(--text-muted);
    }
    .footer-col a {
        font-size: 13px;
        padding: 4px 0;
        color: var(--text-dim);
        line-height: 1.5;
    }
    .footer-col a:hover {
        color: var(--accent);
    }

    .footer-bottom {
        flex-direction: column;
        gap: 14px;
        padding-top: 22px;
        text-align: center;
        border-top: 1px solid var(--border);
        margin-top: 4px;
    }
    .copyright {
        font-size: 12px;
        color: var(--text-muted);
    }
    .footer-legal {
        display: flex;
        gap: 22px;
        justify-content: center;
        flex-wrap: wrap;
    }
    .footer-legal a {
        font-size: 12px;
        color: var(--text-muted);
    }
}

@media (max-width: 420px) {
    .footer-cols {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px 16px;
    }
    .footer-cols .footer-col:last-child {
        grid-column: 1 / -1;
        padding-top: 8px;
        border-top: 1px dashed var(--border);
    }
}

/* =========================================
   RTL (Right-to-Left) 终极修复补丁
   ========================================= */

/* 1. 修复顶部导航栏 (Header) 双重反转问题 */
[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
}
[dir="rtl"] .header-user-menu {
    right: auto;
    left: 0;
}

/* 2. 修复侧边栏 */
[dir="rtl"] .pay-sidebar {
    border-right: none;
    border-left: 1px solid var(--border);
}

/* =========================================
   ⭐️ 核心修复：强制投资组合表格保持 LTR 列顺序
   ========================================= */
/* 让表头和表体保持 LTR 列顺序，不随外层倒转 */
[dir="rtl"] .pay-portfolio-table {
    direction: ltr;
}

/* 强制表头和单元格文字向右对齐 */
[dir="rtl"] .pay-portfolio-table th,
[dir="rtl"] .pay-portfolio-table td {
    text-align: right;
}

/* 价格和余额列强制左对齐（因为它们在表格右侧） */
[dir="rtl"] .pay-portfolio-table th.col-price,
[dir="rtl"] .pay-portfolio-table th.col-balance,
[dir="rtl"] .pay-portfolio-table td.col-price,
[dir="rtl"] .pay-portfolio-table td.col-balance {
    text-align: left !important;
}

/* 代币列内部：图标在右，文字在左 */
[dir="rtl"] .pay-token-cell {
    flex-direction: row-reverse;
    justify-content: flex-end;
}
[dir="rtl"] .pay-token-info {
    text-align: right;
}

/* 锁定数字排版方向为 LTR，防止 $ 符号跑到数字右边 */
[dir="rtl"] .pay-price-value,
[dir="rtl"] .pay-balance-amount,
[dir="rtl"] .pay-balance-usd {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
}

/* 余额列内部文字对齐 */
[dir="rtl"] .pay-portfolio-row .pay-balance-cell {
    text-align: left;
}

/* =========================================
   3. 其它组件修复
   ========================================= */

/* 展开图标翻转：变成向左的箭头 */
[dir="rtl"] .pay-row-expand svg {
    transform: rotate(180deg);
}

/* Toggle 开关滑块修复 */
[dir="rtl"] .pay-toggle {
    /* 默认方向即可，去掉 row-reverse */
}
[dir="rtl"] .pay-toggle-slider::after {
    transform: translateX(16px); /* 关闭时靠右 */
}
[dir="rtl"] .pay-toggle input:checked + .pay-toggle-slider::after {
    transform: translateX(-16px); /* 开启时滑向左侧 */
}

/* 顶部操作栏对齐 */
[dir="rtl"] .pay-portfolio-title-wrap {
    flex-direction: row; /* 恢复默认 RTL 布局 */
}
[dir="rtl"] .pay-portfolio-icon {
    margin-left: 8px;
    margin-right: 0;
}

/* 表单和用户信息 */
[dir="rtl"] .pay-profile-row {
    flex-direction: row;
}
[dir="rtl"] .pay-user-badge {
    flex-direction: row;
}
[dir="rtl"] .pay-settings-section .pay-settings-actions {
    flex-direction: row;
}
[dir="rtl"] .pay-swap-input-row {
    flex-direction: row;
}