/* ============================================================
   admin.css — 后台管理系统 · 现代数字化深色风格
   ============================================================ */

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

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

:root {
    --sidebar-w:   240px;
    --topbar-h:    58px;

    --c-bg:        #060d1f;
    --c-surface:   #0d1b35;
    --c-card:      rgba(255,255,255,.03);
    --c-border:    rgba(255,255,255,.07);
    --c-blue:      #1a56db;
    --c-blue-lt:   #3b82f6;
    --c-cyan:      #06b6d4;
    --c-teal:      #0ea5e9;
    --c-gold:      #f59e0b;
    --c-success:   #10b981;
    --c-danger:    #ef4444;
    --c-warning:   #f59e0b;
    --c-info:      #3b82f6;

    --text-1: #f1f5f9;
    --text-2: #94a3b8;
    --text-3: #475569;

    --glass:       rgba(255,255,255,.03);
    --glass-b:     rgba(255,255,255,.07);

    --r:     10px;
    --r-lg:  16px;
    --r-xl:  22px;
    --trans: .2s ease;
}

html, body { height: 100%; }

body {
    font-family: 'Outfit', 'Noto Sans SC', system-ui, sans-serif;
    background: var(--c-bg);
    color: var(--text-1);
    font-size: .9rem;
    line-height: 1.6;
}

/* ── 背景网格 ──────────────────────────────────────────── */
.admin-body::before {
    content: '';
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(26,86,219,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26,86,219,.025) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   登录页
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.login-bg {
    position: fixed; inset: 0;
    z-index: 0;
}
.login-bg .login-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(26,86,219,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26,86,219,.04) 1px, transparent 1px);
    background-size: 60px 60px;
}
.login-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .5;
    animation: pulse-glow 4s ease-in-out infinite;
}
.login-glow-1 {
    width: 500px; height: 500px;
    background: rgba(26,86,219,.25);
    top: -100px; left: -100px;
}
.login-glow-2 {
    width: 400px; height: 400px;
    background: rgba(6,182,212,.15);
    bottom: -80px; right: -80px;
    animation-delay: 2s;
}
@keyframes pulse-glow {
    0%,100% { opacity: .4; transform: scale(1); }
    50%      { opacity: .7; transform: scale(1.05); }
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--r-xl);
    backdrop-filter: blur(30px);
    box-shadow: 0 24px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
    overflow: hidden;
    animation: card-in .6s cubic-bezier(.34,1.56,.64,1);
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(30px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-stripe {
    height: 3px;
    background: linear-gradient(90deg, #1a56db, #06b6d4, #f59e0b, #1a56db);
    background-size: 300% 100%;
    animation: stripe-move 4s linear infinite;
}
@keyframes stripe-move {
    0%   { background-position: 0% 0; }
    100% { background-position: 300% 0; }
}

.login-header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--c-border);
}
.login-icon-ring {
    width: 72px; height: 72px;
    background: linear-gradient(135deg, rgba(26,86,219,.3), rgba(6,182,212,.2));
    border: 2px solid rgba(26,86,219,.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
    box-shadow: 0 0 30px rgba(26,86,219,.25);
}
.login-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: .25rem;
}
.login-header p {
    font-size: .78rem;
    color: var(--text-2);
}
.login-form { padding: 1.5rem 2rem 1rem; }
.login-footer {
    text-align: center;
    padding: 1rem 2rem 1.5rem;
    font-size: .78rem;
}
.login-footer a { color: var(--text-2); text-decoration: none; transition: color var(--trans); }
.login-footer a:hover { color: var(--c-blue-lt); }

.btn-login {
    width: 100%;
    padding: .8rem;
    background: linear-gradient(135deg, var(--c-blue), var(--c-teal));
    color: white;
    border: none;
    border-radius: var(--r);
    font-size: .95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--trans);
    box-shadow: 0 4px 20px rgba(26,86,219,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: .5rem;
    letter-spacing: .04em;
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(26,86,219,.55);
}

/* ============================================================
   后台布局
   ============================================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── 侧边栏 ────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: rgba(13,27,53,.9);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 300;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--trans), transform var(--trans);
}
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item span:last-child,
.sidebar.collapsed .admin-info { display: none; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 1rem .5rem; }
.sidebar.collapsed .nav-item { justify-content: center; padding: .6rem; }

.sidebar-brand {
    padding: 1.1rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid var(--c-border);
    min-height: var(--topbar-h);
}
.brand-icon-wrap {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,.06);
    border: 1.5px solid rgba(26,86,219,.35);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(26,86,219,.2);
}
.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}
.brand-title  { display: block; font-size: .9rem; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.brand-sub    { display: block; font-size: .65rem; color: var(--text-3); margin-top: .1rem; }

.sidebar-nav { flex: 1; padding: .6rem 0; overflow-y: auto; }

.nav-section-label {
    color: var(--text-3);
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: .8rem 1rem .25rem;
    font-weight: 700;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .9rem;
    color: var(--text-2);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 500;
    border-radius: var(--r);
    margin: .1rem .6rem;
    transition: all var(--trans);
    white-space: nowrap;
}
.nav-item:hover {
    background: rgba(255,255,255,.06);
    color: var(--text-1);
}
.nav-item.active {
    background: linear-gradient(90deg, rgba(26,86,219,.3), rgba(14,165,233,.15));
    color: #93c5fd;
    border: 1px solid rgba(26,86,219,.25);
    font-weight: 600;
}
.nav-icon {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}
.nav-logout { color: #fca5a5 !important; }
.nav-logout:hover { background: rgba(239,68,68,.1) !important; color: #f87171 !important; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: .65rem;
}
.avatar-circle {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, rgba(26,86,219,.3), rgba(6,182,212,.2));
    border: 1px solid rgba(26,86,219,.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.admin-name  { display: block; font-size: .82rem; font-weight: 600; color: var(--text-1); }
.admin-role  { display: block; font-size: .65rem; color: var(--text-3); }

/* ── 主内容区 ─────────────────────────────────────────── */
.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--trans);
}
.admin-main.expanded { margin-left: 60px; }

.admin-topbar {
    height: var(--topbar-h);
    background: rgba(13,27,53,.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--c-border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
}
.topbar-left { display: flex; align-items: center; gap: .8rem; }
.topbar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
}
.topbar-right { display: flex; align-items: center; gap: .6rem; }
.hamburger {
    background: none;
    border: 1px solid var(--c-border);
    color: var(--text-2);
    font-size: 1.1rem;
    width: 36px; height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--trans);
}
.hamburger:hover { background: rgba(255,255,255,.06); color: var(--text-1); }

.admin-content {
    padding: 1.5rem;
    flex: 1;
}

/* ── 统计卡片 ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--glass);
    border: 1px solid var(--glass-b);
    border-radius: var(--r-lg);
    padding: 1.3rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: transform var(--trans), box-shadow var(--trans);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 4px;
}
.stat-blue::before  { background: linear-gradient(180deg, #1a56db, #0ea5e9); }
.stat-green::before { background: linear-gradient(180deg, #10b981, #34d399); }
.stat-purple::before{ background: linear-gradient(180deg, #8b5cf6, #a78bfa); }
.stat-orange::before{ background: linear-gradient(180deg, #f59e0b, #fcd34d); }

.stat-icon {
    font-size: 1.8rem;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--c-border);
    flex-shrink: 0;
}
.stat-num   { font-size: 1.7rem; font-weight: 800; line-height: 1; color: var(--text-1); }
.stat-label { font-size: .75rem; color: var(--text-2); margin-top: .2rem; }

/* ── 快速操作 ─────────────────────────────────────────── */
.quick-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.quick-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.1rem;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--c-border);
    border-radius: var(--r);
    color: var(--text-2);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 500;
    transition: all var(--trans);
}
.quick-btn:hover {
    background: rgba(26,86,219,.2);
    border-color: rgba(26,86,219,.4);
    color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,86,219,.2);
}

/* ── 卡片 ────────────────────────────────────────────── */
.section-card {
    background: var(--glass);
    border: 1px solid var(--glass-b);
    border-radius: var(--r-lg);
    padding: 1.4rem;
    margin-bottom: 1.4rem;
    backdrop-filter: blur(10px);
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}
.section-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 1.2rem;
}
.section-header .section-title { margin-bottom: 0; }

/* ── 年份分组 ─────────────────────────────────────────── */
.year-group { margin-bottom: 1.2rem; }
.year-badge {
    display: inline-block;
    background: linear-gradient(90deg, rgba(26,86,219,.3), rgba(6,182,212,.2));
    border: 1px solid rgba(26,86,219,.3);
    color: #93c5fd;
    padding: .25rem .9rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: .75rem;
    letter-spacing: .04em;
}

/* ── 折叠面板 ────────────────────────────────────────── */
.collapse-panel {
    background: rgba(255,255,255,.02);
    border: 1px dashed rgba(255,255,255,.1);
    border-radius: var(--r-lg);
    padding: 1.2rem;
    margin-bottom: 1.2rem;
}

/* ── 表单 ────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: .65rem .9rem;
    background: rgba(255,255,255,.05);
    border: 1.5px solid rgba(255,255,255,.1);
    border-radius: var(--r);
    font-size: .88rem;
    font-family: inherit;
    color: var(--text-1);
    transition: all var(--trans);
    outline: none;
    appearance: none;
}
.form-group input::placeholder { color: var(--text-3); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(26,86,219,.6);
    background: rgba(26,86,219,.06);
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    padding-right: 2.2rem;
}
.form-group select option { background: #0d1b35; }
.form-group small { display: block; margin-top: .25rem; font-size: .72rem; color: var(--text-3); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; }
.required { color: var(--c-danger); }

/* ── 按钮 ────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .62rem 1.3rem;
    background: linear-gradient(135deg, var(--c-blue), var(--c-teal));
    color: white;
    border: none;
    border-radius: var(--r);
    font-size: .88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--trans);
    box-shadow: 0 2px 10px rgba(26,86,219,.3);
    letter-spacing: .02em;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(26,86,219,.45);
    opacity: .95;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .58rem 1.1rem;
    background: transparent;
    color: var(--text-2);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r);
    font-size: .88rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--trans);
}
.btn-outline:hover {
    border-color: rgba(26,86,219,.5);
    color: #93c5fd;
    background: rgba(26,86,219,.06);
}

.btn-sm { padding: .28rem .7rem; font-size: .77rem; border-radius: 7px; }
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: rgba(239,68,68,.12) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239,68,68,.25) !important;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--trans);
}
.btn-danger:hover {
    background: rgba(239,68,68,.2) !important;
    border-color: rgba(239,68,68,.4) !important;
    color: #f87171 !important;
}

/* ── 数据表格 ─────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--r); }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }

.data-table thead tr {
    background: rgba(26,86,219,.15);
    border-bottom: 1px solid rgba(26,86,219,.2);
}
.data-table th {
    padding: .75rem 1rem;
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
}
.data-table tbody tr {
    border-bottom: 1px solid var(--c-border);
    transition: background var(--trans);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,.025); }
.data-table td { padding: .72rem 1rem; vertical-align: middle; color: var(--text-1); }

.data-table code {
    background: rgba(26,86,219,.15);
    border: 1px solid rgba(26,86,219,.2);
    border-radius: 5px;
    padding: .1rem .4rem;
    font-size: .8rem;
    color: #93c5fd;
    font-family: monospace;
}
.action-cell { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

.score-display {
    background: rgba(26,86,219,.15);
    color: #93c5fd;
    padding: .15rem .6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: .82rem;
    border: 1px solid rgba(26,86,219,.25);
}

.grade-badge-preview {
    display: inline-block;
    background: linear-gradient(135deg, rgba(26,86,219,.3), rgba(6,182,212,.2));
    border: 1px solid rgba(26,86,219,.35);
    color: #93c5fd;
    padding: .18rem .7rem;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: 800;
}

/* ── 警告框 ──────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    padding: .8rem 1.1rem;
    border-radius: var(--r);
    font-size: .87rem;
    animation: alert-in .3s ease;
}
@keyframes alert-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.alert-error   { background: rgba(239,68,68,.1);   border: 1px solid rgba(239,68,68,.25);   color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.1);   border: 1px solid rgba(16,185,129,.25);  color: #6ee7b7; }
.alert-warning { background: rgba(245,158,11,.1);   border: 1px solid rgba(245,158,11,.25);  color: #fcd34d; }
.alert-info    { background: rgba(59,130,246,.1);   border: 1px solid rgba(59,130,246,.25);  color: #93c5fd; }

/* ── 模态框 ──────────────────────────────────────────── */
.modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: #0d1b35;
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.modal-box h3 { font-size: 1.05rem; margin-bottom: .75rem; }

/* ── 响应式 ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .3s ease;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .admin-main { margin-left: 0 !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .admin-content { padding: 1rem; }
}
