:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #17191c;
  background: #f4f5f7;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: #f4f5f7; }
.login-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: #f4f5f7; }
.login-card { width: min(380px, 100%); padding: 28px; border: 1px solid #dfe2e7; border-radius: 12px; background: #fff; box-shadow: 0 16px 45px rgba(0,0,0,.12); }
.login-card h1 { margin: 0 0 8px; font-size: 22px; }
.login-card p { margin: 0 0 20px; color: #737881; font-size: 13px; }
.login-card label { display: grid; gap: 6px; margin-top: 14px; color: #555b64; font-size: 13px; }
.login-card input { height: 42px; box-sizing: border-box; padding: 0 11px; border: 1px solid #cfd3da; border-radius: 6px; font-size: 15px; }
.login-card button { width: 100%; height: 42px; margin-top: 20px; border: 0; border-radius: 6px; color: #fff; background: #1677ff; font-size: 15px; font-weight: 700; }
.login-error { color: #c92a2a !important; margin: 12px 0 -8px !important; }
body.login-required > *:not(.login-screen) { visibility: hidden; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.topbar {
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: #17191c;
  border-bottom: 3px solid #fe2c55;
}
.brand { margin: 0; font-size: 17px; font-weight: 750; }
.shop { margin: 4px 0 0; font-size: 13px; color: #b9bdc5; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.sync-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #fe2c55;
  font-weight: 700;
}
.sync-button:hover { background: #df1740; }
.sync-button:disabled { cursor: wait; opacity: .65; }
.token-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 6px;
  color: #fff;
  background: rgba(255,255,255,.08);
  font-weight: 700;
}
.token-button:hover { background: rgba(255,255,255,.16); }
.sync-icon { font-size: 21px; line-height: 1; }
.sync-button.is-running .sync-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-layout { min-height: calc(100vh - 72px); display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.side-menu { padding: 18px 12px; background: #202327; border-right: 1px solid #30343a; }
.menu-item { width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-left: 3px solid transparent; border-radius: 4px; text-align: left; color: #c8ccd2; background: transparent; font-size: 13px; font-weight: 650; }
.menu-item + .menu-item { margin-top: 4px; }
.menu-item:hover { color: #fff; background: #2b2f35; }
.menu-item.active { color: #fff; background: #34383f; border-left-color: #fe2c55; }
.content-area { min-width: 0; }
.summary-band {
  padding: 0 clamp(16px, 3vw, 40px);
  display: grid;
  grid-template-columns: 140px 140px minmax(220px, 1fr) minmax(260px, 1.4fr);
  background: #fff;
  border-bottom: 1px solid #dfe2e7;
}
.summary-item { padding: 18px 20px; border-right: 1px solid #e7e9ed; }
.summary-item:first-child { padding-left: 0; }
.summary-item:last-child { border-right: 0; }
.summary-item span { display: block; margin-bottom: 7px; color: #70757e; font-size: 12px; }
.summary-item strong { display: block; font-size: 20px; line-height: 1.25; }
.summary-item.wide strong { font-size: 14px; font-weight: 650; }
.status-text { color: #087f5b; }
.status-text.error { color: #c92a2a; }
.status-text.running { color: #9c6500; }
.sync-error { color: #c92a2a; }

.progress-region { padding: 12px clamp(16px, 3vw, 40px); background: #fff8df; border-bottom: 1px solid #f2d98c; }
.progress-track { height: 4px; overflow: hidden; background: #eadcae; }
.progress-track span { display: block; width: 0; height: 100%; background: #b77900; transition: width .25s ease; }
.progress-region p { margin: 8px 0 0; color: #6e5300; font-size: 13px; }

.workspace { padding: 24px clamp(16px, 3vw, 40px) 48px; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(6, 135px); gap: 12px; align-items: end; }
.coupon-toolbar { grid-template-columns: minmax(260px, 1fr) 160px 160px; }
.custom-goods-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 12px; align-items: center; }
.primary-action, .secondary-action { min-height: 40px; padding: 0 16px; border-radius: 6px; font-weight: 700; }
.primary-action { border: 0; color: #fff; background: #fe2c55; }
.primary-action:hover { background: #df1740; }
.secondary-action { border: 1px solid #cfd3da; color: #30343a; background: #fff; }
.search-field { height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #fff; border: 1px solid #cfd3da; border-radius: 6px; }
.search-field:focus-within { border-color: #17191c; box-shadow: 0 0 0 2px rgba(23,25,28,.1); }
.search-icon { color: #7a7f87; font-size: 18px; }
.search-field input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; }
.filter-field { display: grid; gap: 5px; color: #656a73; font-size: 11px; }
.filter-field select, .filter-field input { height: 42px; padding: 0 34px 0 10px; border: 1px solid #cfd3da; border-radius: 6px; background: #fff; color: #202327; }
.filter-field input { padding-right: 10px; }
.result-meta { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #737881; font-size: 12px; }
.product-stock-tabs { width: 100%; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; overflow-x: auto; border: 0; background: transparent; }
.product-stock-tabs button { min-width: 82px; height: 38px; padding: 0 16px; border: 0; border-right: 1px solid #e4e7eb; color: #5f646d; background: #fff; font-weight: 700; }
.product-stock-tabs button:last-child { border-right: 0; }
.product-stock-tabs button:hover { color: #17191c; background: #f7f8fa; }
.product-stock-tabs button.active { color: #fff; background: #17191c; }
.product-batch-actions { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; overflow-x: auto; white-space: nowrap; }
.batch-select-action, .batch-stock-action { min-height: 30px; padding: 0 10px; border: 1px solid #cfd3da; border-radius: 5px; background: #fff; font-size: 12px; font-weight: 650; }
.batch-stock-action.close-stock { color: #c92a2a; border-color: #e6b8b8; }
.batch-stock-action.open-stock { color: #087f5b; border-color: #a8d8c8; }
.batch-stock-action:disabled { cursor: not-allowed; color: #a0a5ad; border-color: #d9dce1; background: #f4f5f7; }

.state-message { padding: 64px 20px; text-align: center; color: #70757e; background: #fff; border: 1px solid #dfe2e7; }
.state-message.error { color: #a61e1e; background: #fff5f5; border-color: #ffc9c9; }
.token-dialog { width: min(680px, calc(100vw - 28px)); padding: 0; border: 1px solid #d5d9df; border-radius: 6px; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.token-dialog::backdrop { background: rgba(20,22,25,.48); }
.token-dialog form { display: grid; grid-template-rows: auto 1fr auto; }
.token-dialog-body { padding: 18px; display: grid; gap: 10px; }
.token-dialog-body label { color: #4f555f; font-size: 12px; font-weight: 700; }
.token-dialog-body textarea { width: 100%; min-height: 180px; resize: vertical; padding: 12px; border: 1px solid #cfd3da; border-radius: 6px; outline: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.token-dialog-body textarea:focus { border-color: #17191c; box-shadow: 0 0 0 2px rgba(23,25,28,.1); }
.token-help, .token-status { margin: 0; color: #70757e; font-size: 12px; line-height: 1.55; }
.token-status.configured { color: #087f5b; }
.token-status.unconfigured { color: #9c6500; }
.table-wrap { overflow: auto; background: #fff; border: 1px solid #dfe2e7; }
.fixed-product-header { position: fixed; top: 0; z-index: 50; overflow: hidden; background: #f7f8fa; border-bottom: 1px solid #d5d9df; box-shadow: 0 2px 5px rgba(0,0,0,.12); }
.fixed-product-header table { margin: 0; }
.fixed-product-header th { position: static; }
table { width: 100%; min-width: 2045px; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
th { position: sticky; top: 0; z-index: 1; padding: 11px 12px; text-align: left; color: #5f646d; background: #f7f8fa; border-bottom: 1px solid #d5d9df; font-size: 11px; font-weight: 700; }
.column-heading { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.column-info { width: 16px; height: 16px; padding: 0; display: inline-grid; place-items: center; border: 1px solid #8b919a; border-radius: 50%; color: #676d76; background: transparent; font-size: 10px; font-weight: 800; line-height: 1; }
.column-info:hover, .column-info:focus-visible { color: #fff; background: #34383f; border-color: #34383f; outline: none; }
td { padding: 12px; vertical-align: middle; border-bottom: 1px solid #eceef1; color: #30343a; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
th:nth-child(1) { width: 45px; }
th:nth-child(2) { width: 160px; }
th:nth-child(3) { width: 120px; }
th:nth-child(4) { width: 250px; }
th:nth-child(5) { width: 175px; }
th:nth-child(6) { width: 145px; }
th:nth-child(7) { width: 180px; }
th:nth-child(8) { width: 100px; }
th:nth-child(9), th:nth-child(10) { width: 105px; }
th:nth-child(11), th:nth-child(12) { width: 100px; }
th:nth-child(13) { width: 110px; }
th:nth-child(14) { width: 90px; }
th:nth-child(15) { width: 100px; }
th:nth-child(16) { width: 165px; }
th:nth-child(17) { width: 100px; }
th:nth-child(18) { width: 110px; }
th:nth-child(19) { width: 110px; }
th:nth-child(20) { width: 230px; }
.product-select-cell, .product-select-header { width: 45px !important; padding-right: 4px; padding-left: 4px; text-align: center; }
.product-select-checkbox { width: 15px; height: 15px; accent-color: #1677ff; }
.cost-price { white-space: nowrap; }
.negative-profit { color: #b42318; font-weight: 700; }
.coupon-table { min-width: 1450px; }
.coupon-table th:nth-child(1) { width: 180px; }
.coupon-table th:nth-child(2) { width: 260px; }
.coupon-table th:nth-child(3) { width: 120px; }
.coupon-table th:nth-child(4) { width: 100px; }
.coupon-table th:nth-child(5) { width: 110px; }
.coupon-table th:nth-child(6) { width: 360px; }
.coupon-table th:nth-child(7) { width: 110px; }
.coupon-table th:nth-child(8) { width: 190px; }
.coupon-table th:nth-child(9) { width: 120px; }
.quotation-table { min-width: 1120px; }
.quotation-table th:nth-child(1) { width: 150px; }
.quotation-table th:nth-child(2) { width: 420px; }
.quotation-table th:nth-child(3) { width: 130px; }
.quotation-table th:nth-child(4) { width: 190px; }
.quotation-table th:nth-child(5) { width: 110px; }
.quotation-table th:nth-child(6) { width: 180px; }
.dine-goods-toolbar { grid-template-columns: minmax(280px, 1fr) 160px 160px; }
#laoliSupplierView .dine-goods-toolbar { grid-template-columns: minmax(280px, 1fr) 160px auto auto; }
.laoli-status-tabs { margin-bottom: 12px; display: inline-flex; overflow: hidden; border: 1px solid #cfd3da; border-radius: 6px; background: #fff; }
.laoli-status-tabs button { min-width: 78px; height: 38px; padding: 0 16px; border: 0; border-right: 1px solid #e4e7eb; color: #5f646d; background: #fff; font-weight: 700; }
.laoli-status-tabs button:last-child { border-right: 0; }
.laoli-status-tabs button:hover { color: #17191c; background: #f7f8fa; }
.laoli-status-tabs button.active { color: #fff; background: #17191c; }
.laoli-supplier-table { min-width: 1180px; }
.laoli-supplier-table th { padding: 8px 10px; }
.laoli-supplier-table td { padding: 7px 10px; line-height: 1.35; }
.laoli-refresh-button.is-complete { color: #16803c; border-color: #b7dfc2; background: #f0faf2; }
.laoli-supplier-table th:nth-child(1) { width: 120px; }
.laoli-supplier-table th:nth-child(2) { width: 320px; }
.laoli-supplier-table th:nth-child(3) { width: 120px; }
.laoli-supplier-table th:nth-child(4), .laoli-supplier-table th:nth-child(5) { width: 90px; }
.laoli-supplier-table th:nth-child(6) { width: 160px; }
.laoli-supplier-table th:nth-child(7), .laoli-supplier-table th:nth-child(8) { width: 90px; }
.laoli-supplier-table th:nth-child(9) { width: 180px; }
.laoli-combo-detail { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #e5e7eb; line-height: 1.5; }
.laoli-combo-detail:last-child { border-bottom: 0; }
.laoli-combo-detail strong { color: #17191c; }
.text-ellipsis-button { max-width: 100%; padding: 0; overflow: hidden; border: 0; color: #2563eb; background: transparent; text-align: left; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.text-ellipsis-button:hover { color: #1d4ed8; text-decoration: underline; }
.dine-goods-table { min-width: 1580px; }
.dine-goods-table th:nth-child(1) { width: 110px; }
.dine-goods-table th:nth-child(2) { width: 280px; }
.dine-goods-table th:nth-child(3) { width: 100px; }
.dine-goods-table th:nth-child(4) { width: 190px; }
.dine-goods-table th:nth-child(5), .dine-goods-table th:nth-child(6), .dine-goods-table th:nth-child(7) { width: 100px; }
.dine-goods-table th:nth-child(8), .dine-goods-table th:nth-child(9) { width: 110px; }
.dine-goods-table th:nth-child(10) { width: 100px; }
.dine-goods-table th:nth-child(11) { width: 140px; }
.dine-goods-table th:nth-child(12) { width: 180px; }
.custom-goods-table { min-width: 1610px; }
.custom-goods-table th:nth-child(1) { width: 220px; }
.custom-goods-table th:nth-child(2), .custom-goods-table th:nth-child(3) { width: 90px; }
.custom-goods-table th:nth-child(4) { width: 100px; }
.custom-goods-table th:nth-child(5) { width: 110px; }
.custom-goods-table th:nth-child(6) { width: 150px; }
.custom-goods-table th:nth-child(7) { width: 340px; }
.custom-goods-table th:nth-child(8), .custom-goods-table th:nth-child(9) { width: 120px; }
.custom-goods-table th:nth-child(10) { width: 260px; }
.custom-goods-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.custom-goods-table td { overflow: hidden; }
.goods-image { width: 64px; height: 64px; display: block; object-fit: contain; border: 1px solid #e0e3e8; border-radius: 4px; background: #f4f5f7; }
.child-summary { min-width: 0; line-height: 1.65; overflow-wrap: anywhere; }
.upload-status { font-weight: 700; }
.upload-status.pending { color: #c92a2a; }
.upload-status.uploaded { color: #087f5b; }
.goods-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.goods-row-actions button { min-height: 30px; padding: 0 9px; border: 1px solid #cfd3da; border-radius: 5px; background: #fff; font-size: 12px; }
.goods-row-actions .danger-action { color: #c92a2a; }

.goods-dialog { width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid #d5d9df; border-radius: 6px; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.goods-dialog::backdrop { background: rgba(20,22,25,.48); }
.goods-dialog form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 42px); }
.goods-editor-layout { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 390px; overflow: hidden; }
.goods-dialog-header, .goods-dialog-footer { padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e5e7eb; }
.goods-dialog-footer { justify-content: flex-end; border-top: 1px solid #e5e7eb; border-bottom: 0; }
.goods-dialog-header h2 { margin: 0; font-size: 17px; }
.goods-dialog-header button { width: 32px; height: 32px; border: 0; background: transparent; font-size: 24px; }
.import-json-dialog { width: min(760px, calc(100vw - 32px)); padding: 0; border: 1px solid #d5d9df; border-radius: 6px; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.import-json-dialog::backdrop { background: rgba(20,22,25,.48); }
.import-json-dialog form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.import-json-body { padding: 18px; display: grid; gap: 8px; }
.import-json-body label { color: #40454d; font-size: 12px; font-weight: 700; }
.import-json-body textarea { width: 100%; min-height: 340px; padding: 12px; resize: vertical; border: 1px solid #cfd3da; border-radius: 5px; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.import-json-body p { margin: 0; color: #737881; font-size: 11px; }
.goods-form-body { padding: 18px; overflow: auto; }
.goods-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.goods-form-grid label, .child-goods-row label { display: grid; gap: 6px; color: #5f646d; font-size: 12px; }
.goods-form-grid input, .goods-form-grid select, .child-goods-row input, .category-fields input { width: 100%; height: 40px; padding: 0 10px; border: 1px solid #cfd3da; border-radius: 5px; background: #fff; }
.image-source-field { min-width: 0; margin: 0; padding: 10px; border: 1px solid #d8dce2; border-radius: 5px; }
.image-source-field legend { color: #5f646d; font-size: 12px; }
.image-source-panel { min-height: 42px; }
.image-source-panel input[type="url"] { width: 100%; height: 40px; padding: 0 10px; border: 1px solid #cfd3da; border-radius: 5px; }
.image-upload-field { position: relative; }
.compact-image-field { padding: 8px 10px; }
.compact-image-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; align-items: center; }
.compact-image-row > select { width: 100%; height: 34px; padding: 0 8px; border: 1px solid #cfd3da; border-radius: 5px; background: #fff; font-size: 11px; }
.compact-image-row .image-source-panel { min-height: 34px; }
.compact-image-row .image-source-panel input[type="url"] { height: 34px; font-size: 11px; }
.compact-library-panel { display: flex; align-items: center; gap: 8px; }
.compact-library-panel .secondary-action { min-height: 34px; }
.image-file-input { padding: 7px !important; background: #fff; }
.image-upload-status { min-height: 16px; color: #737881; font-size: 11px; }
.image-upload-status.uploading { color: #9c6500; }
.image-upload-status.uploaded { color: #087f5b; font-weight: 700; }
.image-upload-status.failed { color: #c92a2a; }
.children-heading { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; }
.children-heading h3 { margin: 0; font-size: 14px; }
.children-heading button { min-height: 34px; padding: 0 10px; border: 1px solid #cfd3da; border-radius: 5px; background: #fff; }
.goods-category-actions { display: flex; align-items: center; gap: 8px; }
.child-goods-list { margin-top: 10px; display: grid; gap: 10px; }
.category-list { margin-top: 10px; display: grid; gap: 14px; }
.goods-category { padding: 14px; border: 1px solid #d8dce2; border-radius: 5px; background: #f7f8fa; }
.category-fields { display: grid; grid-template-columns: minmax(160px, 1fr) 130px 130px auto; gap: 10px; align-items: end; }
.category-fields label { display: grid; gap: 6px; color: #5f646d; font-size: 12px; }
.remove-category-button { height: 40px; border: 1px solid #ffc9c9; border-radius: 5px; color: #c92a2a; background: #fff5f5; }
.single-product .remove-category-button, .single-product .add-child-button { display: none; }
.child-goods-row { padding: 10px 12px; display: grid; gap: 8px; border: 1px solid #dfe3e8; border-radius: 5px; background: #fff; }
.child-basic-row { display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(140px, 1fr) 36px; gap: 10px; align-items: end; }
.child-image-field { min-width: 0; padding: 0; display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(110px, auto); gap: 8px; align-items: center; border: 0; background: transparent; }
.child-image-label { color: #737881; font-size: 11px; }
.child-image-field .compact-image-row { grid-template-columns: 108px minmax(0, 1fr); }
.child-image-field .image-source-panel { min-height: 32px; }
.child-image-field .image-file-input { height: 34px; padding: 4px !important; font-size: 11px; }
.child-image-field .image-file-input::file-selector-button { height: 24px; margin-right: 8px; padding: 0 9px; border: 0; border-radius: 4px; color: #30343a; background: #e9ecef; font-weight: 650; cursor: pointer; }
.child-image-field .image-source-panel input[type="url"] { height: 34px; font-size: 11px; }
.child-library-panel { display: flex; align-items: center; gap: 8px; }
.child-library-panel .secondary-action { min-height: 34px; padding: 0 11px; font-size: 11px; }
.selected-child-library-image { min-width: 0; overflow: hidden; color: #737881; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.child-image-field .image-upload-status { min-width: 110px; min-height: 13px; overflow: hidden; color: #737881; text-align: right; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.remove-child-button { width: 36px; height: 40px; border: 1px solid #ffc9c9; border-radius: 5px; color: #c92a2a; background: #fff5f5; font-size: 18px; }
.image-library-dialog { width: min(760px, calc(100vw - 32px)); }
.image-library-grid { max-height: 65vh; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; overflow: auto; }
.image-library-grid button { min-width: 0; padding: 8px; display: grid; gap: 7px; border: 1px solid #d8dce2; border-radius: 5px; background: #fff; }
.image-library-grid img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #f4f5f7; }
.image-library-grid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.empty-library { grid-column: 1 / -1; color: #737881; text-align: center; }
.content-items-table { min-width: 1380px; }
.content-items-table th:nth-child(1), .content-items-table th:nth-child(2) { width: 140px; }
.content-items-table th:nth-child(3) { width: 220px; }
.content-items-table th:nth-child(4), .content-items-table th:nth-child(5) { width: 130px; }
.content-items-table th:nth-child(6) { width: 320px; }
.content-items-table th:nth-child(7) { width: 100px; }
.content-items-table th:nth-child(8), .content-items-table th:nth-child(9) { width: 100px; }
.content-items-table th:nth-child(10) { width: 170px; }
.content-dialog { width: min(980px, calc(100vw - 28px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid #d5d9df; border-radius: 6px; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.content-dialog::backdrop { background: rgba(20,22,25,.48); }
.content-dialog form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100vh - 26px); }
.content-form-body { padding: 18px; overflow: auto; display: grid; gap: 14px; }
.form-field { display: grid; gap: 7px; color: #4f5661; font-size: 13px; }
.form-field.required > span::before { content: "* "; color: #fe2c55; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid #cfd3da; border-radius: 4px; background: #fff; color: #202327; }
.form-field textarea { min-height: 58px; padding: 10px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compact-upload { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 10px; align-items: center; }
.radio-group { margin: 0; padding: 0; border: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; color: #4f5661; font-size: 13px; }
.radio-group legend { width: 100%; margin-bottom: 3px; color: #4f5661; font-weight: 650; }
.radio-group label { display: inline-flex; align-items: center; gap: 6px; }
.radio-group input[type="number"] { width: 90px; height: 32px; padding: 0 8px; border: 1px solid #cfd3da; border-radius: 4px; }
.mini-table-title { color: #4f5661; font-size: 13px; font-weight: 650; }
.mini-config-table { min-width: 0; font-size: 12px; }
.mini-config-table th, .mini-config-table td { padding: 9px 10px; text-align: center; }
.mini-preview-panel { min-width: 0; padding: 16px; overflow: auto; background: #eef1f4; border-left: 1px solid #d8dce2; }
.mini-preview-panel > h3 { margin: 0 0 12px; font-size: 14px; }
.phone-preview { position: relative; width: 370px; height: 700px; margin: 0 auto; overflow: hidden; border: 6px solid #24282d; border-radius: 28px; background: #5c5c5c; box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.mini-page-header { height: 145px; padding: 28px 18px 62px; display: grid; grid-template-columns: 74px 1fr 112px; align-items: center; color: #080808; }
.mini-page-header strong { text-align: center; font-size: 20px; }
.mini-back { font-size: 42px; line-height: 1; }
.mini-control-pill { height: 36px; display: grid; place-items: center; border-radius: 18px; background: rgba(255,255,255,.65); font-size: 10px; white-space: nowrap; }
.preview-sheet { position: absolute; inset: 112px 0 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px 22px 0 0; background: #fff; }
.preview-sheet-header { position: relative; min-height: 72px; display: grid; place-items: center; border-bottom: 1px solid #f0f1f3; }
.preview-sheet-header h2 { margin: 0; font-size: 20px; }
.preview-close { position: absolute; top: 17px; right: 16px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #aeb1b5; font-size: 20px; line-height: 1; }
.preview-product { margin: 18px 13px 16px; display: grid; grid-template-columns: 94px 1fr; gap: 12px; align-items: center; }
.preview-product img { width: 94px; height: 94px; object-fit: contain; border: 1px solid #eceef1; border-radius: 4px; background: #f5f6f7; }.preview-product img.empty { visibility: hidden; }
.preview-product strong { display: block; line-height: 1.45; font-size: 17px; }.preview-product p { margin: 14px 0 0; display: flex; align-items: baseline; gap: 5px; }.preview-product p b { color: #ff4d4f; font-size: 24px; }.preview-product p span { color: #ff4d4f; font-size: 11px; font-weight: 700; }
.preview-categories { min-height: 0; padding: 0 13px 118px; display: grid; gap: 18px; overflow: auto; }.preview-category-heading { margin: 0 0 9px; display: flex !important; align-items: baseline; justify-content: flex-start; gap: 8px; }.preview-categories h4 { margin: 0; font-size: 15px; font-weight: 650; }.preview-category-heading small { color: #8a9098; font-size: 11px; white-space: nowrap; }.preview-categories section > div:last-child { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.preview-categories article { min-width: 0; padding: 6px; display: grid; grid-template-rows: 96px auto; gap: 7px; align-content: start; border: 1px solid transparent; border-radius: 7px; background: #f4f5f7; cursor: pointer; }
.preview-categories article.is-selected { border-color: #ff5b2e; background: #fff9f6; }
.preview-categories article:focus-visible { outline: 2px solid #ffb18f; outline-offset: 2px; }
.preview-child-image { width: 100%; min-height: 0 !important; display: grid; place-items: center; overflow: hidden; border-radius: 4px; color: #a0a5ad; background: #fff; font-size: 10px !important; }
.preview-child-image img { width: 100%; height: 100%; object-fit: contain; }
.preview-categories article > span:last-child { min-height: 35px; overflow-wrap: anywhere; text-align: center; line-height: 1.45; font-size: 11px; }
.preview-checkout { position: absolute; right: 0; bottom: 0; left: 0; background: #fff; box-shadow: 0 -4px 12px rgba(0,0,0,.05); }
.preview-validation { min-height: 30px; padding: 8px 13px; color: #b42318; background: #fff1f0; font-size: 11px; }
.preview-validation.is-success { color: #087f5b; background: #e8f8f2; }
.preview-validation:not([hidden]) + .preview-selected { display: none; }
.preview-selected { min-height: 36px; padding: 10px 13px; overflow: hidden; color: #92979f; background: #f4f5f7; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.preview-checkout button { width: calc(100% - 26px); height: 46px; margin: 10px 13px 12px; border: 0; border-radius: 23px; color: #171717; background: #ffdc00; font-size: 17px; font-weight: 800; }
.new-product-page > .topbar, .new-product-page > .app-layout { display: none; }.new-product-page .goods-dialog { width: 100vw; max-width: none; height: 100vh; max-height: none; border: 0; border-radius: 0; }.new-product-page .goods-dialog[open] { display: block; }.new-product-page .goods-dialog form { height: 100vh; max-height: none; }.new-product-page .goods-dialog::backdrop { background: #f4f5f7; }
.redeemable-product { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(145px, auto); gap: 8px 12px; min-width: 320px; line-height: 1.4; }
.quotation-count { color: #087f5b; font-variant-numeric: tabular-nums; font-weight: 650; }
.quotation-count.is-zero { color: #c92a2a; }
.quotation-count.has-zero { color: #9c6500; }
.quote-stock-state { font-weight: 700; white-space: nowrap; }
.quote-stock-state.is-available { color: #087f5b; }
.quote-stock-state.is-unavailable { color: #c92a2a; }
.product-abnormal-state { font-weight: 700; white-space: nowrap; }
.product-abnormal-state.is-normal { color: #087f5b; }
.product-abnormal-state.is-abnormal { color: #c92a2a; }
.coupon-shared-cell { vertical-align: top; }
.coupon-product-row + .coupon-product-row td:not([rowspan]) { border-top: 1px solid #eceef1; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.title-cell { color: #17191c; font-weight: 650; line-height: 1.45; }
.id-text, .code-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.id-pair { display: grid; gap: 5px; white-space: nowrap; }
.id-pair b { color: #737881; font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; font-size: 11px; font-weight: 650; }
.muted { color: #969ba3; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 4px; white-space: nowrap; background: #eceff3; color: #4d535c; font-size: 11px; font-weight: 650; }
.badge.green { color: #087f5b; background: #dff7ee; }
.badge.red { color: #b42318; background: #ffebe9; }
.badge.yellow { color: #8a5a00; background: #fff3bf; }
.row-actions { display: flex; align-items: center; gap: 8px; }
.stock-action { min-width: 88px; height: 30px; padding: 0 10px; border: 1px solid currentColor; border-radius: 5px; background: #fff; font-size: 12px; font-weight: 650; }
.stock-action.close-stock { color: #c92a2a; }
.stock-action.open-stock { color: #087f5b; }
.stock-action.unavailable-stock { cursor: pointer; color: #8b919a; background: #eef0f2; border-color: #c8ccd2; }
.stock-action.close-stock:hover { color: #fff; background: #c92a2a; }
.stock-action.open-stock:hover { color: #fff; background: #087f5b; }
.stock-action.unavailable-stock:hover { color: #6f757d; background: #e3e5e8; }
.stock-action:disabled { cursor: wait; opacity: .55; }

.pagination { min-height: 56px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.pagination button { width: 34px; height: 34px; border: 1px solid #cfd3da; border-radius: 5px; background: #fff; font-size: 17px; }
.pagination button:hover:not(:disabled) { border-color: #17191c; }
.pagination button:disabled { cursor: default; opacity: .35; }
.pagination span { min-width: 95px; text-align: center; color: #656a73; font-size: 12px; }
.page-size-field { display: inline-flex; align-items: center; gap: 6px; color: #656a73; font-size: 12px; }
.page-size-field select { height: 34px; padding: 0 28px 0 9px; border: 1px solid #cfd3da; border-radius: 5px; background: #fff; color: #30343a; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; color: #fff; background: #202327; border-radius: 6px; box-shadow: 0 10px 28px rgba(0,0,0,.2); font-size: 13px; }
.explanation-dialog { width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid #d5d9df; border-radius: 6px; color: #202327; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.explanation-dialog::backdrop { background: rgba(20,22,25,.42); }
.explanation-dialog-header { min-height: 52px; padding: 0 14px 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e5e7eb; }
.explanation-dialog h2 { margin: 0; font-size: 16px; letter-spacing: 0; }
.explanation-dialog p { margin: 0; padding: 20px 18px 24px; color: #4d535c; font-size: 14px; line-height: 1.7; }
.explanation-dialog-header button { width: 32px; height: 32px; padding: 0; border: 0; color: #686e77; background: transparent; font-size: 24px; line-height: 1; }
.explanation-dialog-header button:hover { color: #17191c; background: #f0f1f3; border-radius: 4px; }
#laoliComboDialog { width: min(760px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: min(80vh, 720px); overflow: auto; }
#laoliComboDialog .explanation-dialog-body { padding: 8px 18px 20px; }
.wuyou-detail-json { max-height: 65vh; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.wuyou-spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wuyou-spec-table th, .wuyou-spec-table td { padding: 9px 10px; border: 1px solid #e5e7eb; text-align: left; }
.wuyou-spec-table th { background: #f5f6f8; }
.after-sales-toolbar { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.after-sales-table { min-width: 2700px; }
.after-sales-table th:nth-child(1), .after-sales-table td:nth-child(1) { width: 180px; max-width: 180px; }
.after-sales-table th:nth-child(2), .after-sales-table td:nth-child(2) { width: 180px; max-width: 180px; }
.after-sales-table th:nth-child(1), .after-sales-table th:nth-child(2), .after-sales-table td:nth-child(1), .after-sales-table td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.laoli-combo-detail > div { min-width: 0; overflow-x: auto; }
.laoli-combo-detail strong { display: flex; flex-direction: column; gap: 4px; }
.laoli-combo-detail strong small { color: #b42318; font-size: 12px; font-weight: 600; white-space: nowrap; }
.laoli-spec-table { width: 100%; min-width: 0; max-width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.laoli-spec-table .spec-name-col { width: 58%; }
.laoli-spec-table .spec-id-col { width: 24%; }
.laoli-spec-table .spec-price-col { width: 18%; }
.laoli-spec-table th, .laoli-spec-table td { box-sizing: border-box; padding: 8px 6px; border: 1px solid #e5e7eb; text-align: left; }
.laoli-spec-table th, .laoli-spec-table td { min-width: 0; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; }
.laoli-spec-table th { background: #f5f6f8; font-weight: 600; }
.laoli-spec-table th:last-child, .laoli-spec-table td:last-child { text-align: right; white-space: nowrap; }

.mahua-query-panel { margin-bottom: 14px; padding: 14px; border: 1px solid #e0e3e8; border-radius: 6px; background: #f8f9fb; }
.mahua-toolbar { grid-template-columns: 180px 180px minmax(260px, 1fr) auto; }
.mahua-toolbar .search-field { grid-column: auto; }
.mahua-toolbar > button, .mahua-store-row > button { align-self: end; min-height: 40px; }
.mahua-store-row { margin-top: 12px; display: grid; grid-template-columns: minmax(320px, 1fr) auto; gap: 12px; align-items: end; }
.mahua-store-select select { width: 100%; }
.mahua-store-summary { margin-bottom: 14px; padding: 12px 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; border-left: 3px solid #fe2c55; background: #fff7f9; color: #60656d; font-size: 12px; }
.mahua-store-summary strong { color: #202327; font-size: 15px; }
.mahua-product-toolbar { margin-top: 12px; display: grid; grid-template-columns: minmax(260px, 420px); }
.mahua-goods-table { min-width: 1080px; }
.mahua-goods-table th:nth-child(1) { width: 150px; }
.mahua-goods-table th:nth-child(2) { width: 88px; }
.mahua-goods-table th:nth-child(3) { width: 260px; }
.mahua-goods-table th:nth-child(4) { width: 170px; }
.mahua-goods-table th:nth-child(5), .mahua-goods-table th:nth-child(8) { width: 100px; }
.mahua-goods-table th:nth-child(6), .mahua-goods-table th:nth-child(7) { width: 110px; }
.mahua-goods-table td:nth-child(4) { max-width: 170px; overflow-wrap: anywhere; word-break: break-all; }
.mahua-product-image { width: 56px; height: 56px; object-fit: contain; background: #f5f6f7; }
.ai-domain-toolbar { grid-template-columns: 150px 180px minmax(220px, 1fr) minmax(220px, 1fr) auto; }
.ai-domain-toolbar .search-field { grid-column: auto; }
.ai-domain-actions { display: flex; align-items: center; gap: 8px; }
.ai-domain-actions button { white-space: nowrap; }
.ai-domain-dialog { width: min(520px, calc(100vw - 28px)); }
.ai-domain-dialog .content-form-body { gap: 16px; }
.form-help { margin: -2px 0 0; color: #737881; font-size: 12px; line-height: 1.6; }
.ai-domain-table { min-width: 1210px; }
.ai-domain-table th:nth-child(1) { width: 75px; }
.ai-domain-table th:nth-child(2), .ai-domain-table th:nth-child(6) { width: 105px; }
.ai-domain-table th:nth-child(3) { width: 245px; }
.ai-domain-table th:nth-child(4) { width: 190px; }
.ai-domain-table th:nth-child(5) { width: 165px; }
.ai-domain-table th:nth-child(7), .ai-domain-table th:nth-child(8) { width: 175px; }
.ai-domain-table th:nth-child(9) { width: 90px; }
.domain-cell { color: #175cd3; font-weight: 650; }
.table-action { min-height: 30px; padding: 0 10px; border: 1px solid #cfd3da; border-radius: 5px; color: #30343a; background: #fff; font-size: 12px; font-weight: 650; }
.table-action:hover { border-color: #17191c; background: #f5f6f7; }
.table-action.danger { color: #c92a2a; border-color: #e6b8b8; }
.table-action.danger:hover { color: #fff; border-color: #c92a2a; background: #c92a2a; }

@media (max-width: 860px) {
  .goods-editor-layout { grid-template-columns: 1fr; overflow: auto; }.goods-form-body { overflow: visible; }.mini-preview-panel { border-left: 0; border-top: 1px solid #d8dce2; }.category-fields, .child-basic-row { grid-template-columns: 1fr; }.compact-image-row, .child-image-field, .child-image-field .compact-image-row { grid-template-columns: 1fr; }.child-image-field .image-upload-status { text-align: left; }.phone-preview { width: min(350px, 100%); }
  .app-layout { grid-template-columns: 1fr; }
  .side-menu { padding: 8px 16px; display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid #30343a; }
  .menu-item { width: auto; min-width: max-content; padding: 0 12px; border-left: 0; border-bottom: 3px solid transparent; }
  .menu-item + .menu-item { margin-top: 0; }
  .menu-item.active { border-left-color: transparent; border-bottom-color: #fe2c55; }
  .summary-band { grid-template-columns: 1fr 1fr; }
  .summary-item { border-bottom: 1px solid #e7e9ed; }
  .summary-item:nth-child(2) { border-right: 0; }
  .summary-item.wide { padding-left: 0; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .coupon-toolbar { grid-template-columns: 1fr 180px; }
  .dine-goods-toolbar { grid-template-columns: 1fr 180px 180px; }
  #laoliSupplierView .dine-goods-toolbar { grid-template-columns: 1fr 180px 120px 120px; }
  .mahua-toolbar { grid-template-columns: 1fr 1fr; }
  .ai-domain-toolbar { grid-template-columns: 1fr 1fr; }
  .mahua-toolbar .search-field { grid-column: 1 / -1; }
  .goods-form-grid { grid-template-columns: 1fr; }
  .child-goods-row { grid-template-columns: 1fr; }
  .search-field { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .topbar-actions { justify-content: flex-start; }
  .sync-button, .token-button { padding: 0 12px; }
  .summary-band { grid-template-columns: 1fr 1fr; }
  .summary-item { padding: 14px 10px; }
  .summary-item:nth-child(odd) { padding-left: 0; }
  .summary-item strong { font-size: 18px; }
  .toolbar { grid-template-columns: 1fr; }
  .coupon-toolbar { grid-template-columns: 1fr; }
  .dine-goods-toolbar { grid-template-columns: 1fr; }
  .mahua-toolbar, .mahua-store-row { grid-template-columns: 1fr; }
  .ai-domain-toolbar { grid-template-columns: 1fr; }
  .mahua-toolbar .search-field { grid-column: auto; }
  .mahua-store-summary { align-items: flex-start; flex-direction: column; }
  .search-field { grid-column: auto; }
  .result-meta { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; }
  .pagination { justify-content: center; }
  .toast { right: 16px; bottom: 16px; }
  .product-stock-tabs { align-items: stretch; padding-bottom: 4px; }
  .product-stock-tabs button { min-width: 72px; height: 34px; padding: 0 10px; font-size: 12px; }
  .product-batch-actions { margin-bottom: 10px; }
  .batch-select-action, .batch-stock-action { min-height: 34px; padding: 0 8px; font-size: 11px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}
