﻿:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f7faff;
  --line: #c8d5ea;
  --line-strong: #9eb9df;
  --text: #182338;
  --muted: #60708a;
  --weak: #7d8daa;
  --brand: #1f5eff;
  --brand-deep: #1645be;
  --brand-soft: #e6efff;
  --danger: #cf304f;
  --success: #178f57;
  --shadow: 0 12px 32px rgba(28, 57, 110, 0.08);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'HarmonyOS Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, #f7f9fd 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.64;
}

.shell {
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
}

.sidebar-scroll {
  flex: 1;
  overflow: auto;
  padding: 14px 12px 10px;
}

.brand-block {
  padding: 10px 10px 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
}

.brand-kicker,
.page-tag {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--brand);
}

.brand-block h1,
.workspace-head h2,
.content-toolbar h3,
.detail-panel-head h3,
.create-modal-head h3 {
  margin: 0;
}

.brand-copy,
.workspace-head p,
.content-toolbar p,
.detail-panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.tree-section {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.tree-title {
  margin: 0;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #244370;
  background: linear-gradient(180deg, #dfeaff 0%, #c8dcff 100%);
  border-bottom: 1px solid var(--line-strong);
}

.tree-list {
  display: grid;
  gap: 2px;
  padding: 6px;
}

.tree-node,
.nav-item {
  position: relative;
  padding: 7px 10px 7px 18px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  color: var(--text);
}

.tree-node::before,
.nav-item::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 13px;
  width: 6px;
  height: 6px;
  border: 1px solid #7e9cca;
  background: #fff;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, #fdfefe 0%, #dce9ff 100%);
}

.nav-item.active {
  color: #103d98;
  font-weight: 700;
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #edf4ff 0%, #dfeaff 100%);
}

.sidebar-footer-account {
  display: grid;
  gap: 8px;
}

.nav-item-footer {
  padding-left: 18px;
  border-color: var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #e6f0ff 100%);
}

.sidebar-user-meta {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.sidebar-user-meta strong {
  font-size: 14px;
}

.sidebar-user-meta span {
  font-size: 12px;
  color: var(--muted);
}

.sidebar-footer-status {
  display: grid;
  gap: 4px;
}

.sidebar-footer span {
  display: block;
  font-size: 12px;
  color: var(--weak);
}

.sidebar-footer strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: 100vh;
  overflow: hidden;
  padding: 10px 12px 12px;
}

.legacy-panel,
.content-panel,
.detail-panel,
.create-modal {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  display: none;
  min-height: 0;
}

.panel.active {
  display: block;
  min-height: 0;
}

.legacy-panel,
.content-panel {
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.user-center-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.user-center-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  min-height: 0;
  overflow: auto;
}

.user-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.sidebar-logout-btn {
  width: 100%;
  justify-content: center;
}

.user-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.user-card-head h4 {
  margin: 0;
}

.user-account-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.94) 100%);
}

.user-account-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--weak);
}

.user-account-hero strong {
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.03em;
}

.user-account-hero-operators {
  background: rgba(247, 250, 252, 0.92);
}

.user-summary-grid,
.user-form {
  display: grid;
  gap: 12px;
}

.compact-user-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-user-form .user-form-actions {
  grid-column: 1 / -1;
}

.user-form label,
.user-summary-grid label {
  display: grid;
  gap: 6px;
}

.user-form label span,
.user-summary-grid label span {
  font-size: 12px;
  color: var(--muted);
}

.user-form input,
.user-summary-grid input {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.user-form-actions {
  display: flex;
  justify-content: flex-start;
}

.user-card-divider {
  height: 1px;
  background: var(--line);
}

.user-panel-status {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
}

.user-panel-status.is-error,
.auth-status.is-error {
  border-color: rgba(207, 48, 79, 0.35);
  color: var(--danger);
  background: rgba(207, 48, 79, 0.08);
}

.user-table-wrap {
  min-height: 0;
}

.user-table th,
.user-table td {
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.user-table td:first-child,
.user-table th:first-child {
  text-align: left;
}

.action-row-operator {
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.user-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e7f6ee;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.user-status-pill.is-disabled {
  background: #f8e9ed;
  color: var(--danger);
}

.app-boot-error,
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(31, 94, 255, 0.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(22, 143, 87, 0.12), transparent 28%),
    linear-gradient(180deg, #edf3ff 0%, #f7f9fd 100%);
}

.auth-shell,
.app-boot-error {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(320px, 460px);
  gap: 24px;
  align-items: center;
  min-height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px;
}

.auth-hero,
.auth-panel,
.app-boot-error-card {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.auth-hero {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.auth-hero h1,
.app-boot-error-card h1 {
  margin: 0;
}

.auth-copy {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

.auth-tip-list {
  display: grid;
  gap: 12px;
}

.auth-tip-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #f9fbff 0%, #edf4ff 100%);
}

.auth-panel,
.app-boot-error-card {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.auth-panel-head h2 {
  margin: 0;
}

.auth-panel-head p,
.app-boot-error-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
}

.auth-form label span {
  font-size: 12px;
  color: var(--muted);
}

.auth-form input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.auth-submit-btn {
  min-height: 42px;
  justify-content: center;
}

.auth-status {
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

.auth-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
}

.auth-footer p {
  margin: 0;
}

.auth-footer a {
  color: var(--muted);
  text-decoration: none;
}

.auth-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

@media (max-width: 1080px) {
  .user-center-grid,
  .auth-shell,
  .app-boot-error {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .workspace {
    height: auto;
    min-height: 0;
  }

  .compact-user-form {
    grid-template-columns: 1fr;
  }
}

#view-products {
  height: 100%;
}

#view-products .legacy-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) 52px;
}

.legacy-toolbar,
.content-toolbar {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f7fbff 0%, #ebf3ff 100%);
}

.content-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.toolbar-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  overflow: hidden;
}

.toolbar-inline > .toolbar-filters {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.toolbar-leading-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.toolbar-trailing-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  justify-content: flex-end;
}

.batch-action-dropdown-wrap {
  position: relative;
}

.batch-action-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 12;
  min-width: 132px;
  display: grid;
  gap: 2px;
  padding: 4px;
  border: 1px solid #8ea7cc;
  background: linear-gradient(180deg, #fefefe 0%, #edf4ff 100%);
  box-shadow: 0 10px 24px rgba(34, 71, 130, 0.18);
}

.batch-action-dropdown[hidden] {
  display: none;
}

.batch-action-dropdown-item {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #224782;
  text-align: left;
  white-space: nowrap;
}

.batch-action-dropdown-item:hover,
.batch-action-dropdown-item:focus-visible {
  border-color: #b7cae8;
  background: #dce9ff;
  outline: none;
}

.batch-action-dropdown-item.danger {
  color: #9f1f3a;
}

.toolbar-actions,
.filter-actions,
.sheet-upload-tools,
.sheet-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-filters {
  display: grid;
  grid-template-columns: 220px 150px 150px 170px 170px auto;
  gap: 10px;
  align-items: end;
}

/* 筛选折叠按钮：桌面端隐藏，移动端通过媒体查询显示 */
.filter-toggle-btn {
  display: none;
}

.toolbar-filters .filter-actions {
  flex-wrap: nowrap;
  align-self: end;
}

label {
  display: grid;
  gap: 6px;
}

label span {
  font-size: 12px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(31, 94, 255, 0.12);
}

.mini-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #ffffff 0%, #dce9ff 100%);
  color: #224782;
}

.mini-btn.primary {
  border-color: #0f4adb;
  color: #fff;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
}

.mini-btn.danger {
  border-color: #b21f3c;
  color: #fff;
  background: linear-gradient(180deg, #e04968 0%, #bc2242 100%);
}

.toolbar-status {
  padding: 9px 12px;
  font-size: 13px;
  color: #244370;
  border-top: 1px solid #eff4ff;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fdfefe 0%, #f2f7ff 100%);
}

.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  background: #fff;
}

.legacy-table-wrap {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-thead-outer {
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 2px solid #b7cae8;
}

.product-tbody-outer {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  background: #fff;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff 0%, #edf4ff 100%);
  overflow: hidden;
  flex-shrink: 0;
}

.pagination-info {
  font-size: 12px;
  color: var(--muted);
}

.pagination-actions,
.page-number-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.legacy-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.product-table {
  table-layout: fixed;
}

.legacy-table th,
.legacy-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #d8e3f1;
  font-size: 12px;
  text-align: center;
  vertical-align: middle;
}

.legacy-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 700;
  color: #31598f;
  background: linear-gradient(180deg, #fefefe 0%, #dde9ff 100%);
}

/* product 表头已提取为独立容器，不需要 sticky */
.product-thead-outer .legacy-table th {
  position: static;
}

.product-table th,
.product-table td {
  position: relative;
}

.product-table th:not(:last-child),
.product-table td:not(:last-child) {
  border-right: 1px solid #d8e4f5;
}

.product-table th[data-column-key] {
  cursor: move;
  user-select: none;
}

.product-table th[data-column-key]::after {
  content: '⇅';
  margin-left: 6px;
  font-size: 10px;
  color: #90a6ca;
}

.product-table th.is-dragging {
  opacity: 0.58;
}

.product-table th.is-drag-over {
  background: linear-gradient(180deg, #fefefe 0%, #cfe0ff 100%);
}

.product-table [data-column-key='brand'] {
  width: 80px;
  min-width: 80px;
}

.product-table [data-column-key='image'],
.product-table [data-column-key='similarImage'] {
  width: 142px;
  min-width: 142px;
}

.product-table [data-column-key='compareActions'] {
  width: 130px;
  min-width: 130px;
}

.product-table [data-column-key='syncStatus'] {
  width: 92px;
  min-width: 92px;
  padding-left: 2px;
  padding-right: 2px;
}

.product-table [data-column-key='factory'] {
  width: 88px;
  min-width: 88px;
}

.product-table [data-column-key='productId'] {
  width: 72px;
  min-width: 72px;
}

.product-table [data-column-key='styleNo'] {
  width: 106px;
  min-width: 106px;
}

.product-table [data-column-key='createdAt'],
.product-table [data-column-key='updatedAt'] {
  width: 142px;
  min-width: 142px;
}

.product-table [data-column-key^='field:'] {
  width: 140px;
  min-width: 140px;
}

.legacy-row:hover {
  background: #f5f9ff;
}

.legacy-row.is-active {
  background: #dfeaff;
}

.legacy-row.is-selected {
  background: #eaf2ff;
}

.legacy-row.is-active.is-selected {
  background: #d6e5ff;
}

.image-cell {
  min-width: 138px;
}

.image-card {
  display: inline-grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
  min-height: 0;
  margin: 0 auto;
}

.image-card img,
.queue-preview,
.gallery-item img {
  display: block;
  background: #f2f6fc;
  object-fit: contain;
}

.image-card img {
  width: 120px;
  height: 92px;
  border: 1px solid var(--line);
}

.image-card span,
.image-card strong,
.queue-meta,
.gallery-caption span {
  font-size: 11px;
  line-height: 1.45;
}

.sync-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line);
  font-size: 11px;
  border-radius: 999px;
}

.status-success {
  color: #0d6a3b;
  border-color: #8cd2ae;
  background: #ebfbf2;
}

.status-failed {
  color: #a0203d;
  border-color: #efb2bf;
  background: #fff1f4;
}

.status-pending {
  color: #7c5a12;
  border-color: #e8cc88;
  background: #fff8e8;
}

.sync-message-text,
.detail-image-sync-message {
  color: var(--muted);
  word-break: break-word;
}

.similar-cell {
  min-width: 138px;
}

.sync-status-cell {
  min-width: 74px;
}

.similar-placeholder {
  display: inline-grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.similar-result-card {
  display: inline-grid;
  gap: 4px;
  justify-items: center;
  align-content: center;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.similar-result-card img {
  width: 120px;
  height: 92px;
  border: 0;
  background: #f2f6fc;
  object-fit: contain;
}

.similar-result-card strong,
.similar-result-card span {
  font-size: 11px;
  line-height: 1.45;
}

.similar-result-id {
  max-width: 120px;
  text-align: center;
  word-break: break-all;
}

.similar-result-chip {
  margin-top: 2px;
}

.compare-action-cell {
  min-width: 126px;
  text-align: center;
}

.compare-action-stack {
  display: inline-grid;
  gap: 6px;
  justify-items: center;
  margin: 0 auto;
}

.compare-action-stack .mini-btn {
  min-width: 96px;
  white-space: nowrap;
}

.brand-block h1 {
  line-height: 1.18;
}

.cell-stack {
  display: grid;
  gap: 5px;
  align-content: center;
  justify-items: start;
  text-align: left;
}

.cell-stack.compact {
  gap: 7px;
}

.cell-stack strong {
  font-size: 13px;
  color: var(--text);
}

.cell-stack span,
.cell-helper {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.similar-placeholder span {
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.similar-thumb {
  width: 120px;
  height: 92px;
  border: 0;
  background: linear-gradient(135deg, #f7faff 0%, #ecf3ff 100%);
}

.legacy-table td > * {
  margin-left: auto;
  margin-right: auto;
}

.score-text {
  color: #153f99;
  font-weight: 700;
}

.action-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.detail-panel {
  padding: 12px;
  border: 0;
  border-right: 1px solid var(--line);
  box-shadow: none;
  background: linear-gradient(180deg, #fdfefe 0%, #f6faff 100%);
}

.detail-panel-media {
  border-right: 0;
}

.detail-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-item,
.detail-empty,
.dictionary-item,
.detail-note-box {
  border: 1px solid var(--line);
  background: #fff;
}

.detail-item {
  padding: 10px;
}

.detail-item span {
  display: block;
  color: var(--weak);
  font-size: 11px;
  margin-bottom: 6px;
}

.detail-item strong {
  display: block;
  line-height: 1.6;
  word-break: break-word;
}

.detail-empty {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--muted);
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.gallery-item {
  border: 1px solid var(--line);
  background: #fff;
}

.gallery-item img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: #f2f6fc;
}

.gallery-caption {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.gallery-caption strong {
  font-size: 12px;
  color: #1f3d73;
}

.detail-note-box {
  min-height: 80px;
  padding: 10px;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.7;
}

.dictionary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
}

.dictionary-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.dictionary-item:hover {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.dictionary-item-main {
  display: grid;
  gap: 6px;
}

.dictionary-item-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dictionary-item-count {
  font-size: 12px;
  color: var(--muted);
}

.dictionary-item-summary {
  color: #244370;
  line-height: 1.6;
}

.dictionary-item-desc {
  color: var(--muted);
  font-size: 12px;
}

.dictionary-item-side {
  display: flex;
  align-items: center;
}

.dictionary-item.is-product-field .dictionary-item-title-row {
  justify-content: flex-start;
}

.dictionary-item.is-product-field .dictionary-item-count {
  display: none;
}

.dictionary-item strong {
  font-size: 15px;
}

.dictionary-item span {
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(22, 37, 68, 0.3);
  z-index: 20;
}

.modal-overlay.active {
  display: flex;
}

.progress-overlay {
  z-index: 60;
  background: rgba(13, 25, 48, 0.42);
}

.progress-modal {
  width: min(460px, calc(100vw - 28px));
  padding: 22px 22px 18px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #fdfefe 0%, #edf4ff 100%);
  box-shadow: 0 22px 48px rgba(13, 31, 68, 0.22);
}

.progress-modal-head {
  display: grid;
  gap: 4px;
}

.progress-modal-message {
  margin: 14px 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.progress-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #dfe9fb 0%, #edf3ff 100%);
}

.progress-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0f56ee 0%, #5f95ff 52%, #9bc0ff 100%);
  transition: width 0.24s ease;
}

.progress-bar-fill.is-indeterminate {
  width: 45%;
  animation: progress-indeterminate 1.2s linear infinite;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--weak);
}

.progress-meta span:first-child {
  color: #1c4fb8;
  font-weight: 700;
}

.compare-result-modal {
  height: min(760px, calc(100vh - 28px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.compare-result-body {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.compare-result-head {
  align-items: start;
}

.compare-result-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.compare-result-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.compare-result-source-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 255, 0.94) 100%);
}

.compare-result-source-main {
  display: grid;
  gap: 6px;
}

.compare-source-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.04em;
}

.compare-result-source-main strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.compare-result-source-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.compare-result-source-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compare-result-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.84);
}

.compare-summary-card {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #dbe6f5;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.compare-summary-card span {
  font-size: 12px;
  color: var(--muted);
}

.compare-summary-card strong {
  font-size: 16px;
  color: #1b407f;
}

.compare-result-list-wrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  gap: 0;
  padding: 12px 14px 14px;
  position: relative;
  isolation: isolate;
}

.compare-result-list-head {
  display: grid;
  grid-template-columns: 64px 148px 110px 110px 120px 120px 130px 110px;
  gap: 12px;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #31598f;
  border-bottom: 1px solid #dde7f4;
  justify-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.98);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  position: relative;
  z-index: 2;
}

.compare-result-list-head span {
  justify-self: center;
}

.compare-result-list {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding: 10px 0 0;
  position: relative;
  z-index: 1;
}

.compare-result-row {
  display: grid;
  grid-template-columns: 64px 148px 110px 110px 120px 120px 130px 110px;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dde7f4;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.compare-result-row.is-marked {
  border-color: #79a6e8;
  background: linear-gradient(180deg, #f6fbff 0%, #ecf5ff 100%);
}

.compare-result-rank {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #294a80;
}

.compare-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #99b5e6;
  background: linear-gradient(180deg, #edf4ff 0%, #dfeaff 100%);
  font-weight: 700;
}

.compare-result-thumb {
  display: flex;
  justify-content: center;
  align-items: center;
}

.compare-result-thumb img,
.compare-result-thumb .similar-thumb {
  width: 124px;
  height: 94px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: #f1f5fb;
}

.compare-result-cell {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
}

.compare-result-cell strong,
.compare-result-score strong {
  font-size: 15px;
  color: #163f8c;
}

.compare-result-score {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.compare-result-op {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.compare-result-op .mini-btn {
  min-width: 88px;
}

.compare-result-marked {
  font-size: 12px;
  color: #1b4f9a;
  font-weight: 700;
}

.create-modal.compare-filter-modal {
  width: min(480px, calc(100vw - 40px));
  max-width: min(480px, calc(100vw - 40px));
  max-height: min(560px, calc(100vh - 28px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.compare-filter-head {
  align-items: start;
}

.compare-filter-body {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 8px;
}

.compare-filter-option-list {
  display: grid;
  gap: 8px;
}

.compare-filter-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid #d7e3f5;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  cursor: pointer;
}

.compare-filter-option input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.compare-filter-option.is-selected {
  border-color: #79a6e8;
  background: linear-gradient(180deg, #f5faff 0%, #eaf3ff 100%);
}

.compare-filter-option strong {
  color: #153e88;
}

.compare-filter-option span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.compare-filter-actions {
  justify-content: flex-end;
}

.compare-result-empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

body.operation-lock {
  overflow: hidden;
}

@keyframes progress-indeterminate {
  0% {
    transform: translateX(-130%);
  }

  100% {
    transform: translateX(280%);
  }
}

.create-modal {
  width: min(1240px, 100%);
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 10px;
  background: linear-gradient(180deg, #eef4ff 0%, #dfeaff 100%);
}

.create-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 10px;
}

.create-sheet {
  display: grid;
  gap: 10px;
}

.operator-create-modal {
  width: min(480px, calc(100vw - 32px));
}

.operator-modal-form {
  display: grid;
  gap: 14px;
  padding: 16px 20px 20px;
}

.operator-modal-status:empty {
  display: none;
}

.operator-modal-actions {
  display: flex;
  justify-content: center;
}

.user-card-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.product-create-modal,
.batch-product-modal,
.detail-modal,
.compare-result-modal {
  height: min(760px, calc(100vh - 28px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.product-create-modal .create-sheet,
.batch-product-modal .create-sheet {
  min-height: 0;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.detail-modal .create-sheet {
  min-height: 0;
  height: 100%;
}

.batch-product-modal {
  width: min(1160px, 100%);
}

.product-field-create-modal {
  width: min(460px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 28px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.delete-reason-modal {
  width: min(420px, calc(100vw - 32px));
  max-height: min(360px, calc(100vh - 28px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.delete-reason-sheet {
  min-height: 0;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
}

.delete-reason-body {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.78);
}

.delete-reason-text {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.delete-reason-actions {
  justify-content: flex-end;
}

.product-field-create-modal .create-sheet {
  min-height: 0;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0;
}

.product-field-create-actions {
  justify-content: flex-end;
  padding: 12px 14px;
}

.product-field-create-modal .sheet-body {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  height: auto;
  overflow: auto;
  padding: 14px;
}

.dictionary-modal {
  width: min(1320px, 100%);
  height: min(760px, calc(100vh - 28px));
  overflow: hidden;
}

.dictionary-sheet {
  height: calc(100% - 56px);
}

.product-field-manage-modal {
  width: min(980px, calc(100vw - 32px));
  height: 70vh;
  max-height: min(720px, calc(100vh - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.dictionary-manage-modal {
  width: min(980px, calc(100vw - 32px));
  height: 70vh;
  max-height: min(720px, calc(100vh - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.dictionary-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-top-row,
.sheet-body,
.sheet-footer {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.78);
}

.sheet-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
}

.sheet-inline-fields {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(220px, 420px);
  gap: 10px;
}

.sheet-upload-tools {
  justify-content: flex-end;
  min-width: 220px;
}

.sheet-body {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 12px;
  min-height: 560px;
  padding: 10px;
}

.product-create-modal .sheet-body,
.batch-product-modal .sheet-body,
.detail-modal .sheet-body {
  min-height: 0;
  height: 100%;
}

.product-create-modal .sheet-body {
  align-items: stretch;
}

.product-create-modal .sheet-form-column {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.product-create-modal .sheet-image-column {
  min-height: 0;
}

.product-field-manage-modal .sheet-body {
  grid-template-columns: minmax(0, 1fr);
  min-height: auto;
  height: auto;
}

.sheet-form-column {
  display: grid;
  gap: 10px;
  align-content: start;
}

.dictionary-body {
  min-height: 0;
  height: 100%;
}

.dictionary-manage-modal .dictionary-sheet {
  height: auto;
}

.dictionary-manage-body {
  grid-template-columns: minmax(0, 1fr);
  min-height: auto;
  height: auto;
  padding: 10px;
}

.dictionary-manage-list-column {
  min-height: 0;
}

.dictionary-manage-modal .queue-wrap {
  height: 100%;
  min-height: 400px;
  max-height: none;
}


.product-field-manage-modal .dictionary-sheet {
  height: 100%;
  min-height: 0;
}

.product-field-manage-modal .product-field-manage-body {
  padding: 10px;
  min-height: 0;
  height: 100%;
}

.product-field-manage-modal .product-field-manage-list-column {
  min-height: 0;
}

.dictionary-form-column {
  min-height: 0;
  grid-template-rows: repeat(4, auto) 1fr auto;
}

.dictionary-type-inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dictionary-form-actions {
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
}

.remark-field textarea {
  min-height: 118px;
}

.product-field-create-modal .remark-field textarea {
  min-height: 140px;
  height: 140px;
  max-height: 140px;
  width: 100%;
  max-width: 100%;
  resize: none;
  overflow: auto;
}

.product-field-create-modal .remark-field {
  min-height: 0;
}

.dictionary-item-form-modal {
  width: min(460px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 28px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.dictionary-item-form-modal .create-sheet {
  min-height: 0;
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0;
}

.dictionary-item-form-modal .sheet-body {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  height: auto;
  overflow: auto;
  padding: 14px;
}

.dictionary-item-form-modal .remark-field textarea {
  min-height: 140px;
  height: 140px;
  max-height: 140px;
  width: 100%;
  max-width: 100%;
  resize: none;
  overflow: auto;
}

.dictionary-item-form-modal .remark-field {
  min-height: 0;
}

.sheet-image-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}

.dictionary-list-column {
  min-height: 0;
}

.product-field-manage-modal .queue-wrap {
  height: 100%;
  min-height: 400px;
  max-height: none;
}

.dynamic-field-stack {
  display: grid;
  gap: 10px;
}

.dynamic-field-list-title {
  margin: 2px 0 0;
  font-size: 12px;
  color: #5b7398;
}

.dynamic-field-item input {
  background: #fff;
}

.detail-dynamic-field-stack input {
  background: #f9fbff;
}

.queue-wrap {
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow: auto;
}

.dictionary-list-wrap {
  height: 100%;
}

.pending-image-wrap,
.detail-gallery-wrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 10px;
}

.detail-gallery-wrap {
  border-radius: 18px;
}

.pending-image-head {
  display: grid;
  grid-template-columns: 56px 132px 120px 1fr 180px;
  gap: 12px;
  padding: 0 10px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #31598f;
  border-bottom: 1px solid #dde7f4;
}

.pending-image-list,
.detail-image-list,
.batch-image-list,
.dictionary-item-list {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding-top: 10px;
}

.pending-empty {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
}

.dictionary-item-head {
  grid-template-columns: 140px 80px 80px 1fr 120px;
  padding: 0 10px;
}

.dictionary-item-row {
  display: grid;
  grid-template-columns: 140px 80px 80px 1fr 120px;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #dde7f4;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.dictionary-item-row:hover {
  background: linear-gradient(180deg, #f0f5ff 0%, #ebf1ff 100%);
}

.dictionary-item-row.is-selected {
  background: linear-gradient(180deg, #d6e5ff 0%, #cce0ff 100%);
  border-color: #5b9ef7;
}

.dictionary-item-name,
.dictionary-item-status,
.dictionary-item-sort,
.dictionary-item-remark {
  font-size: 12px;
  color: var(--text);
}

.dictionary-item-name {
  display: grid;
  gap: 6px;
}

.dictionary-item-name strong,
.dictionary-item-sort strong {
  font-size: 13px;
}

.dictionary-item-subline,
.dictionary-item-sort span {
  font-size: 11px;
  color: var(--muted);
}

.dictionary-item-sort {
  display: grid;
  gap: 4px;
}

.dictionary-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.dictionary-item-actions .mini-btn {
  white-space: nowrap;
  min-width: 48px;
}

.pending-image-row,
.batch-image-row,
.detail-image-row {
  display: grid;
  grid-template-columns: 56px 132px 120px 1fr 180px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #dde7f4;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.pending-image-order,
.detail-image-order {
  font-weight: 700;
  color: #294a80;
  text-align: center;
}

.pending-image-preview-wrap,
.detail-image-preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.pending-image-preview,
.detail-image-preview {
  width: 108px;
  height: 82px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: #f1f5fb;
}

.previewable-image {
  cursor: zoom-in;
}

.pending-image-type-wrap,
.detail-image-type,
.detail-image-binding,
.pending-image-name {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
}

.pending-image-actions,
.detail-image-actions {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.pending-primary-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #9cb4db;
  color: #224782;
  background: linear-gradient(180deg, #ffffff 0%, #e8f0ff 100%);
}

.batch-image-head {
  grid-template-columns: 56px 132px minmax(0, 1fr) 120px;
}

.batch-image-row {
  grid-template-columns: 56px 132px minmax(0, 1fr) 120px;
}

.queue-note {
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #f8fbff;
  line-height: 1.6;
}

.queue-meta {
  color: var(--muted);
}

.claim-style-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.sheet-inline-note {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
}

.sheet-footer {
  justify-content: flex-end;
  padding: 10px;
}

.detail-modal .sheet-inline-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-inline-action {
  display: grid;
  gap: 8px;
  align-content: start;
}

.detail-modal-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-side-action {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid #dde7f4;
}

.detail-side-action .mini-btn {
  width: 100%;
}

.detail-inline-action span {
  font-size: 12px;
  color: #5b7398;
}

.detail-inline-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-form-column input,
.detail-form-column textarea,
.detail-inline-fields input,
.detail-meta-panel input {
  background: #f9fbff;
}

.detail-sheet {
  min-height: 0;
}

.detail-sheet .sheet-body {
  min-height: 0;
  height: 100%;
}

.detail-modal .sheet-body {
  align-items: stretch;
}

.detail-modal .detail-form-column {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.detail-summary-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.94) 100%);
}

.detail-summary-item {
  display: grid;
  gap: 6px;
}

.detail-summary-item span {
  font-size: 12px;
  color: var(--weak);
  font-weight: 600;
}

.detail-summary-item strong {
  font-size: 14px;
  color: var(--text);
}

.detail-modal .detail-image-column {
  display: block;
  min-height: 0;
}

.detail-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid #dde7f4;
}

.detail-meta-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-gallery-wrap {
  min-height: 100%;
  padding: 10px;
}

.detail-log-wrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 210px;
  padding: 10px;
}

.detail-log-head {
  padding-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #31598f;
  border-bottom: 1px solid #dde7f4;
}

.detail-log-list {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding-top: 10px;
}

.detail-log-item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #dde7f4;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.detail-log-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.detail-log-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}

.detail-log-modal {
  width: min(920px, calc(100vw - 36px));
  min-height: min(640px, calc(100vh - 36px));
}

.detail-log-modal-body {
  min-height: 0;
  height: min(520px, calc(100vh - 180px));
  padding: 12px;
}

.image-lightbox-overlay {
  z-index: 40;
  background: rgba(8, 16, 31, 0.72);
}

.image-lightbox {
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(180deg, #fdfefe 0%, #edf4fb 100%);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.image-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.image-lightbox-body {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: rgba(255, 255, 255, 0.8);
}

.image-lightbox-body img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
}

.image-lightbox-caption {
  color: var(--muted);
  line-height: 1.6;
}

.detail-image-head {
  grid-template-columns: 56px 132px minmax(0, 1fr) 120px;
  align-items: center;
  justify-items: center;
  text-align: center;
}

.detail-image-row {
  grid-template-columns: 56px 132px minmax(0, 1fr) 120px;
  justify-content: start;
  justify-items: center;
  text-align: center;
  border-radius: 18px;
}

.detail-image-meta {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  justify-items: center;
  text-align: center;
}

.detail-image-meta strong {
  font-size: 13px;
  color: var(--text);
}

.detail-image-head span {
  white-space: nowrap;
}

.detail-image-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.detail-image-order,
.detail-image-preview-wrap,
.detail-image-actions,
.detail-image-head span {
  justify-self: center;
}

.detail-image-actions .mini-btn {
  min-width: 78px;
  white-space: nowrap;
}

@media (max-width: 1360px) {
  .toolbar-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-summary-card {
    grid-template-columns: 1fr;
  }

  .detail-meta-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-result-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pending-image-row,
  .batch-image-row,
  .detail-image-row {
    grid-template-columns: 50px 110px 100px 1fr 140px;
  }

  .pending-image-head {
    grid-template-columns: 50px 110px 100px 1fr 140px;
  }

  .batch-image-head,
  .batch-image-row {
    grid-template-columns: 50px 110px minmax(0, 1fr) 110px;
  }

  .detail-image-head,
  .detail-image-row {
    grid-template-columns: 50px 110px minmax(0, 1fr) 110px;
  }

  .dictionary-item-head,
  .dictionary-item-row {
    grid-template-columns: 1fr 90px 90px 1fr 160px;
  }

  .compare-result-list-head,
  .compare-result-row {
    grid-template-columns: 54px 120px repeat(6, 100px);
  }
}

@media (max-width: 1100px) {
  /* /* .shell ?.sidebar */

  .workspace-head-main,
  .sheet-top-row,
  .sheet-body {
    grid-template-columns: 1fr;
    display: grid;
  }

  .dictionary-grid,
  .sheet-inline-fields,
  .detail-meta-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dictionary-type-inline {
    grid-template-columns: 1fr;
  }

  .compare-result-summary,
  .compare-result-list-head,
  .compare-result-row {
    grid-template-columns: 1fr;
  }

  .compare-result-source-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .compare-filter-actions {
    justify-content: stretch;
  }

  .compare-filter-actions .mini-btn {
    flex: 1;
  }

  .pending-image-row,
  .batch-image-row,
  .detail-image-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .pending-image-head {
    display: none;
  }

  .batch-image-head {
    display: none;
  }

  .detail-image-head {
    display: none;
  }

  .dictionary-item-head {
    display: none;
  }

  .dictionary-item-row {
    grid-template-columns: 1fr;
  }

  .claim-style-wrap {
    grid-template-columns: 1fr;
  }

  .sheet-upload-tools {
    min-width: 0;
    justify-content: flex-start;
  }

  .toolbar-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 8px;
  }

  .dictionary-grid,
  .sheet-inline-fields,
  .detail-meta-panel,
  .toolbar-filters {
    grid-template-columns: 1fr;
  }

  .toolbar-inline {
    overflow-x: auto;
  }

  .create-modal {
    padding: 8px;
  }
}

:root {
  --bg: #f6f8fc;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-soft: #f7fafc;
  --line: #e0e5ec;
  --line-strong: #cad3df;
  --text: #181d26;
  --muted: #5f6b7a;
  --weak: #7e8896;
  --brand: #1b61c9;
  --brand-deep: #164fa4;
  --brand-soft: #edf5ff;
  --danger: #c23b52;
  --success: #18794e;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(27, 97, 201, 0.06);
}

body {
  position: relative;
  font-family: 'Segoe UI Variable Text', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(27, 97, 201, 0.12), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(74, 144, 226, 0.1), transparent 20%),
    linear-gradient(180deg, #f4f8fc 0%, #eef3f9 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 58%);
}

.shell {
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid rgba(202, 211, 223, 0.9);
  background: rgba(251, 253, 255, 0.78);
  backdrop-filter: blur(18px);
}

.sidebar-scroll {
  padding: 18px 14px 12px;
}

.brand-block,
.tree-section,
.sidebar-user-meta,
.auth-hero,
.auth-panel,
.app-boot-error-card,
.user-card,
.dictionary-item,
.detail-item,
.detail-empty,
.detail-note-box,
.progress-modal,
.compare-summary-card,
.compare-result-row,
.compare-filter-option,
.dictionary-item-row,
.pending-image-row,
.batch-image-row,
.detail-image-row,
.detail-log-item,
.queue-note,
.auth-tip-card,
.spotlight-card,
.overview-metric-card {
  border-radius: 18px;
}

.brand-block {
  padding: 18px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.94) 100%);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.brand-kicker,
.page-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(27, 97, 201, 0.08);
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}

.brand-block h1,
.workspace-overview-copy h2,
.auth-hero h1,
.app-boot-error-card h1 {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.brand-copy,
.workspace-overview-copy p,
.auth-copy,
.spotlight-card p,
.overview-metric-card p {
  line-height: 1.65;
}

.tree-section {
  margin-top: 16px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.04);
}

.tree-title {
  padding: 12px 14px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--weak);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border-bottom: 0;
}

.tree-list {
  gap: 8px;
  padding: 8px 10px 10px;
}

.nav-item,
.tree-node,
.nav-item-footer {
  min-height: 42px;
  padding: 0 14px 0 34px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #223044;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tree-node::before,
.nav-item::before {
  left: 14px;
  top: 17px;
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(27, 97, 201, 0.28);
}

.nav-item:hover,
.nav-item.active,
.nav-item-footer:hover {
  border-color: rgba(27, 97, 201, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 246, 255, 0.96) 100%);
  box-shadow: 0 12px 24px rgba(27, 97, 201, 0.08);
  transform: translateY(-1px);
}

.nav-item.active {
  color: var(--brand);
}

.sidebar-footer {
  gap: 14px;
  padding: 14px;
  border-top: 1px solid rgba(202, 211, 223, 0.86);
  background: rgba(247, 250, 252, 0.9);
}

.sidebar-user-meta {
  padding: 12px 14px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  background: rgba(255, 255, 255, 0.92);
}

.workspace {
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  height: 100vh;
  padding: 10px 12px;
}

.legacy-panel,
.content-panel,
.detail-panel,
.create-modal,
.image-lightbox {
  border: 1px solid rgba(224, 229, 236, 0.96);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

#view-products .legacy-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.workspace-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 12px;
  padding: 12px 12px 4px;
  animation: surface-rise 0.45s ease;
}

.workspace-overview-copy {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px 18px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(27, 97, 201, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 248, 253, 0.96) 100%);
}

.workspace-overview-copy p {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.workspace-overview-metrics,
.section-spotlight {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.overview-metric-card,
.spotlight-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.overview-metric-card span,
.spotlight-card span {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.04em;
}

.overview-metric-card strong,
.spotlight-card strong {
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.overview-metric-card p,
.spotlight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.workspace-overview-copy h2 {
  font-size: 18px;
  line-height: 1.2;
}

.overview-metric-card p {
  display: none;
}

.section-spotlight {
  padding: 0 16px 16px;
}

.section-spotlight.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-spotlight-user {
  padding-bottom: 0;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}

.user-center-dashboard-metrics {
  padding: 16px 16px 8px;
}

.dashboard-metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.user-center-dashboard-metrics .dashboard-metric-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 12px;
}

.user-center-dashboard-metrics .dashboard-metric-card span {
  font-size: 11px;
  white-space: nowrap;
}

.user-center-dashboard-metrics .dashboard-metric-card strong {
  font-size: 16px;
  flex: 1;
}

.user-center-dashboard-metrics .dashboard-metric-card p {
  display: none;
}

.dashboard-metric-card span {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.04em;
}

.dashboard-metric-card strong {
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--text);
}

.dashboard-metric-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

#view-recycle {
  height: 100%;
}

#view-recycle .content-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

#view-recycle .table-wrap {
  min-height: 0;
  overflow-y: auto;
}

.recycle-dashboard-metrics {
  padding-top: 16px;
}

.recycle-panel-status {
  margin: 0 16px 16px;
  padding: 12px 14px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  border-radius: 14px;
  background: rgba(247, 250, 252, 0.92);
  color: var(--muted);
  line-height: 1.6;
}

.recycle-panel-status.is-warning {
  border-color: #edd392;
  background: #fff8e5;
  color: #8a5a00;
}

.legacy-toolbar,
.content-toolbar,
.toolbar-status,
.pagination-bar,
.sheet-top-row,
.sheet-body,
.sheet-footer,
.compare-result-summary,
.delete-reason-body,
.image-lightbox-body,
.queue-wrap {
  border-color: rgba(224, 229, 236, 0.96);
  background: rgba(255, 255, 255, 0.9);
}

.sheet-top-row,
.sheet-body,
.sheet-footer,
.compare-result-summary,
.compare-result-list-wrap,
.delete-reason-body,
.image-lightbox-body,
.queue-wrap,
.pending-empty,
.compare-result-empty,
.compare-filter-option,
.progress-track,
.detail-log-modal-body {
  border-radius: 18px;
}

.sheet-body,
.queue-wrap,
.image-lightbox-body,
.compare-result-list-wrap,
.detail-log-modal-body {
  overflow: hidden;
}

.pending-image-head,
.dictionary-item-head,
.compare-result-list-head,
.detail-log-head,
.detail-image-head {
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.legacy-toolbar,
.content-toolbar {
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(224, 229, 236, 0.96);
  background: rgba(255, 255, 255, 0.68);
}

.content-toolbar h3,
.create-modal-head h3,
.detail-panel-head h3,
.auth-panel-head h2 {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.content-toolbar p,
.auth-panel-head p,
.compare-result-subtitle {
  margin-top: 8px;
}

.toolbar-status {
  padding: 12px 18px;
  color: var(--muted);
  border-top: 0;
}

label span,
.auth-form label span,
.user-form label span,
.user-summary-grid label span {
  font-size: 12px;
  font-weight: 600;
  color: var(--weak);
  letter-spacing: 0.02em;
}

input,
select,
textarea,
.auth-form input,
.user-form input,
.user-summary-grid input {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(202, 211, 223, 0.96);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
}

textarea {
  padding-top: 10px;
  padding-bottom: 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(27, 97, 201, 0.46);
  box-shadow: 0 0 0 4px rgba(27, 97, 201, 0.1);
}

.mini-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(202, 211, 223, 0.96);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #203047;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.mini-btn:hover:not(:disabled),
.mini-btn:focus-visible:not(:disabled) {
  border-color: rgba(27, 97, 201, 0.22);
  box-shadow: 0 10px 20px rgba(27, 97, 201, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.mini-btn.primary {
  border-color: rgba(27, 97, 201, 0.2);
  background: linear-gradient(180deg, #1b61c9 0%, #164fa4 100%);
  box-shadow: 0 12px 22px rgba(27, 97, 201, 0.2);
}

.mini-btn.danger {
  border-color: rgba(194, 59, 82, 0.2);
  background: linear-gradient(180deg, #d14b63 0%, #b93d53 100%);
  box-shadow: 0 12px 22px rgba(194, 59, 82, 0.18);
}

.ui-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.ui-pill-success {
  color: #0d6a3b;
  border-color: #b7e2ca;
  background: #edf9f1;
}

.ui-pill-pending {
  color: #8a5a00;
  border-color: #edd392;
  background: #fff8e5;
}

.ui-pill-neutral {
  color: #1b61c9;
  border-color: #c7daf8;
  background: #eef5ff;
}

.ui-pill-weak {
  color: #66758a;
  border-color: #dde4ee;
  background: #f7f9fc;
}

.table-wrap {
  background: transparent;
}

.legacy-table {
  border-collapse: separate;
  border-spacing: 0;
}

.legacy-table th,
.legacy-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(224, 229, 236, 0.96);
  font-size: 12px;
}

.legacy-table th {
  color: #49576a;
  background: rgba(248, 250, 252, 0.96);
}

.product-table th:not(:last-child),
.product-table td:not(:last-child) {
  border-right: 1px solid rgba(240, 243, 248, 0.96);
}

.legacy-row,
.dictionary-item-row,
.pending-image-row,
.batch-image-row,
.detail-image-row,
.compare-result-row,
.detail-log-item {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.legacy-row:hover,
.dictionary-item-row:hover,
.pending-image-row:hover,
.batch-image-row:hover,
.detail-image-row:hover,
.compare-result-row:hover,
.detail-log-item:hover {
  background: rgba(248, 251, 255, 0.98);
}

.legacy-row.is-active {
  background: rgba(237, 245, 255, 0.98);
}

.legacy-row.is-selected,
.dictionary-item-row.is-selected,
.compare-result-row.is-marked {
  border-color: rgba(27, 97, 201, 0.24);
  background: rgba(240, 246, 255, 0.98);
}

.image-card img,
.similar-result-card img,
.pending-image-preview,
.detail-image-preview,
.compare-result-thumb img,
.gallery-item img,
.image-lightbox-body img {
  border-radius: 14px;
  border-color: rgba(224, 229, 236, 0.96);
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
}

.sync-status-badge,
.user-status-pill,
.pending-primary-badge,
.compare-rank-badge {
  border-radius: 999px;
}

.dictionary-grid,
.user-center-grid {
  padding: 16px;
}

.dictionary-item {
  padding: 18px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  background: rgba(255, 255, 255, 0.92);
}

.dictionary-item:hover {
  border-color: rgba(27, 97, 201, 0.18);
  background: rgba(248, 251, 255, 0.98);
}

.modal-overlay {
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(8px);
}

.create-modal {
  padding: 14px;
  background: linear-gradient(180deg, rgba(251, 253, 255, 0.98) 0%, rgba(243, 248, 253, 0.96) 100%);
}

.create-modal-head {
  padding: 6px 6px 14px;
}

.auth-page,
.app-boot-error {
  background:
    radial-gradient(circle at top left, rgba(27, 97, 201, 0.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(74, 144, 226, 0.1), transparent 28%),
    linear-gradient(180deg, #f4f8fc 0%, #eef3f9 100%);
}

.auth-shell,
.app-boot-error {
  max-width: 1180px;
  gap: 28px;
  padding: 36px 24px;
}

.auth-shell {
  grid-template-columns: minmax(360px, 420px);
  justify-content: center;
}

.auth-hero,
.auth-panel,
.app-boot-error-card {
  border: 1px solid rgba(224, 229, 236, 0.96);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

.auth-hero {
  padding: 32px;
  background:
    radial-gradient(circle at top right, rgba(27, 97, 201, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 248, 253, 0.95) 100%);
}

.auth-panel,
.app-boot-error-card {
  padding: 32px;
}

.auth-panel {
  width: min(420px, calc(100vw - 32px));
}

.auth-feature-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-feature-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(27, 97, 201, 0.08);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.auth-tip-card {
  padding: 16px;
  border: 1px solid rgba(224, 229, 236, 0.96);
  background: rgba(255, 255, 255, 0.76);
}

.auth-status,
.user-panel-status {
  border-radius: 14px;
  border-color: rgba(224, 229, 236, 0.96);
  background: rgba(247, 250, 252, 0.92);
}

.auth-panel-head {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.auth-panel-head h2 {
  font-size: 28px;
  line-height: 1.2;
}

.app-boot-error-card,
.legacy-panel,
.content-panel,
.workspace-overview-copy,
.overview-metric-card,
.spotlight-card {
  animation: surface-rise 0.45s ease;
}

@keyframes surface-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1360px) {
  .workspace-overview {
    grid-template-columns: 1fr;
  }

  .workspace-overview-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .workspace-overview-metrics,
  .section-spotlight,
  .section-spotlight.compact {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
/* .workspace padding 由 @media (max-width: 768px) 统一设置为 12px，此处不重复声明 */

  .workspace-overview {
    padding: 12px 12px 4px;
  }

  .workspace-overview-copy,
  .overview-metric-card,
  .spotlight-card,
  .auth-hero,
  .auth-panel {
    padding: 18px;
  }

  .legacy-toolbar,
  .content-toolbar,
  .toolbar-status,
  .dictionary-grid,
  .user-center-grid,
  .section-spotlight,
  .dashboard-metrics {
    padding-left: 12px;
    padding-right: 12px;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .recycle-panel-status {
    margin-left: 12px;
    margin-right: 12px;
  }

  .user-account-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .legacy-toolbar,
  .content-toolbar {
    padding-top: 14px;
    padding-bottom: 14px;
  }
}

/* =================================================================
   移动端适配 — Mobile Drawer Navigation
   参考 Linear / Vercel 设计规范：hamburger collapse at 768px
   overlay 遮罩层随侧边栏一起控制
   ================================================================= */

/*  */

/* */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 200;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: rgba(251, 253, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(202, 211, 223, 0.72);
  flex-shrink: 0;
}

/* 汉堡按钮 */
.mobile-menu-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(202, 211, 223, 0.9);
  border-radius: 50%;             /* Linear: circular icon button */
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 8px rgba(27, 97, 201, 0.14);
}

.mobile-menu-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.mobile-menu-icon span {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.22s ease, opacity 0.22s ease;
  transform-origin: center;
}

/* 汉堡 鈫?X → X 动画 */
body.drawer-open .mobile-menu-icon span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
body.drawer-open .mobile-menu-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
body.drawer-open .mobile-menu-icon span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* 顶部栏品牌名 */
.mobile-brand-name {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 顶部栏右侧用户信息 */
.mobile-topbar-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-user-label {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* Overlay 遮罩：默认隐藏 */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.sidebar-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* 侧边栏内关闭按钮：默认隐藏 */
.sidebar-close-btn {
  display: none;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  margin-bottom: 16px;
  border: 1px solid rgba(202, 211, 223, 0.86);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.sidebar-close-btn:hover {
  background: rgba(239, 246, 255, 0.98);
}

/* 抽屉打开时禁止 body 滚动 */
body.drawer-open {
  overflow: hidden;
}

/* ─── 768px 断点：汉堡折叠，侧边栏变抽屉 ─── */
/* 此处位于 CSS 文件末尾，级联顺序最高，无需 !important 即可覆盖 */
@media (max-width: 768px) {

  /* 1. 显示顶部导航栏 */
  .mobile-topbar {
    display: flex;
  }

  /* 2. 激活遮罩层（点击后可关闭）*/
  .sidebar-overlay {
    display: block;
  }

  /* 3. shell 退出 grid 布局，变成普通块 */
  .shell {
    display: block !important;
  }

  /* 4. 侧边栏：脱离文档流，固定定位，默认滑出屏幕左侧 */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 85vw);
    height: 100dvh;
    z-index: 200;                   /* 高于 overlay(190) */
    transform: translateX(-100%) !important;   /* 完全隐藏于左侧*/
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    /* 恢复正常 border（之前某些断点误设 border-bottom 导致外观错误）*/
    border-right: 1px solid rgba(202, 211, 223, 0.9);
    border-bottom: none !important;
    box-shadow: none;
  }

  /* sidebar open state */
  .sidebar.is-open {
    transform: translateX(0) !important;
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s 0s;
    box-shadow: 4px 0 32px rgba(15, 23, 42, 0.16),
                1px 0 0 rgba(202, 211, 223, 0.6);
  }

  /* 6. 显示侧边栏内"关闭"按钮 */
  .sidebar-close-btn {
    display: flex;
  }

  /* 7. 工作区：自然页面流布局，内容随页面滚动 */
  .workspace {
    display: block;
    height: auto;
    min-height: calc(100dvh - 56px);
    padding: 12px;
    overflow-x: hidden;          /* 禁止整页横向溢出 */
    box-sizing: border-box;
  }

  /* panel.active：占满 grid 单格，内部 flex column 纵向排列 */
  .panel.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  /* 8. 产品页：.legacy-panel 跟随 flex column 伸展 */
  #view-products {
    /* 继承自 .panel.active flex column 即可，无需额外声明 */
  }

  #view-products .legacy-panel {
    flex: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
  }

  /* 表格容器：自然高度，不设 max-height，展示所有行 */
  #view-products .legacy-panel .legacy-table-wrap {
    flex: none;
    min-height: 0;
    max-height: none;
    min-width: 0;
    max-width: 100%;
  }

  /* 9. 回收站页：同产品页策略 */
  #view-recycle {
    /* 继承自 .panel.active flex column 即可 */
  }

  #view-recycle .content-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
  }

  #view-recycle .table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    min-height: 80px;
    min-width: 0;
    max-width: 100%;
  }

  /* 10. 工具栏折叠 */
  .toolbar-inline {
    flex-wrap: wrap;
    overflow: visible;
  }

  .toolbar-filters {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 日期 input 防止溢出 */
  input[type="date"] {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  /* 11. 分页栏：页面底部自然流，随内容滚动 */
  .pagination-bar {
    position: static;
    flex-wrap: wrap;
    height: auto;
    min-height: 48px;
    padding: 8px 12px;
    gap: 6px;
    flex-shrink: 0;
  }

  .pagination-actions {
    flex-wrap: wrap;
    gap: 4px;
  }

  /* /* 12. */
  .user-center-panel {
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
  }

  .user-center-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics,
  .recycle-dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 13. 弹窗全屏化（Linear / Vercel 风格：mobile modal = full-screen sheet）*/
  .modal-overlay {
    padding: 8px;
    align-items: flex-end;          /*  */
  }

  .create-modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 12px;
    border-radius: 20px 20px 12px 12px;
  }

  .product-create-modal,
  .batch-product-modal,
  .detail-modal,
  .compare-result-modal {
    height: calc(100dvh - 16px);
    width: 100%;
    border-radius: 20px 20px 12px 12px;
  }

  .operator-create-modal,
  .dictionary-item-form-modal,
  .product-field-create-modal,
  .delete-reason-modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 20px 20px 12px 12px;
  }

  .dictionary-modal,
  .dictionary-manage-modal,
  .product-field-manage-modal {
    width: 100%;
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 20px 20px 12px 12px;
  }

  /* 14. 表单折叠 */
  .sheet-body {
    grid-template-columns: 1fr;
  }

  .product-create-modal .sheet-body,
  .batch-product-modal .sheet-body {
    height: auto;
    min-height: 0;
  }

  .detail-modal .sheet-inline-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 15. 触控目标最小尺寸（适当缩小，提升移动端空间利用率） */
  .mini-btn {
    min-height: 38px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .nav-item,
  .nav-item-footer {
    min-height: 44px;
  }

  input,
  select {
    min-height: 38px;
    font-size: 15px; /* >= 16px 防止 iOS 自动放大，改为 15px 也不触发 */
  }

  /* ── Toolbar: 纵向堆叠；横向溢出由父级 legacy-panel(overflow:hidden) 拦截 ── */
  .toolbar-inline {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden !important; /* 防止工具栏内容横向溢出面板 */
    gap: 8px;
  }

  .toolbar-inline > .toolbar-filters {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
  }

  .toolbar-leading-actions,
  .toolbar-trailing-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }

  /* ── 筛选区：移动端默认折叠，点击按钮展开/收起 ── */
  .filter-toggle-btn {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  /* 默认折叠：筛选表单隐藏 */
  .toolbar-filters:not(.is-open) {
    display: none;
  }

  /* 展开时显示 */
  .toolbar-filters.is-open {
    display: grid;
  }

  /* ── 内容工具栏（字典/回收站等非产品页）── */
  .content-toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .content-toolbar .toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  /* ── 产品表格：整体横向滚动，整页纵向跟随滑动 ── */
  /* legacy-table-wrap 作为唯一横向滚动容器，不限高，展示所有行 */
  .legacy-table-wrap {
    overflow-x: auto !important;   /* 横向滚动 */
    overflow-y: visible !important; /* 纵向不限，由外层页面滚动 */
    height: auto !important;
    max-height: none !important;
    min-width: 0;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  /* thead-outer 和 tbody-outer 在移动端不再分离滚动，取消独立横向约束 */
  .product-thead-outer {
    overflow: visible;
    min-width: 0;
  }

  .product-tbody-outer {
    overflow: visible !important;
    max-height: none !important;
    flex: none !important;
    min-height: 0;
  }

  /* ── 所有 .table-wrap 横向可滚动 ── */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  /* ── 工具栏状态文字自动换行 ── */
  .toolbar-status {
    font-size: 12px;
    white-space: normal;
  }

  /* ── 侧栏抽屉：紧凑布局，字体 / 内容整体缩小 ── */
  .sidebar-scroll {
    padding: 10px 8px 8px;
  }

  .sidebar-close-btn {
    margin-bottom: 6px;
    min-height: 36px;
    font-size: 13px;
  }

  /* 品牌块缩小 */
  .brand-block {
    padding: 6px 8px 8px;
  }

  .brand-kicker {
    font-size: 10px;
    margin-bottom: 3px;
  }

  .brand-block h1 {
    font-size: 15px;
    line-height: 1.25;
  }

  .brand-copy {
    display: none; /* 副标题隐藏节省空间 */
  }

  /* 导航树 */
  .tree-section {
    margin-top: 6px;
  }

  .tree-title {
    padding: 5px 8px;
    font-size: 11px;
  }

  .tree-list {
    padding: 4px;
    gap: 1px;
  }

  .nav-item,
  .tree-node {
    padding: 6px 8px 6px 14px;
    font-size: 13px;
    min-height: 36px;
  }

  /* 底部信息栏压缩 */
  .sidebar-footer {
    padding: 6px 10px;
    gap: 6px;
  }

  .sidebar-footer-status {
    display: none;
  }

  .sidebar-user-meta {
    padding: 6px 8px;
  }

  .sidebar-user-meta strong {
    font-size: 13px;
  }

  .sidebar-user-meta span {
    font-size: 11px;
  }

  .nav-item-footer {
    padding-left: 14px;
    font-size: 13px;
    min-height: 36px;
  }

  /* ── 弹窗内容移动端适配 ── */

  /* 弹窗从底部滑出，overlay 对齐底部 */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  /* 所有弹窗宽度撑满，最大高度不超 95dvh，顶部圆角，底部方角 */
  .create-modal,
  .product-create-modal,
  .batch-product-modal,
  .detail-modal,
  .compare-result-modal,
  .operator-create-modal,
  .dictionary-item-form-modal,
  .product-field-create-modal,
  .delete-reason-modal,
  .dictionary-modal,
  .dictionary-manage-modal,
  .product-field-manage-modal,
  .detail-log-modal,
  .image-lightbox {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 0 !important;
  }

  /* 高度：滚动型弹窗占满；内容短的弹窗按内容高度 */
  .product-create-modal,
  .batch-product-modal,
  .detail-modal,
  .compare-result-modal,
  .dictionary-modal,
  .dictionary-manage-modal,
  .product-field-manage-modal,
  .detail-log-modal,
  .image-lightbox {
    height: calc(100dvh - 40px) !important;
    max-height: calc(100dvh - 40px) !important;
  }

  .operator-create-modal,
  .dictionary-item-form-modal,
  .product-field-create-modal,
  .delete-reason-modal {
    height: auto;
    max-height: calc(100dvh - 60px) !important;
  }

  /* 弹窗头部紧凑化 */
  .create-modal-head {
    padding: 14px 14px 10px;
  }

  .create-modal-head h3,
  .detail-panel-head h3 {
    font-size: 17px;
  }

  /* sheet-top-row 纵向堆叠 */
  .sheet-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 0;
  }

  .sheet-inline-fields {
    grid-template-columns: 1fr;
  }

  .sheet-upload-tools {
    justify-content: flex-start;
  }

  /* sheet-body 纵向单列，内部可滚动 */
  .sheet-body {
    grid-template-columns: 1fr !important;
    min-height: 0;
    padding: 10px 12px;
    overflow-y: auto;
    border-radius: 0;
  }

  /* 表单列允许滚动 */
  .product-create-modal .sheet-form-column,
  .batch-product-modal .sheet-form-column,
  .detail-modal .detail-form-column {
    overflow: visible;
    padding-right: 0;
  }

  /* sheet-footer */
  .sheet-footer {
    padding: 10px 12px;
    border-radius: 0;
  }

  /* 详情弹窗内部字段网格 */
  .detail-inline-fields,
  .detail-meta-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-modal .sheet-inline-fields {
    grid-template-columns: 1fr;
  }

  .detail-summary-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
    gap: 8px;
  }

  /* 图片行：竖向堆叠，跨列显示 */
  .pending-image-head,
  .batch-image-head,
  .detail-image-head {
    display: none;
  }

  .pending-image-row,
  .batch-image-row,
  .detail-image-row {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 8px;
    padding: 10px 12px;
  }

  .pending-image-preview,
  .detail-image-preview {
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: contain;
  }

  /* 字典条目列表 */
  .dictionary-item-head {
    display: none;
  }

  .dictionary-item-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 12px;
  }

  /* 比图结果弹窗 */
  .compare-result-source-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }

  .compare-result-source-main strong {
    font-size: 17px;
  }

  .compare-result-list-head {
    display: none;
  }

  .compare-result-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  .compare-result-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .compare-result-thumb img,
  .compare-result-thumb .similar-thumb {
    width: 100%;
    max-width: 180px;
    height: auto;
  }

  .compare-result-op {
    flex-direction: row;
    flex-wrap: wrap;
    display: flex;
  }

  /* 图片灯箱 */
  .image-lightbox {
    display: flex !important;
    flex-direction: column;
    padding: 12px !important;
  }

  .image-lightbox-body img {
    max-height: calc(100dvh - 160px);
  }

  /* 操作员 / 删除原因等小弹窗 */
  .delete-reason-body {
    padding: 10px 12px;
    border-radius: 0;
  }

  /* 日志弹窗 */
  .detail-log-modal-body {
    height: 100%;
    padding: 10px 12px;
    border-radius: 0;
  }

  /* compare-filter-modal */
  .create-modal.compare-filter-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 60px) !important;
  }

  /* 进度弹窗 */
  .progress-modal {
    width: calc(100vw - 24px) !important;
    margin: 0 12px;
    border-radius: 18px !important;
  }
}

@media (max-width: 480px) {

  .mobile-topbar {
    height: 52px;
    padding: 0 12px;
  }

  .workspace {
    padding: 8px;
    min-height: calc(100dvh - 52px);
  }

  .toolbar-filters {
    grid-template-columns: 1fr;
  }

  .legacy-toolbar,
  .content-toolbar {
    padding: 12px 12px 10px;
    gap: 10px;
  }

  .content-toolbar h3,
  .create-modal-head h3,
  .detail-panel-head h3 {
    font-size: 18px;
  }

  .dashboard-metrics,
  .recycle-dashboard-metrics,
  .user-center-dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .compare-result-list-head {
    display: none;
  }

  .compare-result-row {
    grid-template-columns: 1fr;
  }

  .compare-result-source-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-modal .sheet-inline-fields,
  .detail-meta-panel {
    grid-template-columns: 1fr;
  }
}

/* ─── iOS 安全区域（刘海 / Home 条）─── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-topbar {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  @media (max-width: 768px) {
    .sidebar {
      padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    .workspace {
      padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
  }
}

/*  */
@media (max-width: 768px) {
  .auth-shell {
    grid-template-columns: 1fr;
    justify-content: center;
    padding: 40px 20px 32px;
    min-height: 100dvh;
  }

  .auth-panel {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .auth-shell {
    padding: 28px 16px 24px;
  }

  .auth-panel,
  .app-boot-error-card {
    padding: 24px 18px;
  }

  .auth-panel-head h2 {
    font-size: 22px;
  }

  .auth-submit-btn,
  .auth-form input {
    min-height: 46px;
  }
}
