* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2B7BF7;
  --primary-dark: #1E6BE8;
  --primary-soft: #EAF2FE;
  --text-1: #1B2437;
  --text-2: #5A6A80;
  --text-3: #98A2B3;
  --border: #E9EEF6;
  --bg: #F5F8FC;
  --success: #16A97A;
  --success-bg: #E7F8F1;
  --danger: #E13B3D;
  --danger-bg: #FFECEC;
  --warn: #C97C05;
  --warn-bg: #FFF6E5;
  --radius: 14px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #EEF3FB; padding: 2px 6px; border-radius: 6px; font-size: 12px; color: #1B5FC4; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 224px; background: #fff; border-right: 1px solid var(--border);
  position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; }
.brand .ico {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px;
  background: linear-gradient(135deg, var(--primary), #5AA0FF);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px;
  box-shadow: 0 6px 16px rgba(43, 123, 247, .3);
}
.brand .txt b { display: block; font-size: 15px; }
.brand .txt span { font-size: 11px; color: var(--text-3); }
.nav { padding: 6px 12px 24px; }
.nav .group { font-size: 11px; color: var(--text-3); padding: 14px 10px 6px; letter-spacing: .5px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-size: 13.5px; margin-bottom: 2px;
}
.nav a:hover { background: #F5F8FD; text-decoration: none; color: var(--text-1); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }

.main { margin-left: 224px; flex: 1; min-width: 0; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .spacer { margin-left: auto; }
.topbar .who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.topbar .avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.content { padding: 22px 24px 60px; }

/* 卡片 */
.card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 18px; overflow: hidden; }
.card .head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.card .head h2 { font-size: 15px; font-weight: 700; }
.card .head .spacer { margin-left: auto; }
.card .body { padding: 18px 20px; }
.card .body.p0 { padding: 0; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.stat .extra { font-size: 12px; color: var(--text-2); margin-top: 6px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 13px; border-bottom: 1px solid #F1F5FA; vertical-align: middle; }
th { background: #FAFBFE; color: var(--text-2); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
tbody tr:hover { background: #FBFCFE; }
td.nowrap, th.nowrap { white-space: nowrap; }
td .muted { color: var(--text-3); font-size: 12px; }
.empty { padding: 50px; text-align: center; color: var(--text-3); font-size: 13px; }

/* 标签 / 徽标 */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 9px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.tag.ok { background: var(--success-bg); color: var(--success); }
.tag.bad { background: var(--danger-bg); color: var(--danger); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.info { background: var(--primary-soft); color: var(--primary); }
.tag.gray { background: #F1F5FB; color: var(--text-2); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* 表单 */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.field input[type=text], .field input[type=password], .field input[type=number], .field input[type=date], .field select, .field textarea {
  width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
  font-size: 13.5px; color: var(--text-1); background: #FBFCFE; outline: none; font-family: inherit; transition: all .18s;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(43,123,247,.12); }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.field.inline { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--primary); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .16s; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn.ghost { background: #fff; border-color: var(--border); color: var(--text-2); }
.btn.ghost:hover { color: var(--primary); border-color: #CFE1FD; background: #F8FBFF; }
.btn.danger { background: #fff; border-color: #FFD9D9; color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.toolbar input[type=text], .toolbar input[type=date], .toolbar select {
  height: 38px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; font-size: 13px;
  background: #FBFCFE; outline: none; font-family: inherit; min-width: 130px;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); background: #fff; }
.toolbar .spacer { margin-left: auto; }

.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 14px 20px; font-size: 13px; color: var(--text-2); }
.pager a, .pager span.cur {
  min-width: 32px; height: 32px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-2);
}
.pager span.cur { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager a:hover { text-decoration: none; border-color: #CFE1FD; color: var(--primary); }
.pager .info { margin-right: auto; color: var(--text-3); font-size: 12.5px; }

/* 提示 */
.flash { padding: 12px 16px; border-radius: 12px; font-size: 13px; margin-bottom: 16px; }
.flash.success { background: var(--success-bg); color: #0E8F68; }
.flash.error { background: var(--danger-bg); color: #C92A2A; }
.flash.info { background: var(--primary-soft); color: #1B5FC4; }

/* 图表 */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 10px 4px 0; }
.bars .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bars .bar {
  width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #63A6FF 0%, var(--primary) 100%);
  min-height: 4px; position: relative; transition: all .2s;
}
.bars .bar:hover { filter: brightness(1.06); }
.bars .bar span { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.bars .lab { font-size: 11.5px; color: var(--text-3); }

.progress { height: 8px; background: #EFF3F9; border-radius: 6px; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 6px; }

/* 登录页 */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #EAF2FE 0%, #F7FAFF 45%, #F5F8FC 100%); padding: 24px;
}
.login-box { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 34px 32px; box-shadow: 0 20px 50px rgba(27,36,55,.10); }
.login-box .logo {
  width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--primary), #5AA0FF); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; box-shadow: 0 10px 24px rgba(43,123,247,.32);
}
.login-box h1 { font-size: 20px; text-align: center; margin-bottom: 6px; }
.login-box .sub { text-align: center; color: var(--text-3); font-size: 12.5px; margin-bottom: 24px; }
.login-box .field input { height: 46px; font-size: 14px; }
.login-box .btn { height: 46px; width: 100%; font-size: 15px; margin-top: 6px; }
.login-tip { margin-top: 18px; font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.8; }

/* 详情小工具 */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kv .item { background: #FAFBFE; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.kv .item .k { font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.kv .item .v { font-size: 14px; font-weight: 600; word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12.5px; padding: 5px 11px; border-radius: 20px; background: #F1F5FB; color: var(--text-2); }
.sect-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 22px 0 12px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 16px 14px 50px; }
  .topbar { padding: 0 14px; }
}

/* 统一后台视觉层次 */
:root { --text-3:#6f8098; --bg:#f4f7fb; --radius:16px; }
.sidebar { background:linear-gradient(180deg,#fff,#f9fbff); }
.brand { padding-top:28px; padding-bottom:28px; }
.nav a { min-height:44px; margin-bottom:5px; transition:background .16s; }
.nav a.active { box-shadow:inset 3px 0 0 var(--primary); }
.topbar { box-shadow:0 3px 15px #233c6003; }
.panel,.card { border:1px solid #e4eaf3; box-shadow:0 6px 24px #233c6005; }
.btn { border-radius:10px; }
.field input,.field select,.field textarea { border-radius:10px; }
thead th { background:#f7f9fd; }
a:focus-visible,button:focus-visible { outline:3px solid #2b7bf7; outline-offset:3px; }
@media(prefers-reduced-motion:reduce) { * { transition:none !important; } }

.sidebar-toggle{display:none;min-height:44px}
@media(max-width:900px){.sidebar-toggle{display:inline-flex}.topbar{gap:8px}.topbar .who>span{display:none}.sidebar{box-shadow:12px 0 30px #1b24371a}.topbar h1{font-size:16px}}
