/* ===== 后台 — Apple Style 极简干净 ===== */
:root {
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --text: #1d1d1f;
  --muted: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --hairline: rgba(0, 0, 0, 0.06);
  --bg: #f5f5f7;
  --panel: #ffffff;
  --fill: #f2f2f7;
  --ok: #1f8a4c;
  --ok-bg: #e8f8ef;
  --err: #c62828;
  --err-bg: #fdeceb;
  --warn: #b25000;
  --warn-bg: #fff4e5;
  --radius: 16px;
  --radius-sm: 12px;
  --side-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'UKIJ Tor', -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.47;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea {
  font-family: inherit;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: none; opacity: 0.85; }
code {
  background: var(--fill);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
}

/* ===== layout ===== */
body.admin {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 var(--side-w);
  width: var(--side-w);
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  border-right: 1px solid var(--hairline);
  padding: 28px 14px 20px;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.side-brand {
  margin: 0 10px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.side-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.side-group { border: 0; margin: 0; padding: 0; }
.side-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  user-select: none;
}
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary:hover { background: rgba(0, 0, 0, 0.04); }
.side-group[open] > summary,
.side-group.active > summary {
  background: #fff;
  color: var(--text);
}
.sg-ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted);
}
.side-group.active > summary .sg-ico,
.side-group[open] > summary .sg-ico,
.side-link.on .sg-ico { color: var(--text); }
.sg-ico svg { width: 18px; height: 18px; }
.sg-label { flex: 1; min-width: 0; }
.sg-chev {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  margin-top: -3px;
  flex-shrink: 0;
  opacity: 0.7;
}
.side-group[open] > summary .sg-chev { transform: rotate(-135deg); margin-top: 3px; }
.side-subs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0 10px 12px;
}
.side-subs a {
  display: block;
  padding: 9px 12px 9px 22px;
  border-radius: 10px;
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.side-subs a:hover { background: rgba(0, 0, 0, 0.03); color: var(--text); }
.side-subs a.on {
  color: var(--blue);
  font-weight: 600;
  background: transparent;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}
.side-link:hover { background: rgba(0, 0, 0, 0.04); }
.side-link.on { background: #fff; }

.side-logout {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
}
.side-logout:hover { background: rgba(0, 0, 0, 0.04); color: var(--text); }
.side-logout svg { width: 18px; height: 18px; }

main {
  flex: 1;
  min-width: 0;
  padding: 32px 36px 56px;
  background: var(--bg);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hairline);
}
.page-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.page-head .sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.head-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.head-notify-wrap {
  position: relative;
}
.head-notify {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--hairline);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.head-notify svg { width: 20px; height: 20px; }
.head-notify.has { color: var(--warn); border-color: rgba(178, 80, 0, 0.25); background: var(--warn-bg); }
.head-notify-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e11d48;
  box-shadow: 0 0 0 2px #fff;
}
.head-notify-n {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.head-notify-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 280px;
  max-width: min(280px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(20, 40, 60, 0.14);
  z-index: 80;
  padding: 8px;
  overflow: hidden;
}
.head-notify-panel[hidden] { display: none !important; }
.head-notify-hd {
  padding: 10px 12px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.head-notify-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.head-notify-item[hidden],
.head-notify-empty[hidden] { display: none !important; }
.head-notify-item:hover { background: var(--fill); }
.head-notify-item em {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.head-notify-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.nav-badge {
  margin-inline-start: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  display: inline-block;
  vertical-align: middle;
}
.top-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--warn-bg);
  border: 1px solid rgba(178, 80, 0, 0.18);
  color: var(--warn);
}
.top-alert[hidden] { display: none !important; }
.top-alert-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-size: 14px;
}
.top-alert-body strong { font-weight: 700; }
.top-alert-body a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--warn);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(178, 80, 0, 0.2);
}
.top-alert-x {
  border: 0;
  background: transparent;
  color: var(--warn);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
}
.top-alert-x:hover { opacity: 1; }

.login-lang { margin-bottom: 14px; justify-content: flex-end; width: 100%; }

/* ===== login ===== */
body.guest { background: var(--bg); }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 20px;
  padding: 40px 32px 28px;
}
.login h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.login > p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.login label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
}
.login input {
  width: 100%;
  border: 0;
  background: var(--fill);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  outline: none;
}
.login input:focus {
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
  background: #fff;
  outline: 1px solid var(--blue);
}
.login button {
  width: 100%;
  margin-top: 20px;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: var(--blue);
}
.login button:hover { background: var(--blue-hover); }
.login small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 980px;
  padding: 4px 6px 4px 12px;
}
.lang-switch span { color: var(--muted); font-size: 12px; font-weight: 500; }
.lang-switch a {
  padding: 5px 12px;
  border-radius: 980px;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-decoration: none;
}
.lang-switch a.on {
  background: var(--blue);
  color: #fff;
}

/* ===== alerts / tips ===== */
.alert {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-weight: 600;
  border-left: 4px solid transparent;
}
.alert.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-left-color: var(--ok);
}
.alert.err {
  background: var(--err-bg);
  color: var(--err);
  border-left-color: var(--err);
}
.tip {
  background: var(--fill);
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--muted);
  margin: 0 0 14px;
}
.tip a { font-weight: 600; }

/* ===== dashboard ===== */
.hero-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  color: var(--text);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 14px;
}
.hero-glow {
  position: absolute;
  right: -40px;
  top: -48px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95) 0%, transparent 42%),
    radial-gradient(circle at 60% 55%, rgba(100, 160, 255, 0.45) 0%, transparent 60%),
    radial-gradient(circle at 40% 70%, rgba(255, 180, 120, 0.35) 0%, transparent 55%);
  filter: blur(2px);
  pointer-events: none;
  opacity: 0.9;
}
.hero-body { position: relative; z-index: 1; max-width: 72%; }
.hero-k {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.hero-card h2 {
  margin: 8px 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.hero-card p { margin: 0; color: var(--muted); font-size: 14px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric {
  background: #fff;
  border-radius: 16px;
  padding: 20px 22px;
  min-height: 112px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.metric b {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.metric em {
  display: block;
  margin-top: 10px;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.metric em.up { color: var(--ok); }
.metric em.down { color: var(--err); }
@media (max-width: 900px) {
  .metrics { grid-template-columns: 1fr; }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}
.card span { font-size: 13px; font-weight: 500; color: var(--muted); }
.card b {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}
.card.tone-blue,
.card.tone-sky,
.card.tone-teal,
.card.tone-green,
.card.tone-coral,
.card.tone-orange,
.card.tone-amber {
  background: #fff;
  color: var(--text);
}
.card.tone-blue span,
.card.tone-sky span,
.card.tone-teal span { color: var(--muted); }
.card.tone-blue b,
.card.tone-sky b,
.card.tone-teal b,
.card.tone-green b,
.card.tone-coral b,
.card.tone-orange b,
.card.tone-amber b { color: var(--text); }

.dash-video-viz {
  margin: 0 0 16px;
  padding: 20px 22px;
  background: #fff;
  border-radius: 16px;
}
.dash-video-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}
.dash-video-hd h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  border: 0;
  padding: 0;
}
.dash-video-hd .tip { margin: 0; }
.dash-video-hd .btn {
  flex-shrink: 0;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  background: #f3f4f6;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.dash-viz-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 1.4fr;
  gap: 16px;
  align-items: center;
}
.viz-ring-wrap { text-align: center; }
.viz-ring-wrap > p {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.viz-ring {
  --p: 0;
  --c: #2563eb;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #eef2f7 0);
  display: grid;
  place-items: center;
}
.viz-ring-inner {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.viz-ring-inner b {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}
.viz-ring-inner span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.viz-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0;
}
.viz-bar-row { display: flex; flex-direction: column; gap: 6px; }
.viz-bar-lab {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.viz-bar-lab em {
  font-style: normal;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}
.viz-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.viz-bar-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 0;
}
@media (max-width: 1100px) {
  .dash-viz-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .viz-bars { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .dash-viz-grid { grid-template-columns: 1fr; }
  .dash-video-hd { flex-direction: column; }
}

.dash-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.dash-panel {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
}
.dash-panel h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.dash-panel .empty { color: var(--muted); font-size: 13px; margin: 0; }
.dash-panel ul { list-style: none; margin: 0; padding: 0; }
.dash-panel li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
}
.dash-panel li:last-child { border-bottom: 0; }

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
}
.quick-links a {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
}
.quick-links a:hover { background: #e8e8ed; }
.quick-links a.hot {
  background: var(--warn-bg);
  color: var(--warn);
}

.dash, .dash-orb, .dash-col, .activity, .glass, .float-card, .engage, .forecast, .hbars { display: none; }

/* ===== forms / tables ===== */
.form, .grid, .panel {
  background: #fff;
  padding: 24px 26px;
  border-radius: 16px;
  margin-bottom: 14px;
}
.app-form .span-all { grid-column: 1 / -1; width: 100%; }
.grid.app-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  align-items: start;
}
.app-form > h3,
.app-form > .tip,
.app-form > .bi-pair,
.app-form > .form-actions,
.app-form > .chk-row,
.app-form > details,
.app-form > .row2,
.app-form > .img-row {
  grid-column: 1 / -1;
}
.app-form .field {
  min-width: 0;
}
.app-form .field.span-all {
  grid-column: 1 / -1;
}
.app-form .field label {
  margin-top: 0;
}
.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.img-up {
  background: var(--fill);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 0;
}
.img-up .shot-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 14px;
}
.img-up .img-clear {
  margin: 8px 0 !important;
}
.img-row .img-up:first-child .shot-preview img {
  border-radius: 16px;
}
.flags-row {
  padding: 8px 0 4px;
}
.app-more {
  background: var(--fill);
  border-radius: 14px;
  padding: 4px 14px 14px;
}
.app-more > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 0;
  list-style: none;
  color: var(--text);
}
.app-more > summary::-webkit-details-marker { display: none; }
.app-more > summary::before {
  content: '+';
  display: inline-block;
  width: 1.2em;
  color: var(--blue);
  font-weight: 700;
}
.app-more[open] > summary::before { content: '−'; }
.app-more-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding-top: 4px;
}
.app-more-body > .span-all,
.app-more-body > h4,
.app-more-body > .tip,
.app-more-body > .bi-pair,
.app-more-body > .shot-preview,
.app-more-body > .field.span-all {
  grid-column: 1 / -1;
}
.app-more-body h4 {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.shot-keep {
  position: relative;
  display: block !important;
  margin: 0 !important;
  cursor: pointer;
}
.shot-keep input {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  width: auto;
}
.shot-keep img {
  width: 72px;
  height: 128px;
  object-fit: cover;
  border-radius: 10px;
  background: #fff;
  display: block;
}
.shot-edit { margin-bottom: 8px; }
.card-soft {
  background: #fff;
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 14px;
}
.apps-list-panel { padding-top: 8px; }
.apps-list-head h3 {
  margin: 0 0 12px;
  border: 0;
  padding: 0;
}
.apps-list-head small {
  color: var(--muted);
  font-weight: 500;
}
.apps-table .td-icon { width: 56px; }
.app-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--fill);
  display: block;
}
.app-thumb.empty {
  border: 1px dashed var(--hairline);
}
.muted-id {
  font-size: 11px;
  color: var(--muted);
  background: transparent;
}
.td-actions {
  white-space: nowrap;
}
.td-actions a { margin-right: 8px; }
.apps-table tr.is-editing {
  background: #eaf2ff;
}
.empty-row {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px !important;
}
.form-actions.bottom {
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 28%, #fff 100%);
}
@media (max-width: 900px) {
  .grid.app-form,
  .app-more-body,
  .row2 { grid-template-columns: 1fr; }
}
.bi-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
.bi-col {
  background: var(--fill);
  border-radius: 12px;
  padding: 14px;
}
.bi-head {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text);
}
.bi-col label { margin-top: 10px; }
.app-form textarea.tall { min-height: 140px; }
.app-form .span-all.row3,
.app-form .row3.span-all {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}
@media (max-width: 900px) {
  .bi-pair { grid-template-columns: 1fr; }
  .app-form .row3.span-all { grid-template-columns: 1fr; }
  .dash-panels { grid-template-columns: 1fr; }
}

.form h3, main h3, .grid h3 {
  margin: 22px 0 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  letter-spacing: -0.01em;
}
.form h3:first-child, .grid h3:first-child { margin-top: 0; }
.form label, .grid label {
  display: block;
  margin: 12px 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.row3 > div { min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 18px;
}
.form-actions.top {
  margin-top: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline, #eef1f6);
}
.form-actions.bottom {
  margin-top: 22px;
  margin-bottom: 0;
  padding-top: 16px;
  border-top: 1px solid var(--hairline, #eef1f6);
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(245,246,248,0) 0%, #f5f6f8 28%, #f5f6f8 100%);
  padding-bottom: 12px;
  z-index: 5;
}
.form-actions button {
  min-width: 120px;
}
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }

input[type="text"],
input[type="password"],
input[type="number"],
input:not([type]),
textarea,
select {
  width: 100%;
  border: 0;
  background: var(--fill);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  color: var(--text);
  outline: none;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
  outline: 1px solid var(--blue);
}
.chk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}
.chk {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 8px 12px 8px 0 !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  white-space: nowrap;
}
.chk input { width: auto; }
#noticeUserSelect {
  max-height: 220px;
}

.tabbar-switch {
  margin: 0 0 18px;
  padding: 18px 20px;
  background: #fff;
  border-radius: 16px;
}
.tabbar-switch-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.tabbar-switch-hd h3 { margin: 0 0 4px; font-size: 16px; }
.tabbar-switch-hd .tip { margin: 0; }
.tabbar-switch-hd button {
  flex: none;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.tabbar-switch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.tab-sw {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 !important;
  padding: 14px 12px;
  border-radius: 12px;
  background: var(--fill);
  border: 1px solid var(--hairline);
  cursor: pointer;
}
.tab-sw span { font-size: 13px; font-weight: 700; color: var(--text); }
.tab-sw input { width: 18px; height: 18px; }
.tab-sw.on { background: #e8f8ef; border-color: rgba(31, 138, 76, 0.2); }
.tab-sw.off { opacity: 0.7; }
.tab-sw.locked {
  cursor: default;
  background: #eef2f7;
}
.tab-sw.locked em {
  font-size: 12px;
  font-style: normal;
  color: var(--ok);
  font-weight: 700;
}
@media (max-width: 900px) {
  .tabbar-switch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 14px;
  margin: 8px 0 16px;
  background: var(--fill);
  border-radius: 12px;
}
.feat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 14px;
  margin: 8px 0 16px;
  background: var(--fill);
  border-radius: 12px;
}
.feat-grid .chk { margin: 4px 10px 4px 0 !important; }
.feat-map {
  margin-top: 18px;
  padding: 20px;
  background: #fff;
  border-radius: 16px;
}
.feat-grp {
  margin: 14px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.feat-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.feat-map-item {
  display: block;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--fill);
  text-decoration: none;
  color: var(--text);
}
.feat-map-item:hover { background: #e8e8ed; }
.feat-map-item.off { opacity: 0.45; }
.feat-map-item b { display: block; font-size: 13px; font-weight: 700; }
.feat-map-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.feat-map-item em {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 12px;
  color: var(--blue);
  font-weight: 600;
}

.shot-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.shot-preview a { display: block; }
.shot-preview img {
  width: 84px;
  height: 148px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--fill);
}

button, .btn {
  border: 0;
  border-radius: 12px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--blue-hover); }
button.danger, .btn.danger {
  background: var(--err-bg);
  color: var(--err);
}
button.ghost, .btn.ghost {
  background: var(--fill);
  color: var(--text);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  align-items: center;
}
.filters a {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--line, #e5e5ea);
}
.filters a:hover { color: var(--text); background: var(--fill); }
.filters a.on {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
.vip-quick button.ghost {
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 0;
}
td.muted, .muted { color: var(--muted); }

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}
th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}
th {
  background: #fff;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}
tr:last-child td { border-bottom: 0; }
td img { max-width: 72px; border-radius: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 600;
}
.badge.wait { background: var(--warn-bg); color: var(--warn); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: var(--fill); color: var(--muted); }
.badge.info { background: #eaf2ff; color: var(--blue); }

/* ===== RTL ===== */
body.rtl { direction: rtl; }
body.rtl .sidebar { border-right: 0; border-left: 1px solid var(--hairline); }
body.rtl .side-subs { padding: 6px 12px 10px 0; }
body.rtl .side-subs a { padding: 9px 22px 9px 12px; }
body.rtl th, body.rtl td { text-align: right; }
body.rtl .page-head { flex-direction: row-reverse; }
body.rtl .head-right { flex-direction: row-reverse; }
body.rtl .top-alert { flex-direction: row-reverse; }
body.rtl .top-alert-body { flex-direction: row-reverse; }
body.rtl .head-notify-dot { right: auto; left: 9px; }
body.rtl .head-notify-n { right: auto; left: 2px; }
body.rtl .head-notify-item { flex-direction: row-reverse; }
body.rtl .alert.ok,
body.rtl .alert.err {
  border-left: 0;
  border-right: 4px solid currentColor;
}

.mode-switch-box {
  margin: 0 0 24px;
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, #eff6ff, #ecfeff);
  border: 1px solid #bfdbfe;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}
.mode-switch-box h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #1d4ed8;
}
.mode-switch-box .tip {
  margin: 0 0 14px;
  color: #334155;
}
.mode-switch-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.mode-opt {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}
.mode-opt input { margin-top: 3px; }
.mode-opt.on {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.mode-img-tip {
  margin-top: 10px;
  color: #0f766e !important;
  font-weight: 600;
}
.import-box {
  margin: 0 0 20px;
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}
.import-box h3 { margin: 0 0 8px; font-size: 16px; }
.import-box .btn.ghost {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
#fullAppSettings.mode-dim {
  opacity: 0.38;
  pointer-events: none;
  filter: grayscale(0.35);
  position: relative;
}
#fullAppSettings.mode-dim::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* 列表搜索 + 分页 */
.list-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 16px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.list-bar-q {
  flex: 1;
  min-width: 180px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.list-bar button {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #0f9a8a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.list-bar-clear {
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
}
.list-bar-stat {
  margin-inline-start: auto;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.list-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0 8px;
  padding: 10px 0;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #0f9a8a;
  color: #fff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.pager-btn.off {
  background: #e2e8f0;
  color: #94a3b8 !important;
  pointer-events: none;
}
.pager-info {
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

/* ===== mobile admin shell ===== */
.m-topbar,
.side-mask { display: none; }

@media (max-width: 900px) {
  body.admin {
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .m-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: rgba(245, 245, 247, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--hairline);
  }
  .m-nav-btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 0 var(--hairline);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0;
    cursor: pointer;
  }
  .m-nav-btn span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #1d1d1f;
  }
  .m-topbar-title {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .m-topbar-title strong {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-topbar-title em {
    font-style: normal;
    font-size: 11px;
    color: var(--muted);
  }
  .m-topbar-bell {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
  .side-mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15, 23, 42, 0.42);
  }
  .side-mask[hidden] { display: none !important; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 300px);
    max-height: none;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--hairline);
    border-bottom: 0;
    background: #f5f5f7;
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.rtl .sidebar {
    left: auto;
    right: 0;
    transform: translateX(105%);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  main {
    padding: 16px 14px calc(36px + env(safe-area-inset-bottom));
  }
  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .page-head h1 { font-size: 22px; }
  .head-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .lang-switch { flex-wrap: wrap; }
  .hero-card { padding: 18px 16px; }
  .hero-body { max-width: 100%; }
  .hero-glow {
    width: 120px;
    height: 120px;
    right: -24px;
    top: -30px;
    opacity: 0.75;
  }
  .hero-card h2 { font-size: 22px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 14px; min-height: 96px; }
  .metric b { font-size: 26px; }
  .list-bar-stat { width: 100%; margin-inline-start: 0; }
  .table-wrap, .tbl-wrap, table.list, .hub-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 560px;
  }
  .form-grid, .row-2, .row-3 {
    grid-template-columns: 1fr !important;
  }
  input, select, textarea, button, .btn {
    font-size: 16px;
  }
  .guest .login input,
  .guest .login button {
    min-height: 48px;
    font-size: 16px;
  }
  .site-bind { font-size: 12px !important; line-height: 1.5; }
  .top-alert { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr; }
}
