:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --page-bg: #eef3f7;
  --page-bg-deep: #dbe6ee;
  --topbar-bg: #172338;
  --topbar-border: #26354d;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --surface-tint: #edf4f7;
  --border: #a9b8c8;
  --border-strong: #8ea0b3;
  --text: #172033;
  --text-soft: #53657a;
  --muted: #748296;
  --primary: #0f766e;
  --primary-hover: #0b5f59;
  --primary-soft: #dff5f2;
  --accent: #2563eb;
  --accent-soft: #e8f0ff;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning-soft: #fff6dd;
  --shadow: 0 14px 34px rgba(18, 32, 52, 0.08);
  --shadow-soft: 0 6px 18px rgba(18, 32, 52, 0.06);
  background: var(--page-bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

body {
  background:
    linear-gradient(180deg, var(--page-bg-deep) 0, var(--page-bg) 320px),
    var(--page-bg);
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  box-shadow: 0 10px 28px rgba(10, 20, 35, 0.24);
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 68px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  align-items: center;
  color: #ffffff;
  display: inline-flex;
  grid-column: 1;
  justify-self: start;
}

.brand-logo {
  display: block;
  height: 36px;
  max-width: min(34vw, 210px);
  object-fit: contain;
  width: auto;
}

.nav {
  align-items: center;
  display: flex;
  gap: 8px;
  font-size: 14px;
  grid-column: 2;
  justify-self: end;
  min-width: 0;
}

.nav a,
.user-badge {
  border-radius: 999px;
  color: #d9e4ef;
  padding: 8px 12px;
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.user-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.container {
  margin: 0 auto;
  max-width: 1950px;
  padding: 28px 24px 44px;
}

.page-head {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.page-head.centered {
  display: block;
  text-align: center;
}

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

.export-form {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.export-form label {
  color: var(--text-soft);
  display: grid;
  font-size: 13px;
  font-weight: 700;
  gap: 5px;
}

.export-form input {
  min-height: 38px;
  width: 155px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--text);
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  color: var(--text);
  font-size: 18px;
}

.page-head p,
.login-heading p,
.meta,
small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 6px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button,
.button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  box-shadow: var(--shadow-soft);
  color: #263548;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
}

button:hover,
.button:hover {
  background: var(--surface-tint);
  border-color: #a9bbc8;
}

.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.danger {
  background: #fff7f6;
  border-color: #f2b8b5;
  color: var(--danger);
}

.danger:hover {
  background: var(--danger-soft);
  border-color: #e38a84;
}

.small {
  min-height: 30px;
  padding: 5px 9px;
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.stats.single-stat {
  grid-template-columns: minmax(220px, 320px);
  margin-bottom: 0;
}

.stats.taobao-stats {
  flex: 1;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.stat-card span {
  color: var(--muted);
  display: block;
  font-size: 13px;
}

.stat-card strong {
  color: var(--text);
  display: block;
  font-size: 30px;
  line-height: 1.1;
  margin-top: 8px;
}

.stat-card strong.stat-text {
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stat-card.accent {
  border-color: #f3b3ad;
}

.stat-card.accent strong {
  color: #d92d20;
}

.stat-card.muted {
  background: var(--surface-soft);
}

.filters {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 160px auto;
  margin-bottom: 16px;
  padding: 14px;
}

.filters.return-filters {
  grid-template-columns: minmax(220px, 1fr) 170px 170px auto auto;
}

.filters.production-filters {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}

.filters.taobao-filters {
  grid-template-columns: minmax(260px, 1fr) 220px 170px auto auto;
}

.filters.order-filters {
  grid-template-columns: minmax(260px, 1fr) 180px 180px 160px 160px auto auto;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  min-height: 40px;
  outline: none;
  padding: 9px 11px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

textarea {
  line-height: 1.55;
  resize: vertical;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  min-width: 58px;
  padding: 5px 9px;
}

.status.open {
  background: var(--warning-soft);
  color: #9a5b00;
}

.status.done {
  background: #e7edf2;
  color: var(--text-soft);
}

.status.danger-status {
  background: var(--danger-soft);
  color: var(--danger);
}

.status.success-status {
  background: var(--primary-soft);
  color: var(--primary);
}

.table-panel.records-panel {
  padding: 0;
}

.table-scroll {
  overflow-x: auto;
  width: 100%;
}

.table-scroll-top {
  height: 14px;
  margin: 0 0 6px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
}

.table-scroll-spacer {
  height: 1px;
}

.records-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1480px;
  table-layout: fixed;
  width: 100%;
}

.returns-table {
  min-width: 0;
  width: 100%;
}

.return-date-col {
  width: 72px;
}

.return-product-col {
  width: 14%;
}

.return-reason-col {
  width: 28%;
}

.return-media-col {
  width: 82px;
}

.return-owner-col {
  width: 64px;
}

.return-created-col {
  width: 98px;
}

.return-check-col {
  width: 66px;
}

.return-actions-col {
  width: 58px;
}

.returns-table th,
.returns-table td {
  font-size: 12px;
  padding: 8px 7px;
}

.returns-table td {
  overflow-wrap: anywhere;
}

.returns-table .media-list a {
  word-break: break-all;
}

.returns-table .button.small {
  min-height: 28px;
  padding: 4px 7px;
}

.returns-table .return-check-button {
  min-height: 28px;
  min-width: 54px;
  padding: 4px 7px;
}

.return-check-meta {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

.service-table {
  min-width: 0;
  width: 100%;
}

.service-created-col {
  width: 86px;
}

.service-customer-col {
  width: 76px;
}

.service-order-col {
  width: 86px;
}

.service-platform-col {
  width: 52px;
}

.service-feedback-col {
  width: 16%;
}

.service-handling-col {
  width: 12%;
}

.service-tracking-col {
  width: 86px;
}

.service-owner-col {
  width: 56px;
}

.service-status-col {
  width: 62px;
}

.service-completed-col {
  width: 86px;
}

.service-attachments-col {
  width: 62px;
}

.service-remark-col {
  width: 9%;
}

.service-actions-col {
  width: 112px;
}

.service-table th,
.service-table td {
  font-size: 12px;
  padding: 8px 7px;
}

.service-table td {
  overflow-wrap: anywhere;
}

.service-table td.nowrap {
  white-space: normal;
}

.service-table td.wide {
  max-width: none;
  min-width: 0;
}

.service-table .feedback-summary {
  max-height: 38px;
}

.service-table .button.small,
.service-table button.small {
  min-height: 28px;
  padding: 4px 7px;
}

.service-table .table-actions {
  flex-wrap: wrap;
}

.production-table {
  min-width: 1180px;
}

.production-page {
  font-size: 15px;
  font-weight: 700;
}

.production-page .page-head h1 {
  font-size: 32px;
  font-weight: 850;
}

.production-page .page-head p {
  font-size: 15px;
  font-weight: 750;
}

.production-page .stat-card span {
  font-size: 15px;
  font-weight: 800;
}

.production-page .stat-card strong {
  font-weight: 850;
}

.production-page .filters input,
.production-page button,
.production-page .button {
  font-size: 15px;
  font-weight: 800;
}

.production-page .filters input::placeholder,
.production-table input::placeholder,
.production-table textarea::placeholder {
  color: #5f748d;
  font-weight: 750;
  opacity: 1;
}

.production-product-col {
  width: 14%;
}

.production-text-col {
  width: 24%;
}

.production-updated-col {
  width: 140px;
}

.production-actions-col {
  width: 105px;
}

.production-table input,
.production-table textarea {
  font-size: 15px;
  font-weight: 750;
  min-height: 34px;
}

.production-table th,
.production-table td {
  font-size: 14px;
  font-weight: 750;
}

.production-table th {
  font-weight: 850;
}

.production-table textarea {
  min-width: 220px;
}

.production-table .create-row td {
  background: #d5f0f1;
  border-top-color: #4eafb5;
  border-bottom-color: #4eafb5;
}

.production-table .create-row td:first-child {
  border-left: 4px solid #15969d;
}

.production-table .completed-row td {
  background: #d8dde0;
  color: #66727a;
}

.production-table .completed-row input,
.production-table .completed-row textarea {
  background: #e6eaec;
  border-color: #bdc6cb;
  color: #66727a;
}

.production-table .purchase-completion-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 7px;
}

.production-table .purchase-completed-cell {
  background: #eceff1;
}

.production-table .purchase-completed-cell textarea {
  background: #f6f7f8;
  border-color: #d1d7da;
  color: #788188;
}

.production-table .purchase-completed-cell .purchase-completion-form button {
  background: #e0e4e6;
  border-color: #c4cdd1;
  color: #69757b;
}

.production-table .completed-row .purchase-completed-cell {
  background: #d8dde0;
}

.instruction-hero {
  align-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #eef7f5 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 16px;
  padding: 26px;
}

.instruction-kicker {
  color: var(--primary);
  display: block;
  font-size: 13px;
  font-weight: 850;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.instruction-brand {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.instruction-hero h1 {
  font-size: 34px;
  font-weight: 850;
}

.instruction-hero p,
.instruction-upload-panel p,
.instruction-card p,
.instruction-empty p {
  color: var(--text-soft);
  line-height: 1.6;
}

.instruction-hero-meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 150px;
  padding: 18px;
  text-align: center;
}

.instruction-hero-meta strong {
  display: block;
  font-size: 36px;
}

.instruction-hero-meta span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.instruction-upload-panel {
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 16px;
  grid-template-columns: 250px minmax(0, 1fr);
  margin-bottom: 16px;
  padding: 20px;
}

.instruction-upload-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.instruction-upload-form label {
  color: var(--text-soft);
  display: grid;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
}

.instruction-library {
  display: grid;
  gap: 12px;
}

.instruction-card {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 16px;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  padding: 18px;
}

.instruction-icon {
  align-items: center;
  background: #fff1f0;
  border: 1px solid #f2b8b5;
  border-radius: 8px;
  color: var(--danger);
  display: flex;
  font-weight: 900;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.instruction-card-body h2 {
  font-size: 20px;
  font-weight: 850;
  margin-bottom: 4px;
}

.instruction-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 750;
  gap: 10px;
  margin-top: 10px;
}

.instruction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.instruction-actions form {
  margin: 0;
}

.instruction-empty {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 34px;
  text-align: center;
}

.orders-table {
  min-width: 1180px;
}

.orders-created-col {
  width: 136px;
}

.orders-owner-col {
  width: 70px;
}

.orders-content-col {
  width: 430px;
}

.orders-system-col,
.orders-cancel-col,
.orders-complete-col {
  width: 92px;
}

.orders-unshipped-col {
  width: 128px;
}

.orders-actions-col {
  width: 118px;
}

.taobao-table {
  min-width: 1520px;
}

.records-table th,
.records-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.orders-table th,
.orders-table td {
  font-size: 12px;
  line-height: 1.35;
  padding: 7px 6px;
}

.orders-table .order-content-copy-row {
  display: grid;
  gap: 6px;
}

.orders-table .order-copy-button {
  justify-self: start;
}

.orders-table button.small,
.orders-table .button.small {
  font-size: 12px;
  min-height: 30px;
  padding: 5px 8px;
}

.records-table th:first-child,
.records-table td:first-child {
  border-left: 1px solid var(--border);
}

.records-table th {
  background: #eef5f7;
  border-top: 1px solid var(--border);
  color: #34465c;
  font-weight: 800;
  position: sticky;
  top: 0;
  white-space: nowrap;
  z-index: 1;
}

.records-table th.resizable {
  cursor: grab;
  position: sticky;
}

.records-table th.dragging {
  cursor: grabbing;
  opacity: 0.55;
}

.records-table th.drag-over {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.column-resizer {
  bottom: 0;
  cursor: col-resize;
  position: absolute;
  right: -4px;
  top: 0;
  width: 8px;
  z-index: 3;
}

.column-resizer::after {
  background: #9fb0bf;
  bottom: 8px;
  content: "";
  position: absolute;
  right: 3px;
  top: 8px;
  width: 2px;
}

.records-table.resizing,
.records-table.resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.records-table tbody tr:hover {
  background: #f5fbfa;
}

.records-table tr.overdue {
  background: #fff1f0;
  color: #9f1d18;
}

.records-table tr.overdue:hover {
  background: #ffe4e2;
}

.records-table tr.completed {
  background: #e6eaef;
  color: #4b5563;
}

.records-table tr.completed:hover {
  background: #dde3ea;
}

.records-table tr.completed td {
  background: inherit;
}

.records-table tr.cancelled {
  background: #f5ecec;
  color: #7c2d2d;
}

.records-table tr.cancelled:hover {
  background: #f0e2e2;
}

.records-table tr.cancelled td:not(:last-child) {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.records-table tr.completed.cancelled {
  background: #dfe4ea;
  color: #5f6873;
}

.records-table tr.completed.cancelled:hover {
  background: #d6dde5;
}

.records-table td.wide {
  max-width: 240px;
  min-width: 180px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.records-table td.nowrap {
  white-space: nowrap;
}

.table-feedback {
  color: #334155;
  max-height: none;
  overflow-wrap: anywhere;
}

.feedback-summary {
  color: #334155;
  line-height: 1.5;
  max-height: 42px;
  overflow: hidden;
}

.feedback-preview-button {
  margin-top: 8px;
}

.table-feedback img,
.rich-editor img,
.preview-body img {
  border: 1px solid var(--border);
  border-radius: 7px;
  display: block;
  height: auto;
  margin: 8px 0;
  max-width: 100%;
}

.preview-modal {
  display: none;
  inset: 0;
  position: fixed;
  z-index: 50;
}

.preview-modal.open {
  display: block;
}

.preview-backdrop {
  background: rgba(15, 23, 42, 0.62);
  inset: 0;
  position: absolute;
}

.preview-dialog {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
  display: grid;
  grid-template-rows: auto 1fr;
  left: 50%;
  max-height: 86vh;
  max-width: 1080px;
  overflow: hidden;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 1080px);
}

.preview-head {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.preview-body {
  color: var(--text);
  line-height: 1.65;
  overflow: auto;
  overflow-wrap: anywhere;
  padding: 18px;
}

.preview-body img {
  max-height: none;
  width: auto;
}

.attachment-preview-list {
  display: grid;
  gap: 10px;
}

.attachment-preview-list a {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--accent);
  overflow-wrap: anywhere;
  padding: 11px 12px;
}

.attachment-preview-list a:hover {
  background: var(--accent-soft);
}

.media-list {
  display: grid;
  gap: 6px;
}

.media-list a {
  overflow-wrap: anywhere;
}

.table-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.table-actions form,
.attachment form {
  margin: 0;
}

.empty-cell {
  color: var(--muted);
  padding: 28px !important;
  text-align: center !important;
}

.empty,
.login-panel,
.form,
.table-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.integration-panel {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 16px;
  padding: 18px;
}

.orders-toolbar {
  display: block;
}

.order-stats {
  grid-template-columns: repeat(8, minmax(140px, 1fr));
}

.order-create-panel {
  margin-bottom: 16px;
}

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

.order-share-panel h2 {
  font-size: 18px;
  margin: 0 0 6px;
}

.order-share-panel p {
  color: var(--muted);
  margin: 0;
}

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

.order-share-links {
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}

.order-share-links a {
  white-space: nowrap;
}

.order-rules-panel {
  margin-bottom: 16px;
}

.order-create-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.order-content-field {
  min-width: 0;
}

.order-create-form textarea {
  min-height: 92px;
}

.order-actions {
  flex-wrap: wrap;
}

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

.duplicate-warning {
  background: #fff7e6;
  border: 1px solid #f3c97a;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.duplicate-list {
  display: grid;
  gap: 10px;
}

.duplicate-item {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #edd8a6;
  border-radius: 7px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.duplicate-item p {
  color: var(--text);
  margin: 0;
  white-space: pre-wrap;
}

.order-form-grid-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.user-actions-panel {
  display: grid;
  gap: 12px;
}

.inline-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 240px) auto;
}

.integration-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 6px;
}

.manual-order-panel {
  margin-bottom: 16px;
}

.manual-entry-table-panel {
  margin-bottom: 16px;
}

.manual-order-form {
  gap: 12px;
}

.manual-order-form textarea {
  min-height: 220px;
}

.manual-order-actions {
  display: flex;
  justify-content: flex-end;
}

.flow-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.flow-list span {
  background: var(--primary-soft);
  border: 1px solid #bce7df;
  border-radius: 999px;
  color: #0b5f59;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
}

.category-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.category-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 12px;
}

.category-pill span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.category-pill strong {
  color: var(--primary);
  font-size: 20px;
}

.login-panel {
  margin: 74px auto 0;
  max-width: 420px;
}

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

.login-brand-logo {
  display: block;
  height: 48px;
  object-fit: contain;
  width: auto;
}

.form {
  display: grid;
  gap: 16px;
}

.form.compact {
  border: 0;
  box-shadow: none;
  padding: 0;
}

.form label,
.form-field {
  color: #263548;
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.field-label {
  display: block;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rich-editor {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--text);
  font-weight: 400;
  line-height: 1.55;
  min-height: 150px;
  outline: none;
  overflow-wrap: anywhere;
  padding: 10px 11px;
}

.rich-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.rich-editor .selected-feedback-image {
  outline: 3px solid rgba(15, 118, 110, 0.42);
}

.image-resize-handle {
  background: var(--primary);
  border: 2px solid #ffffff;
  border-radius: 999px;
  cursor: nwse-resize;
  display: inline-block;
  height: 14px;
  margin-left: -12px;
  margin-top: -18px;
  position: relative;
  vertical-align: bottom;
  width: 14px;
}

.grid,
.admin-grid {
  display: grid;
  gap: 14px;
}

.grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid {
  align-items: start;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin: -4px 0 16px;
}

.admin-tabs a {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: #405168;
  font-weight: 700;
  padding: 9px 14px;
}

.admin-tabs a.active,
.admin-tabs a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.admin-form h2,
.table-panel h2 {
  margin-bottom: 4px;
}

.check-row {
  align-items: center;
  display: flex !important;
  gap: 10px !important;
}

.check-row input {
  min-height: 18px;
  width: 18px;
}

.user-table {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.admin-table {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.user-row {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid #e2ebf1;
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-template-columns: 140px 100px 170px minmax(420px, 1fr);
  padding: 11px 12px;
}

.admin-row {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid #e2ebf1;
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr 1.2fr 1.4fr 160px auto;
  padding: 11px 12px;
}

.user-row.header,
.admin-row.header {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding-bottom: 0;
}

.admin-row form {
  margin: 0;
}

.user-row form {
  align-items: start;
  display: grid;
  gap: 8px;
  margin: 0;
}

.permission-box {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.permission-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.permission-head > span {
  color: var(--muted);
  font-size: 13px;
}

.permission-grid {
  display: grid;
  gap: 8px 12px;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.mini-check {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  margin: 0;
}

.mini-check input {
  min-height: 16px;
  width: 16px;
}

.locked-field {
  align-items: center;
  background: #f3f7fa;
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  color: var(--muted);
  display: flex;
  min-height: 42px;
  padding: 10px 12px;
}

.locked-editor,
.locked-attachments {
  min-height: 120px;
}

.locked-textarea {
  min-height: 100px;
}

.form input[readonly],
.form textarea[readonly] {
  background: #f3f7fa;
  color: var(--text-soft);
  cursor: not-allowed;
}

.inline-empty {
  box-shadow: none;
  margin-top: 8px;
}

.attachments,
.pending-attachments {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.saved-attachments {
  margin-top: 16px;
}

.attachment,
.pending-attachment {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin-top: 8px;
  padding: 10px;
}

.attachment a {
  overflow-wrap: anywhere;
}

.pending-attachment-list {
  display: grid;
  gap: 8px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  border-radius: 7px;
  font-weight: 650;
  padding: 10px 12px;
}

.message.success {
  background: #e5f6ef;
  color: #027a48;
}

.message.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.project-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.filters.project-filters {
  grid-template-columns: minmax(260px, 1fr) 160px 180px auto auto;
}

.project-table {
  min-width: 980px;
}

.project-table th,
.project-table td {
  font-size: 13px;
  padding: 9px 8px;
  vertical-align: top;
}

.project-table th:nth-child(1) {
  width: 18%;
}

.project-table th:nth-child(2),
.project-table th:nth-child(3),
.project-table th:nth-child(4),
.project-table th:nth-child(5),
.project-table th:nth-child(6) {
  width: 9%;
}

.project-table th:nth-child(7) {
  width: 22%;
}

.project-table th:nth-child(8) {
  width: 12%;
}

.project-table th:nth-child(9) {
  width: 12%;
}

.project-next-action {
  display: -webkit-box;
  line-height: 1.45;
  max-height: 2.9em;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.next-action-list,
.project-next-actions { display: grid; gap: 8px; }
.next-action-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.project-next-actions { margin: 0; padding-left: 20px; }

.table-main-link {
  color: var(--text);
  display: inline-block;
  font-weight: 750;
}

.table-main-link:hover {
  color: var(--accent);
}

.pill,
.status-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  min-height: 26px;
  padding: 6px 10px;
  white-space: nowrap;
}

.pill {
  background: var(--accent-soft);
  color: #1d4ed8;
}

.status-pill {
  background: #eef2f7;
  color: #334155;
}

.status-正常 {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-延期 {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-即将到期 {
  background: var(--warning-soft);
  color: #9a5b00;
}

.status-暂停 {
  background: var(--warning-soft);
  color: #9a5b00;
}

.status-已完成 {
  background: #e7edf2;
  color: var(--text-soft);
}

.project-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.project-detail-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  margin-bottom: 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  padding: 16px;
}

.section-title {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.info-grid div {
  background: var(--surface-soft);
  border: 1px solid rgba(169, 184, 200, 0.7);
  border-radius: 8px;
  padding: 12px;
}

.info-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 6px;
}

.info-grid dd {
  color: var(--text);
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}

.project-note {
  display: grid;
  gap: 7px;
}

.project-note h3 {
  color: var(--text);
  font-size: 15px;
  margin: 0;
}

.project-note p,
.timeline-item p {
  color: var(--text-soft);
  line-height: 1.6;
  margin: 0;
  overflow-wrap: anywhere;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-tools {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.timeline-tools input {
  min-height: 34px;
}

.timeline-item {
  border-left: 3px solid var(--primary);
  display: grid;
  gap: 4px;
  padding-left: 12px;
}

.timeline-item.is-hidden {
  display: none;
}

.timeline-item time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timeline-item strong {
  color: var(--text);
}

.project-issue-create,
.issue-list,
.issue-group,
.issue-group-body,
.issue-item,
.project-upload-form,
.project-file-list {
  display: grid;
  gap: 12px;
}

.issue-group {
  border: 1px solid rgba(169, 184, 200, 0.72);
  border-radius: 8px;
  overflow: hidden;
}

.issue-group-head {
  align-items: center;
  background: #eef2f7;
  border-bottom: 1px solid rgba(169, 184, 200, 0.72);
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
}

.issue-group-head h3 {
  color: var(--text);
  font-size: 15px;
  margin: 0;
}

.issue-group-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.issue-group-body {
  background: rgba(248, 250, 252, 0.72);
  padding: 12px;
}

.issue-group-未处理 .issue-group-head {
  background: var(--danger-soft);
}

.issue-group-处理中 .issue-group-head {
  background: var(--warning-soft);
}

.issue-group-已解决 .issue-group-head {
  background: var(--primary-soft);
}

.project-issue-create,
.issue-item,
.project-upload-form,
.project-file-item {
  background: var(--surface-soft);
  border: 1px solid rgba(169, 184, 200, 0.72);
  border-radius: 8px;
  padding: 14px;
}

.project-issue-create label,
.issue-item label,
.project-upload-form label {
  color: #263548;
  display: grid;
  gap: 7px;
  font-weight: 700;
}

.issue-item-head,
.project-file-item {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.issue-item-head span,
.project-file-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.project-file-item > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-file-item a {
  font-weight: 750;
  overflow-wrap: anywhere;
}

.project-board-shell {
  border: 1px solid rgba(169, 184, 200, 0.88);
  border-radius: 10px;
  min-height: 720px;
  overflow: auto;
  background:
    linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    #f8fafc;
  background-size: 28px 28px;
}

.project-board {
  min-height: 1200px;
  min-width: 1700px;
  position: relative;
}

.board-card {
  background: #ffffff;
  border: 1px solid rgba(169, 184, 200, 0.9);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(18, 32, 52, 0.12);
  display: grid;
  gap: 10px;
  padding: 12px;
  position: absolute;
}

.board-card.is-dragging,
.board-card.is-resizing {
  box-shadow: 0 18px 36px rgba(18, 32, 52, 0.18);
  z-index: 3;
}

.board-card-未处理 {
  border-top: 5px solid #d92d20;
}

.board-card-处理中 {
  border-top: 5px solid #d97706;
}

.board-card-已解决 {
  border-top: 5px solid #0f766e;
}

.board-note-card {
  background: #fffbea;
  border-color: #facc15;
  border-top: 5px solid #eab308;
}

.board-note-card .board-card-handle {
  background: #fef3c7;
}

.board-card-handle {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid rgba(169, 184, 200, 0.66);
  border-radius: 8px;
  cursor: grab;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: -2px -2px 0;
  min-height: 42px;
  padding: 8px 10px;
  touch-action: none;
  user-select: none;
}

.board-card-handle:active {
  cursor: grabbing;
}

.board-card-handle small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  margin-left: 6px;
}

.board-card-head-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.board-collapse-button {
  box-shadow: none;
  font-size: 12px;
  min-height: 28px;
  padding: 4px 8px;
}

.board-card-body {
  display: grid;
  gap: 10px;
}

.board-card.is-collapsed {
  gap: 0;
}

.board-card.is-collapsed .board-card-body,
.board-card.is-collapsed .board-resize-handle {
  display: none;
}

.board-card.is-collapsed .board-card-handle {
  margin-bottom: -2px;
}

.board-card-form,
.board-image-upload,
.board-comment-form,
.board-comments {
  display: grid;
  gap: 8px;
}

.board-card-form label {
  color: #263548;
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 750;
}

.board-card textarea,
.board-card select,
.board-card input {
  font-size: 13px;
}

.board-card-grid {
  gap: 8px;
}

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

.board-image-item {
  display: grid;
  gap: 6px;
}

.board-image-button {
  border: 1px solid rgba(169, 184, 200, 0.7);
  box-shadow: none;
  min-height: 0;
  padding: 0;
}

.board-image-button img {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.board-comments {
  border-top: 1px solid rgba(169, 184, 200, 0.66);
  padding-top: 8px;
}

.board-comments strong {
  color: var(--text);
  font-size: 13px;
}

.board-comments p {
  background: var(--surface-soft);
  border-radius: 7px;
  color: var(--text-soft);
  display: grid;
  gap: 3px;
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
  padding: 8px;
}

.board-comments p span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.board-resize-handle {
  background: var(--primary);
  border: 2px solid #ffffff;
  border-radius: 999px;
  bottom: -8px;
  box-shadow: var(--shadow-soft);
  cursor: ew-resize;
  height: 18px;
  min-height: 0;
  padding: 0;
  position: absolute;
  right: -8px;
  width: 18px;
  touch-action: none;
}

.board-empty {
  left: 24px;
  position: absolute;
  top: 24px;
}

.image-lightbox {
  align-items: center;
  background: rgba(15, 23, 42, 0.82);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 20;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox img {
  max-height: 88vh;
  max-width: 92vw;
  object-fit: contain;
}

.image-lightbox-close {
  position: fixed;
  right: 24px;
  top: 24px;
}

@media (max-width: 760px) {
  .topbar {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 12px 14px;
  }

  .brand {
    grid-column: 1;
    justify-self: start;
  }

  .nav {
    grid-column: 1;
    justify-self: start;
  }

  .nav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .container {
    padding: 18px 12px 32px;
  }

  h1 {
    font-size: 24px;
  }

  .page-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stats,
  .filters,
  .filters.return-filters,
  .filters.taobao-filters,
  .filters.order-filters,
  .filters.project-filters,
  .stats.taobao-stats,
  .project-stats,
  .order-stats,
  .integration-panel,
  .category-strip,
  .grid,
  .admin-grid,
  .project-detail-layout,
  .info-grid,
  .attachment,
  .user-row,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .instruction-hero,
  .instruction-upload-panel,
  .instruction-upload-form,
  .instruction-card {
    grid-template-columns: 1fr;
  }

  .instruction-hero h1 {
    font-size: 28px;
  }

  .instruction-hero-meta {
    text-align: left;
  }

  .instruction-actions {
    justify-content: stretch;
  }

  .instruction-actions .button,
  .instruction-actions button {
    width: 100%;
  }

  .actions {
    justify-content: stretch;
  }

  .actions > button,
  .actions > .button,
  .filters button,
  .form > button,
  .form > .button {
    width: 100%;
  }

  .order-create-form .actions {
    display: block;
  }

  .toolbar {
    display: grid;
    gap: 10px;
  }

  .export-form,
  .export-form input,
  .export-form button {
    width: 100%;
  }

  .order-create-form {
    grid-template-columns: 1fr;
  }

  .order-share-panel,
  .order-share-links {
    align-items: stretch;
    flex-direction: column;
  }

  .order-share-links {
    width: 100%;
  }

  .order-form-grid,
  .order-form-grid-wide {
    grid-template-columns: 1fr;
  }

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

  .admin-tabs {
    display: grid;
  }

  .records-panel {
    margin-left: -4px;
    margin-right: -4px;
  }

  .records-table th,
  .records-table td {
    padding: 10px 8px;
  }

  .login-panel {
    margin-top: 34px;
  }

  .user-row.header,
  .admin-row.header {
    display: none;
  }

  .permission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-card,
  .project-form {
    padding: 14px;
  }

  .issue-item-head,
  .project-file-item {
    align-items: stretch;
    display: grid;
  }
}

.warehouse-app {
  width: min(85vw, 1480px);
  margin: 0 auto;
  padding: 28px 0 64px;
  text-align: center;
}

.warehouse-header {
  display: grid;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.12);
  text-align: center;
}

.warehouse-header h1 {
  color: #111827;
}

#warehouseStatus {
  color: #64748b;
  font-size: 14px;
}

.warehouse-notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.warehouse-notice.is-info {
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(219, 234, 254, 0.92);
}

.warehouse-notice.is-warning {
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.32);
  background: rgba(254, 243, 199, 0.96);
}

.warehouse-notice.is-error {
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(254, 226, 226, 0.96);
}

.warehouse-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.warehouse-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.warehouse-app .primary-button,
.warehouse-app .secondary-button {
  color: #172554;
  border-color: #6f8bd8;
  background: #aebfec;
  box-shadow: 0 8px 18px rgba(77, 101, 168, 0.18);
}

.warehouse-app .primary-button:hover,
.warehouse-app .secondary-button:hover {
  border-color: #5f7fd2;
  background: #bccaf1;
  box-shadow: 0 10px 22px rgba(77, 101, 168, 0.22);
}

.warehouse-table-shell {
  overflow: auto;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.06);
}

.warehouse-table-toggle {
  margin: 12px auto 0;
  min-width: 220px;
}

.warehouse-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  color: #111827;
}

.warehouse-table th,
.warehouse-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
  vertical-align: top;
  text-align: center;
}

.warehouse-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #ffffff;
  background: #1c7b86;
  font-size: 13px;
  font-weight: 700;
}

.warehouse-table th[data-sort-key] {
  cursor: pointer;
  user-select: none;
}

.warehouse-table th[data-sort-key]::after {
  content: "↕";
  display: inline-block;
  margin-left: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.warehouse-table th[data-sort-key].is-sorted::after {
  color: #ffffff;
  content: "↑";
}

.warehouse-table th[data-sort-key].is-sorted[data-sort-direction="desc"]::after {
  content: "↓";
}

.warehouse-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.warehouse-table td:nth-child(4),
.warehouse-table td:nth-child(5),
.warehouse-table td:nth-child(6),
.warehouse-table td:nth-child(7) {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.warehouse-table td:nth-child(1),
.warehouse-table td:nth-child(2),
.warehouse-table td:nth-child(3),
.warehouse-table td:nth-child(8) {
  word-break: break-word;
}

.warehouse-onway-cell {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.warehouse-onway-summary {
  color: #111827;
  font-weight: 700;
  line-height: 1.2;
}

.warehouse-onway-details {
  display: grid;
  gap: 4px;
  width: 100%;
  max-width: 320px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(28, 123, 134, 0.06);
}

.warehouse-onway-detail {
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.warehouse-image-cell {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.warehouse-image-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.warehouse-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.06);
}

.warehouse-toolbar-copy {
  display: grid;
  gap: 4px;
}

.warehouse-toolbar-copy strong {
  color: #111827;
  font-size: 16px;
}

.warehouse-toolbar-copy p {
  color: #64748b;
  font-size: 13px;
}

.warehouse-toolbar textarea {
  min-height: 98px;
  border-color: rgba(31, 41, 55, 0.18);
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.warehouse-import-preview {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.98), rgba(243, 248, 255, 0.98));
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.06);
}

.warehouse-import-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.warehouse-import-preview h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
}

.warehouse-import-preview p {
  color: #64748b;
  font-size: 13px;
}

.warehouse-import-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.warehouse-import-preview-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.warehouse-import-preview-summary article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 10px;
  background: #ffffff;
}

.warehouse-import-preview-summary span {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.warehouse-import-preview-summary strong {
  color: #111827;
  font-size: 24px;
  line-height: 1;
}

.warehouse-import-preview-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.warehouse-import-preview-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 10px;
  background: #ffffff;
}

.warehouse-import-preview-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.warehouse-import-preview-card-head h3 {
  margin: 0;
  color: #111827;
  font-size: 16px;
}

.warehouse-import-preview-card-head strong {
  color: #172554;
  font-size: 22px;
  line-height: 1;
}

.warehouse-import-preview-items {
  display: grid;
  gap: 6px;
}

.warehouse-import-preview-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.warehouse-import-preview-item span {
  color: #111827;
  font-size: 14px;
  font-weight: 600;
}

.warehouse-import-preview-item small {
  color: #64748b;
  font-size: 12px;
}

.warehouse-import-preview-item strong {
  color: #172554;
  font-size: 18px;
}

.warehouse-category-head-editable {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  align-items: center;
}

.warehouse-category-head-editable input,
.warehouse-remark-input,
.warehouse-item-fields input,
.warehouse-count-input {
  border-color: rgba(31, 41, 55, 0.18);
  background: #ffffff;
}

.warehouse-category-head-editable input,
.warehouse-remark-input {
  min-height: 38px;
}

.warehouse-remark-input {
  width: 100%;
  margin-top: -2px;
}

.warehouse-item-row-editable {
  grid-template-columns: minmax(0, 1fr) 120px auto;
}

.warehouse-item-fields {
  display: grid;
  grid-template-columns: minmax(140px, 1.3fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(140px, 1fr);
  gap: 8px;
  min-width: 0;
}

.warehouse-item-fields input,
.warehouse-count-input {
  min-height: 38px;
}

.warehouse-count-input {
  width: 120px;
}

.warehouse-mini-button,
.warehouse-add-row-button {
  min-height: 36px;
  padding: 0 12px;
}

.warehouse-add-row-button {
  justify-self: start;
}

.warehouse-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  text-align: center;
}

.warehouse-summary-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(31, 41, 55, 0.16);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(239, 246, 255, 0.98));
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.06);
}

.warehouse-summary-card span {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.warehouse-summary-card strong {
  color: #111827;
  font-size: 32px;
  line-height: 1;
}

.warehouse-summary-card small {
  color: #64748b;
  font-size: 13px;
}

.warehouse-section {
  padding: 14px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.06);
}

.warehouse-section + .warehouse-section {
  margin-top: 18px;
}

.warehouse-section-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  justify-items: center;
  text-align: center;
}

.warehouse-section-head h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
}

.warehouse-section-head p {
  color: #64748b;
  font-size: 13px;
}

.warehouse-search-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  justify-items: center;
  margin-bottom: 12px;
}

.warehouse-search-field {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 720px;
  justify-items: center;
}

.warehouse-search-field span,
.warehouse-search-count {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.warehouse-search-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(31, 41, 55, 0.18);
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  text-align: center;
  box-shadow: 0 4px 12px rgba(31, 41, 55, 0.04);
}

.warehouse-search-clear {
  min-width: 96px;
}

.warehouse-search-count {
  align-self: center;
  padding-bottom: 10px;
}

/* Quality inspection and issue closure */
.quality-stats {
  grid-template-columns: repeat(7, minmax(110px, 1fr));
}

.quality-filters {
  grid-template-columns: minmax(220px, 1.6fr) repeat(2, minmax(140px, 0.8fr)) minmax(150px, 1fr) repeat(4, minmax(130px, 0.8fr)) auto auto;
}

.quality-table small {
  display: block;
  margin-top: 4px;
  color: #64748b;
}

.quality-issue-cell {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
}

.quality-severity,
.quality-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.quality-severity-一般 {
  color: #1d4ed8;
  background: #dbeafe;
}

.quality-severity-严重 {
  color: #9a3412;
  background: #ffedd5;
}

.quality-severity-重大 {
  color: #b91c1c;
  background: #fee2e2;
}

.quality-status-待处理 {
  color: #475569;
  background: #e2e8f0;
}

.quality-status-处理中 {
  color: #1d4ed8;
  background: #dbeafe;
}

.quality-status-待验证 {
  color: #92400e;
  background: #fef3c7;
}

.quality-status-已关闭 {
  color: #166534;
  background: #dcfce7;
}

.quality-overdue-row {
  background: #fff7f7;
}

.quality-overdue-text {
  color: #b91c1c !important;
  font-weight: 700;
}

.quality-closed-row {
  color: #64748b;
  background: #f8fafc;
}

.quality-form {
  display: grid;
  gap: 18px;
}

.quality-form-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 12px;
  background: #f8fafc;
}

.quality-form-section h2,
.quality-workflow-panel h2,
.quality-detail-card h2,
.quality-images-panel h2,
.quality-timeline h2 {
  margin: 0;
  color: #111827;
  font-size: 18px;
}

.quality-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
  margin-top: 8px;
}

.quality-image-list,
.quality-image-list > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quality-detail-summary {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.quality-workflow-panel {
  margin-bottom: 18px;
}

.quality-workflow-panel form {
  display: grid;
  gap: 12px;
}

.quality-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.quality-detail-card,
.quality-images-panel,
.quality-timeline {
  padding: 18px;
}

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

.quality-detail-list > div {
  min-width: 0;
}

.quality-detail-list .full {
  grid-column: 1 / -1;
}

.quality-detail-list dt {
  margin-bottom: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.quality-detail-list dd {
  margin: 0;
  color: #111827;
  line-height: 1.6;
  white-space: pre-wrap;
}

.quality-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.quality-action-list span {
  padding: 5px 9px;
  border-radius: 8px;
  color: #1e3a8a;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 600;
}

.quality-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.quality-image-grid figure {
  margin: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.quality-image-grid img {
  width: 100%;
  height: 140px;
  border-radius: 7px;
  object-fit: cover;
}

.quality-image-grid figcaption {
  margin: 7px 0;
  overflow: hidden;
  color: #475569;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quality-timeline {
  margin-top: 18px;
}

.quality-timeline article {
  position: relative;
  display: grid;
  gap: 4px;
  margin-left: 7px;
  padding: 0 0 18px 20px;
  border-left: 2px solid #dbeafe;
}

.quality-timeline article::before {
  position: absolute;
  top: 4px;
  left: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2563eb;
  content: "";
}

.quality-timeline article span {
  color: #64748b;
  font-size: 12px;
}

.quality-timeline article p {
  margin: 2px 0 0;
  color: #334155;
  white-space: pre-wrap;
}

.quality-delete-form {
  margin-top: 18px;
  text-align: right;
}

@media (max-width: 1100px) {
  .quality-stats {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
  }

  .quality-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .quality-stats,
  .quality-filters,
  .quality-action-grid,
  .quality-detail-grid,
  .quality-detail-list {
    grid-template-columns: 1fr;
  }

  .quality-detail-list .full {
    grid-column: auto;
  }

  .quality-form-section,
  .quality-detail-card,
  .quality-images-panel,
  .quality-timeline {
    padding: 14px;
  }
}
.quality-module-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 22px;
  padding: 6px;
  border: 1px solid #dfe5ec;
  border-radius: 12px;
  background: #f7f9fb;
  overflow-x: auto;
}
.quality-module-tabs a { color: #52606d; padding: 9px 15px; border-radius: 8px; white-space: nowrap; text-decoration: none; font-weight: 600; }
.quality-module-tabs a.active { color: #fff; background: #164e63; }
.inspection-result { display: inline-block; border-radius: 999px; padding: 3px 9px; font-weight: 700; background: #eef2f6; }
.result-合格 { color: #166534; background: #dcfce7; }
.result-不合格 { color: #991b1b; background: #fee2e2; }
.result-让步接收 { color: #92400e; background: #fef3c7; }
.critical-badge { display: block; width: fit-content; margin-top: 4px; color: #991b1b; background: #fee2e2; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inspection-edit-table input, .inspection-edit-table select, .inspection-entry-table input, .inspection-entry-table select { min-width: 88px; width: 100%; }
.inspection-edit-table th:nth-child(1), .inspection-edit-table td:nth-child(1), .inspection-edit-table th:nth-child(2), .inspection-edit-table td:nth-child(2) { min-width: 150px; }
.review-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.review-actions form { display: grid; gap: 10px; }
@media (max-width: 720px) { .review-actions { grid-template-columns: 1fr; } }
