:root {
    --primary-color: #0A84FF;
    --primary-gradient: linear-gradient(135deg, #5E5CE6, #0A84FF);
    --bg-color: #F5F5F7;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    --accent-light: rgba(94, 92, 230, 0.1);
}

[data-theme="dark"] {
    --bg-color: #000000;
    --text-primary: #F5F5F7;
    --text-secondary: #A1A1A6;
    --glass-bg: rgba(28, 28, 30, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    --accent-light: rgba(10, 132, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

#bg-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, var(--accent-light) 0%, transparent 70%);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.glass {
    /* Dynamic sensing background */
    background: radial-gradient(600px circle at var(--mouse-x, -100%) var(--mouse-y, -100%),
            rgba(255, 255, 255, 0.08),
            transparent 50%), var(--glass-bg);

    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    border-radius: 32px;
    /* Restore Apple-style smooth corners */
    transition: background 0.4s ease, transform 0.3s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s ease;

    /* Glow Variables */
    --start: 0;
    --active: 0;
    --mouse-x: -100%;
    --mouse-y: -100%;
}

.glass:hover {
    background: radial-gradient(600px circle at var(--mouse-x, -100%) var(--mouse-y, -100%),
            rgba(255, 255, 255, 0.15),
            transparent 50%), var(--glass-bg);
}

/* Unified Lift Effect for Functional Blocks */
.bento-item:hover,
.extra-item:hover,
.footer-content:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .glass:hover {
    background: radial-gradient(600px circle at var(--mouse-x, -100%) var(--mouse-y, -100%),
            rgba(94, 92, 230, 0.15),
            transparent 50%), var(--glass-bg);
}

[data-theme="dark"] .bento-item:hover,
[data-theme="dark"] .extra-item:hover,
[data-theme="dark"] .footer-content:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* Glow Border Layer */
.glass::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.5px;
    /* Border thickness */

    /* Pure White Gradient Sweep (Centered White, Transparent Ends) */
    background: conic-gradient(from calc(var(--start) * 1deg - 30deg),
            transparent 0deg,
            rgba(255, 255, 255, 0.1) 10deg,
            rgba(255, 255, 255, 0.8) 20deg,
            rgba(255, 255, 255, 1) 30deg,
            /* Center Pure White */
            rgba(255, 255, 255, 0.8) 40deg,
            rgba(255, 255, 255, 0.1) 50deg,
            transparent 60deg);

    /* Sophisticated Masking for Border-only visibility */
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;

    opacity: var(--active);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10;
}

/* Nav */
.nav-fixed {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    /* Base centering */
    width: min(1100px, calc(100% - 48px));
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    border-radius: 20px;
}

.animate-nav-in {
    opacity: 0;
    animation: navFadeIn 0.8s ease-out forwards;
}

@keyframes navFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
        /* Keep -50% X while animating Y */
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
}

#app-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
}

.nav-controls {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(128, 128, 128, 0.1);
}

.icon {
    width: 20px;
    height: 20px;
}

/* Hero */
.hero {
    padding-top: 180px;
    padding-bottom: 80px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    line-height: 1.1;
}

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

.hero p {
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    color: var(--text-secondary);
    margin: 0 auto 40px;
    max-width: 600px;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-primary {
    background: #000;
    /* Light mode: Black */
    color: #fff;
    padding: 16px 36px;
    border-radius: 18px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s, background 0.2s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .btn-primary {
    background: #fff;
    /* Dark mode: White */
    color: #000;
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-primary:hover {
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.2);
}

/* Secondary button remains for other potential uses, kept subtle */
.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;
    border-radius: 18px;
    text-decoration: none;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(128, 128, 128, 0.1);
}

/* Bento Grid */
.features {
    padding-bottom: 40px;
}

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

/* Ensure grid items (wrappers) fill height and their children (glass cards) grow */
.bento-grid>div,
.extra-grid>div {
    display: flex;
    flex-direction: column;
}

.bento-item,
.extra-item {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bento-item {
    padding: 30px;
}

.item-row {
    grid-column: span 3;
    display: flex;
    flex-direction: row;
    /* Force horizontal layout for large blocks */
    align-items: center;
    gap: 40px;
    min-height: 320px;
}

.item-row.reverse {
    flex-direction: row-reverse;
}

.bento-text {
    flex: 1;
}

.bento-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bento-item h3 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.bento-item p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.video-container {
    overflow: hidden;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#feat-drag .video-container {
    width: 600px;
    height: 250px;
}

.features-extra-large {
    padding-bottom: 40px;
}

#feat-shortcut .video-container {
    width: 600px;
    height: 300px;
}

#feat-shortcut .bento-text {
    flex: 1;
    min-width: 300px;
}

#feat-island {
    flex-direction: column;
    text-align: center;
    padding: 30px;
    height: auto;
    min-height: unset;
}

#feat-island .bento-text {
    margin-bottom: 24px;
    max-width: 800px;
}

#feat-island .video-container {
    width: 1000px;
    height: 400px;
    max-width: 100%;
    /* 确保在小屏幕下不会溢出 */
}

/* Visual Mockups - Deprecated but kept for reference if needed */
.capsule-mockup {
    width: 240px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    padding: 0 10px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.capsule-mockup .handle {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    margin-left: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.capsule-mockup .time {
    position: absolute;
    left: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.island-mockup {
    width: 280px;
    height: 40px;
    background: #000;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.island-mockup .dot {
    width: 8px;
    height: 8px;
    background: #5E5CE6;
    border-radius: 50%;
    box-shadow: 0 0 10px #5E5CE6;
}

/* Extra Features */
.extra-features {
    padding-bottom: 80px;
    text-align: center;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 40px;
    font-weight: 800;
}

.extra-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    text-align: left;
}

.extra-item {
    padding: 30px;
    border-radius: 24px;
}

.extra-item h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.extra-item p {
    color: var(--text-secondary);
}

/* Footer (Matching Reference Style) */
footer {
    padding-bottom: 30px;
    /* Reduced excessive blank space */
}

.footer-content {
    padding: 40px 24px;
    border-radius: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Uniform line spacing for all 4 lines */
}

.footer-text,
.footer-links {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    /* Clear default paragraph spacing */
    line-height: 1;
    /* Tighten for consistent gap control */
}

.footer-highlight {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.beian {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
    opacity: 0.6;
}

.beian a {
    color: inherit;
    text-decoration: none;
}

.beian a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

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

    .item-row {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }

    .item-row.reverse {
        flex-direction: column;
    }

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