/**
 * 星途 - 深色主题样式
 * Dark Theme for Star Trail Website
 * Version: 3.0 Dark Edition
 */

/* ========================================
   深色主题色彩系统
   ======================================== */

:root {
    /* 主背景色：深空蓝黑 */
    --bg-dark-primary: #0a0e1a;
    --bg-dark-secondary: #131824;
    --bg-dark-elevated: #1a2030;
    --bg-dark-overlay: #212838;
    
    /* 文字色：高对比度 */
    --text-primary-dark: #e8eaf0;
    --text-secondary-dark: #a0a8c0;
    --text-muted-dark: #6b7388;
    
    /* 强调色（保持原有活力） */
    --accent-mbti: #667eea;
    --accent-ai: #10b981;
    --accent-bio: #f59e0b;
    --accent-mgmt: #ec4899;
    
    /* 边框和分隔线 */
    --border-dark: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(102, 126, 234, 0.2);
    
    /* 玻璃态效果 */
    --glass-bg: rgba(26, 32, 48, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* 阴影系统 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* ========================================
   全局深色背景
   ======================================== */

body {
    background: var(--bg-dark-primary);
    color: var(--text-primary-dark);
}

/* ========================================
   导航栏深色
   ======================================== */

.minimal-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-dark);
}

.nav-brand-text {
    color: var(--text-primary-dark);
}

/* Logo 背景虚化效果 */
.nav-logo,
.loader-logo {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3)) 
            drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
    transition: filter 0.3s ease;
}

.nav-logo:hover {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.5)) 
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.3));
}

.loader-logo {
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4)) 
            drop-shadow(0 0 25px rgba(255, 255, 255, 0.3));
}

.nav-link {
    color: var(--text-secondary-dark);
}

.nav-link:hover {
    color: var(--text-primary-dark);
}

.nav-link::after {
    background: var(--accent-mbti);
}

/* ========================================
   Hero Banner 深色优化
   ======================================== */

.hero-banner {
    background: var(--bg-dark-primary);
}

/* Hero背景图保持，但增加深色叠加 */
.hero-bg::after {
    background: linear-gradient(
        to right,
        rgba(10, 14, 26, 0.9) 0%,
        rgba(10, 14, 26, 0.7) 50%,
        rgba(10, 14, 26, 0.5) 100%
    );
}

/* Hero文字已经是白色，保持不变 */
.hero-title,
.hero-subtitle,
.hero-tagline,
.hero-labels,
.hero-description {
    /* 文字色已优化，无需修改 */
}

.hero-cta {
    background: var(--accent-mbti);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.hero-cta:hover {
    background: #7c8ff5;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.6);
}

/* ========================================
   四象限深色 + 玻璃态
   ======================================== */

.quadrant-container {
    background: var(--border-dark);
}

.quadrant {
    background: var(--bg-dark-secondary);
    border: 1px solid var(--border-dark);
}

/* 玻璃态效果 */
.quadrant::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.quadrant:hover::before {
    opacity: 1;
}

/* 象限背景：纯色深色背景（用户要求） */
.quadrant-bg {
    opacity: 0;
    display: none;
}

/* 象限采用纯深色背景 */
.quadrant {
    background: var(--bg-dark-secondary) !important;
}

.quadrant:hover {
    background: var(--bg-dark-elevated) !important;
}

/* 象限内容文字 */
.quadrant-title {
    color: var(--text-primary-dark);
}

.quadrant-subtitle {
    color: var(--text-secondary-dark);
}

.quadrant-desc {
    color: var(--text-secondary-dark);
}

.quadrant-detail {
    color: var(--text-muted-dark);
}

/* 象限按钮 */
.quadrant-btn {
    color: white;
    background: var(--accent-mbti);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.quadrant-btn:hover {
    background: #7c8ff5;
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

/* 状态标签 */
.quadrant-status {
    background: rgba(102, 126, 234, 0.15);
    color: var(--accent-mbti);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.quadrant-status.coming-soon {
    background: rgba(160, 168, 192, 0.1);
    color: var(--text-secondary-dark);
    border: 1px solid var(--border-dark);
}

/* 各象限悬停发光效果增强 */
.quadrant:hover {
    background: var(--bg-dark-elevated);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* MBTI象限 - 紫蓝光晕 */
.quadrant-mbti:hover {
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(102, 126, 234, 0.2);
}

/* AI象限 - 青绿光晕 */
.quadrant-ai:hover {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(16, 185, 129, 0.2);
}

/* 生物科技象限 - 橙黄光晕 */
.quadrant-bio:hover {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(245, 158, 11, 0.2);
}

/* 管理象限 - 粉红光晕 */
.quadrant-mgmt:hover {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(236, 72, 153, 0.2);
}

/* ========================================
   关于区域深色
   ======================================== */

.about-section {
    background: var(--bg-dark-primary);
}

.about-label {
    color: var(--text-secondary-dark);
}

.about-title {
    color: var(--text-primary-dark);
}

.about-divider {
    background: var(--border-dark);
}

.about-lead {
    color: var(--text-primary-dark);
}

.about-text p {
    color: var(--text-secondary-dark);
}

.about-signature {
    color: var(--text-muted-dark);
}

.signature-line {
    background: var(--border-dark);
}

/* ========================================
   页脚深色
   ======================================== */

.footer {
    background: var(--bg-dark-secondary);
    border-top: 1px solid var(--border-dark);
}

.footer-link {
    color: var(--text-secondary-dark);
}

.footer-link:hover {
    color: var(--text-primary-dark);
}

.footer-copyright {
    color: var(--text-muted-dark);
}

/* ========================================
   加载动画（新增）
   ======================================== */

.page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-dark-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    width: 80px;
    height: 80px;
    /* 保持宽高比防止CLS */
    aspect-ratio: 1 / 1;
    margin: 0 auto 1.5rem;
    animation: float 3s ease-in-out infinite;
    display: block;
}

.loader-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-secondary-dark);
    margin-bottom: 1rem;
}

.loader-bar {
    width: 200px;
    height: 3px;
    background: var(--border-dark);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--accent-mbti),
        var(--accent-ai)
    );
    border-radius: 2px;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

/* ========================================
   图片懒加载优化
   ======================================== */

.lazy-load {
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* 确保图片占位空间固定 */
    display: block;
}

.lazy-load.loaded {
    opacity: 1;
}

/* 图标骨架屏 */
.icon-skeleton {
    width: 120px;
    height: 120px;
    /* 与实际图片尺寸严格一致 */
    aspect-ratio: 1 / 1;
    background: linear-gradient(
        90deg,
        var(--bg-dark-elevated) 25%,
        var(--bg-dark-overlay) 50%,
        var(--bg-dark-elevated) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 50%;
    /* 防止布局偏移 */
    margin: 0 auto var(--spacing-sm);
    display: block;
    /* 确保骨架屏和图片绝对重叠 */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 120px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   可访问性增强 (方案A)
   ======================================== */

/* 跳过导航链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-mbti);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: 10000;
    font-weight: 500;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid white;
    outline-offset: 2px;
}

/* 焦点样式 - 所有交互元素 */
*:focus-visible {
    outline: 3px solid var(--accent-mbti);
    outline-offset: 4px;
    border-radius: 4px;
}

/* 导航链接焦点 */
.nav-link:focus-visible {
    outline: 2px solid var(--accent-mbti);
    outline-offset: 2px;
    background: rgba(102, 126, 234, 0.1);
}

/* 象限卡片焦点 */
.quadrant:focus-visible {
    outline: 3px solid var(--accent-mbti);
    outline-offset: 6px;
    transform: translateY(-4px);
}

.quadrant.quadrant-ai:focus-visible {
    outline-color: var(--accent-ai);
}

.quadrant.quadrant-bio:focus-visible {
    outline-color: var(--accent-bio);
}

.quadrant.quadrant-mgmt:focus-visible {
    outline-color: var(--accent-mgmt);
}

/* Hero CTA焦点 */
.hero-cta:focus-visible {
    outline: 3px solid white;
    outline-offset: 4px;
    box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.3);
}

/* 按钮焦点 */
.quadrant-btn:focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
    transform: translateY(-2px);
}

/* 图片焦点（懒加载） */
.lazy-load:focus-visible {
    outline: 3px solid var(--accent-mbti);
    outline-offset: 4px;
}

/* 屏幕阅读器专用文本 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   交互反馈增强 (方案C + 方案F)
   ======================================== */

/* 方案F: Hero按钮脉冲动画 */
.hero-cta {
    position: relative;
    animation: hero-pulse 2s ease-in-out infinite;
}

@keyframes hero-pulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 24px rgba(102, 126, 234, 0.6),
                    0 0 40px rgba(102, 126, 234, 0.3);
    }
}

/* 方案F: 卡片3D倾斜效果 */
.quadrant {
    transform-style: preserve-3d;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quadrant:hover {
    transform: perspective(1000px)
              rotateX(var(--rotate-x, 0deg))
              rotateY(var(--rotate-y, 0deg))
              translateY(-8px);
}

/* 方案F: 页面滚动视差 */
.hero-banner {
    transition: transform 0.5s ease-out;
}

.about-section {
    transition: transform 0.5s ease-out;
}

/* 方案C: 交互反馈 */

/* 点击反馈 - 象限卡片 */
.quadrant:active {
    transform: scale(0.98);
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 波纹效果容器 */
.quadrant {
    position: relative;
    overflow: hidden;
}

.quadrant::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--ripple-x, 50%) var(--ripple-y, 50%),
        rgba(255, 255, 255, 0.3) 0%,
        transparent 60%
    );
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease-out;
}

.quadrant.ripple::before {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        opacity: 1;
        transform: scale(0);
    }
    100% {
        opacity: 0;
        transform: scale(2.5);
    }
}

/* Tooltip提示框 */
.quadrant[data-tooltip] {
    position: relative;
}

.quadrant[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    animation: tooltip-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.quadrant[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    animation: tooltip-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tooltip-in {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-4px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(-8px);
    }
}

/* 鼠标光标变化 */
.quadrant.available {
    cursor: pointer;
}

.quadrant:not(.available) {
    cursor: not-allowed;
}

.hero-cta {
    cursor: pointer;
}

.quadrant-btn {
    cursor: pointer;
}

/* 按钮点击反馈 */
.hero-cta:active,
.quadrant-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

/* 按钮脉冲动画（仅可用按钮） */
.quadrant.available .quadrant-btn {
    animation: pulse-subtle 3s ease-in-out infinite;
}

@keyframes pulse-subtle {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5),
                    0 0 30px rgba(102, 126, 234, 0.2);
    }
}

/* 加载进度指示 */
.icon-skeleton.loading {
    position: relative;
}

.icon-skeleton.loading::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: var(--bg-dark-elevated);
    border-radius: 1px;
    overflow: hidden;
}

.icon-skeleton.loading::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: -100%;
    width: 80%;
    height: 2px;
    background: var(--accent-mbti);
    border-radius: 1px;
    animation: loading-progress 1.5s ease-in-out infinite;
    z-index: 1;
}

@keyframes loading-progress {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ========================================
   响应式深色主题优化
   ======================================== */

@media (max-width: 968px) {
    .quadrant {
        background: var(--bg-dark-secondary);
    }
}

@media (max-width: 768px) {
    .minimal-nav {
        background: rgba(19, 24, 36, 0.95);
    }
}

/* ========================================
   深色主题可访问性
   ======================================== */

/* 确保所有交互元素有明确的焦点样式 */
a:focus,
button:focus {
    outline: 2px solid var(--accent-mbti);
    outline-offset: 2px;
}

/* 提升对比度 */
::selection {
    background: var(--accent-mbti);
    color: white;
}

/* ========================================
   返回顶部按钮
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 56px;
    height: 56px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: var(--shadow-md);
    color: var(--text-primary-dark);
}

.back-to-top:hover {
    background: var(--bg-dark-elevated);
    border-color: var(--accent-mbti);
    transform: translateY(0);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(102, 126, 234, 0.3);
}

.back-to-top:active {
    transform: translateY(0) scale(0.95);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 24px;
        right: 24px;
        width: 48px;
        height: 48px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* ========================================
   性能优化：Critical CSS
   ======================================== */

/* 首屏关键样式已内联，此文件异步加载 */
