:root {
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", system-ui, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", "Consolas", "Liberation Mono", ui-monospace, monospace;
  --bg: #f0f2f5;
  --surface: #fff;
  --line: #e5e6eb;
  --line-2: #c9cdd4;
  --text: #1d2129;
  --text-2: #4e5969;
  --text-3: #86909c;
  --primary: #165dff;
  --primary-hover: #0e42d2;
  --primary-bg: #e8f3ff;
  --success: #00b42a;
  --success-bg: #e8ffea;
  --warning: #ff7d00;
  --warning-bg: #fff7e8;
  --danger: #f53f3f;
  --danger-bg: #ffece8;
  --sidebar: #0b1324;
  --sidebar-2: #111a2e;
  --sidebar-line: rgba(255, 255, 255, .06);
  --sidebar-text: #86909c;
  --header-h: 56px;
  --sidebar-w: 232px;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 12px rgba(0, 0, 0, .04);
  --shadow-lg: 0 8px 28px rgba(15, 23, 42, .16);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.modal-open, body.nav-open { overflow: hidden; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
button, a.btn, .nav-item, .menu-btn { cursor: pointer; touch-action: manipulation; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--primary); color: #fff; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost {
  background: #fff; color: var(--text); border-color: var(--line-2);
}
.btn.ghost:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-bg); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #cb272d; }
.btn.text { background: transparent; color: var(--primary); height: 28px; padding: 0 8px; }
.btn.text:hover { background: var(--primary-bg); }
.btn.text.danger { color: var(--danger); }
.btn.text.danger:hover { background: var(--danger-bg); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; height: 40px; }

/* Tags */
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; vertical-align: middle;
}
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.tag-ok { background: var(--success-bg); color: #2a9a43; }
.tag-live { background: #e8f3ff; color: #0e42d2; }
.tag-off { background: #f2f3f5; color: #86909c; }
.tag-warn { background: var(--warning-bg); color: #d25f00; }
.tag-ban { background: var(--danger-bg); color: #cb272d; }

/* Alerts */
.alert {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px;
}
.alert-ok { background: var(--success-bg); color: #2a9a43; }
.alert-err { background: var(--danger-bg); color: #cb272d; }

/* ========== Login ========== */
.login-page {
  display: grid; grid-template-columns: minmax(420px, 1.05fr) 1fr; min-height: 100vh; min-height: 100dvh;
}
.login-aside {
  position: relative; overflow: hidden; background: #0b1324; color: #fff;
  padding: 48px 56px; display: flex; flex-direction: column; justify-content: center;
}
.login-aside::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at 20% 20%, #000 30%, transparent 75%);
}
.login-aside::after {
  content: ""; position: absolute; width: 420px; height: 420px; right: -140px; bottom: -160px;
  background: radial-gradient(circle, rgba(22,93,255,.45), transparent 68%); pointer-events: none;
}
.login-aside-inner { position: relative; z-index: 1; }
.login-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #7aa2ff; font-weight: 600;
}
.login-kicker .mark {
  width: 22px; height: 22px; border-radius: 5px; background: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
}
.login-aside h1 { margin: 18px 0 10px; font-size: 32px; font-weight: 650; letter-spacing: .02em; }
.login-aside p { margin: 0; max-width: 420px; color: #9aa4b2; font-size: 14px; line-height: 1.7; }
.login-points { position: relative; z-index: 1; display: grid; gap: 14px; max-width: 380px; }
.login-point { display: flex; gap: 12px; align-items: flex-start; color: #c9cdd4; font-size: 13px; }
.login-point strong { display: block; color: #fff; font-weight: 600; margin-bottom: 2px; }
.login-point i {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 6px;
  background: rgba(22,93,255,.18); color: #7aa2ff;
  display: flex; align-items: center; justify-content: center;
}
.login-main {
  display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #f7f8fa;
}
.login-card { width: 400px; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 36px 32px 28px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 6px; font-size: 20px; font-weight: 650; }
.login-card .sub { margin: 0 0 24px; color: var(--text-3); font-size: 13px; }
.login-field { margin-bottom: 16px; }
.login-foot { margin-top: 18px; text-align: center; color: var(--text-3); font-size: 12px; }

/* ========== App shell ========== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; height: 100dvh; flex-shrink: 0; z-index: 30;
}
.brand {
  height: var(--header-h); display: flex; align-items: center; gap: 10px;
  padding: 0 18px; border-bottom: 1px solid var(--sidebar-line);
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px; background: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-name { font-size: 14px; font-weight: 650; letter-spacing: .04em; }
.brand-name small { display: block; font-size: 11px; font-weight: 500; color: var(--sidebar-text); letter-spacing: .08em; text-transform: uppercase; margin-top: 1px; }
.nav { padding: 12px 10px; flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.nav-label {
  padding: 8px 10px 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: #5c6773; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
  border-radius: 6px; color: var(--sidebar-text); font-size: 14px; margin-bottom: 2px;
}
.nav-item svg { flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #e5e6eb; }
.nav-item.active { background: rgba(22,93,255,.18); color: #fff; }
.nav-item.active svg { opacity: 1; color: #7aa2ff; }
.side-foot {
  padding: 12px 10px 16px; border-top: 1px solid var(--sidebar-line);
}
.who {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px;
}
.who-ava {
  width: 32px; height: 32px; border-radius: 50%; background: #1d4ed8;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.who-meta { min-width: 0; }
.who-name { font-size: 13px; font-weight: 600; color: #fff; }
.who-role { font-size: 12px; color: var(--sidebar-text); }
.logout {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border-radius: 6px; color: var(--sidebar-text); font-size: 13px;
}
.logout:hover { background: rgba(255,255,255,.05); color: #fff; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--header-h); background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumb-root { color: var(--text-3); font-size: 13px; }
.crumb-sep { color: #c9cdd4; }
.crumb h1 { margin: 0; font-size: 16px; font-weight: 650; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.clock { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.menu-btn {
  display: none; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  align-items: center; justify-content: center;
}
.content { padding: 20px 24px 40px; }

.page-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-desc { margin: 0; color: var(--text-3); font-size: 13px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.search {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); min-width: 240px;
}
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22,93,255,.15); }
.search input {
  border: 0; outline: none; background: transparent; width: 100%; font-size: 13px; color: var(--text);
}
.search svg { color: var(--text-3); flex-shrink: 0; }
select.filter-select {
  width: auto; min-width: 108px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: #fff; font-size: 13px; color: var(--text);
}
.tpl-pick { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tpl-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); cursor: pointer; }

/* KPI */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px;
}
.kpi-label { font-size: 13px; color: var(--text-3); }
.kpi-value {
  margin-top: 6px; font-size: 26px; font-weight: 650; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.kpi-value.accent { color: var(--primary); }
.kpi-value.ok { color: #2a9a43; }

/* Panel / table */
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; min-width: 1080px; }
table.data th, table.data td {
  text-align: left; padding: 12px 16px; vertical-align: middle;
}
table.data th {
  background: #f7f8fa; color: var(--text-3); font-size: 12px; font-weight: 500;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { border-bottom: 1px solid var(--line); background: #fff; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #f7f8fa; }
.cell-app { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-app .meta { min-width: 0; flex: 1; overflow: hidden; }
.meta .name { display: block; font-weight: 600; font-size: 14px; }
.meta .id { display: block; margin-top: 2px; color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.cell-app .name, .cell-app .id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-remark { max-width: 220px; min-width: 120px; }
.cell-remark .rm-line {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; line-height: 1.45; color: var(--text-2);
}
.cell-remark .rm-line + .rm-line { margin-top: 2px; }
.cell-remark .rm-k {
  display: inline-block; margin-right: 6px; color: var(--text-3); font-size: 11px;
}
.cell-remark .rm-admin { color: #8a6d3b; }
.cell-remark .rm-admin .rm-k { color: #b08a4a; }
.cell-remark .rm-dash { color: var(--text-3); font-size: 12px; }
.thumb {
  width: 40px; height: 40px; min-width: 40px; min-height: 40px;
  border-radius: 6px; border: 1px solid var(--line);
  background: #f7f8fa; display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; cursor: default; box-sizing: border-box;
  padding: 0; margin: 0; appearance: none; -webkit-appearance: none; font: inherit;
}
.thumb[data-preview], .tag-preview { cursor: pointer; }
.tag-preview:hover { box-shadow: 0 0 0 2px rgba(0, 180, 42, .22); }
.thumb img { width: 100%; height: 100%; max-width: none; object-fit: contain; display: block; background: #fff; }
.thumb-ph {
  color: var(--text-3); font-size: 11px; line-height: 1; font-weight: 500;
  letter-spacing: .04em; white-space: nowrap; padding: 0;
}
.qr-hover {
  position: fixed; z-index: 70; padding: 10px 10px 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.qr-hover img {
  display: block; width: auto; height: auto;
  max-width: 240px; max-height: 240px;
  object-fit: contain; background: #fff;
}
.qr-hover-cap { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 6px; }
.qr-hover.qr-lightbox {
  inset: 0; left: 0 !important; top: 0 !important; width: auto; height: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .58); border: 0; border-radius: 0; box-shadow: none;
  pointer-events: auto; padding: 24px 16px; z-index: 90;
}
.qr-hover.qr-lightbox img {
  width: min(78vw, 300px); height: auto; max-width: min(78vw, 300px); max-height: min(70vh, 300px);
  padding: 14px; border-radius: 12px; box-shadow: var(--shadow-lg);
}
.qr-hover.qr-lightbox .qr-hover-cap { color: #fff; margin-top: 10px; }
.ops { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.th-check, .td-check { width: 36px; padding-right: 0 !important; }
.th-check input, .td-check input { width: 16px; height: 16px; margin: 0; vertical-align: middle; cursor: pointer; }
.assign-hint { margin: 0 0 12px; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.status-cell { font-size: 12px; color: var(--text-3); }
.status-cell .tag { margin-right: 6px; }
.stats-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; font: inherit;
}
.stats-btn .n { font-weight: 650; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: -.02em; }
.stats-btn .s { font-size: 12px; color: var(--text-3); }
.stats-btn:hover .n { color: var(--primary); }
.visit-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.visit-kpis.kpis-4 { grid-template-columns: 1fr 1fr; }
.visit-kpis .kpi { padding: 12px 14px; }
.visit-ip-cap { font-size: 12px; color: var(--text-3); margin: 0 0 8px; }
.visit-ip-empty { color: var(--text-3); font-size: 13px; }
.visit-ip-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.visit-ip-table th {
  text-align: left; color: var(--text-3); font-weight: 500; padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.visit-ip-table td {
  padding: 8px; border-bottom: 1px solid var(--line); font-family: var(--mono);
  color: var(--text-2); white-space: nowrap;
}
.visit-ip-table td:nth-child(2) { font-family: inherit; font-variant-numeric: tabular-nums; }
#visitIpsWrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.empty {
  text-align: center; padding: 64px 24px; color: var(--text-3);
}
.empty h3 { margin: 12px 0 6px; color: var(--text); font-size: 15px; font-weight: 600; }
.empty p { margin: 0 0 16px; font-size: 13px; }

/* Forms */
label.field, .field-label {
  display: block; font-size: 13px; color: var(--text-2); margin: 0 0 6px; font-weight: 500;
}
.field { margin-bottom: 16px; }
input[type=text], input[type=password], input[type=email], input[type=tel], textarea, select {
  width: 100%; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff;
  font-size: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input[type=time] {
  height: 36px; width: 148px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff;
  font-size: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 8px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22,93,255,.15);
}
input[readonly] { background: #f7f8fa; color: var(--text-2); }
.hint { display: block; margin-top: 6px; font-size: 12px; color: var(--text-3); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel-pad { padding: 18px 20px; margin-bottom: 16px; }
.time-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.time-row input[type=time] { flex: 0 0 148px; width: 148px; max-width: 148px; }
.time-row .to { color: var(--text-3); font-size: 13px; }
.section { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.section-title { font-size: 13px; font-weight: 650; margin: 0 0 12px; color: var(--text); }

.switch {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 14px; position: relative;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 36px; height: 20px; border-radius: 999px; background: #c9cdd4; position: relative; transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: transform .15s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }

.uploader {
  display: block; border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 16px; text-align: center; color: var(--text-3); font-size: 13px; background: #fafbfc; cursor: pointer;
}
.uploader:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.uploader input { display: none; }
.preview { position: relative; display: inline-block; margin-top: 10px; }
.preview img { width: auto; height: auto; max-width: 160px; max-height: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: block; }
.preview .x {
  position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: var(--danger); color: #fff; font-size: 12px; line-height: 20px; text-align: center; padding: 0;
}
.compose-row { display: flex; gap: 20px; align-items: flex-start; }
.compose-sliders { flex: 1; min-width: 0; }
.range-line {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 10px;
}
.range-line input[type="range"] { flex: 1; min-width: 0; }
.range-line span { width: 28px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-3); }
.range-cap { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 2px 0 8px; }
.range-cap.second { margin-top: 12px; }
.compose-phone {
  flex-shrink: 0;
  width: 196px;
  padding: 10px;
  border-radius: 28px;
  background: #111;
  box-shadow:
    0 0 0 1px #2a2a2a,
    0 12px 28px rgba(15, 23, 42, .18);
  box-sizing: border-box;
  position: sticky;
  top: 72px;
}
.compose-screen {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,.06);
}
.compose-status {
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: #111;
  background: #fff;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .01em;
  box-sizing: border-box;
}
.compose-status-time { padding-left: 1px; }
.compose-status-icons {
  display: inline-flex; align-items: center; gap: 3px;
}
.csi-signal, .csi-wifi, .csi-battery {
  display: inline-block; background: #111; position: relative;
}
.csi-signal {
  width: 9px; height: 7px;
  background:
    linear-gradient(#111,#111) 0 5px / 1.5px 2px no-repeat,
    linear-gradient(#111,#111) 2.5px 3.5px / 1.5px 3.5px no-repeat,
    linear-gradient(#111,#111) 5px 2px / 1.5px 5px no-repeat,
    linear-gradient(#111,#111) 7.5px 0 / 1.5px 7px no-repeat;
}
.csi-wifi {
  width: 8px; height: 6px; border: 1.2px solid #111; border-top: 0; border-radius: 0 0 8px 8px;
  background: transparent; transform: rotate(180deg) translateY(-1px);
}
.csi-wifi::after {
  content: ''; position: absolute; left: 50%; top: 2px; width: 2px; height: 2px;
  margin-left: -1px; border-radius: 50%; background: #111;
}
.csi-battery {
  width: 12px; height: 6px; border: 1px solid #111; border-radius: 1.5px;
  background: linear-gradient(#111,#111) 1px 1px / 7px 2.5px no-repeat;
  box-sizing: border-box;
}
.csi-battery::after {
  content: ''; position: absolute; right: -2.5px; top: 1.2px;
  width: 1.5px; height: 2.5px; border-radius: 0 1px 1px 0; background: #111;
}
.compose-nav {
  position: relative; height: 32px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 42px 0 8px; box-sizing: border-box;
  border-bottom: 0.5px solid rgba(0,0,0,.08);
}
.compose-nav-title {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: #111; line-height: 1.2; text-align: center;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "PingFang SC", "Microsoft YaHei", sans-serif;
  text-shadow: none;
  -webkit-text-stroke: 0;
}
.compose-nav-title:empty::after {
  content: '小程序标题'; color: #9ca3af; font-weight: 500;
}
.compose-nav-capsule {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 15px; border: 0.5px solid rgba(0,0,0,.14);
  border-radius: 999px; background: rgba(255,255,255,.92);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5px; box-sizing: border-box;
}
.cnc-dots {
  width: 9px; height: 8px; border-radius: 50%;
  background:
    radial-gradient(circle at 2px 4px, #3f3f46 1.15px, transparent 1.25px),
    radial-gradient(circle at 7px 4px, #3f3f46 1.15px, transparent 1.25px);
}
.cnc-split {
  width: 1px; height: 8px; background: rgba(0,0,0,.14);
}
.cnc-close {
  width: 8px; height: 8px; border: 1.15px solid #3f3f46; border-radius: 50%;
  box-sizing: border-box; position: relative;
}
.cnc-close::before, .cnc-close::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 4.5px; height: 1px; background: #3f3f46; border-radius: 1px;
}
.cnc-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.cnc-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.compose-stage {
  position: relative; width: 100%;
  aspect-ratio: 9 / 19.5;
  height: auto;
  min-height: 0;
  background: #f3f4f6;
  overflow: hidden;
}
.compose-home {
  height: 16px; background: #fff;
  position: relative;
}
.compose-home::after {
  content: ''; position: absolute; left: 50%; bottom: 5px;
  width: 42px; height: 3px; margin-left: -21px;
  border-radius: 999px; background: #111;
}
.compose-stage img#composeBg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #111;
}
.compose-stage img.compose-mark {
  position: absolute; height: auto; max-width: none; transform: translate(-50%, -50%);
  object-fit: contain; pointer-events: none; z-index: 2;
}
.compose-stage img#composeCode {
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  border-radius: 4px;
}
.compose-stage img#composeCode2 {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .85);
  border-radius: 4px;
  z-index: 3;
}
.compose-title, .compose-note {
  position: absolute; z-index: 5; text-align: center;
  color: #fff; pointer-events: none; line-height: 1.15;
  /* 与真机一致：单行不换行；不要 width:90% 把字挤折行 */
  white-space: nowrap; word-break: keep-all; overflow: visible;
  transform: translate(-50%, -50%); width: max-content; max-width: none;
  font-weight: 700; letter-spacing: 0.01em;
  display: block;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.compose-title span, .compose-note span {
  display: inline;
  vertical-align: middle;
  line-height: 1;
  white-space: nowrap;
}
.compose-title { top: 8%; left: 50%; font-size: 12px; }
.compose-note { top: 88%; left: 50%; font-size: 11px; color: #fff0b8; }
.compose-title[hidden], .compose-note[hidden] { display: none !important; }
@media (max-width: 860px) {
  .compose-row { flex-direction: column; }
  .compose-phone { position: static; width: 180px; margin: 0 auto; }
}
.shot-text-input {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.shot-text-input::placeholder { color: var(--text-3); font-weight: 500; }
.text-style-row {
  display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 8px; align-items: center;
  font-size: 12px; color: var(--text-2);
}
.text-style-row label { display: inline-flex; align-items: center; gap: 6px; }
.text-style-row input[type="color"] {
  width: 28px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
.text-style-row input[type="number"] {
  width: 52px; height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px;
}
.compose-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 12px; text-align: center; font-size: 12px; color: var(--text-3); line-height: 1.4;
}
.compose-empty[hidden] { display: none; }

/* Modal */
.mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: none; align-items: center; justify-content: center; z-index: 80; padding: 16px;
}
.mask.show { display: flex; }
.modal {
  width: 480px; max-width: 100%; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; max-height: min(90vh, 860px); overflow: hidden;
}
.modal > form {
  display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
}
.modal-lg { width: 640px; }
.modal-md { width: 560px; }
.modal-sm { width: 400px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 15px;
  flex-shrink: 0;
}
.modal-close {
  width: 28px; height: 28px; border: 0; background: transparent; border-radius: 6px; color: var(--text-3); font-size: 18px; line-height: 1;
}
.modal-close:hover { background: #f2f3f5; color: var(--text); }
.modal-body { padding: 16px 20px; overflow: auto; flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.modal-foot {
  padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid var(--line); background: #fff; flex-shrink: 0;
}
.modal-msg { padding: 8px 10px; border-radius: 6px; margin-bottom: 12px; font-size: 13px; }
.modal-msg.ok { background: var(--success-bg); color: #2a9a43; }
.modal-msg.err { background: var(--danger-bg); color: #cb272d; }

/* Toast */
.toast-wrap {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; min-width: 240px; max-width: 420px;
  background: #1d2129; color: #fff; padding: 10px 14px; border-radius: 8px;
  box-shadow: var(--shadow-lg); font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: #1a7f37; }
.toast.err { background: #cb272d; }

.scrim {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25;
}

@media (max-width: 960px) {
  .login-page { grid-template-columns: 1fr; }
  .login-aside {
    display: flex;
    padding: 28px 24px 22px;
    padding-top: max(28px, calc(16px + env(safe-area-inset-top)));
    min-height: 0;
    justify-content: flex-end;
  }
  .login-aside h1 { margin: 10px 0 4px; font-size: 24px; }
  .login-aside p { font-size: 13px; }
  .login-aside::after { width: 260px; height: 260px; right: -90px; bottom: -130px; }
  .login-main {
    flex: 1;
    align-items: flex-start;
    padding: 20px 16px 32px;
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }
  .login-card { width: 100%; max-width: 400px; padding: 24px 20px 20px; }
  .login-page input[type=text],
  .login-page input[type=password] {
    font-size: 16px;
    height: 44px;
  }
  .login-page .btn.block { height: 44px; font-size: 16px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: inline-flex; width: 40px; height: 40px; }
  .crumb-root, .crumb-sep { display: none; }
  .crumb h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar {
    position: fixed; left: 0; top: 0;
    width: min(var(--sidebar-w), calc(100vw - 56px));
    transform: translateX(-110%); transition: transform .2s;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
  }
  .sidebar.open { transform: none; box-shadow: 8px 0 28px rgba(0, 0, 0, .28); }
  .scrim.show { display: block; }
  .scrim { padding-top: env(safe-area-inset-top); }
  .grid2 { grid-template-columns: 1fr; }
  .content {
    padding: 14px 14px calc(28px + env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .topbar {
    padding: 0 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-h) + env(safe-area-inset-top));
  }
  .search { min-width: 0; flex: 1 1 180px; }
  .page-toolbar { align-items: stretch; }
  .toolbar-actions { width: 100%; }
  .copy-box { flex-wrap: wrap; }
  .time-row input[type=time] { flex: 1 1 120px; width: auto; max-width: none; }
  .mask { padding: 0; align-items: flex-end; }
  .modal, .modal-lg, .modal-md, .modal-sm {
    width: 100%; max-width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 12px 12px 0 0;
  }
  .modal-foot {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .toast { min-width: 0; max-width: calc(100vw - 32px); }
  .toast-wrap { top: calc(12px + env(safe-area-inset-top)); width: calc(100% - 24px); align-items: center; }
  .ops { flex-wrap: wrap; white-space: normal; gap: 4px; }
  .status-cell { word-break: break-word; }
  .cell-remark { max-width: none; min-width: 0; }
  .cell-remark .rm-line { white-space: normal; }
  .cell-app .name, .cell-app .id { white-space: normal; }
  .table-wrap { overflow: visible; }
  table.data { min-width: 0; }
  table.data thead { display: none; }
  table.data tbody tr {
    display: block;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
  }
  table.data tbody tr:hover td { background: transparent; }
  table.data th, table.data td {
    padding: 6px 0;
    border-bottom: 0;
    background: transparent;
  }
  table.data td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }
  table.data td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 72px;
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.5;
    padding-top: 2px;
  }
  table.data td.td-main {
    display: block;
    padding: 0 0 8px;
  }
  table.data td.td-check {
    justify-content: flex-start;
    padding-bottom: 8px;
  }
  table.data td.td-check::before { content: none; }
  table.data td.td-ops {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px dashed var(--line);
  }
  table.data td[colspan] { display: block; }
  table.data td[colspan]::before { content: none; }
  .visit-ip-table { min-width: 520px; }
  .modal-body img { max-width: 100%; height: auto; }
}
.copy-row { margin-bottom: 12px; }
.copy-box {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #f7f8fa; border: 1px solid var(--line); border-radius: var(--radius);
}
.copy-box code { flex: 1; font-family: var(--mono); font-size: 12px; color: var(--text-2); word-break: break-all; }

.flow-steps {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.flow-step {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 4px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text-2);
  font-size: 13px; text-decoration: none;
}
.flow-step .n {
  width: 22px; height: 22px; border-radius: 50%; background: #f2f3f5; color: var(--text-3);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 650;
}
.flow-step.on { border-color: var(--primary); color: var(--primary); background: #f4f8ff; }
.flow-step.on .n { background: var(--primary); color: #fff; }
.flow-line { width: 24px; height: 1px; background: var(--line); }
.flow-or { color: var(--text-3); font-size: 12px; padding: 0 2px; }
input[type=file] { max-width: 100%; }

@media (max-width: 720px) {
  .app { min-height: 100dvh; }
  input[type=text], input[type=password], input[type=email], input[type=tel],
  input[type=search], input[type=time], textarea, select {
    font-size: 16px;
    min-height: 40px;
    height: 40px;
  }
  textarea { height: auto; min-height: 88px; }
  .search { height: 40px; width: 100%; flex: 1 1 100%; }
  .search input { font-size: 16px; height: auto; min-height: 0; }
  select.filter-select { height: 40px; min-width: 0; flex: 1 1 calc(50% - 4px); }
  .btn { height: 40px; }
  .btn.sm, .btn.text, .btn.text.sm { height: 36px; padding: 0 10px; }
  .btn.block { height: 44px; }
  .page-desc { width: 100%; }
  .kpi-value { font-size: 22px; }
  .panel-pad { padding: 14px; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
}

@media (max-width: 560px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .clock { display: none; }
  .flow-line { display: none; }
}

@media (hover: none) {
  table.data tbody tr:hover td { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
