/* ==================== 自托管字体（无任何外部字体请求） ==================== */
/* Inter 拉丁子集（48KB woff2，单文件变量字体，含 wght 轴 → 400/600 均由该文件实例化）
   许可：SIL Open Font License 1.1，全文见 assets/fonts/Inter-OFL.txt
   中文字符及本子集未覆盖字形由 body 中的系统字体栈渲染。 */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../assets/fonts/inter-latin-var.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #00d4ff;
    --secondary-blue: #007bff;
    --accent-gold: #ffd700;
    --dark-bg: #0a0a0a;
    --dark-bg-2: #1a1a2e;
    --text-white: #ffffff;
    --text-gray: #b0b0b0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC', 'Hiragino Sans GB', sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--dark-bg-2) 100%);
    color: var(--text-white);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* ==================== 可访问性基础 ==================== */
/* 跳过导航链接：默认视觉隐藏，键盘聚焦时滑出 */
.skip-link {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translate(-50%, -150%);
    z-index: 2000;
    padding: 12px 24px;
    border-radius: 0 0 12px 12px;
    background: var(--primary-blue);
    color: #0a0a0a;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translate(-50%, 0);
}

/* 仅屏幕阅读器可见（用于补充结构性标题/说明） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 键盘焦点可见 */
:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
    border-radius: 4px;
}

/* 程序化聚焦容器（skip-link 目标）不显示轮廓 */
[tabindex='-1']:focus {
    outline: none;
}

/* 正文链接：UA 默认蓝色在深色背景上对比度不足，统一为主题青色（约 10.9:1） */
a {
    color: var(--primary-blue);
}

/* ==================== 粒子画布 ==================== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ==================== 导航栏 ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 15px 50px;
    background: rgba(10, 10, 10, 0.95);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--text-white);
    text-decoration: none;
    font-size: 16px;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-blue);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--primary-blue);
}

/* ==================== 下拉菜单 ==================== */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-toggle::before {
    content: '▾';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle::before,
.dropdown:focus-within .dropdown-toggle::before {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 150px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    padding: 10px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    color: var(--text-gray);
    font-size: 14px;
    transition: all 0.3s ease;
}

.dropdown-menu li a:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-blue);
    padding-left: 25px;
}

/* ==================== Hero 区域 ==================== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 1;
}

.hero-content {
    max-width: 900px;
    padding: 20px;
}

.hero-title {
    font-size: 72px;
    font-weight: bold;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 24px;
    color: var(--text-gray);
    margin-bottom: 40px;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(90deg, var(--secondary-blue), var(--primary-blue));
    color: var(--text-white);
    text-decoration: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease 0.4s backwards;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}

/* ==================== 电镜图像轮播 ==================== */
.carousel-section {
    position: relative;
    z-index: 1;
    padding: 80px 50px;
    background: linear-gradient(180deg, transparent 0%, rgba(26, 26, 46, 0.5) 50%, transparent 100%);
}

.carousel-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.carousel-wrapper {
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.2);
}

.carousel-slides {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    min-width: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.carousel-slide.active {
    opacity: 1;
}

.slide-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 500px;
}

.slide-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.slide-label {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    /* 对比度修复：原为继承的白色，白字在 #ffd700 上仅 1.4:1；改深色后 ≥11:1 */
    color: #0a0a0a;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 2px;
}

.slide-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    background: rgba(10, 10, 10, 0.95);
}

.slide-info h3 {
    font-size: 36px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.slide-info p {
    font-size: 18px;
    color: var(--text-gray);
    margin-bottom: 30px;
    line-height: 1.6;
}

.resolution {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary-blue);
    border-radius: 25px;
    font-size: 14px;
    color: var(--primary-blue);
    font-weight: 500;
}

/* 轮播按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--primary-blue);
    color: var(--dark-bg);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.carousel-btn.prev {
    left: -25px;
}

.carousel-btn.next {
    right: -25px;
}

/* 轮播指示器 */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.indicator {
    width: 12px;
    height: 12px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator:hover {
    background: rgba(0, 212, 255, 0.5);
}

.indicator.active {
    background: var(--primary-blue);
    border-color: var(--accent-gold);
    transform: scale(1.3);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}

/* 显微镜图案占位符 */
.microscopy-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

.tem-pattern {
    background-image: 
        radial-gradient(circle at 30% 40%, rgba(0, 212, 255, 0.5) 2px, transparent 2px),
        radial-gradient(circle at 70% 60%, rgba(255, 215, 0, 0.5) 2px, transparent 2px),
        radial-gradient(circle at 50% 30%, rgba(0, 212, 255, 0.5) 2px, transparent 2px),
        radial-gradient(circle at 60% 70%, rgba(255, 215, 0, 0.5) 2px, transparent 2px);
    background-size: 60px 60px;
    animation: patternShift 8s linear infinite;
}

.sem-pattern {
    background-image: 
        linear-gradient(45deg, rgba(0, 212, 255, 0.3) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 215, 0, 0.3) 25%, transparent 25%);
    background-size: 40px 40px;
    animation: patternShift 10s linear infinite;
}

.stem-pattern {
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.6) 3px, transparent 3px),
        radial-gradient(circle at 80% 70%, rgba(255, 215, 0, 0.6) 3px, transparent 3px),
        radial-gradient(circle at 40% 80%, rgba(0, 212, 255, 0.4) 2px, transparent 2px);
    background-size: 80px 80px;
    animation: patternShift 12s linear infinite;
}

.fib-pattern {
    background-image: 
        linear-gradient(0deg, rgba(0, 212, 255, 0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 215, 0, 0.4) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: patternShift 15s linear infinite;
}

.afm-pattern {
    background-image: 
        radial-gradient(ellipse at 50% 50%, rgba(0, 212, 255, 0.5) 0%, transparent 70%);
    background-size: 100px 100px;
    animation: patternPulse 4s ease-in-out infinite;
}

@keyframes patternShift {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

@keyframes patternPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

/* ==================== 内容区域 ==================== */
.content-section {
    position: relative;
    z-index: 1;
    padding: 100px 50px;
}

.section-title {
    font-size: 42px;
    text-align: center;
    margin-bottom: 60px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== 技术卡片 ==================== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.tech-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 40px 30px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.tech-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-blue);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.tech-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.tech-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--primary-blue);
}

.tech-description {
    color: var(--text-gray);
    line-height: 1.6;
}

/* ==================== 动画 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 移动端菜单按钮 ==================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    background: none;
    border: 0;
    color: inherit;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold));
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 992px) {
    .navbar {
        padding: 15px 30px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: right 0.4s ease;
        backdrop-filter: blur(20px);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 10px 0;
        display: none;
    }
    
    .dropdown:hover .dropdown-menu,
    .dropdown:focus-within .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu li a {
        padding: 8px 15px;
        text-align: center;
    }
    
    .dropdown-menu li a:hover {
        padding-left: 15px;
    }
    
    .hero-title {
        font-size: 48px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }
    
    .nav-links {
        gap: 15px;
    }
    
    .hero-title {
        font-size: 42px;
    }
    
    .hero-subtitle {
        font-size: 18px;
    }
    
    .content-section {
        padding: 60px 20px;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    /* 轮播响应式 */
    .slide-content {
        grid-template-columns: 1fr !important;
        min-height: auto;
    }
    
    .slide-image {
        height: 250px;
    }
    
    .slide-info {
        padding: 30px;
    }
    
    .slide-info h3 {
        font-size: 24px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .carousel-btn.prev {
        left: 10px;
    }
    
    .carousel-btn.next {
        right: 10px;
    }
    
    /* 技术卡片响应式 */
    .tech-grid {
        grid-template-columns: 1fr;
    }
    
    .tech-card {
        padding: 30px 20px;
    }
    
    /* 页脚响应式 */
    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .cta-button {
        padding: 12px 25px;
        font-size: 14px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .tech-title {
        font-size: 20px;
    }
}

/* ==================== 404 页面 ==================== */
.notfound-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

/* ==================== 减少动态效果（prefers-reduced-motion: reduce） ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    /* 滚动显现改为直接可见，避免元素停留在 opacity: 0 */
    .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
    }

    .carousel-slides {
        transition: none !important;
    }

    /* 粒子背景纯装饰：减少动态效果时不渲染 */
    #particles-canvas {
        display: none !important;
    }
}
