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

:root {
    /* ---- 旧变量名保留为「转接层」：值指向 MD3 令牌 ----
       下方 170+ 个选择器一行不改，即可完成 MD3 化。
       promo 是深色宣传页，HTML 上固定 data-md3-theme="dark"，
       所以这些令牌取到的始终是 MD3 深色套的值。 */
    --primary: var(--md3-primary);
    --primary-dark: var(--md3-primary-container);
    --dark-bg: var(--md3-background);
    --card-bg: var(--md3-surface-container-low);
    --text-primary: var(--md3-on-surface);
    --text-secondary: var(--md3-on-surface-variant);

    /* 圆角：原项目 tokens.css 的 radius 梯度与 MD3 形状体系完全同值
       （4/8/12），直接转接，视觉零变化 */
    --radius-sm: var(--md3-shape-extra-small);
    --radius-md: var(--md3-shape-small);
    --radius-lg: var(--md3-shape-medium);

    /* 学科色是业务语义（六科区分），MD3 色彩系统没有对应角色。
       按 MD3 允许「品牌/业务扩展色」的惯例保留原值，不强行塞进 MD3 角色。 */
    --physics: #4A90D9;
    --chemistry: #48A9A6;
    --biology: #7CB342;

    /* 学科沉浸区与高亮徽标：同属业务扩展色，命名化以免裸值散落 */
    --physics-deep: #1a2a4a;
    --biology-deep: #1a2a1a;
    --promo-highlight: #E74C3C;
    --promo-on-highlight: #ffffff;

    /* 遗传系谱图标记色：生物学专业语义（圆形=女、红色=患病个体），
       与「高亮红」同值但含义不同，独立命名避免被误改 */
    --pedigree-female: #E91E63;
    --pedigree-affected: #E74C3C;
}

body {
    font-family: MiSans, "Microsoft YaHei", sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.logo {
    font-size: 1.5rem;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--md3-on-surface);
    font-size: 1.5rem;
    cursor: pointer;
}

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 120px 50px 80px;
    background: var(--md3-background);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: transparent;
    animation: pulse 10s ease-in-out infinite;
}

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

.hero-content {
    text-align: center;
    z-index: 1;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    background: var(--primary);
    padding: 8px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 40px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stat-num {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.hero-stat-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    padding: 14px 35px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, transform 0.3s, opacity 0.3s, box-shadow 0.3s;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: var(--md3-on-primary);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-3px);
}

.hero-visual {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    animation: float 6s ease-in-out infinite;
}

.floating-card span:first-child {
    font-size: 1.5rem;
}

.physics-card {
    top: 30%;
    left: 10%;
    animation-delay: 0s;
}

.chemistry-card {
    top: 20%;
    right: 10%;
    animation-delay: 2s;
}

.biology-card {
    bottom: 25%;
    left: 15%;
    animation-delay: 4s;
}

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

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    color: var(--md3-on-surface);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header .section-title {
    margin-bottom: 10px;
}

.subject-tag {
    display: inline-block;
    padding: 6px 20px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.subject-tag.physics {
    background: rgba(74, 144, 217, 0.2);
    color: var(--physics);
    border: 1px solid var(--physics);
}

.subject-tag.chemistry {
    background: rgba(72, 169, 166, 0.2);
    color: var(--chemistry);
    border: 1px solid var(--chemistry);
}

.subject-tag.biology {
    background: rgba(124, 179, 66, 0.2);
    color: var(--biology);
    border: 1px solid var(--biology);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.intro-section {
    padding: 100px 0;
    background: var(--dark-bg);
}

.intro-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 50px;
    align-items: start;
}

.intro-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.8;
}

.lead {
    font-size: 1.3rem !important;
    color: var(--md3-on-surface) !important;
}

.intro-text strong {
    color: var(--primary);
}

.intro-highlights {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.highlight-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.highlight-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.highlight-item h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.highlight-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.intro-stats-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.intro-stats-card h3 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    color: var(--primary);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.stats-value {
    color: var(--md3-on-surface);
    font-weight: 600;
}

.features-section {
    padding: 100px 0;
    background: var(--md3-surface-container-low);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0;
    transform: translateY(20px);
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.tools-section {
    padding: 100px 0;
}

.physics-tools {
    background: var(--md3-surface-container-low);
}

.chemistry-tools {
    background: var(--md3-surface-container);
}

.tools-showcase {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.tool-detail-card {
    display: flex;
    gap: 50px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(20px);
}

.tool-detail-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.tool-detail-card.reverse {
    flex-direction: row-reverse;
}

.tool-preview-area {
    flex: 1;
    min-width: 0;
}

.tool-mockup {
    background: var(--md3-surface-container-lowest);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mockup-screen {
    padding: 30px;
    background: var(--physics-deep);
    text-align: center;
}

.mockup-formula {
    font-family: 'Times New Roman', serif;
    font-size: 3rem;
    color: var(--md3-on-surface);
    margin-bottom: 10px;
}

.mockup-result {
    font-size: 1.5rem;
    color: var(--primary);
}

.mockup-voice {
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--primary);
}

.projectile-canvas {
    width: 100%;
    height: 250px;
    display: block;
}

.mockup-controls {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-group label {
    width: 100px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.control-group input[type="range"] {
    flex: 1;
    accent-color: var(--primary);
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-info h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.tool-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}

.tool-features {
    list-style: none;
    margin-bottom: 25px;
}

.tool-features li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.tool-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary);
    padding: 5px 15px;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.bio-grid {
    grid-template-columns: repeat(3, 1fr);
}

.tool-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
}

.tool-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.tool-card h4 {
    font-size: 1rem;
    margin-bottom: 10px;
}

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

.tool-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: var(--promo-on-highlight);
    padding: 3px 10px;
    border-radius: var(--radius-md);
    font-size: 0.7rem;
}

.tool-badge.highlight {
    background: var(--promo-highlight);
}

.highlight-tool-section {
    padding: 100px 0;
    background: var(--md3-surface-container);
}

.highlight-tool {
    display: flex;
    gap: 50px;
    align-items: center;
}

.highlight-tool-content {
    flex: 1;
}

.highlight-badge {
    display: inline-block;
    background: var(--promo-highlight);
    color: var(--promo-on-highlight);
    padding: 6px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.highlight-tool-content h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.highlight-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 30px;
}

.highlight-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.hf-item {
    display: flex;
    gap: 15px;
}

.hf-icon {
    width: 35px;
    height: 35px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.hf-item h5 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.hf-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.highlight-tool-demo {
    flex: 1;
}

.process-flow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.pf-step {
    background: rgba(72, 169, 166, 0.2);
    border: 2px solid var(--chemistry);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.pf-step.core {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary);
}

.pf-arrow {
    color: var(--primary);
    font-size: 1.2rem;
}

.reaction-example {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    padding: 25px;
}

.reaction-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.reaction-eq {
    font-family: 'Times New Roman', serif;
    font-size: 1.8rem;
    color: var(--md3-on-surface);
    margin-bottom: 15px;
}

.reaction-analysis {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.reaction-analysis span {
    background: rgba(102, 126, 234, 0.2);
    padding: 5px 15px;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    color: var(--primary);
}

.biology-tools {
    background: var(--md3-surface-container-low);
}

.pedigree-highlight {
    padding: 100px 0;
    background: var(--biology-deep);
}

.pedigree-content {
    display: flex;
    gap: 50px;
    align-items: center;
}

.pedigree-info {
    flex: 1;
}

.pedigree-info h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.pedigree-info > p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

.pedigree-features {
    list-style: none;
}

.pedigree-features li {
    padding: 8px 0;
    color: var(--text-secondary);
}

.pedigree-demo {
    flex: 1;
    text-align: center;
}

.pedigree-svg-large {
    width: 100%;
    max-width: 400px;
    margin-bottom: 20px;
}

.pedigree-svg-large circle.male {
    fill: var(--physics);
}

.pedigree-svg-large circle.female {
    fill: var(--pedigree-female);
}

.pedigree-svg-large circle.affected {
    fill: var(--pedigree-affected);
}

.pedigree-svg-large line {
    stroke: var(--md3-outline-variant);
    stroke-width: 2;
}

.pedigree-legend-large {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.dot.male { background: var(--physics); }
.dot.female { background: var(--pedigree-female); }
.dot.affected { background: var(--promo-highlight); }

.pedigree-question {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.pedigree-question p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.answer-hint {
    color: var(--biology);
    font-weight: 600;
}

.tech-section {
    padding: 100px 0;
    background: var(--md3-surface-container-low);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.tech-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tech-card h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-tags span {
    background: rgba(102, 126, 234, 0.2);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
}

.file-structure {
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.fs-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fs-item.indent1 { padding-left: 20px; }
.fs-item.indent2 { padding-left: 40px; }
.fs-item.indent3 { padding-left: 60px; }

.folder-icon, .file-icon {
    font-size: 1rem;
}

.contact-section {
    padding: 100px 0;
    background: var(--md3-surface-container-low);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.contact-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.contact-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.contact-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.contact-path {
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.footer {
    padding: 60px 0;
    background: var(--dark-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.footer-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.footer-desc {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

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

.footer-subjects {
    display: flex;
    justify-content: center;
    gap: 15px;
    /* 原版缺这一行：390px 视口下 6 个学科标签挤在一行，右侧溢出 6px。
       加上换行后窄屏自动折成两行（既有问题，迁移时顺手修）。 */
    flex-wrap: wrap;
}

.subject {
    padding: 8px 20px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
}

.subject.physics {
    background: rgba(74, 144, 217, 0.2);
    color: var(--physics);
}

.subject.chemistry {
    background: rgba(72, 169, 166, 0.2);
    color: var(--chemistry);
}

.subject.biology {
    background: rgba(124, 179, 66, 0.2);
    color: var(--biology);
}

@media (max-width: 1024px) {
    .intro-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .bio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .highlight-tool {
        flex-direction: column;
    }

    .pedigree-content {
        flex-direction: column;
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(15, 15, 35, 0.98);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-stats {
        gap: 30px;
    }

    .hero-stat-num {
        font-size: 2rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .floating-card {
        display: none;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .intro-section,
    .features-section,
    .tools-section,
    .highlight-tool-section,
    .pedigree-highlight,
    .tech-section,
    .contact-section {
        padding: 60px 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bio-grid {
        grid-template-columns: 1fr;
    }

    .tool-detail-card {
        flex-direction: column;
        padding: 25px;
    }

    .tool-detail-card.reverse {
        flex-direction: column;
    }

    .highlight-features {
        grid-template-columns: 1fr;
    }

    .process-flow {
        justify-content: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 15px;
    }
}