:root {
    --primary-font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --accent: #0071e3;

    /* Light Theme */
    --bg: #ffffff;
    --mesh-1: #e2e8f0;
    --mesh-2: #f8fafc;
    --text: #1d1d1f;
    --text-muted: #86868b;
    --glass: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    --wallpaper: url('assets/light.jpg');
}

body.dark-mode {
    --bg: #000000;
    --mesh-1: #0f172a;
    --mesh-2: #1e293b;
    --text: #f5f5f7;
    --text-muted: #a1a1a6;
    --glass: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    --wallpaper: url('assets/dark.jpg');
}

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

body {
    font-family: var(--primary-font);
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.5s, color 0.5s;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Staggered Offsets (Balanced for Initial Centering) */
.mac-window.staggered-1 {
    top: 50px;
    left: calc(50% - 90px);
}

.mac-window.staggered-2 {
    top: 90px;
    left: calc(50% - 30px);
}

.mac-window.staggered-3 {
    top: 65px;
    left: calc(50% + 90px);
}

.mac-window.staggered-4 {
    top: 110px;
    left: calc(50% + 30px);
}

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

/* Nav */
.top-nav {
    height: 100px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.top-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-actions {
    display: flex;
    gap: 12px;
}

.nav-btn {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 0;
    width: 44px;
    height: 36px;
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.2, 0, 0.4, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#lang-toggle {
    width: 54px;
    /* Slightly wider for "中文" */
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

body.dark-mode .nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text);
    opacity: 0.8;
}

.lang-text {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.8;
}

/* Main & Typography */
.tip-gray {
    color: var(--text-secondary) !important;
    opacity: 0.7;
}

/* Footer (Matching Reference Style) */
footer {
    padding: 60px 0 30px 0;
}

.footer-content {
    padding: 40px 24px;
    border-radius: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.footer-content:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.footer-text,
.footer-links {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.footer-highlight {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.footer-highlight:hover {
    text-decoration: underline;
}

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

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

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

/* Simulator Container */
.playground {
    padding-top: 120px;
    padding-bottom: 60px;
}

.simulator {
    height: 550px;
    position: relative;
    background: var(--wallpaper) no-repeat center center / 100% auto !important;
    border-radius: 40px;
    border: 1px solid var(--glass-border);
    transition: background 0.5s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 40px;
}

/* Windows */
.mac-window {
    width: 500px;
    height: 320px;
    background: var(--glass);
    backdrop-filter: blur(30px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.3s ease,
        filter 0.4s ease;
}

.mac-window.minimized {
    transform: translateX(-50%) scale(0.98);
    opacity: 0;
    filter: blur(8px);
    pointer-events: none;
}

.mac-window.peeking {
    opacity: 0.6;
    filter: blur(2px);
    transform: translateX(-50%) translateY(-10px);
    pointer-events: none;
}

.window-header {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--glass-border);
}

.traffic-lights {
    display: flex;
    gap: 8px;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.light.red {
    background: #ff5f56;
}

.light.yellow {
    background: #ffbd2e;
}

.light.green {
    background: #27c93f;
}

.window-title {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 48px;
}

.window-content {
    flex: 1;
    padding: 0;
    display: flex;
    overflow: hidden;
}

.sidebar-mock {
    width: 140px;
    background: rgba(0, 0, 0, 0.08);
    margin: 10px;
    border-radius: 12px;
}

.main-mock {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card-mock {
    width: calc(50% - 5px);
    height: 80px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
}

.player-mock {
    margin: 10px;
    height: 80px;
    background: rgba(255, 45, 85, 0.05);
    border-radius: 12px;
    width: calc(100% - 20px);
}

.list-mock {
    flex: 1;
    margin: 0 10px 10px 10px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
}

.toolbar-mock {
    height: 36px;
    background: rgba(0, 0, 0, 0.05);
    width: calc(100% - 20px);
    margin: 10px;
    border-radius: 12px;
}

.browser-mock {
    flex: 1;
    background: white;
    margin: 0 10px 10px 10px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.settings-sidebar {
    width: 160px;
    background: rgba(128, 128, 128, 0.08);
    margin: 10px;
    border-radius: 12px;
}

.settings-main {
    flex: 1;
    background: rgba(255, 255, 255, 0.4);
    margin: 10px 10px 10px 0;
    border-radius: 12px;
}

.app-store-content {
    background: linear-gradient(180deg, rgba(3, 169, 244, 0.1), transparent);
}

.music-content {
    background: linear-gradient(180deg, rgba(255, 45, 85, 0.1), transparent);
}

.safari-content {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
}

.apple-content {
    background: linear-gradient(180deg, rgba(128, 128, 128, 0.1), transparent);
}

/* Dock */
.dock-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-bottom: 20px;
    z-index: 100;
}

.dock {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dock-item {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.4, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dock-item:hover {
    transform: scale(1.1) translateY(-4px);
}

.dock-item .icon {
    width: 44px;
    height: 44px;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.4, 1);
}

/* Visual Size Normalization (Corrected) */
.dock-item[data-app="app-store"] .icon,
.dock-item[data-app="music"] .icon {
    transform: scale(1.18);
    /* Boost icons with internal padding */
}

.dock-item[data-app="safari"] .icon {
    transform: scale(1.0);
    /* Keep full-bleed base size */
    border-radius: 9px;
}

.dock-item[data-app="apple"] .icon {
    transform: scale(0.98);
    /* Shrink large white background icons */
    border-radius: 9px;
}

/* Specific Hover Logic */
.dock-item[data-app="app-store"]:hover .icon,
.dock-item[data-app="music"]:hover .icon {
    transform: scale(1.28);
}

.dock-item[data-app="safari"]:hover .icon {
    transform: scale(1.1);
}

.dock-item[data-app="apple"]:hover .icon {
    transform: scale(1.08);
}

/* Indicator Dot */
.indicator {
    position: absolute;
    bottom: -6px;
    width: 4px;
    height: 4px;
    background: var(--text);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.dock-item.active .indicator {
    opacity: 0.6;
}

/* Preview Box */
.preview-box {
    position: absolute;
    bottom: 64px;
    width: 120px;
    height: 80px;
    background: var(--glass);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 6px;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.dock-item:hover .preview-box {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.preview-thumb {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    opacity: 0.6;
}

.app-store-thumb {
    background: #007aff;
}

.music-thumb {
    background: #ff2d55;
}

.safari-thumb {
    background: #fdfdfd;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.apple-thumb {
    background: #8e8e93;
}

/* Hero & Bento */
h1 {
    font-size: 3.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 30px;
}

.cta-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.main-cta {
    background: var(--text);
    color: var(--bg);
    padding: 12px 32px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
}

.tip {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

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

.glass-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
}

.glass-card h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.glass-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

footer {
    padding: 30px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}