* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

:root {
    --primary: #0084ff;
    --secondary: #9d5cff;
    --accent: #ff2e63;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body {
    min-height: 100vh;
    background: #0a0a0d;
    color: #ffffff;
    overflow-x: hidden;
}

/* ─── 光标跟随光效 ─── */
.cursor-glow {
    position: fixed;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 132, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
    mix-blend-mode: screen;
}

/* ─── 光场背景 ─── */
.light-field {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at 15% 25%, rgba(131, 58, 180, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(253, 29, 29, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 132, 255, 0.1) 0%, transparent 60%);
    z-index: -2;
    animation: lightField 20s ease-in-out infinite alternate;
}
.bg-gradient {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #0a0a0d 0%, #121217 100%);
    z-index: -3;
}
@keyframes lightField {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

/* ─── 液态玻璃 ─── */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    transition: var(--transition);
}
.glass:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 48px rgba(0, 132, 255, 0.2);
    transform: translateY(-5px);
}
.glass-3d {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    border-radius: 32px;
    transition: var(--transition);
    transform-style: preserve-3d;
    perspective: 1000px;
}
.glass-3d:hover {
    transform: translateY(-8px) rotateX(2deg);
    box-shadow: 0 16px 64px rgba(0,132,255,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
    border-color: rgba(0,132,255,0.3);
}

/* ─── 导航栏 ─── */
.glass-nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 1280px;
    height: 76px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 36px;
    z-index: 1000;
    background: rgba(10, 10, 13, 0.7);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: var(--transition);
}
.glass-nav.scrolled {
    top: 16px;
    height: 68px;
    background: rgba(10, 10, 13, 0.85);
}
.logo {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
    text-decoration: none;
}
.nav-links {
    display: flex;
    gap: 36px;
    list-style: none;
}
.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: var(--transition);
    position: relative;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition);
    border-radius: 2px;
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::after { width: 100%; }

/* ─── 英雄区 ─── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 60px;
}
.hero-content {
    text-align: center;
    padding: 80px 60px;
    max-width: 900px;
}
.glitch-text {
    font-size: 72px;
    font-weight: 900;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 12px;
    letter-spacing: -1px;
    animation: glitch 5s infinite;
}
@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-2px, 2px); }
    94% { transform: translate(2px, -2px); }
    96% { transform: translate(-2px, -2px); }
    98% { transform: translate(2px, 2px); }
}
.hero-content h2 {
    font-size: 28px;
    font-weight: 300;
    color: rgba(255,255,255,0.7);
    margin-bottom: 20px;
}
.slogan {
    font-size: 20px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 48px;
    font-style: italic;
}

/* ─── 统计卡片 ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}
.stat-card {
    padding: 24px;
    text-align: center;
}
.stat-number {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}
.stat-label {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ─── 按钮 ─── */
.btn {
    display: inline-block;
    padding: 16px 32px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}
.btn-primary {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,132,255,0.3);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,132,255,0.4);
}
.btn-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: var(--glass-bg);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-3px);
}
.btn-sm {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 14px;
}
.hero-btns {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── 通用区块 ─── */
.section {
    padding: 100px 20px;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
}
.section-header {
    text-align: center;
    margin-bottom: 60px;
}
.section-header h2 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 16px;
}
.divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    margin: 0 auto 20px;
    border-radius: 2px;
}
.section-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.6);
    max-width: 600px;
    margin: 0 auto;
}

/* ─── 分类筛选 ─── */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}
.category-btn {
    padding: 10px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.category-btn:hover, .category-btn.active {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
}
.category-btn .count {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 4px;
}

/* ─── 题目卡片 ─── */
.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}
.challenge-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}
.challenge-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
}
.challenge-card:hover::before { opacity: 1; }
.challenge-card.solved {
    border-color: rgba(34,197,94,0.3);
}
.challenge-card.solved::before {
    background: linear-gradient(90deg, #22c55e, #10b981);
    opacity: 1;
}
.ch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ch-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    transition: var(--transition);
}
.challenge-card:hover .ch-title { color: var(--primary); }
.challenge-card.solved:hover .ch-title { color: #22c55e; }
.ch-points {
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ch-body {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ch-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}
.ch-solves { display: flex; align-items: center; gap: 6px; }
.ch-solved-badge {
    color: #22c55e;
    font-weight: 600;
}

/* ─── 分类标签 ─── */
.cat-badge {
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cat-badge.web { background: rgba(0,132,255,0.2); color: #0084ff; border: 1px solid rgba(0,132,255,0.3); }
.cat-badge.reverse { background: rgba(157,92,255,0.2); color: #9d5cff; border: 1px solid rgba(157,92,255,0.3); }
.cat-badge.pwn { background: rgba(255,46,99,0.2); color: #ff2e63; border: 1px solid rgba(255,46,99,0.3); }
.cat-badge.crypto { background: rgba(234,179,8,0.2); color: #eab308; border: 1px solid rgba(234,179,8,0.3); }
.cat-badge.misc { background: rgba(34,197,94,0.2); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.cat-badge.cloud { background: rgba(6,182,212,0.2); color: #06b6d4; border: 1px solid rgba(6,182,212,0.3); }

/* ─── 难度标签 ─── */
.diff-badge {
    padding: 4px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.diff-badge.easy { background: rgba(34,197,94,0.2); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.diff-badge.medium { background: rgba(234,179,8,0.2); color: #eab308; border: 1px solid rgba(234,179,8,0.3); }
.diff-badge.hard { background: rgba(239,68,68,0.2); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }

/* ─── 题目详情 ─── */
.ch-detail {
    padding: 48px;
    max-width: 900px;
    margin: 0 auto;
}
.ch-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.back-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 15px;
    transition: var(--transition);
}
.back-link:hover { color: var(--primary); }
.ch-detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
}
.ch-meta {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    flex-wrap: wrap;
}
.ch-description {
    font-size: 17px;
    line-height: 1.85;
    color: rgba(255,255,255,0.85);
    margin-bottom: 32px;
}
.ch-description p { margin-bottom: 16px; }
.ch-description code {
    background: rgba(0,132,255,0.15);
    color: #79c0ff;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    border: 1px solid rgba(0,132,255,0.2);
}

/* ─── Flag提交 ─── */
.flag-form {
    padding: 32px;
    margin-bottom: 32px;
}
.flag-form h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.flag-input-group {
    display: flex;
    gap: 12px;
}
.flag-input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    color: #fff;
    font-size: 15px;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s;
}
.flag-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,132,255,0.15);
}
.flag-input::placeholder { color: rgba(255,255,255,0.3); }
.flag-submit-btn {
    padding: 14px 28px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}
.flag-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,132,255,0.3);
}

/* ─── 提示消息 ─── */
.msg {
    padding: 14px 24px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid;
}
.msg.correct {
    background: rgba(0,200,120,0.15);
    color: #00c878;
    border-color: rgba(0,200,120,0.3);
}
.msg.wrong {
    background: rgba(255,46,99,0.15);
    color: #ff2e63;
    border-color: rgba(255,46,99,0.3);
}
.msg.already {
    background: rgba(234,179,8,0.15);
    color: #eab308;
    border-color: rgba(234,179,8,0.3);
}

/* ─── 解题者列表 ─── */
.solvers-list {
    padding: 32px;
}
.solvers-list h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}
.solver-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}
.solver-item:last-child { border-bottom: none; }
.solver-name { font-weight: 600; color: #fff; }

/* ─── 排行榜 ─── */
.scoreboard-table {
    width: 100%;
    border-collapse: collapse;
}
.scoreboard-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.scoreboard-table td {
    padding: 16px 20px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.scoreboard-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}
.rank-num {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.rank-1 .rank-num { background: linear-gradient(90deg, #ffd700, #ffaa00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rank-2 .rank-num { background: linear-gradient(90deg, #c0c0c0, #a0a0a0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rank-3 .rank-num { background: linear-gradient(90deg, #cd7f32, #b87333); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-val {
    font-weight: 700;
    color: var(--primary);
}

/* ─── Writeup 列表 ─── */
.writeups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}
.writeup-card {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.writeup-card:hover .wp-title { color: var(--primary); }
.wp-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    transition: var(--transition);
}
.wp-meta {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    display: flex;
    gap: 16px;
}

/* ─── Writeup 详情 ─── */
.writeup-detail {
    padding: 48px;
    max-width: 900px;
    margin: 0 auto;
}
.writeup-content {
    font-size: 17px;
    line-height: 1.85;
    color: rgba(255,255,255,0.85);
}
.writeup-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 36px 0 16px;
    color: #fff;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.writeup-content p { margin-bottom: 16px; }
.writeup-content ul, .writeup-content ol {
    margin: 16px 0;
    padding-left: 24px;
}
.writeup-content li { margin-bottom: 8px; }
.writeup-content strong { color: #fff; }
.writeup-content code {
    background: rgba(0,132,255,0.15);
    color: #79c0ff;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    border: 1px solid rgba(0,132,255,0.2);
}
.writeup-content pre {
    background: rgba(0,0,0,0.4);
    padding: 20px 24px;
    border-radius: 16px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #abb2bf;
    margin: 20px 0;
    border: 1px solid rgba(255,255,255,0.08);
}

/* ─── 个人主页 ─── */
.profile-header {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}
.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 800;
    border: 3px solid rgba(255,255,255,0.1);
}
.profile-info h2 {
    font-size: 32px;
    font-weight: 700;
}
.profile-info .score-display {
    font-size: 24px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}
.solves-history {
    padding: 32px;
}
.solves-history h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}
.solve-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.solve-row:last-child { border-bottom: none; }
.solve-row .ch-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}
.solve-row .ch-link:hover { color: var(--primary); }
.solve-row .solve-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    align-items: center;
}
.solve-points { font-weight: 700; color: var(--primary); }

/* ─── 登录/注册 ─── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
}
.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.login-card .subtitle {
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    margin-bottom: 36px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
    font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,132,255,0.15);
}
.form-group input::placeholder { color: rgba(255,255,255,0.3); }
.form-group select option { background: #1a1a2e; color: #fff; }
.form-group textarea { min-height: 120px; resize: vertical; font-family: inherit; }
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,132,255,0.3);
}
.error-msg {
    background: rgba(255,46,99,0.15);
    border: 1px solid rgba(255,46,99,0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #ff2e63;
    font-size: 14px;
    text-align: center;
}
.login-icon {
    text-align: center;
    margin-bottom: 24px;
    font-size: 48px;
    color: var(--primary);
}
.back-home {
    text-align: center;
    margin-top: 24px;
}
.back-home a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}
.back-home a:hover { color: var(--primary); }

/* ─── 页脚 ─── */
.footer {
    padding: 24px;
    text-align: center;
    margin: 0 20px 24px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    font-size: 14px;
    color: rgba(255,255,255,0.5);
}
.footer p { margin-bottom: 8px; }
.footer a { color: var(--primary); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ─── Admin专用 ─── */
.admin-wrapper {
    padding-top: 120px;
    min-height: 100vh;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}
.admin-header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.admin-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.admin-user-info {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
}
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.admin-stat-card {
    padding: 20px 24px;
    text-align: center;
}
.admin-stat-card .num {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.admin-stat-card .lbl {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.btn-admin {
    padding: 12px 24px;
    border-radius: 14px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-add {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #fff;
}
.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,132,255,0.3);
}
.btn-edit {
    background: rgba(157,92,255,0.2);
    color: #9d5cff;
    border: 1px solid rgba(157,92,255,0.3);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
}
.btn-edit:hover { background: rgba(157,92,255,0.35); transform: translateY(-1px); }
.btn-delete {
    background: rgba(255,46,99,0.15);
    color: #ff2e63;
    border: 1px solid rgba(255,46,99,0.25);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
}
.btn-delete:hover { background: rgba(255,46,99,0.3); transform: translateY(-1px); }
.btn-logout {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
}
.btn-logout:hover { background: rgba(255,46,99,0.15); color: #ff2e63; border-color: rgba(255,46,99,0.3); }
.btn-settings {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
}
.btn-settings:hover { background: rgba(0,132,255,0.15); color: var(--primary); border-color: rgba(0,132,255,0.3); }

.admin-table-wrap {
    overflow-x: auto;
    border-radius: 24px;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-table td {
    padding: 16px 20px;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}
.admin-table tr { transition: background 0.2s; }
.admin-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.admin-table .actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.4);
    font-size: 16px;
}

/* ─── Modal ─── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px;
    border-radius: 28px;
    background: rgba(18,18,23,0.95);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}
.modal h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.modal .form-group { margin-bottom: 18px; }
.modal label {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
    font-weight: 500;
}
.modal input, .modal select, .modal textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}
.modal input:focus, .modal select:focus, .modal textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,132,255,0.12);
}
.modal select option { background: #1a1a2e; color: #fff; }
.modal textarea { min-height: 150px; resize: vertical; font-family: inherit; }
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}
.btn-cancel {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 12px 24px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}
.btn-cancel:hover { background: rgba(255,255,255,0.1); }
.btn-save {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}
.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,132,255,0.3);
}

/* ─── Toast ─── */
.toast-container {
    position: fixed;
    top: 110px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 14px 24px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    animation: slideInRight 0.4s ease, fadeOut 0.4s ease 2.6s forwards;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.1);
    max-width: 360px;
}
.toast.success { background: rgba(0,200,120,0.2); color: #00c878; border-color: rgba(0,200,120,0.3); }
.toast.error { background: rgba(255,46,99,0.2); color: #ff2e63; border-color: rgba(255,46,99,0.3); }
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-20px); } }

/* ─── 工具类 ─── */
.mt-60 { margin-top: 60px; }
.text-center { text-align: center; }
.text-muted { color: rgba(255,255,255,0.5); }

/* ─── 响应式 ─── */
@media (max-width: 768px) {
    .glass-nav { width: 95%; padding: 0 20px; }
    .nav-links { display: none; }
    .hero-content { padding: 60px 30px; }
    .glitch-text { font-size: 48px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .section-header h2 { font-size: 32px; }
    .challenges-grid, .writeups-grid { grid-template-columns: 1fr; }
    .flag-input-group { flex-direction: column; }
    .admin-header { flex-direction: column; align-items: flex-start; }
    .admin-header-actions { flex-wrap: wrap; }
    .modal { padding: 24px; }
    .admin-table { font-size: 13px; }
    .admin-table th, .admin-table td { padding: 12px 14px; }
}