/* Workspace finish. Keep business status colors distinct from action colors. */
:root {
  --work-ink: #183b31;
  --work-muted: #516d60;
  --work-line: #d9e5dc;
  --work-wash: #f3f6f3;
  --work-accent: #286652;
  --work-focus: #367f69;
  --work-motion: cubic-bezier(.2, 0, .38, .9);
}

body { font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif; }

.guide-header {
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 2px 12px rgba(20, 61, 44, .035);
}

.guide-header > div { max-width: 1180px; gap: 1rem; box-sizing: border-box; }
.commerce-nav { margin-right: 0; gap: .18rem; }
.commerce-nav button { padding-inline: .8rem; }
.commerce-nav button.active { background: #e4efe8; color: #215a46; }
.commerce-nav button:hover { background: #edf4ef; color: #215a46; }
.nav-draft-badge {
  display: inline-block;
  margin-inline-start: .3rem;
  padding: .1rem .28rem;
  border-radius: .3rem;
  background: #deece3;
  color: #2c624e;
  font-size: .65rem;
  vertical-align: middle;
}
.nav-draft-badge[hidden], [data-action="sale-draft-discard"][hidden] { display: none; }
.sales-draft-note { margin: -.25rem 0 1rem; color: var(--work-muted); font-size: .85rem; }
.guide-header-tools { gap: .9rem; }
.local-mode-status { color: var(--work-muted); }
.team-entry { color: var(--work-muted); font-size: .85rem; font-weight: 650; white-space: nowrap; }
.team-entry:hover, .team-entry:focus-visible { color: var(--ink); text-decoration: underline; }

.guide-page { padding-top: clamp(1.4rem, 3vw, 2.5rem); }
.guide-heading h1, .commerce-heading h1 {
  color: var(--work-ink);
  font-weight: 680;
  line-height: 1.24;
  letter-spacing: -.025em;
}

.guide-panel, .commerce-step, .catalog-card, .handbook-article,
.handbook-toc, .task-card, .customer-profile {
  border-color: var(--work-line);
  box-shadow: 0 2px 4px rgba(21, 54, 40, .035);
}

.btn.primary { background: var(--work-accent); border-color: var(--work-accent); }
.btn.primary:hover:not(:disabled) { background: #1f5745; border-color: #1f5745; }
.btn.secondary:hover:not(:disabled) { border-color: #a9c2b3; background: #f1f6f2; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--work-focus);
  outline-offset: 3px;
}

.guide-page table thead { background: #edf3ee; }
.guide-page table th { color: #496459; }
.guide-page table td { color: #365447; }
.guide-page table td small { color: #5a7063; }
.guide-footer { color: #597066; }

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-block: clamp(.4rem, 2vw, 1rem) clamp(1.6rem, 4vw, 2.4rem);
}

.home-intro time { color: #4e6f5e; font-size: .88rem; font-weight: 600; }
.home-intro h1 {
  margin: .65rem 0 .7rem;
  color: var(--work-ink);
  font-size: clamp(1.95rem, 4.2vw, 3.5rem);
  line-height: 1.16;
  font-weight: 680;
  letter-spacing: -.035em;
}
.home-intro-copy p { margin: 0; color: var(--work-muted); font-size: .95rem; line-height: 1.75; }

.home-shipping {
  min-width: 0;
  border-radius: .95rem;
  padding: clamp(1rem, 2.7vw, 1.55rem);
  background: linear-gradient(124deg, #173e32 20%, #2d5c49 100%);
  color: #f5faf6;
  box-shadow: 0 12px 24px rgba(24, 66, 49, .13);
}

.home-shipping-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.home-shipping-heading h2 { display: flex; align-items: center; gap: .55rem; margin: 0; color: inherit; font-size: .95rem; }
.home-shipping-heading h2 .icon { width: 1rem; height: 1rem; color: #bbd9c6; }
.home-shipping.has-today-shipments .home-shipping-heading h2 .icon,
.home-shipping.has-today-shipments dl > div:first-child :is(dt, dd, small) { color: #ffb1a8; }
.home-shipping-heading .btn.subtle {
  padding: .3rem .5rem;
  min-height: 2rem;
  color: #e9f6ed;
  font-size: .79rem;
  white-space: nowrap;
}
.home-shipping-heading .btn.subtle:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.home-shipping-heading .btn > .icon { order: 1; }
.home-shipping-heading .btn:focus-visible { outline-color: #d0ebda; }
.home-shipping dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: .8rem 0 0;
  padding-top: .85rem;
  border-top: 1px solid rgba(217, 238, 223, .24);
}
.home-shipping dl > div { min-width: 0; padding-right: .45rem; }
.home-shipping dl > div + div { border-inline-start: 1px solid rgba(217, 238, 223, .24); padding-inline-start: .8rem; }
.home-shipping dt { color: #d4e8db; font-size: .8rem; }
.home-shipping dd {
  margin: .2rem 0 0;
  font-size: clamp(1.4rem, 3vw, 2.05rem);
  line-height: 1.2;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.home-shipping dd small { color: #d4e8db; font-size: .76rem; font-weight: 400; }

.guide-task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.guide-task { min-height: 7rem; padding: 1.2rem 1.35rem; gap: 1rem; color: var(--work-ink); border-color: var(--work-line); }
.guide-task-icon { border-radius: .7rem; }
.guide-task:first-child .guide-task-icon { background: #dceee3; color: #245c49; }
.guide-task strong { font-size: clamp(1rem, 1.75vw, 1.23rem); }
.guide-task small { color: var(--work-muted); }
.guide-task:hover { border-color: #8aaf9c; box-shadow: 0 8px 18px rgba(24, 66, 49, .08); }
.guide-welcome > .guide-methods { padding-block: .65rem; margin-top: .75rem; }

.dispatch-layout { gap: 1rem; align-items: start; }
.dispatch-layout > .guide-panel { min-width: 0; margin: 0; }
.dispatch-calendar .fulfillment-heading { gap: .5rem; flex-wrap: wrap; }
.dispatch-calendar .fulfillment-heading .inline-actions { gap: .25rem; }
.dispatch-calendar .fulfillment-heading .btn { min-height: 2rem; padding: .28rem .45rem; }
.dispatch-day {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: 1rem minmax(0, 1fr);
  justify-items: center;
  gap: .12rem;
  height: 3.5rem;
  min-height: 0;
  min-width: 0;
  padding: .24rem .08rem;
  font-variant-numeric: tabular-nums;
}
.dispatch-day.outside { color: #60766a; }
.dispatch-day[aria-current="date"] { border-color: #449078; box-shadow: inset 0 0 0 1px #449078; font-weight: 700; }
.dispatch-day[aria-pressed="true"] { background: var(--work-accent); border-color: var(--work-accent); }
.dispatch-day.has-batches { background: #fae5e2; color: #892921; border-color: #c97b73; }
.dispatch-day.has-batches[aria-current="date"] { box-shadow: inset 0 0 0 1px #a9332a; }
.dispatch-day.has-batches[aria-pressed="true"] { background: #a9332a; color: #fff; border-color: #a9332a; }
.dispatch-day-number { line-height: 1rem; }
.dispatch-day-counts { display: grid; justify-items: center; align-content: start; gap: 1px; min-width: 0; max-width: 100%; }
.dispatch-day-counts > span {
  border-radius: .24rem;
  padding-inline: .06rem;
  font-size: .625rem;
  font-weight: 650;
  line-height: .76rem;
  white-space: nowrap;
}
.dispatch-count-pending { background: #f8d0cb; color: #78251f; }
.dispatch-count-sent { background: #dae9f0; color: #265b73; }
.dispatch-calendar-key { display: flex; flex-wrap: wrap; gap: .2rem .75rem; margin: .65rem 0 0; color: var(--work-muted); font-size: .75rem; }
.dispatch-queue-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.dispatch-queue-heading :is(h2, h3) { margin: 0; }
.dispatch-queue-heading > span { color: var(--work-muted); font-size: .84rem; }
.dispatch-filters { gap: .38rem; }
.dispatch-filters .btn { min-height: 2.15rem; padding: .35rem .6rem; }
.dispatch-empty { padding: 1rem; margin: 0; border-radius: .55rem; background: #f0f5f0; color: var(--work-muted); }
.dispatch-shipped { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--work-line); }
.dispatch-shipped .dispatch-queue-heading { margin-bottom: .6rem; }
.shipment-records { container-type: inline-size; }
.shipment-records table { white-space: normal; }
.shipment-records :is(td, th) { padding: .55rem .5rem; overflow-wrap: anywhere; }
.shipment-records td small { display: block; }
.shipment-records td .btn { white-space: nowrap; padding: .3rem .55rem; min-height: 2.1rem; }
.shipment-corrections { padding-inline: 1.6rem .8rem; overflow-wrap: anywhere; }
.shipment-corrections li + li { margin-top: .65rem; }
.dispatch-queue .fulfillment-table th:nth-child(3) { width: 13%; }
.dispatch-queue .fulfillment-table th:nth-child(5) { width: 12%; }
.dispatch-queue .fulfillment-table th:last-child { width: 21%; }
.dispatch-queue .fulfillment-table td[data-label="计划发货"] { white-space: nowrap; }
.dispatch-queue .fulfillment-table td[data-label="计划发货"] small { white-space: normal; }

@media (min-width: 1120px) {
  .dispatch-layout { grid-template-columns: minmax(0, 20.25rem) minmax(0, 1fr); }
  .dispatch-calendar { padding: 1rem; }
  .dispatch-queue { padding-inline: 1rem; }
}

@media (max-width: 760px) {
  .commerce-nav button { padding-inline: .35rem; }
  .guide-header-tools { gap: .6rem; }
  .home-intro { grid-template-columns: 1fr; gap: 1rem; padding-block: .3rem 1.1rem; }
  .guide-task-list { grid-template-columns: 1fr; gap: .65rem; }
  .guide-task { min-height: 0; padding: .85rem; }
}

@media (max-width: 700px) {
  .guide-header > div { row-gap: .45rem; }
  .commerce-nav { margin-top: 0; }
}

@media (max-width: 480px) {
  .guide-header-tools .local-mode-status { display: none; }
  .commerce-nav [data-resume-draft] { position: relative; }
  .nav-draft-badge { position: absolute; inset: .26rem .26rem auto auto; width: .38rem; height: .38rem; margin: 0; padding: 0; font-size: 0; background: #3d8267; }
}

@media (max-width: 360px) {
  .dispatch-day { padding-inline: 0; }
  .dispatch-day-counts > span { padding-inline: .025rem; }
}

@container (max-width: 480px) {
  .shipment-records :is(tbody, tr) { display: block; }
  .shipment-records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .shipment-records tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem; padding: .4rem 0; border-bottom: 1px solid var(--work-line); }
  .shipment-records td { display: block; padding: .3rem; border: 0; }
  .shipment-records td:first-child, .shipment-records td:last-child { grid-column: 1 / -1; }
  .shipment-records [data-label]::before { content: attr(data-label); display: block; color: var(--work-muted); font-size: .75rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .guide-task, .btn, .commerce-nav button, .dispatch-day {
    transition: background-color 160ms var(--work-motion), border-color 160ms var(--work-motion),
      box-shadow 160ms var(--work-motion), transform 160ms var(--work-motion);
  }
  .guide-task > .icon { transition: transform 160ms var(--work-motion); }
  .guide-task:hover > .icon { transform: translateX(3px); }
  .guide-task:active, .btn:active { transform: scale(.985); }
  .dispatch-day:active:not(:disabled) { transform: scale(.96); }
  dialog[open] { animation: workspace-dialog-in 190ms cubic-bezier(0, 0, .38, .9); }
  .more-menu[open] > div { animation: workspace-dialog-in 140ms cubic-bezier(0, 0, .38, .9); }
}

@keyframes workspace-dialog-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
