/* ==========================================================================
   base.css — 全局基础：设计变量、重置、背景横幅、容器
   依赖顺序：本文件最先加载，所有文件共用其中的 CSS 变量。
   ========================================================================== */

:root {
    --bg-dark: #0b0f14;
    --bg-card: #151c26;
    --bg-card-hover: #1a2330;
    --primary: #35d07f;
    --primary-dark: #2aa865;
    --accent: #58a6ff;
    --text: #e6edf3;
    --text-muted: #9aa7b4;
    --border: #24303e;
    --danger: #f85149;
    --radius: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark); /* 页面主体兜底深色背景 */
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 背景图局部遮罩：只覆盖背景图区域，降低背景干扰、保证前景文字可读（不覆盖页眉下方的空白区） */
.banner-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(11, 15, 20, 0.35);
}

/* 背景层：fixed 全屏背景，脱离文档流（不挤占排版），高度/顶部由 JS 动态控制（桌面全屏 → 移动端页眉之下区域渐变动画） */
.bg-banner {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--bg-top, 0px); /* 页眉高度由 JS 计算（手机端背景从页眉之下开始） */
    width: 100%;
    height: var(--bg-height, 100vh); /* 默认全屏，JS 动态设置 */
    overflow: hidden;
    transition: top 0.5s cubic-bezier(0.22, 1, 0.36, 1), height 0.6s cubic-bezier(0.22, 1, 0.36, 1); /* 窗口缩放时平滑渐变 */
    z-index: 0;
    pointer-events: none;
}

.bg-slider {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg-dark); /* 兜底深色，图片加载前/失败时显示 */
}

.bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    will-change: opacity;
}

.bg-layer.active {
    opacity: 1;
}

/* 底部渐变过渡：背景图 → 空白区域 */
.banner-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40%;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(11, 15, 20, 0) 0%,
        var(--bg-dark) 100%
    );
}

/* 内容置于背景横幅之下，底部为吸底页脚预留空间 */
.container {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem 6rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem 2rem;
    }
}
