:root {
  --primary: #1a6dd8;
  --primary-dark: #1257b4;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2d3d;
  --muted: #8a97a6;
  --danger: #e05252;
  --ok: #2fa84f;
  --warn: #e6a23c;
  --border: #e6eaf0;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px;
  padding-bottom: 64px;
}
/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(135deg, #1a6dd8, #2f8bef);
  color: #fff; padding: 14px 16px;
}
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar .sub { font-size: 12px; opacity: .85; margin-top: 2px; }
/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; background: #fff; border-top: 1px solid var(--border);
  max-width: 640px; margin: 0 auto;
}
.tabbar a {
  flex: 1; text-align: center; padding: 8px 0 10px; color: var(--muted);
  text-decoration: none; font-size: 11px;
}
.tabbar a .icon { font-size: 20px; display: block; }
.tabbar a.active { color: var(--primary); }
/* 布局 */
.wrap { max-width: 640px; margin: 0 auto; padding: 12px; }
.card {
  background: var(--card); border-radius: 12px; padding: 14px;
  margin-bottom: 12px; box-shadow: 0 1px 4px rgba(20,40,80,.06);
}
.card h3 { font-size: 15px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: #f6f9ff; border-radius: 10px; padding: 10px 8px; text-align: center; }
.stat .v { font-size: 20px; font-weight: 700; color: var(--primary); }
.stat .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stat.warn .v { color: var(--danger); }
/* 按钮 */
.btn {
  display: inline-block; border: none; border-radius: 8px; padding: 9px 16px;
  font-size: 14px; cursor: pointer; background: var(--primary); color: #fff;
}
.btn.block { display: block; width: 100%; text-align: center; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.gray { background: #eef1f5; color: var(--muted); }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; }
/* 列表 */
.row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 2px; border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row .name { font-weight: 600; }
.row .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: #eef4ff; color: var(--primary); margin-right: 4px;
}
.tag.gray { background: #f0f2f5; color: var(--muted); }
.tag.red { background: #fdecec; color: var(--danger); }
.tag.green { background: #e9f8ee; color: var(--ok); }
.tag.orange { background: #fdf3e4; color: var(--warn); }
/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 7px 6px; border-bottom: 1px solid var(--border); text-align: center; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12px; }
.tbl td.l, .tbl th.l { text-align: left; }
.tbl tr.me { background: #f2f8ff; }
.tbl-scroll { overflow-x: auto; }
/* 表单 */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; font-size: 15px; background: #fff; color: var(--text);
}
.field textarea { min-height: 70px; resize: vertical; }
.seg { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 7px 12px; font-size: 13px; cursor: pointer; color: var(--text);
}
.seg button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
/* 登录页 */
.login-box { max-width: 380px; margin: 12vh auto 0; padding: 0 20px; }
.login-box .logo { text-align: center; font-size: 44px; margin-bottom: 8px; }
.login-box h2 { text-align: center; margin-bottom: 24px; }
/* 状态点 */
.pill {
  display: inline-block; min-width: 44px; text-align: center; font-size: 12px;
  padding: 3px 8px; border-radius: 6px; background: #f0f2f5;
}
.pill.ok { background: #e9f8ee; color: var(--ok); }
.pill.half { background: #fdf3e4; color: var(--warn); }
.pill.bad { background: #fdecec; color: var(--danger); }
.toast {
  position: fixed; top: 18%; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.75); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; z-index: 99; max-width: 80vw; text-align: center;
}
.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 13px; }
a.link { color: var(--primary); text-decoration: none; }
.section-title { font-size: 14px; color: var(--muted); margin: 14px 2px 8px; }
@media (min-width: 700px) { .wrap { max-width: 760px; } }
