@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Light Theme Variables (Default) */
    --bg-color: #fcfcfd;
    --bg-gradient-1: #e9efff;
    --bg-gradient-2: #fdfcff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-tertiary: #9ca3af;
    
    --brand-primary: #000000;
    --brand-primary-hover: #333333;
    --brand-accent: #2563eb;
    
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.08);
    --card-shadow: 0 4px 24px -6px rgba(0, 0, 0, 0.05);
    
    --nav-bg: rgba(255, 255, 255, 0.8);
    --nav-border: rgba(0, 0, 0, 0.05);

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="dark"] {
    /* Dark Theme Variables */
    --bg-color: #030712;
    --bg-gradient-1: #111827;
    --bg-gradient-2: #0f172a;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    
    --brand-primary: #ffffff;
    --brand-primary-hover: #f3f4f6;
    --brand-accent: #3b82f6;
    
    --card-bg: rgba(17, 24, 39, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    --nav-bg: rgba(3, 7, 18, 0.7);
    --nav-border: rgba(255, 255, 255, 0.05);
}

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

html {
    scroll-behavior: smooth;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s var(--ease-out), color 0.5s var(--ease-out);
    position: relative;
}

/* Dynamic Background Elements */
.bg-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at 15% 50%, var(--bg-gradient-1), transparent 50%),
                radial-gradient(circle at 85% 30%, var(--bg-gradient-2), transparent 50%);
    opacity: 0.8;
    transition: all 0.5s ease;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.bg-blob-1 {
    top: -10%; left: -10%; width: 50vw; height: 50vw;
    background: rgba(59, 130, 246, 0.15);
    animation-delay: 0s;
}

.bg-blob-2 {
    bottom: -10%; right: -10%; width: 60vw; height: 60vw;
    background: rgba(139, 92, 246, 0.15);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.1); }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { font-size: 1rem; color: var(--text-secondary); }

.gradient-text {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 120px 0;
    position: relative;
    z-index: 1;
}

/* Navbar */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--nav-border);
    transition: transform 0.3s ease, background-color 0.5s ease;
}

.header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.header.hidden {
    transform: translateY(-100%);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}

.nav-logo span {
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-logo-img {
    height: 36px;
    width: auto;
    display: block;
    border-radius: 6px;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s var(--ease-out);
}

.nav-links a.active::after, .nav-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: var(--bg-color); /* Inverse */
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

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

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(8px);
}

.btn-outline:hover {
    background-color: var(--card-bg);
    border-color: var(--text-tertiary);
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.sun-icon, .moon-icon { transition: all 0.3s var(--ease-out); }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: none; }
:root:not([data-theme="dark"]) .moon-icon { display: none; }


/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 72px; /* Offset nav */
    position: relative;
}

.hero-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.hero-badge {
    padding: 6px 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5.5rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.server-ip-box {
    margin-top: 24px;
    padding: 16px 32px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: copy;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.server-ip-box:hover {
    transform: translateY(-2px) scale(1.02);
    border-color: var(--brand-accent);
    box-shadow: var(--card-shadow);
}

.server-ip-label {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.server-ip-domain {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--text-primary);
}

/* Cards & Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-top: 64px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.4s var(--ease-spring);
    position: relative;
    transform-style: preserve-3d;
}

.card-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.2), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    mix-blend-mode: overlay;
}

.card:hover .card-glare {
    opacity: 1;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 24px;
    display: inline-block;
    transform: translateZ(30px);
}

.card h3 {
    margin-bottom: 16px;
    transform: translateZ(20px);
}

.card p {
    transform: translateZ(10px);
    line-height: 1.7;
}

/* Content Sections */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 64px auto;
}

.section-header p {
    margin-top: 16px;
    font-size: 1.125rem;
}

.content-block {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 64px;
    backdrop-filter: blur(12px);
    margin-bottom: 32px;
}

.content-block p {
    margin-bottom: 16px;
    font-size: 1.125rem;
    line-height: 1.8;
}

.content-block p:last-child {
    margin-bottom: 0;
}

/* Rules List */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 48px;
}

.rule-group {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.rule-group:hover {
    transform: translateX(8px);
    box-shadow: var(--card-shadow);
    border-color: var(--text-tertiary);
}

.rule-group h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.rule-group ul {
    list-style: none;
}

.rule-group ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.rule-group ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-tertiary);
    transition: background-color 0.3s ease;
}

.rule-group:hover ul li::before {
    background-color: var(--brand-accent);
}

/* Whitelist Methods */
.whitelist-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.method-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.method-card:hover {
    border-color: var(--text-tertiary);
}

.method-card h3 {
    margin-bottom: 16px;
}

.method-card .highlight {
    font-size: 3rem;
    font-weight: 800;
    font-family: monospace;
    color: var(--brand-accent);
    margin: 24px 0;
    letter-spacing: 0.05em;
}

/* Ban List */
.ban-list { display: flex; flex-direction: column; gap: 12px; }

.ban-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    backdrop-filter: blur(12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ban-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
    border-color: var(--text-tertiary);
}

.ban-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    flex-shrink: 0;
    image-rendering: pixelated;
    background: var(--bg-color);
}

.ban-info { flex: 1; min-width: 0; }
.ban-name { font-weight: 600; color: var(--text-primary); font-size: 1.05rem; margin-bottom: 4px; word-break: break-all; }
.ban-reason { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 6px; }
.ban-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.8rem; color: var(--text-tertiary); }

.ban-status {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.ban-status.active { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.ban-status.lifted { background: rgba(16, 185, 129, 0.12); color: #10b981; }

/* Pager */
.pager { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 40px; }
.pager .btn.disabled { opacity: 0.45; pointer-events: none; }
.pager-info { color: var(--text-secondary); font-size: 0.9rem; }

@media (max-width: 560px) {
    .ban-row { flex-wrap: wrap; }
    .ban-status { order: -1; margin-left: auto; }
}

/* Alerts */
.alert {
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-weight: 500;
    display: inline-block;
    backdrop-filter: blur(8px);
}

.alert-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .alert-red { color: #f87171; }
[data-theme="dark"] .alert-blue { color: #60a5fa; }

/* Footer */
.footer {
    padding: 48px 0;
    text-align: center;
    border-top: 1px solid var(--nav-border);
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

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

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

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

.footer-disclaimer {
    margin: 16px auto 0 auto;
    max-width: 720px;
    font-size: 0.75rem;
    line-height: 1.7;
    color: var(--text-tertiary);
}

/* Animation Engine Classes */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s var(--ease-out);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s var(--ease-out);
    will-change: opacity, transform;
}

.stagger-item.active {
    opacity: 1;
    transform: translateY(0);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-color);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s var(--ease-spring);
    z-index: 1000;
    box-shadow: var(--card-shadow);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Screenshot Gallery (Bento) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 16px;
    margin-top: 16px;
}

.gallery-item {
    position: relative;
    grid-column: span 2;
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    cursor: zoom-in;
    background: var(--card-bg);
}

.gallery-item.gallery-feature {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ease-out);
}

.gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-item figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 16px 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    pointer-events: none;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.9);
    cursor: zoom-out;
    backdrop-filter: blur(4px);
}

.lightbox.open {
    display: flex;
    animation: lb-fade 0.25s var(--ease-out);
}

.lightbox img {
    max-width: 95%;
    max-height: 90vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@keyframes lb-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-item, .gallery-item.gallery-feature {
        grid-column: span 1;
        grid-row: span 1;
    }
}

/* 移动端汉堡按钮（由 main.js 注入），桌面端隐藏 */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    line-height: 0;
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 768px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* 导航折叠成从顶栏下拉的面板 */
    .nav-links {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 24px 16px;
        background: var(--nav-bg);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--nav-border);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height 0.3s var(--ease-out), opacity 0.3s var(--ease-out), padding 0.3s var(--ease-out);
    }

    .nav-links.open {
        max-height: 80vh;
        opacity: 1;
        pointer-events: auto;
        overflow-y: auto;
    }

    .nav-links li { width: 100%; }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 14px 4px;
        border-bottom: 1px solid var(--nav-border);
    }

    .nav-links a::after { display: none; }

    .nav-links li:last-child {
        display: flex;
        justify-content: flex-start;
        padding-top: 8px;
    }

    .section {
        padding: 80px 0;
    }

    .content-block {
        padding: 32px;
    }
}

@media (max-width: 560px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
    }
}
