:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e5e8ee;
  --text: #1f2733;
  --muted: #7a8598;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;
  --gray: #64748b;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --radius: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.err { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 16px; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #eef2ff, #f4f6f9); }
.login-card { background: var(--card); width: 100%; max-width: 360px; padding: 28px 24px; border-radius: 16px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card input { width: 100%; margin-top: 14px; }
.login-card .tip { margin-top: 14px; line-height: 1.6; }
.btn-block { width: 100%; margin-top: 18px; }

/* ---------- 输入控件 ---------- */
input, select, textarea, .input {
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px;
  background: #fff; color: var(--text); width: 100%; outline: none; font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { resize: vertical; min-height: 72px; }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--text); font-size: 14px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  background: #fff; border-bottom: 1px solid var(--line); padding: 10px 16px; }
.brand { font-weight: 700; color: var(--primary); }
.spacer { flex: 1; }
.who { font-size: 13px; color: var(--muted); }
.view { padding: 16px; max-width: 1080px; margin: 0 auto; padding-bottom: 90px; }

/* 顶部导航（桌面） */
.nav { display: flex; gap: 4px; background: #fff; border-bottom: 1px solid var(--line);
  padding: 0 12px; position: sticky; top: 49px; z-index: 19; overflow-x: auto; }
.nav a { padding: 12px 14px; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.nav a .badge { margin-left: 5px; }

/* ---------- 卡片/列表 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 16px; }
.section-title { font-size: 15px; font-weight: 600; margin: 4px 0 10px; }

.list-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer; }
.list-item:hover { border-color: #cdd6e4; }
.li-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.li-no { font-weight: 600; font-size: 14px; }
.li-sub { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; line-height: 1.6;
  background: #eef1f6; color: var(--gray); }
.badge.blue { background: #e0ebff; color: #1d4ed8; }
.badge.orange { background: #ffedd5; color: #c2410c; }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.gray { background: #eef1f6; color: #64748b; }
.badge.urgent { background: var(--red); color: #fff; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .n { font-size: 24px; font-weight: 700; }
.kpi .t { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* 表格 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--muted); font-weight: 600; font-size: 13px; }
.table-scroll { overflow-x: auto; }

/* 详情 kv */
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 14px; }
.kv .k { color: var(--muted); }

/* 时间线 */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--primary); }
.timeline .tl-time { color: var(--muted); font-size: 12px; }

/* 留言 */
.comment { background: #f8fafc; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-size: 14px; }
.comment .c-meta { color: var(--muted); font-size: 12px; margin-bottom: 2px; }

/* 工具条 */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 120px; flex: 0 1 auto; }
.grow { flex: 1; }

/* 缩略图 */
.thumb { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.thumb-sm { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* 底部标签栏（手机） */
.tabbar { display: none; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: #1f2733; color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); max-width: 90%; }

/* Modal */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; padding: 20px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal h3 { margin: 0 0 12px; }
.modal .actions { justify-content: flex-end; }

/* ---------- 响应式：手机 ---------- */
@media (max-width: 640px) {
  .view { padding: 12px; padding-bottom: 76px; }
  .row2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 78px 1fr; }
  /* 顶部横向导航改为底部标签栏 */
  .nav { display: none; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; text-align: center; padding: 9px 2px 8px; color: var(--muted); font-size: 11px; }
  .tabbar a .ico { display: block; font-size: 19px; line-height: 1.3; }
  .tabbar a.active { color: var(--primary); }
  .tabbar a .badge { position: absolute; }
}
