.admin-page {
  --ink: #182433;
  --muted: #526176;
  --mint: #206bc4;
  --blue-soft: #edf5ff;
  --line: #dce4ed;
  --card: #fff;
  background: #f4f7fb;
  color: var(--ink);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.admin-page [hidden] { display: none !important; }
.admin-page :focus-visible { outline: 2px solid #2776dd; outline-offset: 3px; }
.admin-page [aria-busy="true"] { cursor: progress; opacity: .7; }
.admin-page button.primary:hover, .admin-page .button.primary:hover { background: #104990; }
.admin-page .layout { grid-template-columns: 218px minmax(0, 1fr); }
.admin-page .side {
  background: #182433;
  color: #f3f6fb;
  border-right: 1px solid #2c3b4e;
  height: 100dvh;
  padding: 24px 16px;
  gap: 14px;
  overflow-y: auto;
}
.admin-page .side-brand { font-size: 16px; padding: 0 4px 10px; }
.brand-symbol {
  display: inline-grid;
  min-width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--mint);
  font-weight: 750;
}
.shop-context {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  background: #223349;
  border-left: 3px solid #68a6f0;
  border-radius: 2px 9px 9px 2px;
  overflow-wrap: anywhere;
}
.shop-context small { font-size: 12px; color: #b5c5d9; }
.admin-page .side nav button {
  border: 0;
  min-height: 42px;
  padding-inline: 12px;
  color: #c1cde0;
  font-size: 14px;
}
.admin-page .side nav button:hover { background: #26374c; color: #fff; }
.admin-page .side nav button.selected { background: #294465; color: #fff; box-shadow: inset 3px 0 #69a6f2; }
.admin-page .side footer { border-top: 1px solid #34455a; padding-top: 12px; }
.admin-page .side footer small { color: #b5c5d9; }
.admin-page .side footer button { color: #e4ecf6; border-color: #455a75; }
.admin-page .side footer button:hover { background: #27394f; }
.admin-page .main { padding: 22px clamp(16px, 3vw, 44px) 52px; }
.workspace-bar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; min-height:38px; margin-bottom:22px; padding-bottom:12px; border-bottom:1px solid var(--line); color:var(--muted); font-size:13px; }
.workspace-store { padding:4px 9px; border-radius:5px; background:#e9eef5; color:var(--ink); font-weight:650; }
.admin-page .heading { gap: 16px; margin-bottom: 21px; }
.admin-page h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.025em; }
.admin-page .heading p { font-size: 14px; line-height: 1.55; }
.admin-page .panel { border-radius: 10px; box-shadow: 0 1px 3px #1824330a; }
.admin-page .subtle { background: var(--blue-soft); color: #154b95; border-color: #d9e7fd; }
.admin-page .subtle:hover { background: #dceaff; }
.admin-page .catalog-panel { padding: 0; overflow: hidden; }
.catalog-tools { display: grid; gap: 13px; padding: 17px; border-bottom: 1px solid var(--line); }
.filter-group { display: flex; flex-wrap: wrap; gap: 5px; }
.admin-page .filter-group button { color: var(--muted); border-color: transparent; background: #f4f7fb; }
.admin-page .filter-group button[aria-pressed="true"] { background: var(--blue-soft); border-color: #c4d9f8; color: #154b95; }
.filter-group button span { font-size: 12px; color: inherit; }
.catalog-search { display: grid; grid-template-columns: minmax(150px, 340px) minmax(105px, 150px); gap: 10px; }
.admin-page table { color: var(--ink); }
.admin-page th { background: #f7f9fc; }
.admin-page th, .admin-page td { padding: 11px 12px; }
.admin-page .product-cell small { display: block; margin-top: 4px; }
.admin-page .thumb { object-fit: contain; width: 48px; height: 48px; flex: 0 0 48px; background: #f1f4f8; }
.admin-page .money { font-variant-numeric: tabular-nums; font-weight: 650; }
.admin-page .empty { display: grid; justify-items: center; gap: 12px; padding: 35px 12px; text-align: center; }
.admin-page .preview { top: 20px; }
.admin-page .preview h2 { font-size: 16px; margin: 0 0 10px; }
.admin-page .device { border-color: #22314c; }
.admin-page .layout-form { gap: 20px; }
.section-switch { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.theme-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(min(148px,100%),1fr)); gap:12px; }
.admin-page .theme-choice {
  position:relative;
  display:grid;
  min-width:0;
  gap:9px;
  padding:9px;
  border:1px solid var(--line);
  border-radius:9px;
  color:var(--ink);
  cursor:pointer;
}
.theme-choice:has(input:checked) { border-color:var(--mint); box-shadow:0 0 0 1px var(--mint); }
.theme-choice:focus-within { outline:2px solid var(--mint); outline-offset:3px; }
.theme-choice input { position:absolute; z-index:1; inset:16px 15px auto auto; margin:0; accent-color:var(--mint); }
.theme-choice strong, .theme-choice small { display:block; padding-inline:3px; }
.theme-choice small { font-size:12px; font-weight:400; }
.theme-swatch { position:relative; display:grid; grid-template-columns:repeat(3,1fr); align-content:end; gap:5px; height:92px; padding:10px; overflow:hidden; border-radius:6px; background:var(--shop-paper); border:1px solid var(--shop-line); }
.theme-swatch::before { content:''; grid-column:1/-1; height:29px; background:var(--shop-tile); border-radius:4px; }
.theme-swatch i { height:17px; border:1px solid var(--shop-line); border-radius:3px; background:var(--shop-surface); }
.theme-swatch b { position:absolute; top:23px; left:20px; width:36px; height:8px; border-radius:3px; background:var(--shop-accent); }
.preview-bar { display:grid; gap:8px; margin-bottom:10px; }
.admin-page .preview-bar h2 { margin:0; }
.admin-page .preview-bar button { min-height:34px; padding:4px 10px; }
.admin-page .shop-preview { color:var(--shop-ink); background:var(--shop-paper); border:2px solid #283649; max-height:min(670px,75vh); overflow-y:auto; scrollbar-width:thin; }
.shop-preview .device-top { background:var(--shop-surface); border-color:var(--shop-line); }
.shop-preview .device-top p, .shop-preview small { color:var(--shop-muted); }
.shop-preview .sim-body { padding:12px; }
.banner-card-heading { flex-wrap:wrap; }
.banner-card input[type=color] { max-width:98px; padding:4px; }
.banner-preview-controls { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); }
.shop-preview .sim-banner {
  display:flex;
  align-items:center;
  gap:7px;
  min-height:135px;
  padding:8px 8px 12px;
  border-radius:9px;
  color:var(--banner-ink);
  background:linear-gradient(112deg,var(--banner-start),var(--banner-end));
  overflow:hidden;
}
.shop-preview .sim-banner-copy { flex:1; min-width:0; display:grid; justify-items:start; align-content:center; gap:5px; padding-left:3px; }
.sim-banner-copy strong, .shop-preview .sim-banner-copy small { display:-webkit-box; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.sim-banner-copy strong { font-size:15px; white-space:pre-line; line-height:1.14; -webkit-line-clamp:3; }
.shop-preview .sim-banner-copy small { color:inherit; opacity:.86; font-size:10px; -webkit-line-clamp:2; }
.shop-preview .sim-banner .sim-img,
.sim-banner-image-placeholder { flex:none; display:block; width:48%; height:115px; object-fit:contain; border-radius:5px; background:transparent; }
.sim-banner-image-placeholder { display:grid; place-items:center; font-size:10px; border:1px dashed currentColor; }
.shop-preview .sim-poster .sim-img,
.sim-poster .sim-banner-image-placeholder { width:100%; }
.shop-preview .sim-cta { display:inline-block; width:fit-content; padding:4px 9px; border-radius:5px; color:var(--shop-button-text); background:var(--shop-accent); font-size:10px; }
.shop-preview .sim-block { background:var(--shop-surface); border-color:var(--shop-line); }
.shop-preview .sim-items, .sim-categories { display:grid; grid-template-columns:repeat(var(--shop-products),minmax(0,1fr)); gap:7px; }
.shop-preview .sim-items strong, .sim-price { color:var(--shop-price); }
.shop-preview .sim-items img { height:86px; margin-bottom:3px; }
.sim-categories { grid-template-columns:repeat(var(--shop-categories),minmax(0,1fr)); }
.sim-categories div { display:grid; min-width:0; place-items:center; padding:4px; gap:2px; border-radius:5px; background:var(--shop-tile); font-size:10px; overflow-wrap:anywhere; }
.sim-categories img { width:100%; height:26px; object-fit:contain; }
.sim-categories.is-directory div { display:flex; gap:10px; padding:5px 8px; }
.sim-categories.is-directory img { width:36px; height:29px; }
.sim-categories.is-directory b { margin-left:auto; color:var(--shop-accent); }
.sim-product-photo { width:100%; height:185px; object-fit:contain; background:var(--shop-tile); border-radius:10px; }
.sim-detail .sim-block, .sim-contact { display:grid; gap:9px; font-size:12px; }
.sim-spec, .shop-preview .sim-chips span { background:var(--shop-tile); border-radius:5px; padding:5px; }
.sim-price { font-size:20px; }
.publish-bar small { white-space: nowrap; }
.recommend-item { min-height: 40px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.admin-page .block-row { flex-wrap: wrap; }
.admin-page .block-row strong { white-space: normal; }
.profile-form { max-width: 830px; }
.shop-entry { margin-bottom: 16px; }
.shop-entry input { flex: 1 1 240px; }
.admin-page .upload {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  padding: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcff;
}
.upload-content { display: grid; gap: 7px; font-size: 14px; }
.admin-page .cover-preview, .image-placeholder {
  width: 84px;
  height: 68px;
  object-fit: contain;
  background: #f1f5fa;
}
.image-placeholder { display: grid; place-items: center; border: 1px dashed #b5c8e2; border-radius: 8px; color: var(--muted); font-size: 12px; }
.admin-page label.file-button {
  position: relative;
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  padding-inline: 11px;
  color: #154b95;
  background: var(--blue-soft);
  border: 1px solid #d9e7fd;
  border-radius: 8px;
}
.admin-page label.file-button:focus-within { outline: 2px solid #2776dd; outline-offset: 2px; }
.admin-page .file-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.admin-page .file-button:has(input:disabled) { opacity: .6; }
.admin-page .check input { flex: 0 0 16px; }
.admin-page .approval { font-size: 12px; line-height: 1.55; }
.admin-page dialog { width: min(720px, 100% - 24px); max-height: min(90dvh, 850px); padding: 0 22px 0; box-shadow: 0 18px 65px #15243b33; }
.admin-page dialog::backdrop { background: #1425427d; }
.admin-page dialog h2 { position: sticky; top: 0; z-index: 2; background: #fff; margin: 0 -22px 16px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.admin-page dialog > p { margin-bottom: 15px; }
.admin-page fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.admin-page legend { color: var(--ink); font-size: 14px; font-weight: 700; padding-inline: 5px; }
.admin-page .publish-choice { min-height: 38px; }
.modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-inline: -22px;
  padding: 13px 22px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.editor .modal-actions { margin-top: 10px; }
.form-error {
  color: #842135;
  background: #fff1f2;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.editor .form-error { margin-top: 8px; }
.copy-status:empty { display: none; }
.admin-page .list-row { flex-wrap: wrap; justify-content: space-between; }
.share-detail { display: grid; gap: 4px; overflow-wrap: anywhere; }
.admin-page .login .brand-symbol { margin-bottom: 16px; }
.admin-page #notice { background: #18365c; }
.startup { padding: 28px; }

@media (max-width: 1050px) {
  .admin-page .grid-split { grid-template-columns: minmax(0, 1fr); }
  .admin-page .preview { position: static; max-width: 360px; width: 100%; justify-self: center; }
  .admin-page .table-wrap { overflow: visible; }
  .admin-page table, .admin-page tbody { display: block; white-space: normal; }
  .admin-page thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .admin-page tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border-bottom: 1px solid var(--line);
    padding: 13px 15px;
  }
  .admin-page tr:last-child { border-bottom: 0; }
  .admin-page td { display: block; padding: 0; border: 0; overflow-wrap: anywhere; }
  .admin-page td:first-child, .admin-page td.table-actions { grid-column: 1 / -1; }
  .admin-page td[data-label]::before { display: block; content: attr(data-label); margin-bottom: 3px; font-size: 12px; color: var(--muted); font-weight: 500; }
}
@media (min-width: 870px) {
  .admin-page .grid-split { grid-template-columns: minmax(0,1fr) minmax(236px,34%); gap:16px; }
  .admin-page .preview { position:sticky; width:100%; max-width:none; }
  .admin-page .jump-preview { display:none; }
}
@media (max-width: 650px) {
  .admin-page .side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    padding: 12px;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .admin-page .side-brand { padding-bottom: 1px; }
  .admin-page .side footer { grid-column: 2; grid-row: 1; margin-top: 0; padding-top: 0; border-top: 0; }
  .admin-page .side footer small { display: none; }
  .admin-page .side nav, .shop-context { grid-column: 1 / -1; }
  .admin-page .side nav { flex-wrap: wrap; overflow: visible; }
  .admin-page .side nav button { min-height: 40px; padding-inline: 8px; }
  .shop-context { display: flex; align-items: baseline; gap: 8px; padding-block: 8px; }
  .shop-context small { white-space: nowrap; }
  .admin-page .main { padding: 19px 12px 40px; }
  .workspace-bar { margin-bottom:14px; }
  .admin-page .heading { gap: 10px; }
  .catalog-tools { padding: 12px; }
  .catalog-search { grid-template-columns: minmax(0, 1fr) minmax(104px, 32%); }
}
