@charset "utf-8";

/* =========================================
   1. 全局变量与基础设置 (黄金比例计算核心)
   ========================================= */
:root {
    --primary-color: #1629CC; 
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    
    --pc-header-h: 70px;
    --sp-header-h: 60px;
    --sp-bottom-h: 70px; 
    
    --pc-header-s: calc(var(--pc-header-h) * 0.618);
    --sp-header-s: calc(var(--sp-header-h) * 0.618);
    --sp-bottom-s: calc(var(--sp-bottom-h) * 0.618);
    
    --radial-distance: 140px; 
    --drawer-width: 280px;
    
    /* 动态滚动条补偿宽度 (由 JS 注入) */
    --scrollbar-w: 0px; 
}

body { 
    margin: 0; 
    font-family: 'Noto Sans JP', sans-serif; 
    background-color: #f1f5f9; 
    color: var(--text-dark); 
    overflow-x: hidden; 
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }

/* =========================================
   2. 防抖动机制 (Layout Shift 彻底消除)
   ========================================= */
body.no-scroll { overflow: hidden; padding-right: var(--scrollbar-w) !important; }

/* 各组件独立补偿：保留原有 padding 的基础上，额外加上滚动条宽度 */
.pc-header.no-scroll-pad { padding-right: calc(40px + var(--scrollbar-w)) !important; }
.sp-header.no-scroll-pad { padding-right: calc(15px + var(--scrollbar-w)) !important; }
.sp-bottom-nav.no-scroll-pad { padding-right: var(--scrollbar-w) !important; }

/* =========================================
   3. 双重遮罩层与公共组件
   ========================================= */
.fab-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(5px); 
    opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 999; 
}
.fab-overlay.show { opacity: 1; visibility: visible; }

.drawer-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.4); 
    opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 1004; 
}
.drawer-overlay.show { opacity: 1; visibility: visible; }

.push-left { transform: translateX(calc(var(--drawer-width) * -1)) !important; }
.page-wrapper { min-height: 100vh; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* 页面内容区约束 (新UI专属) */
.content-inner { max-width: 960px; margin: 0 auto; padding: 20px; }

/* =========================================
   4. PC 端 UI 样式 (大屏可见)
   ========================================= */
@media (min-width: 769px) {
    .page-wrapper { padding-top: var(--pc-header-h); }
    .sp-only { display: none !important; }

    .pc-header {
        position: fixed; top: 0; left: 0; width: 100%; box-sizing: border-box; 
        background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
        padding: 0 40px; display: flex; align-items: center; height: var(--pc-header-h); z-index: 1000;
        transition: height 0.3s, box-shadow 0.3s;
    }
    .pc-header.scrolled { height: var(--pc-header-s); box-shadow: 0 4px 10px rgba(0,0,0,0.08); }

    .pc-logo-box { width: 140px; flex-shrink: 0; display: flex; align-items: center; }
    .pc-logo-box img { transition: height 0.3s; }
    .pc-header.scrolled .pc-logo-box img { height: 28px !important; } /* Logo 随动缩小 */

    .pc-nav-menu { flex-grow: 1; display: flex; height: 100%; position: relative; }
    .pc-nav-item { flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: 700; font-size: 14px; transition: color 0.2s; position: static; }
    .pc-nav-item:hover { color: var(--primary-color); }

    /* 100% 等宽 Mega Menu */
    .pc-mega-menu {
        position: absolute; top: 100%; left: 0; width: 100%; 
        background: #ffffff; border-radius: 0 0 12px 12px; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1), 0 1px 0 0 rgba(0,0,0,0.05) inset;
        opacity: 0; visibility: hidden; transform: translateY(10px); transition: all 0.3s;
        display: grid; grid-template-columns: 320px 1fr 250px; overflow: hidden; color: var(--text-dark); text-align: left; cursor: default;
    }
    .pc-nav-item.has-mega:hover .pc-mega-menu { opacity: 1; visibility: visible; transform: translateY(0); }

    /* 左侧菜单支持滚动条，容纳众多子菜单 */
    .mega-col-left { background-color: var(--bg-light); padding: 15px 0; border-right: 1px solid var(--border-color); max-height: 450px; overflow-y: auto; }
    .mega-col-left::-webkit-scrollbar { width: 6px; }
    .mega-col-left::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 4px; }
    
    .sub-menu-item { padding: 10px 24px; font-weight: 500; font-size: 13px; cursor: pointer; transition: 0.2s; display: flex; justify-content: space-between; align-items: center; }
    .sub-menu-item:hover, .sub-menu-item.active { background-color: #ffffff; color: var(--primary-color); box-shadow: inset 3px 0 0 var(--primary-color); }
    
    .mega-col-center { padding: 30px; }
    .center-content-box { display: none; animation: fadeIn 0.3s ease; }
    .center-content-box.active { display: block; }
    .center-title { font-size: 18px; font-weight: 700; margin: 0 0 10px 0; }
    .center-desc { color: var(--text-light); font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
    .center-image { width: 100%; height: 160px; background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-weight: bold; font-size: 12px; }
    
    .mega-col-right { padding: 30px 24px; background-color: #fafafa; border-left: 1px solid var(--border-color); }
    .right-title { font-size: 14px; color: var(--text-light); text-transform: uppercase; margin-bottom: 15px; font-weight: 700; }
    .news-item { margin-bottom: 15px; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
    .news-item:hover .news-text { color: var(--primary-color); }
    .badge-new { background: #ef4444; color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: bold; margin-top: 2px; }
    .news-text { font-size: 13px; line-height: 1.5; font-weight: 500; transition: color 0.2s; }
    
    @keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
}

/* =========================================
   5. SP 端 UI 样式 (小屏手机端可见)
   ========================================= */
@media (max-width: 768px) {
    .page-wrapper { padding-top: var(--sp-header-h); padding-bottom: 80px; } /* 底部留空给悬浮菜单 */
    .pc-only { display: none !important; }

    /* --- SP 页头样式 --- */
    .sp-header {
        position: fixed; top: 0; left: 0; width: 100%; height: var(--sp-header-h); 
        background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        display: flex; align-items: center; justify-content: space-between; padding: 0 15px; box-sizing: border-box; z-index: 1000;
        transition: height 0.3s, transform 0.3s;
    }
    .sp-header.scrolled { height: var(--sp-header-s); }

    /* ★ 左侧：固定最小宽度，保证 Logo 空间 */
    .sp-header-left { flex: 1; display: flex; justify-content: flex-start; align-items: center; min-width: 60px; }
    .sp-header-left img { transition: height 0.3s; }
    .sp-header.scrolled .sp-header-left img { height: 22px !important; }

    /* ★ 右侧：固定最小宽度，保证 Icon 空间 */
    .sp-header-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; min-width: 60px; }
    
    /* ★ 中间：核心修复，防止文字过长挤掉右侧图标 */
    .sp-header-center { 
        flex: 2; 
        text-align: center; 
        font-weight: 700; 
        font-size: 16px; 
        white-space: nowrap; 
        overflow: hidden; 
        text-overflow: ellipsis; /* 文字超出时显示 ... */
        min-width: 0;            /* Flex 布局防止撑破的黑科技 */
        padding: 0 10px;         /* 给文字左右留点呼吸空间 */
        transition: font-size 0.3s; 
    }
    .sp-header.scrolled .sp-header-center { font-size: 13px; }
    
    /* ★ 菜单图标：变大、改颜色 */
    .sp-menu-icon { 
        font-size: 32px;               /* 字体变大 */
        color: var(--primary-color);   /* 改为网站主题色 */
        transition: transform 0.3s; 
        cursor: pointer; 
    }
    .sp-header.scrolled .sp-menu-icon { transform: scale(0.85); }

    /* --- SP 右侧推开式手风琴抽屉 --- */
    .sp-drawer {
        position: fixed; top: 0; right: calc(var(--drawer-width) * -1); 
        width: var(--drawer-width); height: 100%; background: #fff; box-shadow: inset 4px 0 15px rgba(0,0,0,0.05);
        z-index: 1005; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; flex-direction: column; overflow-y: auto;
    }
    .drawer-header { height: 60px; padding: 0 20px; display: flex; align-items: center; justify-content: flex-end; border-bottom: 1px solid var(--border-color); }
    .drawer-close { font-size: 24px; color: var(--text-light); cursor: pointer; padding: 10px; }
    
    .drawer-nav { padding: 10px 0; }
    .accordion-item { border-bottom: 1px solid #f1f5f9; }
    .accordion-title { padding: 15px 20px; font-size: 15px; font-weight: 700; color: var(--text-dark); display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: background 0.2s; }
    .accordion-title:active { background: #f8fafc; }
    .arrow { font-size: 12px; transition: transform 0.3s ease; color: var(--text-light); }
    .accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; background: #f8fafc; }
    .accordion-content li a { display: block; padding: 12px 20px 12px 40px; font-size: 14px; color: #475569; border-bottom: 1px solid #e2e8f0; }
    .accordion-item.active .accordion-title { color: var(--primary-color); }
    .accordion-item.active .arrow { transform: rotate(180deg); color: var(--primary-color); }

    /* --- SP 底部横向菜单 --- */
    .sp-bottom-nav {
        position: fixed; bottom: 0; left: 0; width: 100%; height: var(--sp-bottom-h);
        background: #ffffff; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); box-sizing: border-box;
        display: flex; justify-content: space-around; align-items: center;
        z-index: 1000; padding-bottom: env(safe-area-inset-bottom);
        transition: height 0.3s, transform 0.3s; 
    }
    .sp-bottom-nav.scrolled { height: var(--sp-bottom-s); }
    
    .nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; cursor: pointer; color: #475569; }
    .nav-icon { font-size: 20px; transition: transform 0.3s; }
    .nav-text { font-size: 10px; margin-top: 2px; transition: opacity 0.2s, height 0.2s; font-weight: 700; }
    .sp-bottom-nav.scrolled .nav-text { opacity: 0; height: 0; overflow: hidden; }
    .sp-bottom-nav.scrolled .nav-icon { transform: scale(0.9); }

    .fab-container { position: relative; flex: 1; display: flex; justify-content: center; align-items: center; height: 100%; }
    .fab-wrapper { position: relative; display: flex; justify-content: center; align-items: center; transform: translateY(-18px); transition: transform 0.3s; }
    .sp-bottom-nav.scrolled .fab-wrapper { transform: translateY(0); }
    
    /* 绝对居中的 FAB [+] 按钮 */
    .fab-main {
        width: 56px; height: 56px; background: var(--primary-color); border-radius: 50%;
        display: flex; align-items: center; justify-content: center; color: white; 
        font-size: 40px; font-weight: 900; line-height: 0; padding-bottom: 4px; 
        box-shadow: 0 4px 12px rgba(22, 41, 204, 0.4); border: none; z-index: 1002;
        transition: width 0.3s, height 0.3s, font-size 0.3s, transform 0.3s, background 0.3s;
    }
    .sp-bottom-nav.scrolled .fab-main { width: 34px; height: 34px; font-size: 26px; padding-bottom: 2px; }
    .fab-container.active .fab-main { transform: rotate(45deg); background: #ef4444; }

    /* 径向折扇弹出引擎 */
    .radial-menu { position: absolute; top: 50%; left: 50%; width: 0; height: 0; z-index: 1001; }
    .menu-item {
        position: absolute; top: 0; left: 0; transform: translate(-50%, -50%) rotate(0deg) translateY(0) scale(0);
        opacity: 0; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
        display: flex; flex-direction: column; align-items: center; pointer-events: none;
    }
    .fab-container.active .menu-item { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) rotate(var(--angle)) translateY(calc(var(--radial-distance) * -1)) scale(1); }
    
    .item-icon { width: 44px; height: 44px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,0.15); margin-bottom: 8px; font-size: 18px; }
    .item-label { writing-mode: vertical-rl; text-orientation: mixed; font-size: 12px; font-weight: 700; color: #1e293b; background: rgba(255,255,255,0.95); padding: 6px 3px; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
}

/* =========================================
   6. 设计书 / 正文内容专用样式
   ========================================= */
.spec-doc { max-width: 900px; margin: 40px auto; background: white; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); padding: 40px; }
.spec-doc h2 { border-bottom: 3px solid var(--primary-color); padding-bottom: 10px; margin-top: 0; color: var(--text-dark); }
.spec-doc h3 { color: var(--primary-color); margin-top: 30px; display: flex; align-items: center; gap: 8px; font-size: 18px; }
.spec-doc h3::before { content: "■"; font-size: 14px; }
.spec-doc ul { padding-left: 20px; list-style-type: disc; }
.spec-doc li { margin-bottom: 10px; line-height: 1.6; color: #475569; font-size: 15px; }
.spec-doc strong { color: var(--text-dark); }

/* =========================================
   7. 动态通知栏 (Information Center)
   ========================================= */
#global-notice-area {
    width: 100%;
    margin-bottom: 20px;
}

/* 基础通知卡片样式 */
.global-notice {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    animation: noticeFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transition: opacity 0.4s ease, transform 0.4s ease, height 0.4s ease;
}

@keyframes noticeFadeIn {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 隐藏状态 (用于 JS 自动消失) */
.global-notice.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* 内容区 (支持后台传来的 HTML) */
.notice-content { flex: 1; margin-left: 10px; }

/* 关闭按钮 */
.notice-close {
    background: none; border: none; font-size: 20px; cursor: pointer;
    opacity: 0.5; padding: 0 0 0 10px; transition: opacity 0.2s;
}
.notice-close:hover { opacity: 1; }

/* -----------------------------------
   Level: Info (緑 - 绿)
----------------------------------- */
.notice-info { background-color: #f6ffed; border: 1px solid #b7eb8f; color: #237804; box-shadow: 0 4px 12px rgba(82, 196, 26, 0.05); }
.notice-info::before { content: "✅"; font-size: 1.2rem; margin-top: 2px; }
.notice-info .notice-close { color: #237804; }

/* -----------------------------------
   Level: Warning (黄 - 黄)
----------------------------------- */
.notice-warning { background-color: #fffbe6; border: 1px solid #ffe58f; color: #d48806; box-shadow: 0 4px 12px rgba(250, 173, 20, 0.05); }
.notice-warning::before { content: "💡"; font-size: 1.2rem; margin-top: 2px; }
.notice-warning .notice-close { color: #d48806; }

/* -----------------------------------
   Level: Error (赤 - 红)
----------------------------------- */
.notice-error { background-color: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; box-shadow: 0 4px 12px rgba(245, 34, 45, 0.05); }
.notice-error::before { content: "🚨"; font-size: 1.2rem; margin-top: 2px; }
.notice-error .notice-close { color: #cf1322; }

/* 手机端微调 */
@media (max-width: 768px) {
    .global-notice { padding: 10px 15px; font-size: 0.85rem; }
}