/* 字体由 index.html 独立 <link> 引入，避免 @import 失败时整份样式表被浏览器忽略 */

/* AOS 外链失败或未 init 时，避免 data-aos 区块长期 opacity:0 导致“整页空白” */
html:not(.aos-initialized) [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
}

:root { --primary: #6366f1; --accent: #a855f7; }
body { 
    background: #f8fafc; 
    overflow-x: hidden; 
    font-family: 'Noto Sans SC', sans-serif; 
    color: #1e293b;
    font-size: 16px; /* 基础字号提升 */
}

/* 顶部行情条 */
.ticker-wrap {
    position: fixed; top: 0; width: 100%; height: 44px;
    background: #0f172a; overflow: hidden; z-index: 1001;
    display: flex; align-items: center;
}
.ticker { display: flex; white-space: nowrap; animation: ticker 60s linear infinite; }
.ticker-item { display: flex; align-items: center; padding: 0 35px; color: #fff; font-size: 13px; font-family: 'JetBrains Mono'; font-weight: bold; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* 极光背景 */
.aurora {
    position: fixed; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    filter: blur(100px); z-index: -1; animation: float 20s infinite alternate;
}
@keyframes float { 0% { transform: translate(-10%, -10%); } 100% { transform: translate(20%, 10%); } }

/* Bento 盒子基础样式 (参考图风格) */
.bento-box {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 2.5rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* === 高级环境光效果增强 === */
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.bento-box:hover {
    transform: translateY(-12px);
    box-shadow: 0 40px 80px -15px rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
}

/* ====== 环境光晕层 ====== */
.bento-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(
        800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
        rgba(99, 102, 241, 0.06), 
        transparent 40%
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.bento-box:hover::before {
    opacity: 1;
}

/* 优化原生边框，增加微弱的光泽感 */
.bento-box::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    background: radial-gradient(
        400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(99, 102, 241, 0.3), 
        transparent 40%
    ) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.bento-box:hover::after {
    opacity: 1;
}

/* 代码动态输入效果 */
.code-cursor::after {
    content: "|";
    animation: blink 1s infinite;
    color: var(--primary);
}
@keyframes blink { 50% { opacity: 0; } }

/* 文字变动呼吸灯效果 */
@keyframes text-pulsate {
  0%, 100% { text-shadow: 0 0 4px rgba(99, 102, 241, 0.1); }
  50% { text-shadow: 0 0 20px rgba(99, 102, 241, 0.8), 0 0 30px rgba(168, 85, 247, 0.4); }
}
.breathing-glow { animation: text-pulsate 2.5s infinite ease-in-out; }

/* Hero 区 K 线背景：仅覆盖标题+副标题+CTA 区域，不顶到 ticker/nav */
.hero-financial-section {
    position: relative;
    isolation: isolate;
    margin-bottom: 8rem;
    padding: 1.5rem 0 2.5rem;
}
.hero-financial-content {
    position: relative;
    z-index: 1;
}
#financialCanvas {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
    -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
}
@media (max-width: 768px) {
    .hero-financial-section {
        margin-bottom: 5rem;
        padding: 0.5rem 0 2rem;
    }
    #financialCanvas {
        -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 92%);
        mask-image: linear-gradient(to bottom, black 40%, transparent 92%);
    }
}

@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr !important; }
    .h5-padding { padding-top: 140px !important; }
}

/* 优化后的数据统计板块样式 */
.stats-board {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-radius: 2rem;
    overflow: hidden;
    box-shadow: 0 16px 48px -8px rgba(99,102,241,0.09);
    background: #fff;
    border: 1px solid #e0e7ef;
    margin-bottom: 0;
}
.stat-item {
    flex: 1;
    padding: 2.8rem 0 2.2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    transition: background .18s, box-shadow .15s;
}
.stat-item:not(:first-child) {
    border-left: 1px solid #f1f5f9;
}
.stat-number {
    font-size: 2.7rem;
    font-weight: 900;
    color: #6366f1;
    font-style: italic;
    letter-spacing: -0.01em;
    line-height: 1;
    margin-bottom: 0.5rem;
    transition: color .3s;
}
.stat-label {
    font-size: 0.96rem;
    color: #64748b;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: .22em;
    margin-top: 0.2rem;
    white-space: nowrap;
    transition: color .3s;
}
.stat-item:hover {
    background: linear-gradient(90deg, #f0f5ff 0%, #f3e8ff 100%);
    box-shadow: 0 4px 32px -8px rgba(99,102,241,0.13);
}
@media (max-width: 1000px) {
    .stats-board {
        flex-wrap: wrap;
        border-radius: 1.5rem;
    }
    .stat-item {
        flex: 1 0 50%;
        min-width: 50%;
        border-bottom: 1px solid #f1f5f9;
        border-left: none !important;
    }
    .stat-item:nth-child(odd) {
        border-right: 1px solid #f1f5f9;
    }
    .stat-item:nth-child(5) {
        border-bottom: none;
        border-right: none;
    }
}
@media (max-width: 640px) {
    .stat-item {
        flex: 1 0 50%;
        min-width: 50%;
        padding: 2rem 0 1.6rem;
        border-bottom: 1px solid #f1f5f9;
        border-left: none !important;
    }
    .stat-item:nth-child(odd) {
        border-right: 1px solid #f1f5f9;
    }
    .stat-item:nth-child(even) {
        border-right: none;
    }
    /* 第 5 项单独占一行并居中 */
    .stat-item:nth-child(5) {
        flex: 1 0 100%;
        min-width: 100%;
        border-right: none !important;
        border-bottom: none;
    }
    .stat-number {
        font-size: 2rem;
    }
    .stat-label {
        font-size: 0.72rem;
        letter-spacing: .1em;
        white-space: normal;
        text-align: center;
        padding: 0 0.35rem;
    }
}

/* 限制代码块的宽高和滚动 */
.code-scrollable {
    max-width: 100%;
    min-height: 140px;
    max-height: 210px;
    overflow-x: auto;
    overflow-y: auto;
    white-space: pre; /* 让代码保留原本格式, 遏制换行 */
    word-break: break-all;
    word-wrap: break-word;
}
@media (max-width:768px){
    .code-scrollable {
        font-size: 12px !important;
        max-height: 120px;
    }
}
