* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #0f1e33; --text: #1f2d3d; --sub: #6b7a90; --line: #e3e9f2;
  --bg: #f4f7fb; --card: #fff; --accent: #2563eb; --accent-soft: #eef5ff;
  --danger: #e11d48; --ok: #0f9d58;
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; font-size: 14px; outline: none; }
.btn { border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: #fff1f3; color: var(--danger); border: 1px solid #f8d3da; }
.btn.small { padding: 5px 11px; font-size: 12.5px; border-radius: 6px; }
.btn.full { width: 100%; margin-top: 8px; padding: 11px; }

/* 登录 */
.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%); padding: 24px;
}
.login-card { width: 100%; max-width: 360px; background: #fff; border-radius: 16px; padding: 30px 26px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.login-brand { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: 1px; }
.login-sub { font-size: 12px; color: var(--sub); margin: 5px 0 22px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 12px; color: var(--sub); }
.field input, .field select {
  height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; width: 100%; background: #fff;
}
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.login-tip { margin-top: 18px; font-size: 11.5px; color: var(--sub); border-top: 1px dashed var(--line); padding-top: 12px; }
.login-tip p { display: flex; gap: 10px; line-height: 1.95; margin: 0; }
.login-tip p span { width: 62px; flex: none; color: var(--sub); }
.login-tip p b { font-weight: 600; color: #3d4a5e; font-family: Consolas, monospace; }
.back-shop { display: block; margin-top: 12px; text-align: center; font-size: 12px; color: var(--accent); text-decoration: none; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.side {
  width: 216px; flex: none; background: #0f1e33; color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg,#3b82f6,#8b5cf6);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.brand b { display: block; font-size: 14.5px; letter-spacing: .5px; }
.brand small { font-size: 10.5px; color: rgba(255,255,255,.5); }
.nav { flex: 1; padding: 6px 10px; overflow-y: auto; }
.nav button {
  width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; background: none; border: 0;
  color: rgba(255,255,255,.68); font-size: 13.5px; cursor: pointer; margin-bottom: 2px;
  display: flex; align-items: center; gap: 9px;
}
.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button.on { background: rgba(59,130,246,.22); color: #fff; font-weight: 600; }
.nav button .ic { width: 16px; text-align: center; font-size: 13px; opacity: .9; }
.nav .dot { margin-left: auto; background: #ff2c55; font-size: 10px; border-radius: 9px; padding: 1px 6px; font-weight: 700; }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.09); font-size: 12px; }
.who span { display: block; color: #fff; font-size: 13px; }
.who small { color: rgba(255,255,255,.5); font-size: 11px; }
.link { margin-top: 8px; color: rgba(255,255,255,.55); background: none; border: 0; cursor: pointer; font-size: 12px; padding: 0; }
.link:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.head {
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.head h1 { font-size: 17px; color: var(--ink); font-weight: 700; }
.head-actions a { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.content { padding: 22px 26px 40px; }

/* 指标卡 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1180px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.stat { background: #fff; border-radius: 12px; padding: 16px 18px; border: 1px solid var(--line); }
.stat .k { font-size: 12px; color: var(--sub); }
.stat .v { font-size: 25px; font-weight: 800; color: var(--ink); margin-top: 6px; letter-spacing: -.5px; }
.stat .v small { font-size: 13px; font-weight: 600; margin-right: 2px; color: var(--sub); }
.stat.hl { background: linear-gradient(135deg,#f0f6ff,#fff); border-color: #cfe0f5; }
.stat.hl .v { color: var(--accent); }

/* 卡片与表格 */
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.card-head h2 { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.card-head .hint { font-size: 12px; color: var(--sub); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 14px; background: #f7fafd; color: var(--sub); font-weight: 600; font-size: 12px; white-space: nowrap; }
td { padding: 11px 14px; border-top: 1px solid #eef2f7; vertical-align: middle; }
tbody tr:hover { background: #fafcff; }
.t-img { width: 42px; height: 42px; border-radius: 7px; object-fit: cover; background: #eef2f7; }
.mono { font-family: Consolas, monospace; font-size: 11.5px; color: var(--sub); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 11px; font-size: 11.5px; font-weight: 600; }
.pill.ok { background: #e8f7ef; color: #0f7a4a; }
.pill.wait { background: #fff4e5; color: #b45309; }
.pill.bad { background: #ffeef1; color: #be123c; }
.pill.info { background: #eef5ff; color: #1d4ed8; }
.actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* 表单区 */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; padding: 18px; }
.form-grid .field { margin: 0; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { padding: 0 18px 18px; display: flex; gap: 10px; }
.hint-line { font-size: 12px; color: var(--sub); padding: 0 18px 14px; line-height: 1.7; }
.chk-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chk-list label {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 11px; font-size: 12.5px; cursor: pointer; background: #fff;
}
.chk-list input { accent-color: var(--accent); }

.empty { padding: 44px; text-align: center; color: var(--sub); font-size: 13px; }
.toast {
  position: fixed; left: 50%; top: 22px; transform: translate(-50%,-14px);
  background: #0f1e33; color: #fff; padding: 10px 20px; border-radius: 9px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .22s; z-index: 99; box-shadow: 0 6px 22px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  .nav { display: flex; overflow-x: auto; gap: 4px; }
  .nav button { white-space: nowrap; width: auto; }
  .content { padding: 14px; }
  .head { padding: 0 14px; }
}