:root {
  color-scheme: light;
  --page: #f3f5ef;
  --paper: #fffefa;
  --text: #20382f;
  --muted: #54685f;
  --line: #dce5dc;
  --green: #163b31;
  --wash: #eef4ed;
  --yellow: #fff274;
  font-family: "PingFang SC", "Microsoft YaHei UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--text); font-size: 15px; line-height: 1.55; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #63917b; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.3; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.topbar { background: var(--green); color: #fffdf6; }
.topbar-inner { max-width: 1060px; margin: auto; padding: 14px max(16px, env(safe-area-inset-right)) 14px max(16px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.topbar strong { font-size: 17px; }
.signout { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 9px; background: transparent; color: #f5faf2; border: 1px solid #78968a; border-radius: 9px; text-decoration: none; }
.account-actions, .detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.detail-actions { justify-content: space-between; margin-bottom: 7px; }
.export-button { min-height: 44px; padding-inline: 11px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.sign-in { max-width: 430px; margin: clamp(14px, 5vw, 48px) auto 0; padding: clamp(17px, 5vw, 29px); }
.sign-in form { display: grid; gap: 12px; margin-top: 15px; }
.sign-in h1 { font-size: clamp(22px, 6vw, 29px); }
.sign-in .primary { justify-self: start; }
.sign-in p:empty, .read-time:empty, #detailMessage:empty { display: none; }
.read-time, #detailMessage { margin-block: 9px; color: var(--muted); font-size: .85rem; }
.size-group + .size-group { margin-top: 14px; }
.size-group h3 { margin-bottom: 6px; font-size: .94rem; }
.notice-list { margin: 0; padding-inline-start: 1.2em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(85px, 1fr)); gap: 8px; }
main { max-width: 1060px; margin: auto; padding: 18px max(16px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.intro { margin: 5px 0 16px; }
.intro h1 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -.03em; }
.intro p { color: var(--muted); margin-top: 5px; }
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: 17px; }
.search { padding: clamp(12px, 3vw, 20px); }
.search-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
label { min-width: 0; color: var(--muted); }
label > span { display: block; margin-bottom: 5px; font-size: .82rem; font-weight: 680; }
input, select { background: white; border: 1px solid #b5c6ba; border-radius: 9px; min-height: 46px; }
input { width: 100%; min-width: 0; padding: 9px 11px; font-size: 16px; }
select { max-width: 100%; padding: 6px 12px 6px 8px; }
.primary { border: 1px solid var(--green); background: var(--green); color: white; border-radius: 9px; min-height: 46px; padding: 8px clamp(13px, 4vw, 26px); font-weight: 700; }
.filters { margin-top: 9px; }
.filters summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 650; color: #335749; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters summary::after { content: ""; height: 7px; width: 7px; border-bottom: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); margin: -4px 4px 0 auto; }
.filters[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.filter-grid select { width: 100%; }
.reset { display: inline-flex; min-height: 44px; align-items: center; border: 0; background: transparent; padding: 0; color: #285d46; text-decoration: underline; text-underline-offset: 3px; }
.results-bar { display: flex; margin: 22px 0 10px; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.results-bar h2 { font-size: 1.17rem; margin-bottom: 2px; }
.results-bar p { font-size: .82rem; color: var(--muted); }
.results-bar select { min-height: 44px; font-size: .88rem; }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.card { width: 100%; min-width: 0; text-align: left; padding: 11px; display: grid; grid-template-columns: 65px minmax(0, 1fr); gap: 11px; color: var(--text); }
.card:hover, .card:focus-visible { border-color: #9eb4a3; }
.card img, .placeholder { aspect-ratio: 4 / 5; width: 100%; height: auto; object-fit: cover; background: #e8ede5; border-radius: 9px; }
.placeholder { display: grid; place-items: center; color: var(--muted); text-align: center; font-size: .73rem; }
.card-content { min-width: 0; }
.card-overline { display: flex; align-items: start; gap: 7px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 5px; }
.card-number { color: #34594c; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; line-height: 1.4; padding: 3px 7px; border: 1px solid #d5dce2; background: #edf0f3; color: #586473; font-size: .76rem; border-radius: 100px; white-space: nowrap; }
.production-state-confirmed { background: #e5f0ff; color: #215c9c; border-color: #bad2f2; }
.production-state-cutting { background: #fff0d4; color: #8f5009; border-color: #edcd96; }
.production-state-cut { background: #ffe0ba; color: #93441a; border-color: #e8b381; }
.production-state-sewing { background: #f3e5ff; color: #744599; border-color: #dbc1ee; }
.production-state-sewn { background: #e2d5fc; color: #55338b; border-color: #c6b1e8; }
.production-state-washing { background: #dff5fa; color: #19677e; border-color: #b7dce7; }
.production-state-washed { background: #c4eced; color: #185f61; border-color: #97ccce; }
.production-state-ironing { background: #fde8ef; color: #98445e; border-color: #eac1cf; }
.production-state-ironed { background: #f5d6e0; color: #803048; border-color: #dda8bb; }
.production-state-stocked { background: #ddf2dc; color: #356934; border-color: #b6d9b3; }
.production-state-shipping { background: #e8e9ff; color: #4e4a93; border-color: #c7c5ef; }
.production-state-shipped { background: #c8e8d8; color: #205b3d; border-color: #9bc8b1; }
.card-code { display: block; font-size: clamp(16px, 4.5vw, 21px); font-weight: 760; overflow-wrap: anywhere; }
.card-brand { display: block; font-size: .83rem; color: var(--muted); overflow-wrap: anywhere; margin: 3px 0 5px; }
.card-order, .card-date { display: block; color: #324c40; font-size: .83rem; overflow-wrap: anywhere; }
.card-open { display: inline-flex; align-items: center; min-height: 26px; font-size: .8rem; color: #285d46; margin-top: 3px; }
.card-open::after { content: ""; height: 6px; width: 6px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); margin-left: 6px; }
.empty { padding: 23px; color: var(--muted); text-align: center; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin: -4px 0 7px; border: 0; background: transparent; color: #285d46; padding: 0; }
.back::before { content: ""; height: 7px; width: 7px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: 0 8px 0 3px; }
.detail-hero { padding: clamp(13px, 3vw, 23px); }
.detail-identity { display: grid; grid-template-columns: minmax(0, 1fr) min(23vw, 100px); gap: 13px; align-items: start; }
.detail-identity.single { grid-template-columns: minmax(0, 1fr); }
.detail-identity h1 { font-size: clamp(22px, 6vw, 37px); overflow-wrap: anywhere; margin: 4px 0 5px; }
.detail-number { font-weight: 690; color: #335749; }
.detail-customer { font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.detail-barcode { margin-top: 6px; overflow-wrap: anywhere; }
.detail-barcode strong { font-weight: 780; font-variant-numeric: tabular-nums; }
.image-button { padding: 0; border: 0; width: 100%; background: #e8ede5; border-radius: 12px; min-height: 44px; }
.image-button img { border-radius: 11px; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.hero-facts { display: flex; gap: 10px 24px; flex-wrap: wrap; margin-top: 12px; }
.hero-facts dt { color: var(--muted); font-size: .78rem; }
.hero-facts dd { font-weight: 690; overflow-wrap: anywhere; }
.totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.total { background: var(--wash); color: #183a2d; border-radius: 12px; padding: 12px 10px; }
.total.actual { background: var(--green); color: white; }
.total p { font-size: .81rem; font-weight: 660; }
.total strong { display: inline-block; font-size: clamp(21px, 5.8vw, 34px); font-variant-numeric: tabular-nums; line-height: 1.22; overflow-wrap: anywhere; }
.total small { margin-left: 4px; font-size: .84rem; }
.detail-nav { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.detail-nav a { display: flex; min-height: 44px; align-items: center; text-decoration: none; white-space: nowrap; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); padding: 6px 12px; font-size: .85rem; }
.detail-sections { display: grid; gap: 10px; }
.section { min-width: 0; padding: clamp(12px, 3vw, 19px); }
.section h2 { font-size: 1.16rem; }
.section > h2 { margin-bottom: 10px; }
.section > p { font-size: .87rem; color: var(--muted); }
.size-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.size-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; line-height: 1.32; text-align: center; font-variant-numeric: tabular-nums; }
.size-table th, .size-table td { min-width: 32px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 4px; white-space: nowrap; }
.size-table tr > :last-child { border-right: 0; font-weight: 740; }
.size-table tbody tr:last-child > * { border-bottom: 0; }
.size-table thead th { background: #e9f1e7; }
.size-table tbody tr { background: var(--paper); }
.size-table tbody tr:nth-child(even) { background: #f4f6f1; }
.size-table tr > :first-child { position: sticky; left: 0; z-index: 1; min-width: 112px; width: clamp(112px, 29vw, 150px); padding-inline: 7px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.size-table tbody th { background: inherit; }
.size-table td.zero { color: var(--muted); }
.size-hint { margin-top: 7px; }
.requirements { display: grid; gap: 6px; }
.note { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; background: #f2f5ee; border-radius: 8px; padding: 8px 10px; }
.note.special { background: var(--yellow); }
.note-label { color: #3d5244; font-weight: 680; font-size: .82rem; }
.note-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.requirement-group + .requirement-group { margin-top: 14px; }
.requirement-group h3 { margin-bottom: 6px; font-size: .92rem; color: #365447; }
.material-row { border-top: 1px solid var(--line); margin-top: 9px; padding-top: 9px; display: grid; gap: 3px; overflow-wrap: anywhere; }
.material-title { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.material-title small { white-space: nowrap; }
.detail-terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 9px; }
.detail-terms div { background: #f3f6f0; border-radius: 9px; padding: 8px 10px; min-width: 0; }
.detail-terms dt { color: var(--muted); font-size: .81rem; }
.detail-terms dd { font-weight: 680; overflow-wrap: anywhere; }
.technical-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.section .technical-copy { margin-bottom: 10px; }
.customer-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.customer-note + .customer-note { margin-top: 10px; }
.belt-requirement + .belt-requirement { margin-top: 8px; }
.accessory-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 100px)); gap: 8px; margin-top: 7px; }
.accessory-thumb { margin: 0; min-width: 0; }
.accessory-photo { width: 100%; }
.accessory-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.accessory-thumb figcaption, .accessory-note { margin-top: 3px; color: var(--muted); font-size: .79rem; overflow-wrap: anywhere; }
dialog { padding: 10px; color: var(--text); border: 0; border-radius: 14px; width: min(94vw, 710px); max-height: 94vh; background: var(--paper); }
dialog::backdrop { background: #101f1bcc; }
dialog form { display: flex; justify-content: flex-end; }
dialog button { min-height: 44px; padding: 5px 13px; background: white; border: 1px solid var(--line); border-radius: 9px; }
dialog img { margin: 6px auto 0; max-height: calc(90vh - 60px); object-fit: contain; }
footer { color: var(--muted); text-align: center; padding-top: 17px; font-size: .81rem; }
@media (min-width: 740px) {
  .detail-identity { grid-template-columns: minmax(0, 1fr) 120px; }
  .detail-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .detail-sections .wide { grid-column: 1 / -1; }
  .note { grid-template-columns: minmax(92px, .34fr) minmax(0, 1fr); }
}
@media (max-width: 350px) {
  main { padding-inline: 11px; }
  .totals { gap: 5px; }
  .total { padding-inline: 8px; }
}
@media print {
  .topbar, main footer, #searchPage, #loginPage, #startMessage, #detailPage, #photoDialog { display: none !important; }
  body:not(.print-authorized) #printNotice { display: block !important; }
  body.print-authorized #detailPage:not([hidden]) { display: block !important; }
  .detail-actions, .detail-nav, .size-hint, #detail-status, #gallery { display: none !important; }
  body, .surface { background: white; }
  main { max-width: none; padding: 0; }
  .section { break-inside: avoid; }
  .size-scroll { overflow: visible; }
  .size-table { font-size: .73rem; }
  .size-table tr > :first-child { min-width: 0; width: auto; }
  .size-table th, .size-table td { min-width: 0; }
}
