/* ============ 锦间企微服务系统 · 设计基底（深色侧栏 + 浅色主区，同色系） ============ */
:root {
  color-scheme: light;
  /* 主区域：冰蓝白，与侧栏同属深海军蓝—冰蓝色系 */
  --bg: #eef3f9;
  --bg-2: #e7eff7;
  --surface: #ffffff;
  --surface-2: #f6fafd;
  --surface-3: #f1f6fb;
  --ink: #0e2135;
  --ink-2: #2a4763;
  --muted: #56748c;
  --muted-2: #7a97ad;
  --line: rgba(18, 52, 84, 0.10);
  --line-strong: rgba(18, 52, 84, 0.18);
  --brand: #2c7fae;
  --brand-dark: #164e6d;
  --brand-hover: #3892c6;
  --brand-soft: rgba(44, 127, 174, 0.10);
  --grad: linear-gradient(100deg, #c2e2f6 0%, #83badf 46%, #5091c8 100%);
  --amber: #9d6520;
  --amber-soft: rgba(196, 133, 58, 0.12);
  --danger: #bf3a30;
  --danger-soft: rgba(191, 58, 48, 0.09);
  --blue: #2f6fd0;
  --blue-soft: rgba(47, 111, 208, 0.10);
  /* 侧栏：深海军蓝，保持官网深色调 */
  --sb-bg: #050b15;
  --sb-bg-2: #08131f;
  --sb-ink: #e9f2f9;
  --sb-ink-2: rgba(203, 225, 240, 0.74);
  --sb-muted: rgba(163, 188, 207, 0.5);
  --sb-line: rgba(150, 190, 220, 0.14);
  --sb-line-strong: rgba(150, 190, 220, 0.24);
  --sidebar: #050b15;
  --sidebar-2: #08121f;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 66, 0.06);
  --shadow-md: 0 10px 26px -10px rgba(16, 42, 66, 0.18);
  --shadow-lg: 0 26px 64px -20px rgba(12, 32, 52, 0.28);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(960px 640px at 88% -16%, rgba(131, 186, 223, 0.34), transparent 64%),
    radial-gradient(780px 560px at -8% 104%, rgba(80, 145, 200, 0.18), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

::selection { background: rgba(131, 186, 223, 0.4); color: #0b1d2e; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(18, 52, 84, 0.18); border-radius: 8px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(18, 52, 84, 0.3); background-clip: content-box; }

.num { font-variant-numeric: tabular-nums; }

/* ============ 通用控件 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid rgba(18, 52, 84, 0.22);
  background: #fff;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.16s ease;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgba(16, 42, 66, 0.04);
}
.btn:hover { border-color: rgba(44, 127, 174, 0.5); background: #f7fbfe; color: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #06202f;
  font-weight: 600;
  box-shadow: 0 10px 24px -14px rgba(80, 145, 200, 0.9);
}
.btn-primary:hover {
  background: var(--grad);
  border-color: transparent;
  color: #06202f;
  filter: brightness(1.05);
  box-shadow: 0 14px 28px -14px rgba(80, 145, 200, 0.95);
}

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: rgba(44, 127, 174, 0.08); color: var(--brand-dark); border-color: transparent; }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); border-color: rgba(191, 58, 48, 0.26); background: rgba(191, 58, 48, 0.04); }
.btn-danger:hover { background: var(--danger-soft); border-color: rgba(191, 58, 48, 0.5); color: #99271f; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
.field > label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.field .req { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
p.hint { font-size: 12px; color: var(--muted); line-height: 1.72; margin: 0; }

.input, select.input, textarea.input {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  outline: none;
}
.input::placeholder { color: rgba(122, 151, 173, 0.85); }
.input:focus {
  border-color: rgba(44, 127, 174, 0.65);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(44, 127, 174, 0.13);
}
.input[readonly], .input:disabled { background: rgba(18, 52, 84, 0.035); color: var(--ink-2); cursor: default; }
textarea.input { min-height: 78px; resize: vertical; line-height: 1.65; }
select.input {
  appearance: none;
  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.5L6 8l3.5-3.5' stroke='%2356748c' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
select.input option { background: #fff; color: var(--ink); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-sales { background: var(--blue-soft); color: #255fb4; }
.badge-delivery { background: var(--amber-soft); color: var(--amber); }
.badge-customer { background: var(--brand-soft); color: var(--brand-dark); }
.badge-admin { background: rgba(18, 52, 84, 0.08); color: var(--ink-2); }
.badge-muted { background: rgba(18, 52, 84, 0.05); color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  background: rgba(18, 52, 84, 0.06);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.pill-ok { background: var(--brand-soft); color: var(--brand-dark); }
.pill-wait { background: var(--amber-soft); color: var(--amber); }
.pill-idle { background: rgba(18, 52, 84, 0.04); color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-body { padding: 20px; }

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .empty-title { font-size: 14px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }

/* ============ 登录 / 入口（左侧品牌区保持深色） ============ */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  min-height: 100vh;
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px 56px;
  background:
    radial-gradient(720px 460px at 88% 8%, rgba(80, 145, 200, 0.3), transparent 62%),
    radial-gradient(620px 520px at 5% 96%, rgba(29, 74, 120, 0.45), transparent 60%),
    linear-gradient(158deg, #050b15 0%, #081426 58%, #040a12 100%);
  color: var(--sb-ink);
}
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(150, 195, 225, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 195, 225, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 40%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 10%, transparent 78%);
  pointer-events: none;
}
.brand-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 50%;
  flex: 0 0 auto; overflow: hidden;
  display: grid; place-items: center;
  background: rgba(190, 209, 224, 0.08);
  box-shadow: 0 0 0 1px rgba(150, 190, 220, 0.3), 0 10px 22px -12px rgba(80, 145, 200, 0.95);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }
.brand-name small { display: block; font-size: 10px; font-weight: 400; color: rgba(163, 188, 207, 0.5); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }

.brand-main { position: relative; z-index: 1; max-width: 470px; }
.brand-main h1 {
  font-size: 33px;
  line-height: 1.34;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  font-weight: 600;
}
.brand-main h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #e4f3fd 0%, #a8d5f0 46%, #74acd9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #8ec8e8;
}
.brand-main p { color: rgba(194, 215, 230, 0.72); font-size: 13.5px; line-height: 1.8; }

.brand-points { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }
.brand-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: rgba(194, 215, 230, 0.82); }
.brand-point .dot {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center; margin-top: 1px;
  background: rgba(142, 200, 232, 0.14); color: #8ec8e8;
  font-size: 11px; font-weight: 700;
}

.brand-foot { position: relative; z-index: 1; font-size: 11.5px; color: rgba(163, 188, 207, 0.42); letter-spacing: 0.03em; }

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--bg);
}
.auth-box { width: 100%; max-width: 400px; }
.auth-box .eyebrow {
  font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 12px;
}
.auth-box h2 { font-size: 23px; margin-bottom: 8px; }
.auth-box .lead { font-size: 13.5px; color: var(--muted); margin-bottom: 26px; line-height: 1.7; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form .field > label { font-size: 12.5px; }

.auth-foot { margin-top: 22px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.auth-foot code { background: rgba(18, 52, 84, 0.06); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; color: var(--ink-2); }

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.65;
  margin-bottom: 18px;
}
.notice-info { background: rgba(44, 127, 174, 0.07); color: #1a5878; border: 1px solid rgba(44, 127, 174, 0.2); }
.notice-warn { background: rgba(196, 133, 58, 0.09); color: #84530f; border: 1px solid rgba(196, 133, 58, 0.24); }
.notice-error { background: rgba(191, 58, 48, 0.06); color: #9d2b22; border: 1px solid rgba(191, 58, 48, 0.22); }
.notice b { font-weight: 600; }

.role-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 8px; border-radius: 20px;
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 12.5px; font-weight: 600; margin-bottom: 18px;
}
.role-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

/* ============ 工作台 ============ */
.workspace { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

/* 侧栏：深色，与官网同调 */
.sidebar {
  background-color: var(--sb-bg);
  background-image:
    radial-gradient(560px 380px at 50% -10%, rgba(80, 145, 200, 0.18), transparent 62%),
    linear-gradient(180deg, #08131f 0%, #050b15 100%);
  color: #a8c2d4;
  border-right: 1px solid var(--sb-line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand-top { margin-bottom: 26px; padding: 0 6px; color: var(--sb-ink); }
.sidebar .brand-name small { color: rgba(163, 188, 207, 0.45); }
.side-nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; min-height: 0; }
.side-nav .nav-label { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sb-muted); padding: 8px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--sb-ink-2);
  border: none; background: transparent; text-align: left; width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: rgba(142, 200, 232, 0.08); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(142, 200, 232, 0.2), rgba(142, 200, 232, 0.06));
  color: #d8eefb; font-weight: 500;
  box-shadow: inset 2px 0 0 #8ec8e8;
}
.nav-item .ico { width: 16px; text-align: center; opacity: 0.85; font-size: 13px; }
.nav-item .count {
  margin-left: auto; font-size: 11px; padding: 0 6px; height: 18px; border-radius: 9px;
  background: rgba(142, 200, 232, 0.14); display: inline-flex; align-items: center;
}

/* 侧栏第二组：本企业目录（总览 + 各类别） */
.side-nav .nav-label-sub {
  margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--sb-line);
  letter-spacing: 0.08em; text-transform: none; font-size: 11px;
}
.sub-nav { display: flex; flex-direction: column; gap: 1px; }
.nav-sub {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 7px; border: none; background: transparent;
  font-size: 12.8px; color: rgba(203, 225, 240, 0.6);
  text-align: left; width: 100%; line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-sub:hover { background: rgba(142, 200, 232, 0.08); color: #fff; }
.nav-sub.active { background: rgba(142, 200, 232, 0.14); color: #cbe9fa; }
.nav-sub .nav-sub-dot {
  width: 5px; height: 5px; border-radius: 50%; flex: 0 0 auto;
  background: currentColor; opacity: 0.45;
}
.nav-sub.active .nav-sub-dot { opacity: 1; }
.nav-sub .nav-sub-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-sub .count { margin-left: auto; font-size: 10.5px; color: rgba(163, 188, 207, 0.5); }
.nav-sub.active .count { color: rgba(203, 233, 250, 0.85); }

/* 跳转目标避开吸顶导航 */
#sec-overview, .cat-card, .cat-block { scroll-margin-top: 76px; }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--sb-line); }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--grad);
  color: #06202f; font-size: 13px; font-weight: 700;
}
.side-user .who { font-size: 13px; color: var(--sb-ink); line-height: 1.3; }
.side-user .who small { display: block; font-size: 11px; color: rgba(163, 188, 207, 0.6); font-weight: 400; }
.side-logout {
  width: 100%; border: 1px solid var(--sb-line-strong); background: transparent;
  color: rgba(203, 225, 240, 0.7); height: 32px; border-radius: 7px; font-size: 12.5px;
  white-space: nowrap;
}
.side-logout:hover { background: rgba(142, 200, 232, 0.1); color: #fff; border-color: rgba(142, 200, 232, 0.4); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 62px; padding: 0 30px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.topbar .crumb b { color: var(--ink); font-weight: 600; font-size: 14px; }
.topbar .sep { color: var(--muted-2); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.tenant-tag {
  font-size: 12px; color: var(--ink-2); background: #fff;
  padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line-strong);
}
.tenant-tag:hover { border-color: rgba(44, 127, 174, 0.45); color: var(--brand-dark); }

.page { padding: 26px 30px 60px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h2 { font-size: 20px; margin-bottom: 5px; }
.page-head .desc { font-size: 13px; color: var(--muted); }
.page-head .actions { display: flex; gap: 9px; flex: 0 0 auto; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f9fcfe);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; box-shadow: var(--shadow-sm);
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad); opacity: 0.95; }
.stat .k { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.stat .v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat .v span { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat .stat-sub { margin-top: 5px; font-size: 11.5px; color: var(--muted-2); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.03em; padding: 10px 16px; background: var(--surface-3);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: rgba(44, 127, 174, 0.035); }
.table .co { font-weight: 500; color: var(--ink); }
.table .sub { font-size: 12px; color: var(--muted); }
.table .right { text-align: right; }
.table .idx { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }

.bar { width: 62px; height: 5px; border-radius: 3px; background: rgba(18, 52, 84, 0.1); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.bar.low > i { background: #d99b40; }

/* 链接组 */
.link-group { display: flex; flex-direction: column; gap: 10px; }
.link-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 12px;
}
.link-row .tag { flex: 0 0 auto; }
.link-row .url {
  flex: 1 1 auto; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.link-row .verify-hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* 详情 */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.detail-grid > .stack:last-child { position: sticky; top: 78px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.kv { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.kv dd.empty-val { color: var(--muted-2); }

.form-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
}
.form-actions .note { font-size: 12px; color: var(--muted); }

.section-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.lock-hint {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--muted); background: rgba(18, 52, 84, 0.045);
  border: 1px solid var(--line); padding: 2px 8px; border-radius: 5px;
}

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10, 26, 42, 0.42);
  backdrop-filter: blur(3px); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade 0.16s ease;
}
.modal {
  background: #fff; border: 1px solid var(--line-strong);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 86vh; overflow: auto;
  animation: pop 0.18s ease;
}
/* 点遮罩空白处不关闭弹窗，只轻微抖一下表示「这里关不掉」 */
@keyframes maskNudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.modal-mask.nudge .modal { animation: maskNudge 0.26s ease; }
@media (prefers-reduced-motion: reduce) {
  .modal-mask.nudge .modal { animation: none; }
}
.modal-head { padding: 20px 22px 0; }
.modal-head h3 { font-size: 16px; margin-bottom: 6px; }
.modal-head p { font-size: 12.5px; color: var(--muted); }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 0 22px 20px; display: flex; justify-content: flex-end; gap: 9px; }

/* 长表单弹窗：标题与按钮吸边，中间随内容滚动 */
.modal.modal-sticky { max-height: 88vh; }
.modal.modal-sticky .modal-head {
  position: sticky; top: 0; z-index: 2;
  background: #fff; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.modal.modal-sticky .modal-body { padding-top: 16px; }
.modal.modal-sticky .modal-foot {
  position: sticky; bottom: 0; z-index: 2;
  background: #fff; padding-top: 14px; padding-bottom: 18px;
  border-top: 1px solid var(--line);
}

/* 企业编辑：折叠的其余项目 + 串码同步区 */
.more-fields { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.more-fields > summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--brand);
  list-style: none; display: flex; align-items: center; gap: 7px;
}
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields > summary::before {
  content: "＋"; font-size: 11px; width: 16px; height: 16px; flex: 0 0 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px; background: rgba(44, 127, 174, 0.1);
}
.more-fields[open] > summary::before { content: "－"; }
.more-fields > summary:hover { color: var(--brand-dark); }

.sync-box {
  margin-top: 22px; padding: 14px 16px 15px; border-radius: 9px;
  background: #f4f8fc; border: 1px solid rgba(18, 52, 84, 0.13);
}
.sync-box .check-row { font-weight: 600; color: var(--ink); font-size: 13px; }
.code-mini { display: flex; flex-direction: column; gap: 7px; }
.code-mini-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.code-mini-row .code-mini-code { font-size: 12px; color: var(--ink-2); letter-spacing: 0.02em; }
.code-mini-row .sub { font-size: 11.5px; color: var(--muted); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }

/* Toast */
.toast-wrap { position: fixed; bottom: 84px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: #fff; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 11px 15px; font-size: 13px; box-shadow: var(--shadow-md);
  max-width: 340px; animation: slideIn 0.2s ease;
}
.toast.ok { background: #f0faf6; border-color: rgba(32, 143, 109, 0.35); color: #17604a; }
.toast.err { background: #fdf3f2; border-color: rgba(191, 58, 48, 0.32); color: #8f241c; }
@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

.boot { height: 100vh; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }

/* ============ 标准项目：说明 / 企业填写（上）/ 交付填写（下） ============ */
.std-item { padding: 17px 0; border-bottom: 1px dashed var(--line); }
.std-item:first-child { padding-top: 2px; }
.std-item:last-child { border-bottom: none; padding-bottom: 2px; }
.std-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; flex-wrap: wrap; }
.std-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.std-req { color: var(--danger); font-size: 12.5px; line-height: 1; }
.std-desc { font-size: 12px; color: var(--muted); line-height: 1.65; margin-bottom: 10px; }
.std-fields { display: flex; flex-direction: column; gap: 9px; margin-top: 9px; }
.std-field { min-width: 0; }
.std-field-label {
  font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 5px; font-weight: 600;
}
.std-field .input { width: 100%; }
.std-field textarea.input { resize: vertical; line-height: 1.7; }
.std-val {
  font-size: 13px; line-height: 1.72; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid rgba(44, 127, 174, 0.45);
  border-radius: 6px;
  padding: 8px 11px; min-height: 38px;
}
.std-val.empty {
  color: var(--muted-2); font-size: 12.5px;
  background: rgba(18, 52, 84, 0.022); border-left-color: rgba(18, 52, 84, 0.14);
  display: flex; align-items: center;
}
/* 空着的只读栏，尽量不占视觉重量 */
.std-val.empty.minimal {
  background: transparent; border-color: transparent; border-left-color: transparent;
  border-bottom: 1px dashed rgba(18, 52, 84, 0.16); border-radius: 0;
  padding: 2px 0 4px; min-height: 0;
}

/* 底部固定保存条 */
.save-bar {
  position: fixed; bottom: 0; left: 236px; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 30px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.save-bar .note { font-size: 12.5px; color: var(--muted); }
.page:has(.save-bar) { padding-bottom: 92px; }

/* 复选行（后台配置用） */
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 4px; }
.check-box {
  border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2);
  padding: 8px 11px; max-height: 170px; overflow-y: auto;
}
.check-box .check-row { padding: 4px 0; }
.check-box .pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-empty {
  border: 1px dashed var(--line-strong); border-radius: 9px; padding: 12px;
  font-size: 12.5px; color: var(--muted); line-height: 1.6;
}
.person-cell { max-width: 180px; }
.person-cell .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 「交付未指派」这类警示小标，宽度要小于人名，避免把表格撑到横向滚动 */
.flag-warn { color: #84530f; background: rgba(196, 133, 58, 0.12); border: 1px solid rgba(196, 133, 58, 0.22); border-radius: 5px; padding: 1px 5px; font-size: 11px; }

.type-chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 5px; font-size: 11px; background: rgba(18, 52, 84, 0.06); color: var(--muted);
}
.cat-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* 类别快捷跳转与折叠 */
.cat-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
/* 宽屏下侧栏已经有目录，顶部标签就不再重复 */
@media (min-width: 881px) {
  .cat-nav.has-side { justify-content: flex-end; }
  .cat-nav.has-side .cat-chips { display: none; }
}
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px;
  background: #fff; border: 1px solid var(--line-strong);
  font-size: 12.5px; color: var(--ink-2); text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.cat-chip:hover { border-color: rgba(44, 127, 174, 0.5); color: var(--brand-dark); }
.cat-chip span {
  font-size: 11px; color: var(--muted);
  background: rgba(18, 52, 84, 0.06); padding: 0 5px; border-radius: 8px;
}
.cat-nav-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cat-expand { display: inline-flex; gap: 6px; }

/* 查看方式：全部显示 / 单类查看 */
.seg {
  display: inline-flex; padding: 2px; gap: 2px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 9px;
}
.seg-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 4px 11px; border-radius: 7px;
  font-size: 12.5px; color: var(--muted); line-height: 1.5;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 500; }

/* 单类模式：只留当前这一类，其余收起；没选类别时显示总览 */
body.single-mode .cat-expand { display: none; }
body.single-mode .cat-card:not(.is-current) { display: none; }
body.single-mode .overview-panel { display: block; }
body.single-mode.has-current .overview-panel { display: none; }
.overview-panel { display: none; }
form > .overview-panel { margin-bottom: 16px; }
.ov-list { display: flex; flex-direction: column; gap: 8px; }
.ov-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 13.5px; color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ov-row:hover { border-color: rgba(44, 127, 174, 0.45); background: rgba(44, 127, 174, 0.045); }
.ov-row:hover .ov-go { color: var(--brand-dark); }
.ov-name { font-weight: 500; }
.ov-meta { font-size: 12.5px; color: var(--muted); }
.ov-meta.done { color: var(--brand); }
.ov-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.ov-go { font-size: 12.5px; color: var(--brand); white-space: nowrap; }
.card[id^="cat-"] { scroll-margin-top: 76px; }

.cat-card { margin-bottom: 16px; }
.cat-head {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 15px 20px; background: transparent; border: none;
  border-bottom: 1px solid var(--line);
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
}
.cat-head:hover { background: rgba(44, 127, 174, 0.04); }
.cat-head:focus-visible { outline: 2px solid rgba(44, 127, 174, 0.6); outline-offset: -2px; }
.cat-chevron {
  width: 7px; height: 7px; flex: none;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.cat-title { font-size: 14.5px; font-weight: 600; }
.cat-count { font-size: 12px; color: var(--muted); }
.cat-progress {
  margin-left: auto; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cat-progress.done { color: var(--brand); }
.cat-warn {
  font-size: 11.5px; color: var(--danger); background: var(--danger-soft);
  padding: 1px 7px; border-radius: 9px; white-space: nowrap;
}
.cat-card.collapsed .cat-head { border-bottom-color: transparent; }
.cat-card.collapsed .cat-body,
.cat-card.collapsed .card-body { display: none; }
.cat-card.collapsed .cat-chevron { transform: rotate(-45deg); }

/* ============ 后台 ============ */
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.admin-tab {
  border: none; background: transparent; padding: 9px 14px; font-size: 13.5px;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar select.input, .toolbar input.input { width: auto; min-width: 140px; height: 34px; }

.tenant-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.tenant-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tenant-card h4 { font-size: 15px; margin-bottom: 3px; }
.tenant-card .meta { font-size: 12.5px; color: var(--muted); }
.tenant-card .metrics { display: flex; gap: 22px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.metric .mk { font-size: 11.5px; color: var(--muted); }
.metric .mv { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric .mv span { font-size: 12px; color: var(--muted); font-weight: 400; }

/* 企业项目勾选 */
.pick-group { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.pick-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pick-group-head .check-row { font-weight: 600; font-size: 13.5px; }
.pick-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }
.pick-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--ink-2); padding: 3px 0;
}
.pick-item .pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item.locked { color: var(--muted); pointer-events: none; }
.pick-item input[type="checkbox"] { accent-color: var(--brand); }
.table td .btn-sm[data-dir] { min-width: 30px; padding-left: 0; padding-right: 0; }
/* 串码表里的长企业名：一行显示，超出省略，详细看 title */
.table .co-ellipsis {
  font-size: 13px; color: var(--ink); line-height: 1.45;
  max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.table .note-ellipsis { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table td .btn-sm + .btn-sm { margin-left: 5px; }
/* 白表格里的操作按钮，给一点底色才看得出边界 */
.table td .btn-sm:not(.btn-primary):not(.btn-danger) { background: #f4f8fc; border-color: rgba(18, 52, 84, 0.2); }
.table td .btn-sm:not(.btn-primary):not(.btn-danger):hover { background: #e9f2fa; border-color: rgba(44, 127, 174, 0.45); }

/* 资质管理：成绩录入弹窗里的一行 = 科目 + 分数 + 是否通过 */
.exam-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 112px;
  gap: 8px 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.exam-row:last-child { border-bottom: none; }
.exam-row .input { height: 34px; }
.exam-row-name { min-width: 0; }
.exam-row-name .co { font-size: 13.5px; color: var(--ink); font-weight: 500; line-height: 1.4; }
.exam-row-name .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.exam-row-head { padding: 0 0 6px; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.exam-row-head > div { font-size: 11.5px; color: var(--muted); }
/* 资质页的侧栏是选择式：点了切内容，不做滚动联动 */
.sub-nav-pick .nav-sub { text-align: left; }
/* 考试弹窗里「销售 / 交付」并排，别被两列网格拉开 */
.exam-check-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 2px 0; }
.people { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.person {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px;
  background: #f4f8fc; border: 1px solid rgba(18, 52, 84, 0.16); border-radius: 7px; padding: 5px 9px;
  color: var(--ink-2);
}
.person .copy {
  border: none; background: transparent; color: var(--brand);
  font-size: 11.5px; padding: 0 0 0 8px; margin-left: 1px;
  border-left: 1px solid rgba(18, 52, 84, 0.16); line-height: 1.2;
}
.person .copy:hover { color: var(--brand-dark); }
.person .copy.del { color: #b4544c; }
.person .copy.del:hover { color: #8f3a33; }

.flow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.flow-step {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px 15px;
}
.flow-step .step-no {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--brand); margin-bottom: 7px;
}
.flow-step h4 { font-size: 13.5px; margin-bottom: 6px; }
.flow-step p { font-size: 12.5px; color: var(--muted); line-height: 1.78; }

.plan-item { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px dashed var(--line); }
.plan-item:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.plan-label { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.plan-text { font-size: 13.5px; line-height: 1.75; color: var(--ink); white-space: pre-wrap; word-break: break-word; }

@media (max-width: 1080px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-grid > .stack:last-child { position: static; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 26px; min-height: auto; gap: 24px; }
  .brand-main h1 { font-size: 25px; }
  .brand-points { display: none; }
  .auth-panel { padding: 34px 22px 48px; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center;
    padding: 12px 14px; gap: 10px 12px;
    border-right: none; border-bottom: 1px solid var(--sb-line);
  }
  /* 窄屏分两行：品牌 + 用户在上，导航在下（放不下就换行，不横向溢出） */
  .sidebar .brand-top { order: 1; margin-bottom: 0; flex: 0 0 auto; }
  .sidebar .brand-name { white-space: nowrap; }
  .sidebar .brand-name small { display: none; }
  .sidebar .side-user .who { white-space: nowrap; }
  .side-user { flex: 0 0 auto; margin: 0; }
  .side-foot {
    order: 2; flex: 0 0 auto; margin: 0 0 0 auto; padding: 0;
    border: none; display: flex; gap: 8px; align-items: center;
  }
  .side-logout { width: auto; padding: 0 10px; }
  .side-nav {
    order: 3; flex: 1 0 100%;
    flex-direction: row; flex-wrap: wrap; gap: 4px;
    overflow: visible; padding-bottom: 2px;
  }
  .side-nav .nav-label { display: none; }
  /* 窄屏侧栏变成横向条，目录回到顶部标签 */
  .side-nav .nav-label-sub, .sub-nav { display: none; }
  /* 例外：资质页的服务方列表是唯一的切换入口，窄屏改成横向可滑的一行 */
  .side-nav .sub-nav-pick {
    display: flex; flex-direction: row; gap: 6px;
    flex: 1 0 100%; order: 4;
    overflow-x: auto; padding-bottom: 4px;
  }
  .side-nav .sub-nav-pick .nav-sub { flex: 0 0 auto; width: auto; white-space: nowrap; padding-right: 14px; }
  .side-nav .sub-nav-pick .nav-sub-dot { display: none; }
  .side-nav .nav-item { white-space: nowrap; }
  .page { padding: 18px 16px 48px; }
  .topbar { padding: 0 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .flow-grid { grid-template-columns: 1fr; }
  .save-bar { left: 0; padding: 10px 16px; }
  .kv { grid-template-columns: 108px minmax(0, 1fr); }
  /* 窄屏表格保底宽度，靠容器横向滚动，避免列被压成竖排 */
  .table-wrap > table.table { min-width: 660px; }
}

/* 成绩录入：窄屏把「是否通过」换到下一行，避免分数框被挤没 */
@media (max-width: 600px) {
  .exam-row { grid-template-columns: minmax(0, 1fr) 84px; }
  .exam-row > select { grid-column: 1 / -1; }
  .exam-row-head { display: none; }
}

/* 资质考试：对象与必考按角色逐行设置 */
.exam-role-grid { display: grid; gap: 6px; margin-top: 6px; }
.exam-role-line {
  display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center;
  gap: 12px; padding: 8px 11px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: var(--surface-2);
}
.exam-role-line.exam-role-head { border: none; background: none; padding: 0 11px 2px; }
.exam-role-object { font-weight: 600; color: var(--ink); }
.exam-role-line .check-row input:disabled { cursor: not-allowed; opacity: .5; }

/* 人员成绩转置表：行是考试、列是人员 */
.qual-card .card-head { flex-wrap: wrap; }
.qual-stat { font-size: 12px; color: var(--muted); }
.qual-table th { vertical-align: top; }
.qual-table th .btn-sm { margin-top: 6px; }
.qual-table td .co { line-height: 1.5; }
.qual-table td .sub { line-height: 1.5; }

@media (max-width: 600px) {
  .exam-role-line { grid-template-columns: 96px minmax(0, 1fr); }
  .qual-stat { width: 100%; white-space: normal; }
}

/* 转置表窄屏：不要套用通用的 660px 保底宽度，否则考试名列被撑满、人员列全在屏外 */
@media (max-width: 880px) {
  .table-wrap > table.table.qual-table { min-width: 0; }
  .qual-table th:not(:first-child), .qual-table td:not(:first-child) { min-width: 104px; }
  .qual-table td:first-child { max-width: 210px; }
}

/* 工作台资质表：窄屏不套用通用 660px 保底宽度，隐藏次要列保证成绩可读 */
@media (max-width: 880px) {
  .table-wrap > table.table.exam-table { min-width: 0; }
  .exam-table th:nth-child(5), .exam-table td:nth-child(5) { display: none; }
}
@media (max-width: 600px) {
  .exam-table th:nth-child(2), .exam-table td:nth-child(2) { display: none; }
  .exam-table th, .exam-table td { padding-left: 9px; padding-right: 9px; }
}

/* 运行日志：七列偏宽，窄屏依次收起来源与类型，保证动作与结果可读 */
.log-table td:nth-child(2) { white-space: nowrap; }
.log-table .person-cell .name { font-weight: 500; }
.log-table .sub { line-height: 1.5; }

@media (max-width: 1000px) {
  .table-wrap > table.table.log-table { min-width: 0; }
  .log-table th:nth-child(6), .log-table td:nth-child(6) { display: none; }
}
@media (max-width: 760px) {
  .log-table th:nth-child(2), .log-table td:nth-child(2) { display: none; }
  .log-table th, .log-table td { padding-left: 8px; padding-right: 8px; font-size: 12px; }
}

/* ============ 公告栏 ============ */
.nav-flag {
  margin-left: auto;
  font-size: 10.5px; line-height: 1;
  padding: 4px 7px; border-radius: 999px;
  background: rgba(196, 133, 58, 0.22); color: #f2c98f;
  white-space: nowrap;
}
.nav-flag + .count { margin-left: 6px; }

.ann-list { display: flex; flex-direction: column; gap: 10px; }
.ann-card {
  display: flex; flex-direction: column; gap: 6px;
  text-align: left; width: 100%; padding: 15px 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.ann-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad); opacity: 0;
}
.ann-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.ann-card.is-unread { background: linear-gradient(180deg, #ffffff, #f7fbfe); }
.ann-card.is-unread::before { opacity: 1; }
.ann-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ann-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.ann-title { font-size: 14.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-spacer { flex: 1; }
.ann-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ann-meta .dot-sep { color: var(--muted-2); opacity: 0.6; }
.ann-preview { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.ann-body { font-size: 14px; line-height: 1.95; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }

.back-link { border: none; background: transparent; padding: 0; font-size: 12.5px; color: var(--muted); }
.back-link:hover { color: var(--brand-dark); }

.thread { display: flex; flex-direction: column; gap: 16px; }
.thread-item { display: flex; gap: 10px; }
.thread-avatar {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.thread-body { flex: 1; min-width: 0; }
.thread-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--ink); }
.thread-time { font-size: 11.5px; font-weight: 400; color: var(--muted-2); }
.thread-text { margin-top: 3px; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.thread-empty { font-size: 13px; color: var(--muted); padding: 2px 0 4px; }

.comment-form {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px dashed var(--line-strong);
  display: flex; flex-direction: column; gap: 10px;
}
.comment-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comment-foot .hint { font-size: 12px; color: var(--muted); }

@media (max-width: 600px) {
  .ann-card { padding: 13px 14px; }
  .ann-head { flex-wrap: wrap; }
  .ann-title { white-space: normal; }
  .comment-foot { flex-direction: column; align-items: stretch; }
}

/* 公告有新评论：与「未读」区分开（蓝色） */
.pill-new { background: var(--blue-soft); color: var(--blue); }
.nav-flag-fresh { background: rgba(142, 200, 232, 0.18); color: #bfe3f5; }
.ann-card.is-fresh::before { opacity: 1; background: var(--blue); }
.ann-card.is-fresh .ann-preview { color: var(--ink-2); }

/* ============================ 敏感词命中标记 ============================ */

/* 被标出的输入框：红边 + 淡红底，与「必填未填」区分开（那个是虚线提示） */
.input.is-flagged,
.is-flagged.input {
  border-color: rgba(191, 58, 48, 0.7) !important;
  background: rgba(191, 58, 48, 0.045) !important;
  box-shadow: 0 0 0 3px rgba(191, 58, 48, 0.10);
}
.input.is-flagged:focus,
.is-flagged.input:focus {
  border-color: rgba(191, 58, 48, 0.85) !important;
  box-shadow: 0 0 0 3px rgba(191, 58, 48, 0.18);
}
/* 框下面那行「含敏感词：xxx」 */
.field-flag {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
  color: #b3352c;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}
.field-flag::before {
  content: "!";
  flex: none;
  width: 14px; height: 14px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(191, 58, 48, 0.12);
  color: #b3352c;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}
/* 表单顶部汇总警示 */
.form-alert {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid rgba(191, 58, 48, 0.28);
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  background: rgba(191, 58, 48, 0.05);
}
.form-alert b { font-size: 13px; font-weight: 600; color: #9d2b22; }
.form-alert span { font-size: 12.5px; line-height: 1.6; color: #8f4239; }

/* 后台敏感词页 */
.word-add { display: flex; flex-direction: column; gap: 10px; }
.word-add textarea.input { min-height: 84px; }
.word-add-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.word-add-row .field { flex: 1; min-width: 200px; }
.word-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.word-test-result {
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
}
.word-test-result.hit {
  border-color: rgba(191, 58, 48, 0.28);
  border-left: 3px solid var(--danger);
  background: rgba(191, 58, 48, 0.045);
  color: #9d2b22;
}
.word-test-result b { font-weight: 600; }
@media (max-width: 640px) {
  .word-add-row .field { min-width: 100%; }
  /* 和其它窄屏表格一样，取消 660px 的保底宽度，否则整表要横向拖 */
  .table-wrap > table.table.word-table { min-width: 0; }
  /* 窄屏让「命中」「更新时间」退场，把位置留给操作按钮，避免整表横向拖动 */
  .word-table th:nth-child(4), .word-table td:nth-child(4),
  .word-table th:nth-child(5), .word-table td:nth-child(5) { display: none; }
  .word-table th, .word-table td { padding: 10px 11px; }
  .word-table td .word-row-actions { flex-wrap: nowrap; }
}
@media (max-width: 520px) {
  /* 更窄时备注也收起来：敏感词 + 状态 + 操作三列刚好占满，不用横向拖 */
  .word-table th:nth-child(2), .word-table td:nth-child(2),
  .word-table th:nth-child(4), .word-table td:nth-child(4),
  .word-table th:nth-child(5), .word-table td:nth-child(5) { display: none; }
  .word-table { table-layout: fixed; }
  .word-table th:nth-child(3), .word-table td:nth-child(3) { width: 76px; }
  .word-table th:nth-child(6), .word-table td:nth-child(6) { width: 128px; }
  .word-table th, .word-table td { padding: 10px 8px; font-size: 13px; }
  .word-table .btn-sm { padding: 5px 9px; font-size: 12px; }
}

/* 公告管理 */
.notice-table .pick-cell { width: 40px; padding-right: 2px; }
.notice-table .pick-cell input { width: 15px; height: 15px; accent-color: #2c7fae; cursor: pointer; }
.notice-table tr.is-picked td { background: rgba(44, 127, 174, 0.055); }
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 20px 12px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--ink-2);
  background: rgba(191, 58, 48, 0.05);
  border: 1px solid rgba(191, 58, 48, 0.18);
}
.bulk-bar b { color: var(--danger); }
.bulk-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.notice-toolbar { margin-bottom: 0; }
.notice-toolbar select.input { min-width: 152px; }
/* 固定列宽，避免企业全称把「公告」列挤成一条 */
.notice-table { table-layout: fixed; }
.notice-table th:nth-child(1), .notice-table td:nth-child(1) { width: 40px; }
.notice-table th:nth-child(2) { width: 21%; }
.notice-table th:nth-child(4) { width: 96px; }
.notice-table th:nth-child(5) { width: 108px; }
.notice-table th:nth-child(6) { width: 118px; }
.notice-table th:nth-child(7) { width: 52px; }
.notice-table th:nth-child(8) { width: 62px; }
.notice-table td .name, .notice-table td .sub { overflow-wrap: anywhere; }
.notice-table td .name { line-height: 1.5; }
/* 企业列统一单行省略，全称放在 title 里，行高不会被长名字撑开 */
.notice-table td:nth-child(2) .name,
.notice-table td:nth-child(2) .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1080px) {
  /* 发布人、评论数先退场，留下企业 / 公告 / 时间 / 阅读 / 操作 */
  .notice-table th:nth-child(4), .notice-table td:nth-child(4),
  .notice-table th:nth-child(7), .notice-table td:nth-child(7) { display: none; }
}
@media (max-width: 760px) {
  /* 标题与工具条分两行排，别把「公告列表」挤成竖排 */
  .notice-card .card-head { flex-wrap: wrap; row-gap: 10px; }
  .notice-card .card-head > h3 { white-space: nowrap; }
  .notice-card .card-head > .sub { white-space: nowrap; }
  .notice-toolbar { flex: 1 0 100% !important; width: 100%; margin-left: 0 !important; }
  .notice-toolbar select.input { flex: 1 1 100%; min-width: 0; }
  .notice-toolbar input.input { flex: 1 1 auto; min-width: 0; }
  .notice-toolbar .btn { flex: 0 0 auto; }
  /* 手机上只留企业、公告、操作三列 */
  .table-wrap > table.table.notice-table { min-width: 0; }
  .notice-table th:nth-child(5), .notice-table td:nth-child(5),
  .notice-table th:nth-child(6), .notice-table td:nth-child(6) { display: none; }
  .notice-table { table-layout: fixed; }
  .notice-table th:nth-child(2), .notice-table td:nth-child(2) { width: 92px; }
  .notice-table th:nth-child(8), .notice-table td:nth-child(8) { width: 62px; }
  .notice-table th, .notice-table td { padding: 10px 9px; }
  .notice-table td .sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .bulk-bar { margin: 0 14px 12px; }
}
