:root {
  color-scheme: light;
  --ink: #14233b;
  --muted: #65708a;
  --line: #d8def0;
  --line-strong: #c7d0e8;
  --panel: #ffffff;
  --page: #f5f7ff;
  --rail: #ffffff;
  --blue: #0b66ff;
  --blue-dark: #0750cb;
  --blue-soft: #e9efff;
  --green: #0c9b6f;
  --red: #c63d58;
  --amber: #c7791b;
  --shadow: 0 8px 24px rgba(24, 43, 83, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.is-locked {
  display: block;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
}

.app-shell[hidden],
.login-shell[hidden] {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #f7f9ff 0%, #eef3ff 100%);
}

.login-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.login-brand strong,
.login-brand p {
  display: block;
  margin: 0;
}

.login-brand strong {
  font-size: 22px;
  color: #102442;
}

.login-brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.app-version {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.brand-version {
  margin-top: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
}

.login-form {
  display: grid;
  gap: 14px;
}

button,
input,
textarea,
select {
  font: inherit;
}

textarea[readonly] {
  background: #f8faff;
}

button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

button.secondary,
button.ghost {
  background: #fff;
  color: var(--blue);
  border-color: #6ea1ff;
}

button.secondary:hover,
button.ghost:hover {
  background: #f1f6ff;
  color: var(--blue-dark);
}

button.danger {
  background: #fff;
  border-color: #f2b5c1;
  color: var(--red);
}

button.danger:hover {
  background: #fff4f6;
}

.sidebar {
  min-height: 100vh;
  padding: 16px 0;
  background: var(--rail);
  border-right: 1px solid var(--line);
  color: var(--ink);
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}

.brand {
  width: 100%;
  display: grid;
  place-items: center;
  gap: 6px;
  margin-bottom: 52px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 3px solid var(--blue);
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.brand-mark.small {
  width: 26px;
  height: 26px;
  border-width: 2px;
  font-size: 10px;
}

.brand h1,
.brand p {
  display: none;
}

.steps {
  width: 100%;
  display: grid;
  gap: 8px;
}

.step {
  color: #49556c;
  text-decoration: none;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 12px 0;
  border-left: 3px solid transparent;
  font-size: 12px;
  font-weight: 800;
}

.step span {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #49556c;
  font-size: 17px;
}

.step.is-active,
.step:hover {
  background: #dfe6ff;
  border-left-color: var(--blue);
  color: var(--blue);
}

.step.is-active span,
.step:hover span {
  background: var(--blue);
  color: #fff;
}

.summary {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 0 10px;
}

.sidebar-user-info-panel {
  width: calc(100% - 18px);
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faff;
}

.sidebar-user-info-panel .section-head {
  margin-bottom: 0;
}

.sidebar-user-info-panel .section-head h3 {
  font-size: 14px;
}

.sidebar-user-info-block {
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}

.sidebar-user-info-block strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #1d2b49;
}

.sidebar-user-info-panel .user-info-list,
.sidebar-user-info-panel .user-info-token-list {
  font-size: 12px;
  line-height: 1.45;
  gap: 4px;
}

.sidebar-user-info-panel .user-info-token-row {
  padding: 8px 10px;
}

.sidebar-user-info-panel .user-info-token-row strong {
  font-size: 12px;
  margin-bottom: 0;
}

.sidebar-footer {
  width: 100%;
  padding: 12px 10px 4px;
  display: flex;
  justify-content: center;
}

.summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  background: #fbfcff;
}

.summary span {
  display: block;
  color: var(--blue);
  font-size: 18px;
  font-weight: 950;
}

.summary small {
  color: var(--muted);
  font-size: 11px;
}

main {
  min-width: 0;
  padding: 0 46px 32px;
}

.topbar {
  min-height: 64px;
  margin: 0 -46px 26px;
  padding: 0 40px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.topbar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--blue);
  font-size: 22px;
  font-weight: 950;
}

.topbar-brand > div {
  display: grid;
  gap: 2px;
}

.topbar h2,
.topbar p,
.section-head h3,
.section-head p {
  margin: 0;
}

.back-link {
  color: #34405a;
  font-size: 14px;
  margin-bottom: 22px;
}

.topbar h2 {
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.15;
  color: #102442;
}

.topbar-subtitle {
  color: var(--muted);
  margin-top: 8px;
  font-size: 15px;
}

.topbar-subtitle strong {
  color: #102442;
}

.topbar-actions,
.button-row,
.export-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-actions {
  align-items: end;
}

.topbar-actions > button {
  height: 38px;
  min-height: 38px;
  padding: 0 16px;
}

.user-switch {
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.user-switch span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.user-switch select {
  height: 38px;
}

#userStoreIdsInput {
  min-height: 40px;
}

#userPasswordInput,
#loginPasswordInput {
  letter-spacing: 0;
}

.eyebrow {
  color: var(--blue);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0;
  font-size: 12px;
  margin-bottom: 6px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: none;
  padding: 18px;
  margin-bottom: 18px;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.workspace.view-panel.is-active {
  display: grid;
}

#import {
  border-radius: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.section-head.compact {
  align-items: flex-start;
}

.section-head h3 {
  font-size: 18px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green);
  background: #e4f7f0;
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
}

.settings {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.field {
  display: grid;
  gap: 7px;
  align-content: start;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.translation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.translation-row button {
  min-height: 40px;
  white-space: nowrap;
}

.ai-generate-row button {
  min-width: 132px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

input,
select {
  min-height: 42px;
}

#storeOperatorIdsInput,
#userStoreIdsInput {
  min-height: 42px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 102, 255, 0.12);
}

.keyword-row {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.button-row {
  justify-content: flex-start;
  margin-top: 14px;
}

.subsection-title {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #34405a;
  font-size: 14px;
  font-weight: 950;
}

.aux-search-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.aux-search-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 0;
  padding: 16px 0 0;
  border-top: 0;
  cursor: pointer;
  list-style: none;
}

.aux-search-summary::-webkit-details-marker {
  display: none;
}

.aux-search-summary::after {
  content: "+";
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--blue);
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  background: #fff;
}

.aux-search-panel[open] .aux-search-summary::after {
  content: "-";
}

.note {
  margin-top: 12px;
  color: var(--muted);
  background: #f8faff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 14px;
}

.result-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.result-list li + li {
  margin-top: 8px;
}

.scrape-status {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.scrape-status.is-ok {
  color: var(--green);
}

.scrape-status.is-warn {
  color: var(--amber);
}

.scrape-status.is-error {
  color: var(--red);
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.workspace.view-panel {
  display: none;
}

.workspace.view-panel.is-active {
  display: grid;
}

.workspace .panel {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.list-panel {
  border-right: 1px solid var(--line-strong) !important;
  padding: 0;
}

.list-panel .section-head {
  padding: 18px 16px 12px;
  margin: 0;
  display: grid;
  gap: 12px;
}

.bulk-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 0 16px 12px;
}

.bulk-row button {
  min-height: 34px;
  padding: 0 8px;
  font-size: 13px;
}

.search {
  max-width: none;
}

.draft-list {
  display: grid;
  max-height: 760px;
  overflow: auto;
}

.draft-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: stretch;
  border-top: 1px solid var(--line);
}

.draft-item {
  width: 100%;
  min-height: 108px;
  text-align: left;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  background: #fff;
  color: var(--ink);
  border: 0;
  padding: 12px 16px;
  border-radius: 0;
}

.draft-item:hover,
.draft-item.is-selected,
.draft-item-row:hover .draft-delete,
.draft-item-row.is-selected .draft-delete {
  background: var(--blue);
  color: #fff;
}

.draft-delete {
  min-height: 108px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  background: #fff;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.draft-delete svg {
  width: 18px;
  height: 18px;
  display: block;
}

.draft-delete:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.draft-state {
  grid-row: 1 / 3;
  width: 66px;
  height: 66px;
  border-radius: 8px;
  background: #eef3ff;
  border: 1px solid var(--line-strong);
  position: relative;
  overflow: hidden;
}

.draft-state::after {
  content: "图";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--blue);
  font-weight: 950;
}

.draft-state img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.draft-state img:not([src]) {
  display: none;
}

.draft-item.is-ready .draft-state {
  border-color: rgba(255, 255, 255, 0.4);
}

.draft-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.draft-copy strong,
.draft-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-copy strong {
  font-size: 15px;
}

.draft-copy small {
  color: var(--muted);
  font-weight: 700;
}

.draft-item:hover small,
.draft-item.is-selected small {
  color: rgba(255, 255, 255, 0.82);
}

.draft-item:hover .draft-state,
.draft-item.is-selected .draft-state {
  background: #fff;
}

.ready-chip {
  grid-column: 2;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-self: start;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.ready-chip input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.draft-item:hover .ready-chip,
.draft-item.is-selected .ready-chip {
  color: #fff;
}

.editor-panel {
  min-height: 680px;
  padding: 22px 36px;
}

.empty-editor {
  min-height: 128px;
  display: grid;
  align-content: start;
  color: var(--muted);
  gap: 10px;
  padding: 4px 0;
}

.empty-editor strong {
  color: var(--ink);
  font-size: 16px;
}

.empty-copy {
  display: grid;
  gap: 3px;
  max-width: 520px;
  font-size: 13px;
}

.empty-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.empty-thumb {
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #f8faff;
  overflow: hidden;
  position: relative;
}

.empty-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.empty-thumb.is-broken::before {
  content: "图片加载失败";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.toggle {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.toggle input {
  width: 18px;
  height: 18px;
}

.draft-hero {
  margin: 6px 0 18px;
}

.draft-hero-card,
.draft-hero-empty {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbff;
}

.draft-hero-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  min-height: 180px;
}

.draft-hero-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.draft-hero-meta {
  padding: 16px 18px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.draft-hero-badge {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e9efff;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 900;
}

.draft-hero-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.draft-hero-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 18px;
}

.draft-hero-card.is-broken {
  grid-template-columns: 1fr;
}

.draft-hero-fallback {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.span-2 {
  grid-column: span 4;
}

.form-grid .field:not(.span-2) {
  grid-column: span 2;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  min-height: 0;
}

#detailImagePreview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  min-height: 0;
}

#detailImagePreview .thumb.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(48, 112, 255, 0.22);
}

#detailImagePreview .thumb.is-success {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16);
}

#detailImagePreview .thumb.is-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.14);
}

#detailImagePreview .thumb-select {
  right: 8px;
  width: fit-content;
}

.thumb {
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #f7f9ff;
  overflow: hidden;
  position: relative;
}

.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.thumb-index {
  position: absolute;
  left: 8px;
  bottom: 8px;
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(16, 25, 35, 0.76);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.thumb-select {
  position: absolute;
  left: 8px;
  top: 8px;
  height: 28px;
  border-radius: 8px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  z-index: 3;
  cursor: pointer;
}

.thumb-select input {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
}

.thumb.is-unselected img {
  filter: grayscale(0.82);
  opacity: 0.42;
}

.thumb.is-primary {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(48, 112, 255, 0.22);
}

.thumb.is-success {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.16);
}

.thumb.is-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.14);
}

.thumb-status {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 950;
  z-index: 3;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.thumb-status.is-success {
  background: rgba(22, 163, 74, 0.96);
}

.thumb-status.is-error {
  background: rgba(220, 38, 38, 0.96);
}

.thumb-open,
.thumb-action,
.thumb-primary {
  position: absolute;
  height: 28px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 25, 35, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
  z-index: 2;
}

.thumb-open {
  right: 8px;
  bottom: 8px;
}

.thumb-action {
  top: 8px;
  right: 8px;
}

.thumb-primary {
  left: 8px;
  bottom: 42px;
  background: rgba(48, 112, 255, 0.9);
}

.thumb.is-primary .thumb-primary {
  background: rgba(21, 92, 52, 0.92);
}

.thumb-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.thumb.is-broken::before {
  content: "图片加载失败";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: #f8faff;
}

.thumb-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  padding: 16px;
  background: #f8faff;
  font-size: 13px;
}

.source-compare {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #f8faff;
  padding: 12px;
}

.source-compare div {
  display: grid;
  gap: 5px;
}

.source-compare span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.source-compare p,
.source-compare pre {
  margin: 0;
  color: var(--ink);
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.source-link-row {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f8faff;
  padding: 10px 12px;
}

.source-link-row span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 850;
}

.source-link-row a {
  color: var(--blue);
  font-weight: 850;
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.source-link-row a.is-empty {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
}

#export {
  margin-top: 18px;
}

.export-grid button {
  min-width: 178px;
}

.publish-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 4px;
  margin-bottom: 14px;
  align-items: start;
}

.publish-grid .span-2 {
  grid-column: span 2;
}

.task-query {
  margin-top: 8px;
}

.action-field {
  align-self: end;
}

.action-field button {
  width: 100%;
}

.payload-preview {
  min-height: 260px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #f8faff;
  color: var(--ink);
  padding: 14px;
  font: 13px/1.55 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  white-space: pre-wrap;
}

.result-panel {
  display: grid;
  gap: 12px;
  white-space: normal;
}

.result-title {
  font-size: 16px;
  font-weight: 950;
  color: var(--ink);
}

.result-summary,
.result-next {
  color: var(--muted);
  font-weight: 750;
}

.result-next {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 10px 12px;
}

.result-kv {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.result-kv div,
.result-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.result-kv dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.result-kv dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.result-row {
  display: grid;
  gap: 8px;
  border-left-width: 4px;
}

.result-row.is-ok {
  border-left-color: var(--green);
}

.result-row.is-warn {
  border-left-color: #d97706;
}

.result-row.is-error {
  border-left-color: var(--red);
}

.result-row strong,
.result-row span,
.result-row small {
  display: block;
}

.result-row span,
.result-row small {
  color: var(--muted);
  font-weight: 750;
}

.result-row ul {
  margin: 0;
  padding-left: 18px;
}

.result-row li + li {
  margin-top: 8px;
}

.result-raw {
  border-top: 1px dashed var(--line-strong);
  padding-top: 8px;
}

.result-raw summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 850;
}

.result-raw pre {
  margin: 10px 0 0;
  max-height: 320px;
  overflow: auto;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  padding: 12px;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.store-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 22px;
}

.user-info-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-info-block {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fbfcff;
  padding: 12px;
  min-width: 0;
}

.user-info-block-wide {
  grid-column: 1 / -1;
}

.user-info-block strong {
  display: block;
  margin-bottom: 10px;
  color: #1d2b49;
  font-size: 13px;
}

.user-info-list,
.user-info-token-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.user-info-token-row {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.user-info-token-row strong {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

.user-info-token-row small {
  color: var(--muted);
  font-size: 12px;
}

.user-info-total {
  color: var(--blue);
  font-weight: 900;
  font-size: 12px;
  margin-bottom: 8px;
}

.store-item {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}

.store-item-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  cursor: default;
}

.store-item-main {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  display: grid;
  gap: 4px;
  color: inherit;
  cursor: pointer;
}

.store-open-btn {
  align-self: center;
  white-space: nowrap;
}

.store-item strong {
  font-size: 15px;
}

.store-item small {
  color: var(--muted);
  font-weight: 750;
}

.store-item.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.store-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}

.metric-card {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fbfcff;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.metric-card span {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
}

.store-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.store-detail-panel {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfcff;
  padding: 14px;
}

.store-detail-list {
  display: grid;
  gap: 12px;
  min-height: 220px;
}

.store-detail-pagination {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.store-detail-pagination span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  min-width: 88px;
  text-align: center;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.detail-product-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.detail-product-image {
  width: 72px;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #f7f9ff;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: zoom-in;
  padding: 0;
}

.detail-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-product-image.is-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 6px;
}

.detail-product-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.detail-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.detail-card-head strong {
  min-width: 0;
}

.detail-translation {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 13px;
}

button.secondary.detail-stock-button {
  align-self: flex-end;
  margin-left: auto;
  flex: 0 0 auto;
  min-height: 28px !important;
  height: 28px !important;
  width: auto !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.detail-order-items {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.detail-order-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--line-strong);
}

.detail-order-image {
  width: 72px;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: #f7f9ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-order-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-order-image.is-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 8px;
}

.detail-order-copy {
  min-width: 0;
}

.detail-order-copy strong,
.detail-order-copy small {
  display: block;
}

.detail-order-copy strong {
  font-size: 13px;
  line-height: 1.45;
}

.detail-order-copy small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.detail-product-link,
.detail-order-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
}

.detail-product-link:hover,
.detail-order-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.store-raw-panel {
  margin-top: 16px;
}

.store-raw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.store-raw-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.72);
  cursor: pointer;
}

.image-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 32px));
  margin: 4vh auto;
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.image-lightbox-dialog img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  display: block;
  background: #f8fafc;
  border-radius: 10px;
}

.image-lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  main {
    padding: 0 20px 28px;
  }

  .topbar {
    margin: 0 -20px 22px;
    padding: 12px 22px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar-actions {
    justify-content: flex-start;
    align-items: stretch;
  }

  .topbar-brand {
    font-size: 18px;
  }

  .back-link {
    margin-bottom: 8px;
  }

  .workspace,
  .import-grid,
  .publish-grid {
    grid-template-columns: 1fr;
  }

  .publish-grid .span-2 {
    grid-column: span 1;
  }

  .list-panel {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line-strong) !important;
  }
}

@media (max-width: 860px) {
  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, auto);
    gap: 10px;
  }

  .user-switch {
    min-width: 0;
  }

  .topbar-actions > button {
    width: 100%;
  }

  .topbar-brand {
    display: none;
  }
}

@media (max-width: 700px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px 12px;
  }

  .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
  }

  .steps {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
  }

  .step {
    border-left: 0;
    border-bottom: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 4px;
    gap: 4px;
    background: #fff;
  }

  .step strong {
    font-size: 11px;
    line-height: 1.2;
    word-break: keep-all;
  }

  .step span {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  .step.is-active,
  .step:hover {
    border-color: var(--blue);
    background: #eef3ff;
  }

  .summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
    padding: 0;
  }

  .topbar {
    margin: 0 -20px 18px;
    padding: 12px 20px;
  }

  .topbar-actions {
    grid-template-columns: 1fr 1fr;
  }

  .topbar-actions > button {
    min-width: 0;
  }

  .keyword-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .field:not(.span-2),
  .span-2 {
    grid-column: span 1;
  }

  .editor-panel {
    padding: 18px;
  }
}
