:root {
  --admin-aside: 208px;
  --admin-top: 48px;
  --navy: #1b2430;
  --navy-2: #111820;
  --navy-3: #2b3645;
  --go: #ff6a00;
  --line: #e8eaed;
  --bg: #f3f4f6;
  --ink: #1a1a1a;
  --muted: #8a8f98;
  --ok: #067d62;
  --warn: #c45500;
}
.is-admin {
  margin: 0;
  background: var(--bg);
  min-height: 100vh;
}
.admin-aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--admin-aside);
  background: var(--navy);
  color: #d7dde5;
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.admin-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 16px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.admin-logo .mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: #ff9900; color: #111; font-weight: 800;
  display: grid; place-items: center; font-size: 14px;
}
.admin-logo b { display: block; font-size: 14px; color: #fff; }
.admin-logo small { display: block; font-size: 11px; color: #9aa4b2; font-weight: 400; }
.admin-menu { padding: 10px 8px; flex: 1; }
.admin-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c5ced8;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 2px;
}
.admin-menu a:hover { background: var(--navy-3); color: #fff; }
.admin-menu a.on { background: var(--navy-3); color: #ffd814; }
.admin-menu a[data-nav="publish"] { position: relative; }
.admin-pub-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff8a00;
  flex: 0 0 8px;
  box-shadow: 0 0 0 0 rgba(255, 138, 0, .6);
  animation: admin-pub-dot-in .4s ease-out, admin-pub-dot-pulse 1.6s ease-out .4s infinite;
}
@keyframes admin-pub-dot-in {
  from { transform: scale(.15); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes admin-pub-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 138, 0, .55); }
  70% { box-shadow: 0 0 0 6px rgba(255, 138, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 138, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .admin-pub-dot { animation: none; }
}
.admin-menu .sep {
  height: 1px; background: rgba(255,255,255,.08); margin: 10px 8px;
}
.admin-aside .foot {
  padding: 12px 16px 16px;
  font-size: 11px;
  color: #8b95a3;
  line-height: 1.4;
}
.admin-set-btn {
  margin: 4px 10px 8px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  background: var(--navy-3);
  color: #ffd814;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.admin-set-btn:hover { background: #334155; color: #fff; }
.admin-api-panel {
  position: fixed;
  inset: 0;
  z-index: 420;
  background: rgba(17, 24, 32, .45);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 20px 20px calc(var(--admin-aside) + 12px);
}
.admin-api-panel[hidden] { display: none !important; }
.admin-api-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  display: grid;
  gap: 8px;
}
.admin-api-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-api-card b { font-size: 16px; color: var(--ink); }
.admin-api-card .hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.admin-api-card label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
.admin-api-card input {
  height: 36px;
  border: 1px solid #888c8c;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
}
.admin-api-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.admin-api-acts button {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid #d9d9d9;
  background: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.admin-api-acts .go {
  background: var(--go);
  color: #fff;
  border-color: var(--go);
}
.admin-main {
  margin-left: var(--admin-aside);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-top {
  height: auto;
  min-height: var(--admin-top);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.admin-top .crumb { font-size: 13px; color: var(--ink); font-weight: 700; }
.admin-top .crumb span { color: var(--muted); font-weight: 500; }
.admin-top .right {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}
.mode-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.mode-switch i {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d8dde3;
  transition: background .18s ease;
}
.mode-switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}
.mode-switch input:checked + i { background: var(--go); }
.mode-switch input:checked + i::after { transform: translateX(16px); }
.mode-switch input:checked ~ span:last-of-type,
.mode-switch:not(:has(input:checked)) span:first-of-type { color: var(--ink); }
.ce-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 8px;
}
.ce-grid div {
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.ce-grid span { display: block; color: var(--muted); font-size: 11px; }
.ce-grid b { display: block; margin-top: 2px; font-size: 15px; }
.ce-block {
  margin: 0 0 10px;
  padding: 0 0 0 18px;
  color: #ad4e00;
  font-size: 12px;
  line-height: 1.5;
}
.ce-fill {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin: 8px 0 12px;
}
.ce-fill label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.ce-fill input {
  width: 140px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
}
.muted-reserve { opacity: .85; }
.muted-reserve h2 { color: var(--muted); }
.admin-chip {
  font-size: 12px;
  background: #f3f4f6;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: #333;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-chip a { color: inherit; text-decoration: none; font-weight: 700; }
#adminLogout { color: #1677ff; margin-left: 6px; }
.admin-content { flex: 1; padding: 16px 18px 40px; animation: page-rise .28s ease; }
@keyframes page-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.page-rise { animation: page-rise .32s ease; }
@media (prefers-reduced-motion: reduce) {
  .admin-content, .page-rise { animation: none; }
}
.admin-content .page { max-width: none; margin: 0; padding: 0; }

.home-flow {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
}
.home-flow li {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 72px;
  position: relative;
  overflow: hidden;
}
.home-flow li b {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1b2430;
  color: #fff;
  font-size: 14px;
}
.home-flow li strong { display: block; font-size: 15px; }
.home-flow li span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.home-flow li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(255, 106, 0, .16), transparent 70%);
  animation: home-sweep 1s ease forwards;
}
.home-flow li:nth-child(2)::after { animation-delay: .18s; }
.home-flow li:nth-child(3)::after { animation-delay: .36s; }
.home-flow li.is-on {
  border-color: #ff6a00;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, .12);
}
.home-flow li.is-on b { background: #ff6a00; color: #111; }
@keyframes home-sweep {
  0% { width: 0; opacity: 1; }
  65% { width: 100%; opacity: .9; }
  100% { width: 100%; opacity: 0; }
}
@media (max-width: 800px) {
  .home-flow { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .home-flow li::after { animation: none; width: 0; }
}
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
a.kpi:hover { border-color: #ff6a00; transform: translateY(-1px); }
.kpi span { color: var(--muted); font-size: 12px; }
.kpi b { display: block; font-size: 28px; margin-top: 4px; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
.imgbed-space {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 16px;
  font-size: 13px;
  color: var(--muted);
}
.imgbed-space button {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #111;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.imgbed-space button:disabled { opacity: 0.6; cursor: default; }
.imgbed-space span { color: var(--ink, #1c1917); }
.dash-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
}
.dash-home { align-items: start; }
.mine-h2 { margin: 18px 0 10px !important; }
.mine-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mine-grid div {
  background: #f7f8fa;
  border-radius: 8px;
  padding: 8px 10px;
}
.mine-grid span { display: block; color: var(--muted); font-size: 11px; }
.mine-grid b { display: block; margin-top: 2px; font-size: 18px; }
.dash-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.dash-panel h2 { margin: 0 0 12px; font-size: 15px; }
.now-list { display: flex; flex-direction: column; gap: 16px; }
.now-prod {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: start;
}
.now-prod > div { min-width: 0; }
.now-prod img {
  width: 96px; height: 96px; object-fit: contain;
  background: #f6f6f6; border: 1px solid var(--line); border-radius: 8px;
}
.now-prod h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.35; word-break: break-word; }
.now-prod p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; word-break: break-word; }
.now-prod p + p { margin-top: 6px; }
.now-prod .ph, .now-empty {
  min-height: 72px;
  display: flex;
  align-items: center;
  color: #333;
  line-height: 1.55;
}
.now-prod .ph {
  width: 96px;
  height: 96px;
  justify-content: center;
  background: #f6f6f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}
.tool-bar .capture { flex-direction: column; align-items: stretch; }
.tool-bar .capture textarea { width: 100%; flex: none; min-height: 96px; }
.tool-bar .capture-btns { width: 100%; }
.tool-bar .steps { margin-top: 12px; }
.tool-bar .steps li { font-size: 13px; padding: 6px 12px 6px 6px; }
.tool-bar .steps li span { width: 22px; height: 22px; font-size: 12px; }
.now-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.now-acts a, .now-acts button {
  height: 34px; padding: 0 12px; border-radius: 6px;
  border: 1px solid #d9d9d9; background: #fff;
  font-weight: 700; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; text-decoration: none; color: #111;
}
.now-acts a.primary, .now-acts button.primary {
  background: #ff6a00; color: #fff; border-color: #ff6a00;
}
.cap-box textarea {
  width: 100%; min-height: 72px; border: 1px solid #d9d9d9;
  border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 13px;
}
.cap-box .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.store-line { font-size: 13px; color: #444; margin-bottom: 8px; }

.tool-bar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.tool-bar .capture { margin-top: 0; }
.store-mini {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; font-size: 13px;
}
.store-mini button { height: 30px; }
#store-panel { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }

.is-admin .topbar { display: none; }
.is-admin .bench { min-height: calc(100vh - var(--admin-top)); }
.is-admin .workbar { top: var(--admin-top); }

.admin-gate {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(17, 24, 32, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-gate[hidden] { display: none !important; }
.admin-gate-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 22px 22px 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}
.admin-gate-card b {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--ink);
}
.admin-gate-card p {
  margin: 0 0 8px;
  font-size: 14px;
  color: #222;
  line-height: 1.5;
}
.admin-gate-card .hint {
  color: var(--muted);
  font-size: 12px;
}
.admin-gate-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.admin-gate-acts button {
  height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid #d9d9d9;
  background: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.admin-gate-acts .go {
  background: var(--go);
  color: #fff;
  border-color: var(--go);
}

@media (max-width: 1100px) {
  .dash-kpis, .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .admin-aside { width: 56px; }
  .admin-main { margin-left: 56px; }
  .admin-logo b, .admin-logo small, .admin-menu a span, .admin-aside .foot, .admin-set-btn span { display: none; }
  .admin-menu a { justify-content: center; padding: 10px 0; }
  .admin-set-btn { margin: 4px 8px 8px; }
  .admin-set-btn::before { content: "设"; }
  .admin-api-panel { padding-left: 68px; }
}
