/* ============================================================
   蔚蓝白蚁 · 界面设计系统（theme.css）
   在 style.css 之后加载，统一覆盖全局元素与页面骨架。
   ============================================================ */

:root {
  --brand: #12557f;
  --brand-2: #1a7fb8;
  --brand-soft: #eaf3fa;
  --ink: #17293a;
  --ink-2: #47596b;
  --ink-3: #8394a5;
  --line: #e7edf4;
  --line-2: #d6e0ea;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ok: #1f9d5a;
  --warn: #d98a1f;
  --bad: #d94a3d;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --sh-1: 0 1px 2px rgba(16, 42, 67, .05);
  --sh-2: 0 6px 20px rgba(16, 42, 67, .09);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: #cfe6f7; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16, 42, 67, .02);
}
.topbar .logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 15.5px; font-weight: 600; color: var(--brand); letter-spacing: .2px;
  padding-left: 40px; position: relative;
}
.topbar .logo::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  box-shadow: 0 3px 8px rgba(18, 85, 127, .28);
}
.topbar .logo::after {
  content: "蔚"; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; line-height: 30px; text-align: center;
  font-size: 15px; color: #fff; font-weight: 600; letter-spacing: 0;
}
.topbar .role-tag {
  font-size: 12px; color: var(--ink-2); background: var(--brand-soft);
  border: 1px solid #d5e7f4; padding: 3px 10px; border-radius: 20px; font-weight: 500;
}
.topbar .spacer { flex: 1; }
.topbar button {
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2);
  border-radius: var(--r-sm); padding: 7px 14px; font-size: 13px; cursor: pointer;
  transition: all .14s;
}
.topbar button:hover { border-color: #b9cfe0; color: var(--brand); background: #f8fbfd; }

/* ---------------- 导航 ---------------- */
.nav {
  position: sticky; top: 58px; z-index: 55;
  display: flex; gap: 6px; padding: 0 24px;
  background: var(--card); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav button {
  position: relative; border: none; background: none;
  padding: 14px 14px 13px; font-size: 13.5px; color: var(--ink-2);
  border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer;
  transition: color .14s, border-color .14s;
  font-family: inherit;
}
.nav button:hover { color: var(--brand-2); }
.nav button.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------------- 内容区 ---------------- */
.wrap { max-width: 1280px; margin: 22px auto 40px; padding: 0 24px; transition: opacity .12s; }
.wrap.dim { opacity: .5; }

/* 页面标题区（一级页头） */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.ph-title { font-size: 21px; font-weight: 600; color: var(--ink); letter-spacing: -.2px; line-height: 1.3; }
.ph-sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.ph-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 面包屑（二级页返回） */
.crumb {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  color: var(--ink-3); margin-bottom: 12px;
}
.crumb a, .crumb button {
  color: var(--brand-2); background: none; border: none; padding: 0;
  font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.crumb a:hover, .crumb button:hover { text-decoration: underline; }
.crumb .sep { color: #c3cfdb; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 16px;
  box-shadow: var(--sh-1);
}
.card > h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  padding-bottom: 12px; margin: -2px 0 16px;
  border-bottom: 1px solid var(--line);
}
.card > h3::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand)); flex: 0 0 auto;
}
.card > h3 .muted { font-weight: 400; }

/* 三级面板：带关闭按钮的浮层卡片 */
.panel {
  border: 1px solid #cfe0ee; background: linear-gradient(180deg, #fbfdff, #fff 120px);
  border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(18, 85, 127, .08);
}
.panel > h3 {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 14.5px; font-weight: 600; color: var(--brand);
  padding-bottom: 12px; margin: 0 0 14px; border-bottom: 1px dashed #d8e6f1;
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 9px 18px; font-size: 13.5px; font-weight: 500; font-family: inherit;
  background: var(--brand); color: #fff; cursor: pointer; white-space: nowrap;
  transition: background .14s, box-shadow .14s, transform .1s, border-color .14s;
  box-shadow: 0 1px 2px rgba(18, 85, 127, .18);
}
.btn:hover { background: #0e4a70; box-shadow: 0 3px 10px rgba(18, 85, 127, .24); }
.btn:active { transform: translateY(1px); }
.btn.gray { background: #fff; color: var(--ink-2); border-color: var(--line-2); box-shadow: none; }
.btn.gray:hover { background: #f7fafc; color: var(--brand); border-color: #b9cfe0; }
.btn.green { background: var(--ok); box-shadow: 0 1px 2px rgba(31, 157, 90, .2); }
.btn.green:hover { background: #17844a; }
.btn.red { background: var(--bad); box-shadow: 0 1px 2px rgba(217, 74, 61, .2); }
.btn.red:hover { background: #bf3b30; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- 表单 ---------------- */
input, select, textarea {
  width: 100%; font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 9px 12px; transition: border-color .14s, box-shadow .14s;
}
input:hover, select:hover, textarea:hover { border-color: #bdd2e2; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(26, 127, 184, .13);
}
input::placeholder, textarea::placeholder { color: #a9b8c6; }
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; accent-color: var(--brand-2); }
textarea { resize: vertical; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238394a5' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
label.f {
  display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  margin: 12px 0 5px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; }
.grid .full { grid-column: 1 / -1; }

/* ---------------- 表格 ---------------- */
table.list {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
table.list th {
  background: #f6f9fc; color: var(--ink-2); text-align: left;
  padding: 11px 14px; font-size: 12px; font-weight: 600; letter-spacing: .2px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.list td { padding: 11px 14px; border-bottom: 1px solid #f1f5f8; vertical-align: middle; color: var(--ink-2); }
table.list tr:last-child td { border-bottom: none; }
table.list tbody tr:hover td, table.list tr:hover td { background: #f8fbfd; }
table.list td b { color: var(--ink); font-weight: 600; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap; line-height: 1.5;
}
.tag.warn { background: #fdf4e3; color: #a86b0d; }
.tag.ok { background: #e8f7ee; color: #1a7d46; }
.tag.blue { background: #e8f2fb; color: var(--brand); }
.tag.gray { background: #eff3f7; color: var(--ink-2); }
.tag.red { background: #fdeceb; color: #b3382d; }
.tag.orange { background: #fdf0e6; color: #b35e12; }

/* ---------------- 空状态 / 辅助文字 ---------------- */
.empty {
  text-align: center; color: var(--ink-3); padding: 40px 16px; font-size: 13px;
  background: repeating-linear-gradient(45deg, #fbfdff, #fbfdff 10px, #f8fbfd 10px, #f8fbfd 20px);
  border-radius: var(--r-md); border: 1px dashed var(--line-2);
}
.muted { color: var(--ink-3); font-size: 12px; }
.err { background: #fdeceb; color: #b3382d; border: 1px solid #f6d2ce; border-radius: var(--r-sm); padding: 9px 13px; font-size: 13px; margin-top: 12px; }
.msg { background: #e8f7ee; color: #1a7d46; border: 1px solid #c8e9d6; border-radius: var(--r-sm); padding: 9px 13px; font-size: 13px; margin-top: 12px; }

/* ---------------- 登录 / 注册页（左右分栏） ---------------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 34px 18px;
  background:
    radial-gradient(900px 520px at 8% -12%, #d9e9f8 0%, rgba(217, 233, 248, 0) 62%),
    radial-gradient(760px 460px at 102% 108%, #dceef7 0%, rgba(220, 238, 247, 0) 58%),
    #f1f5f9;
}
.auth-card {
  width: 100%; max-width: 950px; min-height: 566px;
  display: grid; grid-template-columns: 0.86fr 1fr;
  background: #fff; border-radius: 22px; overflow: hidden;
  border: 1px solid #e4ecf4;
  box-shadow: 0 32px 70px -26px rgba(12, 41, 66, .38), 0 2px 8px rgba(12, 41, 66, .05);
  animation: authIn .45s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes authIn { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }

/* 左：品牌面板 */
.auth-brand {
  position: relative; overflow: hidden; padding: 42px 34px 34px;
  display: flex; flex-direction: column; color: #fff;
  background: linear-gradient(158deg, #0c3a58 0%, #12557f 46%, #1a7fb8 100%);
}
.auth-brand.plat { background: linear-gradient(158deg, #241a3f 0%, #3f2a6b 48%, #6a4bb0 100%); }
.auth-brand::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(circle at 26% 16%, #000 0%, transparent 76%);
  mask-image: radial-gradient(circle at 26% 16%, #000 0%, transparent 76%);
}
.auth-brand::after {
  content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  right: -120px; bottom: -130px;
  background: radial-gradient(circle, rgba(120, 214, 190, .38) 0%, rgba(120, 214, 190, 0) 70%);
}
.auth-brand.plat::after { background: radial-gradient(circle, rgba(190, 170, 255, .38) 0%, rgba(190, 170, 255, 0) 70%); }
.ab-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.ab-logo {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px;
  display: grid; place-items: center; font-size: 21px; font-weight: 600; letter-spacing: .5px;
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(4px);
}
.ab-name { font-size: 18px; font-weight: 600; letter-spacing: .4px; }
.ab-slogan { font-size: 11.5px; color: rgba(255, 255, 255, .62); margin-top: 2px; letter-spacing: .6px; }
.ab-points { position: relative; z-index: 1; list-style: none; margin: 46px 0 0; padding: 0; }
.ab-points li {
  position: relative; padding-left: 22px; margin-bottom: 15px;
  font-size: 13px; color: rgba(255, 255, 255, .82); line-height: 1.5;
}
.ab-points li::before {
  content: ""; position: absolute; left: 4px; top: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 3px rgba(255, 255, 255, .1);
}
.ab-foot {
  position: relative; z-index: 1; margin-top: auto; padding-top: 20px;
  font-size: 11.5px; color: rgba(255, 255, 255, .48);
  border-top: 1px solid rgba(255, 255, 255, .12);
}

/* 右：表单区 */
.auth-form { padding: 46px 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.af-eyebrow {
  font-size: 11.5px; font-weight: 500; letter-spacing: 1.2px; color: var(--brand-2);
  text-transform: uppercase; margin-bottom: 9px;
}
.auth-brand.plat ~ .auth-form .af-eyebrow { color: #6a4bb0; }
.af-title { font-size: 25px; font-weight: 600; color: var(--ink); letter-spacing: -.2px; line-height: 1.25; }
.af-sub { font-size: 13px; color: var(--ink-3); margin-top: 7px; }
/* 没有 tab 切换的页面（平台 / 未开通），标题与表单保持呼吸感 */
.af-sub + #auth-body { margin-top: 24px; }

.seg2 { display: inline-flex; align-self: flex-start; gap: 2px; padding: 3px; margin: 22px 0 20px; background: #eff3f8; border-radius: 11px; }
.seg2 button {
  border: none; background: none; padding: 7px 20px; border-radius: 9px;
  font-size: 13px; color: var(--ink-2); font-family: inherit; transition: .16s;
}
.seg2 button.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 42, 67, .14); }

.fld { margin-bottom: 14px; }
.fld > label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ipt { position: relative; display: flex; align-items: center; }
.ipt > .ic {
  position: absolute; left: 12px; width: 16px; height: 16px;
  stroke: #9fb0c0; fill: none; stroke-width: 1.65;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke .16s;
}
.ipt > input, .ipt > select {
  width: 100%; height: 43px; padding: 0 13px 0 37px;
  border: 1px solid var(--line-2); border-radius: 10px;
  font-size: 13.5px; color: var(--ink); background: #fafcfe;
  font-family: inherit; transition: .16s;
}
.ipt > select { appearance: none; padding-right: 30px; background-image: none; }
.ipt.sel::after {
  content: ""; position: absolute; right: 14px; top: 50%; pointer-events: none;
  width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.6px solid #9fb0c0; border-bottom: 1.6px solid #9fb0c0;
  transform: rotate(45deg); border-radius: 1px;
}
.ipt > input::placeholder { color: #a8b6c4; }
.ipt > input:focus, .ipt > select:focus {
  outline: none; border-color: var(--brand-2); background: #fff;
  box-shadow: 0 0 0 3.5px rgba(26, 127, 184, .13);
}
.ipt:focus-within > .ic { stroke: var(--brand-2); }
.ipt > input[type=password], .ipt.has-eye > input { padding-right: 42px; }
.ipt .eye {
  position: absolute; right: 6px; width: 30px; height: 30px; border: none; background: none;
  display: grid; place-items: center; border-radius: 7px; cursor: pointer;
}
.ipt .eye:hover { background: #eef4fa; }
.ipt .eye svg { width: 17px; height: 17px; stroke: #9fb0c0; fill: none; stroke-width: 1.6; stroke-linecap: round; }
.ipt .eye.on svg { stroke: var(--brand-2); }

.af-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.af-chk { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.af-chk input { width: 15px; height: 15px; accent-color: var(--brand-2); cursor: pointer; }
.af-link { font-size: 12.5px; color: var(--ink-3); }

.btn-auth {
  width: 100%; height: 45px; margin-top: 20px; border: none; border-radius: 11px;
  background: linear-gradient(135deg, #1a7fba 0%, #12557f 100%);
  color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 1.5px;
  font-family: inherit; cursor: pointer; transition: .18s;
  box-shadow: 0 8px 20px -8px rgba(18, 85, 127, .75);
}
.auth-brand.plat ~ .auth-form .btn-auth {
  background: linear-gradient(135deg, #6a4bb0 0%, #3f2a6b 100%);
  box-shadow: 0 8px 20px -8px rgba(63, 42, 107, .75);
}
.btn-auth:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(18, 85, 127, .8); }
.btn-auth:active { transform: translateY(0); box-shadow: 0 5px 14px -8px rgba(18, 85, 127, .8); }
.btn-auth:disabled { opacity: .62; cursor: default; transform: none; }
.btn-auth-ghost {
  display: block; width: 100%; height: 45px; margin-top: 12px; box-sizing: border-box;
  border: 1.5px solid #c4d4e2; border-radius: 11px; background: #fff; color: #12557f;
  font-size: 14px; font-weight: 600; letter-spacing: .5px; font-family: inherit;
  text-align: center; line-height: 42px; text-decoration: none; transition: .18s;
}
.btn-auth-ghost:hover { background: #f1f7fb; border-color: #1a7fba; }

.auth-alert {
  display: flex; gap: 9px; align-items: flex-start; margin-top: 14px;
  padding: 10px 13px; border-radius: 10px; font-size: 12.8px; line-height: 1.6;
  animation: authIn .22s ease both;
}
.auth-alert .ai { flex: 0 0 15px; width: 15px; height: 15px; margin-top: 1px; stroke-width: 1.8; fill: none; stroke-linecap: round; }
.auth-alert.err { background: #fdecea; color: #b3382d; border: 1px solid #f7d5d1; }
.auth-alert.err .ai { stroke: #c9503f; }
.auth-alert.ok { background: #e9f7ef; color: #1a7d46; border: 1px solid #c9e9d7; }
.auth-alert.ok .ai { stroke: #21955a; }
.auth-alert.info { background: #eef4fa; color: var(--ink-2); border: 1px solid #dbe6f1; }
.auth-alert.info .ai { stroke: var(--brand-2); }
.auth-alert b { font-weight: 600; }

.af-tip { font-size: 12.5px; color: var(--ink-3); margin-top: 16px; line-height: 1.7; }
.af-sep { display: flex; align-items: center; gap: 10px; margin: 22px 0 0; color: var(--ink-3); font-size: 11.5px; }
.af-sep::before, .af-sep::after { content: ""; height: 1px; background: var(--line); flex: 1; }

@media (max-width: 860px) {
  .auth-wrap { padding: 0; align-items: stretch; }
  .auth-card {
    grid-template-columns: 1fr; grid-template-rows: auto 1fr;
    max-width: none; min-height: 100vh;
    border-radius: 0; border: none; box-shadow: none;
  }
  .auth-brand { flex-direction: row; align-items: center; gap: 12px; padding: 26px 22px 24px; }
  .auth-brand::after { display: none; }
  .ab-logo { width: 40px; height: 40px; flex-basis: 40px; border-radius: 11px; font-size: 18px; }
  .ab-name { font-size: 16px; }
  .ab-points, .ab-foot { display: none; }
  .auth-form { padding: 30px 22px 40px; justify-content: flex-start; }
  .af-title { font-size: 22px; }
  .fld-row { grid-template-columns: 1fr; }
  .seg2 { align-self: stretch; }
  .seg2 button { flex: 1; }
}

@media (max-width: 420px) {
  .auth-form { padding: 26px 18px 36px; }
  .af-title { font-size: 20px; }
}


/* ---------------- 数值卡 / 项目卡微调 ---------------- */
.kpi { border-radius: var(--r-md); border: 1px solid var(--line); border-left-width: 3px; box-shadow: var(--sh-1); }
.pcard, .pcard2 { border-radius: var(--r-md); }
.stat { border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--sh-1); }

/* ---------------- 分段控件 ---------------- */
.seg { display: inline-flex; background: #eef3f8; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: none; background: none; padding: 6px 14px; font-size: 12.5px; color: var(--ink-2);
  border-radius: 8px; cursor: pointer; font-family: inherit; transition: all .14s;
}
.seg button.on { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 42, 67, .12); }

/* ---------------- 详情页信息栅格 ---------------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; }
.info-grid .ii { min-width: 0; }
.info-grid .ii-k { font-size: 11.5px; color: var(--ink-3); margin-bottom: 2px; }
.info-grid .ii-v { font-size: 13.5px; color: var(--ink); font-weight: 500; word-break: break-all; }

/* 两栏布局 */
.cols { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }

@media (max-width: 700px) {
  .topbar { padding: 0 14px; }
  .topbar .logo { font-size: 14px; }
  .nav { padding: 0 10px; }
  .wrap { padding: 0 12px; margin-top: 14px; }
  .card { padding: 16px; border-radius: var(--r-md); }
  .page-head { margin-bottom: 14px; }
  .ph-title { font-size: 18px; }
}

/* ---------------- 人员分配胶囊 ---------------- */
.wk-list { display: flex; flex-wrap: wrap; gap: 8px; }
.wk-item {
  display: flex; align-items: center; gap: 7px; padding: 6px 13px;
  border: 1px solid var(--line-2); border-radius: 20px; font-size: 12.5px;
  color: var(--ink-2); cursor: pointer; transition: all .14s; user-select: none; background: #fff;
}
.wk-item:hover { border-color: #b9d3e4; background: #f8fbfd; }
.wk-item em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.wk-item:has(input:checked) { border-color: #8dc3e4; background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.wk-item:has(input:checked) em { color: #5a94b8; }
.card > h3 .pt-close { margin-left: auto; }

/* ---------------- 表单底部悬浮操作栏 ---------------- */
.form-actions {
  position: sticky; bottom: 14px; z-index: 20;
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 18px; margin-bottom: 8px;
  box-shadow: 0 4px 16px rgba(16, 42, 67, .10);
}

/* ---------------- 多租户：公司标识 / 顶栏按钮 ---------------- */
.co-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 10px;
  font-size: 12px; padding: 3px 10px; border-radius: 20px;
  background: #eef6fc; color: #1a5f92; border: 1px solid #cfe6f7; max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.co-badge.sup { background: #fff4e2; color: #a8620d; border-color: #f3d6a6; }
.tb-btn {
  border: 1px solid var(--line-2, #d9e3ec); background: #fff; color: #1a5f92;
  border-radius: 8px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; margin-right: 8px;
}
.tb-btn:hover { background: #f2f8fd; border-color: #a9c8e2; }
/* 平台公司表格里的按钮更紧凑 */
.card table.list td .btn.sm { margin: 1px 2px 1px 0; }
/* 平台 KPI 数值略小，避免 5 列挤压 */
.kpis .kpi .kn { font-size: 21px; }

/* ==================== 四害防治（pest.js） ==================== */
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ph-act-in { display: flex; gap: 8px; flex-wrap: wrap; }

.pst-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.pst-stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; cursor: pointer; transition: .16s; text-align: center;
}
.pst-stat:hover { border-color: #b9d3e8; box-shadow: var(--sh-1); transform: translateY(-1px); }
.pst-stat.on { border-color: var(--brand-2); background: var(--brand-soft); }
.pst-n { font-size: 22px; font-weight: 600; color: var(--brand); line-height: 1.2; }
.pst-t { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pst-stat.total .pst-n { color: var(--ink); }

.pst-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pst-toolbar .spacer { flex: 1; }
.pst-search { position: relative; display: flex; align-items: center; width: 300px; }
.pst-search svg {
  position: absolute; left: 11px; width: 15px; height: 15px;
  stroke: #9fb0c0; fill: none; stroke-width: 1.8; stroke-linecap: round;
}
.pst-search input { height: 38px; padding-left: 34px; border-radius: 9px; }

.pst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pst-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px 16px 13px; cursor: pointer; transition: .16s; position: relative;
}
.pst-card::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--brand-2), var(--brand));
}
.pst-card:hover { border-color: #b9d3e8; box-shadow: var(--sh-2); transform: translateY(-2px); }
.pst-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.pst-no { font-size: 11.5px; color: var(--ink-3); letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.pst-card-title {
  font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pst-card-sub {
  font-size: 12.5px; color: var(--ink-3); margin-bottom: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pst-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--ink-3); padding-top: 9px; border-top: 1px dashed var(--line);
}
.pst-right { display: flex; align-items: center; gap: 6px; }
.tiny-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 4px;
  background: #fdecea; color: #b3382d; border: 1px solid #f7d5d1; letter-spacing: .4px;
}

.pst-kind-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.pst-kind {
  text-align: left; background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--r-md); padding: 14px 15px; cursor: pointer; transition: .16s; font-family: inherit;
}
.pst-kind:hover { border-color: #b9d3e8; }
.pst-kind.on { border-color: var(--brand-2); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(26,127,184,.08); }
.pst-kind b { display: block; font-size: 14px; color: var(--ink); font-weight: 600; }
.pst-kind i { display: block; font-style: normal; font-size: 11.5px; color: var(--brand-2); margin-top: 3px; }
.pst-kind em { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.pst-kind-fixed { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }

.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pf-chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2);
  background: #f6f9fc; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.pf-chip input { width: auto; margin: 0; accent-color: var(--brand-2); }
.pf-inline { width: 180px; height: 32px; display: inline-block; }

.pst-rows td { padding: 5px 6px; }
.pst-rows td.c, .pst-rows td.lbl { text-align: center; }
.pst-rows td.r { text-align: right; font-variant-numeric: tabular-nums; }
.pst-rows input, .pst-rows select { height: 34px; font-size: 13px; padding: 0 9px; border-radius: 7px; }
.pst-rows tr:first-child th { font-size: 12px; font-weight: 500; }

/* 用药记录：药品下拉清单，选「其他」才出现手填框 */
.drug-pick { display: flex; flex-direction: column; gap: 5px; }
.drug-pick > select, .drug-pick > input { width: 100%; }
.drug-pick > select { text-overflow: ellipsis; }
.drug-pick.other > select { color: var(--ink-3); }
.drug-pick .drug-other { border-color: var(--brand-2); background: #f7fbff; }

/* 小屏：行式表格横向滚动，不撑破卡片 */
@media (max-width: 700px) {
  table.pst-rows { display: block; overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
  table.pst-rows th, table.pst-rows td { white-space: nowrap; }
  .drug-pick > select, .drug-pick > input { min-width: 150px; }
}
.pst-total-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.pst-total-row .spacer { flex: 1; }
.pst-total-row b { color: var(--brand); font-size: 16px; font-variant-numeric: tabular-nums; }

.pst-photo-tools { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.pst-photo-box { display: flex; flex-wrap: wrap; gap: 10px; }
.pst-photo { position: relative; width: 118px; height: 88px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-2); }
.pst-photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.pst-photo .del {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.pst-photo .del:hover { background: #d94a3d; }

.pst-h4 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 7px; }
.pst-file {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fafcfe;
}
.pst-file-ico {
  flex: 0 0 34px; height: 34px; border-radius: 7px; background: #fdecea; color: #b3382d;
  font-size: 10.5px; font-weight: 600; display: grid; place-items: center; letter-spacing: .5px;
}
.pst-file-name { font-size: 13px; color: var(--ink); font-weight: 500; word-break: break-all; }
.pst-file .btn { margin-left: auto; }

.sig-wrap { display: grid; grid-template-columns: 1fr; gap: 10px; }
.sig-slot { border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 11px 13px; background: #fbfcfe; }
.sig-slot.done { border-style: solid; border-color: #c9e9d7; background: #f7fdfa; }
.sig-h { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.sig-slot img { max-height: 74px; display: block; background: #fff; border-radius: 4px; }
.sig-m { font-size: 11.5px; color: var(--ink-3); margin: 6px 0 8px; }
.sig-empty { font-size: 12.5px; color: var(--ink-3); margin-bottom: 9px; }

.pst-logs { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.pst-logs li { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.pst-logs li:last-child { border-bottom: none; }
.pst-log-a { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); margin-right: 7px; }
.pst-log-t { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pst-log-d { color: var(--ink-2); margin-top: 3px; }

/* 手写签名弹层 */
.signpad-mask {
  position: fixed; inset: 0; z-index: 200; background: rgba(12, 30, 46, .55);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(2px); animation: padIn .18s ease both;
}
@keyframes padIn { from { opacity: 0 } to { opacity: 1 } }
.signpad {
  background: #fff; border-radius: 16px; width: min(700px, 100%);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .45); overflow: hidden;
}
.signpad-h { display: flex; align-items: flex-start; padding: 18px 22px 14px; }
.signpad-h > div { flex: 1; }
.sp-t { font-size: 16px; font-weight: 600; color: var(--ink); }
.sp-s { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.sp-x {
  border: none; background: none; font-size: 24px; line-height: 1; color: var(--ink-3);
  cursor: pointer; padding: 0 4px; border-radius: 6px;
}
.sp-x:hover { color: var(--ink); background: #f2f6fa; }
.signpad-body { position: relative; padding: 0 22px; }
#sp-canvas {
  display: block; width: 100%; background: #fcfdfe;
  border: 1px solid var(--line-2); border-radius: 10px; touch-action: none; cursor: crosshair;
}
.signpad-line {
  position: absolute; left: 44px; right: 44px; bottom: 34px; height: 1px;
  background: repeating-linear-gradient(90deg, #cfdbe6 0 6px, transparent 6px 12px); pointer-events: none;
}
.signpad-f { display: flex; align-items: center; gap: 9px; padding: 15px 22px 18px; flex-wrap: wrap; }
.signpad-f input { width: 170px; height: 36px; border-radius: 8px; }
.signpad-f .spacer { flex: 1; }
.sp-err { padding: 0 22px 14px; color: #b3382d; font-size: 12.5px; min-height: 8px; }

@media (max-width: 760px) {
  .cols2 { grid-template-columns: 1fr; }
  .pst-stats { grid-template-columns: repeat(3, 1fr); }
  .pst-kind-pick { grid-template-columns: 1fr 1fr; }
  .pst-search { width: 100%; }
  .pst-toolbar { flex-wrap: wrap; }
  .signpad-f input { width: 100%; }
}

/* 单张照片水印编辑弹层 */
.pwm-mask {
  position: fixed; inset: 0; z-index: 210; background: rgba(12, 30, 46, .55);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(2px); animation: padIn .18s ease both;
}
.pwm {
  background: #fff; border-radius: 16px; width: min(680px, 100%);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .45); overflow: hidden;
}
.pwm-h { display: flex; align-items: flex-start; padding: 18px 22px 12px; }
.pwm-h > div { flex: 1; }
.pwm-t { font-size: 16px; font-weight: 600; color: var(--ink); }
.pwm-s { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.pwm-b { display: flex; gap: 18px; padding: 0 22px; align-items: flex-start; }
.pwm-l { width: 176px; flex: none; }
.pwm-l img { width: 100%; display: block; border-radius: 10px; border: 1px solid var(--line-2); }
.pwm-lt { font-size: 11.5px; color: var(--ink-3); text-align: center; margin-top: 6px; }
.pwm-fs { flex: 1; min-width: 0; display: grid; gap: 9px; }
.pwm-f { display: flex; align-items: center; gap: 9px; }
.pwm-f > span { width: 68px; flex: none; font-size: 12.5px; color: var(--ink-2); text-align: right; }
.pwm-f input { flex: 1; min-width: 0; height: 36px; border-radius: 8px; }
.pwm-tip { padding: 9px 22px 0; font-size: 12px; color: var(--ink-3); min-height: 16px; }
.pwm-f2 { display: flex; align-items: center; gap: 9px; padding: 14px 22px 18px; }
.pwm-sp { flex: 1; }
@media (max-width: 640px) {
  .pwm-b { flex-direction: column; gap: 12px; }
  .pwm-l { width: 100%; display: flex; gap: 10px; align-items: center; }
  .pwm-l img { width: 92px; }
  .pwm-lt { margin: 0; text-align: left; }
  .pwm-f > span { width: 58px; }
}


/* ============================================================
 * 竖版侧栏布局（PC 左侧固定导航 + 手机抽屉）
 * ============================================================ */
.frame { display: flex; min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: 242px; z-index: 60;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0e3a57 0%, #11456a 55%, #145079 100%);
  color: #dcebf7;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.10); }
.side-logo {
  width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2a91c4, #46b6e0); color: #fff; font-weight: 700; font-size: 19px;
  box-shadow: 0 4px 12px rgba(42,145,196,.45);
}
.side-brand-t { min-width: 0; }
.side-brand-t b { display: block; font-size: 14.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-brand-t i { font-style: normal; font-size: 11px; color: rgba(255,255,255,.55); }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 12px 14px; }
.side-gt { margin: 14px 8px 6px; font-size: 11px; letter-spacing: .14em; color: rgba(255,255,255,.42); }
.side-gt:first-child { margin-top: 4px; }
.snav {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 2px 0;
  padding: 9px 12px; border: none; border-radius: 9px; cursor: pointer; font-family: inherit;
  background: none; color: #cfe3f2; font-size: 13.5px; text-align: left; transition: all .14s;
}
.snav svg { width: 19px; height: 19px; flex: none; opacity: .82; }
.snav span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snav:hover { background: rgba(255,255,255,.09); color: #fff; }
.snav.on { background: linear-gradient(135deg, #2a91c4, #3aa6d8); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(42,145,196,.4); }
.snav.on svg { opacity: 1; }
.side-foot { padding: 12px 14px 14px; border-top: 1px solid rgba(255,255,255,.10); }
.side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.side-avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.14); color: #fff; font-size: 14px; font-weight: 600;
}
.side-user b { display: block; font-size: 13px; color: #fff; }
.side-user i { font-style: normal; font-size: 11px; color: rgba(255,255,255,.55); }
.side-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.side-acts .btn { flex: 1; }
.side-mask { display: none; }

.main { flex: 1; margin-left: 242px; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.main .wrap { flex: 1; }
.main-top { display: none; }

/* 手机端：抽屉式侧栏 + 顶栏 */
@media (max-width: 900px) {
  .side { width: 274px; transform: translateX(-102%); transition: transform .26s ease; box-shadow: 0 0 44px rgba(0,0,0,.38); }
  .side.open { transform: none; }
  .side-mask { position: fixed; inset: 0; background: rgba(10,25,40,.5); z-index: 55; }
  .side-mask.show { display: block; }
  .main { margin-left: 0; }
  .main-top {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40;
    background: #fff; border-bottom: 1px solid var(--line); padding: 10px 14px;
  }
  .burger { border: none; background: none; font-size: 20px; padding: 2px 6px; cursor: pointer; color: var(--ink); }
  .mt-title { font-weight: 600; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mt-co { font-size: 12px; color: var(--ink-3); }
  .mt-out { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: inherit; color: var(--ink-2); }
}

/* ---------- 平台模块开关 ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.mod-item {
  display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; cursor: pointer; background: #fff; transition: all .15s;
}
.mod-item:hover { border-color: var(--brand-2); }
.mod-item div { display: flex; align-items: center; gap: 8px; }
.mod-item input { width: auto; accent-color: var(--brand-2); }
.mod-item b { font-size: 13.5px; color: var(--ink); }
.mod-item i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.mod-item.off { background: #f6f8fa; border-color: #e3e9ee; opacity: .82; }

/* ---------- 客户管理 ---------- */
.cli-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.cli-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px 13px;
  cursor: pointer; transition: all .16s; box-shadow: 0 1px 4px rgba(16,42,67,.05);
}
.cli-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,42,67,.10); }
.cli-top { display: flex; align-items: center; gap: 10px; }
.cli-logo {
  width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center;
  font-weight: 700; font-size: 17px; color: #fff; background: linear-gradient(135deg, #1a6f9e, #2a91c4);
}
.cli-name { min-width: 0; flex: 1; }
.cli-name b { display: block; font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cli-name i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.cli-info { margin: 11px 0 9px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12.5px; color: var(--ink-2); }
.cli-info em { font-style: normal; color: var(--ink-3); margin-right: 6px; }
.cli-info div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cli-info div:last-child { grid-column: 1/-1; }
.cli-meta { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 9px; align-items: center; }
.cli-meta b { color: var(--brand); }

/* ---------- 四害按项目汇总 ---------- */
.pst-proj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pst-proj { border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; cursor: pointer; background: #fff; transition: all .15s; }
.pst-proj:hover { border-color: var(--brand-2); box-shadow: 0 4px 14px rgba(16,42,67,.08); }
.pst-proj.on { border-color: var(--brand); background: #f2f9fe; }
.pp-top { display: flex; align-items: baseline; gap: 8px; }
.pp-top b { font-size: 13.5px; color: var(--ink); }
.pp-top .pst-right { font-size: 11.5px; }
.pp-n { margin-top: 5px; font-size: 12.5px; color: var(--ink-2); }
.pp-n b { color: var(--brand); font-size: 15px; }
.pp-kinds { margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 700px) {
  .cli-cards { grid-template-columns: 1fr; }
  .pst-proj-list { grid-template-columns: 1fr; }
}

/* 页面切换骨架屏：点击后 180ms 内没出结果才显示，避免快页面闪现 */
.skel { animation: skelIn .18s ease; }
.skel-card {
  background: var(--card, #fff); border: 1px solid var(--line, #e3e9ef);
  border-radius: 12px; padding: 18px 20px; margin-bottom: 14px;
}
.skel-line {
  height: 12px; border-radius: 6px; margin: 9px 0;
  background: linear-gradient(90deg, rgba(0,0,0,.06) 25%, rgba(0,0,0,.11) 37%, rgba(0,0,0,.06) 63%);
  background-size: 400% 100%; animation: skelShine 1.25s ease-in-out infinite;
}
.skel-line.w40 { width: 40%; } .skel-line.w60 { width: 60%; } .skel-line.w80 { width: 80%; }
.skel-h { height: 20px; width: 32%; margin-bottom: 16px; }
@keyframes skelShine { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes skelIn { from { opacity: 0; } to { opacity: 1; } }


/* ============================================================
 * 多页面页签条（顶部多标签）—— 与 hash 路由配套
 *   桌面：吸顶一条，像浏览器标签；手机：跟随 main-top 下方，可横滑
 * ============================================================ */
.tabbar {
  position: sticky; top: 0; z-index: 38;
  display: flex; align-items: flex-end; gap: 6px;
  background: linear-gradient(180deg, #f7fafd, #eaf1f7);
  border-bottom: 1px solid var(--line-2);
  padding: 6px 12px 0; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabs { display: flex; align-items: flex-end; gap: 4px; flex: 1; min-width: 0; }
.wtab {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  max-width: 200px; height: 34px; padding: 0 8px 0 12px;
  border: 1px solid transparent; border-bottom: none;
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, .6); color: var(--ink-2);
  font-size: 13px; text-decoration: none; white-space: nowrap;
  position: relative; top: 1px; transition: background .14s, color .14s;
}
.wtab > span { overflow: hidden; text-overflow: ellipsis; }
.wtab svg { width: 15px; height: 15px; flex: none; opacity: .62; }
.wtab:hover { background: #fff; color: var(--brand); text-decoration: none; }
.wtab.on {
  background: #fff; border-color: var(--line-2); color: var(--brand); font-weight: 600;
  box-shadow: inset 0 2px 0 var(--brand-2);
}
.wtab.on svg { opacity: 1; }
.wtab .wx {
  font-style: normal; width: 17px; height: 17px; line-height: 16px; text-align: center;
  border-radius: 50%; font-size: 13px; color: var(--ink-3); flex: none;
}
.wtab .wx:hover { background: #ffe3df; color: var(--bad); }
.tabtools {
  flex: none; height: 27px; width: 30px; margin-bottom: 5px;
  border: 1px solid var(--line-2); background: #fff; border-radius: 8px;
  color: var(--ink-3); cursor: pointer; font-size: 13px; font-family: inherit;
}
.tabtools:hover { color: var(--brand); border-color: #b9cfe0; }
@media (max-width: 900px) {
  .tabbar { position: static; padding: 6px 8px 0; }
  .wtab { max-width: 152px; height: 32px; font-size: 12.5px; padding: 0 6px 0 10px; }
  .tabtools { display: none; }
}

/* ---------- 总结报告：关联工单选择 ---------- */
.pst-link-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; font-size: 12.5px; color: var(--ink-2);
}
.pst-link-bar b { color: var(--brand); font-size: 14px; margin: 0 2px; }
.pst-link-bar .spacer { flex: 1 1 20px; }
.pst-link-list {
  max-height: 336px; overflow: auto;
  border: 1px solid var(--line); border-radius: 10px;
}
.pst-link-list table { margin: 0; border: none; }
.pst-link-list th { background: #f2f7fb; }
.pst-link-list tr { cursor: pointer; }
.pst-link-list tr:hover td { background: #f7fbfe; }
.pst-link-list tr.on td { background: #edf7ff; }
.pst-link-list tr.on td:first-child { box-shadow: inset 3px 0 0 var(--brand-2); }
.pst-link-list tr.out td { color: var(--ink-3); }
.pst-link-list td b { font-weight: 600; color: var(--ink); }
.pst-link-list td .muted { font-size: 11.5px; }

/* ============================================================
 * 角色与权限 v2
 *   公司内部成员 = 公司级权限矩阵；外协成员 = 单项目单权限卡片
 * ============================================================ */
.role-stat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.role-stat .stat {
  background: #fff; border: 1px solid var(--line-2); border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 1px 2px rgba(16, 42, 67, .04);
}
.role-stat .stat-k { font-size: 12.5px; color: var(--ink-3); }
.role-stat .stat-v { font-size: 24px; font-weight: 700; color: var(--brand); line-height: 1.3; margin-top: 2px; }
.role-stat .stat-s { font-size: 11.5px; color: var(--ink-3); }
.badge-sup { background: #f0a020; color: #fff; border-radius: 4px; padding: 1px 5px; font-size: 11px; }

.role-rule .rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.role-rule .rule-item { background: #f7fafd; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; }
.role-rule .rule-t { font-weight: 600; font-size: 13.5px; color: var(--brand); margin-bottom: 4px; }
.role-rule p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }

/* 内部成员权限矩阵 */
.pm-group { margin: 12px 0; }
.pm-gt { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.pm-items { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-item {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px;
  font-size: 12.5px; background: #fff; cursor: pointer;
}
.pm-item:hover { border-color: #b9cfe0; }
.pm-item.base { background: #f4f7fa; color: var(--ink-2); cursor: default; }
.pm-item.base em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.pm-item input { margin: 0; }

/* 项目级授权卡 */
.rp-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 12px; }
.rp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.rpcard { border: 1px solid var(--line-2); border-radius: 10px; background: #fff; overflow: hidden; }
.rpcard.off { background: #f8fafc; }
.rpcard.off .rp-body { display: none; }
.rp-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: #f7fafd; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13px;
}
.rpcard.off .rp-head { border-bottom: none; }
.rp-head b { font-weight: 600; color: var(--ink); }
.rp-head .muted { font-size: 11.5px; }
.rp-tag { font-style: normal; margin-left: auto; font-size: 11px; color: var(--brand); background: #e8f3fb; border-radius: 4px; padding: 1px 6px; }
.rp-body { padding: 8px 12px 10px; }
.rp-row { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.rp-k { flex: none; width: 34px; font-size: 11.5px; color: var(--ink-3); padding-top: 5px; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px;
  font-size: 12px; background: #fff; cursor: pointer; white-space: nowrap;
}
.pp-chip:hover { border-color: #b9cfe0; }
.pp-chip.locked { background: #f4f7fa; color: var(--ink-2); cursor: default; }
.pp-chip input { margin: 0; }
.role-switch {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); font-size: 12.5px;
}
.role-switch select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line-2); font-family: inherit; font-size: 12.5px; }
@media (max-width: 900px) {
  .role-stat { grid-template-columns: 1fr; }
  .role-rule .rule-grid { grid-template-columns: 1fr; }
  .rp-list { grid-template-columns: 1fr; }
}

/* 邮箱验证码（改密码弹窗） */
.code-row{display:flex;gap:8px;align-items:stretch}
.code-row input{flex:1;min-width:0}
.code-row .btn{flex:0 0 auto;white-space:nowrap}
