/* =========================================================
   宇智慧巡官 · 巡检管理平台
   设计系统 v2：深色侧栏 + 顶部工作栏 + 卡片/表格分层
   ========================================================= */

:root {
  /* 文字 */
  --ink: #0f1729;
  --ink-2: #3d4859;
  --ink-3: #6b7688;
  --ink-4: #98a2b3;

  /* 描边与底色 */
  --line: #eaecf0;
  --line-2: #f2f4f7;
  --line-strong: #dde2e9;
  --bg: #f6f7f9;
  --surface: #ffffff;

  /* 主色 */
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-700: #1e40af;
  --primary-soft: #eff4ff;
  --primary-line: #c7d9fe;

  /* 语义色 */
  --success: #079455;
  --success-soft: #ecfdf3;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --info: #175cd3;
  --info-soft: #eff8ff;

  /* 形状 */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* 阴影 */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --sh-md: 0 6px 16px -4px rgba(16, 24, 40, .1), 0 2px 6px -2px rgba(16, 24, 40, .05);
  --sh-lg: 0 18px 40px -12px rgba(16, 24, 40, .18);

  --sidebar-w: 232px;
  --topbar-h: 60px;

  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-700); }

h1, h2, h3, p { margin: 0; }

::selection { background: #d7e4ff; }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: #cfd6e0 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #cfd6e0; border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

/* =========================================================
   骨架布局
   ========================================================= */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 26px 32px 64px;
}

/* =========================================================
   侧边栏
   ========================================================= */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  z-index: 60;
  background: linear-gradient(180deg, #0b1424 0%, #101c2e 55%, #0e1a2b 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 180px at 10% 0%, rgba(59, 130, 246, .16), transparent 70%),
    radial-gradient(300px 200px at 90% 100%, rgba(37, 99, 235, .1), transparent 70%);
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  z-index: 1;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(140deg, #4f8cff 0%, #2563eb 55%, #1d4ed8 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, .6), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.brand-text b {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.35;
}

.brand-text span {
  font-size: 11px;
  color: #74859e;
  letter-spacing: .06em;
}

.menu {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 14px;
  z-index: 1;
}

.menu-group {
  padding: 14px 10px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  color: #5b6b83;
  text-transform: uppercase;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  margin-bottom: 2px;
  border-radius: var(--r-sm);
  color: #a3b1c4;
  font-size: 13.5px;
  font-weight: 450;
  transition: background .16s, color .16s;
}

.menu-item svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: .78;
  transition: opacity .16s;
}

.menu-item:hover { background: rgba(255, 255, 255, .055); color: #eef4fb; }
.menu-item:hover svg { opacity: 1; }

.menu-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, .22), rgba(59, 130, 246, .08));
  color: #fff;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(110, 160, 255, .16);
}

.menu-item.active svg { opacity: 1; color: #93b8ff; }

.menu-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.menu-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.sidebar-user {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 8px 10px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .07);
}

.sidebar-user .avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(140deg, #3b82f6, #1e40af);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user .who { flex: 1; min-width: 0; }

.sidebar-user .who b {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .who span { font-size: 11px; color: #74859e; }

.sidebar-user .acts { display: flex; gap: 2px; }

.sidebar-user .acts a {
  width: 26px;
  height: 26px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b9bb1;
  transition: background .15s, color .15s;
}

.sidebar-user .acts a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar-user .acts svg { width: 15px; height: 15px; }

/* =========================================================
   顶部工作栏
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-4);
  min-width: 0;
}

.crumb i { font-style: normal; color: #cfd6e0; }
.crumb b { color: var(--ink-2); font-weight: 500; }
.crumb span { white-space: nowrap; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  transition: background .15s, color .15s;
}

.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #fff;
}

.topbar-sep {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 4px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary-700);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid #dbe7fe;
}

/* =========================================================
   页面头
   ========================================================= */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-head h1 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -.01em;
  line-height: 1.35;
  color: var(--ink);
}

.page-head .sub {
  margin-top: 5px;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.6;
}

.page-head .head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: none;
}

/* 兼容旧类名 */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-header h1 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); margin: 0; }
.page-sub { margin-top: 5px; font-size: 13px; color: var(--ink-3); }
h1 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 18px; }
h2 { font-size: 14.5px; font-weight: 600; margin: 0; color: var(--ink); }

/* =========================================================
   卡片
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  margin-bottom: 16px;
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}

.card-head .t { display: flex; align-items: center; gap: 2px 9px; min-width: 0; flex-wrap: wrap; }
.card-head h2 { font-size: 14.5px; font-weight: 600; }
.card-head .desc { flex: 1 1 100%; font-size: 12.5px; color: var(--ink-4); margin-top: 1px; line-height: 1.5; }
.card-head .acts { display: flex; gap: 8px; flex: none; align-items: center; }

.card-body { padding: 20px; }
.card-body.flush { padding: 0; }
.card-body.tight { padding: 14px 20px; }

/* 无 card-body 的老结构仍然留白 */
.card > .table-wrap { padding-top: 4px; }
.card > h2 { padding: 16px 20px 12px; border-bottom: 1px solid var(--line-2); }
.card > form { padding: 20px; }
.card > .muted { padding: 0 20px 16px; }
.card > .empty { padding: 40px 20px; }
.card > .apply-item { margin: 0 20px; }
.card > p.muted { padding: 12px 20px 0; }

/* =========================================================
   统计卡
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px 15px;
  box-shadow: var(--sh-xs);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}

.stat:hover {
  transform: translateY(-2px);
  border-color: #dbe4f5;
  box-shadow: var(--sh-md);
}

.stat .stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.stat-label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
}

.stat-icon {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--line-2);
  color: var(--ink-3);
}

.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.blue { background: var(--primary-soft); color: var(--primary); }
.stat-icon.orange { background: var(--warning-soft); color: var(--warning); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.slate { background: #f4f5f7; color: #5d6b80; }

.stat b {
  display: block;
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--ink);
}

.stat b.stat-danger { color: var(--danger); }

.stat .stat-foot {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-4);
}

/* 流程漏斗 */
.flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
}

.flow-item {
  background: #fff;
  padding: 12px 14px;
}

.flow-item span {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

.flow-item b {
  font-size: 18px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.flow-item.is-active { background: linear-gradient(180deg, #f7faff, #fff); }
.flow-item.is-active b { color: var(--primary); }

/* 进度条 */
.bar {
  height: 7px;
  border-radius: 99px;
  background: var(--line-2);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width .5s ease;
}

.bar.green > i { background: linear-gradient(90deg, #34d399, #079455); }

/* =========================================================
   表格
   ========================================================= */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: .03em;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 11px 14px;
  font-size: 13.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}

table tr:hover td { background: #fafbfd; }
table tr:last-child td { border-bottom: none; }

td .strong, td.strong { color: var(--ink); font-weight: 550; }
td .sub { display: block; font-size: 12px; color: var(--ink-4); margin-top: 1px; }

.cell-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-xs);
  background: var(--line-2);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -.02em;
  color: var(--ink);
}

.score-pill.low { color: var(--danger); }
.score-pill em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--ink-4); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
table .row-actions, .mobile-card .row-actions { flex-wrap: nowrap; }

/* =========================================================
   按钮
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--primary);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, border-color .15s, transform .1s;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.btn:hover {
  background: var(--primary-600);
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, .4);
}

.btn:active { transform: translateY(1px); }

.btn svg { width: 15px; height: 15px; }

.btn.secondary {
  background: #fff;
  color: var(--ink-2);
  border-color: var(--line-strong);
  box-shadow: var(--sh-xs);
}

.btn.secondary:hover {
  background: #fbfcfd;
  border-color: #cbd5e1;
  color: var(--ink);
  box-shadow: var(--sh-sm);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-3);
  box-shadow: none;
}

.btn.ghost:hover { background: var(--line-2); color: var(--ink); box-shadow: none; }

.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b42318; box-shadow: 0 4px 12px -2px rgba(217, 45, 32, .4); }

.btn.danger-ghost {
  background: #fff;
  color: var(--danger);
  border-color: #fecdca;
  box-shadow: none;
}

.btn.danger-ghost:hover { background: var(--danger-soft); color: #b42318; }

.btn-sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14.5px; border-radius: var(--r-md); }

.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* 底部悬浮操作条：长表单保存/提交不用滚到底 */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 0 16px;
  margin-top: 4px;
  background: linear-gradient(180deg, rgba(246, 247, 249, 0) 0%, var(--bg) 46%);
}

@media (max-width: 1024px) {
  .action-bar {
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 12px 14px;
    margin: 0 -14px -48px;
    box-shadow: 0 -4px 16px rgba(16, 24, 40, .07);
  }
  .action-bar .btn { flex: 1; }
}

/* =========================================================
   徽章
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
  flex: none;
}

.badge-success { background: var(--success-soft); color: #067647; border-color: #abefc6; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: #b2ddff; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: #fedf89; }
.badge-danger { background: var(--danger-soft); color: #b42318; border-color: #fecdca; }
.badge-neutral { background: #f8f9fb; color: #5d6b80; border-color: var(--line); }

/* 计数用小胶囊，不带圆点 */
.badge.count { padding: 0 7px; font-variant-numeric: tabular-nums; }
.badge.count::before { display: none; }

/* =========================================================
   表单
   ========================================================= */
input, select, textarea {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-family: inherit;
  line-height: normal;
  transition: border-color .15s, box-shadow .15s;
  max-width: 100%;
}

textarea { height: auto; padding: 9px 12px; line-height: 1.6; resize: vertical; }

input::placeholder, textarea::placeholder { color: var(--ink-4); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #84a9fb;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, .1);
}

input[type="radio"], input[type="checkbox"] {
  height: auto;
  width: 15px;
  height: 15px;
  padding: 0;
  accent-color: var(--primary);
  vertical-align: -2px;
}

input[type="file"] { height: auto; padding: 6px 10px; font-size: 12.5px; }

select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236b7688' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* 表单行（旧结构） */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.row label {
  min-width: 84px;
  flex: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}

.row input, .row select, .row textarea { flex: 1; min-width: 0; }
.row:last-child { margin-bottom: 0; }

/* 字段块（新结构：label 在上） */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }

.field > label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.field .hint { font-size: 11.5px; color: var(--ink-4); }
.field input, .field select, .field textarea { width: 100%; }

.capture {
  display: block;
  padding: 7px 10px;
  background: #fbfcfd;
  border: 1px dashed #cbd5e1;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 100%;
}

/* =========================================================
   筛选条
   ========================================================= */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line-2);
}

.filter-bar .spacer { flex: 1; }
.filter-bar input, .filter-bar select { height: 34px; font-size: 13px; }
.filter-bar select { min-width: 168px; }
.filter-bar .search { width: 180px; }

/* 工作台「查看项目」切换条 */
.scope-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

.scope-bar .lb { font-size: 12.5px; color: var(--ink-3); }

.scope-bar select {
  height: 34px;
  min-width: 280px;
  font-size: 13px;
}

.scope-bar .now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.scope-bar .now b { color: var(--primary-600); font-weight: 600; }

.scope-bar .scope-tip { margin-left: auto; }

.mobile-card tr.is-active { background: var(--primary-soft); }
.mobile-card tr.is-active td { border-color: var(--primary-line); }

@media (max-width: 640px) {
  .scope-bar { padding: 10px 12px; gap: 8px; }
  .scope-bar select { min-width: 0; flex: 1 1 100%; }
  .scope-bar .scope-tip { margin-left: 0; }
  .scope-bar .now { flex: 1 1 100%; }
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  transition: all .15s;
}

.filter-toggle:hover { border-color: #cbd5e1; background: #fbfcfd; }

.filter-toggle.on {
  background: var(--danger-soft);
  border-color: #fecdca;
  color: #b42318;
  font-weight: 500;
}

.filter-toggle .n {
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, .06);
}

.filter-meta {
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--ink-4);
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-meta b { color: var(--ink-2); font-weight: 600; }

/* =========================================================
   提示与空状态
   ========================================================= */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 13.5px;
}

.alert.ok { background: var(--success-soft); color: #067647; border-color: #abefc6; }
.alert.error { background: var(--danger-soft); color: #b42318; border-color: #fecdca; }
.alert.warn { background: var(--warning-soft); color: var(--warning); border-color: #fedf89; }

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--ink-4);
  font-size: 13.5px;
}

.empty-state {
  padding: 48px 20px 52px;
  text-align: center;
}

.empty-state .art {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #f7f9fc, #eef2f8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b6c0ce;
}

.empty-state .art svg { width: 30px; height: 30px; }
.empty-state .t { font-size: 14px; font-weight: 550; color: var(--ink-2); }
.empty-state .d { margin-top: 4px; font-size: 12.5px; color: var(--ink-4); }

/* =========================================================
   其它元素
   ========================================================= */
.photo {
  max-width: 64px;
  max-height: 48px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  object-fit: cover;
  display: block;
}

.muted { color: var(--ink-3); font-size: 13px; }
.tiny { font-size: 11.5px; color: var(--ink-4); }
.divider { height: 1px; background: var(--line-2); margin: 18px 0; }

.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.kv > div span { display: block; font-size: 12px; color: var(--ink-4); margin-bottom: 3px; }
.kv > div b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 14px 20px;
  font-size: 13px;
  color: var(--ink-2);
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 0 0 3px #fff;
}
.timeline li::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 17px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--success); }
.timeline li span { color: var(--ink-4); font-size: 12px; margin-left: 6px; }

/* 账号申请项 */
.apply-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
}

.apply-item:last-child { border-bottom: none; padding-bottom: 4px; }

.apply-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}

.apply-info strong { font-size: 14.5px; font-weight: 600; color: var(--ink); }

.apply-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.apply-actions input, .apply-actions select { height: 34px; font-size: 13px; }

/* 分段控件 */
.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--line-2);
  border-radius: var(--r-md);
  gap: 2px;
}

.seg a {
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
}

.seg a.on { background: #fff; color: var(--ink); box-shadow: var(--sh-xs); }

/* =========================================================
   登录页
   ========================================================= */
body.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 480px at 8% -10%, #e4edff 0%, transparent 62%),
    radial-gradient(760px 420px at 96% 108%, #e8f1ff 0%, transparent 58%),
    #f4f6fa;
}

.login-shell {
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(16, 24, 40, .3), 0 2px 8px rgba(16, 24, 40, .05);
}

.login-aside {
  position: relative;
  padding: 44px 40px;
  color: #fff;
  background: linear-gradient(160deg, #0d1b30 0%, #12233d 48%, #0f2136 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.login-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(620px 380px at 78% 4%, rgba(59, 130, 246, .26), transparent 72%),
    radial-gradient(520px 420px at -6% 104%, rgba(37, 99, 235, .18), transparent 74%);
}

.login-aside > * { position: relative; z-index: 1; }

.login-aside .mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(140deg, #4f8cff, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 10px 24px -8px rgba(59, 130, 246, .8);
}

.login-aside h2 { font-size: 23px; font-weight: 650; margin-top: 22px; letter-spacing: .01em; color: #fff; }
.login-aside p { margin-top: 10px; font-size: 13px; line-height: 1.85; color: #a8b8cd; }

.login-aside ul {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.login-aside ul li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: #b7c5d6;
}

.login-aside ul li i {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 11px;
  color: #9dc0ff;
  flex: none;
}

.login-aside .foot { font-size: 11.5px; color: #6b7f96; margin-top: 30px; }

.login-card {
  padding: 46px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card .head b { display: block; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.login-card .head span { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }

.login-form { margin-top: 26px; display: flex; flex-direction: column; gap: 15px; }
.login-form .field > label { font-size: 12.5px; color: var(--ink-2); }
.login-form input { height: 42px; }
.login-form .btn { width: 100%; height: 43px; margin-top: 4px; font-size: 14px; }

.login-note {
  margin-top: 20px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-4);
}

/* 兼容旧的登录卡片结构 */
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand .brand-mark { width: 42px; height: 42px; font-size: 19px; }
.login-brand b { display: block; font-size: 17px; font-weight: 650; margin: 0; }
.login-brand span { font-size: 12px; color: var(--ink-3); }
.login-card .row { display: block; margin-bottom: 16px; }
.login-card .row label { display: block; margin-bottom: 7px; min-width: 0; font-size: 12.5px; color: var(--ink-2); }
.login-card .row input { width: 100%; display: block; height: 42px; }
.login-card .btn { width: 100%; height: 43px; font-size: 14px; }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  :root { --topbar-h: 0px; }

  .sidebar {
    inset: 0 0 auto 0;
    width: auto;
    height: 56px;
    flex-direction: row;
    align-items: center;
    padding: 0 10px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }

  .sidebar::after { display: none; }

  .brand { padding: 0 10px 0 2px; flex: none; }
  .brand-mark { width: 30px; height: 30px; font-size: 14px; border-radius: 9px; }
  .brand-text { display: none; }

  .menu {
    display: flex;
    gap: 2px;
    padding: 0;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .menu-group, .menu-badge { display: none; }

  .menu-item {
    white-space: nowrap;
    padding: 7px 11px;
    margin: 0;
    font-size: 13px;
    border-radius: var(--r-sm);
  }

  .menu-item svg { display: none; }
  .menu-item.active::before { display: none; }

  .sidebar-user {
    padding: 0;
    margin: 0 0 0 6px;
    background: none;
    border: none;
    flex: none;
    gap: 4px;
  }

  .sidebar-user .who { display: none; }
  .sidebar-user .avatar { width: 28px; height: 28px; font-size: 12px; }
  .sidebar-user .acts a { width: 28px; height: 28px; }

  .main { margin-left: 0; padding-top: 56px; }
  .topbar { display: none; }
  .container { padding: 16px 14px 48px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat b { font-size: 22px; }
  .stat-icon { width: 26px; height: 26px; border-radius: 8px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head .head-actions { justify-content: flex-start; }
  .card-head { padding: 14px 16px; flex-wrap: wrap; }
  .card-body { padding: 16px; }
  .row { display: block; }
  .row label { display: block; margin-bottom: 6px; }
  .row input, .row select, .row textarea { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px; height: 42px; }
  .btn { height: 40px; }
  .btn-sm { height: 33px; }
  .filter-bar { padding: 11px 14px; }
  .filter-bar select { min-width: 0; flex: 1; }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .apply-actions { flex-direction: column; align-items: stretch; }
  .apply-actions form { width: 100%; }
  .apply-actions select, .apply-actions input { width: 100%; }
  .login-shell { grid-template-columns: 1fr; max-width: 420px; }
  .login-aside { display: none; }
  .login-card { padding: 32px 24px; }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}

@media (max-width: 640px) {
  .mobile-card table,
  .mobile-card tbody,
  .mobile-card tr,
  .mobile-card td { display: block; width: 100%; }

  .mobile-card th { display: none; }

  .mobile-card tr {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 10px 13px;
    margin: 0 12px 10px;
    background: #fff;
    box-shadow: var(--sh-xs);
  }

  .mobile-card td {
    border: none;
    border-bottom: 1px solid var(--line-2);
    padding: 8px 0;
    font-size: 13.5px;
  }

  .mobile-card td:last-child { border-bottom: none; padding-bottom: 2px; }

  .mobile-card td:before {
    content: attr(data-label);
    display: block;
    color: var(--ink-4);
    font-size: 11px;
    letter-spacing: .04em;
    margin-bottom: 2px;
  }

  .mobile-card tr:hover td { background: transparent; }
  .table-wrap { overflow: visible; }
  .card > .table-wrap { padding-top: 8px; }
  .page-head h1 { font-size: 19px; }
}

/* ---------- 移动端修正 ---------- */
@media (max-width: 1024px) {
  .menu { scrollbar-width: none; -ms-overflow-style: none; }
  .menu::-webkit-scrollbar { display: none; }

  /* 用户区实底，避免滚动菜单从下方透出来 */
  .sidebar-user {
    background: #0e1a2b;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, .1);
    border-radius: 0;
    margin: 0 0 0 6px;
    padding: 0 2px 0 10px;
    height: 56px;
    gap: 2px;
  }
}

@media (max-width: 640px) {
  /* 顶栏拆两行：第一行品牌 + 用户，第二行菜单，避免菜单被头像压住 */
  .sidebar {
    height: auto;
    flex-wrap: wrap;
    padding: 0;
  }
  .brand {
    height: 48px;
    padding: 0 8px 0 12px;
    flex: none;
  }
  .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }
  .brand-text b { font-size: 14px; color: #fff; }
  .brand-text span { display: none; }

  .sidebar-user {
    order: 2;
    height: 48px;
    margin: 0 6px 0 auto;
    padding: 0 4px 0 8px;
    border-left: none;
  }

  .menu {
    order: 3;
    flex: 0 0 100%;
    padding: 4px 8px 6px;
    gap: 0;
    border-top: 1px solid rgba(255, 255, 255, .07);
  }
  .menu-item { padding: 6px 7px; font-size: 12px; }
  /* 手机上导航行很窄：站内信入口保留在右上角铃铛，避免菜单挤出屏 */
  .menu-item[href="/messages"] { display: none; }

  .main { padding-top: 90px; }

  /* 表头行在卡片化后隐藏，之前会留成一条空框 */
  .mobile-card tr.thead { display: none; }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px;
  }
  .filter-bar > * { width: 100%; min-width: 0; }
  .filter-bar select { grid-column: span 1; min-width: 0; height: 40px; font-size: 15px; }
  /* 项目名较长，手机上单选占整行，避免只露出前几个字 */
  .filter-bar select:first-of-type { grid-column: 1 / -1; }
  .filter-bar .search,
  .filter-bar .filter-toggle,
  .filter-bar .tiny { grid-column: 1 / -1; }
  .filter-bar .search { width: 100%; height: 40px; font-size: 15px; }
  .filter-bar .btn { grid-column: span 1; }
  .filter-bar .spacer { display: none; }
  .filter-bar .tiny { text-align: right; }
  .filter-toggle { justify-content: center; }

  /* 五段流程在窄屏两列时，最后一段独占整行，不留空格子 */
  .flow > div:last-child:nth-child(odd) { grid-column: span 2; }

  .container { padding: 14px 12px 44px; }
  .card-head { padding: 13px 14px; }
  .card-body { padding: 14px; }
  .mobile-card tr { margin: 0 10px 8px; }
}

@media print {
  .sidebar, .topbar, .btn, .filter-bar, .page-head .head-actions { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #d0d5dd; }
}


/* 备案号页脚：工信部要求展示，浅灰不抢视觉 */
.site-foot {
  padding: 28px 0 36px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-4);
}
.site-foot a { color: var(--ink-4); text-decoration: none; }
.site-foot a:hover { color: var(--ink-2); text-decoration: underline; }
