:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1b2333;
  --ink-2: #5b6577;
  --ink-3: #8b94a3;
  --line: #e6e9ef;
  --brand: #0d7a6b;
  --brand-2: #0b6a5d;
  --warn: #c2410c;
  --danger: #b91c1c;
  --ok: #15803d;
  --amber: #d97706;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 8px 24px rgba(20, 30, 50, .06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.side {
  position: fixed; left: 0; top: 0; bottom: 0; width: 208px;
  background: #14201f;
  color: #cfd8d6;
  display: flex; flex-direction: column;
  padding: 18px 0;
  z-index: 5;
  overflow: hidden;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 18px 18px;
  font-weight: 700; font-size: 15px; color: #fff;
  letter-spacing: .3px;
}
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: #26c98f; box-shadow: 0 0 0 4px rgba(38,201,143,.14); }
.side nav {
  display: flex; flex-direction: column; gap: 2px; padding: 0 10px 6px;
  overflow-y: auto; flex: 1 1 auto; min-height: 0;
  scrollbar-width: thin; scrollbar-color: #2f423f transparent;
}
.side nav::-webkit-scrollbar { width: 6px; }
.side nav::-webkit-scrollbar-thumb { background: #2f423f; border-radius: 3px; }
.side nav::-webkit-scrollbar-track { background: transparent; }
.item {
  display: flex; flex-direction: column;
  padding: 9px 12px; border-radius: 8px;
  color: #b9c4c1; text-decoration: none;
}
.item b { font-weight: 600; font-size: 13.5px; }
.item i { font-style: normal; font-size: 11.5px; color: #7f8e8b; }
.item:hover { background: #1c2c2a; text-decoration: none; }
.item.active { background: #1f3a35; color: #fff; }
.item.active i { color: #9fc4bc; }
.side-foot { margin-top: auto; padding: 12px 18px; }
.side-foot .logout { color: #8b9b98; font-size: 12px; }

.main { margin-left: 208px; padding: 22px 28px 60px; min-height: 100vh; }

/* ---------- 通用组件 ---------- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.flash.success { background: #ecfdf5; color: #046c4e; border: 1px solid #bbf7d0; }
.flash.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.flash.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px; cursor: pointer;
  text-decoration: none; line-height: 1;
}
.btn:hover { border-color: #c9d2df; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card h2 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.card h3 { margin: 18px 0 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .label { color: var(--ink-3); font-size: 12px; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat .foot { font-size: 12px; color: var(--ink-2); margin-top: 6px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th, table.tb td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tb th { color: var(--ink-2); font-weight: 600; background: #fafbfc; font-size: 12.5px; white-space: nowrap; }
table.tb tr:hover td { background: #fbfcfd; }
table.tb td.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px;
  background: #f1f5f9; color: #475569; margin-right: 4px;
}
.tag.ok { background: #ecfdf5; color: #047857; }
.tag.warn { background: #fffbeb; color: #b45309; }
.tag.danger { background: #fef2f2; color: #b91c1c; }
.tag.info { background: #eff6ff; color: #1d4ed8; }
.tag.gray { background: #f3f4f6; color: #6b7280; }

.score { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.score-bar { width: 54px; height: 6px; background: #eef1f5; border-radius: 4px; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #0d7a6b); }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff; color: var(--ink);
  outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: #7cc3b6; box-shadow: 0 0 0 3px rgba(13,122,107,.08); }
textarea { resize: vertical; min-height: 110px; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* 图片 */
.thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #eef1f5; border: 1px solid var(--line); }
.thumb-lg { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; background: #eef1f5; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.img-grid .cell { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.img-grid .cell img { width: 100%; height: 92px; object-fit: cover; display: block; }
.img-grid .cell .no { display: flex; align-items: center; justify-content: center; height: 92px; color: var(--ink-3); font-size: 12px; background: #f8fafc; }

/* 分页 */
.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pg { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 12.5px; color: var(--ink-2); }
.pg.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 图表 */
.chart { width: 100%; }
canvas { max-width: 100%; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 64px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-track { height: 9px; background: #eef1f5; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #34d399, #0d7a6b); }
.bar-row .val { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* 登录页 */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(1200px 600px at 20% 0%, #e7f5f1, #f5f6f8 60%); }
.login-card { width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 19px; margin: 0 0 4px; }
.login-card .muted { margin: 0 0 20px; font-size: 12.5px; }
.login-card label { display: block; margin-bottom: 14px; font-size: 12.5px; color: var(--ink-2); }
.login-card label input { margin-top: 6px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-card .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 16px; line-height: 1.6; }

/* 空状态 */
.empty { padding: 40px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* 抽屉 / 弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 20; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: min(720px, 92vw); max-height: 84vh; overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(15,23,42,.25); }

/* 进度提示 */
.job-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.spinner { width: 12px; height: 12px; border: 2px solid #cbd5e1; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 演示 / 授权横幅 */
.demo-banner{
  position:sticky;top:0;z-index:20;
  margin:0 0 14px;padding:9px 14px;border-radius:8px;
  background:#fff8e1;border:1px solid #f2d98a;color:#8a6d00;
  font-size:13px;font-weight:600;letter-spacing:.2px;
}
.demo-banner.warn{background:#fdf0f0;border-color:#f0b3b3;color:#a12a2a}
.demo-banner a{color:inherit;text-decoration:underline}
/* ---------- 窄屏：侧栏收窄，内容区留白 ---------- */
@media (max-width: 720px) {
  .side { width: 148px; }
  .brand { font-size: 13px; padding: 4px 10px 12px; }
  .side nav { padding: 0 6px 6px; }
  .item { padding: 7px 8px; }
  .item b { font-size: 12.5px; }
  .item i { font-size: 10.5px; }
  .side-foot { padding: 10px 10px; }
  .main { margin-left: 148px; padding: 14px 12px 60px; }
}

/* 体验版升级条 */
.demo-banner.up{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#eef6f4;border-color:#bfe0d8;color:#0b5d52}
.demo-banner .btn{text-decoration:none}
.demo-banner .btn.primary{color:#fff}
