:root {
    --primary: #3b6cff;
    --primary-light: #6f9bff;
    --primary-dark: #2e5bff;
    --ink: #1f2a44;
    --text: #333f56;
    --muted: #6b7a99;
    --line: #e7ecf7;
    --bg: #f2f5fb;
    --card-shadow: 0 4px 18px rgba(31, 42, 68, .07);
    --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
body { background: var(--bg); color: var(--text); }
a { text-decoration: none; color: var(--primary); }

.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar { width: 220px; background: linear-gradient(180deg, #1a2440, #223055); color: #fff; padding: 24px 14px; flex-shrink: 0; }
.sidebar h1 { font-size: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 28px; letter-spacing: 1px; color: #9db8ff; }
.sidebar h1 .logo-icon { width: 22px; height: 22px; flex-shrink: 0; }
.sidebar h1 span { background: linear-gradient(90deg, #9db8ff, #fff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar a { display: flex; align-items: center; gap: 10px; color: #b9c5e8; padding: 11px 18px; font-size: 14px; border-radius: 10px; margin-bottom: 4px; transition: background .2s, color .2s, transform .15s; }
.sidebar a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.sidebar a.active svg, .sidebar a:hover svg { opacity: 1; }
.sidebar a:hover { background: rgba(255, 255, 255, .08); color: #fff; transform: translateX(2px); }
.sidebar a.active { background: linear-gradient(90deg, var(--primary), var(--primary-light)); color: #fff; box-shadow: 0 4px 12px rgba(59, 108, 255, .4); }

.main { flex: 1; padding: 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.topbar h2 { font-size: 21px; color: var(--ink); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.topbar h2::before { content: ""; width: 5px; height: 20px; border-radius: 3px; background: linear-gradient(180deg, var(--primary), var(--primary-light)); }

/* 卡片 */
.card { background: #fff; border-radius: var(--radius); padding: 22px; margin-bottom: 22px; box-shadow: var(--card-shadow); border: 1px solid rgba(231, 236, 247, .8); }
.card h3 { color: var(--ink); font-size: 16px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f6f9ff; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fafcff; }
tr:last-child td { border-bottom: none; }

/* 按钮 */
.btn { display: inline-block; padding: 7px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: 13px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; transition: opacity .2s, transform .1s, box-shadow .2s; box-shadow: 0 2px 8px rgba(59, 108, 255, .3); }
.btn:hover { opacity: .92; box-shadow: 0 4px 12px rgba(59, 108, 255, .4); }
.btn:active { transform: scale(.97); }
.btn.danger { background: linear-gradient(135deg, #ff6b6d, #ff4d4f); box-shadow: 0 2px 8px rgba(255, 77, 79, .3); }
.btn.danger:hover { box-shadow: 0 4px 12px rgba(255, 77, 79, .4); }
.btn.gray { background: #eef1f8; color: var(--muted); box-shadow: none; }
.btn.gray:hover { background: #e3e8f4; }

/* 表单 */
input, select, textarea { padding: 9px 12px; border: 1px solid #d6ddeb; border-radius: 8px; font-size: 13px; width: 100%; margin-bottom: 12px; background: #fff; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 108, 255, .12); }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { position: relative; overflow: hidden; border-radius: var(--radius); padding: 22px; color: #fff; box-shadow: 0 6px 16px rgba(59, 108, 255, .22); transition: transform .2s; }
.stat .stat-icon { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; opacity: .35; }
.stat:hover { transform: translateY(-3px); }
.stat:nth-child(5n+1) { background: linear-gradient(135deg, #3b6cff, #6f9bff); }
.stat:nth-child(5n+2) { background: linear-gradient(135deg, #21b573, #55d69a); }
.stat:nth-child(5n+3) { background: linear-gradient(135deg, #ff9f1a, #ffc266); }
.stat:nth-child(5n+4) { background: linear-gradient(135deg, #9b59f5, #bd8bfa); }
.stat:nth-child(5n+5) { background: linear-gradient(135deg, #00b8d9, #4dd6ec); }
.stat .num { font-size: 30px; font-weight: 700; }
.stat .label { font-size: 13px; opacity: .92; margin-top: 6px; }

/* 登录页 */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #16203c 0%, #23346a 45%, #3b6cff 100%); }
.login-box { background: rgba(255, 255, 255, .96); border-radius: 18px; padding: 44px 40px; width: 380px; box-shadow: 0 20px 60px rgba(10, 18, 40, .45); backdrop-filter: blur(8px); }
.login-box h1 { font-size: 21px; margin-bottom: 24px; text-align: center; color: var(--ink); }
.login-logo { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--primary-light)); box-shadow: 0 8px 20px rgba(59, 108, 255, .35); }
.login-logo svg { width: 32px; height: 32px; }
.error { color: #ff4d4f; font-size: 13px; margin-bottom: 10px; }

img.thumb { width: 90px; height: 50px; object-fit: cover; border-radius: 8px; box-shadow: 0 2px 6px rgba(31, 42, 68, .12); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: #eef3ff; color: var(--primary); }
.badge.off { background: #f2f2f2; color: #999; }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-top: 20px; }
.chart-title { font-size: 15px; color: var(--ink); margin-bottom: 8px; }
.chart { width: 100%; height: 300px; }

.edit-hint { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; background: #fff7e6; border: 1px solid #ffe1a8; border-radius: 8px; padding: 9px 14px; margin-bottom: 10px; font-size: 13px; color: #ad6800; }
