:root {
    --bg-main: #FAF9F6;
    --bg-card: linear-gradient(135deg, #FFF5F5 0%, #FFFDEB 100%);
    --bg-card-flat: #FFFFFF;
    --bg-warn: #fdfaf2;
    --text-main: #2D3135;
    --text-sub: #868E96;
    --text-muted: #b5b5b5;
    --accent-black: #121212;
    --accent-gold: #c5a059;
    --accent-green: #2ECC71;
    --accent-red: #E74C3C;
    --accent-yellow: #F1C40F;
    --border-color: rgba(0, 0, 0, 0.05);
    --border-light: #ececec;
    --radius-lg: 20px;
    --radius-sm: 12px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.015);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.04);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans CJK SC", sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-gold); text-decoration: none; transition: var(--transition); }
a:hover { color: #a8843e; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ===== Layout ===== */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.container {
    width: 100%;
    max-width: 520px;
    padding: 0 20px;
    margin: 0 auto;
}
.main-content {
    flex: 1;
    width: 100%;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.main-inner {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== Navbar ===== */
.navbar {
    width: 100%;
    background: rgba(250, 249, 246, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-container {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
}
.logo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.3px;
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}
.nav-links {
    display: flex;
    gap: 4px;
}
.nav-links a {
    padding: 6px 14px;
    border-radius: 10px;
    color: var(--text-sub);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}
.nav-links a:hover { color: var(--text-main); background: rgba(0,0,0,0.04); }
.nav-links a.active { color: var(--accent-black); background: var(--accent-black); color: #fff; }

/* ===== Page Header ===== */
.page-header {
    text-align: center;
    padding: 48px 20px 8px;
}
.page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.page-header p {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-top: 6px;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-flat {
    background: var(--bg-card-flat);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
}
.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== Status Dots ===== */
.status-dots { display: flex; gap: 6px; }
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.dot-green { background-color: var(--accent-green); }
.dot-yellow { background-color: var(--accent-yellow); }
.dot-red { background-color: var(--accent-red); }
.status-dot-live {
    width: 8px;
    height: 8px;
    background: #2ec4b6;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #2ec4b6;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ===== Info Rows ===== */
.status-info { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.info-row { display: flex; justify-content: space-between; font-size: 0.95rem; }
.info-label { color: var(--text-sub); }
.info-value { font-weight: 600; }

/* ===== Online Counter ===== */
.online-number-wrapper { margin-bottom: 16px; }
.online-count {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent-gold);
    line-height: 1;
    letter-spacing: -1px;
    display: inline-block;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.online-unit {
    font-size: 1rem;
    color: var(--text-sub);
    font-weight: 500;
    margin-left: 4px;
}
.chart-container { width: 100%; height: 60px; margin-top: 16px; }
.chart-container canvas { width: 100%; height: 100%; }

/* ===== Data Row ===== */
.data-row { display: flex; justify-content: space-between; align-items: center; }
.data-label { font-size: 0.9rem; color: var(--text-sub); }
.data-value { font-size: 1.25rem; font-weight: 700; }
.data-subtext { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; text-align: right; }

/* ===== Resource Warning ===== */
.card-warn { background: var(--bg-warn); border-color: #f3ebd8; }
.resource-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.resource-title { font-size: 0.9rem; font-weight: 600; color: var(--accent-gold); }
.resource-status { font-size: 0.8rem; color: var(--accent-gold); font-weight: 600; }
.progress-bar-bg {
    width: 100%; height: 6px;
    background: rgba(197, 160, 89, 0.15);
    border-radius: 3px; overflow: hidden; margin-bottom: 8px;
}
.progress-bar-fill { height: 100%; background: var(--accent-gold); border-radius: 3px; }
.resource-tips { font-size: 0.75rem; color: #a8843e; line-height: 1.4; }

/* ===== Steps ===== */
.step-list { display: flex; flex-direction: column; gap: 16px; }
.step-item { display: flex; align-items: flex-start; gap: 14px; }
.step-icon {
    width: 22px; height: 22px;
    background: rgba(46, 204, 113, 0.12);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 2px;
}
.step-icon svg { width: 12px; height: 12px; fill: var(--accent-green); }
.step-content h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; }
.step-content p { font-size: 0.85rem; color: var(--text-sub); }

/* ===== Buttons ===== */
.btn-group { display: flex; gap: 12px; width: 100%; }
.btn {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    border: none;
}
.btn-primary {
    background-color: var(--accent-black);
    color: #FFFFFF;
}
.btn-primary:hover { background-color: #2a2a2a; color: #fff; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid rgba(0, 0, 0, 0.15);
}
.btn-secondary:hover { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.3); color: var(--text-main); }
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

/* ===== Code Area ===== */
.code-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.code-tag {
    font-size: 0.75rem; color: var(--text-sub);
    background: rgba(0,0,0,0.04); padding: 2px 8px; border-radius: 20px;
}
.code-area {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.04);
    padding: 16px;
    border-radius: var(--radius-sm);
    color: #4A5568;
    overflow-x: auto;
    white-space: pre;
    margin-bottom: 16px;
}

/* ===== News List ===== */
.news-list { display: flex; flex-direction: column; gap: 16px; }
.news-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}
.news-item:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.news-meta { display: flex; gap: 12px; margin-bottom: 10px; font-size: 0.8rem; color: var(--text-muted); }
.news-tag {
    background: rgba(0,0,0,0.04);
    color: var(--text-sub);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}
.news-item h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.news-item p { color: var(--text-sub); font-size: 0.88rem; line-height: 1.7; }

/* ===== Rules ===== */
.rules-list { display: flex; flex-direction: column; gap: 12px; }
.rule-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}
.rule-item:hover { box-shadow: var(--shadow-hover); }
.rule-number {
    background: var(--accent-black);
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}
.rule-content h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.rule-content p { color: var(--text-sub); font-size: 0.85rem; }
.rule-severity {
    display: inline-block; padding: 2px 8px;
    border-radius: 6px; font-size: 0.65rem; font-weight: 600; margin-left: 8px;
}
.severity-warning { background: #FFF3E0; color: #E65100; }
.severity-ban { background: #FFEBEE; color: #C62828; }

/* ===== Team ===== */
.team-grid { display: flex; flex-direction: column; gap: 16px; }
.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}
.team-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.team-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), #e0c97f);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #fff; font-weight: 700;
    flex-shrink: 0;
}
.team-info h3 { font-size: 1rem; font-weight: 600; margin-bottom: 2px; }
.team-role { color: var(--accent-gold); font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; }
.team-info p { color: var(--text-sub); font-size: 0.82rem; }

/* ===== Gallery ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: var(--transition);
}
.gallery-item:hover { transform: scale(1.02); }

/* ===== Vote ===== */
.vote-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}
.vote-card:hover { box-shadow: var(--shadow-hover); }
.vote-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.vote-card p { color: var(--text-sub); font-size: 0.85rem; margin-bottom: 16px; }

/* ===== Toast ===== */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--accent-black); color: #fff;
    padding: 12px 24px; border-radius: var(--radius-sm);
    font-size: 0.9rem; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    opacity: 0; transition: all 0.4s ease; z-index: 9999;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== Footer ===== */
.footer {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-sub);
    padding: 32px 20px;
    border-top: 1px solid var(--border-color);
}
.footer p { margin-bottom: 4px; }

/* ===== Announcement Modal ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; z-index: 2000;
}
.modal-card {
    background: #fff; width: 100%; max-width: 420px;
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
    position: relative; padding: 32px 24px 24px;
    display: flex; flex-direction: column; gap: 20px;
    animation: modalIn 0.3s ease-out;
}
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.close-icon {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; width: 32px; height: 32px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.close-icon svg { width: 16px; height: 16px; stroke: #000; stroke-width: 2; stroke-linecap: round; }
.close-icon:hover svg { opacity: 0.6; }
.modal-header { display: flex; flex-direction: column; gap: 16px; }
.modal-title { font-size: 20px; font-weight: 700; }
.tab-container { display: flex; gap: 8px; border-bottom: 1px solid #eaeaea; padding-bottom: 12px; }
.tab-btn {
    flex: 1; padding: 8px 12px; border-radius: 10px;
    border: 1px solid #eaeaea; background: #fafafa;
    color: #666; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: var(--transition); text-align: center;
}
.tab-btn.active { background: var(--accent-black); color: #fff; border-color: var(--accent-black); }
.modal-body { min-height: 160px; max-height: 280px; overflow-y: auto; }
.tab-content { display: none; color: #555; font-size: 14px; line-height: 1.6; }
.tab-content.active { display: block; }
.tab-content p { margin-bottom: 12px; }
.tab-content ul { padding-left: 18px; margin-bottom: 12px; }
.tab-content li { margin-bottom: 6px; }
.highlight-text { color: #000; font-weight: 600; }
.modal-footer { display: flex; flex-direction: column; gap: 10px; }
.modal-footer .btn { width: 100%; }

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .main-content { padding: 24px 16px; }
    .card { padding: 20px; }
    .btn-group { flex-direction: column; }
    .nav-toggle { display: flex; }
    .nav-links {
        display: none; position: absolute; top: 56px; left: 0; right: 0;
        background: rgba(250,249,246,0.98); backdrop-filter: blur(12px);
        flex-direction: column; padding: 12px 20px;
        border-bottom: 1px solid var(--border-color);
    }
    .nav-links.active { display: flex; }
    .gallery-grid { grid-template-columns: 1fr; }
}
