/* ===== 黄金比例变量 ===== */
:root {
    --phi: 1.618;
    --phi-inv: 0.618;

    /* 极简奢华 — 亮色 */
    --bg: #f5f3f0;
    --bg-elevated: rgba(255, 255, 255, 0.45);
    --text: #1c1c1c;
    --text-secondary: #5c5c5c;
    --text-tertiary: #8a8a8a;
    --accent: #c9a96e;
    --accent-soft: rgba(201, 169, 110, 0.15);
    --border: rgba(0, 0, 0, 0.06);
    --shadow: rgba(0, 0, 0, 0.04);
    /* 背景元素颜色 */
    --particle-color: rgba(180, 140, 80, 0.5);
    --glow-color: rgba(180, 140, 80, 0.25);
}

[data-theme="dark"] {
    --bg: #0c0c0c;
    --bg-elevated: rgba(255, 255, 255, 0.04);
    --text: #e8e6e3;
    --text-secondary: #a0a0a0;
    --text-tertiary: #6b6b6b;
    --accent: #c9a96e;
    --accent-soft: rgba(201, 169, 110, 0.12);
    --border: rgba(255, 255, 255, 0.06);
    --shadow: rgba(0, 0, 0, 0.2);
    /* 背景元素颜色 */
    --particle-color: rgba(201, 169, 110, 0.4);
    --glow-color: rgba(201, 169, 110, 0.15);
}

/* ===== 重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.6s ease, color 0.6s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ===== 背景层 ===== */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* 网格线 */
.bg-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 120px 120px;
    opacity: 0.4;
}

/* 渐变光晕 */
.bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 60% at 10% 90%, var(--glow-color), transparent 50%),
        radial-gradient(ellipse 80% 50% at 90% 10%, var(--glow-color), transparent 50%),
        radial-gradient(ellipse 60% 40% at 50% 50%, var(--particle-color), transparent 60%);
}

/* 动态粒子 */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--particle-color);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 25s; }
.particle:nth-child(2) { left: 25%; top: 60%; animation-delay: -5s; animation-duration: 20s; }
.particle:nth-child(3) { left: 45%; top: 30%; animation-delay: -10s; animation-duration: 22s; }
.particle:nth-child(4) { left: 65%; top: 70%; animation-delay: -3s; animation-duration: 28s; }
.particle:nth-child(5) { left: 80%; top: 40%; animation-delay: -8s; animation-duration: 24s; }
.particle:nth-child(6) { left: 15%; top: 80%; animation-delay: -12s; animation-duration: 26s; }
.particle:nth-child(7) { left: 55%; top: 15%; animation-delay: -7s; animation-duration: 21s; }
.particle:nth-child(8) { left: 90%; top: 85%; animation-delay: -2s; animation-duration: 23s; }
.particle:nth-child(9) { left: 35%; top: 50%; animation-delay: -15s; animation-duration: 27s; }
.particle:nth-child(10) { left: 75%; top: 25%; animation-delay: -4s; animation-duration: 19s; }
.particle:nth-child(11) { left: 5%; top: 45%; animation-delay: -9s; animation-duration: 30s; }
.particle:nth-child(12) { left: 50%; top: 85%; animation-delay: -6s; animation-duration: 25s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    25% { transform: translate(30px, -40px) scale(1.2); opacity: 0.7; }
    50% { transform: translate(-20px, -80px) scale(0.8); opacity: 0.4; }
    75% { transform: translate(40px, -30px) scale(1.1); opacity: 0.6; }
}

/* 漂浮光斑 */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}

.glow-orb:nth-child(1) {
    width: 500px;
    height: 500px;
    background: var(--glow-color);
    top: -150px;
    left: -150px;
    animation: floatOrb1 25s ease-in-out infinite;
}

.glow-orb:nth-child(2) {
    width: 400px;
    height: 400px;
    background: var(--glow-color);
    bottom: -100px;
    right: -100px;
    animation: floatOrb2 30s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.15; }
    25% { transform: translate(120px, 80px) scale(1.15); opacity: 0.22; }
    50% { transform: translate(60px, 150px) scale(0.9); opacity: 0.1; }
    75% { transform: translate(-40px, 60px) scale(1.08); opacity: 0.18; }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.15; }
    25% { transform: translate(-100px, -60px) scale(1.12); opacity: 0.2; }
    50% { transform: translate(-160px, -120px) scale(0.88); opacity: 0.08; }
    75% { transform: translate(-60px, -40px) scale(1.05); opacity: 0.16; }
}

/* 噪点纹理 */
.noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* 鼠标跟随光效 */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

body:hover .cursor-glow {
    opacity: 1;
}

/* ===== 主题切换 ===== */
.theme-toggle {
    position: fixed;
    top: calc(100vh * 0.146);   /* (1 - 0.618)² ≈ 0.146 */
    right: calc(100vw * 0.146);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    backdrop-filter: blur(16px);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: scale(1.08);
}

/* ===== 主画布（黄金比例网格） ===== */
.canvas {
    position: relative;
    z-index: 1;
    width: min(1000px, 84vw);
    height: min(520px, 68vh);
    display: flex;
    align-items: stretch;
    animation: fade-in 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== 左侧主视觉区（宽 61.8%）===== */
.primary-zone {
    flex: 0 0 calc(100% / var(--phi));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-right: 48px;
}

/* 时钟 */
.time-block {
    padding-top: 2px;
}

.clock {
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: clamp(2.2rem, 3.5vw, 3rem);
    font-weight: 300;
    letter-spacing: 0.06em;
    color: var(--text);
    line-height: 1.1;
    transition: color 0.6s ease;
}

.date {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-top: 10px;
    font-weight: 400;
}

/* 身份 — 视觉焦点 */
.identity-block {
    margin-top: 8px;
}

.site-title {
    font-size: clamp(2rem, 3.5vw, 2.8rem);
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.15;
    color: var(--text);
    transition: color 0.6s ease;
    font-family: "Cormorant Garamond", "Source Han Serif SC", "Source Han Serif CN", serif;
}

.site-subtitle {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-top: 12px;
    font-weight: 400;
}

.divider {
    width: 40px;
    height: 1px;
    background: var(--accent);
    margin: 20px 0;
    opacity: 0.5;
}

.manifesto {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 300px;
    font-weight: 300;
}

/* 社交轨道 */
.social-orbit {
    display: flex;
    gap: 16px;
    padding-bottom: 2px;
}

.orbit-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: all 0.35s ease;
    background: transparent;
}

.orbit-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-3px);
}

/* 中间装饰线 */
.canvas::before {
    content: '';
    position: absolute;
    left: calc(100% / var(--phi));
    top: 15%;
    bottom: 15%;
    width: 1px;
    background: var(--border);
}

/* ===== 右侧功能列表区（宽 38.2%）===== */
.secondary-zone {
    flex: 0 0 calc(100% - 100% / var(--phi));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 48px;
}

.zone-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.zone-label {
    font-family: "SF Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-weight: 500;
}

.zone-title {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 500;
}

.zone-line {
    flex: 1;
    height: 1px;
    background: var(--border);
    margin-left: 8px;
}

/* ===== 翻页滑块 ===== */
.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.slider-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.slider-arrow:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.slider-arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    border-color: var(--border);
    color: var(--text-tertiary);
}

.slider-viewport {
    flex: 1;
    overflow: hidden;
}

.slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.slider-page {
    flex: 0 0 100%;
    min-width: 100%;
}

/* ===== 网站列表（极简线条风格）===== */
.site-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.site-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px;
    text-decoration: none;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    transition: all 0.35s ease;
    position: relative;
}

.site-item:first-child {
    border-top: 1px solid var(--border);
}

.site-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--accent-soft);
    transition: width 0.35s ease;
}

.site-item:hover {
    color: var(--text);
    padding-left: 14px;
}

.site-item:hover::before {
    width: 2px;
}

.item-num {
    font-family: "SF Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    min-width: 20px;
    transition: color 0.3s ease;
}

.item-icon {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    width: 24px;
    text-align: center;
    transition: all 0.35s ease;
}

.site-item:hover .item-icon {
    color: var(--accent);
}

.item-name {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.item-arrow {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    opacity: 0;
    transform: translate(-3px, 3px);
    transition: all 0.35s ease;
}

.site-item:hover .item-arrow {
    opacity: 1;
    transform: translate(0, 0);
    color: var(--accent);
}

/* 分页点 */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    background: var(--text-tertiary);
    opacity: 0.2;
    cursor: pointer;
    transition: all 0.4s ease;
}

.slider-dot.active {
    opacity: 1;
    background: var(--accent);
    transform: scale(1.3);
}

/* ===== 底部版权 ===== */
.canvas-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: calc(100vh * 0.06);
    animation: fade-in 1s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.footer-sep {
    width: 24px;
    height: 1px;
    background: var(--accent);
    opacity: 0.4;
}

.canvas-footer p {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    font-weight: 300;
}

/* ===== 动画 ===== */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== 响应式 ===== */
@media (max-width: 860px) {
    html, body {
        overflow: auto;
        height: auto;
    }

    body {
        padding: 80px 24px 60px;
        justify-content: flex-start;
    }

    .canvas {
        flex-direction: column;
        height: auto;
        width: 100%;
        max-width: 420px;
        gap: 48px;
    }

    .canvas::before {
        display: none;
    }

    .primary-zone {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 40px;
        gap: 32px;
    }

    .time-block {
        margin-bottom: 0;
    }

    .identity-block {
        margin-top: 0;
        margin-bottom: 0;
    }

    .social-orbit {
        margin-top: 0;
    }

    .secondary-zone {
        flex: none;
        width: 100%;
        padding-left: 0;
    }

    .canvas-footer {
        margin-top: 48px;
    }
}

@media (max-width: 380px) {
    .clock {
        font-size: 2.4rem;
    }

    .site-title {
        font-size: 2rem;
    }
}
