/* 合作者 / 渠道后台同源样式：后续改公共组件请同步另一套。
   手机端布局约定见《交接报告》第 19 章「移动端密度规范」。 */
:root {
  --bg: #0d0f16;
  --bg-soft: #121521;
  --panel: #171a27;
  --panel-2: #1d2130;
  --panel-3: #232839;
  --line: #2a2f42;
  --line-soft: #222637;
  --text: #e4e6f2;
  --text-2: #9498ac;
  --text-3: #61667c;
  --brand: #ffb23e;
  --brand-2: #ff850f;
  --brand-soft: rgba(255, 178, 62, .12);
  --ok: #35c07d;
  --ok-soft: rgba(53, 192, 125, .14);
  --warn: #e0a63a;
  --warn-soft: rgba(224, 166, 58, .14);
  --bad: #e2636d;
  --bad-soft: rgba(226, 99, 109, .14);
  --info: #4e93e8;
  --info-soft: rgba(78, 147, 232, .14);
  --violet: #9a7ce8;
  --violet-soft: rgba(154, 124, 232, .14);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 250px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 600; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
button { font-family: inherit; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, #141720 0%, #10132099 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #1a1c26;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 15px; letter-spacing: .5px; color: var(--brand); }
.brand-text small { font-size: 11px; color: var(--text-3); }

.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px 18px; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: #2c3145; border-radius: 3px; }
.group-label {
  font-size: 11px;
  letter-spacing: 1.4px;
  color: var(--text-3);
  padding: 14px 10px 7px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 2px;
  font-size: 13.5px;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(255, 178, 62, .28);
  font-weight: 600;
}
.nav-item .n-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-3);
  background: var(--panel-3);
  border-radius: 20px;
  padding: 0 8px;
}
.nav-item.active .n-count { color: var(--brand); background: rgba(255,178,62,.16); }

.side-foot { padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.who { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.who b { color: var(--text-2); display: block; font-size: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: rgba(15, 17, 23, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-3); flex: 1; }
.crumb b { color: var(--text); font-size: 14.5px; }
.crumb i { font-size: 10px; }

.top-actions { display: flex; align-items: center; gap: 10px; }
.env-chip {
  font-size: 11.5px; padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--text-3); white-space: nowrap;
}
.env-chip.on { color: var(--ok); border-color: rgba(53, 192, 125, .35); background: var(--ok-soft); }
.env-chip.off { color: var(--warn); border-color: rgba(224, 166, 58, .35); background: var(--warn-soft); }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 11px 5px 6px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--panel); font-size: 12.5px;
}
.user-chip .ava {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #1a1c26; font-size: 12px; font-weight: 600;
}
.user-chip .role { color: var(--text-3); font-size: 11.5px; }

.ghost-btn {
  border: 1px solid var(--line); background: transparent; color: var(--text-2);
  padding: 7px 13px; border-radius: 9px; cursor: pointer; font-size: 12.5px; font-family: inherit;
}
.ghost-btn:hover { color: var(--bad); border-color: rgba(226, 99, 109, .4); }

.view { flex: 1; padding: 22px 24px 40px; max-width: 1560px; width: 100%; }
.page-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 24px 26px; color: var(--text-3); font-size: 11.5px;
  border-top: 1px solid var(--line-soft); margin-top: auto;
}

.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 24px; margin: 0 0 7px; letter-spacing: .3px; }
.page-head p { margin: 0; color: var(--text-2); font-size: 13px; max-width: 980px; }
.page-head .basis {
  margin-top: 9px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-3);
  border: 1px dashed var(--line); border-radius: 20px; padding: 4px 12px;
}
.page-head .basis.src-local { color: var(--warn); border-color: rgba(224, 166, 58, .4); border-style: solid; }
.page-head .basis.src-remote { color: var(--ok); border-color: rgba(53, 192, 125, .4); border-style: solid; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 22px 0 12px;
}
.section-title { font-size: 14.5px; letter-spacing: .18em; }
.section-head .help { margin: 0; }
.help { font-size: 12px; color: var(--text-3); }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px;
  display: flex; flex-direction: column;
}
.card.tight { padding: 13px 14px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.card-head h3 { font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.card-head .hint { font-size: 11.5px; color: var(--text-3); }
.card-body { flex: 1; }
.card-foot { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--text-3); }

.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .k-label { font-size: 12px; color: var(--text-3); }
.kpi .k-ico {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 12.5px;
}
.kpi .k-val { font-size: 25px; font-weight: 600; letter-spacing: .4px; }
.kpi .k-sub { font-size: 11.5px; color: var(--text-3); }
.kpi .k-val .unit { font-size: 12.5px; color: var(--text-3); margin-left: 4px; font-weight: 400; }
a.kpi-link { display: block; border-radius: var(--radius); }
.kpi-link { cursor: pointer; }
a.kpi-link .card, .kpi-link .card { height: 100%; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.kpi-link:hover .card, .kpi-link:hover .card { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
a.kpi-link:hover .k-label, .kpi-link:hover .k-label { color: var(--brand); }

tr.flash { animation: rowFlash 1.4s ease; }
@keyframes rowFlash {
  0% { background: rgba(255, 178, 62, .26); }
  60% { background: rgba(255, 178, 62, .12); }
  100% { background: transparent; }
}

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 20px; font-size: 11.5px;
  border: 1px solid var(--line); color: var(--text-2); white-space: nowrap;
  background: var(--panel-2);
}
.tag.ok { color: var(--ok); border-color: rgba(53, 192, 125, .32); background: var(--ok-soft); }
.tag.warn { color: var(--warn); border-color: rgba(224, 166, 58, .32); background: var(--warn-soft); }
.tag.bad { color: var(--bad); border-color: rgba(226, 99, 109, .32); background: var(--bad-soft); }
.tag.info { color: var(--info); border-color: rgba(78, 147, 232, .32); background: var(--info-soft); }
.tag.violet { color: var(--violet); border-color: rgba(154, 124, 232, .32); background: var(--violet-soft); }
.tag.brand { color: var(--brand); border-color: rgba(255, 178, 62, .34); background: var(--brand-soft); }
.tag.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font-size: 13px; white-space: nowrap;
  transition: .15s;
}
.btn:hover { border-color: rgba(255, 178, 62, .45); color: var(--brand); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #1a1c26; border-color: transparent; font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.06); color: #1a1c26; }
.btn.danger { color: var(--bad); border-color: rgba(226, 99, 109, .35); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

.more-ops { display: inline-flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.more-ops > summary {
  list-style: none; cursor: pointer;
  padding: 5px 10px; font-size: 12px; border-radius: 7px;
  border: 1px solid var(--line); color: var(--text-2); background: var(--panel-2);
  user-select: none; display: inline-flex; align-items: center; gap: 5px;
}
.more-ops > summary::-webkit-details-marker { display: none; }
.more-ops > summary::after { content: "▾"; font-size: 9px; opacity: .7; }
.more-ops > summary:hover { border-color: rgba(226, 99, 109, .4); color: var(--bad); }
.more-ops[open] > summary { color: var(--bad); border-color: rgba(226, 99, 109, .4); }
.more-ops-body {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 7px; min-width: 160px;
}

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button {
  background: transparent; border: none; color: var(--text-2); cursor: pointer;
  padding: 7px 13px; font-size: 12.5px;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--text-3); }
input[type="text"], input[type="number"], input[type="search"], input[type="password"], select, textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); padding: 8px 11px; font-size: 13px; font-family: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: rgba(255, 178, 62, .5); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { resize: vertical; min-height: 76px; }
.form-grid { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 11px 13px; color: var(--text-3); font-weight: 500;
  font-size: 12px; letter-spacing: .4px; border-bottom: 1px solid var(--line);
  background: var(--panel-2); white-space: nowrap;
}
tbody td { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .015); }
td .cell-main { color: var(--text); }
td .cell-sub { font-size: 11.5px; color: var(--text-3); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.tabs {
  display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.tabs button {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-2); cursor: pointer; padding: 9px 13px; font-size: 13px;
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs .t-count { font-size: 11px; color: var(--text-3); margin-left: 5px; }

.note {
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; font-size: 12.5px; color: var(--text-2); background: rgba(255, 255, 255, .012);
}
.note.warn { border-color: rgba(224, 166, 58, .4); color: #e8c583; background: var(--warn-soft); }
.note.bad { border-color: rgba(226, 99, 109, .38); color: #eb9aa2; background: var(--bad-soft); }
.note.info { border-color: rgba(78, 147, 232, .38); color: #a9c8f2; background: var(--info-soft); }

.empty { text-align: center; padding: 34px 16px; color: var(--text-3); font-size: 13px; }
.empty i { display: block; font-size: 26px; margin-bottom: 10px; color: var(--text-3); opacity: .7; font-style: normal; }

.kv { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--text-3); font-size: 12.5px; }
.kv dd { margin: 0; }
.kv-wide { grid-column: 1 / -1; }

.list { display: flex; flex-direction: column; gap: 9px; }
.list-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-item .li-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.list-item .li-side { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.checklist { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.checklist .ck { display: flex; gap: 9px; align-items: flex-start; color: var(--text-2); }
.checklist .ck i { color: var(--ok); font-size: 12px; margin-top: 3px; font-style: normal; }
.checklist .ck.todo i { color: var(--text-3); }

.mask {
  position: fixed; inset: 0; background: rgba(6, 8, 12, .58);
  opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 40;
  backdrop-filter: blur(2px);
}
.mask.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 94vw);
  background: var(--panel); border-left: 1px solid var(--line);
  transform: translateX(102%); transition: transform .22s ease; z-index: 50;
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.drawer-body { padding: 17px 18px 30px; overflow-y: auto; }
.drawer-body h4 { font-size: 13.5px; margin: 18px 0 9px; color: var(--brand); }
.drawer-body h4:first-child { margin-top: 0; }

.toast-wrap { position: fixed; right: 20px; bottom: 22px; z-index: 80; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--brand);
  color: var(--text); padding: 10px 15px; border-radius: var(--radius-sm); font-size: 13px;
  box-shadow: var(--shadow); animation: toastIn .18s ease; max-width: 340px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.rule-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.rule-nav {
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 10px; position: sticky; top: 74px;
}
.rule-nav .rule-group { font-size: 11px; letter-spacing: 1.2px; color: var(--text-3); padding: 11px 10px 5px; text-transform: uppercase; }
.rule-nav .rule-group:first-child { padding-top: 4px; }
.rule-nav-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; border-radius: 8px; color: var(--text-2);
  cursor: pointer; border: 1px solid transparent; background: transparent;
  font-size: 13px; text-align: left; transition: .15s;
}
.rule-nav-item::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .4; flex: 0 0 auto; }
.rule-nav-item:hover { background: var(--panel-2); color: var(--text); }
.rule-nav-item.active { background: var(--brand-soft); color: var(--brand); border-color: rgba(255, 178, 62, .28); font-weight: 600; }
.rule-nav-item.active::before { opacity: 1; }

.rule-content {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  padding: 24px 26px; min-height: 460px;
}
.rule-content .rule-title { font-size: 18px; color: var(--brand); margin-bottom: 6px; }
.rule-content .rule-cite { font-size: 11.5px; color: var(--text-3); margin-bottom: 18px; }
.rule-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.rule-list li { position: relative; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.8; }
.rule-list li::before {
  content: ""; position: absolute; left: 0; top: 11px; width: 7px; height: 7px;
  border-radius: 2px; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.rule-list li b { color: var(--text); }
.rule-empty { color: var(--text-3); padding: 60px 0; text-align: center; }

.rule-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rule-quick .card { cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.rule-quick .card:hover { border-color: rgba(255, 178, 62, .45); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.rule-quick .q-title { font-size: 13.5px; color: var(--brand); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.rule-quick .q-title .q-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 12px; flex: 0 0 auto; }
.rule-quick .q-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.rule-quick .q-more { margin-top: 10px; font-size: 11.5px; color: var(--text-3); }
.rule-quick .card:hover .q-more { color: var(--brand); }

.notif-list { display: flex; flex-direction: column; gap: 9px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s;
}
.notif-item:hover { border-color: rgba(255, 178, 62, .4); }
.notif-item.unread { border-left: 3px solid var(--brand); background: var(--panel-2); }
.notif-ico {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px;
  display: grid; place-items: center; font-size: 14px; font-weight: 600;
}
.notif-ico.bad { background: var(--bad-soft); color: var(--bad); }
.notif-ico.brand { background: var(--brand-soft); color: var(--brand); }
.notif-ico.ok { background: var(--ok-soft); color: var(--ok); }
.notif-ico.warn { background: var(--warn-soft); color: var(--warn); }
.notif-main { flex: 1; min-width: 0; }
.notif-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 600; }
.notif-title .tag { margin-left: 2px; }
.notif-body { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.7; }
.notif-time { font-size: 11.5px; color: var(--text-3); flex: 0 0 auto; white-space: nowrap; margin-top: 2px; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); flex: 0 0 auto; }

@media (max-width: 900px) {
  .rule-layout { grid-template-columns: 1fr; }
  .rule-nav { position: static; }
  .rule-quick { grid-template-columns: 1fr; }
}

.auth {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 22px;
  position: relative;
  isolation: isolate;
  background-color: #050607;
  background-image:
    linear-gradient(180deg, rgba(5,6,7,.14) 0%, rgba(5,6,7,.6) 52%, rgba(5,6,7,.92) 100%),
    url("assets/hero-xinjiang-tech-replica.webp");
  background-position: center top, center top;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
  padding: 40px 20px;
}
.auth::before {
  content: "";
  position: absolute;
  top: 0; right: -36px; bottom: -36px; left: -36px;
  z-index: -2;
  background-image: url("assets/hero-xinjiang-tech-replica.webp");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  filter: blur(18px);
  opacity: .95;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, transparent 18%, rgba(0,0,0,.35) 52%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, transparent 18%, rgba(0,0,0,.35) 52%, #000 100%);
}
.auth::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,178,62,.07) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(255,178,62,.05) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 16%, rgba(18,146,255,.16), transparent 38%),
    linear-gradient(180deg, rgba(5,6,7,.08) 0%, rgba(5,6,7,.42) 48%, rgba(5,6,7,.88) 100%);
}
.auth > * { position: relative; z-index: 1; }
.auth-card {
  width: 100%; max-width: 400px;
  background: rgba(23, 26, 39, .6);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px;
  padding: 40px 36px; box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 8px; }
.auth-brand .brand-mark { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; }
.auth-brand .brand-mark svg { width: 22px; height: 22px; }
.auth-brand .brand-logo { width: 40px; height: 40px; flex: 0 0 40px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(255,178,62,.25)); }
.auth-brand .brand-text b { color: var(--brand); font-size: 18px; letter-spacing: 1px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 { font-size: 22px; color: var(--brand); letter-spacing: 1px; }
.auth-head p { color: var(--text-3); font-size: 13px; margin: 6px 0 0; }
.auth-form .field { margin-bottom: 16px; }
.auth-submit { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.auth-switch { display: flex; justify-content: space-between; margin-top: 14px; font-size: 12.5px; color: var(--text-3); }
.auth-switch a { color: var(--brand); }
.auth-divider { border: none; border-top: 1px solid var(--line-soft); margin: 18px 0; }
.auth-error {
  background: var(--bad-soft); border: 1px solid rgba(226,99,109,.3); border-radius: var(--radius-sm);
  color: #eb9aa2; font-size: 13px; padding: 10px 13px; margin-bottom: 16px; display: none;
}
.auth-error.show { display: block; }
.auth-foot { color: var(--text-3); font-size: 12px; }

/* 登录卡片：左右两栏（左密码/手机号切换，右微信扫码二维码） */
.auth-login-card { max-width: 660px; }
.auth-card .auth-brand { margin-bottom: 28px; }

.login-body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
}
.login-main { min-width: 0; padding-right: 30px; }
.login-aside {
  display: flex; align-items: flex-start;
  padding-left: 30px; border-left: 1px solid var(--line-soft);
}
.login-panel { margin-top: 0; }
.login-panel .auth-form { margin-top: 0; }

/* 登录方式切换：长胶囊 */
.login-tabs {
  display: flex; gap: 2px; padding: 3px;
  margin-bottom: 26px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}
.login-tab {
  flex: 1; padding: 8px 16px; font-size: 14px; font-weight: 500;
  color: var(--text-2); background: transparent; border: 0;
  border-radius: 999px; cursor: pointer;
  transition: color .15s, background .15s;
}
.login-tab:hover { color: var(--text); }
.login-tab.active { color: var(--text); background: var(--panel); box-shadow: var(--shadow); }

/* 验证码行 */
.field-row { display: flex; gap: 10px; align-items: center; }
.field-row input { flex: 1; }
.btn-quiet {
  border: 0; background: transparent; color: var(--brand);
  cursor: pointer; font-size: 13px; padding: 4px 2px; white-space: nowrap;
}
.btn-quiet:hover { color: var(--brand-2); text-decoration: underline; }
.btn-quiet:disabled { opacity: .45; cursor: not-allowed; text-decoration: none; }

/* 右侧微信二维码 */
.login-qr { display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-qr canvas {
  display: block; width: 200px; height: 200px;
  border: 1px solid var(--line); border-radius: 8px; background: #ffffff;
}
.login-qr-title { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--text); }
.login-qr-hint { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-2); }

.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.promo-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.promo-qr {
  flex: 0 0 auto;
  border-radius: 8px;
  background: #fff;
}
.promo-info { min-width: 0; flex: 1; }
.promo-name { font-weight: 600; color: var(--text); }
.promo-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.promo-op { flex: 0 0 auto; }
.promo-stage {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.promo-stage-info { min-width: 200px; flex: 1; }

@media (max-width: 1080px) {
  .grid.cols-3, .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .view { padding: 16px 14px 30px; }
  .topbar { padding: 10px 14px; gap: 9px; }
  .crumb { display: none; }
  .user-chip .role { display: none; }
}
/* 渠道服务商工作台 · 动态推广二维码 */
.qr-metrics { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.qr-metrics b { color: var(--text); font-weight: 600; }
.qr-metrics b.brand { color: var(--brand); }
.qr-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.qr-inactive { opacity: .55; }
.qr-inactive .promo-qr { filter: grayscale(1); }

/* ===== 注册页（渠道服务商 / 合作者）============================== */
[hidden] { display: none !important; }

.auth-register-card { max-width: 620px; }
.auth-register-card .auth-brand { margin-bottom: 18px; }
.auth-register-card .auth-head { text-align: left; margin-bottom: 20px; }
.auth-register-card .auth-head p { margin-bottom: 0; }

.auth-form fieldset { margin: 0 0 18px; padding: 0; border: 0; }
.auth-form fieldset legend {
  padding: 0; margin-bottom: 10px;
  font-size: 12px; letter-spacing: .08em; color: var(--text-2);
}
.auth-form .req { color: var(--brand-2); }
.auth-form .help { display: block; margin-top: 5px; font-size: 12px; color: var(--text-3); }
.auth-form .error-text { display: block; margin-top: 5px; font-size: 12px; color: var(--bad); }
.auth-form .form-grid { gap: 0 24px; }

.auth-form input[type="tel"] {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); padding: 8px 11px; font-size: 13px; font-family: inherit; width: 100%;
  transition: border-color .15s;
}
.auth-form input[type="tel"]:focus { outline: none; border-color: rgba(255, 178, 62, .5); }
.auth-form input[type="tel"]::placeholder { color: var(--text-3); }
.auth-form input[aria-invalid="true"] { border-color: var(--bad); }

/* 身份证上传 */
.id-card-upload { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.id-card-slot { position: relative; }
.id-card-frame {
  position: relative; aspect-ratio: 1.585 / 1;
  border: 1.5px dashed var(--line); border-radius: 10px;
  background: var(--panel-2); cursor: pointer; overflow: hidden;
  transition: border-color .2s, background .2s;
}
.id-card-frame:hover { border-color: var(--brand); background: rgba(255, 178, 62, .06); }
.id-card-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  color: var(--text-3); pointer-events: none;
}
.id-card-placeholder svg { color: var(--text-3); opacity: .55; }
.id-card-placeholder > span:first-of-type { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: .06em; }
.id-card-hint { font-size: 11px; color: var(--text-3); opacity: .8; }
.id-card-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.id-card-slot.uploaded .id-card-frame { border-style: solid; border-color: var(--brand); }
.id-card-slot.uploaded .id-card-placeholder { display: none; }

/* 服务区域下拉 */
.region-select { position: relative; max-width: 320px; }
.region-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--panel-2);
  cursor: pointer; font: inherit; font-size: 14px; color: var(--text); text-align: left;
  transition: border-color .15s;
}
.region-trigger:hover { border-color: rgba(255, 178, 62, .45); }
.region-trigger[aria-expanded="true"] { border-color: var(--brand); }
.region-summary { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }
.region-summary.has-value { color: var(--text); }
.region-caret { flex: 0 0 auto; color: var(--text-3); transition: transform .15s; }
.region-trigger[aria-expanded="true"] .region-caret { transform: rotate(180deg); }
.region-panel {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow);
}
.region-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.region-confirm { margin-left: auto; color: var(--brand); font-weight: 600; }
.region-grid { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; padding-right: 2px; }
.region-chip {
  display: flex; align-items: center; gap: 7px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2);
  font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s;
}
.region-chip:hover { border-color: rgba(255, 178, 62, .45); }
.region-chip[data-on="true"] { border-color: var(--brand); background: var(--brand-soft); }
.region-chip input { accent-color: var(--brand); }
.region-group { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.region-group-head { display: flex; align-items: center; }
.region-group-check { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 8px 10px; font-size: 13px; cursor: pointer; }
.region-group-check input { accent-color: var(--brand); flex: 0 0 auto; margin: 0; }
.region-group-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-group-check[data-on="true"] .region-group-name { color: var(--brand); font-weight: 600; }
.region-group-toggle { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 36px; padding: 0; margin-right: 6px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; }
.region-group-caret { transition: transform .15s; }
.region-group-toggle[aria-expanded="true"] .region-group-caret { transform: rotate(180deg); }
.region-group-body { padding: 0 10px 10px; }
.region-chip-list { display: grid; grid-template-columns: 1fr; gap: 6px; }

/* 密码显隐 */
.pw-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; margin: 0; flex: 0 0 auto;
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle .icon-eye-off { display: none; }
.pw-toggle[data-shown="true"] .icon-eye { display: none; }
.pw-toggle[data-shown="true"] .icon-eye-off { display: block; }

/* 注册底部：服务号二维码 */
.service-qr {
  display: flex; align-items: center; gap: 16px; margin-top: 20px;
  padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--panel-2);
}
.service-qr-code { position: relative; flex: 0 0 auto; width: 108px; height: 108px; cursor: pointer; border-radius: 4px; overflow: hidden; }
.service-qr canvas { display: block; width: 108px; height: 108px; background: #ffffff; }
.service-qr-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  background: rgba(33, 84, 74, .9); color: #ffffff; font-size: 12px; font-weight: 600;
}
.service-qr-overlay svg { width: 22px; height: 22px; }
.service-qr-body { min-width: 0; }
.service-qr-title { font-size: 14px; font-weight: 600; color: var(--text); }
.service-qr-list { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 0; padding: 0; list-style: none; }
.service-qr-list li { font-size: 12px; color: var(--text-2); }
.service-qr-list li::before { content: '✓'; margin-right: 4px; color: var(--ok); }
.service-qr-hint { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.service-qr-hint.error { color: var(--bad); }
.service-qr-code.service-qr-error { outline: 2px solid var(--bad); outline-offset: 2px; }

@media (max-width: 640px) {
  .id-card-upload, .auth-form .form-grid { grid-template-columns: 1fr; }
}/* ============================================================
   移动端外壳与信息密度（布局层，不改配色）
   1. <=1080：侧栏改为抽屉，顶栏增加菜单按钮
   2. <=720：两列 KPI、紧凑卡片、表格横滑、tab 单行
   ============================================================ */

.side-toggle,
.side-mask {
  display: none;
}

@media (max-width: 1080px) {
  .app {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(82vw, 280px);
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: 18px 0 50px rgba(0, 0, 0, .45);
  }

  .app.side-open .sidebar {
    transform: none;
  }

  .main {
    width: 100%;
    min-height: 100vh;
  }

  .side-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 6px 9px;
  }

  .side-mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(5, 7, 11, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }

  .app.side-open .side-mask {
    opacity: 1;
    pointer-events: auto;
  }

  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .view {
    padding: 12px 12px 24px;
  }

  .topbar {
    gap: 8px;
    padding: 10px 12px;
  }

  .crumb {
    display: none;
  }

  .env-chip {
    display: none;
  }

  .top-actions {
    gap: 6px;
    min-width: 0;
  }

  .user-chip {
    padding: 4px 8px 4px 5px;
    white-space: nowrap;
  }

  .user-chip .role {
    display: none;
  }

  .user-chip > span:not(.ava) {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ghost-btn {
    padding: 6px 10px;
    white-space: nowrap;
  }

  .page-head {
    margin-bottom: 12px;
  }

  .page-head h1 {
    margin: 0 0 4px;
    font-size: 19px;
  }

  .page-head p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .page-head .basis {
    margin-top: 6px;
    padding: 3px 8px;
    font-size: 10.5px;
  }

  .grid {
    gap: 8px;
  }

  .grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid > *,
  .card,
  .kpi-link {
    min-width: 0;
  }

  .card {
    padding: 11px 12px;
    border-radius: 11px;
  }

  .card.tight {
    padding: 10px 11px;
  }

  .card-head {
    gap: 8px;
    margin-bottom: 8px;
  }

  .card-head h3 {
    gap: 6px;
    font-size: 12.5px;
  }

  .card-head .hint {
    font-size: 10.5px;
  }

  .card-foot {
    margin-top: 8px;
    padding-top: 8px;
    font-size: 11px;
  }

  .kpi {
    gap: 2px;
  }

  .kpi .k-top {
    gap: 6px;
  }

  .kpi .k-label {
    overflow: hidden;
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .kpi .k-ico {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 11px;
  }

  .kpi .k-val {
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: 0;
  }

  .kpi .k-val .unit {
    margin-left: 2px;
    font-size: 10.5px;
  }

  .kpi .k-sub {
    overflow: hidden;
    font-size: 10px;
    line-height: 1.35;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .tabs,
  .seg {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar,
  .seg::-webkit-scrollbar {
    display: none;
  }

  .tabs button,
  .seg button {
    flex: 0 0 auto;
    padding: 7px 9px;
    font-size: 11.5px;
    white-space: nowrap;
  }

  .toolbar {
    gap: 8px;
  }

  .table-wrap {
    border-radius: 10px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 560px;
    font-size: 12px;
  }

  .table-wrap:has(thead th:nth-child(8)) table {
    min-width: 720px;
  }

  .table-wrap:has(thead th:nth-child(9)) table {
    min-width: 1080px;
  }

  .table-wrap thead th {
    padding: 8px 9px;
    font-size: 11px;
  }

  .table-wrap tbody td {
    padding: 8px 9px;
  }

  .table-wrap td .cell-sub {
    font-size: 10.5px;
  }

  .table-wrap::before {
    content: "左右滑动查看完整表格";
    position: sticky;
    left: 0;
    top: 0;
    z-index: 2;
    display: block;
    padding: 5px 9px;
    color: var(--text-3);
    background: var(--panel);
    border-bottom: 1px solid var(--line-soft);
    font-size: 9.5px;
    letter-spacing: .03em;
  }

  .page-foot {
    padding: 12px 12px 18px;
    font-size: 10px;
  }

  .page-foot span:last-child {
    display: none;
  }
}

@media (max-width: 380px) {
  .grid.cols-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .ghost-btn {
    padding: 6px 8px;
    font-size: 0;
  }

  .ghost-btn svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 720px) {
  .auth {
    padding: 24px 16px 32px;
  }

  .auth-card,
  .auth-login-card {
    max-width: 420px;
  }

  .login-body {
    grid-template-columns: 1fr;
  }

  .login-main {
    padding-right: 0;
  }

  .login-aside {
    display: none;
  }

  .auth-brand {
    margin-bottom: 20px;
  }

  .login-tabs {
    margin-bottom: 20px;
  }
}

@media (max-width: 720px) {
  .promo-card {
    gap: 10px;
    padding: 12px;
  }

  .promo-qr {
    width: 96px;
    height: 96px;
  }

  .promo-name {
    font-size: 13.5px;
  }

  .promo-sub {
    font-size: 11px;
  }

  .qr-metrics {
    gap: 8px;
    font-size: 11px;
  }

  .qr-actions {
    gap: 5px;
    margin-top: 8px;
  }
}


/* ── 统一主站 LOGO ─────────────────────────────────────── */
.brand-mark { background: transparent; color: inherit; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* 列表行可点击查看详情 */
table tbody tr { cursor: pointer; }



/* deploy-fix: 装饰层导致横向溢出 */
html{overflow-x:clip}
body{max-width:100vw}
