:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --primary: #2f6bff;
    --primary-dark: #1f4fd6;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --danger: #ef4444;
    --success: #10b981;
    --shadow: 0 8px 24px rgba(31, 41, 55, .08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2f6bff 0%, #6d28d9 100%);
    padding: 20px;
}
.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--panel);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 36px 32px;
}
.auth-logo {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color .15s;
}
.field input:focus { border-color: var(--primary); }
.btn {
    display: inline-block;
    padding: 11px 16px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    text-align: center;
    transition: background .15s;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-block { width: 100%; }
.btn-ghost { background: #eef2ff; color: var(--primary); }
.btn-ghost:hover { background: #e0e7ff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* ---------- 后台布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 230px;
    background: #0f172a;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    padding: 22px 0;
    flex-shrink: 0;
}
.sidebar .brand {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    padding: 0 22px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar nav { flex: 1; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    color: #cbd5e1;
    font-size: 14px;
}
.sidebar nav a:hover { background: #1e293b; text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar .me {
    border-top: 1px solid #1e293b;
    padding: 14px 22px;
    font-size: 13px;
}
.sidebar .me .u { color: #fff; font-weight: 600; }
.sidebar .me a { color: #94a3b8; font-size: 13px; }

.main { flex: 1; padding: 28px 32px; overflow-x: auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { font-size: 22px; margin: 0; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 20px;
}
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 26px;
    text-align: center;
    color: var(--muted);
    margin-bottom: 22px;
    transition: border-color .15s, background .15s;
}
.upload-zone.drag { border-color: var(--primary); background: #f5f8ff; }
.upload-zone strong { color: var(--text); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: none; }
.fname { display: flex; align-items: center; gap: 10px; }
.fname .em { font-size: 20px; }
.actions a, .actions button {
    margin-right: 8px;
    font-size: 13px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}
.actions .del { color: var(--danger); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.stat-row { display: flex; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.stat {
    flex: 1;
    min-width: 150px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.stat .n { font-size: 24px; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.crumb { font-size: 14px; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.crumb a { color: var(--primary); }
.crumb .sep { color: #cbd5e1; }

@media (max-width: 720px) {
    .sidebar { width: 64px; }
    .sidebar .brand span, .sidebar nav a span, .sidebar .me { display: none; }
    .main { padding: 18px; }
}
