:root {
  --ground: #e6e7e4;
  --paper: #fffef9;
  --ink: #30312e;
  --muted: #62645d;
  --line: #dcddd4;
  --control-line: #b9bdae;
  --soft: #eeeee6;
  --action: #f6db7a;
  --action-hover: #efcd53;
  --focus: #716017;
  --good: #28613d;
  --warn: #79531e;
  --bad: #a53a37;
  --elevation: 0 16px 40px -24px rgb(58 55 40 / 32%), 0 5px 12px -8px rgb(58 55 40 / 15%);
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 100% 0%, #f9f4d4 0, transparent 65%), var(--ground); min-height: 100dvh; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, a { touch-action: manipulation; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: #565f35; }
button, input, select, textarea { color: var(--ink); }
input, textarea { caret-color: var(--ink); }
input::placeholder, textarea::placeholder { color: #6a6b62; opacity: 1; }
::selection { background: var(--action); color: var(--ink); }
:is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.35; font-weight: 650; letter-spacing: -.025em; }
h2 { font-size: 20px; line-height: 1.45; font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: 16px; line-height: 1.5; font-weight: 600; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip-link { position: fixed; top: -60px; left: 24px; z-index: 100; padding: 12px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 10px; }
.sidebar { position: fixed; inset: 24px auto 24px 24px; width: 104px; background: var(--paper); border-radius: 26px; padding: 14px 10px; display: flex; flex-direction: column; box-shadow: var(--elevation); z-index: 20; }
.sidebar nav { display: flex; flex-direction: column; gap: 7px; }
.nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 76px; gap: 7px; font-size: 12px; text-decoration: none; border-radius: 14px; color: var(--muted); transition: background 160ms ease, color 160ms ease; }
.nav-link:hover { background: var(--soft); color: var(--ink); }
.nav-link.active { background: var(--ink); color: var(--paper); }
.nav-link svg { width: 22px; height: 22px; }
.sidebar-note { font-size: 11px; text-align: center; color: var(--muted); margin-top: auto; padding: 20px 0 2px; }
.workspace { margin-left: 154px; padding: 0 30px 0 0; }
.topbar { min-height: 92px; max-width: 1560px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.wordmark { font-size: 17px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.identity-label { color: var(--muted); font-size: 12px; max-width: 20em; overflow-wrap: anywhere; }
.brand-symbol { object-fit: contain; display: block; width: 44px; height: 44px; margin-left: 8px; }
main { max-width: 1560px; margin: auto; min-width: 0; min-height: calc(100dvh - 180px); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin: 17px 0 28px; }
.page-heading p { color: var(--muted); max-width: 72ch; margin-top: 9px; }
.page-heading .actions { display: flex; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; border: 1px solid var(--control-line); background: var(--paper); color: var(--ink); border-radius: 9px; padding: 9px 15px; font-size: 13px; line-height: 1.4; text-decoration: none; transition: background 160ms ease, border-color 160ms ease; }
.button:hover:not(:disabled) { background: #f3f1df; border-color: #9fa58f; color: var(--ink); }
.button.primary { background: var(--action); border-color: transparent; }
.button.primary:hover:not(:disabled) { background: var(--action-hover); border-color: transparent; }
.button.danger { background: #fbf0ec; color: #8b302b; border-color: #d9b2aa; }
.button.quiet { background: transparent; border-color: transparent; padding-inline: 7px; }
.button.compact { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.icon-button { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; min-width: 36px; min-height: 36px; font-size: 24px; line-height: 1; }
.icon-button:hover { background: var(--soft); }
.search-bar { background: var(--paper); border-radius: 14px; padding: 10px 12px 10px 20px; box-shadow: var(--elevation); display: flex; align-items: center; gap: 14px; }
.search-bar input { width: 100%; min-width: 0; border: 0; background: transparent; min-height: 38px; padding: 7px 2px; outline-offset: 2px; }
.search-bar svg { color: var(--muted); }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin: 20px 0 19px; }
.filter { position: relative; width: 210px; }
.filter summary { list-style: none; cursor: pointer; background: var(--paper); border: 1px solid var(--control-line); border-radius: 8px; min-height: 40px; padding: 8px 30px 8px 12px; font-size: 13px; position: relative; }
.filter summary::-webkit-details-marker { display: none; }
.filter summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); position: absolute; right: 13px; top: 14px; }
.filter[open] summary::after { transform: rotate(225deg); top: 18px; }
.filter-popover { position: absolute; z-index: 15; top: 46px; left: 0; width: max(100%, 250px); max-height: 310px; overflow: auto; background: var(--paper); border: 1px solid var(--control-line); border-radius: 10px; padding: 10px; box-shadow: 0 13px 25px -12px rgb(58 55 40 / 25%); }
.choice { display: flex; align-items: flex-start; gap: 8px; padding: 6px 5px; cursor: pointer; line-height: 1.5; overflow-wrap: anywhere; }
.choice input { margin-top: 4px; accent-color: var(--ink); flex: none; }
.choice:hover { background: var(--soft); border-radius: 5px; }
.filter-help { display: block; color: var(--muted); font-size: 11px; padding: 5px 5px 9px; }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 23px 0 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.result-bar strong { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.page-size { display: flex; align-items: center; gap: 8px; }
.page-size select { border: 1px solid var(--control-line); border-radius: 6px; background: var(--paper); padding: 4px 7px; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.product-card { background: var(--paper); border-radius: 14px; overflow: hidden; box-shadow: var(--elevation); display: flex; flex-direction: column; min-width: 0; }
.product-image { position: relative; height: 200px; background: #f5f5ed; display: flex; align-items: center; justify-content: center; text-decoration: none; padding: 14px; }
.product-image img { object-fit: contain; width: 100%; height: 100%; }
.image-placeholder { text-align: center; color: var(--muted); padding: 24px 10px; font-size: 12px; max-width: 20em; }
.product-info { padding: 17px 18px 18px; display: flex; flex-direction: column; flex: 1; gap: 10px; }
.product-title { font-size: 16px; font-weight: 600; line-height: 1.55; text-decoration: none; overflow-wrap: anywhere; }
.product-summary { font-size: 12px; color: var(--muted); line-height: 1.7; }
.product-info .product-footer { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.product-code { color: var(--muted); font-size: 11px; }
.badge { display: inline-block; border-radius: 5px; background: var(--soft); color: #505548; padding: 2px 7px; font-size: 11px; line-height: 1.6; max-width: 100%; overflow-wrap: anywhere; }
.badge.warning { background: #f8eac4; color: var(--warn); }
.badge.good { background: #e3eee2; color: var(--good); }
.badge.bad { background: #f8e8e3; color: var(--bad); }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 28px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.surface { background: var(--paper); border-radius: 14px; padding: 26px; box-shadow: var(--elevation); min-width: 0; }
.section { margin-top: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-heading p { color: var(--muted); font-size: 12px; }
.muted, .field-help { color: var(--muted); }
.field-help { font-size: 12px; line-height: 1.7; margin-top: 7px; }
.empty-state { padding: 54px 26px; text-align: center; background: var(--paper); border-radius: 14px; }
.empty-state h2 { margin-bottom: 10px; }
.empty-state p { max-width: 60ch; margin: 0 auto 18px; color: var(--muted); }
.notice { background: #f4f0dd; color: #535442; border-radius: 10px; padding: 13px 16px; line-height: 1.75; margin: 14px 0; }
.notice.warning { background: #f8edcf; color: #775323; }
.notice.error { background: #fbede8; color: #8b302b; }
.notice p + p { margin-top: 7px; }
.notice .button { margin-top: 10px; }
.detail-layout { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(340px, 1.15fr); gap: 30px; align-items: start; }
.gallery-main { min-height: 310px; height: 370px; width: 100%; display: flex; align-items: center; justify-content: center; background: #f5f5ed; border: 0; border-radius: 10px; padding: 22px; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 13px; }
.gallery-thumb { width: 78px; height: 68px; background: #f5f5ed; padding: 5px; border: 1px solid var(--line); border-radius: 6px; }
.gallery-thumb.active { outline: 2px solid var(--focus); outline-offset: 2px; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.detail-summary h1 { margin: 12px 0; }
.detail-summary p { max-width: 68ch; overflow-wrap: anywhere; }
.metadata-list { margin: 22px 0 0; display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 10px 16px; font-size: 13px; }
.metadata-list dt { color: var(--muted); }
.metadata-list dd { margin: 0; overflow-wrap: anywhere; }
.identifier { font-family: Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; text-align: left; }
th { color: var(--muted); font-weight: 500; background: #f5f5ed; white-space: nowrap; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 13px; vertical-align: top; }
td { overflow-wrap: anywhere; max-width: 460px; }
tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.attribute-value { font-variant-numeric: tabular-nums; }
.evidence { list-style: none; padding: 0; margin: 0; }
.evidence li { padding: 15px 0; border-bottom: 1px solid var(--line); }
.evidence li:first-child { padding-top: 0; }
.evidence li:last-child { border: 0; padding-bottom: 0; }
.evidence blockquote { margin: 8px 0 0; padding: 10px 13px; background: #f5f5ed; border-radius: 6px; line-height: 1.8; overflow-wrap: anywhere; }
.evidence small { color: var(--muted); }
.hint-list { margin: 0; padding-left: 20px; color: var(--warn); }
.hint-list li + li { margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 7px; color: var(--ink); font-size: 13px; }
.field input, .field textarea, .field select { background: var(--paper); border: 1px solid var(--control-line); border-radius: 7px; width: 100%; padding: 10px 11px; min-height: 42px; }
.field textarea { resize: vertical; min-height: 100px; line-height: 1.7; }
.field select[multiple] { min-height: 120px; }
.field .code-input { font-family: Consolas, monospace; font-size: 12px; line-height: 1.7; min-height: 210px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 22px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 25px; }
.inline-error { background: #fbede8; color: #8b302b; border-radius: 7px; padding: 10px 12px; margin-top: 13px; overflow-wrap: anywhere; }
.tab-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 22px; }
.tab-row .button.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.management-layout { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
.management-list { list-style: none; padding: 0; margin: 0; }
.management-list li { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.management-list li:first-child { padding-top: 0; }
.management-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.management-list p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.editor-section + .editor-section { margin-top: 25px; padding-top: 23px; border-top: 1px solid var(--line); }
.editor-section h3 { margin-bottom: 14px; }
.history-select { min-height: 36px; background: var(--paper); border: 1px solid var(--control-line); border-radius: 7px; padding: 7px 9px; max-width: 280px; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; max-width: 1560px; margin: 34px auto 0; padding: 20px 0; border-top: 1px solid #c9ccbf; font-size: 11px; color: var(--muted); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: min(640px, calc(100% - 32px)); background: var(--ink); color: var(--paper); padding: 13px 20px; border-radius: 9px; z-index: 80; box-shadow: var(--elevation); }
dialog { border: 0; padding: 0; border-radius: 14px; max-width: min(500px, calc(100% - 28px)); width: 500px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 65px -20px rgb(0 0 0 / 35%); }
dialog::backdrop { background: rgb(35 37 31 / 45%); }
.dialog-body { padding: 25px; }
.dialog-body .field { margin-top: 22px; }
.image-dialog { width: min(1100px, calc(100% - 28px)); max-width: calc(100% - 28px); max-height: calc(100dvh - 30px); }
.image-viewer { padding: 22px; }
#image-full { overflow: auto; max-height: calc(100dvh - 180px); background: #f5f5ed; text-align: center; }
#image-full img { max-width: 100%; height: auto; display: inline-block; }
.image-viewer > p { margin-top: 14px; font-size: 12px; }
.loading-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.loading-grid div { height: 330px; border-radius: 14px; background: #f4f4ed; }
.noscript { position: fixed; inset: 100px 30px auto 150px; padding: 25px; background: var(--paper); color: var(--bad); }
@media (min-width: 1750px) { .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1280px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .workspace { margin-left: 138px; padding-right: 22px; } .sidebar { left: 18px; width: 98px; } .filter { width: 190px; } }
@media (max-width: 1000px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .detail-layout { grid-template-columns: 1fr; } .gallery-main { height: 330px; } .management-layout { grid-template-columns: 1fr; } .topbar-actions { gap: 10px; } .identity-label { max-width: 130px; } .filter { width: 175px; } }
@media (max-width: 700px) {
  .sidebar { position: sticky; top: 0; width: auto; height: auto; inset-inline: 0; padding: 7px 14px; border-radius: 0; box-shadow: 0 4px 18px -10px rgb(58 55 40 / 24%); }
  .sidebar nav { flex-direction: row; gap: 7px; justify-content: center; }
  .nav-link { flex-direction: row; min-height: 42px; padding: 8px 12px; font-size: 12px; border-radius: 9px; gap: 7px; }
  .nav-link svg { width: 18px; height: 18px; }
  .sidebar-note { display: none; }
  .workspace { margin-left: 0; padding: 0 16px; }
  .topbar { min-height: 82px; gap: 10px; }
  .wordmark { font-size: 16px; }
  .brand-symbol { width: 34px; height: 34px; margin: 0; }
  .identity-label { display: none; }
  .topbar-actions { gap: 9px; }
  .topbar-actions .button { font-size: 11px; padding-inline: 9px; }
  h1 { font-size: 25px; }
  .page-heading { margin-top: 8px; margin-bottom: 22px; flex-direction: column; gap: 14px; }
  .page-heading p { font-size: 13px; line-height: 1.75; }
  .search-bar { padding: 8px 9px 8px 13px; gap: 9px; }
  .search-bar input { font-size: 13px; }
  .search-bar svg { width: 18px; }
  .filter-row { gap: 9px; margin-top: 15px; }
  .filter { width: calc(50% - 5px); }
  .filter:nth-child(3) { width: calc(50% - 5px); }
  .filter-popover { width: max(100%, 230px); max-width: calc(100vw - 32px); }
  .filter:nth-child(2) .filter-popover { left: auto; right: 0; }
  .filter summary { font-size: 12px; }
  .product-grid { gap: 12px; }
  .product-image { height: 155px; padding: 12px; }
  .product-info { padding: 13px; gap: 8px; }
  .product-title { font-size: 14px; }
  .product-summary { font-size: 11px; }
  .surface { padding: 19px; }
  .detail-layout { gap: 22px; }
  .gallery-main { min-height: 250px; height: 280px; padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field input, .field textarea, .field select { font-size: 16px; }
  .form-actions { justify-content: flex-start; }
  .page-footer { flex-direction: column; gap: 5px; }
  .result-bar { margin-top: 17px; }
  .metadata-list { grid-template-columns: 84px minmax(0, 1fr); gap: 9px 12px; }
  .loading-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .loading-grid div { height: 285px; }
  .loading-grid div:last-child { display: none; }
  .noscript { inset: 100px 16px auto; }
}
@media (max-width: 380px) { .nav-link { font-size: 11px; padding-inline: 8px; } .nav-link svg { display: none; } .product-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.workspace-label { padding: 6px 12px; background: var(--paper); border-radius: 5px; font-size: 12px; color: var(--muted); }
.page-heading .badges { margin-top: 13px; }
.product-code { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.product-description { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: 14px 22px; line-height: 1.8; }
.variant-block { padding-block: 20px; border-top: 1px solid var(--line); }
.variant-block:first-of-type { border-top: 0; }
.variant-block h3 { margin-bottom: 5px; }
.variant-block .table-wrap { margin-top: 14px; }
.attribute-value small { display: block; margin-top: 4px; }
.evidence-list { margin-top: 20px; }
.evidence blockquote { margin: 10px 0; padding: 7px 14px; border-left: 2px solid var(--control-line); color: var(--ink); white-space: pre-wrap; }
.workflow-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
#workflow-form { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
#workflow-description { margin-block: 22px; }
.publish-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 20px; margin-block: 14px 22px; }
.attribute-editor { padding: 17px; border: 1px solid var(--line); border-radius: 5px; margin: 20px 0 0; }
.attribute-editor legend { padding-inline: 8px; font-weight: 600; }
.attribute-editor .form-grid { margin-top: 0; }
fieldset.field { border: 0; padding: 0; min-width: 0; }
.editor-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.filter-count { margin-left: 8px; font-size: 11px; font-variant-numeric: tabular-nums; background: var(--action); padding: 0 6px; border-radius: 3px; }
.filter-options { max-height: 260px; overflow-y: auto; margin-bottom: 14px; }
.filter-options .choice { margin-bottom: 9px; }
.gallery-thumb small { display: block; }
.gallery-thumb img { width: 100%; height: 66px; object-fit: contain; }
.gallery-thumb { height: 98px; }
.gallery-thumb span { font-size: 11px; line-height: 1.4; }
.gallery-main:disabled { opacity: 1; }
.image-status { color: var(--muted); font-size: 12px; position: absolute; inset: 0; display: grid; place-items: center; }
.product-image img:not([src]) { visibility: hidden; }
.icon-button svg { width: 20px; height: 20px; }
.toast.error { background: var(--bad); }
.search-bar .button { flex-shrink: 0; white-space: nowrap; min-width: 70px; }
.field input[type="checkbox"], .choice input[type="checkbox"] { width: 16px; min-width: 16px; height: 16px; min-height: 16px; padding: 0; flex: 0 0 16px; accent-color: var(--ink); }
.image-relations { min-width: 610px; }
.history-table { min-width: 590px; }
.image-relations select { min-width: 140px; }
.table-wrap { position: relative; min-width: 0; max-width: 100%; overflow-x: auto; }
.field { position: relative; min-width: 0; }
.table-scroll-hint { display: none; color: var(--muted); font-size: 12px; margin-block: 10px; }
@media (max-width: 700px) { .table-scroll-hint { display: block; } }
.filter summary svg { display: none; }
.relation-preview { width: 130px; height: 110px; object-fit: contain; background: var(--soft); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 700px) { .page-heading .workspace-label { display: none; } .publish-fields { grid-template-columns: 1fr; } .workflow-actions .button { flex: 1 1 45%; } .product-footer { align-items: flex-start; } }
