/* ========== 基础样式 ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* ── Deep Space × Cold Teal × Warm Cream ── */
    --teal:         #2DD4C0;
    --teal-deep:    #1AAD9A;
    --teal-glow:    #4EEADE;
    --teal-mist:    #0D8F80;

    --bg-base:      #070A0D;
    --bg-panel:     #0A0E12;
    --bg-card:      #0E1318;
    --bg-surface:   #121820;

    /* Warm cream text */
    --cream:        #F2EDE4;
    --cream-2:      #B8AFA3;
    --cream-3:      #6A6059;
    --cream-dim:    #3A3530;

    --transition:   cubic-bezier(.4,0,.2,1);
}

html, body {
    height: 100%;
    font-family: 'Noto Serif SC', serif;
    background: var(--bg-base);
    color: var(--cream);
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-text-size-adjust: 100%;
}

/* ── DEEP SPACE BG ── */
.space-bg {
    position: fixed; inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 15% 20%, rgba(13,143,128,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 85% 80%, rgba(45,212,192,0.05) 0%, transparent 55%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(10,20,28,0.9) 0%, transparent 100%),
        var(--bg-base);
}

/* ── AURORA ── */
.aurora { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.aurora-orb {
    position: absolute; border-radius: 50%;
    filter: blur(110px);
    animation: drift ease-in-out infinite alternate;
}
.aurora-orb:nth-child(1) {
    width: 65vw; height: 65vw;
    background: radial-gradient(circle, rgba(13,80,74,0.55) 0%, transparent 65%);
    top: -20%; left: -15%;
    opacity: 1;
    animation-duration: 26s;
}
.aurora-orb:nth-child(2) {
    width: 50vw; height: 50vw;
    background: radial-gradient(circle, rgba(8,50,46,0.5) 0%, transparent 65%);
    bottom: -20%; right: -10%;
    opacity: 1;
    animation-duration: 20s;
    animation-delay: -8s;
}
.aurora-orb:nth-child(3) {
    width: 30vw; height: 30vw;
    background: radial-gradient(circle, rgba(45,212,192,0.07) 0%, transparent 70%);
    top: 35%; left: 60%;
    opacity: 1;
    animation-duration: 30s;
    animation-delay: -15s;
}
@keyframes drift {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(3vw,4vh) scale(1.06); }
}

/* ── SCAN LINE TEXTURE ── */
.scanlines {
    position: fixed; inset: 0; z-index: 2; pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.04) 2px,
        rgba(0,0,0,0.04) 4px
    );
}

/* ── GRID ── */
.grid-texture {
    position: fixed; inset: 0; z-index: 2; pointer-events: none;
    background-image:
        linear-gradient(rgba(45,212,192,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45,212,192,0.03) 1px, transparent 1px);
    background-size: 56px 56px;
}

/* ── PARTICLES ── */
.particles { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.particle {
    position: absolute; border-radius: 50%;
    background: var(--teal-glow);
    opacity: 0;
    animation: float-up linear infinite;
}
@keyframes float-up {
    0%   { opacity:0; transform:translateY(0) scale(1); }
    8%   { opacity:0.55; }
    92%  { opacity:0.1; }
    100% { opacity:0; transform:translateY(-75vh) scale(0); }
}

/* ── THEME TOGGLE ── */
.theme-toggle {
    position: fixed; top: 26px; right: 26px; z-index: 100;
    width: 40px; height: 40px; border-radius: 11px;
    border: 1px solid rgba(45,212,192,0.16);
    background: rgba(14,19,24,0.7);
    backdrop-filter: blur(20px);
    color: var(--teal); font-size: 14px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.theme-toggle:hover {
    background: rgba(45,212,192,0.1);
    box-shadow: 0 0 16px rgba(45,212,192,0.15);
}

/* ── LAYOUT ── */
.layout {
    position: relative; z-index: 10;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
}

/* ── LEFT PANEL ── */
.left-panel {
    display: flex; flex-direction: column;
    justify-content: center; align-items: flex-start;
    padding: 80px 60px 80px 80px;
    position: relative;
}

.brand-badge {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 60px;
}
.brand-icon {
    width: 58px; height: 58px;
    border-radius: 16px;
    background: var(--bg-surface);
    border: 1px solid rgba(45,212,192,0.25);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 24px rgba(45,212,192,0.15), inset 0 1px 0 rgba(45,212,192,0.1);
}
.brand-name {
    font-family: 'Noto Serif SC', serif;
    font-size: 20px; font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--cream);
}
.brand-name span {
    display: block;
    font-family: 'Lato', sans-serif;
    font-size: 10px; font-weight: 300;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: var(--teal);
    margin-top: 5px;
    opacity: 0.85;
}

.hero-headline {
    font-family: 'Noto Serif SC', serif;
    font-size: clamp(36px, 4.8vw, 62px);
    font-weight: 300;
    line-height: 1.25;
    color: var(--cream);
    margin-bottom: 22px;
    letter-spacing: 0.01em;
}
.hero-headline em {
    font-style: normal;
    background: linear-gradient(125deg, var(--teal-glow) 0%, var(--teal) 40%, #A8F0E8 80%, var(--cream) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-family: 'Lato', sans-serif;
    font-size: 14px; font-weight: 300;
    letter-spacing: 0.06em;
    color: var(--cream-2);
    line-height: 2;
    margin-bottom: 52px;
    max-width: 360px;
}

.feature-list { display: flex; flex-direction: column; gap: 18px; }
.feature-item { display: flex; align-items: center; gap: 14px; }
.feature-dot {
    width: 34px; height: 34px; border-radius: 9px;
    background: rgba(45,212,192,0.07);
    border: 1px solid rgba(45,212,192,0.18);
    display: flex; align-items: center; justify-content: center;
    color: var(--teal);
    font-size: 13px; flex-shrink: 0;
    transition: all 0.3s;
}
.feature-item:hover .feature-dot {
    background: rgba(45,212,192,0.13);
    border-color: rgba(45,212,192,0.4);
    box-shadow: 0 0 14px rgba(45,212,192,0.18);
}
.feature-text { font-size: 13px; color: var(--cream-2); letter-spacing: 0.04em; }

/* Vertical divider */
.deco-line {
    position: absolute; right: 0; top: 50%;
    transform: translateY(-50%);
    width: 1px; height: 55vh;
    background: linear-gradient(to bottom,
        transparent,
        rgba(45,212,192,0.2) 25%,
        rgba(45,212,192,0.3) 50%,
        rgba(45,212,192,0.2) 75%,
        transparent
    );
}
.deco-line::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 10px var(--teal), 0 0 20px var(--teal);
}

/* ── RIGHT PANEL ── */
.right-panel {
    display: flex; align-items: flex-start;
    justify-content: center;
    padding: 40px 60px 40px 40px;
    overflow-y: auto;
    max-height: 100vh;
}

.right-panel::-webkit-scrollbar {
    width: 6px;
}
.right-panel::-webkit-scrollbar-track {
    background: transparent;
}
.right-panel::-webkit-scrollbar-thumb {
    background: rgba(45,212,192,0.2);
    border-radius: 3px;
}

.content-wrapper {
    width: 100%;
    max-width: 680px;
    padding-top: 20px;
}

/* ── PROXY TOGGLE ── */
.proxy-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 28px;
    margin-bottom: 28px;
    background: rgba(14,19,24,0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(45,212,192,0.12);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all 0.3s var(--transition);
}

.proxy-toggle:hover {
    border-color: rgba(45,212,192,0.25);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px rgba(45,212,192,0.08);
}

.toggle-label {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--cream-2);
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label i {
    color: var(--teal);
    font-size: 16px;
}

/* Switch */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(45,212,192,0.15);
    border: 1px solid rgba(45,212,192,0.2);
    transition: all 0.3s var(--transition);
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--cream-2);
    transition: all 0.3s var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

input:checked + .slider {
    background: linear-gradient(135deg, var(--teal-mist), var(--teal-deep));
    border-color: var(--teal);
    box-shadow: 0 0 12px rgba(45,212,192,0.3);
}

input:checked + .slider:before {
    transform: translateX(24px);
    background: var(--cream);
}

input:focus + .slider {
    box-shadow: 0 0 0 3px rgba(45,212,192,0.2);
}

/* ── VERSIONS GRID ── */
.versions-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

/* ── LOADING ── */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.loading-spinner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-spinner p {
    color: var(--cream-2);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    letter-spacing: 0.04em;
}

.spinner {
    border: 3px solid rgba(45,212,192,0.1);
    border-top: 3px solid var(--teal);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ── VERSION CARD ── */
.version-card {
    background: rgba(14,19,24,0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(45,212,192,0.12);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all 0.3s var(--transition);
    overflow: hidden;
    position: relative;
}

.version-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--teal-glow), transparent);
    opacity: 0.5;
}

.version-card:hover {
    transform: translateY(-4px);
    border-color: rgba(45,212,192,0.25);
    box-shadow: 0 16px 48px rgba(0,0,0,0.4), 0 0 30px rgba(45,212,192,0.1);
}

/* Collapsible Header */
.version-header {
    cursor: pointer;
    transition: all 0.3s;
    padding: 4px;
    margin: -4px;
    border-radius: 12px;
}

.version-header:hover {
    background: rgba(45,212,192,0.05);
}

.expand-icon {
    font-size: 14px;
    color: var(--teal);
    transition: all 0.3s var(--transition);
    line-height: 1;
    margin-left: 12px;
}

.version-content {
    overflow: hidden;
    transition: all 0.4s var(--transition);
}

.version-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    margin-top: 0;
}

.version-content.expanded {
    max-height: 2000px;
    opacity: 1;
    padding-top: 20px;
}

.version-name {
    font-family: 'Noto Serif SC', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
}

.version-name::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--teal);
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 8px var(--teal);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

.version-description {
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    color: var(--cream-3);
    line-height: 1.6;
}

/* Version Info */
.version-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(45,212,192,0.05);
    border: 1px solid rgba(45,212,192,0.1);
    border-radius: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-family: 'Lato', sans-serif;
    font-size: 10px;
    font-weight: 400;
    color: var(--cream-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.version-number, .download-count {
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--teal);
}

.download-count i {
    font-size: 11px;
    margin-right: 4px;
}

/* Changelog */
.changelog-section {
    margin-bottom: 20px;
}

.changelog-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.04em;
}

.changelog-title i {
    color: var(--teal);
    font-size: 12px;
}

.changelog-content {
    max-height: 160px;
    overflow-y: auto;
    padding: 16px;
    background: rgba(45,212,192,0.03);
    border: 1px solid rgba(45,212,192,0.1);
    border-radius: 12px;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    line-height: 1.7;
    color: var(--cream-2);
}

.changelog-content::-webkit-scrollbar {
    width: 4px;
}

.changelog-content::-webkit-scrollbar-thumb {
    background: rgba(45,212,192,0.3);
    border-radius: 2px;
}

.changelog-content h1, .changelog-content h2, .changelog-content h3 {
    font-size: 14px;
    margin: 10px 0 6px 0;
    color: var(--teal);
    font-weight: 600;
}

.changelog-content ul, .changelog-content ol {
    margin-left: 16px;
    margin-bottom: 10px;
}

.changelog-content li {
    margin-bottom: 4px;
}

.changelog-content li::marker {
    color: var(--teal);
}

.changelog-content code {
    background: rgba(45,212,192,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', monospace;
    font-size: 11px;
    color: var(--teal-glow);
}

/* Assets Section */
.assets-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.asset-item {
    background: rgba(45,212,192,0.05);
    border: 1px solid rgba(45,212,192,0.1);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s;
}

.asset-item:hover {
    border-color: rgba(45,212,192,0.2);
    background: rgba(45,212,192,0.08);
}

.asset-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.asset-name {
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--cream);
    word-break: break-all;
}

.asset-size {
    font-family: 'Lato', sans-serif;
    font-size: 11px;
    color: var(--cream-3);
    background: rgba(45,212,192,0.1);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Download Button */
.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--teal-mist) 0%, var(--teal-deep) 40%, var(--teal) 100%);
    color: var(--bg-base);
    text-decoration: none;
    border-radius: 10px;
    font-family: 'Noto Serif SC', serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    transition: all 0.3s var(--transition);
    box-shadow: 0 4px 16px rgba(26,173,154,0.3);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26,173,154,0.4);
}

.download-btn:hover::before {
    opacity: 1;
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn i {
    font-size: 12px;
}

/* Error Message */
.error-message {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #fca5a5;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-family: 'Lato', sans-serif;
}

.error-message h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-message button {
    margin-top: 12px;
    padding: 10px 20px;
    background: rgba(239,68,68,0.2);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    color: #fca5a5;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.error-message button:hover {
    background: rgba(239,68,68,0.3);
}

/* ── FOOTER ── */
.footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(45,212,192,0.1);
    margin-top: 10px;
}

.footer p {
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    color: var(--cream-3);
    margin: 4px 0;
    letter-spacing: 0.04em;
}

.footer #lastUpdate {
    color: var(--teal);
    font-weight: 600;
}

.footer .disclaimer {
    margin-top: 8px;
    font-size: 11px;
    opacity: 0.7;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
    from { opacity:0; transform:translateY(20px); }
    to   { opacity:1; transform:translateY(0); }
}

.left-panel > * { animation: fadeUp 0.65s var(--transition) both; }
.left-panel > *:nth-child(2) { animation-delay:.08s; }
.left-panel > *:nth-child(3) { animation-delay:.16s; }
.left-panel > *:nth-child(4) { animation-delay:.24s; }
.left-panel > *:nth-child(5) { animation-delay:.32s; }

.content-wrapper { animation: fadeUp 0.65s var(--transition) both; animation-delay: 0.1s; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
    .layout { grid-template-columns: 1fr; }
    .left-panel { display: none; }
    .right-panel { 
        padding: 20px; 
        max-height: none;
        overflow-y: visible;
    }
    .content-wrapper { padding-top: 60px; }
    .mobile-brand { 
        display: flex !important;
        align-items: center;
        gap: 12px;
        margin-bottom: 24px;
        justify-content: center;
    }
    .theme-toggle {
        top: 16px;
        right: 16px;
    }
}

@media (min-width: 1025px) { 
    .mobile-brand { display: none !important; } 
}

@media (max-width: 480px) {
    .proxy-toggle {
        padding: 16px 20px;
        gap: 12px;
    }
    .toggle-label {
        font-size: 13px;
    }
    .version-card {
        padding: 18px;
    }
    .version-info {
        padding: 12px;
        gap: 10px;
    }
    .changelog-content {
        padding: 12px;
        max-height: 130px;
    }
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
    --bg-base:    #E8F0EE;
    --bg-panel:   #F0F6F4;
    --bg-card:    rgba(240,248,246,0.9);
    --bg-surface: #E0EBE8;
    --cream:      #0D1C1A;
    --cream-2:    #3A5550;
    --cream-3:    #6A9090;
    --cream-dim:  #9ABABA;
}

[data-theme="light"] body { background: #DDE8E6; }

[data-theme="light"] .space-bg {
    background: radial-gradient(ellipse 80% 60% at 15% 20%, rgba(45,212,192,0.08) 0%, transparent 60%), #DDE8E6;
}

[data-theme="light"] .aurora-orb:nth-child(1) { opacity: 0.35; }
[data-theme="light"] .aurora-orb:nth-child(2) { opacity: 0.28; }

[data-theme="light"] .scanlines { opacity: 0.15; }

[data-theme="light"] .grid-texture {
    background-image:
        linear-gradient(rgba(45,212,192,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45,212,192,0.05) 1px, transparent 1px);
}

[data-theme="light"] .theme-toggle {
    background: rgba(220,238,234,0.9);
    border-color: rgba(45,212,192,0.3);
    color: var(--teal-deep);
}

[data-theme="light"] .proxy-toggle {
    background: rgba(255,255,255,0.7);
    border-color: rgba(45,212,192,0.2);
}

[data-theme="light"] .version-card {
    background: rgba(255,255,255,0.8);
    border-color: rgba(45,212,192,0.15);
    box-shadow: 0 8px 32px rgba(0,80,70,0.1);
}

[data-theme="light"] .version-card:hover {
    border-color: rgba(45,212,192,0.3);
    box-shadow: 0 16px 48px rgba(0,80,70,0.15);
}

[data-theme="light"] .version-info,
[data-theme="light"] .changelog-content,
[data-theme="light"] .asset-item {
    background: rgba(45,212,192,0.05);
    border-color: rgba(45,212,192,0.15);
}

[data-theme="light"] .asset-item:hover {
    background: rgba(45,212,192,0.1);
}

[data-theme="light"] .download-btn {
    color: #fff;
}

[data-theme="light"] .footer {
    border-color: rgba(45,212,192,0.15);
}

[data-theme="light"] .slider {
    background: rgba(45,212,192,0.2);
}
