:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --line: #dbe4ef;
  --brand: #0f766e;
  --brand-2: #2563eb;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
}

* { box-sizing: border-box; }
html { min-height: 100%; font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, rgba(37, 99, 235, .12), transparent 28%),
    linear-gradient(135deg, #eef6ff 0%, #f8fbff 42%, #edf8f5 100%);
}
a { color: inherit; text-decoration: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  padding: 22px 16px;
  color: #e5eef8;
  background: linear-gradient(180deg, #0f172a, #13353f);
}
.brand { display: grid; gap: 3px; margin-bottom: 26px; }
.brand strong { font-size: 24px; }
.brand span { color: #9fb4c8; font-size: 13px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar a {
  border-radius: 8px;
  padding: 11px 12px;
  color: #d9e6f2;
  font-weight: 800;
  background: rgba(255,255,255,.07);
}

.content-shell { min-height: 100vh; margin-left: 230px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(219,228,239,.9);
  padding: 14px 22px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
}
.page { display: grid; gap: 18px; padding: 24px; }
.page-head, .section-head, .card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; }
h2 { margin-bottom: 0; font-size: 18px; }
h3 { margin-bottom: 6px; font-size: 18px; }
.page-subtitle { margin: 8px 0 0; color: var(--muted); font-weight: 700; }
.muted, .section-head span, .store-card p, .store-row p, dt, small { color: var(--muted); }

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.metrics div, .surface, .store-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}
.metrics div { display: grid; gap: 6px; padding: 16px; }
.metrics span { color: var(--muted); font-size: 13px; }
.metrics strong { font-size: 24px; overflow-wrap: anywhere; }
.portal-metrics div {
  min-height: 104px;
  border-left: 4px solid color-mix(in srgb, var(--brand-2) 72%, #fff);
}
.surface { display: grid; gap: 14px; padding: 18px; }
.console-shell {
  min-height: calc(100vh - 138px);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .08);
}
.console-frame {
  display: block;
  width: 100%;
  min-height: calc(100vh - 138px);
  border: 0;
  background: #fff;
}

.store-grid,
.store-list {
  display: grid;
  gap: 14px;
}
.store-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.store-card { display: grid; gap: 14px; padding: 16px; }
.store-card dl { display: grid; gap: 8px; margin: 0; }
.store-card dl div { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; }
dd { margin: 0; overflow-wrap: anywhere; }

.store-workbench { gap: 16px; }
.section-count {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.store-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.store-search,
.store-sort {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.store-search input,
.store-sort select {
  min-height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  font-weight: 700;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #eef4fb;
  padding: 4px;
}

.segmented button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  padding: 4px 10px;
  font-weight: 900;
}

.segmented button.active {
  background: #fff;
  color: var(--brand-2);
  box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}

.store-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(150px, .7fr) minmax(260px, 1.2fr) minmax(220px, .9fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .055);
}

.store-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.store-main h3 { margin-bottom: 4px; }
.store-main p { margin-bottom: 0; }

.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 5px rgba(148, 163, 184, .16);
}
.status-dot.online { background: #16a34a; box-shadow: 0 0 0 5px rgba(22, 163, 74, .16); }
.status-dot.offline { background: #f59e0b; box-shadow: 0 0 0 5px rgba(245, 158, 11, .16); }
.status-dot.disabled { background: #94a3b8; }

.store-state {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.store-facts {
  display: grid;
  gap: 6px;
  margin: 0;
}

.store-facts div,
.profile-list div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
}

.store-facts dd,
.profile-list dd {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.copy-link {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.store-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.store-permissions.large { gap: 8px; }

.permission-chip {
  border: 1px solid #d7e0ea;
  border-radius: 999px;
  padding: 5px 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.permission-chip.enabled {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.permission-chip.disabled {
  color: #94a3b8;
  background: #f1f5f9;
}

.badge {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}
.badge.ok { color: var(--ok); background: #dcfce7; }
.badge.warn { color: var(--warn); background: #fef3c7; }
.badge.neutral { color: #334155; background: #e2e8f0; }
.badge.online { color: var(--ok); background: #dcfce7; }
.badge.offline { color: var(--warn); background: #fef3c7; }
.badge.disabled { color: #475569; background: #e2e8f0; }
.notice {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 14px;
  color: #1d4ed8;
  background: #eff6ff;
}
.notice.error {
  border-color: #fecaca;
  color: var(--bad);
  background: #fff1f2;
}
.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 26px;
  color: var(--muted);
  text-align: center;
}
.account-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255,255,255,.72);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 900;
  cursor: pointer;
}
.button.primary { color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.button.ghost { color: var(--text); background: #eaf0f7; }
.button.disabled { pointer-events: none; opacity: .45; }

.store-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 14px;
}

.store-profile-card,
.remote-status-panel { align-content: start; }

.profile-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.remote-status-body {
  display: grid;
  gap: 8px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.remote-status-body strong { font-size: 18px; }
.remote-status-body span { color: var(--muted); font-weight: 700; }

.copy-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  padding: 10px 14px;
  font-weight: 900;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .22);
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(15, 23, 42, .72), rgba(15, 118, 110, .46)),
    radial-gradient(circle at 78% 18%, rgba(37, 99, 235, .32), transparent 26%),
    linear-gradient(135deg, #0f172a 0%, #124049 48%, #e8f5ff 100%);
}
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  width: min(920px, calc(100vw - 34px));
  align-items: center;
}
.login-brand { color: #fff; }
.login-brand p { font-weight: 900; }
.login-brand h1 { font-size: 44px; }
.login-brand span { color: #dbeafe; }
.login-panel {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 10px;
  padding: 22px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 22px 60px rgba(15, 23, 42, .25);
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  font: inherit;
}

@media (max-width: 860px) {
  .sidebar { position: static; width: auto; }
  .content-shell { margin-left: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-shell { grid-template-columns: 1fr; }
  .store-toolbar { grid-template-columns: 1fr; }
  .store-row { grid-template-columns: 1fr; align-items: stretch; }
  .store-profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .page { padding: 16px; }
  .metrics { grid-template-columns: 1fr; }
  .page-head, .section-head, .card-actions { align-items: stretch; flex-direction: column; }
  .store-grid { grid-template-columns: 1fr; }
}
