/* ============================================================
   JIIL NetTech Studio — 官网主样式
   assets/css/main.css
   ------------------------------------------------------------
   设计语言：企业级「大厂」风格
   - 近黑墨色 + 单一克制强调色(azure)，中性灰阶
   - 精细 1px 边框 + 低透明度分层阴影（拒绝默认重阴影）
   - Manrope 正文 / Space Grotesk 标题
   - 区块统一节奏：eyebrow 眉标 + 大标题 + 副标题
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
    --bg: #ffffff;
    --bg-alt: #f6f7f9;
    --surface: #ffffff;
    --ink: #0c0f14;
    --muted: #5b6472;
    --border: #e7e9ee;
    --border-strong: #d5dae2;

    --accent: #2f6bff;
    --accent-deep: #1a4fd8;
    --accent-soft: rgba(47, 107, 255, 0.08);
    --accent-line: rgba(47, 107, 255, 0.28);

    --gradient-primary: linear-gradient(135deg, #0c0f14 0%, #232a35 100%);
    --gradient-secondary: linear-gradient(135deg, #2f6bff 0%, #1a4fd8 100%);

    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(12, 15, 20, 0.08);

    /* 吉祥物光环（由 theme.js 按时辰插值，日落时变暖） */
    --halo-a: rgba(47, 107, 255, 0.10);
    --halo-b: rgba(14, 159, 138, 0.08);

    /* 吉祥物列宽：首屏 grid 第二列与 .mascot-stage 绝对定位宽度共用，
       保证宽屏下立绘正好落在原来那个位置，拆屏后视觉没有位移 */
    --hero-mascot-col: clamp(340px, 34vw, 470px);

    /* 顶栏实测高度。JS（snapCards.sync）每帧按 header.offsetHeight 覆写，
       这里只是 CSS 兜底值，避免首帧 padding 为 0 造成标题顶到屏幕最上沿 */
    --header-h: 64px;

    --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.08);
    --shadow-2: 0 2px 4px rgba(15, 23, 42, 0.05), 0 24px 48px -16px rgba(15, 23, 42, 0.16);

    --font-display: 'Space Grotesk', 'Manrope', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-body: 'Manrope', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;

    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --section-pad: 112px;
}

.dark-mode {
    --bg: #0a0c10;
    --bg-alt: #0d1015;
    --surface: #13161c;
    --ink: #f2f4f7;
    --muted: #9aa3b2;
    --border: #232730;
    --border-strong: #2e3540;

    --accent: #5b8bff;
    --accent-deep: #7ca4ff;
    --accent-soft: rgba(91, 139, 255, 0.12);
    --accent-line: rgba(91, 139, 255, 0.4);

    --gradient-primary: linear-gradient(135deg, #1a2332 0%, #2f6bff 100%);
    --gradient-secondary: linear-gradient(135deg, #2f6bff 0%, #5b8bff 100%);

    --glass-bg: rgba(10, 12, 16, 0.78);
    --glass-border: rgba(255, 255, 255, 0.08);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
    --shadow-2: 0 2px 4px rgba(0, 0, 0, 0.4), 0 24px 48px -16px rgba(0, 0, 0, 0.6);
}

/* ---------- 基础 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'ss01' 1, 'cv05' 1;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* ---------- 关键帧 ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%      { transform: translateY(-10px); }
}
@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------- 滚动进场 ---------- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(32px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }
.animate-on-scroll.delay-5 { transition-delay: 0.5s; }

/* ---------- 布局 ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ---------- 错误状态 ---------- */
.error-container {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.error-message {
    max-width: 600px;
    width: 100%;
    padding: 44px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-2);
    text-align: center;
}
.error-message h1 {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 18px;
    color: #ef4444;
}
.error-message p {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 28px;
}
.error-message code {
    display: block;
    background: var(--bg-alt);
    padding: 18px;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    text-align: left;
    margin-top: 18px;
    overflow-x: auto;
    color: #dc2626;
}
.error-message button {
    margin-top: 20px;
    padding: 12px 28px;
    background: var(--gradient-secondary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.error-message button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

/* ---------- 加载动画 ---------- */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 20px;
}
.loader-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.loader-text {
    font-size: 15px;
    color: var(--muted);
}

/* ---------- 顶部导航 ---------- */
header {
    padding: 20px 0;
    background-color: var(--glass-bg);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(0);
    opacity: 1;
}
header.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
}
header.header-shrink {
    padding: 10px 0;
    box-shadow: var(--shadow-1);
}
/* 收缩态的 logo 字号只在桌面/平板给足。手机端（≤480）靠 400/340 断点
   逐档缩到 12/11px；这里若不加 min-width 限定，17px 会一路覆盖下去，
   把标题挤出容器被裁（实测 390px 缺 4px，标题显示成 "JIIL NetTech Studic"）。 */
@media (min-width: 481px) {
    header.header-shrink .logo-img { height: 32px; width: 32px; }
    header.header-shrink .logo-text h1 { font-size: 17px; }
    header.header-shrink .logo-text span { font-size: 10px; }
    header.header-shrink nav a { font-size: 13px; }
    header.header-shrink .game-website-button { padding: 6px 14px; font-size: 13px; }
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s ease;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 0;
    /* logo 段可压缩，空间不足时先让文字让位，右侧操作区永远完整 */
    flex: 0 1 auto;
    margin-right: 10px;
}
.logo-img {
    height: 40px;
    width: 40px;
    flex: 0 0 auto;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
}
.logo-text { min-width: 0; overflow: hidden; }
/* 文字优先缩小而不是被裁掉：nowrap + 缩放，字号由断点逐档下调 */
.logo-text h1 { letter-spacing: -0.02em; }
.logo-text h1 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.2;
    white-space: nowrap;
}
.logo-text span {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
/* 站名为主标题文字（h1 留给页面内容标题），样式与旧 h1 保持一致 */
.logo-text .logo-name {
    display: block;
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.2;
    white-space: nowrap;
    text-transform: none;
}
header.header-shrink .logo-text .logo-name { font-size: 17px; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
    /* 语言/主题/菜单等操作按钮永不压缩，空间不足时由左侧 logo 让位 */
    flex: 0 0 auto;
    margin-left: auto;
}
nav ul {
    display: flex;
    list-style: none;
    gap: 22px;
}
nav a {
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
    position: relative;
    transition: color 0.3s ease;
}
nav a:after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
nav a:hover { color: var(--accent); }
nav a:hover:after { width: 100%; }

.game-website-button {
    background: var(--gradient-secondary);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    box-shadow: 0 4px 12px -4px var(--accent-line);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* 窄屏时胶囊绝不允许内部换行：inline 元素一旦宽度被挤就会裂成上下两半 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex: 0 0 auto;
}
/* 文字与图标都不换行，图标为装饰可压缩 */
.game-website-button > span { white-space: nowrap; }
.game-website-button > i { flex: 0 0 auto; white-space: nowrap; }
.game-website-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -6px var(--accent-line);
}
.game-website-button:after { display: none; }

/* 导航项整体不换行；空间不足时先压缩间距，而不是把按钮压扁 */
nav ul { flex-wrap: nowrap; }
nav ul li { flex: 0 0 auto; }
nav a { white-space: nowrap; }

/* 吉祥物入口按钮（顶栏，深色渐变胶囊，与名人堂蓝色区分） */
.mascot-button {
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px -4px rgba(12, 15, 20, 0.35);
}
.mascot-button:hover {
    box-shadow: 0 10px 20px -6px rgba(12, 15, 20, 0.4);
}

/* 明暗模式已改为 .theme-mode 三态切换器（见下方「明暗模式切换器」），此处仅保留语言按钮 */
.lang-toggle {
    background: none;
    border: 1px solid transparent;
    color: var(--ink);
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.lang-toggle:hover {
    background-color: var(--accent-soft);
    color: var(--accent);
}

/* 官方 QQ 群入口（顶栏胶囊按钮） */
.qq-group-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: border-color .2s, color .2s, background .2s;
}
.qq-group-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}
.qq-group-btn svg { flex: none; }
@media (max-width: 480px) {
    .qq-group-btn { width: 34px; padding: 0; justify-content: center; }
    .qq-group-btn span { display: none; }
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--ink);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

/* ---------- Hero 区域 ---------- */
/* 自适应：顶部留白随视口收缩，内容在首屏内垂直居中 */
.hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: clamp(88px, 12vh, 148px) 0 clamp(56px, 9vh, 96px);
    margin-top: 0;
    position: relative;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 80% 60% at 18% 38%, var(--accent-soft) 0%, transparent 62%),
        radial-gradient(ellipse 55% 45% at 82% 18%, rgba(124, 108, 255, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 62% 82%, rgba(14, 165, 233, 0.05) 0%, transparent 52%);
    z-index: 0;
}
.hero-bg::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background:
        radial-gradient(circle at 30% 40%, var(--accent-soft) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(14, 165, 233, 0.04) 0%, transparent 35%);
    animation: float 22s ease-in-out infinite;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 820px;
}
.hero h1,
.hero h2 {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 700;
    line-height: 1.08;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--ink) 30%, var(--muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero p {
    font-size: clamp(16px, 1.8vw, 19px);
    color: var(--muted);
    margin-bottom: 38px;
    max-width: 640px;
    line-height: 1.75;
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}
/* 第 1 屏没有按钮，留着空的 flex 容器会白占一整行高度（移动端实测 44px），
   把文案和轮播点隔开，视觉上像漏排。 */
.hero-buttons:empty { display: none; }
.hero-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.hero-button.primary {
    background: var(--ink);
    color: var(--bg);
}
.hero-button.secondary {
    background: var(--gradient-secondary);
    color: #fff;
    box-shadow: 0 8px 20px -8px var(--accent-line);
}
.hero-button.outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--ink);
}
.hero-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

.hero-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.hero-carousel-container {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.hero-carousel-slide {
    min-width: 100%;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.hero-carousel-slide.active {
    opacity: 1;
    transform: scale(1);
}
.hero-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    color: var(--ink);
    font-size: 15px;
}
.hero-carousel-nav:hover {
    background: var(--surface);
    transform: translateY(-50%) scale(1.08);
    box-shadow: var(--shadow-1);
}
.hero-carousel-nav.prev { left: 12px; }
.hero-carousel-nav.next { right: 12px; }
/* 箭头外置到轮播两侧的留白里。但要留白够宽：容器左右各 28px 内边距，
   <1300px 时外置 60px 会把 prev 箭头顶到屏幕外（1100px 实测左缘 -32px），
   故只在 ≥1300px（容器左缘 ≥42px，外置后仍有 ≥-18px… 实测 1300 时箭头左缘
   约 10px，安全）才外置，更窄的宽度收回轮播内部。 */
@media (min-width: 1300px) {
    .hero-carousel-nav.prev { left: -60px; }
    .hero-carousel-nav.next { right: -60px; }
}

.hero-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 36px;
}

.hero-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--border-strong);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}
.hero-carousel-dot:hover { background: var(--muted); }
.hero-carousel-dot.active {
    background: var(--accent);
    width: 26px;
}
.hero-carousel-dot.has-badge::after {
    content: '';
    position: absolute;
    top: -3px; right: -3px;
    width: 6px; height: 6px;
    background: #ef4444;
    border-radius: 50%;
}

.hero-slide-badge {
    display: inline-block;
    padding: 5px 14px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 20px;
    animation: pulse-badge 2.2s ease-in-out infinite;
}

/* ---------- Hero 双栏 + 吉祥物（原创角色） ---------- */
/* 首屏与吉祥物屏的共同外层，同时是「卡片滚动容器」。
   宽屏：.mascot-stage 绝对定位叠在 .hero 右侧，两者视觉上仍是一屏分栏，
        外层不滚动（内容刚好一屏，滚动手势直接交给页面）。
   窄屏：外层变成 height:100svh + overflow-y:auto 的滚动容器，
        里面 .hero 与 .mascot-stage 各占一整屏，由 scroll-snap 做卡片式吸附；
        滑到容器底部后，滚动手势沿滚动链交还给页面，正文恢复自由滚动。
        断点按视口宽度判定（≤1024px），不按设备类型。 */
.hero-stage {
    position: relative;
    /* 裁剪装饰性溢出：光环宽 118%，会探出舞台右缘几十像素，
       在 1100px 左右刚好顶出文档宽度，弄出一条横向滚动条。
       裁在 hero-stage 边界（= 视口边缘）上，光环本来就是渐隐光晕，看不出切口。
       窄屏由下面的媒体查询改回 overflow-y:auto 的滚动容器。 */
    overflow: hidden;
}

/* 吉祥物屏容器（宽屏下被绝对定位挪进首屏） */
.mascot-stage {
    position: absolute;
    top: 0;
    bottom: 0;
    /* 右边缘对齐 .container 的内容右边缘。
       注意必须用百分比而不是 100vw：绝对定位的包含块是 .hero-stage
       （宽度 = 文档宽，不含滚动条），100vw 含滚动条，会整体偏移一个滚动条宽。 */
    right: max(28px, calc((100% - 1200px) / 2 + 28px));
    width: var(--hero-mascot-col);
    /* 与 .hero 同样的上下留白：原来立绘是 .hero-inner 的 grid 项，
       中心对齐的是「首屏去掉 padding 后」的内容区。
       这里若不复制同样的 padding，立绘会比原来低 (148-96)/2 ≈ 26px。 */
    padding: clamp(88px, 12vh, 148px) 0 clamp(56px, 9vh, 96px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;   /* 光环比舞台宽 18%，不拦截首屏文案的点击 */
    z-index: 1;
}
.mascot-stage-inner {
    width: 100%;
    /* 去掉 .container 的左右 28px 内边距：这一列已经由 --hero-mascot-col
       精确定位，再叠内边距会把立绘整体左移 28px，和原来的位置对不上 */
    padding-left: 0;
    padding-right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}
/* 吉祥物屏的柔和底光（宽屏下叠在首屏背景上，几乎不可见；
   窄屏下它是这一屏自己的背景，让它明显区别于上一屏轮播） */
.mascot-stage-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 50% 46%, var(--accent-soft) 0%, transparent 66%),
        radial-gradient(ellipse 46% 40% at 78% 22%, rgba(124, 108, 255, 0.06) 0%, transparent 58%);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}
/* 窄屏专属的下滑提示（宽屏隐藏：那里吉祥物本来就在同屏，不需要引导） */
.mascot-stage-hint {
    display: none;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, var(--hero-mascot-col));
    align-items: center;
    gap: clamp(20px, 4vw, 56px);
}

/* 吉祥物舞台：高度随视口伸缩，上下都有硬边界，任何窗口都不溢出、不缩水 */
.hero-mascot {
    position: relative;
    /* 必须显式给宽度：它现在是 .mascot-stage-inner 的 flex 项，
       不再是 grid 列项（拆屏前靠 grid 列宽撑着）。
       子元素大多是绝对定位，flex 内容尺寸算出来是 0，立绘会整块消失。 */
    width: 100%;
    height: clamp(360px, min(70vh, 620px), 620px);
    /* 鼠标跟随：app.js 按光标位置写入这三个变量（默认居中不动） */
    --mx: 0px;
    --my: 0px;
    --tilt: 0deg;
}

/* 光环：她是「吉域光芒」的化身（颜色随时辰渐变，见 theme.js）
   跟随鼠标做轻微反向位移，制造视差 */
.mascot-halo {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 118%;
    aspect-ratio: 1;
    transform: translate(calc(-50% + var(--mx) * -0.45), calc(-50% + var(--my) * -0.45));
    background:
        radial-gradient(circle at 50% 50%, var(--halo-a) 0%, transparent 58%),
        radial-gradient(circle at 50% 62%, var(--halo-b) 0%, transparent 46%);
    animation: mascot-halo 7s ease-in-out infinite;
    pointer-events: none;
    transition: transform .25s ease-out;
}
@keyframes mascot-halo {
    0%, 100% { opacity: .75; transform: translate(calc(-50% + var(--mx) * -0.45), calc(-50% + var(--my) * -0.45)) scale(1); }
    50% { opacity: 1; transform: translate(calc(-50% + var(--mx) * -0.45), calc(-50% + var(--my) * -0.45)) scale(1.05); }
}

/* 立绘本体（flex 居中：grid 的 auto 行会按图片固有尺寸算高，把图挤出舞台） */
.mascot-trigger {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transform-origin: 50% 92%;
    animation: mascot-sway 8s ease-in-out infinite;
    transition: transform .28s ease-out;
}
/* 鼠标停在她身上时：停掉摇摆循环，改用 transform 直接跟随光标
   （不能用 animation-play-state:paused —— 动画的 transform 优先级高于声明值，不生效） */
.hero-mascot.looking .mascot-trigger {
    animation: none;
    transform: translate(var(--mx), var(--my)) rotate(var(--tilt));
}
.mascot-img {
    width: auto;
    height: auto;
    max-width: 100%;
    /* 统一展示尺寸：vh 系数恒小于舞台高度，图片永不溢出舞台（max-height 的 100% 在 grid item 上不解析） */
    max-height: min(100%, clamp(300px, 62vh, 560px));
    object-fit: contain;
    opacity: 0;
    filter: drop-shadow(0 20px 34px rgba(15, 23, 42, 0.14));
    animation: mascot-breathe 4.6s ease-in-out infinite;
    transition: opacity .8s ease;
}
/* 立绘加载成功后 app.js 会加 .art-ready，图片才淡入（初始 opacity:0 防止白图闪一下） */
.mascot-img.art-ready { opacity: 1; }
/* 日常装（mascot-main.png）是细长全身像，人物只占画布宽 86%，而夏/冬/生日是宽幅半身像
   占 96%~98%。同画布高度下日常装视觉体量明显偏小，这里只对 daily 放大补偿，
   其他三套尺寸完全不变。scale 是独立属性，与呼吸/摇摆的 transform 叠加互不覆盖。
   注意：max-height 不能用百分比（94% × scale 1.16 = 109%，必然溢出舞台），
   这里直接按「目标视觉高度 ÷ scale」给绝对值，保证放大后仍落在舞台内。 */
html[data-outfit="daily"] .mascot-img {
    scale: 1.16;
    max-height: clamp(250px, 50vh, 450px);
}
.mascot-trigger.no-art .mascot-img { display: none; }
.mascot-fallback { display: none; }
.mascot-trigger.no-art .mascot-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}
.mascot-fallback svg {
    width: auto;
    height: 92%;
    max-width: 100%;
}

@keyframes mascot-breathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@keyframes mascot-sway {
    0%, 100% { transform: rotate(-0.8deg); }
    50% { transform: rotate(0.8deg); }
}
.mascot-img.happy {
    animation: mascot-happy .75s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes mascot-happy {
    0% { transform: translateY(0) rotate(0); }
    35% { transform: translateY(-18px) rotate(-2.5deg); }
    70% { transform: translateY(0) rotate(2deg); }
    100% { transform: translateY(0) rotate(0); }
}

/* 小动作 1：伸懒腰（整体拉长再弹回，落地影子同步压扁） */
.mascot-img.act-stretch {
    animation: mascot-stretch 1.9s cubic-bezier(0.34, 1.3, 0.64, 1);
}
@keyframes mascot-stretch {
    0%   { transform: translateY(0) scale(1, 1); }
    28%  { transform: translateY(-16px) scale(.94, 1.07); }
    55%  { transform: translateY(-20px) scale(.93, 1.1); }
    80%  { transform: translateY(-4px) scale(1.03, .97); }
    100% { transform: translateY(0) scale(1, 1); }
}

/* 小动作 2：打哈欠（身体后仰 + 微微下坠，像真的困了） */
.mascot-img.act-yawn {
    animation: mascot-yawn 2.1s ease-in-out;
}
@keyframes mascot-yawn {
    0%   { transform: translateY(0) rotate(0) scale(1, 1); }
    30%  { transform: translateY(4px) rotate(-1.2deg) scale(1.04, .95); }
    55%  { transform: translateY(9px) rotate(-1.8deg) scale(1.07, .92); }
    78%  { transform: translateY(3px) rotate(.6deg) scale(.99, 1.02); }
    100% { transform: translateY(0) rotate(0) scale(1, 1); }
}

/* 地面落影 */
.mascot-ground {
    position: absolute;
    left: 50%;
    bottom: 8%;
    width: 42%;
    height: 16px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.13) 0%, transparent 70%);
    border-radius: 50%;
    animation: mascot-breathe 4.6s ease-in-out infinite;
    pointer-events: none;
}

/* 漂浮小元素 */
.mascot-deco {
    position: absolute;
    color: var(--muted);
    opacity: .85;
    animation: deco-float 5s ease-in-out infinite;
    pointer-events: none;
}
.mascot-deco svg { width: 100%; height: auto; display: block; }
.deco-star-a { top: 10%; left: 2%; width: 22px; }
.deco-star-b { top: 24%; right: 4%; width: 14px; animation-delay: 1.2s; }
.deco-pencil { top: 6%; right: 20%; width: 32px; animation-delay: .6s; }
.deco-pad { bottom: 15%; left: -2%; width: 38px; animation-delay: 1.8s; }
@keyframes deco-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(6deg); }
}

/* ---------- 小柚问候模式切换器 ---------- */
.greet-mode { position: relative; }
.greet-mode-toggle {
    width: 40px; height: 40px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-sm, 10px);
    color: var(--ink);
    cursor: pointer;
    display: grid; place-items: center;
    font-size: 14px;
    transition: color .2s, border-color .2s, transform .2s;
}
.greet-mode-toggle:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-1px); }
.greet-mode-toggle.active { color: var(--accent); border-color: var(--accent-line); }
.greet-mode-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 248px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    padding: 14px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top right;
    transition: opacity .22s ease, transform .22s cubic-bezier(0.34, 1.56, 0.64, 1), visibility .22s;
    z-index: 90;
}
.greet-mode-panel.open { opacity: 1; visibility: visible; transform: none; }
.greet-mode-title {
    font-family: var(--font-display);
    font-size: 12px; font-weight: 700;
    letter-spacing: .12em;
    color: var(--muted);
    margin-bottom: 10px;
}
.greet-mode-opt {
    width: 100%;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 10px);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: background .18s, border-color .18s;
}
.greet-mode-opt:hover { background: var(--accent-soft); }
.greet-mode-opt.active { background: var(--accent-soft); border-color: var(--accent-line); }
.greet-mode-opt > i { color: var(--accent); font-size: 13px; margin-top: 3px; }
.greet-mode-opt b { display: block; font-size: 13.5px; font-weight: 700; }
.greet-mode-opt small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.greet-mode-slots {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
    padding: 4px 11px 10px 34px;
}
.greet-mode-slots button {
    padding: 6px 0;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: color .18s, border-color .18s, background .18s;
}
.greet-mode-slots button:hover { color: var(--accent); border-color: var(--accent-line); }
.greet-mode-slots button.active { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

@media (max-width: 640px) {
    .greet-mode-panel { width: min(272px, calc(100vw - 32px)); }
    .greet-mode-toggle { width: 36px; height: 36px; }
}

/* ---------- 明暗模式切换器（浅色 / 深色 / 跟随时间） ---------- */
.theme-mode { position: relative; }
.theme-mode-toggle {
    width: 40px; height: 40px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-sm, 10px);
    color: var(--ink);
    cursor: pointer;
    display: grid; place-items: center;
    font-size: 14px;
    transition: color .2s, border-color .2s, transform .2s;
}
.theme-mode-toggle:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-1px); }
.theme-mode-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 262px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    padding: 14px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transform-origin: top right;
    transition: opacity .22s ease, transform .22s cubic-bezier(0.34, 1.56, 0.64, 1), visibility .22s;
    z-index: 90;
}
.theme-mode-panel.open { opacity: 1; visibility: visible; transform: none; }
.theme-mode-title {
    font-family: var(--font-display);
    font-size: 12px; font-weight: 700;
    letter-spacing: .12em;
    color: var(--muted);
    margin-bottom: 10px;
}
.theme-mode-opt {
    width: 100%;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm, 10px);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: background .18s, border-color .18s;
}
.theme-mode-opt:hover { background: var(--accent-soft); }
.theme-mode-opt.active { background: var(--accent-soft); border-color: var(--accent-line); }
.theme-mode-opt > i { color: var(--accent); font-size: 13px; margin-top: 3px; }
.theme-mode-opt b { display: block; font-size: 13.5px; font-weight: 700; }
.theme-mode-opt small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

/* 太阳轨迹：一天时辰的明暗渐变 + 当前位置 */
.theme-mode-track {
    position: relative;
    height: 8px;
    margin: 12px 4px 8px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        #0a0c10 0%, #0e0d16 19%, #fbf3e8 27%, #f8fafc 35%, #ffffff 50%,
        #fcfcfa 65%, #f9e7d2 75%, #1a2130 82%, #0a0c10 90%, #0a0c10 100%);
    border: 1px solid var(--glass-border);
}
.theme-mode-sun {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--ink);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--glass-border), 0 1px 4px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%);
    transition: left 1.2s cubic-bezier(0.4, 0, 0.2, 1), background-color .8s ease;
}
.theme-mode-now {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 11.5px; color: var(--muted);
    padding: 0 4px 2px;
}
.theme-mode-now b { color: var(--ink); font-size: 12px; font-weight: 700; }

@media (max-width: 640px) {
    .theme-mode-panel { width: min(272px, calc(100vw - 32px)); }
    .theme-mode-toggle { width: 36px; height: 36px; }
}

/* 台词气泡（改到右侧：左侧原本太窄显得小，右边空间大且不压立绘） */
.mascot-bubble {
    position: absolute;
    top: 3%;
    right: 0;
    left: auto;
    max-width: min(340px, 46%);
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    padding: 14px 20px;
    font-size: clamp(14px, 1.15vw, 16px);
    font-weight: 600;
    line-height: 1.65;
    color: var(--ink);
    box-shadow: var(--shadow-1);
    opacity: 0;
    transform: translateY(8px) scale(0.92);
    transition: opacity .3s ease, transform .35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 3;
}
.mascot-bubble.show { opacity: 1; transform: none; }

/* ---------- 吉祥物探头彩蛋（滚动跟随，整图贴右侧屏幕） ---------- */
.mascot-peek {
    position: fixed;
    right: 0;
    bottom: 15vh;
    z-index: 60;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    transform: translateX(calc(100% + 28px));
    visibility: hidden;
    transition: transform .6s cubic-bezier(0.34, 1.56, 0.64, 1), visibility .6s;
    will-change: transform;
}
.mascot-peek.show { transform: translateX(0); visibility: visible; }
/* 整张图右缘贴住屏幕边缘（横贴墙姿势） */
.mascot-peek .peek-trigger { margin-right: -2px; }
.peek-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: block;
}
.peek-img {
    /* 方框裁切：换装立绘为全身图，只取头+肩形成探头效果 */
    width: clamp(140px, 18vw, 200px);
    height: clamp(140px, 18vw, 200px);
    object-fit: cover;
    object-position: 50% 12%;
    display: block;
    opacity: 0;
    filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.14));
    transition: opacity .6s ease;
}
.peek-img.art-ready { opacity: 1; }
.peek-trigger.no-art .peek-img { display: none; }
.peek-fallback { display: none; }
.peek-trigger.no-art .peek-fallback { display: block; }
.peek-fallback svg {
    width: clamp(130px, 16vw, 180px);
    height: auto;
    display: block;
    filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.14));
}
.peek-bubble {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    border-bottom-right-radius: 4px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.55;
    color: var(--ink);
    max-width: 220px;
    box-shadow: var(--shadow-1);
    opacity: 0;
    transform: translateX(8px);
    transition: opacity .3s .15s ease, transform .3s .15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.mascot-peek.show .peek-bubble { opacity: 1; transform: none; }

/* 光环颜色已由 --halo-a / --halo-b 驱动（theme.js 按时辰插值），无需按模式覆写 */

/* ---------- 窄屏（≤1024px）：卡片式首屏 ----------
   两块各自成为独立的一整屏，中间不允许停：
     屏 1  顶栏 + 轮播（进场位置，完整占满视口，不漏下一屏）
     屏 2  小柚整屏（点她有台词互动）
   做法：.hero-stage 变成 height:100svh 的滚动容器，两屏在里面各占一整屏，
        scroll-snap-type: y mandatory + scroll-snap-stop: always 保证
        「一次手势最多跨一屏、不能停在中间」。滑到容器底部后，
        滚动手势沿滚动链（scroll chaining）交还给页面，正文恢复自由滑动。
        这里不能把 scroll-snap 挂到 <html> 上：html 级 mandatory 的吸附点
        只有 0 和吉祥物屏顶，滑过吉祥物屏后会被永远拉回 844，
        用户根本离不开这两张卡（实测确认，见 app.js 注释）。
   断点取 1024px 而不是判断设备：窗口窄到放不下左右分栏时就切卡片式，
   桌面/大窗口窗口化时仍是自由滚动的分栏布局。 */
@media (max-width: 1024px) {
    /* 外层成为卡片滚动容器：固定一屏高，内部纵向滚动 + 吸附 */
    .hero-stage {
        position: relative;
        height: 100svh;
        overflow-y: auto;
        overflow-x: hidden;
        scroll-snap-type: y mandatory;
        /* 不设 overscroll-behavior:contain —— 要的就是滑出底部后
           把手势链传递给页面，让正文接着滚 */
        scrollbar-width: none;          /* Firefox */
        -ms-overflow-style: none;       /* 旧 Edge */
    }
    .hero-stage::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

    /* 两张卡：贴顶对齐 + 一次手势只过一张 */
    .hero-stage > .hero,
    .hero-stage > .mascot-stage {
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    /* 吉祥物屏：脱掉绝对定位，成为第二张卡片 */
    .mascot-stage {
        position: relative;
        top: auto; right: auto; bottom: auto;
        width: 100%;
        height: 100svh;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
        overflow: hidden;
        isolation: isolate;
    }
    .mascot-stage-bg { opacity: 1; }
    .mascot-stage-inner {
        width: 100%;
        height: 100%;
        /* 上下留白：顶部必须 ≥ 顶栏高度（fixed 64px），否则气泡会被顶栏压住；
           底部给下滑提示。左右由 .container 的 18/14px 内边距负责。 */
        padding: max(64px, clamp(52px, 8svh, 88px)) 0 clamp(64px, 10svh, 96px);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 屏 1：轮播独占一屏，不再和立绘挤在一起 */
    .hero {
        height: 100svh;
        min-height: 100svh;
        padding: calc(var(--header-h, 64px) + 8px) 0 40px;
        align-items: center;
    }
    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        align-content: center;
    }
    .hero-content {
        order: 1;
        width: 100%;
        max-width: 720px;
        margin: 0 auto;
    }

    /* 立绘在独立一屏里，尺寸只受这一屏高度约束 */
    .hero-mascot {
        display: block;
        order: 2;
        width: 100%;
        max-width: 460px;
        height: clamp(300px, 56svh, 560px);
        margin: 0 auto;
    }
    .mascot-img { max-height: min(100%, clamp(268px, 50svh, 500px)); }
    /* 日常装是细长全身像，同画布高度下偏小，单独放大补偿。
       上限先除以 scale，否则放大后视觉高度会顶出舞台。 */
    html[data-outfit="daily"] .mascot-img {
        scale: 1.14;
        max-height: clamp(232px, 44svh, 436px);
    }
    /* 独立一屏后气泡不必再挤在立绘和文案之间，直接挂到右上角 */
    .mascot-bubble {
        top: clamp(-64px, -7svh, -34px);
        left: auto;
        right: 0;
        transform: translateY(8px) scale(0.92);
        transform-origin: top right;
        max-width: min(280px, 62%);
        font-size: 13px;
        padding: 10px 14px;
        border-bottom-left-radius: 16px;
        border-top-right-radius: 4px;
    }
    .mascot-bubble.show { transform: none; }
    .mascot-trigger { align-items: center; padding: 34px 0 0; }
    .mascot-ground { bottom: 2%; }

    /* 下滑提示：告诉用户还能往下一屏 */
    .mascot-stage-hint {
        display: flex;
        position: absolute;
        left: 0; right: 0;
        bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 8px;
        pointer-events: none;
        z-index: 4;
    }
    .mascot-hint-text {
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.16em;
        color: var(--muted);
        opacity: 0.75;
    }
    .mascot-hint-arrow {
        width: 34px; height: 34px;
        border-radius: 50%;
        border: 1px solid var(--glass-border);
        background: var(--glass-bg);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        color: var(--ink);
        animation: hint-bob 1.9s ease-in-out infinite;
    }
    @keyframes hint-bob {
        0%, 100% { transform: translateY(0); opacity: 0.7; }
        50%      { transform: translateY(5px); opacity: 1; }
    }

    /* 平板同样抬探头，避免贴底压在正文上 */
    .mascot-peek { bottom: 13vh; gap: 10px; z-index: 90; }
    /* 装饰元素在窄屏会顶到边界，统一收进来 */
    .deco-pad { left: 0; }
    .deco-pencil { right: 12%; width: 26px; }
}
/* ---------- 平板（641~1024）：卡片式，但一屏更宽裕，立绘可以再大一号 ---------- */
@media (min-width: 641px) and (max-width: 1024px) {
    .hero-mascot {
        max-width: 560px;
        height: clamp(360px, 62svh, 620px);
    }
    .mascot-img { max-height: min(100%, clamp(330px, 56svh, 560px)); }
    html[data-outfit="daily"] .mascot-img { scale: 1.14; max-height: clamp(272px, 48svh, 480px); }
    .mascot-bubble { font-size: 13.5px; max-width: min(320px, 56%); }
}
@media (max-width: 640px) {
    /* 手机端探头：避开 Safari 底部工具栏与刘海区。
       原来贴 bottom:7vh（844px 视口约 785px），压在正文中间偏下，
       滑动时容易被误认为正文的一部分。抬到 16vh 且图放大，更像"探出来搭话"。 */
    .mascot-peek {
        bottom: calc(16vh + env(safe-area-inset-bottom, 0px));
        padding-right: env(safe-area-inset-right, 0px);
        gap: 9px;
        z-index: 90;
    }
    .peek-img {
        width: clamp(112px, 34vw, 158px);
        height: clamp(112px, 34vw, 158px);
        object-fit: cover;
        object-position: 50% 10%;
        filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.18));
    }
    /* 手机端气泡会盖在正文卡片上，必须给足不透明度 + 描边，
       否则背景文字透出来，两层字叠在一起完全读不了。
       --glass-bg 在移动端偏透明，这里单独换成实底。 */
    .peek-bubble {
        font-size: 12.5px;
        max-width: 46vw;
        padding: 9px 12px;
        background: var(--surface);
        border-color: var(--border);
        box-shadow: 0 8px 22px -6px rgba(15, 23, 42, 0.28);
    }
    /* 手机端点击热区放大，避免误触 */
    .peek-trigger { padding: 5px; margin: -5px; }
    /* 吉祥物独占一屏后，舞台尺寸只跟这一屏的高度走；
       实测 390x844：整屏 844px 减去顶栏 64 与底部提示 76 = 704px 可用，
       舞台取 52svh ≈ 439px，上下都还留得住气泡和地面光圈。 */
    .hero-mascot { height: clamp(280px, 56svh, 460px); max-width: 384px; }
    .mascot-img { max-height: min(100%, clamp(250px, 50svh, 410px)); }
    html[data-outfit="daily"] .mascot-img { scale: 1.1; max-height: clamp(210px, 41svh, 340px); }

    .mascot-bubble { max-width: min(230px, 62%); font-size: 12px; padding: 9px 12px; }
    /* 窄屏隐藏体积大的装饰，只留两颗小星 */
    .deco-pad, .deco-pencil { display: none; }
    .deco-star-a { width: 18px; }
    .deco-star-b { width: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .mascot-img, .mascot-trigger, .mascot-halo, .mascot-ground, .mascot-deco { animation: none !important; }
    /* 光标跟随也是动效，尊重系统设置：不跟随、无过渡 */
    .hero-mascot.looking .mascot-trigger { transform: none; }
    .mascot-trigger, .mascot-halo { transition: none !important; }
    .mascot-peek { transition: visibility .2s; }
}

/* ---------- 区块通用 ---------- */
.section {
    padding: var(--section-pad) 0;
}
.section-title {
    text-align: center;
    margin-bottom: 56px;
}
.section-title .eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
}
.section-title h2 {
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 40px);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
    color: var(--ink);
}
.section-title p {
    font-size: 15px;
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---------- 数据统计 ---------- */
.stats-section {
    padding: var(--section-pad) 0;
    background: var(--bg-alt);
    position: relative;
    overflow: hidden;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.stat-card {
    text-align: center;
    padding: 36px 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-secondary);
    transform: scaleX(0);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.stat-card:hover::before { transform: scaleX(1); }
.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-2);
}
.stat-value {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 46px);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}
.stat-value .stat-prefix,
.stat-value .stat-suffix {
    font-size: 0.55em;
    color: var(--accent);
    font-weight: 700;
}
.stat-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ============================================================
   产品 / 服务卡片（重做：视觉锚点 + 高级感）
   ============================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.45s ease,
                box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
/* 顶部强调线：hover 时从卡片左侧展开 */
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 2;
    background: linear-gradient(90deg, var(--card-accent, var(--accent)), transparent 70%);
    opacity: 0;
    transform: scaleX(0.2);
    transform-origin: left;
    transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-2);
}
.project-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

/* 媒体区：有图用图，无图用渐变 + 图标块 */
.project-media {
    position: relative;
    height: 138px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse 90% 120% at 20% 0%, var(--tile-soft, var(--accent-soft)) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-alt) 0%, var(--surface) 100%);
}
.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover .project-media img { transform: scale(1.04); }

.project-icon-tile {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--tile-a, var(--accent)), var(--tile-b, var(--accent-deep)));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 14px 28px -10px var(--tile-glow, rgba(15, 23, 42, 0.35));
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card:hover .project-icon-tile { transform: translateY(-3px) scale(1.04); }

/* 已停服状态 */
.project-card.is-stopped .project-media { filter: grayscale(1); opacity: 0.75; }
.project-card.is-stopped .project-icon-tile { background: linear-gradient(135deg, #6b7280, #9ca3af); box-shadow: none; }
.project-card.is-stopped .project-body { opacity: 0.72; }
.stopped-badge {
    position: absolute;
    top: 14px; right: 14px;
    padding: 4px 12px;
    background: rgba(12, 15, 20, 0.78);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    border-radius: 999px;
}

.project-body {
    padding: 24px 26px 26px;
}
/* 类别眉标：克制的小号大写（替代原蓝色 pill） */
.project-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--card-accent, var(--accent));
    margin-bottom: 10px;
}
.project-body h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
    color: var(--ink);
    line-height: 1.3;
}
.project-body > p {
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.7;
    font-size: 14px;
}
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}
.project-tag {
    display: inline-block;
    padding: 3px 11px;
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--muted);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.project-links {
    display: flex;
    gap: 16px;
    align-items: center;
}
.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--card-accent, var(--accent));
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: opacity 0.3s ease;
}
.project-link i { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); font-size: 12px; }
.project-link:hover i { transform: translateX(4px); }

/* ---------- 软件产品（复用项目卡片） ---------- */
.software-section { background: var(--bg-alt); }

/* ---------- 发展历程 ---------- */
.milestones-section { background: var(--bg); }
.milestones-timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}
.milestones-timeline:before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    top: 0; bottom: 0;
    background: linear-gradient(180deg, var(--border) 0%, var(--accent-line) 50%, var(--border) 100%);
}
.milestone-item {
    display: flex;
    align-items: center;
    margin-bottom: 44px;
    position: relative;
}
.milestone-item:nth-child(odd) { flex-direction: row-reverse; }
.milestone-year {
    flex: 0 0 104px;
    text-align: center;
    padding: 9px 16px;
    background: var(--gradient-secondary);
    color: white;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.02em;
    z-index: 1;
    box-shadow: 0 8px 18px -8px var(--accent-line);
    transition: transform 0.3s ease;
}
.milestone-item:hover .milestone-year { transform: scale(1.06); }
.milestone-content {
    flex: 1;
    padding: 22px 24px;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin: 0 24px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.milestone-content:hover {
    border-color: var(--accent-line);
    box-shadow: var(--shadow-1);
    transform: translateY(-2px);
}
.milestone-content h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--ink);
}
.milestone-content p {
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}
.milestone-item:nth-child(even) .milestone-content { margin-left: 24px; }
.milestone-item:nth-child(odd) .milestone-content { margin-right: 24px; }

/* ---------- 最新动态 ---------- */
.events-section { background: var(--bg-alt); }
.events-list {
    max-width: 820px;
    margin: 0 auto;
}
.event-item {
    display: flex;
    margin-bottom: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-1);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.event-item:hover {
    transform: translateX(6px);
    border-color: var(--accent-line);
    box-shadow: var(--shadow-2);
}
.event-date {
    flex: 0 0 148px;
    padding: 24px;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.event-date::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.08) 0%, transparent 60%);
}
.event-date .date-day {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.event-date .date-month { font-size: 15px; font-weight: 600; margin-top: 4px; }
.event-date .date-year { font-size: 13px; opacity: 0.85; margin-top: 2px; }
.event-content { flex: 1; padding: 24px 26px; }
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}
.event-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
}
.event-time {
    font-size: 12px;
    color: var(--muted);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 4px 13px;
    border-radius: 999px;
    font-weight: 500;
    white-space: nowrap;
}
.event-description {
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

/* ============================================================
   相关链接卡片（重做：品牌色图标块，接上 color 字段）
   ============================================================ */
.links-section { background: var(--bg-alt); }
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 960px;
    margin: 0 auto;
}
/* 网站服务 6 张卡：三列排布（3 + 3），避免 4 + 1 的孤行 */
#websites .links-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.link-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 24px 22px;
    text-align: left;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease,
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
/* 左侧品牌色细条 */
.link-card::before {
    content: '';
    position: absolute;
    left: 0; top: 16px; bottom: 16px;
    width: 3px;
    border-radius: 3px;
    background: var(--link-accent, var(--accent));
    opacity: 0.85;
    transition: transform 0.35s ease, opacity 0.35s ease;
    transform: scaleY(0.6);
}
.link-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-1);
}
.link-card:hover::before {
    transform: scaleY(1);
    opacity: 1;
}
.link-tile {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--link-accent, var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    box-shadow: 0 8px 18px -8px var(--link-glow, rgba(15, 23, 42, 0.35));
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.link-card:hover .link-tile { transform: translateY(-2px) scale(1.05); }
.link-card h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
}
.link-card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}
.link-card a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--link-accent, var(--accent));
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    margin-top: auto;
    transition: opacity 0.3s ease;
}
.link-card a i { transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); font-size: 12px; }
.link-card a:hover i { transform: translateX(4px); }

/* ---------- 关于我们 ---------- */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}
.about-content p {
    color: var(--muted);
    line-height: 1.85;
    margin-bottom: 20px;
    font-size: 15px;
    text-align: justify;
}
.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ink);
    color: var(--bg);
    padding: 12px 26px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

/* ============================================================
   页脚（重做：企业级多列）
   ============================================================ */
footer {
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
    padding: 72px 0 36px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.7fr repeat(4, 1fr);
    gap: 44px;
    text-align: left;
}
.footer-brand h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 12px;
}
.footer-brand p {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.7;
    max-width: 300px;
}
.footer-col h4 {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 18px;
}
.footer-col a {
    display: block;
    color: var(--muted);
    font-size: 14px;
    padding: 5px 0;
    text-decoration: none;
    transition: color 0.25s ease, transform 0.25s ease;
}
.footer-col a:hover {
    color: var(--accent);
    transform: translateX(3px);
}
.footer-col .footer-note {
    display: block;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--muted);
    opacity: .82;
    margin-top: 2px;
}
.footer-bottom {
    border-top: 1px solid var(--border);
    margin-top: 52px;
    padding-top: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}
.copyright {
    font-size: 13px;
    color: var(--muted);
}
.footer-policies {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
}
.footer-policies a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.25s ease;
}
.footer-policies a:hover { color: var(--accent); }
.footer-policies span { color: var(--border-strong); }
.socials {
    display: flex;
    align-items: center;
    gap: 10px;
}
.socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--muted);
    transition: all 0.25s ease;
}
.socials a:hover {
    color: var(--accent);
    border-color: var(--accent-line);
    transform: translateY(-2px);
}
.socials svg {
    width: 17px;
    height: 17px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }
}
@media (max-width: 768px) {
    :root { --section-pad: 60px; }

    /* 首屏在 ≤1024px 已由「窄屏卡片式」接管（固定 100svh 一整屏）。
       这里只调排版细节，不再改高度 —— 改了就和 scroll-snap 的落点对不上。 */
    .hero {
        padding: calc(var(--header-h, 64px) + 8px) 0 32px;
        margin-top: 0;
    }
    .hero-inner { gap: 0; width: 100%; }
    .hero h1, .hero h2 { font-size: clamp(27px, 8vw, 36px); line-height: 1.2; margin-bottom: 14px; }
    .hero p { font-size: 15.5px; line-height: 1.7; margin-bottom: 0; }
    .hero-slide-badge { margin-bottom: 12px; padding: 4px 12px; }
    .hero-button { padding: 11px 20px; font-size: 13.5px; }
    .hero-buttons { gap: 10px; margin-top: 18px; }
    /* 轮播容器高度由 JS 钉在激活屏上，这里只需给 dots 一个紧凑间距 */
    .hero-carousel-dots { margin-top: 16px; }

    /* 区块标题与留白 */
    .section-title { margin-bottom: 36px; }
    .section-title h2 { font-size: 26px; margin-bottom: 10px; }
    .section-title p { font-size: 14px; padding: 0 4px; }
    .section-title .eyebrow { margin-bottom: 10px; }

    /* 卡片：一律单列，杜绝两列挤压 */
    .projects-grid { grid-template-columns: 1fr; gap: 18px; }
    .links-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
    .stat-card { padding: 22px 14px; }
    .stat-value { font-size: clamp(26px, 8vw, 34px); }
    .project-body { padding: 20px 20px 22px; }
    .project-body h3 { font-size: 17.5px; }
    .link-card { padding: 20px 18px; }

    .nav-right { gap: 8px; }

    /* 发展历程：时间轴靠左，节点与内容纵向不重叠 */
    .milestones-timeline:before { left: 22px; }
    .milestone-item { flex-direction: row !important; margin-bottom: 28px; }
    .milestone-year { flex: 0 0 76px; font-size: 13.5px; padding: 7px 10px; }
    .milestone-content { margin-left: 16px !important; margin-right: 0 !important; padding: 16px 18px; }
    .milestone-content h3 { font-size: 16.5px; }
    .milestone-content p { font-size: 13.5px; line-height: 1.65; }

    /* 动态：日期条横向排布，避免竖着占掉半屏 */
    .event-item { flex-direction: column; margin-bottom: 18px; }
    .event-date {
        flex: 0 0 auto;
        padding: 12px 16px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }
    .event-date .date-day { font-size: 22px; }
    .event-date .date-month { font-size: 13px; margin-top: 0; }
    .event-date .date-year { font-size: 12px; margin-top: 0; }
    .event-content { padding: 18px 20px 20px; }
    .event-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .event-title { font-size: 16.5px; }
    .event-time { font-size: 11.5px; }

    /* 关于我们 */
    .about-content p { font-size: 14.5px; line-height: 1.75; text-align: left; }

    header.header-shrink nav ul { top: 62px; }
    .hero-carousel-nav { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    footer { padding: 48px 0 28px; }
    .footer-col a { font-size: 13.5px; padding: 4px 0; }
    .footer-brand p { font-size: 13px; }
}

@media (max-width: 480px) {
    :root { --section-pad: 48px; }
    .container { padding: 0 18px; }
    /* logo 整块缩小，标题完整可见不被裁切 */
    .logo { gap: 8px; margin-right: 6px; }
    .logo-img { height: 30px; width: 30px; border-radius: 8px; }
    .logo-text h1, .logo-text .logo-name { font-size: clamp(12px, 3.4vw, 15px); }
    .hero h1, .hero h2 { font-size: clamp(25px, 8.5vw, 30px); }
    .section-title h2 { font-size: 22px; }
    .stats-grid { grid-template-columns: 1fr; }
    .links-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    /* 顶栏在小屏只留主标题，副标题隐藏（1080 断点已隐，此处兜底） */
    .logo-text span { display: none; }
    /* ≤480：只按屏宽收宽度，高度比例沿用 640 档（见 640 断点注释） */
    .hero-mascot { max-width: 344px; }
    .mascot-bubble { max-width: min(212px, 58%); font-size: 12px; padding: 8px 11px; }
}
/* 超窄屏（≤400px）：logo 图标与操作按钮再收一档，优先保证标题完整不裁切 */
@media (max-width: 400px) {
    .container { padding: 0 14px; }
    .logo { gap: 6px; margin-right: 4px; }
    .logo-img { height: 26px; width: 26px; border-radius: 7px; }
    .logo-text h1, .logo-text .logo-name { font-size: 12px; letter-spacing: -0.03em; }
    .nav-right { gap: 6px; }
    .hamburger { width: 34px; height: 34px; }
    .theme-mode-toggle, .greet-mode-toggle, .lang-toggle { width: 34px; height: 34px; }
    .hero-mascot { max-width: 324px; }
    .mascot-bubble { max-width: min(196px, 56%); font-size: 11.5px; padding: 7px 10px; }
}
/* 极窄屏（≤340px，如 iPhone SE 竖屏）：标题允许折行，宁可两行也不截字 */
@media (max-width: 340px) {
    .logo { gap: 5px; margin-right: 2px; }
    .logo-img { height: 22px; width: 22px; border-radius: 6px; }
    .logo-text h1, .logo-text .logo-name { font-size: 11px; white-space: normal; line-height: 1.15; }
    .nav-right { gap: 4px; }
    .theme-mode-toggle, .greet-mode-toggle, .lang-toggle { width: 30px; height: 30px; }
    .hamburger { width: 30px; height: 30px; }
}

/* ---------- 导航转抽屉（≤1400px） ----------
   原先断在 768px，后提到 1080px。现导航项增至 11 个（含名人堂/吉祥物/语录胶囊），
   横向排列加左上角 logo 标题共需 ~1400px，故断点再提到 1400px，避免标题被导航挤裁。 */
@media (max-width: 1400px) {
    .hamburger { display: flex; }

    nav ul {
        position: fixed;
        top: 0; right: 0;
        /* 原为 min(300px, 84vw)：390px 手机上占 77% 屏宽，看着"吃掉半屏"。
           收到 min(262px, 72vw)，既留出可见的正文区，关闭按钮也够得着。 */
        width: min(262px, 72vw);
        height: 100vh;
        flex-direction: column;
        background: var(--surface);
        padding: 8px 20px 24px;
        gap: 0;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.22);
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1001;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    nav.active ul { transform: translateX(0); }

    /* 抽屉顶部标题栏：站点名 + 明确的关闭按钮。
       之前抽屉顶通到屏幕外，用户既不知道能关，也没有可点的关闭入口。
       右对齐让开左上角的顶栏 logo，避免两层标题叠在一起出现重影。 */
    nav ul::before {
        content: "菜单";
        display: block;
        position: sticky;
        top: 0;
        z-index: 2;
        margin: 0 -20px 8px;
        padding: 18px 62px 14px 20px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        font-size: 14px;
        font-weight: 700;
        color: var(--ink);
    }
    nav ul::after {
        content: "\f00d";           /* fa-xmark */
        position: absolute;
        top: 12px; right: 14px;
        width: 40px; height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: var(--accent-soft);
        color: var(--accent);
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 17px;
        cursor: pointer;
        z-index: 3;
        -webkit-tap-highlight-color: transparent;
    }
    nav ul::after:active { transform: scale(0.92); }

    nav ul li { border-bottom: 1px solid var(--border); }
    nav ul li:last-child { border-bottom: none; }
    nav ul li a {
        display: block;
        padding: 15px 0;
        font-size: 15px;
    }
    /* 抽屉内的胶囊按钮铺满整行，不再是窄条 */
    nav ul li a.game-website-button {
        display: flex;
        width: 100%;
        margin: 8px 0;
        padding: 13px 16px;
        font-size: 14.5px;
        --mascot-btn-icon-size: 12px;
        --mascot-btn-icon-gap: 6px;
    }
    /* 遮罩由 JS 的 hidden 属性显隐。原先依赖 `nav.active + .nav-overlay`
       相邻兄弟选择器，但 overlay 实际写在 .nav-right 内、nav 是它的子元素，
       永远匹配不上 → 遮罩从不显示 → 抽屉只能靠点空白处关闭。 */
    .nav-overlay {
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0, 0, 0, 0.42);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .nav-overlay[hidden] { display: none; }
    html.menu-open .nav-overlay { opacity: 1; }
    /* 关键层级修复：遮罩(#navOverlay, z-index:1000)在 body 层且排在 header 之后，
       而 header 自身 z-index 也是 1000 —— 同值时后出现的遮罩会整个盖住 header，
       连抽屉一起盖住 → 点抽屉里任何地方命中的都是遮罩，菜单直接被关掉。
       菜单打开期间把 header（含抽屉）抬到遮罩之上，遮罩只负责盖住正文区域。 */
    html.menu-open header { z-index: 1002; }
    /* 抽屉打开时禁止背景滚动（JS 同时锁 body position） */
    html.menu-open { overflow: hidden; }

    nav.active .hamburger i:before { content: '\f00d'; }
}
/* 抽屉化后的 logo 字号只在平板区间给足；手机端仍按 480/400/340 断点逐档下调。
   （本组写在文件末尾，若不限定 min-width，会覆盖 480 断点里更小的字号。） */
@media (min-width: 481px) and (max-width: 1400px) {
    .logo-text h1, .logo-text .logo-name { font-size: clamp(15px, 2vw, 18px); }
    .logo-img { height: 36px; width: 36px; }
    header.header-shrink .logo-img { height: 30px; width: 30px; }
    header.header-shrink .logo-text h1, header.header-shrink .logo-text .logo-name { font-size: 16px; }
}

/* ---------- 横向导航（>1400px）：收紧间距，保证左上角 logo 标题不被导航挤裁 ---------- */
/* 注意：本组断点必须排在 1400 抽屉断点与 480 断点之后。同优先级下后写的胜出。 */
@media (min-width: 1401px) and (max-width: 1600px) {
    nav ul { gap: 10px; }
    nav a { font-size: 13px; }
    .game-website-button { padding: 7px 12px; font-size: 12.5px; }
    header.header-shrink .game-website-button { padding: 5px 10px; font-size: 12px; }
    .logo-text h1, .logo-text .logo-name { font-size: 18px; }
    /* 这一档导航最拥挤，QQ 群按钮只留图标，避免挤压导航 */
    .qq-group-btn { width: 34px; padding: 0; justify-content: center; }
    .qq-group-btn span { display: none; }
}
/* 桌面端：logo 贴近左侧，文字相对图标略微下移 */
@media (min-width: 1401px) {
    header .nav-container { padding-left: 18px; }
    .logo { gap: 10px; margin-right: 6px; }
    .logo-text { transform: translateY(2px); }
}

/* ---------- 矮窗口（笔记本/窗口化）：压缩首屏，保证吉祥物完整居中 ----------
   必须限定 min-width: 1081px。原本写 981px，与平板档（641~1024）重叠，
   1024×800 实测命中这条的 scale:1.12 / 43vh 上限，把立绘顶出舞台 10px。 */
@media (min-width: 1081px) and (max-height: 800px) {
    .hero h1, .hero h2 { font-size: clamp(30px, 3.4vw, 38px); margin-bottom: 14px; }
    .hero p { font-size: 15px; margin-bottom: 20px; line-height: 1.6; }
    .hero-carousel-dots { margin-top: 18px; }
    .hero-mascot { height: clamp(300px, min(62vh, 520px), 520px); }
    .mascot-img { max-height: min(100%, clamp(260px, 56vh, 480px)); }
    /* 矮窗口下日常装同样放大；max-height 给绝对值，不用百分比（见主规则的注释） */
    html[data-outfit="daily"] .mascot-img {
        scale: 1.12;
        max-height: clamp(215px, 43vh, 385px);
    }
}

/* ============================================================
   窄屏卡片式首屏：「换卡」过渡
   ------------------------------------------------------------
   吸附规则本身写在上面 ≤1024px 主档的 .hero-stage 上（滚动容器方案），
   这里只做落点的那张卡淡入上移、另一张退场的过渡。
   JS 按内部滚动位置给 .hero-inner / .mascot-stage-inner 加 .card-active，
   并给 .hero-stage 加 .cards-on 才启用这套渐隐——
   否则 JS 没执行的窗口期两屏会以 0.34 透明度闪一下。
   用 transition 而不是 animation：滚动是连续的，animation 会在
   类名反复增删时重播，来回滑就闪。
   ============================================================ */
@media (max-width: 1024px) {
    .hero-stage.cards-on .hero-inner,
    .hero-stage.cards-on .mascot-stage-inner {
        opacity: 0.34;
        transform: translateY(22px) scale(0.985);
        transition: opacity 0.42s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .hero-stage.cards-on .hero-inner.card-active,
    .hero-stage.cards-on .mascot-stage-inner.card-active {
        opacity: 1;
        transform: none;
    }
}

/* 尊重「减少动效」：不做淡入上移，但吸附行为本身保留（它是功能性导航） */
@media (prefers-reduced-motion: reduce) {
    .hero-stage.cards-on .hero-inner,
    .hero-stage.cards-on .mascot-stage-inner {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .mascot-hint-arrow { animation: none !important; }
}

/* ============================================================
   吉域三风（首页，位于「关于我们」之后）
   ============================================================ */
.winds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.wind-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: 36px 28px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.wind-card:hover {
    border-color: var(--border-strong);
}
.wind-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 4px 16px 4px 19px;   /* 右侧补齐字距造成的视觉偏差 */
    margin-bottom: 18px;
}
.wind-motto {
    font-family: var(--font-display);
    font-size: clamp(19px, 2.6vw, 23px);
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.04em;
    line-height: 1.5;
    margin-bottom: 12px;
}
.wind-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.9;
}

/* 定制软件需求 */
.custom-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
    padding: 40px 44px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}
.custom-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}
.custom-copy h2 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: 12px;
}
.custom-copy p {
    font-size: 14px;
    line-height: 1.9;
    color: var(--muted);
    max-width: 620px;
}
.custom-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    flex: 0 0 auto;
}
.custom-mail {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 24px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: box-shadow .2s, transform .2s;
}
.custom-mail:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(47, 107, 255, .26);
}
.custom-note {
    font-size: 12px;
    color: var(--muted);
}
@media (max-width: 760px) {
    .custom-panel {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px 24px;
        gap: 22px;
    }
    .custom-copy h2 { font-size: 21px; }
}
