/* R8：全局重置 / 滚动条 / html / body / .theme-toggle / navShimmer 与 theme_base.css 重复，已收敛（首页先于本文件加载 theme_base.css） */

/* 仅交互元素显式声明过渡，避免 * 通配符 */
.nav-link, .card, .btn-more, .theme-toggle, .menu-toggle,
.global-search-btn, .mail-notify-btn, .search-type-btn,
.search-result-item, .dropdown a, .dropdown {
    transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275),
                background-color 0.3s ease,
                border-color 0.3s ease,
                color 0.2s ease,
                box-shadow 0.3s ease,
                opacity 0.3s ease;
}
/* 导航栏 */
/* header 用 100vw 覆盖到滚动条槽（含最右侧），使毛玻璃底层延伸到屏幕最右边；
   由此产生的亚像素横向溢出由 body 的 overflow-x:hidden（theme_base.css）吸收，无需在 html 上加 overflow-x:clip。
   切勿再给 html 加 overflow-x:clip/hidden——它会把 fixed header 裁到内容边缘（clientWidth），
   导致滚动条槽处的毛玻璃消失（右上角"缺口"）。 */
header { 
    position: fixed; 
    top: 0; 
    width: 100vw; 
    height: 60px; 
    background: var(--nav-bg); 
    z-index: 9999; 
    border-bottom: 1px solid var(--glass-border); 
    display: flex; 
    justify-content: center; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}
.nav-wrapper {
    position: relative;
    width: 100%;
    /* 全宽三段式 header：logo 绝对定位左缘、导航居中、右侧按钮绝对定位右缘。
       勿加 max-width——宽屏下会把三者收进居中内容带，右侧按钮到视口右缘间出现空玻璃区（右上角空缺） */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 32px;
    height: 100%;
    overflow: visible;
}
.logo {
    position: absolute;
    left: 32px;
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-blue);
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(100, 149, 237, 0.3);
    z-index: 2;
    animation: logoPulse 3s ease-in-out infinite;
}

.nav-menu {
    display: flex;
    gap: 25px;
    height: 100%;
    white-space: nowrap;
    overflow: visible;
    flex-shrink: 1;
    min-width: 0;
    /* 显式定位上下文：供液态胶囊定位，且避免 lz-liquid 注入内联 position:relative
       盖过移动端抽屉的 position:fixed（内联优先级高于样式表） */
    position: relative;
}
.nav-wrapper > div:last-child {
    position: absolute;
    right: 32px;
    z-index: 2;
}
/* 防御层：当 .nav-menu 被脚本搬到 body 直挂时（修复 Safari iOS backdrop-filter 截断 fixed 后代），
   即使媒介查询不命中也强制按抽屉形态渲染，避免触屏宽屏环境下回退桌面 flex 残留在页面下方。 */
body > .nav-menu {
    position: fixed;
    top: 60px;
    right: 10px;
    bottom: 10px;
    width: 260px;
    height: auto;
    flex-direction: column;
    padding: 10px;
    background: rgba(20, 20, 25, 0.97);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    transform: translateX(calc(100% + 16px));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(140,140,140,.45) transparent;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    z-index: 10001;
}
body > .nav-menu::-webkit-scrollbar { width: 6px; height: 6px; }
body > .nav-menu::-webkit-scrollbar-track { background: transparent; }
body > .nav-menu::-webkit-scrollbar-thumb { background: rgba(140,140,140,.4); border-radius: 3px; }
html[data-theme="light"] body > .nav-menu {
    background: rgba(245, 245, 247, 0.97);
}
body > .nav-menu.active {
    transform: translateX(0);
}
/* 抽屉内菜单项改为块级堆叠：基础 .nav-item 是 display:flex，会让子下拉成为横向 flex 兄弟飞到右侧，必须重置为 block 才能让下拉在父项下方竖直展开 */
body > .nav-menu .nav-item {
    display: block;
    height: auto;
    position: relative;
}
body > .nav-menu .dropdown {
    display: none;
    position: static;
    left: auto;
    top: auto;
    padding: 4px 5px;
    border: 1px solid var(--glass-border);
    border-left: 2px solid var(--brand-blue);
    border-radius: 12px;
    margin: 4px 0 8px 6px;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: rgba(0,0,0,0.02);
    min-width: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
[data-theme="dark"] body > .nav-menu .dropdown {
    background: rgba(255,255,255,0.03);
}
/* 三级嵌套卡片：统一细边框、去蓝色左强调、略浅底，形成内嵌层次（匹配 demo 形态） */
body > .nav-menu .dropdown.level-3 {
    border-left: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.015);
    margin-left: 4px;
}
[data-theme="dark"] body > .nav-menu .dropdown.level-3 {
    background: rgba(255,255,255,0.02);
}
body > .nav-menu .nav-item.open > .dropdown {
    display: block;
}
body > .nav-menu .nav-link {
    font-size: 16px;
    padding: 13px 16px;
    border-radius: 12px;
    margin: 2px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
body > .nav-menu .nav-link .arrow {
    margin-left: 10px;
    font-size: 12px;
    opacity: 0.5;
    transition: transform 0.3s;
}
body > .nav-menu .nav-item.open > .nav-link .arrow {
    transform: rotate(180deg);
}
body > .nav-menu .dropdown .nav-link {
    font-size: 14px;
    padding: 10px 18px;
}
.nav-item { 
    position: relative; 
    height: 100%;
    display: flex;
    align-items: center;
}
.nav-link { 
    font-size: 14px; 
    color: var(--text-color); 
    opacity: 0.95; 
    padding: 10px 15px; 
    display: block; 
    cursor: pointer; 
    border-radius: 12px;
    position: relative;
    z-index: 2;
}
.nav-link:hover { 
    opacity: 1; 
    color: var(--brand-blue); 
}
/* 当前页静态高亮（非胶囊）：品牌蓝 + 加粗 */
.nav-link.is-current {
    opacity: 1;
    color: var(--brand-blue);
    font-weight: 600;
}

/* PC端下拉列表 */
@media (min-width: 769px) {
    .dropdown { 
        position: absolute; 
        top: 100%; 
        left: 0; 
        background: rgba(30, 30, 35, 0.92);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        min-width: 200px; 
        padding: 12px 0; 
        border-radius: 16px; 
        opacity: 0; 
        visibility: hidden; 
        transform: translateY(15px) scale(0.95); 
        transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), visibility 0.3s; 
        box-shadow: var(--card-shadow); 
        border: 1px solid var(--glass-border);
        z-index: 9999;
    }
    [data-theme="light"] .dropdown {
        background: rgba(255, 255, 255, 0.95);
    }
    .nav-item:hover > .dropdown { 
        opacity: 1; 
        visibility: visible; 
        transform: translateY(5px) scale(1); 
    }
    .dropdown .dropdown { 
        top: -12px; 
        left: 100%; 
        margin-left: 8px; 
    } /* 三级向右弹出 */
    /* 二级 has-sub 箭头朝右（三级从右侧弹出）：HTML 仍输出 ▾，此处旋转为 ▸ */
    .dropdown .has-sub > .nav-link .arrow { 
        display: inline-block;
        transform: rotate(-90deg); 
    }
    .dropdown a { 
        font-size: 14px; 
        padding: 12px 16px; 
        display: block; 
        border-radius: 8px; 
        color: var(--text-color); 
        margin: 0 8px;
        transition: background 0.2s ease;
    }
    .dropdown a:hover { 
        color: var(--brand-blue) !important;
    }
    
    .menu-toggle { 
        display: none; 
    } /* PC端隐藏汉堡菜单 */
}

/* 滚动提示箭头：模板常驻输出，仅移动端媒体查询内激活（display:flex），桌面端默认隐藏 */
.scroll-hint { display: none; }

/* 移动端样式 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 60px;
        right: 10px;
        bottom: 10px;
        width: 260px;
        height: auto;
        background: rgba(20, 20, 25, 0.97);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        flex-direction: column;
        padding: 10px;
        border: 1px solid var(--glass-border);
        border-radius: 20px;
        transform: translateX(calc(100% + 16px));
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: rgba(140,140,140,.45) transparent;
        box-shadow: 0 12px 40px rgba(0,0,0,0.35);
        z-index: 10001;
    }
    .nav-menu::-webkit-scrollbar { width: 6px; height: 6px; }
    .nav-menu::-webkit-scrollbar-track { background: transparent; }
    .nav-menu::-webkit-scrollbar-thumb { background: rgba(140,140,140,.4); border-radius: 3px; }
    [data-theme="light"] .nav-menu {
        background: rgba(245, 245, 247, 0.97);
    }
    .nav-menu.active { 
        transform: translateX(0); 
    }
    .nav-item {
        display: block;
        height: auto;
        position: relative;
    }
    .dropdown { 
        display: none; 
        position: static; 
        left: auto;
        top: auto;
        padding: 4px 5px; 
        border: 1px solid var(--glass-border);
        border-left: 2px solid var(--brand-blue); 
        border-radius: 12px;
        margin: 4px 0 8px 6px; 
        background: rgba(0,0,0,0.02);
        min-width: 0;
        box-shadow: none;
    }
    [data-theme="dark"] .dropdown {
        background: rgba(255,255,255,0.03);
    }
    .dropdown.level-3 {
        border-left: 1px solid var(--glass-border);
        background: rgba(0,0,0,0.015);
        margin-left: 4px;
    }
    [data-theme="dark"] .dropdown.level-3 {
        background: rgba(255,255,255,0.02);
    }
    .nav-item.open > .dropdown { 
        display: block; 
    }
    .nav-link { 
        font-size: 16px; 
        padding: 13px 16px;
        border-radius: 12px;
        margin: 2px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .nav-link .arrow {
        margin-left: 10px;
        font-size: 12px;
        opacity: 0.5;
        transition: transform 0.3s;
    }
    .nav-item.open > .nav-link .arrow {
        transform: rotate(180deg);
    }
    .dropdown .nav-link {
        font-size: 14px;
        padding: 10px 18px;
    }
    .menu-toggle {
        cursor: pointer;
        font-size: 20px;
        color: var(--text-color);
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.3s ease;
    }
    .menu-toggle:hover {
        background: rgba(100, 149, 237, 0.1);
    }
    /* 移动端导航栏右侧按钮紧凑 */
    header .nav-wrapper > div:last-child {
        gap: 8px !important;
    }
    .global-search-btn,
    .mail-notify-btn {
        width: 30px !important;
        height: 30px !important;
    }
    .global-search-btn svg,
    .mail-notify-btn svg {
        width: 14px;
        height: 14px;
    }
    .theme-toggle {
        width: 30px;
        height: 30px;
        min-width: 0; /* 覆盖 theme_base 移动端 44px 最小触控尺寸，保持首页紧凑导航 */
        min-height: 0;
    }
    .theme-toggle svg {
        width: 15px;
        height: 15px;
    }
    /* 用户胶囊缩小 */
    header .nav-wrapper > div:last-child > div[style*="border-radius:980px"] {
        padding: 4px 8px 4px 6px !important;
    }
    header .nav-wrapper > div:last-child > div[style*="border-radius:980px"] span[style*="font-size:13px"] {
        display: none;
    }
    /* 首页header高度匹配 */
    header {
        height: 52px;
    }
    main {
        padding-top: calc(52px + env(safe-area-inset-top)) !important;
    }
}

/* 主体内容 */
.hero { 
    min-height: 180px; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    padding: 40px 20px 20px; 
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(100, 149, 237, 0.1) 0%, transparent 70%);
    z-index: -1;
    animation: rotate 20s linear infinite;
}
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.hero h1 { 
    font-size: clamp(38px, 8vw, 64px); 
    font-weight: 800; 
    background: linear-gradient(135deg, var(--text-color) 40%, var(--brand-blue)); 
    background-size: 200% 200%;
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards 0.2s, gradientShift 6s ease-in-out infinite 1s;
}

.container { 
    max-width: 1024px; 
    margin: 0 auto 50px; 
    padding: 0 20px; 
}
.section-title { 
    font-size: 24px; 
    margin: 60px 0 30px; 
    border-left: 4px solid var(--brand-blue); 
    padding-left: 15px; 
    font-weight: 700; 
    position: relative;
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards 0.2s, subtleFloat 4s ease-in-out infinite 1s;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50%;
    height: 2px;
    background: linear-gradient(to right, var(--brand-blue), transparent);
}

.grid { 
    display: grid; 
    gap: 25px; 
    grid-template-columns: repeat(3, 1fr); 
}
.grid-tools { 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
}

/* 单行横滚模式 */
.grid.grid-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    grid-template-columns: none;
}
.grid.grid-scroll > .card {
    flex: 0 0 320px;
    min-width: 280px;
    scroll-snap-align: start;
    height: auto;
}
.grid.grid-scroll.grid-tools > .card {
    flex: 0 0 200px;
    min-width: 160px;
}
.grid.grid-scroll::-webkit-scrollbar {
    height: 6px;
}
.grid.grid-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.grid.grid-scroll::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

.card { 
    background: var(--card-bg); 
    padding: 30px; 
    border-radius: 20px; 
    box-shadow: var(--card-shadow); 
    border: 1px solid var(--glass-border); 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    position: relative;
    overflow: hidden;
    z-index: 1;
    contain: layout paint;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s forwards;
}
.card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--brand-blue), #ff7eb3, #ff758c);
    z-index: -1;
    border-radius: 22px;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.card:hover::before {
    opacity: 0.2;
}
.card:hover { 
    transform: translateY(-8px); 
    border-color: var(--glass-border);
    box-shadow: 0 14px 38px rgba(0,0,0,0.10);
}
.card h3, .card h4 { 
    color: var(--text-color); 
    font-weight: 700; 
}
.card p { 
    font-size: 14px; 
    color: var(--text-secondary); 
    margin: 12px 0 20px; 
    line-height: 1.6; 
    flex-grow: 1; 
}
.btn-more { 
    color: var(--brand-blue); 
    font-weight: 600; 
    font-size: 14px; 
    margin-top: auto; 
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

@media (max-width: 900px) { 
    .grid:not(.grid-scroll) { 
        grid-template-columns: repeat(2, 1fr); 
    } 
}
@media (max-width: 600px) { 
    /* 快捷服务：横向滚动 */
    .grid:not(.grid-scroll):not(.grid-tools) { 
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        grid-template-columns: none;
        gap: 14px;
        /* 为卡片阴影预留渲染空间：overflow 会硬裁阴影形成静止直角灰边，
           用 padding 容纳阴影扩散、负 margin 抵消布局位移，阴影随卡片滚动不再被裁 */
        padding: 10px 12px 36px;
        margin: -10px -12px -28px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    } 
    .grid:not(.grid-scroll):not(.grid-tools)::-webkit-scrollbar { display: none; }
    .grid:not(.grid-scroll):not(.grid-tools) > .card {
        flex: 0 0 260px;
        min-width: 240px;
        scroll-snap-align: start;
    }
    /* 常用工具：保持网格分行展示 */
    .grid-tools:not(.grid-scroll) {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .grid-tools:not(.grid-scroll) > .card {
        padding: 14px 10px;
    }
    .grid-tools:not(.grid-scroll) .card h4 {
        font-size: 13px;
    }
    /* 移动端卡片阴影：与桌面一致（hover 不加强，防 iOS 粘性 hover 突变大阴影）；
       直角灰边的根治靠上方滚动容器的 padding/负 margin 补偿，而非去除阴影 */
    .card, .card:hover { box-shadow: 0 8px 32px rgba(0,0,0,0.1); }
    /* 滚动容器：左侧渐变 + 右侧渐变 + 左右箭头提示 */
    .scroll-wrap { position: relative; }
    /* 右侧渐变 */
    .scroll-wrap::after {
        content: '';
        position: absolute;
        top: 0; right: -12px; bottom: 36px;
        width: 60px;
        background: linear-gradient(to right, transparent, var(--bg-color));
        pointer-events: none;
        opacity: 0;
        transition: opacity .3s;
        z-index: 1;
    }
    /* 左侧渐变 */
    .scroll-wrap::before {
        content: '';
        position: absolute;
        top: 0; left: -12px; bottom: 36px;
        width: 60px;
        background: linear-gradient(to left, transparent, var(--bg-color));
        pointer-events: none;
        opacity: 0;
        transition: opacity .3s;
        z-index: 1;
    }
    .scroll-wrap.has-more::after { opacity: 1; }
    .scroll-wrap.has-scrolled::before { opacity: 1; }
    /* 箭头按钮通用样式 */
    .scroll-hint {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background: var(--card-bg);
        border: 1px solid var(--glass-border);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        cursor: pointer;
        opacity: 0;
        transition: opacity .3s, background .15s;
        z-index: 2;
    }
    .scroll-hint-right { right: 10px; }
    .scroll-hint-left { left: 10px; }
    .scroll-wrap.has-more .scroll-hint-right { opacity: 1; }
    .scroll-wrap.has-scrolled .scroll-hint-left { opacity: 1; }
    .scroll-wrap .scroll-hint:active { background: var(--glass-border); }
}

footer { 
    text-align: center; 
    padding: 60px 0; 
    font-size: 14px; 
    color: var(--text-secondary); 
    opacity: 0.7; 
    border-top: 1px solid var(--glass-border); 
    margin-top: 20px;
}

/* 动画增强：仅在 hover 时启用 GPU 提升，避免常驻 will-change 占显存 */
.card:hover, .nav-link:hover, .theme-toggle:hover {
    will-change: transform;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === 增强动效 === */

/* 浮动光球背景 */
.floating-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.35;
    animation: floatOrb 18s ease-in-out infinite;
    will-change: transform;
}
.orb:nth-child(1) {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(100, 149, 237, 0.35), transparent 70%);
    top: -10%; left: -5%;
    animation-duration: 18s;
}
.orb:nth-child(2) {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(147, 112, 219, 0.3), transparent 70%);
    top: 50%; right: -8%;
    animation-duration: 22s;
    animation-delay: -5s;
}
.orb:nth-child(3) {
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(72, 209, 204, 0.25), transparent 70%);
    bottom: 10%; left: 20%;
    animation-duration: 20s;
    animation-delay: -10s;
}
.orb:nth-child(4) {
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255, 126, 179, 0.2), transparent 70%);
    top: 30%; left: 60%;
    animation-duration: 25s;
    animation-delay: -7s;
}
@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.02); }
}

/* 鼠标跟随光斑 */
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(100, 149, 237, 0.12), transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-9999px, -9999px);
    transition: opacity 0.4s ease;
    opacity: 0;
    will-change: transform;
}
.cursor-glow.active { opacity: 1; }

/* Hero标题渐变流动（background-size/animation 已并入上方 .hero h1 基础规则） */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 卡片鼠标内光效果 */
.card .card-spotlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(100, 149, 237, 0.12), transparent 60%);
}
.card:hover .card-spotlight { opacity: 1; }

/* 导航栏微光 */
header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100, 149, 237, 0.5), rgba(147, 112, 219, 0.3), rgba(72, 209, 204, 0.5), transparent);
    background-size: 200% 100%;
    animation: navShimmer 4s linear 1 forwards;
}

/* Hero副标题打字淡入 */
.hero-subtitle {
    opacity: 0;
    animation: fadeInUp 0.8s forwards 0.6s;
}

/* 粒子漂浮 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--brand-blue);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 12s ease-in-out infinite;
}
.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 14s; }
.particle:nth-child(2) { left: 25%; animation-delay: -2s; animation-duration: 11s; }
.particle:nth-child(3) { left: 40%; animation-delay: -4s; animation-duration: 16s; }
.particle:nth-child(4) { left: 55%; animation-delay: -6s; animation-duration: 13s; }
.particle:nth-child(5) { left: 70%; animation-delay: -3s; animation-duration: 15s; }
.particle:nth-child(6) { left: 85%; animation-delay: -8s; animation-duration: 12s; }
.particle:nth-child(7) { left: 15%; animation-delay: -1s; animation-duration: 17s; }
.particle:nth-child(8) { left: 60%; animation-delay: -5s; animation-duration: 10s; }
@keyframes particleFloat {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

/* 滚动渐入 - JS配合 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.grid.scroll-reveal {
    opacity: 1;
    transform: none;
}
.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* section-title 悬浮微动（animation 已并入上方基础规则） */
@keyframes subtleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Logo呼吸光（animation 已并入上方 .logo 基础规则） */
@keyframes logoPulse {
    0%, 100% { text-shadow: 0 0 10px rgba(100, 149, 237, 0.3); }
    50% { text-shadow: 0 0 20px rgba(100, 149, 237, 0.6), 0 0 40px rgba(100, 149, 237, 0.2); }
}

/* === 移动端全面优化 === */

/* iPhone 刘海屏安全区（header 安全区 padding 已并入上方 header 基础规则） */
main {
    padding-top: calc(60px + env(safe-area-inset-top));
}

/* 触控设备：hover 效果降级为 active */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: translateY(-4px);
    }
    .card:hover::before,
    .card:hover::after {
        opacity: 0;
    }
    .card:active {
        transform: scale(0.98);
    }
    .cursor-glow {
        display: none !important;
    }
}

/* iPhone 全面屏适配 */
@media (max-width: 430px) {
    .hero {
        height: auto;
        min-height: 280px;
        padding: 60px 16px 40px;
    }
    .hero h1 {
        font-size: clamp(28px, 10vw, 40px);
        margin-bottom: 12px;
    }
    .hero-subtitle {
        font-size: 15px !important;
        padding: 0 8px;
    }
    .container {
        padding: 0 16px;
        margin-bottom: 30px;
    }
    .section-title {
        font-size: 20px;
        margin: 40px 0 20px;
        padding-left: 12px;
    }
    .card {
        padding: 20px;
        border-radius: 16px;
    }
    .card h3 {
        font-size: 17px;
    }
    .card p {
        font-size: 13px;
        margin: 8px 0 14px;
    }
    .btn-more {
        font-size: 13px;
    }
    footer {
        padding: 40px 16px;
        font-size: 12px;
    }
    .grid:not(.grid-scroll):not(.grid-tools) {
        gap: 14px;
    }
    .grid-tools:not(.grid-scroll) {
        gap: 10px;
    }
    /* 移动端减小光球和粒子 */
    .orb {
        opacity: 0.25;
        filter: blur(40px);
    }
    .particle {
        width: 2px;
        height: 2px;
    }
    /* 移动端只保留 2 个光球 + 4 个粒子，进一步减少合成层 */
    .orb:nth-child(n+3) { display: none; }
    .particle:nth-child(n+5) { display: none; }
    /* 移动端关闭 hero::before 装饰层与 nav shimmer，省 GPU */
    .hero::before, header::after { display: none; }
}

/* iPad 竖屏优化 */
@media (min-width: 431px) and (max-width: 820px) {
    .hero {
        min-height: 320px;
    }
    .hero h1 {
        font-size: clamp(36px, 6vw, 52px);
    }
    .grid:not(.grid-scroll) {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    .container {
        padding: 0 24px;
    }
}

/* iPad 横屏（与桌面一致，微调间距） */
@media (min-width: 821px) and (max-width: 1194px) {
    .nav-wrapper {
        padding: 0 24px;
    }
    .container {
        padding: 0 24px;
    }
}

/* 横屏小屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 200px;
        padding: 30px 16px;
    }
    .hero h1 {
        font-size: 28px;
    }
}

/* 用户系统级"减少动效"偏好：关闭装饰动画，减少 CPU/GPU 占用 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .floating-orbs, .particles, .cursor-glow,
    .hero::before, header::after {
        display: none !important;
    }
    .scroll-reveal { opacity: 1; transform: none; }
}

/* 移动端触控区补足 44px(视觉尺寸不变,伪元素扩大命中) */
@media (max-width: 768px) {
    .global-search-btn, .mail-notify-btn, .theme-toggle, .menu-toggle { position: relative; }
    .global-search-btn::after, .mail-notify-btn::after, .theme-toggle::after, .menu-toggle::after {
        content: ''; position: absolute; inset: -8px; border-radius: 50%;
    }
}
