:root {
  --bg: #EBF4FC;
  --surface: #FFFFFF;
  --line: #D9E6F2;
  --line-strong: #C9D9E9;
  --text: #1F3549;
  --sub: #5E758B;
  --hint: #93A6B7;
  --p: #3275AA;
  --p-hover: #2A6394;
  --p-soft: #D8E9F7;
  --p-fg: #FFFFFF;
  --ok: #559783;
  --ok-soft: #EAF4F0;
  --warn: #B3895B;
  --warn-soft: #FAF3EA;
  --bad: #B86D68;
  --bad-soft: #FAEFEE;
  --fill: #E3EFF9;
  --fill2: #D5E5F3;
  --hover: #EEF6FD;
  --th: #F2F8FD;
  --radius: 10px;
  --radius-lg: 12px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.3, 1.3, .4, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { text-decoration: none; color: inherit; }
img { display: block; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid #7E9DB8; outline-offset: 2px; }

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D5DCE5; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #C2CBD6; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 18% 12%, #DCEBF8 0, transparent 44%),
    radial-gradient(circle at 84% 88%, #E3F1EE 0, transparent 42%),
    #E7F1FA;
  padding: 24px;
}
.login-card {
  width: 368px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 30px 28px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(31, 53, 73, .08);
  animation: card-in .6s var(--ease-out) both;
}
.login-card .mascot {
  width: 72px; height: 72px; margin: 0 auto 12px;
  border-radius: 20px; background: var(--p-soft); object-fit: contain; padding: 6px;
}
.login-card h1 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.login-card p { color: var(--sub); margin: 6px 0 22px; font-size: 13px; }
.login-card .field { text-align: left; }
.login-card .btn { width: 100%; margin-top: 18px; height: 40px; font-size: 14px; }
.login-tip { margin-top: 14px; color: var(--hint); font-size: 12px; line-height: 1.6; }

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

.side {
  width: 216px;
  flex: 0 0 216px;
  background: #F6FBFE;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 14px; }
.brand img {
  width: 34px; height: 34px; border-radius: 10px; object-fit: contain;
  background: var(--p-soft); padding: 4px;
}
.brand b { font-size: 15px; font-weight: 600; display: block; letter-spacing: -.01em; }
.brand span { color: var(--hint); font-size: 12px; }

.nav { position: relative; padding: 2px 10px 12px; flex: 1; overflow: auto; }
.nav-group { padding: 16px 10px 6px; color: var(--hint); font-size: 11px; letter-spacing: .12em; }
.nav a {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 10px; margin-bottom: 2px;
  border-radius: 10px; color: var(--sub);
  transition: color .2s, background-color .2s;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav a:hover { background: var(--fill); color: var(--text); }
.nav a.active, .nav a.active:hover {
  background: transparent; color: var(--p); font-weight: 600;
}
.nav a.active svg { opacity: 1; }
.nav a span { white-space: nowrap; }
.nav-ind {
  position: absolute; left: 10px; right: 10px; top: 0; height: 38px; z-index: 0;
  border-radius: 10px; background: var(--p-soft);
  box-shadow: inset 3px 0 0 var(--p);
  pointer-events: none;
  transition: transform .5s var(--ease-spring), height .3s var(--ease-out);
}
.side-foot {
  border-top: 1px solid var(--line); padding: 13px 16px;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--sub); font-size: 13px;
}
.side-foot button { color: var(--p); padding: 4px 6px; border-radius: 6px; transition: background-color .2s; }
.side-foot button:hover { background: var(--p-soft); }
.admin-chip { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-chip i {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--p-soft); color: var(--p);
  display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 11px; font-weight: 700;
}

.main { flex: 1; min-width: 0; }
.workspace-head { position: sticky; top: 0; z-index: 20; background: var(--bg); }

.page-nav {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 24px; background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.page-tabs {
  position: relative; flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 4px 0; overflow-x: auto; scrollbar-width: none;
}
.page-tabs::-webkit-scrollbar { display: none; }
.tab-ind {
  position: absolute; left: 0; top: 4px; height: 34px; width: 0; z-index: 0;
  border-radius: 9px; background: var(--fill);
  pointer-events: none;
  transition: transform .5s var(--ease-spring), width .5s var(--ease-spring);
}
.page-tab {
  position: relative; z-index: 1; flex: none;
  display: flex; align-items: center;
  border-radius: 9px; color: var(--sub);
  transition: background-color .2s, color .2s;
}
.page-tab:not(.active):hover { background: var(--hover); }
.page-tab.new { animation: tab-in .45s var(--ease-spring) both; }
.page-tab-select {
  display: flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 10px; white-space: nowrap;
  font-size: 13px; color: inherit;
}
.page-tab-select svg { width: 15px; height: 15px; flex: none; opacity: .8; }
.page-tab.active .page-tab-select { color: var(--p); font-weight: 600; }
.page-tab.active .page-tab-select svg { opacity: 1; }
.page-tab-close {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-right: 5px;
  border-radius: 6px; color: var(--hint);
  transition: background-color .2s, color .2s;
}
.page-tab-close svg { width: 10px; height: 10px; stroke-width: 2; }
.page-tab-close:hover { background: var(--fill2); color: var(--text); }
.page-refresh {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line); border-radius: 9px; color: var(--sub);
  transition: background-color .2s, color .2s, border-color .2s, transform .35s var(--ease-out);
}
.page-refresh svg { width: 16px; height: 16px; }
.page-refresh:hover { background: var(--hover); color: var(--p); border-color: var(--line-strong); }
.page-refresh:active { transform: rotate(-40deg) scale(.94); }

.topbar { display: flex; align-items: baseline; gap: 10px; padding: 16px 24px 8px; }
.topbar h1 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.topbar span { color: var(--hint); font-size: 12px; }
.topbar h1.title-in { animation: title-in .3s var(--ease-out) both; }

.view { padding: 6px 24px 40px; }
.view > div.page-anim { animation: page-in .26s var(--ease-out) both; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px;
  transition: box-shadow .4s, border-color .3s;
}
.card:hover { box-shadow: 0 6px 20px rgba(31, 48, 64, .05); }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.card-head .sub { color: var(--hint); font-size: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px;
  transition: transform .45s var(--ease-out), box-shadow .45s, border-color .3s;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(31, 48, 64, .08); border-color: #C9DDEE; }
.stat .label { color: var(--sub); font-size: 12px; }
.stat .value { font-size: 26px; font-weight: 600; margin-top: 6px; letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.stat .value.blue { color: var(--p); }
.stat .value.orange { color: var(--warn); }
.stat .value.green { color: var(--ok); }
.stat .hint { color: var(--hint); font-size: 12px; margin-top: 4px; }
button.stat { text-align: left; width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition:
    background-color .2s, border-color .2s, color .2s,
    transform .35s var(--ease-out), box-shadow .35s;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover { border-color: #C3D8EA; color: var(--p); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(31, 48, 64, .07); }
.btn:active { transform: scale(.97); box-shadow: none; }
.btn.primary, .btn:not(.ghost):not(.line):not(.danger):not(.danger-soft):not(.orange) {
  background: var(--p); border-color: var(--p); color: var(--p-fg);
}
.btn.primary:hover, .btn:not(.ghost):not(.line):not(.danger):not(.danger-soft):not(.orange):hover { background: var(--p-hover); border-color: var(--p-hover); color: var(--p-fg); }
.btn.ghost { background: var(--p-soft); border-color: transparent; color: var(--p); }
.btn.ghost:hover { background: #CCE1F2; border-color: transparent; color: var(--p); }
.btn.line { background: var(--surface); color: var(--sub); }
.btn.line:hover { color: var(--p); }
.btn.orange { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.btn.orange:hover { background: #F1E6D6; color: var(--warn); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
.btn.danger:hover { background: #A4524C; border-color: #A4524C; color: #FFFFFF; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.spinner {
  width: 12px; height: 12px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .7s linear infinite;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--sub); }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: 9px; padding: 8px 11px; outline: none; font-size: 13px;
  transition: border-color .2s, box-shadow .2s;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--p);
  box-shadow: 0 0 0 3px rgba(79, 117, 145, .14);
}
.textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 128px; flex: 0 0 auto; }
.filters .field.grow { flex: 1; min-width: 190px; }

.table-wrap { overflow: auto; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 10px 11px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
th { color: var(--sub); font-weight: 500; font-size: 12px; background: var(--th); white-space: nowrap; }
th.th-sort { cursor: pointer; user-select: none; }
th.th-sort:hover, th.th-sort.on { color: var(--p); }
th.th-sort .sort-ind { margin-left: 4px; font-size: 10px; color: var(--hint); }
th.th-sort.on .sort-ind { color: var(--p); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr td { transition: background-color .28s ease; }
tbody tr:hover td { background: var(--hover); }
td .muted, th .muted { color: var(--hint); font-size: 12px; }
td .title { font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.view table > tbody > tr,
.user-row {
  animation: row-in .3s var(--ease-out) both;
}
.view table > tbody > tr:nth-child(2), .user-row:nth-child(2) { animation-delay: 18ms; }
.view table > tbody > tr:nth-child(3), .user-row:nth-child(3) { animation-delay: 36ms; }
.view table > tbody > tr:nth-child(4), .user-row:nth-child(4) { animation-delay: 54ms; }
.view table > tbody > tr:nth-child(5), .user-row:nth-child(5) { animation-delay: 72ms; }
.view table > tbody > tr:nth-child(6), .user-row:nth-child(6) { animation-delay: 90ms; }
.view table > tbody > tr:nth-child(7), .user-row:nth-child(7) { animation-delay: 108ms; }
.view table > tbody > tr:nth-child(8), .user-row:nth-child(8) { animation-delay: 126ms; }
.view table > tbody > tr:nth-child(n+9), .user-row:nth-child(n+9) { animation-delay: 144ms; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; background: var(--p-soft); color: var(--p); white-space: nowrap;
}
.tag.gray { background: var(--fill); color: var(--sub); }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.orange { background: var(--warn-soft); color: var(--warn); }
.tag.red { background: var(--bad-soft); color: var(--bad); }
.tag.blue { background: var(--p-soft); color: var(--p); }

.empty { text-align: center; color: var(--hint); padding: 40px 0; font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; color: var(--sub); font-size: 12px; }
.pager .btn { height: 28px; }

.switch {
  position: relative; width: 40px; height: 22px; padding: 0;
  border-radius: 999px; background: #D4DBE3;
  transition: background-color .25s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(20, 32, 44, .18);
  transition: transform .5s cubic-bezier(.34, 1.5, .64, 1);
}
.switch.on { background: var(--p); }
.switch.on::after { transform: translateX(18px); }

/* 场地行内操作 */
.venue-stepper {
  display: inline-flex; align-items: center; overflow: hidden;
  border: 1px solid var(--line); border-radius: 7px; background: var(--surface);
}
.venue-stepper .step {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  color: var(--sub); font-size: 14px; line-height: 1;
  transition: background-color .2s, color .2s;
}
.venue-stepper .step:hover { background: var(--fill); color: var(--p); }
.venue-stepper .step[disabled] { opacity: .45; cursor: wait; }
.venue-stepper .weight-input {
  width: 52px; min-width: 34px; height: 24px; padding: 0 2px;
  border: 0; background: transparent;
  text-align: center; font-size: 12px; color: var(--text);
  font-variant-numeric: tabular-nums;
  appearance: textfield; -moz-appearance: textfield;
}
.venue-stepper .weight-input::-webkit-outer-spin-button,
.venue-stepper .weight-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.venue-stepper .weight-input:hover { background: var(--fill); }
.venue-stepper .weight-input:focus { outline: none; background: var(--fill); box-shadow: inset 0 0 0 1px var(--p); }
.venue-stepper .weight-input[disabled] { opacity: .45; cursor: wait; }
.venue-switch { width: 36px; height: 20px; }
.venue-switch::after { width: 14px; height: 14px; }
.venue-switch.on::after { transform: translateX(16px); }
.venue-switch[disabled] { opacity: .55; cursor: wait; }
.venue-status { display: inline-flex; align-items: center; gap: 7px; }
.venue-status .status-text { min-width: 24px; font-size: 11px; color: var(--sub); }
tr.row-saving td { background: var(--p-soft) !important; }
tr.row-flash td { animation: row-flash .75s ease; }
@keyframes row-flash { 0% { background: var(--ok-soft); } 100% { background: transparent; } }

/* ---------- 用户目录 ---------- */
.user-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 16px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line);
}
.user-hero .eyebrow { font-size: 10.5px; letter-spacing: .1em; color: var(--hint); }
.user-hero h2 { font-size: 18px; font-weight: 600; margin-top: 4px; letter-spacing: -.01em; }
.user-hero p { margin-top: 3px; font-size: 12px; color: var(--sub); }
.user-hero .hero-stats { display: flex; gap: 7px; flex: none; }
.user-hero .hero-stat { padding: 7px 11px; border-radius: 9px; background: var(--fill); }
.user-hero .hero-stat b { display: block; font-size: 17px; font-weight: 600; line-height: 1.2; color: var(--p); font-variant-numeric: tabular-nums; }
.user-hero .hero-stat span { font-size: 11px; color: var(--hint); }
.user-hero .hero-stat.bad b { color: var(--bad); }

.user-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 9px 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.search-box {
  flex: 1; min-width: 210px; height: 36px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 11px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--p); box-shadow: 0 0 0 3px rgba(79, 117, 145, .14); }
.search-box svg { width: 15px; height: 15px; flex: none; color: var(--hint); }
.search-box input { flex: 1; height: 100%; border: none; outline: none; background: none; font-size: 13px; }
.status-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--fill); }
.status-tabs button {
  padding: 6px 12px; border-radius: 7px; color: var(--sub); font-size: 12px;
  transition: background-color .2s, color .2s;
}
.status-tabs button:hover { color: var(--text); }
.status-tabs button.on { background: var(--surface); color: var(--p); font-weight: 600; box-shadow: 0 1px 3px rgba(31, 48, 64, .08); }

.user-layout { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 14px; margin-top: 12px; align-items: start; }
.user-list {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
}
.user-list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  color: var(--sub); font-size: 12px;
}
.user-list-head b { color: var(--text); font-weight: 600; }

.um-rows {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px; max-height: calc(100vh - 390px); min-height: 300px; overflow: auto;
}
.um-av-wrap { position: relative; flex: none; display: flex; }
.um-dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok); border: 2px solid var(--surface);
}
.um-dot.off { background: var(--bad); }
.um-row {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 11px; border: 1px solid transparent; border-radius: 10px;
  background: #F8FCFF; text-align: left; font: inherit; color: inherit;
  transition: background-color .2s, border-color .2s;
}
.um-row:hover { background: var(--hover); border-color: var(--line); }
.um-row.selected { background: var(--p-soft); border-color: var(--p); }
.um-row-main { flex: 1; min-width: 0; }
.um-row-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.um-row-name em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-row-name .tag { font-size: 10px; padding: 1px 6px; }
.um-row-sub { margin-top: 3px; font-size: 11px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-chips { display: flex; gap: 5px; flex: none; }
.um-chip {
  display: flex; align-items: baseline; gap: 3px;
  padding: 3px 7px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--hint); font-size: 10px;
}
.um-chip b { font-size: 12.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.um-chev { flex: none; color: var(--hint); font-size: 16px; line-height: 1; }
.um-row.selected .um-chev { color: var(--p); }
.um-foot { padding: 0 12px 10px; }
.um-foot .pager { margin-top: 8px; }

.user-avatar {
  width: 38px; height: 38px; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--p-soft); color: var(--p);
  font-size: 15px; font-weight: 600;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-avatar.big {
  width: 56px; height: 56px; font-size: 20px; border-radius: 18px;
  border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(31, 48, 64, .10);
}

.um-detail {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
  position: sticky; top: 126px; scroll-margin-top: 126px;
  animation: detail-in .3s var(--ease-out) both;
}
.um-dhead {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(155deg, var(--p-soft) 0%, #F8FCFF 62%, var(--surface) 100%);
}
.um-dname { display: flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.um-dname .tag { font-size: 10.5px; padding: 2px 7px; }
.um-duid { margin-top: 3px; font-size: 11px; color: var(--sub); }
.um-dbody { padding: 14px 16px 16px; }
.um-actions { display: flex; gap: 8px; }
.um-actions .btn { flex: 1; height: 32px; font-size: 12px; }
.btn.danger-soft { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn.danger-soft:hover { background: #F2DEDC; border-color: transparent; color: var(--bad); }
.um-group { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); }
.um-gtitle { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--hint); letter-spacing: .06em; }
.um-gtitle::before { content: ""; width: 3px; height: 10px; border-radius: 2px; background: var(--p); opacity: .5; }
.um-line { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 12.5px; }
.um-line span { flex: none; width: 58px; color: var(--hint); }
.um-line b { flex: 1; min-width: 0; font-weight: 500; word-break: break-all; }
.um-copy {
  flex: none; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface); color: var(--sub); font: inherit; font-size: 10.5px;
  transition: color .2s, border-color .2s;
}
.um-copy:hover { color: var(--p); border-color: var(--p); }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.perm-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--sub); }
.perm-item > span { flex: none; width: 72px; color: var(--hint); }
.perm-item .select, .perm-item .input { flex: 1; min-width: 0; height: 28px; font-size: 11.5px; }
.perm-item input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--p); }
.perm-actions { display: flex; gap: 8px; margin-top: 9px; }
.perm-actions .btn { height: 30px; font-size: 11.5px; }
.um-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 7px; }
.um-metrics div { padding: 8px 4px; border-radius: 8px; text-align: center; border: 1px solid var(--line); }
.um-metrics div:nth-child(1) { background: var(--p-soft); }
.um-metrics div:nth-child(2) { background: var(--ok-soft); }
.um-metrics div:nth-child(3) { background: var(--warn-soft); }
.um-metrics b { display: block; font-size: 17px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.um-metrics span { font-size: 10.5px; color: var(--sub); }
.um-tip { margin-top: 11px; font-size: 10.5px; line-height: 1.6; color: var(--hint); }
.um-empty { text-align: center; color: var(--hint); padding: 34px 12px; font-size: 12px; }
.um-empty img { width: 64px; margin: 0 auto 8px; opacity: .9; }

.ingest-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }

/* ---------- 骨架屏 / 错误态 ---------- */
.skeleton-page { display: flex; flex-direction: column; gap: 12px; }
.skel {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, #DCE9F5 0%, #F2F9FE 50%, #DCE9F5 100%);
  background-size: 200% 100%;
  animation: shimmer 1.1s ease-in-out infinite;
}
.skel-hero { height: 84px; border-radius: var(--radius-lg); }
.skel-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.skel-cards .skel { height: 78px; border-radius: var(--radius-lg); }
.skel-panel { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.skel-panel .skel { height: 12px; margin-bottom: 14px; }
.skel-panel .skel:last-child { margin-bottom: 0; }
.skel-panel .skel.row { height: 30px; }
.skel-table td .skel { height: 12px; }

.error-state {
  display: flex; align-items: center; gap: 14px;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
}
.error-icon {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bad-soft); color: var(--bad);
  font-size: 18px; font-weight: 600;
}
.error-state b { display: block; font-size: 14px; }
.error-state p { margin-top: 3px; font-size: 12px; color: var(--sub); word-break: break-all; }
.error-state .btn { margin-left: auto; }

/* ---------- 弹窗 ---------- */
body.modal-open { overflow: hidden; }
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(24, 34, 46, .34);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .24s ease;
}
.modal-mask.open { opacity: 1; }
.modal-mask.closing { opacity: 0; }
.modal {
  width: 540px; max-width: 100%; max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  transform: translateY(14px) scale(.96);
  transition: transform .5s var(--ease-spring), opacity .25s ease;
}
.modal-mask.open .modal { transform: none; }
.modal-mask.closing .modal { transform: translateY(8px) scale(.98); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 0; }
.modal-icon {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--p-soft); color: var(--p);
}
.modal-icon svg { width: 18px; height: 18px; }
.modal-icon.warn { background: var(--warn-soft); color: var(--warn); }
.modal-icon.danger { background: var(--bad-soft); color: var(--bad); }
.modal-icon.success { background: var(--ok-soft); color: var(--ok); }
.modal-heading { flex: 1; min-width: 0; padding-top: 2px; }
.modal-heading h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.modal-heading p { margin-top: 4px; color: var(--sub); font-size: 12px; line-height: 1.6; }
.modal-close {
  width: 28px; height: 28px; flex: none; margin-left: 4px;
  display: grid; place-items: center; border-radius: 8px;
  color: var(--hint); font-size: 18px; line-height: 1;
  transition: background-color .2s, color .2s;
}
.modal-close:hover { background: var(--fill); color: var(--text); }
.modal-body { padding: 16px 20px 4px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 20px 18px; }
.modal-label { font-size: 12px; color: var(--sub); }
.modal-note { font-size: 12px; color: var(--hint); line-height: 1.65; }
.detail-block {
  background: var(--fill); border-radius: 9px; padding: 11px 13px;
  font-size: 12px; color: var(--sub); white-space: pre-wrap; word-break: break-all;
}
.detail-block b { color: var(--text); }

/* ---------- 提示 ---------- */
.toast-root {
  position: fixed; top: 70px; right: 20px; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  width: max-content; max-width: min(400px, calc(100vw - 40px));
  pointer-events: none;
}
.toast-item {
  position: relative; display: flex; align-items: center; gap: 9px;
  max-width: 100%; padding: 9px 14px 10px 10px;
  border-radius: 11px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(31, 48, 64, .12);
  font-size: 13px;
  animation: toast-in .58s var(--ease-spring) both;
}
.toast-item.out { animation: toast-out .24s ease forwards; }
.toast-icon {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
}
.toast-icon svg { width: 12px; height: 12px; stroke-width: 2.2; }
.toast-item.success .toast-icon { background: var(--ok-soft); color: var(--ok); }
.toast-item.error .toast-icon { background: var(--bad-soft); color: var(--bad); }
.toast-item.info .toast-icon { background: var(--p-soft); color: var(--p); }
.toast-text { word-break: break-word; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; animation: toast-bar 2.6s linear forwards; }
.toast-item.success .toast-bar { background: var(--ok); }
.toast-item.error .toast-bar { background: var(--bad); }
.toast-item.info .toast-bar { background: var(--p); }

/* ---------- 动效 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes title-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes tab-in { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes row-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes detail-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(22px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(14px) scale(.98); } }
@keyframes toast-bar { from { width: 100%; } to { width: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .user-layout { grid-template-columns: 1fr; }
  .user-detail, .um-detail { position: static; }
  .user-rows, .um-rows { max-height: none; }
  .user-hero { flex-direction: column; align-items: stretch; gap: 16px; }
  .user-hero .hero-stats { width: 100%; }
  .user-hero .hero-stat { flex: 1; min-width: 0; }
}
@media (max-width: 760px) {
  .ingest-grid { grid-template-columns: 1fr; }
  .side { width: 68px; flex-basis: 68px; }
  .brand { justify-content: center; padding: 16px 6px 12px; }
  .brand div, .nav a span, .side-foot span { display: none; }
  .nav { padding: 2px 6px 10px; }
  .nav-group { display: none; }
  .nav a { justify-content: center; padding: 0; }
  .nav-ind { left: 6px; right: 6px; }
  .side-foot { justify-content: center; padding: 12px 6px; }
  .admin-chip { display: none; }
  .page-nav { padding: 8px 14px; gap: 8px; }
  .page-tab-select { padding: 0 8px; }
  .page-tab-select svg { display: none; }
  .view { padding: 6px 14px 32px; }
  .topbar { padding: 14px 14px 6px; }
  .topbar h1 { font-size: 18px; }
  .topbar span { display: none; }
  .user-toolbar { padding: 9px; }
  .search-box { min-width: 0; }
  .status-tabs { order: 3; width: 100%; justify-content: space-between; }
  .um-chips { display: none; }
  .user-hero { padding: 12px 14px; }
  .user-hero h2 { font-size: 16px; }
  .user-hero .hero-stat { padding: 6px 9px; }
  .user-layout { margin-top: 10px; }
  .user-hero { padding: 16px; }
  .user-hero h2 { font-size: 18px; }
  .skel-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { border-radius: 14px; }
  .modal-head { padding: 16px 16px 0; }
  .modal-body { padding: 14px 16px 2px; }
  .modal-foot { padding: 14px 16px 16px; }
  .toast-root { top: auto; bottom: 18px; left: 12px; right: 12px; width: auto; align-items: stretch; max-width: none; }
}

.top-account { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.top-account-name { font-size: 12px; color: var(--sub); }
.top-logout {
  height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--sub); font-size: 12px;
  transition: color .2s, border-color .2s, background-color .2s;
}
.top-logout:hover { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }

.btn.tiny { height: 28px; padding: 0 10px; font-size: 12px; font-weight: 500; }

/* 后台图片：缩略图 + 点击看大图 */
.admin-images { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.admin-image {
  width: 104px; height: 104px; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--surface); cursor: zoom-in;
  transition: border-color .2s, transform .2s;
}
.admin-image:hover { border-color: var(--blue); transform: translateY(-1px); }
.admin-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-images.compact { gap: 6px; margin-top: 0; }
.admin-images.compact .admin-image { width: 44px; height: 44px; border-radius: 8px; }
.admin-lightbox {
  position: fixed; inset: 0; z-index: 3000; padding: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .72); opacity: 0; transition: opacity .18s;
}
.admin-lightbox.open { opacity: 1; }
.admin-lightbox img {
  max-width: min(92vw, 1200px); max-height: 88vh;
  border-radius: 12px; background: #fff; box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
.admin-lightbox-close {
  position: absolute; top: 18px; right: 22px; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16);
  color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.admin-lightbox-close:hover { background: rgba(255, 255, 255, .28); }
.modal-body textarea.input { min-height: 84px; resize: vertical; }

/* 配置分组 */
.cfg-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); cursor: pointer; }
.cfg-section { padding-top: 8px; }
.cfg-section h3 { font-size: 13px; font-weight: 600; color: var(--sub); margin: 6px 0 2px; }
.cfg-desc { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.cfg-example { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------- 代录发布表单 ---------- */
.modal.wide { width: 880px; }
.form-section { margin-top: 18px; }
.form-section > h4 {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px;
}
.form-section > h4::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span2 { grid-column: 1 / -1; }
.cand-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cand-item {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.cand-item:hover { border-color: var(--line-strong); background: var(--hover); }
.cand-item input { margin-top: 3px; }
.cand-item .meta { margin-top: 2px; color: var(--hint); font-size: 12px; }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
}
.ai-note { margin-top: 10px; padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.6; }
.ai-note.ok { background: var(--ok-soft); color: var(--ok); }
.ai-note.warn { background: var(--warn-soft); color: var(--warn); }
.ai-issues { margin: 6px 0 0 18px; padding: 0; }
.ai-issues li { margin-top: 2px; }

/* 标签选择与省市区级联 */
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; max-height: 150px; overflow-y: auto; padding: 4px 2px; }
.tag-chip {
  height: 28px; padding: 0 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--sub);
  font-size: 12px; transition: background-color .2s, border-color .2s, color .2s;
}
.tag-chip:hover { border-color: var(--line-strong); color: var(--text); }
.tag-chip.on { background: var(--p-soft); border-color: transparent; color: var(--p); }
.region-cascade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.venue-line { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.coord-line { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin-top: 6px; }

/* UI 文案位置预览 */
.copy-preview{margin-top:12px;padding:12px;border:1px dashed #d8e2f0;border-radius:12px;background:#f8fbff}
.cp-label{font-size:12px;color:#7b8a9e;margin-bottom:8px}
.cp-phones{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.cp-phone{background:#fff;border:1px solid #e6eef8;border-radius:12px;padding:10px;font-size:12px;color:#334}
.cp-cap{font-size:11px;color:#7b8a9e;margin-bottom:6px}
.cp-nav{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.cp-banner{background:linear-gradient(160deg,#eaf3ff,#f7fbff);border-radius:8px;padding:8px;margin-bottom:6px}
.cp-title{font-weight:600;font-size:13px}
.cp-chip{display:inline-block;margin-top:4px;padding:1px 8px;border-radius:10px;background:#fff;color:#2e7cf6;font-size:11px}
.cp-empty{color:#8a97a8;font-size:11px;line-height:1.4}
.cp-bubble{background:#eef5ff;border-radius:8px;padding:8px;line-height:1.5}
.cp-row{display:flex;justify-content:space-between}
