:root {
  --brand: #2A7A50;
  --brand-dark: #1F6B45;
  --brand-soft: #E7F2EB;
  --amber: #E39B34;
  --amber-soft: #FDF3E3;
  --danger: #C4473A;
  --danger-soft: #FCEDEC;
  --info: #3C7FB8;
  --ink: #17251E;
  --ink-2: #466053;
  --muted: #7C8D84;
  --line: #E1EAE4;
  --bg: #F2F6F3;
  --card: #fff;
  --r: 12px;
  --shadow: 0 2px 10px rgba(23, 37, 30, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  position: fixed; inset: 0;
  background: linear-gradient(150deg, #17472F 0%, #1F6B45 48%, #3E8C60 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-box {
  width: 900px; max-width: 100%;
  background: #fff; border-radius: 18px; overflow: hidden;
  display: flex; box-shadow: 0 24px 60px rgba(0,0,0,.28);
  min-height: 480px;
}
.login-left {
  flex: 1; padding: 48px 42px;
  background: linear-gradient(160deg, #1F6B45, #3E8C60);
  color: #fff;
}
.brand {
  width: 54px; height: 54px; border-radius: 14px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; margin-bottom: 22px;
}
.brand-title { font-size: 26px; font-weight: 700; line-height: 1.45; }
.brand-sub { margin-top: 8px; color: rgba(255,255,255,.78); letter-spacing: 3px; font-size: 13px; }
.brand-points { margin-top: 34px; padding: 0; list-style: none; }
.brand-points li { padding: 9px 0 9px 20px; position: relative; color: rgba(255,255,255,.88); font-size: 13px; }
.brand-points li::before {
  content: ''; position: absolute; left: 0; top: 17px;
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6);
}
.login-right { width: 380px; padding: 48px 40px; display: flex; flex-direction: column; }
.login-h { font-size: 21px; font-weight: 700; }
.login-desc { color: var(--muted); font-size: 13px; margin: 6px 0 26px; }
.ipt-line { display: block; margin-bottom: 16px; }
.ipt-line span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ipt-line input {
  width: 100%; height: 42px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none;
}
.ipt-line input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(42,122,80,.12); }
.block { width: 100%; margin-top: 8px; }
.quick-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ql {
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 12px; color: var(--ink-2); cursor: pointer; background: #FAFCFB;
}
.ql:hover { border-color: var(--brand); color: var(--brand); }
.login-err { margin-top: 14px; color: var(--danger); font-size: 13px; min-height: 20px; }

/* ---------------- 框架 ---------------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex-shrink: 0;
  background: linear-gradient(180deg, #1B5C3B, #17472F);
  color: #D9E8DE; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-logo {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.side-t { font-size: 15px; font-weight: 700; color: #fff; }
.side-s { font-size: 11px; color: rgba(255,255,255,.6); }
.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-sec { font-size: 11px; color: rgba(255,255,255,.4); padding: 14px 10px 6px; letter-spacing: 1px; }
.nav-i {
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 2px;
  color: #C7DCCF;
}
.nav-i:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-i.on { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.nav-i .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.35); }
.nav-i.on .dot { background: #7BD3A2; }
.side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.mode-chip {
  padding: 10px 12px; border-radius: 9px; font-size: 12px;
  background: rgba(227,155,52,.2); color: #FFD9A6; border: 1px solid rgba(227,155,52,.4);
}
.mode-chip.off { background: rgba(123,211,162,.16); color: #A9E7C6; border-color: rgba(123,211,162,.35); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 62px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 5;
}
.crumb { font-size: 16px; font-weight: 700; }
.top-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; color: var(--ink-2); margin-right: 6px; }
.who b { color: var(--ink); }
.view { padding: 22px 24px 60px; flex: 1; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px;
  border: 1px solid rgba(0,0,0,.03);
}
.card-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.card-h h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-h .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, 1fr); } }

.stat {
  background: #fff; border-radius: var(--r); padding: 18px 20px;
  box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.03);
}
.stat .lab { font-size: 12px; color: var(--muted); }
.stat .val { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -1px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.brand .val { color: var(--brand); }
.stat.danger .val { color: var(--danger); }
.stat.amber .val { color: var(--amber); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 10px 12px; background: #F6FAF7;
  color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid #EEF3F0; vertical-align: middle; }
/* 授权一览：按人分组，子行用虚线与浅底区分 */
td.grant-owner { vertical-align: top; padding-top: 14px; border-right: 1px solid var(--line); }
tr.grant-sub td { border-top: 1px dashed var(--line); background: #FAFCFB; }
table.tbl tr:hover td { background: #FAFDFB; }
table.tbl td.nowrap, table.tbl th.nowrap { white-space: nowrap; }
.table-wrap { overflow: auto; max-height: 640px; border: 1px solid var(--line); border-radius: 10px; }

.btn {
  height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: #CFDDD4; background: #FAFCFB; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); border-color: #EDD3CF; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.ipt, .sel, .ta {
  height: 34px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; outline: none; background: #fff; color: var(--ink);
}
.ta { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; width: 100%; }
.ipt:focus, .sel:focus, .ta:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(42,122,80,.1); }

.tag {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; line-height: 18px; margin: 0 6px 4px 0; white-space: nowrap;
}
.tag.brand { background: var(--brand-soft); color: var(--brand-dark); }
.tag.amber { background: var(--amber-soft); color: #9A6415; }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.info { background: #E9F2FA; color: var(--info); }
.tag.grey { background: #EFF3F0; color: var(--muted); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }

.empty { padding: 48px; text-align: center; color: var(--muted); font-size: 13px; }

.thumb {
  width: 52px; height: 40px; object-fit: cover; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #F6FAF7; margin-right: 6px;
}
.thumbs { display: flex; align-items: center; }
.sign-mini { width: 76px; height: 32px; object-fit: contain; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: 6px; }

.bar { height: 6px; background: #EEF3F0; border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); }
.bar.low > i { background: var(--danger); }
.bar.warn > i { background: var(--amber); }

.kv { display: flex; padding: 7px 0; font-size: 13px; }
.kv .k { width: 100px; color: var(--muted); flex-shrink: 0; }
.kv .v { flex: 1; word-break: break-all; }

.timeline { border-left: 2px solid var(--line); padding-left: 16px; margin-left: 6px; }
.timeline .ti { position: relative; padding-bottom: 14px; font-size: 13px; }
.timeline .ti::before {
  content: ''; position: absolute; left: -21px; top: 6px;
  width: 9px; height: 9px; border-radius: 50%; background: var(--brand);
}
.timeline .ti .when { font-size: 12px; color: var(--muted); }

.alert {
  padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert.warn { background: var(--amber-soft); color: #8A5A11; border: 1px solid #F0DCBB; }
.alert.danger { background: var(--danger-soft); color: #8E2F25; border: 1px solid #F1D2CE; }
.alert.info { background: #E9F2FA; color: #25597F; border: 1px solid #CFE2F1; }
.alert.ok { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #C9E3D4; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(15,28,21,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px;
}
.modal {
  width: 720px; max-width: 100%; max-height: 86vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.modal-h {
  padding: 16px 20px; font-size: 15px; font-weight: 700; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-x { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; }
.modal-b { padding: 20px; overflow: auto; font-size: 13px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

.f-row { margin-bottom: 14px; }
.f-row > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.f-row input, .f-row select, .f-row textarea { width: 100%; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
/* 输入框 + 行内按钮（如「登录账号」的手填开关） */
.ipt-wrap { display: flex; gap: 6px; align-items: center; }
.ipt-wrap > .ipt, .ipt-wrap > .sel { flex: 1; min-width: 0; }
.ipt-wrap > .btn { flex: none; white-space: nowrap; }

.toast {
  position: fixed; left: 50%; top: 28px; transform: translateX(-50%);
  background: rgba(23,37,30,.92); color: #fff; padding: 10px 20px;
  border-radius: 8px; font-size: 13px; z-index: 200;
}

.mono { font-family: "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }
.link { color: var(--brand); cursor: pointer; }
.hl { color: var(--danger); font-weight: 700; }

/* ---------- 得分排行榜 ---------- */
.kpi-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.kpi {
  flex: 1; min-width: 118px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #FBFDFC;
}
.kpi-v { font-size: 22px; font-weight: 700; color: var(--brand-dark); }
.kpi-v.ok { color: var(--brand); }
.kpi-v.bad { color: var(--danger); }
.kpi-l { font-size: 12px; color: var(--muted); margin-top: 2px; }

.alert { border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.6; }
.alert.warn { background: #FFF7E6; color: #9A6415; border: 1px solid #F3DFAE; }

.rk-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: #EFF3F0; color: #7B8A81; font-size: 12px; font-weight: 700;
}
.rk-badge.g1 { background: linear-gradient(135deg, #E9C069, #C9962F); color: #fff; }
.rk-badge.g2 { background: linear-gradient(135deg, #CBD5DD, #9AA9B5); color: #fff; }
.rk-badge.g3 { background: linear-gradient(135deg, #E0AE85, #BE8459); color: #fff; }

.rk-sc { display: flex; align-items: center; gap: 10px; }
.rk-sc > span { min-width: 38px; text-align: right; font-size: 15px; font-weight: 700; }
.rk-bar { flex: 1; min-width: 60px; height: 6px; border-radius: 999px; background: #EFF3F0; overflow: hidden; }
.rk-bar-in { height: 100%; border-radius: 999px; }

.pod { display: flex; align-items: flex-end; justify-content: center; gap: 16px; padding: 42px 0 4px; }
.pod-c {
  flex: 0 1 220px; text-align: center; padding: 22px 14px 18px;
  border-radius: 12px; background: #F4F8F5; border: 1px solid var(--line);
}
.pod-c.p1 { background: linear-gradient(180deg, #FFF6E2, #FFFDF7); border-color: #F0D9A4; padding-bottom: 26px; }
.pod-c.p2 { background: linear-gradient(180deg, #F2F5F8, #FBFDFF); border-color: #DDE4EA; }
.pod-c.p3 { background: linear-gradient(180deg, #FAF1E9, #FEFBF8); border-color: #EEDCC8; }
.pod-bg {
  width: 40px; height: 40px; margin: -50px auto 8px; border-radius: 50%;
  line-height: 40px; font-size: 15px; font-weight: 700; color: #fff;
  background: #9AA9B5; box-shadow: 0 4px 10px rgba(0, 0, 0, .14);
}
.pod-bg.g1 { background: linear-gradient(135deg, #E9C069, #C9962F); }
.pod-bg.g2 { background: linear-gradient(135deg, #CBD5DD, #9AA9B5); }
.pod-bg.g3 { background: linear-gradient(135deg, #E0AE85, #BE8459); }
.pod-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.pod-score { font-size: 24px; font-weight: 700; }
.pod-unit { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 2px; }

/* ICP 备案页脚 */
.beian-foot {
  padding: 14px 24px 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.beian-foot a { color: var(--muted); text-decoration: none; }
.beian-foot a:hover { color: var(--brand); }
.beian-foot .sep { margin: 0 10px; opacity: .5; }
