* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #f5f6f7; color: #232a26; font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }

.layout { display: flex; min-height: 100vh; }

/* ---------- 侧栏 ---------- */
.sidebar { width: 220px; flex-shrink: 0; background: #ffffff; border-right: 1px solid #edf1ef; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; padding: 26px 22px 22px; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: #2ba471; flex-shrink: 0; }
.logo-text { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.nav { padding: 8px 12px; flex: 1; }
.nav-item { display: block; padding: 11px 14px; border-radius: 10px; color: #5c6762; text-decoration: none; font-size: 14px; margin-bottom: 4px; }
.nav-item:hover { background: #f4f8f6; color: #2ba471; }
.nav-item.active { background: #e9f7f0; color: #22855c; font-weight: 600; }
.nav-sub { margin: 0 0 6px 0; }
.nav-sub a { display: block; padding: 7px 14px 7px 32px; margin: 2px 6px; font-size: 13px; color: #6d7873; text-decoration: none; border-radius: 8px; }
.nav-sub a:hover { background: #f4f8f6; color: #2ba471; }
.nav-sub a.on { background: #e9f7f0; color: #22855c; font-weight: 600; }
.tab-hint { font-size: 12.5px; color: #8b948d; margin: 0 0 14px; }
.sidebar-foot { padding: 18px 22px; border-top: 1px solid #f1f5f3; font-size: 13px; }
.who { color: #8b9691; }
.logout { color: #c0392b; text-decoration: none; }
.logout:hover { text-decoration: underline; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; padding: 28px 32px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
h1 { font-size: 22px; margin: 0; }
.sub-title { color: #8b9691; font-size: 13px; margin-top: 4px; }

/* ---------- 卡片 ---------- */
.card { background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 6px 24px rgba(30,60,45,.05); margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; }
.card-hint { font-size: 12px; color: #9aa3ab; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 6px 24px rgba(30,60,45,.05); }
.kpi-label { font-size: 12.5px; color: #8b9691; }
.kpi-value { font-size: 30px; font-weight: 700; margin-top: 8px; line-height: 1.1; }
.kpi-foot { font-size: 12px; color: #9aa3ab; margin-top: 6px; }
.kpi-value.accent { color: #2ba471; }
.kpi-value.gray { color: #6b7671; }

/* ---------- 图表 ---------- */
.chart-wrap { width: 100%; overflow: hidden; }
svg.chart { width: 100%; height: 280px; display: block; }
.chart-empty { padding: 60px; text-align: center; color: #9aa3ab; }

/* ---------- 切换 ---------- */
.tabs { display: flex; gap: 6px; background: #f4f7f5; padding: 4px; border-radius: 10px; }
.tabs a { padding: 6px 14px; border-radius: 8px; font-size: 13px; color: #5c6762; text-decoration: none; }
.tabs a.active { background: #fff; color: #22855c; font-weight: 600; box-shadow: 0 2px 6px rgba(30,60,45,.08); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: #6b7671; padding: 10px 12px; border-bottom: 1px solid #edf1ef; white-space: nowrap; font-size: 12.5px; }
td { padding: 12px; border-bottom: 1px solid #f4f7f5; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fbfdfc; }
.table-wrap { overflow-x: auto; }
.empty-row { text-align: center; color: #9aa3ab; padding: 40px 0; }

/* ---------- 徽标 ---------- */
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; background: #eef2f0; color: #6b7671; }
.tag-green { background: #e9f7f0; color: #22855c; }
.tag-red { background: #fdecec; color: #c0392b; }
.dot-green { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2ba471; margin-right: 6px; }
.dot-gray { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #c9d2cd; margin-right: 6px; }

.avatar-mini { width: 30px; height: 30px; border-radius: 50%; background: #eef2f0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.avatar-mini img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 榜单名次 ---------- */
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: #f2f5f3; color: #8b9691; font-size: 12.5px; font-weight: 600; }
.rank-badge.rank-1 { background: linear-gradient(135deg,#ffeab4,#ffd464); color: #7a5c14; }
.rank-badge.rank-2 { background: linear-gradient(135deg,#eff3f6,#d3dde6); color: #4b5a66; }
.rank-badge.rank-3 { background: linear-gradient(135deg,#f8e3d2,#e8c2a3); color: #7c5233; }

/* ---------- 表单 ---------- */
.form-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; padding: 14px 0; border-bottom: 1px solid #f4f7f5; }
.form-row:last-child { border-bottom: none; }
.form-label { font-size: 13.5px; color: #3f4a45; padding-top: 9px; }
.form-label small { display: block; color: #9aa3ab; font-size: 12px; font-weight: 400; margin-top: 3px; }
input[type=text], input[type=password], input[type=number], select, textarea {
    width: 100%; max-width: 520px; padding: 9px 12px; border: 1px solid #e2e8e5; border-radius: 9px;
    font-size: 13.5px; background: #fbfcfc; font-family: inherit; color: #232a26;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #2ba471; background: #fff; }
.radio-line { display: flex; gap: 18px; padding-top: 8px; font-size: 13.5px; }
.radio-line label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.btn { display: inline-block; padding: 10px 22px; border: 0; border-radius: 10px; background: linear-gradient(135deg,#3ecb8b,#2ba471); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { opacity: .92; }
.btn-ghost { background: #fff; border: 1px solid #dde5e1; color: #3f4a45; }
.btn-ghost:hover { border-color: #2ba471; color: #22855c; opacity: 1; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 8px; }
.form-actions { margin-top: 22px; display: flex; gap: 10px; align-items: center; }

/* ---------- 提示 ---------- */
.notice { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.notice-ok { background: #eef7f2; border: 1px solid #cfe9dd; color: #2f7d5c; }
.notice-err { background: #fdecec; border: 1px solid #f5c6c6; color: #c0392b; }
.notice-info { background: #f4f7f9; border: 1px solid #e3ebf0; color: #5c6762; }
.notice code, .mono { background: #f0f3f1; padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; word-break: break-all; }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border-radius: 8px; font-size: 13px; text-decoration: none; color: #5c6762; border: 1px solid #e6ece9; }
.pager a:hover { border-color: #2ba471; color: #22855c; }
.pager .current { background: #2ba471; color: #fff; border-color: #2ba471; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f5f6f7; }
.login-card { width: 380px; background: #fff; border-radius: 18px; padding: 36px 32px; box-shadow: 0 16px 48px rgba(30,60,45,.09); }
.login-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.login-sub { color: #8b9691; font-size: 13px; margin-bottom: 26px; }
.login-card label { display: block; font-size: 13px; color: #5c6762; margin: 16px 0 6px; }
.login-card input { width: 100%; }
.login-card .btn { width: 100%; margin-top: 26px; padding: 12px; }

/* ---------- 用户详情 ---------- */
.profile-head { display: flex; align-items: center; gap: 18px; }
.avatar-big { width: 64px; height: 64px; border-radius: 50%; background: #eef2f0; display: flex; align-items: center; justify-content: center; font-size: 30px; overflow: hidden; }
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 18px; font-weight: 600; }
.profile-meta { font-size: 12.5px; color: #9aa3ab; margin-top: 4px; word-break: break-all; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.mini-stat { background: #f7faf8; border-radius: 10px; padding: 14px 16px; }
.mini-stat .k { font-size: 12px; color: #8b9691; }
.mini-stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; }

@media (max-width: 1100px) {
    .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
    .sidebar { width: 60px; }
    .logo-text, .nav-item, .sidebar-foot { display: none; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .main { padding: 20px 16px 60px; }
    .form-row { grid-template-columns: 1fr; gap: 6px; }
}
