:root {
  --text: #2f2418;
  --text-soft: #7a6550;
  --primary: #1f6f78;
  --primary-strong: #164b52;
  --accent: #c06c47;
  --success: #457b50;
  --danger: #b54545;
  --shadow: 0 24px 60px rgba(68, 45, 18, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --content: 1360px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 216, 162, 0.45), transparent 28%),
    radial-gradient(circle at top right, rgba(31, 111, 120, 0.18), transparent 26%),
    linear-gradient(180deg, #fffaf2 0%, #f7efe5 55%, #f0e6d7 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(10px);
}

body::before {
  left: -8%;
  bottom: 8%;
  background: radial-gradient(circle, rgba(31, 111, 120, 0.12), transparent 70%);
}

body::after {
  right: -10%;
  top: 10%;
  background: radial-gradient(circle, rgba(192, 108, 71, 0.12), transparent 66%);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(var(--content), calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 52px;
}

.topbar,
.hero-card,
.panel,
.login-card,
.space-panel,
.space-toolbar-card,
.summary-card,
.table-card,
.detail-space,
.history-card,
.side-nav,
.modal-card,
.product-card,
.empty-state {
  background: rgba(255, 252, 247, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 22px;
  position: sticky;
  top: 18px;
  z-index: 30;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #d1a56f);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.brand h1,
.hero-copy h1,
.login-card h2,
.section-head h2,
.modal-card h3 {
  margin: 0;
  font-family: "STZhongsong", "Songti SC", serif;
  letter-spacing: 0.06em;
}

.brand p,
.muted,
.hero-copy p,
.section-head p,
.history-card p,
.product-meta,
.helper {
  margin: 0;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.nav-row,
.toolbar,
.chip-row,
.action-row,
.card-actions,
.modal-actions,
.meta-row,
.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 24px;
  margin-top: 28px;
}

.hero-card {
  padding: 38px;
  background:
    linear-gradient(135deg, rgba(31, 111, 120, 0.94), rgba(192, 108, 71, 0.88)),
    rgba(255, 255, 255, 0.06);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.hero-card::before {
  width: 260px;
  height: 260px;
  right: -80px;
  top: -90px;
}

.hero-card::after {
  width: 220px;
  height: 220px;
  left: -60px;
  bottom: -120px;
}

.hero-copy,
.hero-stats {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.12;
  margin-bottom: 18px;
}

.hero-copy p {
  color: rgba(255, 255, 255, 0.86);
  max-width: 640px;
  line-height: 1.8;
}

.pill,
.badge,
.status-badge,
.tiny-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}

.pill {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 14px;
}

.badge,
.tiny-badge {
  background: rgba(31, 111, 120, 0.08);
  color: var(--primary-strong);
}

.status-badge.success {
  background: rgba(69, 123, 80, 0.12);
  color: var(--success);
}

.status-badge.warn {
  background: rgba(192, 108, 71, 0.12);
  color: var(--accent);
}

.status-badge.danger {
  background: rgba(181, 69, 69, 0.12);
  color: var(--danger);
}

.stat-grid,
.choice-grid,
.summary-kpi,
.metric-grid,
.workbench-grid,
.detail-grid,
.admin-layout,
.form-grid,
.history-list,
.space-list,
.selected-list,
.detail-list,
.product-grid {
  display: grid;
  gap: 18px;
}

.stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.dashboard-stack {
  display: grid;
  gap: 18px;
}

.dashboard-subtitle {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 18px;
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 13px;
}

.dashboard-stat-grid,
.dashboard-panel-grid,
.dashboard-insight-list {
  display: grid;
  gap: 18px;
}

.dashboard-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
}

.dashboard-stat-card,
.dashboard-insight-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(57, 44, 25, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 238, 227, 0.72));
}

.dashboard-stat-card strong,
.dashboard-insight-card strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 32px;
}

.dashboard-stat-label,
.dashboard-insight-label {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.dashboard-panel-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
}

.dashboard-panel {
  min-width: 0;
}

.dashboard-panel-wide {
  min-height: 100%;
}

.dashboard-trend-frame {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
}

.dashboard-trend-bars {
  display: grid;
  grid-template-columns: repeat(30, minmax(22px, 1fr));
  align-items: end;
  gap: 10px;
  width: max(100%, 950px);
  min-width: 0;
  min-height: 260px;
  margin-top: 14px;
  padding-right: 6px;
}

.dashboard-trend-bar {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
}

.dashboard-trend-count,
.dashboard-trend-date {
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-trend-date {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.dashboard-trend-bar-track {
  display: flex;
  align-items: end;
  width: 100%;
  min-height: 160px;
  padding: 6px 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(31, 111, 120, 0.08), rgba(31, 111, 120, 0.02));
}

.dashboard-trend-bar-fill {
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(31, 111, 120, 0.55), rgba(31, 111, 120, 1));
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.25);
}

.dashboard-insight-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.dashboard-insight-card-wide {
  grid-column: 1 / -1;
}

.dashboard-link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary-strong);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.dashboard-link-button:hover,
.dashboard-link-button:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.dashboard-filter-chip {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.dashboard-filter-chip:hover,
.dashboard-filter-chip:focus-visible {
  background: rgba(31, 111, 120, 0.16);
}

.stat-grid > article,
.summary-kpi article,
.split-card,
.panel,
.login-card,
.space-panel,
.space-toolbar-card,
.table-card,
.summary-card,
.detail-space,
.history-card,
.modal-card,
.empty-state {
  padding: 24px;
}

.choice-grid,
.summary-kpi,
.metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(247, 240, 230, 0.9));
  border: 1px solid rgba(57, 44, 25, 0.08);
}

.choice-card h3,
.product-card h3,
.detail-space h3,
.history-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn[data-loading="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: wait;
}

.btn[data-loading="true"]::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}

.btn:disabled,
.page-btn:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.btn-accent {
  background: linear-gradient(135deg, #c06c47, #9d593c);
  color: #fff;
}

.btn-secondary {
  background: rgba(31, 111, 120, 0.08);
  color: var(--primary-strong);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  border: 1px solid rgba(57, 44, 25, 0.08);
}

.btn-danger {
  background: rgba(181, 69, 69, 0.1);
  color: var(--danger);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: 24px;
  min-height: calc(100vh - 140px);
}

.workbench-grid {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  margin-top: 26px;
}

.workbench-main {
  display: grid;
  gap: 18px;
}

.detail-grid {
  grid-template-columns: 1fr;
  margin-top: 24px;
}

.admin-layout {
  grid-template-columns: 240px minmax(0, 1fr);
  margin-top: 28px;
}

.admin-layout > section {
  min-width: 0;
}

.side-nav {
  height: fit-content;
  position: sticky;
  top: 106px;
  padding: 18px;
}

.nav-item {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: none;
  background: transparent;
  text-align: left;
  color: var(--text-soft);
  font-weight: 700;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(31, 111, 120, 0.14), rgba(192, 108, 71, 0.12));
  color: var(--text);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 18px;
}

.workbench-project-card {
  padding: 20px 24px;
}

.workbench-project-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.workbench-project-title {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.workbench-project-title h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.22;
}

.workbench-project-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-soft);
  font-size: 14px;
}

.workbench-project-actions {
  justify-content: flex-end;
}

.workbench-project-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) repeat(3, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
}

.project-more-fields {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(57, 44, 25, 0.08);
}

.project-more-fields summary {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-strong);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.project-more-fields summary::-webkit-details-marker {
  display: none;
}

.project-more-fields summary::after {
  content: "+";
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(31, 111, 120, 0.08);
  font-size: 14px;
  line-height: 1;
}

.project-more-fields[open] summary::after {
  content: "-";
}

.project-more-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.field-wide {
  grid-column: 1 / -1;
}

.project-more-fields textarea.input {
  min-height: 78px;
  resize: vertical;
}

form[data-form="admin-integration-config"] textarea.input {
  word-break: break-all;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 700;
}

.import-overwrite-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.form-toggle,
.card-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.form-toggle input,
.card-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  flex: none;
}

.product-hot-badge {
  background: rgba(192, 108, 71, 0.12);
  color: var(--accent);
}

.import-overwrite-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
  flex: none;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid rgba(57, 44, 25, 0.12);
  background: rgba(255, 255, 255, 0.84);
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--text);
  outline: none;
}

.textarea {
  min-height: 112px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(31, 111, 120, 0.46);
  box-shadow: 0 0 0 4px rgba(31, 111, 120, 0.08);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  background: rgba(247, 240, 230, 0.86);
  color: var(--text-soft);
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
}

.search-field {
  position: relative;
  min-width: min(360px, 100%);
}

.search-field-input {
  padding-left: 90px;
  padding-right: 90px;
}

.search-field-action {
  position: absolute;
  top: 7px;
  right: 7px;
  bottom: 7px;
  border: none;
  border-radius: 999px;
  padding: 0 16px;
  background: linear-gradient(135deg, rgba(31, 111, 120, 0.12), rgba(192, 108, 71, 0.18));
  color: var(--primary-strong);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.search-field-action-primary {
  right: 7px;
}

.search-field-action-secondary {
  left: 7px;
  right: auto;
  background: rgba(31, 111, 120, 0.08);
  color: var(--text-muted);
}

.search-field-action:hover {
  transform: translateY(-1px);
}

.product-config-stack {
  gap: 20px;
}

.product-config-overview {
  display: grid;
  gap: 12px;
}

.product-config-gallery-strip,
.admin-product-gallery-preview {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.product-config-gallery-thumb,
.admin-product-gallery-preview-item {
  flex: 0 0 82px;
  padding: 0;
  border: 1px solid rgba(57, 44, 25, 0.12);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.product-config-gallery-thumb.is-active {
  border-color: rgba(31, 111, 120, 0.36);
  box-shadow: 0 0 0 3px rgba(31, 111, 120, 0.12);
}

.product-config-gallery-thumb .product-cover,
.admin-product-gallery-preview-item .product-cover {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.product-config-cover {
  border-radius: 20px;
}

.product-config-space-picker {
  display: grid;
  gap: 10px;
}

.product-config-space-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(57, 44, 25, 0.08);
  background: rgba(255, 255, 255, 0.84);
}

.product-config-space-trigger-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.product-config-space-trigger-copy span {
  color: var(--text-soft);
  font-size: 12px;
}

.product-config-space-trigger-copy strong {
  font-size: 15px;
  line-height: 1.4;
}

.product-config-space-sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
}

.product-config-space-sheet-layer[hidden] {
  display: none;
}

.product-config-space-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(25, 19, 11, 0.32);
}

.product-config-space-sheet {
  position: relative;
  width: min(560px, calc(100vw - 24px));
  max-height: min(70vh, 520px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 28px;
  background: rgba(255, 252, 247, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: 0 28px 60px rgba(34, 24, 12, 0.22);
}

.product-config-space-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.product-config-space-sheet-head strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.product-config-space-sheet-list {
  display: grid;
  gap: 10px;
}

.product-config-space-row {
  position: relative;
  display: block;
  cursor: pointer;
}

.product-config-space-row-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.product-config-space-row-copy {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(57, 44, 25, 0.08);
  background: rgba(255, 255, 255, 0.84);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.product-config-space-row:hover .product-config-space-row-copy {
  border-color: rgba(31, 111, 120, 0.22);
  transform: translateY(-1px);
}

.product-config-space-row-input:checked + .product-config-space-row-copy {
  border-color: rgba(31, 111, 120, 0.26);
  background: linear-gradient(135deg, rgba(31, 111, 120, 0.12), rgba(255, 255, 255, 0.84));
  box-shadow: 0 10px 22px rgba(31, 111, 120, 0.08);
}

.product-config-space-row-input:focus-visible + .product-config-space-row-copy {
  border-color: rgba(31, 111, 120, 0.28);
  box-shadow: 0 0 0 4px rgba(31, 111, 120, 0.08);
}

.product-config-space-row-copy strong {
  font-size: 15px;
}

.product-config-space-row-copy span {
  color: var(--text-soft);
  font-size: 13px;
}

.product-config-status {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-radius: 22px;
  border: 1px dashed rgba(31, 111, 120, 0.22);
  background: linear-gradient(180deg, rgba(31, 111, 120, 0.06), rgba(255, 255, 255, 0.76));
  text-align: center;
}

.product-config-status strong {
  font-size: 18px;
}

.product-config-status.is-error {
  border-color: rgba(181, 69, 69, 0.24);
  background: linear-gradient(180deg, rgba(181, 69, 69, 0.08), rgba(255, 255, 255, 0.8));
}

.product-config-loader {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(31, 111, 120, 0.12);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

.option-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.option-chip {
  position: relative;
  display: inline-flex;
  min-width: 132px;
  cursor: pointer;
}

.option-chip-space {
  min-width: 180px;
}

.option-chip-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.option-chip-copy {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid rgba(57, 44, 25, 0.08);
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.option-chip:hover .option-chip-copy {
  border-color: rgba(31, 111, 120, 0.22);
  transform: translateY(-1px);
}

.option-chip-input:checked + .option-chip-copy,
.option-chip.is-selected .option-chip-copy {
  border-color: rgba(31, 111, 120, 0.26);
  background: linear-gradient(135deg, rgba(31, 111, 120, 0.12), rgba(255, 255, 255, 0.82));
  box-shadow: 0 10px 22px rgba(31, 111, 120, 0.08);
}

.option-chip-input:focus-visible + .option-chip-copy {
  border-color: rgba(31, 111, 120, 0.28);
  box-shadow: 0 0 0 4px rgba(31, 111, 120, 0.08);
}

.option-chip-title {
  font-size: 14px;
  line-height: 1.45;
}

.option-chip-note {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}

.product-config-meta-grid {
  gap: 16px;
}

.product-config-summary {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(31, 111, 120, 0.14);
  background:
    radial-gradient(circle at top right, rgba(31, 111, 120, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 240, 230, 0.86));
}

.product-config-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-config-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-config-summary-grid article {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(57, 44, 25, 0.08);
}

.product-config-summary-grid span {
  color: var(--text-soft);
  font-size: 12px;
}

.product-config-summary-grid strong {
  font-size: 14px;
}

.space-picker {
  display: grid;
  gap: 12px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.space-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.space-option input {
  width: 18px;
  height: 18px;
  margin-top: 16px;
  accent-color: var(--primary);
  flex: none;
}

.space-option-copy {
  flex: 1;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(57, 44, 25, 0.08);
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.space-option:hover .space-option-copy {
  border-color: rgba(31, 111, 120, 0.22);
  transform: translateY(-1px);
}

.space-option input:checked + .space-option-copy {
  border-color: rgba(31, 111, 120, 0.26);
  background: linear-gradient(135deg, rgba(31, 111, 120, 0.12), rgba(255, 255, 255, 0.78));
}

.space-option.is-disabled {
  cursor: not-allowed;
}

.space-option.is-disabled input {
  cursor: not-allowed;
}

.space-option.is-disabled .space-option-copy {
  background: rgba(247, 240, 230, 0.72);
  color: var(--text-soft);
}

.space-option.is-disabled:hover .space-option-copy {
  transform: none;
  border-color: rgba(57, 44, 25, 0.08);
}

.space-option-name {
  font-size: 15px;
}

.space-option-note {
  color: var(--text-soft);
  font-size: 13px;
}

.space-toolbar-card {
  display: grid;
  gap: 16px;
}

.space-tab-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.space-pill {
  flex: 0 0 auto;
  display: flex;
  border-radius: 999px;
  border: 1px solid rgba(57, 44, 25, 0.08);
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.space-pill.active {
  border-color: rgba(31, 111, 120, 0.22);
  background: linear-gradient(135deg, rgba(31, 111, 120, 0.12), rgba(255, 255, 255, 0.78));
}

.space-pill-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 220px;
  border: none;
  background: transparent;
  padding: 12px 14px;
  color: inherit;
}

.space-pill-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.space-toolbar-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.space-toolbar-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.chip {
  border: 1px solid rgba(57, 44, 25, 0.1);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14px;
}

.chip.active {
  background: rgba(31, 111, 120, 0.12);
  color: var(--primary-strong);
  border-color: rgba(31, 111, 120, 0.22);
}

.result-meta,
.pagination,
.pagination-controls,
.page-list {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.result-meta,
.pagination {
  justify-content: space-between;
}

.result-meta {
  margin-bottom: 18px;
}

.pagination {
  margin-top: 18px;
}

.result-note,
.pagination-ellipsis {
  font-size: 13px;
}

.pagination-controls {
  justify-content: flex-end;
}

.page-list {
  gap: 8px;
}

.page-btn {
  min-width: 40px;
  border: 1px solid rgba(57, 44, 25, 0.1);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}

.page-btn.active {
  background: rgba(31, 111, 120, 0.12);
  color: var(--primary-strong);
  border-color: rgba(31, 111, 120, 0.22);
}

.product-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.product-card {
  overflow: hidden;
}

.product-image-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.product-image-trigger-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(25, 19, 11, 0.76);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.product-cover {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.product-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.product-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.price {
  font-weight: 800;
  color: var(--accent);
}

.space-card,
.selected-item,
.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.detail-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid rgba(57, 44, 25, 0.12);
  white-space: nowrap;
}

.detail-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(57, 44, 25, 0.06);
  vertical-align: middle;
}

.detail-table tbody tr:hover {
  background: rgba(31, 111, 120, 0.04);
}

.detail-table .select,
.detail-table .input {
  min-width: 80px;
  font-size: 13px;
  padding: 6px 10px;
}

.detail-table .btn-sm {
  font-size: 13px;
  padding: 5px 12px;
}

.detail-table .product-name-cell strong {
  display: block;
  margin-bottom: 2px;
}

.detail-table .product-name-cell .muted {
  font-size: 12px;
}

.detail-table .price-cell {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.detail-table .num-cell {
  text-align: center;
}

.detail-table .action-cell {
  text-align: center;
  white-space: nowrap;
}

.detail-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.space-card.active {
  border-color: rgba(31, 111, 120, 0.22);
  background: linear-gradient(135deg, rgba(31, 111, 120, 0.12), rgba(255, 255, 255, 0.74));
}

.space-card h4,
.selected-item h4 {
  margin: 0;
}

.space-card p,
.selected-item p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-soft);
}


.detail-summary-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(57, 44, 25, 0.08);
}

.detail-summary-bar strong {
  color: var(--text);
  font-weight: 600;
}

.detail-summary-bar [aria-hidden] {
  color: rgba(57, 44, 25, 0.18);
}

.workbench-summary-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.workbench-summary-strip .metric {
  flex: 1 0 0;
  min-width: 180px;
}

.workbench-summary-strip .metric p,
.workbench-summary-strip .metric strong {
  white-space: nowrap;
}

.detail-project-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.project-meta-card {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(57, 44, 25, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.project-meta-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.project-meta-value {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
  word-break: break-word;
}

.summary-kpi strong,
.stat-grid strong {
  display: block;
  font-size: 28px;
  margin-bottom: 4px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(57, 44, 25, 0.08);
  vertical-align: top;
}

th {
  color: var(--text-soft);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty-state {
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(25, 19, 11, 0.42);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 60;
}

.product-image-viewer-modal {
  padding: 0;
  background: rgba(15, 13, 11, 0.92);
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: rgba(255, 252, 247, 0.96);
}

.product-image-viewer-card {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  background: rgba(15, 13, 11, 0.98);
  color: #fff;
  display: grid;
  grid-template-rows: auto 1fr;
}

.product-image-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
}

.product-image-viewer-index {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.product-image-viewer-stage {
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 20px 18px 28px;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.product-image-viewer-image {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  grid-column: 2;
}

.product-image-viewer-status {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  grid-column: 1 / -1;
}

.product-image-viewer-status.is-warning {
  color: #ffd27d;
}

.product-image-viewer-nav {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
}

.product-image-viewer-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.scan-modal {
  display: grid;
  gap: 16px;
}

.scan-stage {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(57, 44, 25, 0.12);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(135deg, #1f6f78, #29524a 46%, #c06c47);
  min-height: 320px;
}

.scan-video {
  width: 100%;
  height: min(58vh, 420px);
  object-fit: cover;
  background: rgba(18, 18, 18, 0.7);
}

.scan-frame {
  position: absolute;
  inset: 15% 21%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: 0 0 0 999px rgba(15, 11, 7, 0.22);
  pointer-events: none;
}

.scan-stage-copy {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(20, 15, 9, 0.56);
  color: #fffaf2;
  backdrop-filter: blur(12px);
}

.scan-stage-copy strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.scan-stage-copy p {
  margin: 0;
  color: rgba(255, 250, 242, 0.84);
}

.scan-stage.is-error .scan-video {
  opacity: 0.24;
  filter: grayscale(1);
}

.scan-stage.is-error .scan-frame {
  display: none;
}

.selected-panel {
  position: sticky;
  top: 106px;
}

.toast-wrap {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 12px;
  z-index: 80;
}

.toast {
  min-width: 260px;
  max-width: 380px;
  padding: 14px 16px;
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 18px 32px rgba(24, 20, 13, 0.22);
}

.toast.info {
  background: linear-gradient(135deg, #1f6f78, #164b52);
}

.toast.success {
  background: linear-gradient(135deg, #457b50, #2f5d39);
}

.toast.error {
  background: linear-gradient(135deg, #b54545, #7e2f2f);
}

.toast-wrap:empty {
  display: none;
}

.print-only {
  display: none;
}

@page {
  size: A4;
  margin: 14mm 12mm 16mm;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .hero,
  .login-grid,
  .workbench-grid,
  .admin-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: static;
  }

  .dashboard-stat-grid,
  .dashboard-insight-list,
  .dashboard-panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-panel-wide,
  .dashboard-insight-card-wide {
    grid-column: 1 / -1;
  }

  .workbench-project-head {
    flex-direction: column;
    align-items: stretch;
  }

  .workbench-project-actions {
    justify-content: flex-start;
  }

  .workbench-project-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-project-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .selected-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(var(--content), calc(100% - 24px));
    padding-top: 18px;
  }

  .topbar {
    padding: 14px 16px;
    border-radius: 22px;
  }

  .hero-card,
  .panel,
  .login-card,
  .space-panel,
  .space-toolbar-card,
  .table-card,
  .summary-card,
  .detail-space,
  .history-card,
  .modal-card {
    padding: 18px;
    border-radius: 22px;
  }

  .choice-grid,
  .summary-kpi,
  .metric-grid,
  .workbench-project-fields,
  .project-more-fields-grid,
  .detail-project-meta,
  .stat-grid,
  .dashboard-stat-grid,
  .dashboard-insight-list,
  .dashboard-panel-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-trend-bars {
    width: max(100%, 840px);
  }

  .space-pill {
    max-width: calc(100vw - 72px);
  }

  .space-pill-main {
    max-width: calc(100vw - 132px);
  }

  .search-field {
    min-width: 100%;
  }

  .product-config-space-trigger {
    align-items: stretch;
    flex-direction: column;
  }

  .product-config-space-sheet-head {
    flex-direction: column;
    align-items: stretch;
  }

  .product-config-space-sheet-head .btn {
    align-self: flex-start;
  }

  .product-config-space-sheet-layer {
    padding: 12px;
  }

  .product-config-space-sheet {
    width: min(100vw - 12px, 560px);
    max-height: min(76vh, 560px);
    padding: 18px;
    border-radius: 24px;
  }

  .option-chip,
  .option-chip-space {
    width: 100%;
  }

  .product-config-summary-grid {
    grid-template-columns: 1fr;
  }

  .scan-frame {
    inset: 18% 12%;
  }
}

@media print {
  body {
    background: #fff;
    color: #1f1a17;
    font-family: "SimSun", "Songti SC", serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body::before,
  body::after,
  .topbar,
  .side-nav,
  .modal,
  .toast-wrap,
  .screen-only {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .print-only > h2,
  .print-only > p {
    display: none !important;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .detail-space,
  .summary-card,
  .table-card,
  .history-card {
    box-shadow: none;
    border: 1px solid #d9d1c6;
    background: #fff;
  }

  .print-sheet {
    display: grid;
    gap: 14px;
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2f2418;
  }

  .print-brand h1,
  .print-space-head h2 {
    margin: 0;
    color: #201913;
    letter-spacing: 0.08em;
  }

  .print-kicker,
  .print-space-index {
    margin: 0 0 6px;
    color: #7a6550;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
  }

  .print-project {
    margin: 8px 0 0;
    font-size: 13px;
    color: #4a3a2a;
  }

  .print-code-block {
    min-width: 220px;
    display: grid;
    gap: 6px;
  }

  .print-code-block p,
  .print-space-head p,
  .print-footer p {
    margin: 0;
    font-size: 11px;
    color: #6f5b48;
  }

  .print-code-block span,
  .print-meta-card span,
  .print-metric span,
  .print-space-total span {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: #7a6550;
    text-transform: uppercase;
  }

  .print-code-block strong,
  .print-meta-card strong,
  .print-metric strong,
  .print-space-total strong {
    color: #201913;
    font-size: 13px;
  }

  .print-overview {
    display: grid;
    gap: 10px;
  }

  .print-meta-grid,
  .print-metrics {
    display: grid;
    gap: 10px;
  }

  .print-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .print-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .print-meta-card,
  .print-metric {
    border: 1px solid #d9d1c6;
    border-radius: 8px;
    padding: 10px 12px;
    background: #faf7f2;
  }

  .print-space-list {
    display: grid;
    gap: 12px;
  }

  .print-space-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-space-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 8px;
  }

  .print-space-total {
    min-width: 120px;
    text-align: right;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 11px;
  }

  .print-table thead {
    display: table-header-group;
  }

  .print-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .print-table th,
  .print-table td {
    padding: 7px 8px;
    border: 1px solid #d9d1c6;
    vertical-align: top;
    line-height: 1.45;
  }

  .print-table th {
    background: #f3ece3;
    color: #4a3a2a;
    font-size: 10px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.04em;
  }

  .print-table td {
    word-break: break-word;
    color: #201913;
  }

  .print-table .is-number {
    text-align: right;
    white-space: nowrap;
  }

  .print-product-cell {
    display: grid;
    gap: 4px;
  }

  .print-flag {
    display: inline-block;
    width: fit-content;
    padding: 1px 6px;
    border: 1px solid #c95f5f;
    border-radius: 999px;
    color: #a94444;
    font-size: 10px;
  }

  .print-empty {
    padding: 14px 16px;
    border: 1px dashed #d9d1c6;
    border-radius: 8px;
    color: #7a6550;
    font-size: 11px;
    text-align: center;
  }

  .print-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #d9d1c6;
  }
}
