:root {
  color-scheme: light;
  --page: #f4f5f7;
  --white: #fff;
  --ink: #192438;
  --muted: #5b6676;
  --line: #d8dfea;
  --indigo: #253f74;
  --indigo-dark: #182d59;
  --soft: #eaf0fc;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; letter-spacing: -.035em; }
h2 { font-size: 1.125rem; }
.shell { width: min(100% - 36px, 1060px); margin-inline: auto; }
.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.header-content { min-height: 64px; display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 700; }
.brand-mark { width: 24px; height: 27px; background: var(--indigo); border-radius: 4px 4px 10px 10px; border: 3px solid var(--indigo); outline: 1px dashed #b6caf4; outline-offset: -5px; }
.muted, .storage-status, .code, .style-info, .style-due { color: var(--muted); font-size: .875rem; }
main { padding-block: 36px 56px; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
#summary { margin-top: 8px; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
.primary, .quiet {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px;
  padding: 8px 15px; border-radius: 8px; border: 1px solid transparent; font-weight: 650;
  text-decoration: none;
}
.primary { color: var(--white); background: var(--indigo); white-space: nowrap; }
.primary:hover { background: var(--indigo-dark); }
.quiet { background: var(--white); color: var(--indigo); border-color: var(--line); }
.quiet:hover { background: var(--soft); }
:focus-visible, .button:focus-within { outline: 3px solid #547cce; outline-offset: 2px; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 175px); gap: 12px; margin-bottom: 20px; }
input:not([type=file]), select, textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: 8px 11px; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 7px;
}
textarea { resize: vertical; }
.empty { text-align: center; padding: 52px 16px; border: 1px dashed #b6c2d6; border-radius: 12px; background: #eef2f8; }
.empty p { color: var(--muted); margin-top: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); gap: 16px; }
.card { display: block; text-align: left; width: 100%; padding: 0; border-radius: 12px; overflow: hidden; background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.card:hover { border-color: var(--indigo); }
.card-media { display: grid; place-items: center; aspect-ratio: 4/3; background: #e8edf5; color: var(--muted); }
.card-media img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.no-photo { font-size: .875rem; }
.card-copy { display: grid; gap: 6px; padding: 14px; overflow-wrap: anywhere; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stage { padding: 2px 8px; background: var(--soft); color: var(--indigo-dark); border-radius: 5px; white-space: nowrap; font-size: .875rem; }
.notice { padding: 10px 12px; margin-bottom: 12px; border-radius: 7px; background: var(--soft); }
.back { margin-bottom: 15px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; gap: 16px; margin-top: 23px; }
.panel { padding: 19px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.photo-actions .button { flex: 1; }
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.photos:not(:empty) { margin-block: 12px; }
#photo-hint { margin-top: 8px; }
.photo { margin: 0; min-width: 0; background: var(--page); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo-remove { color: var(--indigo); background: none; border: 0; width: 100%; min-height: 38px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.fields label { font-size: .875rem; font-weight: 650; }
.fields label :is(input, select, textarea) { margin-top: 5px; font-size: 1rem; font-weight: 400; }
.wide { grid-column: 1 / -1; }
.required, .error { color: #9e291e; }
.error { margin-top: 8px; }
.form-footer { display: flex; align-items: center; gap: 14px; justify-content: flex-end; margin-top: 14px; }
.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: 660px) {
  main { padding-top: 24px; }
  .editor-grid { grid-template-columns: 1fr; }
  .form-footer { flex-wrap: wrap; }
  .form-footer .primary { width: 100%; }
}
@media (max-width: 355px) {
  .heading { align-items: stretch; flex-direction: column; }
  .filters, .fields { grid-template-columns: 1fr; }
}
.stage[data-stage="生产中"] { color: #157443; }
.stage[data-stage="调整中"] { color: #ac4b05; }
.stage.error { color: #c12525; }
#business { margin: 2rem 0; }
.record-block { padding: 1rem 0; border-bottom: 1px solid #d9dfe7; }
.record-line { padding: 1rem 0; display: grid; gap: .7rem; border-bottom: 1px solid #d9dfe7; }
dialog { width: min(640px, 90vw); max-height: 85vh; border: 1px solid #d9dfe7; border-radius: 16px; padding: 1.5rem; }
dialog::backdrop { background: #172c4680; }
dialog label { display: grid; gap: .4rem; margin: .7rem 0; }
#share-private { width: auto; }
@media print {
  body > * { display: none !important; }
  body > main { display: block !important; }
  main > * { display: none !important; }
  #share-dialog { display: block !important; position: static; width: auto; max-height: none; border: 0; overflow: visible; }
  #share-dialog > :not(#share-preview) { display: none !important; }
  .record-block { break-inside: avoid; }
}

.filters { grid-template-columns: minmax(0,1fr) 160px 160px; }
button:not(.card):not(.photo-remove) { min-height: 44px; padding: .5rem .8rem; border-radius: 8px; border: 1px solid var(--line); }
#business > h2:not(:first-child) { margin-top: 1.5rem; }
#stock-section { margin-top: 1.5rem; }
#stock-section label { display: block; margin: .8rem 0; }
#stock-section input[type=date] { max-width: 220px; }
#stock-results p { padding: .6rem 0; border-bottom: 1px solid var(--line); }
#stock-section details { margin-top: 1rem; }
#stock-section summary { cursor: pointer; }
#stock-section details p { margin: .8rem 0; }
@media (max-width:660px) { .filters { grid-template-columns: 1fr 1fr; } .filters input { grid-column:1/-1; } .card-meta { flex-wrap:wrap; } }

#batch-progress { margin-top: 1rem; }
.share-photo { width: 110px; height: 110px; object-fit: cover; margin-bottom: .6rem; }
.record-block h3 { font-size: 1rem; margin: 0 0 .5rem; }
.record-block p + p { margin-top: .4rem; }

.stage > span { display: block; }
.stage > [data-stage="生产中"] { color: #157443; }
.stage > [data-stage="运输中"] { color: #253f74; }
.stage > [data-stage="已到货"] { color: #4c5969; }
#share-preview { overflow-wrap: anywhere; }
.clocks{display:flex;gap:16px;padding:18px 0;justify-content:flex-end}.clocks span{background:white;border:1px solid #d7deeb;border-radius:10px;padding:12px;font-variant-numeric:tabular-nums}.bulkbar{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:18px}.bulkbar input,.product-check{width:20px;height:20px}.cards{display:flex!important;flex-direction:column;gap:0!important;background:white;border:1px solid #d7deeb;border-radius:12px;overflow:hidden}.product-row{display:grid;grid-template-columns:24px 70px minmax(0,1fr) auto;align-items:center;gap:18px;padding:16px;border-bottom:1px solid #eceef2}.thumbnail{width:70px;height:82px;padding:0;border-radius:8px;overflow:hidden}.thumbnail img{width:100%;height:100%;object-fit:cover}.product-copy{display:flex;flex-direction:column;gap:8px;text-align:left;background:none;border:0;min-width:0;padding:8px 0}.style-info{color:#637083;font-size:13px;overflow-wrap:anywhere}.stage{display:flex;flex-direction:column;gap:6px;font-size:13px}#image-preview{max-width:95vw;max-height:95vh}#preview-image{display:block;max-width:85vw;max-height:78vh;object-fit:contain}.timeline-event{border-left:2px solid #d7deeb;padding:12px 20px;margin-left:6px}.timeline-event time{display:block;color:#637083;font-size:13px}output{display:block;padding:12px;font-size:18px}@media(max-width:600px){.product-row{grid-template-columns:20px 48px minmax(0,1fr) auto;gap:9px;padding:12px 8px}.thumbnail{width:48px;height:62px}.product-copy{font-size:14px}.stage{font-size:11px;max-width:88px}.clocks{gap:8px;justify-content:stretch}.clocks span{flex:1;font-size:12px;padding:10px}.bulkbar{font-size:13px}}
.bulkbar label{display:flex;align-items:center;gap:8px}
button.product-copy{border:0!important;box-shadow:none;padding:0!important;background:transparent;white-space:normal}
button.thumbnail{padding:0!important;flex-shrink:0}
.product-check{margin:0}
.product-row .stage{white-space:normal}

#pack-total {
  padding: 0;
  margin-top: 5px;
  font-size: .8rem;
  font-weight: 400;
  color: var(--muted);
}
#pack-total:empty {
  display: none;
}

.stage[data-stage="待发货"], .stage > [data-stage="待发货"] { color:#6d28a8; background:#f3e8ff; border-radius:6px; padding:4px 6px; }
.stage.reproduction-overdue { color:#b42318; background:#feeceb; border-radius:6px; padding:4px 6px; }
.login-panel { max-width:540px; margin-inline:auto; }
.login-panel form, .login-panel #approval-wait { display:grid; gap:16px; margin-top:22px; }
.login-panel label { display:grid; gap:6px; }
.login-panel .checkbox-label { display:flex; align-items:center; gap:8px; }
.login-panel input[type=checkbox] { width:20px; min-height:20px; }
.login-privacy { margin-top:24px; }
.login-panel #error { color:#b42318; margin-top:16px; }

.filters {grid-template-columns:minmax(150px,2fr) repeat(4,minmax(110px,1fr));}
@media(max-width:800px){.filters{grid-template-columns:1fr 1fr}.filters input{grid-column:1/-1}}

.quantity-extra{color:#157443}.quantity-short{color:#ad4b05}.order-section{margin-top:18px}.order-section>p{margin:10px 0}.order-section details{margin:12px 0}.record-line input[readonly]{background:#f4f5f7}.order-section .record-block input{max-width:260px}
/* Private order documents retain the existing narrow-screen card layout. */
.packing-files { margin-top: 1rem; border-top: 1px solid #d9e0eb; padding-top: .8rem; }
.packing-files summary { cursor: pointer; font-weight: 600; }
.packing-file { display: flex; align-items: center; gap: .7rem; padding: .7rem 0; flex-wrap: wrap; }
.packing-file > div { flex: 1; min-width: 120px; overflow-wrap: anywhere; }
.packing-file small { display: block; color: #657083; margin: .3rem 0; }
.document-image { padding: 0; width: 64px; height: 76px; overflow: hidden; flex: 0 0 64px; }
.document-image img { width: 100%; height: 100%; object-fit: contain; }
.document-controls { display: flex; gap: .8rem; flex-wrap: wrap; align-items: end; }
.document-controls label { flex: 1 1 180px; min-width: 0; }
.document-controls input { width: 100%; min-width: 0; }
.packing-files progress { width: 100%; margin-top: .8rem; }
.reference-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.reference-grid figure { margin: 0; width: 100px; }
.reference-grid img { width: 100px; height: 120px; object-fit: contain; border: 1px dashed var(--line); cursor: zoom-in; }
.reference-grid button { font-size: .85rem; padding: .4rem; }
#copy-reference-wrap { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; }
#copy-reference { width: 20px; min-height: 20px; }
#style-group summary { font-weight: 600; cursor: pointer; }
.group-member { display: flex; gap: .8rem; align-items: center; border-bottom: 1px solid var(--line); padding: .7rem 0; }
.group-member > img { width: 56px; height: 72px; object-fit: contain; cursor: zoom-in; }
.group-link { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: .4rem; overflow-wrap: anywhere; }
.group-link span, .group-link small { display: block; }
.group-dialog { max-height: 85dvh; overflow: auto; }
.group-choice { display: flex; flex-direction: row; align-items: center; gap: .6rem; margin: .8rem 0; }
.group-choice input { width: 22px; min-height: 22px; flex: 0 0 22px; }
