/* =========================================
   Base & Reset - Morandi Lab Edition
   ========================================= */
:root {
    /* 莫兰迪深空钛灰与哑光银白 */
    --bg-main: #23272A; /* 深钛灰 */
    --bg-secondary: #2C2F33; /* 浅钛灰 */
    --bg-card: rgba(44, 47, 51, 0.6);
    --bg-card-hover: rgba(227, 229, 232, 0.08);
    --text-primary: #E3E5E8; /* 哑光银白 */
    --text-secondary: #B9BBBE; /* 暗银 */
    --accent-color: #99AAB5; /* 莫兰迪蓝灰 */
    --gradient-primary: linear-gradient(135deg, #E3E5E8 0%, #99AAB5 100%);
    --gradient-hover: linear-gradient(135deg, #FFFFFF 0%, #B9BBBE 100%);
    --border-color: rgba(227, 229, 232, 0.15);
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* 实验室网格背景 */
    background-image: 
        linear-gradient(rgba(227, 229, 232, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(227, 229, 232, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul { list-style: none; }

/* =========================================
   Header & Navbar (Global)
   ========================================= */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(35, 39, 42, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.nav-links { display: flex; gap: 32px; }
.nav-links a { font-weight: 500; color: var(--text-secondary); }
.nav-links a:hover { color: var(--text-primary); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 8px; /* 实验室硬朗风格 */
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-main);
    box-shadow: 0 0 15px rgba(227, 229, 232, 0.2);
}

.btn-primary:hover {
    background: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(227, 229, 232, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(227, 229, 232, 0.1);
    border-color: var(--text-primary);
}

/* =========================================
   Warp Dashboard (index.html specific)
   ========================================= */
body.warp-dashboard {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.scene {
    position: relative;
    width: 100vw;
    height: 100vh;
    perspective: 1500px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

/* 左右切分布局 */
.hero-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    gap: 60px;
    z-index: 10;
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    transform-style: preserve-3d;
}

.hero-split.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateZ(-1000px) scale(0.5);
    filter: blur(20px);
}

.hero-text {
    flex: 1;
    max-width: 550px;
    transform: translateZ(50px);
}

.hero-text h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.hero-text h1 span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 核心网格容器 (右半部分) */
.dashboard-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    transform-style: preserve-3d;
}

/* 大师球数据卡片 */
.masterball-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 50px 40px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.masterball-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.masterball-card:hover::before { left: 150%; }
.masterball-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-primary);
    transform: translateZ(30px) translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px rgba(227, 229, 232, 0.1);
}

.masterball-card h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.masterball-card p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: inline-block;
}

/* =========================================
   WARP SPEED ANIMATIONS 
   ========================================= */
/* 当屏幕进入跃迁状态 */
body.is-warping .scene {
    animation: space-stretch 1s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

@keyframes space-stretch {
    0% { filter: blur(0); }
    40% { filter: blur(8px) brightness(1.5) contrast(1.5); transform: scaleZ(3) scaleX(1.1) translateZ(300px); }
    100% { filter: blur(0) brightness(1) contrast(1); transform: scaleZ(1) scaleX(1) translateZ(0); }
}

/* 被点击的卡片产生的长残影 (Trailing Echoes) */
.masterball-card.warp-active {
    animation: trailing-echo 1s cubic-bezier(0.7, 0, 0.3, 1) forwards;
    z-index: 100;
}

@keyframes trailing-echo {
    0% { transform: translateZ(0) scale(1); filter: blur(0); opacity: 1; }
    30% {
        transform: translateZ(400px) scale(1.5) skewX(-15deg);
        filter: blur(4px);
        box-shadow: 
            20px 0 30px rgba(227,229,232,0.8), 
            60px 0 60px rgba(153,170,181,0.6), 
            120px 0 100px rgba(227,229,232,0.3);
        color: transparent;
        text-shadow: 20px 0 20px #E3E5E8, 40px 0 40px #99AAB5;
    }
    100% {
        transform: translateZ(1000px) scale(3) skewX(-30deg);
        filter: blur(20px);
        opacity: 0;
    }
}

/* 背景跃迁光束 */
.warp-lines {
    position: absolute;
    top: 50%; left: 50%;
    width: 200vw; height: 200vh;
    transform: translate(-50%, -50%) translateZ(-500px);
    background: radial-gradient(circle, transparent 20%, var(--bg-main) 70%),
                repeating-conic-gradient(from 0deg, transparent 0deg, rgba(227,229,232,0.05) 1deg, transparent 2deg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

body.is-warping .warp-lines {
    opacity: 1;
    animation: rotate-warp 1s linear infinite;
}

@keyframes rotate-warp {
    0% { transform: translate(-50%, -50%) translateZ(-500px) rotate(0deg) scale(1); }
    100% { transform: translate(-50%, -50%) translateZ(0px) rotate(15deg) scale(2); }
}

/* =========================================
   Detail Views (Inside the Warp Dashboard)
   ========================================= */
.detail-view {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 40px;
    opacity: 0;
    pointer-events: none;
    transform: translateZ(500px) scale(1.2);
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 20;
    overflow-y: auto; /* Allow scrolling inside detail if needed */
}

.detail-view.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateZ(0) scale(1);
}

.detail-content {
    background: rgba(35, 39, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 50px;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.detail-header h2 {
    font-size: 2.5rem;
    color: var(--text-primary);
}

/* Internal components reused for details */
.media-grid, .pricing-grid, .features-grid, .reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.media-card, .pricing-card, .feature-card, .review-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 12px;
}

.pricing-card.popular {
    border-color: var(--text-primary);
    background: rgba(227,229,232,0.05);
}

/* =========================================
   Subpages Fallback (About, Terms, etc.)
   ========================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-header { padding: 150px 0 80px; text-align: center; border-bottom: 1px solid var(--border-color); }
.page-header h1 { font-size: 3rem; margin-bottom: 16px; color: var(--text-primary); }
.section-subtitle { color: var(--text-secondary); font-size: 1.1rem; }
.page-content { max-width: 800px; margin: 0 auto; padding: 60px 24px 100px; }
.page-content h2 { font-size: 1.8rem; margin: 40px 0 20px; color: var(--text-primary); }
.page-content p, .page-content ul { margin-bottom: 20px; color: var(--text-secondary); font-size: 1.1rem; }
.page-content ul { padding-left: 24px; list-style: disc; }

footer {
    background: var(--bg-main);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
    text-align: center;
}
.footer-links { display: flex; gap: 32px; justify-content: center; margin: 24px 0; }
.footer-links a { color: var(--text-secondary); font-weight: 500; }
.footer-links a:hover { color: var(--text-primary); }
.footer-bottom { color: var(--text-secondary); font-size: 0.9rem; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.05); }

/* =========================================
   Responsive 
   ========================================= */
@media (max-width: 768px) {
    .hero-split {
        flex-direction: column;
        gap: 30px;
        margin-top: 80px;
    }
    .hero-text {
        text-align: center;
        max-width: 100%;
        margin-bottom: 20px;
    }
    .hero-text h1 {
        font-size: 2.5rem;
    }
    .dashboard-grid { grid-template-columns: 1fr; width: 100%; }
    .masterball-card { padding: 30px 24px; }
    .masterball-card h3 { font-size: 1.5rem; }
    .nav-links { display: none; }
    .detail-content { padding: 30px 20px; }
    .detail-header h2 { font-size: 1.8rem; }
    .btn { min-height: 50px; width: 100%; justify-content: center; }
    .navbar .btn { width: auto; min-height: auto; }
}
