/* ============================================================
   筑俊之家工程圈 · 管理后台设计系统
   Light theme / 中文 B 端后台
   ============================================================ */
:root {
  --brand: #c63b2f;
  --brand-600: #ad3227;
  --brand-700: #8f281f;
  --brand-50: #fdf3f1;
  --brand-100: #fae3df;
  --gold: #b8873c;
  --gold-50: #fdf7ec;

  --ink: #111827;
  --ink-2: #374151;
  --ink-3: #5f6875;
  --ink-4: #8b93a1;
  --line: #e8eaee;
  --line-2: #f1f2f5;
  --bg: #f4f5f7;
  --card: #ffffff;

  --green: #1f9254;
  --green-50: #eef8f2;
  --amber: #b5761a;
  --amber-50: #fdf6e7;
  --blue: #2563a8;
  --blue-50: #eef4fb;
  --red: #c63b2f;
  --red-50: #fdf1ef;
  --purple: #6941c6;
  --purple-50: #f4f0fd;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 14px rgba(16, 24, 40, .07);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .16);
  --sidebar-w: 226px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 13.5px; color: var(--ink); }
::selection { background: var(--brand-100); }
svg { display: block; }

/* ---------------- 启动遮罩 ---------------- */
.boot {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; background: #fff;
}
.boot-mark {
  width: 48px; height: 48px; border-radius: 12px; background: var(--brand);
  color: #fff; font-size: 22px; font-weight: 700; display: grid; place-items: center;
  letter-spacing: -1px; box-shadow: 0 8px 24px rgba(198, 59, 47, .28);
}
.boot-text { font-size: 14px; font-weight: 600; color: var(--ink-2); letter-spacing: 2px; }
.boot-bar { width: 120px; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; background: var(--brand); animation: bootMove 1.1s infinite ease-in-out; }
@keyframes bootMove { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

/* ============================================================
   布局
   ============================================================ */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 40;
}
.brand {
  height: 60px; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; border-bottom: 1px solid var(--line-2);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: 0 0 30px;
  box-shadow: 0 4px 10px rgba(198, 59, 47, .25);
}
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 10.5px; color: var(--ink-4); letter-spacing: 1.6px; margin-top: -2px; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-group { margin-top: 12px; }
.nav-label {
  font-size: 10.5px; color: var(--ink-4); letter-spacing: 1.2px;
  padding: 6px 10px; font-weight: 600; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px;
  color: var(--ink-2); cursor: pointer; font-size: 13px; margin-bottom: 1px;
  transition: background .15s, color .15s; position: relative;
}
.nav-item:hover { background: #f7f8fa; }
.nav-item.active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  background: var(--brand); border-radius: 0 3px 3px 0;
}
.nav-item svg { width: 16px; height: 16px; opacity: .78; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; background: var(--brand); color: #fff; font-size: 10.5px;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 600;
}
.nav-item.active .nav-badge { background: var(--brand); }

.sidebar-foot {
  border-top: 1px solid var(--line-2); padding: 10px 12px; font-size: 11px; color: var(--ink-4);
  display: flex; align-items: center; gap: 8px;
}
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-50); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.page-title { font-size: 15px; font-weight: 650; letter-spacing: .2px; }
.page-crumb { font-size: 11.5px; color: var(--ink-4); margin-top: -1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search-global {
  display: flex; align-items: center; gap: 7px; background: #f6f7f9; border: 1px solid transparent;
  border-radius: 8px; padding: 0 10px; height: 34px; width: 240px; color: var(--ink-4);
  transition: border-color .15s, background .15s;
}
.search-global:focus-within { background: #fff; border-color: var(--line); box-shadow: var(--shadow-sm); }
.search-global input { border: 0; background: transparent; outline: none; width: 100%; }
.search-global kbd {
  font-family: var(--font); font-size: 10px; border: 1px solid var(--line); background: #fff;
  border-radius: 4px; padding: 1px 4px; color: var(--ink-4);
}

.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-3); position: relative;
}
.icon-btn:hover { background: #f6f7f9; color: var(--ink); }
.preview-front {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--brand-50, #fdf1ef);
  color: var(--brand, #c63b2f); font-size: 12.5px; font-weight: 600; text-decoration: none;
  white-space: nowrap; transition: background .15s, border-color .15s;
}
.preview-front:hover { background: #fbe4e0; border-color: var(--brand, #c63b2f); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand); border: 1.5px solid #fff;
}
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 8px;
  cursor: pointer; border: 1px solid transparent;
}
.user-chip:hover { background: #f6f7f9; }
.user-chip .meta { line-height: 1.25; }
.user-chip .meta b { font-size: 12.5px; font-weight: 600; display: block; }
.user-chip .meta span { font-size: 10.5px; color: var(--ink-4); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand-50); color: var(--brand-600);
  display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex: 0 0 30px;
  border: 1px solid var(--brand-100);
}
.avatar.sm { width: 26px; height: 26px; flex: 0 0 26px; font-size: 11px; }
.avatar.lg { width: 44px; height: 44px; flex: 0 0 44px; font-size: 16px; }
.avatar.gray { background: #f1f2f5; color: var(--ink-3); border-color: var(--line); }

.content { padding: 20px 22px 48px; flex: 1; }

/* ---------------- 页头 ---------------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: -.2px; }
.page-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-3); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   基础组件
   ============================================================ */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-hd {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2);
}
.card-hd h3 { font-size: 13.5px; font-weight: 650; margin: 0; }
.card-hd .sub { font-size: 11.5px; color: var(--ink-4); }
.card-hd .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-bd { padding: 16px; }
.card-bd.tight { padding: 0; }

.btn {
  height: 32px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn:hover { background: #f8f9fa; border-color: #d9dce2; }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(198,59,47,.2); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn.ghost:hover { background: #f6f7f9; color: var(--ink); }
.btn.danger { color: var(--red); border-color: #f2d3cf; background: #fff; }
.btn.danger:hover { background: var(--red-50); }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn.xs { height: 24px; padding: 0 7px; font-size: 11.5px; border-radius: 5px; }
.btn.lg { height: 38px; padding: 0 18px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tag {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px;
  border-radius: 5px; font-size: 11px; background: #f4f5f7; color: var(--ink-3);
  border: 1px solid transparent; white-space: nowrap;
}
.tag.brand { background: var(--brand-50); color: var(--brand-600); }
.tag.green { background: var(--green-50); color: var(--green); }
.tag.amber { background: var(--amber-50); color: var(--amber); }
.tag.blue { background: var(--blue-50); color: var(--blue); }
.tag.purple { background: var(--purple-50); color: var(--purple); }
.tag.gold { background: var(--gold-50); color: var(--gold); border-color: #f2e4c9; }
.tag.danger { background: var(--red-50); color: var(--red); border-color: #f2d3cf; }
.tag.line { background: #fff; border-color: var(--line); color: var(--ink-3); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px;
  border-radius: 20px; font-size: 11px; font-weight: 500;  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.green { background: var(--green-50); color: var(--green); }
.badge.amber { background: var(--amber-50); color: var(--amber); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.gray { background: #f3f4f6; color: var(--ink-3); }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.purple { background: var(--purple-50); color: var(--purple); }

.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tb th {
  text-align: left; font-weight: 600; font-size: 11.5px; color: var(--ink-4);
  padding: 10px 12px; background: #fafbfc; border-bottom: 1px solid var(--line);
  white-space: nowrap; letter-spacing: .2px;
}
table.tb td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tb tbody tr:hover { background: #fcfcfd; }
table.tb tbody tr:last-child td { border-bottom: 0; }
table.tb td.num { font-variant-numeric: tabular-nums; }
table.tb .cell-title { font-weight: 600; color: var(--ink); display: block; }
table.tb .cell-sub { font-size: 11px; color: var(--ink-4); }

/* 通用表格：views 里写的是 class="table"（洞察 / 合规 / 反馈 / 公告 / 敏感词），
   此前只有 table.tb 有样式，这 5 个页面实际用的是浏览器默认表格 ——
   表现就是表格不铺满宽度（右侧大片留白）、列宽随内容乱走（长文本列被压成多行）。
   这里补齐 .table，并比 .tb 更宽松：行高 1.55、上下内边距 15px，长列表更好读。 */
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th {
  text-align: left; font-weight: 600; font-size: 11.5px; color: var(--ink-4);
  padding: 12px 14px; background: #fafbfc; border-bottom: 1px solid var(--line);
  white-space: nowrap; letter-spacing: .2px;
}
table.table td {
  padding: 15px 14px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle; line-height: 1.55;
}
table.table tbody tr:hover { background: #fcfcfd; }
table.table tbody tr:last-child td { border-bottom: 0; }
table.table td.mono { font-variant-numeric: tabular-nums; }
table.table .cell-sub { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; }
/* 定宽列不折行；标题列吃剩余宽度并保证最小可读宽度，避免被挤成多行 */
table.table .nowrap { white-space: nowrap; }
table.table .cell-wrap { white-space: normal; min-width: 320px; line-height: 1.6; }
.row-actions { display: flex; gap: 2px; }
.link { color: var(--brand-600); cursor: pointer; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field .hint { font-size: 11px; color: var(--ink-4); margin-top: 4px; }
.field .req { color: var(--brand); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid #dfe2e8; border-radius: 7px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 74px; padding: 8px 10px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: #e0a39c; box-shadow: 0 0 0 3px rgba(198,59,47,.08); }
.input::placeholder, .textarea::placeholder { color: #a9b0bb; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b93a1' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }

.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 12.5px; padding: 6px 0; }
.check input { margin: 3px 0 0; accent-color: var(--brand); width: 14px; height: 14px; }
.check .t { font-weight: 500; }
.check .d { font-size: 11px; color: var(--ink-4); line-height: 1.5; }

.switch { position: relative; width: 36px; height: 20px; border-radius: 12px; background: #dfe2e8; cursor: pointer; transition: background .18s; flex: 0 0 36px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(16px); }

.segmented { display: inline-flex; background: #f3f4f6; border-radius: 8px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; height: 26px; padding: 0 11px; border-radius: 6px;
  font-size: 12px; color: var(--ink-3); cursor: pointer; font-weight: 500;
}
.segmented button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  border: 0; background: transparent; padding: 9px 12px; font-size: 12.5px; color: var(--ink-3);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-600); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px;
  position: relative; overflow: hidden;
}
.kpi .k-label { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.kpi .k-value { font-size: 26px; font-weight: 700; letter-spacing: -.8px; margin: 5px 0 2px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 12px; font-weight: 500; color: var(--ink-4); margin-left: 3px; letter-spacing: 0; }
.kpi .k-foot { font-size: 11px; color: var(--ink-4); display: flex; align-items: center; gap: 6px; }
.kpi .k-icon {
  position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; background: var(--brand-50); color: var(--brand);
}
.kpi .k-icon.green { background: var(--green-50); color: var(--green); }
.kpi .k-icon.blue { background: var(--blue-50); color: var(--blue); }
.kpi .k-icon.amber { background: var(--amber-50); color: var(--amber); }
.trend-up { color: var(--green); font-weight: 600; }
.trend-down { color: var(--red); font-weight: 600; }

/* ---------------- 抽屉 / 弹窗 ---------------- */
.scrim { position: fixed; inset: 0; background: rgba(17, 24, 39, .38); z-index: 90; animation: fadeIn .16s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; background: #fff; z-index: 91;
  width: 660px; max-width: 94vw; display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(16,24,40,.14); animation: slideIn .22s cubic-bezier(.22,.8,.3,1);
}
.drawer.wide { width: 860px; }
@keyframes slideIn { from { transform: translateX(40px); opacity: .6; } }
.drawer-hd {
  padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px;
}
.drawer-hd h2 { font-size: 15.5px; font-weight: 650; margin: 0; }
.drawer-hd .sub { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }
.drawer-hd .x { margin-left: auto; }
.drawer-bd { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }
.drawer-ft {
  border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 8px;
  justify-content: flex-end; background: #fcfcfd;
}
.drawer-ft .left { margin-right: auto; display: flex; gap: 8px; }

.modal {
  position: fixed; z-index: 95; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: #fff; border-radius: var(--r-lg); width: 460px; max-width: 92vw;
  box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.22,.8,.3,1); overflow: hidden;
}
@keyframes pop { from { transform: translate(-50%, -48%) scale(.97); opacity: 0; } }
.modal-hd { padding: 16px 18px 10px; font-size: 14.5px; font-weight: 650; }
.modal-bd { padding: 0 18px 16px; font-size: 13px; color: var(--ink-2); }
.modal-ft { padding: 12px 18px; background: #fcfcfd; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------- Toast ---------------- */
.toast-host { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #1f2430; color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; align-items: center; gap: 8px;
  animation: toastIn .2s ease; max-width: 520px;
}
.toast.ok { background: #16653c; }
.toast.err { background: #9c2c22; }
.toast.warn { background: #8a5a12; }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }

/* ---------------- 空状态 / 骨架 ---------------- */
.empty { padding: 44px 20px; text-align: center; color: var(--ink-4); }
.empty .ic { width: 44px; height: 44px; border-radius: 12px; background: #f5f6f8; display: grid; place-items: center; margin: 0 auto 10px; color: #b9c0cb; }
.empty b { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 3px; }
.empty span { font-size: 12px; }
.skeleton { background: linear-gradient(90deg, #f3f4f6 25%, #eceef1 37%, #f3f4f6 63%); background-size: 400% 100%; animation: sk 1.3s infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- 列表工具条 ---------------- */
.toolbar {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line-2);
}
.toolbar .input, .toolbar .select { height: 32px; width: auto; min-width: 120px; font-size: 12.5px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar .spacer { margin-left: auto; }
.stat-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-chip {
  display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px;
  background: #fff; border: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); cursor: pointer;
}
.stat-chip b { font-size: 13px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-chip.active { border-color: #e6b0a9; background: var(--brand-50); color: var(--brand-600); }
.stat-chip.active b { color: var(--brand-600); }

.pager { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 12px; color: var(--ink-3); }
.pager .spacer { margin-left: auto; }
.pager .btn { height: 26px; }

/* ---------------- 项目 / 媒体 ---------------- */
.proj-cell { display: flex; gap: 10px; align-items: center; min-width: 240px; }
.proj-thumb {
  width: 42px; height: 42px; border-radius: 8px; overflow: hidden; flex: 0 0 42px;
  background: linear-gradient(135deg, #f6e7e4, #f3f4f6); display: grid; place-items: center;
  color: var(--brand-600); font-weight: 700; font-size: 15px; border: 1px solid var(--line-2);
}
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.media-item {
  position: relative; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: #f4f5f7;
  border: 1px solid var(--line);
}
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; }
.media-item .del {
  position: absolute; top: 4px; right: 4px; width: 19px; height: 19px; border-radius: 50%;
  background: rgba(17,24,39,.6); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 11px;
}
.upload-tile {
  aspect-ratio: 4/3; border: 1px dashed #d5d9e0; border-radius: 8px; display: grid; place-items: center;
  cursor: pointer; color: var(--ink-4); background: #fcfcfd; text-align: center; font-size: 11px; gap: 2px;
}
.upload-tile:hover { border-color: #e0a39c; color: var(--brand-600); background: var(--brand-50); }
.upload-tile svg { width: 18px; height: 18px; margin: 0 auto 2px; }

/* ---------------- 公共媒体组件：只读画廊 / 视频角标 ---------------- */
.media-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mg-item {
  position: relative; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: #f4f5f7;
}
.mg-item img, .mg-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mg-item video { object-fit: contain; background: #111827; }
.mg-item a { display: block; width: 100%; height: 100%; }
.mg-badge {
  position: absolute; left: 5px; bottom: 5px; padding: 1px 6px; border-radius: 4px;
  background: rgba(17, 24, 39, .68); color: #fff; font-size: 10px; line-height: 16px;
  pointer-events: none;
}
.media-item .mg-badge { top: 5px; bottom: auto; left: 5px; }
/* 会员单位后台是窄栏卡片，3 列比 4 列更清晰 */
.mu-narrow .media-grid, .mu-narrow .media-gallery { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .media-grid, .media-gallery { grid-template-columns: repeat(3, 1fr); }
}

/* 时间轴 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -18px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid #cfd4dc;
}
.tl-item:first-child::before { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.tl-item .tl-hd { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.tl-item .tl-time { font-size: 11px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.tl-item .tl-body { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* 详情描述 */
.dl { display: grid; grid-template-columns: 88px 1fr; gap: 9px 12px; font-size: 12.5px; }
.dl dt { color: var(--ink-4); }
.dl dd { margin: 0; color: var(--ink-2); word-break: break-all; }
.section-title { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .3px; margin: 20px 0 10px; display: flex; align-items: center; gap: 6px; }
.section-title::before { content: ""; width: 3px; height: 12px; background: var(--brand); border-radius: 2px; }
.section-title:first-child { margin-top: 0; }

/* 匹配 */
.match-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-2);
}
.match-row:hover { background: #fcfcfd; }
.match-score { width: 52px; flex: 0 0 52px; text-align: center; }
.match-score .l { margin-top: 1px; white-space: nowrap; }
.match-score .n { font-size: 17px; font-weight: 700; color: var(--brand-600); font-variant-numeric: tabular-nums; line-height: 1.1; }
.match-score .l { font-size: 10px; color: var(--ink-4); }
.match-score.low .n { color: var(--ink-3); }
.score-bar { height: 4px; background: #eef0f3; border-radius: 3px; overflow: hidden; width: 90px; }
.score-bar i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }

/* 看板 / 列表双栏 */
.split { display: grid; grid-template-columns: 330px 1fr; gap: 14px; align-items: start; }
.list-pane { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.list-pane .item { padding: 11px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.list-pane .item:hover { background: #fcfcfd; }
.list-pane .item.active { background: var(--brand-50); border-left: 3px solid var(--brand); padding-left: 11px; }
.list-pane .item .t { font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.list-pane .item .m { font-size: 11px; color: var(--ink-4); margin-top: 3px; display: flex; gap: 6px; align-items: center; }

/* 图表 */
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-3); }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.chart-wrap { width: 100%; overflow: hidden; }

/* 登录 */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #fff; }
.auth-visual {
  background: linear-gradient(145deg, #7d221a 0%, #a83226 45%, #c63b2f 100%);
  color: #fff; padding: 46px 52px; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.auth-visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle at 82% 18%, rgba(255,255,255,.14), transparent 42%),
                    radial-gradient(circle at 12% 88%, rgba(255,255,255,.1), transparent 40%);
}
.auth-visual .grid-lines {
  position: absolute; inset: 0; opacity: .12;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 48px 48px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; position: relative; z-index: 2; }
.auth-brand .m { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-weight: 700; border: 1px solid rgba(255,255,255,.3); }
.auth-brand b { font-size: 15px; letter-spacing: .5px; }
.auth-mid { margin: auto 0; display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 2; }
.auth-mid .am-item {
  display: flex; gap: 11px; align-items: flex-start; padding: 11px 13px; border-radius: 10px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(3px);
  max-width: 380px;
}
.auth-mid .am-ic { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.auth-mid b { font-size: 12.8px; display: block; margin-bottom: 2px; }
.auth-mid span { font-size: 11.5px; opacity: .72; line-height: 1.6; display: block; }
.auth-hero { margin-top: 18px; position: relative; z-index: 2; }
.auth-hero h1 { font-size: 34px; line-height: 1.3; margin: 0 0 14px; font-weight: 700; letter-spacing: -.5px; }
.auth-hero p { font-size: 13.5px; opacity: .82; max-width: 420px; line-height: 1.8; margin: 0; }
.auth-stats { display: flex; gap: 30px; margin-top: 34px; }
.auth-stats .n { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.auth-stats .l { font-size: 11.5px; opacity: .7; }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 40px 8vw; }
.auth-form .inner { width: 100%; max-width: 356px; margin: 0 auto; }
.auth-form h2 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.3px; }
.auth-form .sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 24px; }
/* 登录页底部备案公示（点击跳转工信部 / 公安部官方查询） */
.login-beian {
  border-top: 1px dashed var(--line); margin-top: 22px; padding-top: 12px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  font-size: 11px; color: var(--ink-4);
}
.login-beian a { color: var(--ink-3); text-decoration: none; }
.login-beian a:hover { color: var(--brand); }
.login-beian i { width: 1px; height: 10px; background: var(--line); display: inline-block; }

/* 公有信息大厅 */
.pub-hero { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 14px; }
.pub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pub-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; transition: all .16s; }
.pub-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: #e2c0bb; }
.pub-card h4 { margin: 0 0 6px; font-size: 13.5px; line-height: 1.5; font-weight: 650; }
.pub-card .meta { font-size: 11.5px; color: var(--ink-4); display: flex; gap: 8px; flex-wrap: wrap; }
.locked-phone {
  display: inline-flex; align-items: center; gap: 6px; background: #f7f8fa; border: 1px dashed #d9dce2;
  color: var(--ink-3); border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer;
}
.locked-phone:hover { border-color: var(--brand); color: var(--brand-600); background: var(--brand-50); }

/* 工具类 */
.muted { color: var(--ink-4); }
.small { font-size: 11.5px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }
.ml-auto { margin-left: auto; }
.mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; } .mt-8 { margin-top: 8px; } .mt-10 { margin-top: 10px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 4px; } .mb-6 { margin-bottom: 6px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.hr { height: 1px; background: var(--line-2); margin: 16px 0; border: 0; }
.w-full { width: 100%; }
.text-r { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dim { opacity: .5; }
.hidden { display: none !important; }

/* 响应式 */
@media (max-width: 1240px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .pub-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: 226px; flex-basis: 226px; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .search-global { display: none; }
  .preview-front span { display: none; }
  .preview-front { padding: 0 8px; }
  .split { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .drawer { width: 100%; }
}

/* ============================================================
   地图模块
   ============================================================ */
.map-page { margin: -20px -22px -48px; height: calc(100vh - 60px); display: flex; flex-direction: column; background: #eef1f4; }
.map-toolbar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 9px 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; z-index: 5;
}
.map-toolbar .input, .map-toolbar .select { height: 30px; font-size: 12px; width: auto; min-width: 104px; flex: 0 0 auto; }
.map-toolbar .input[style] { width: 158px !important; }
.map-toolbar .segmented { flex: 0 0 auto; }
.map-toolbar .filter-tags { flex: 1 1 320px; min-width: 0; }
.map-body { flex: 1; display: flex; min-height: 0; position: relative; }
.map-canvas { flex: 1; position: relative; overflow: hidden; background: #e9edf1; }
.map-canvas canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.map-side {
  width: 350px; flex: 0 0 350px; background: #fff; border-left: 1px solid var(--line);
  overflow-y: auto; display: flex; flex-direction: column;
}
.map-side.empty-side { display: grid; place-items: center; padding: 24px; }
.map-legend {
  position: absolute; left: 12px; top: 12px; background: rgba(255,255,255,.94); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 11px; color: var(--ink-3); display: flex; gap: 12px;
  box-shadow: var(--shadow-sm); backdrop-filter: blur(6px); z-index: 3;
}
.map-legend .k { display: flex; align-items: center; gap: 5px; }
.map-legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.map-hint {
  position: absolute; right: 12px; top: 12px; background: rgba(255,255,255,.94); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px; font-size: 11px; color: var(--ink-3); z-index: 3; box-shadow: var(--shadow-sm);
}
.map-tip {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 6;
  background: rgba(17,24,39,.86); color: #fff; font-size: 12px; padding: 7px 12px; border-radius: 7px;
}
.map-select-box { position: absolute; border: 1.5px dashed var(--brand); background: rgba(198,59,47,.08); pointer-events: none; z-index: 4; }
.map-offline {
  position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-4);
  font-size: 12px; background: #eef1f4;
}
.point-detail { padding: 14px 16px; }
.point-title { font-size: 14px; font-weight: 650; line-height: 1.5; }
.nearby-item {
  display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.nearby-item:hover { background: #fcfcfd; }
.nearby-item .dist { font-size: 13px; font-weight: 700; color: var(--brand-600); width: 52px; flex: 0 0 52px; }
.filter-tags { display: flex; gap: 5px; flex-wrap: wrap; max-width: 420px; }
.filter-tag {
  height: 26px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--line); background: #fff;
  font-size: 11.5px; color: var(--ink-3); display: inline-flex; align-items: center; cursor: pointer;
}
.filter-tag.on { background: var(--brand-50); border-color: #e6b0a9; color: var(--brand-600); font-weight: 600; }
@media (max-width: 1100px) {
  .map-side { position: absolute; right: 0; top: 0; bottom: 0; box-shadow: var(--shadow-lg); z-index: 8; }
  .map-page { margin: -16px -14px -40px; }
}

/* ============================================================
   地图真实底图（腾讯地图 GL JS）
   ============================================================ */
.map-tmap { position: absolute; inset: 0; display: none; background: #eef1f4; }
.map-canvas.engine-tmap #mCv { display: none; }
.map-canvas.engine-tmap .map-tmap { display: block; }
.map-canvas.engine-tmap { cursor: default; }
.map-canvas.engine-tmap .map-legend { pointer-events: none; }
/* 腾讯底图上的控件层级低于图例与提示 */
.map-tmap .tmap-control { z-index: 1; }

/* 地图底图切换（悬浮控件） */
.map-engine-btn {
  position: absolute; right: 12px; top: 44px; z-index: 4;
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 10px; border-radius: 7px;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-2); box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}
.map-engine-btn:hover { border-color: #d8dde4; }
.map-engine-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------- 区域筛选组（省 / 市 / 区县）---------------- */
.toolbar .region-group { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.toolbar .region-group .select { min-width: 0; }

/* ---------------- AI 快速录入（整段文本 → 分类项） ---------------- */
.ai-inline { border: 1px solid var(--brand-100); border-radius: 10px; background: #fff; margin-bottom: 16px; }
.ai-inline > summary {
  cursor: pointer; list-style: none; padding: 10px 12px; display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--brand-700);
}
.ai-inline > summary::-webkit-details-marker { display: none; }
.ai-inline > summary::after { content: "展开 / 收起"; margin-left: auto; font-size: 11px; color: var(--ink-4); font-weight: 400; }
.ai-inline[open] > summary { border-bottom: 1px solid var(--brand-100); }
.ai-inline #aiInlinePanel { padding: 12px; }
.ai-intro {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
  background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 9px; margin-bottom: 10px;
}
.ai-intro-ic {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; display: grid; place-items: center;
  background: #fff; color: var(--brand); box-shadow: var(--shadow-sm);
}
.ai-intro b { font-size: 12.5px; color: var(--ink); }
.ai-intro .small { line-height: 1.65; margin-top: 3px; }
.ai-text { width: 100%; font-size: 12.5px; line-height: 1.7; }
.ai-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 9px 0 4px; }
.ai-actions [data-meta] { margin-left: auto; font-size: 11px; }
.ai-result { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ai-result-hd {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.ai-result-hd .small { line-height: 1.6; margin-top: 2px; }
.ai-group { padding: 10px 12px 8px; border-bottom: 1px solid var(--line-2); }
.ai-group:last-of-type { border-bottom: 0; }
.ai-group-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: var(--ink-2); }
.ai-group-hd b { position: relative; padding-left: 9px; }
.ai-group-hd b::before { content: ""; position: absolute; left: 0; top: 3px; width: 3px; height: 11px; border-radius: 2px; background: var(--brand); }
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.ai-item { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; background: #fff; min-width: 0; }
.ai-item:hover { border-color: #d8dde4; }
.ai-item-hd { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; min-width: 0; }
.ai-item-hd input[type="checkbox"] { accent-color: var(--brand); margin: 0; width: 14px; height: 14px; flex: 0 0 14px; }
.ai-item-hd b { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.ai-src {
  margin-left: auto; font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: var(--green-50); color: var(--green); white-space: nowrap;
}
.ai-src.infer { background: var(--amber-50); color: var(--amber); }
.ai-item .input, .ai-item .select, .ai-item .textarea { width: 100%; font-size: 12px; }
.ai-item .textarea { resize: vertical; min-height: 38px; }
.ai-hints {
  margin: 0 12px 12px; padding: 9px 11px; border-radius: 8px;
  background: var(--gold-50); border: 1px solid #f2e4c9; font-size: 11.5px; color: #8a6a2f; line-height: 1.8;
}
@media (max-width: 760px) { .ai-grid { grid-template-columns: 1fr; } }

/* 全屏媒体查看器：点图放大、多图翻看、视频播放 */
.fs-viewer {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(10, 12, 16, .97);
  display: flex; flex-direction: column;
  animation: fsIn .18s ease;
}
@keyframes fsIn { from { opacity: 0; } to { opacity: 1; } }
.fs-top {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 16px; flex: 0 0 auto;
}
.fs-count { color: #e5e9f0; font-size: 13px; margin-right: auto; padding-left: 4px; }
.fs-close {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 15px;
  display: grid; place-items: center;
}
.fs-close:hover { background: rgba(255, 255, 255, .26); }
.fs-stage { flex: 1; overflow: hidden; position: relative; }
.fs-track {
  display: flex; height: 100%;
  transition: transform .22s ease; will-change: transform;
}
.fs-slide {
  flex: 0 0 100%; height: 100%;
  display: grid; place-items: center; padding: 10px 56px;
  box-sizing: border-box;
}
.fs-slide img, .fs-slide video {
  max-width: 100%; max-height: 100%;
  object-fit: contain; display: block; border-radius: 6px;
}
.fs-slide video { width: 100%; background: #000; }
.fs-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 26px; line-height: 1; display: grid; place-items: center;
  padding-bottom: 4px; z-index: 3;
}
.fs-prev { left: 10px; }
.fs-next { right: 10px; }
.fs-nav:hover { background: rgba(255, 255, 255, .26); }

/* 会员可见等级多选 */
.tier-box { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.check.tier-item { margin: 0; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-size: 12.5px; }
.check.tier-item:has(input:checked) { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.check.tier-item input { margin-right: 4px; }
