:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1f2a44;
  background: #f7f6f1;
  --ink: #1f2a44;
  --muted: #5c6371;
  --paper: #f8f5ee;
  --line: #d9d0be;
  --gold: #aa9160;
  --white: #fff;
  --navy-hover: #303d59;
}

* { box-sizing: border-box; }
body, h1, h2, h3, p, dl { margin: 0; }
body { min-width: 0; }
p { line-height: 1.6; }
h1 { font-size: 1.875rem; line-height: 1.25; font-weight: 650; }
h2 { font-size: 1.0625rem; line-height: 1.45; }
h3 { font-size: 1rem; margin-bottom: 8px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1380px;
  min-height: 70px;
  margin: auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.55rem;
  font-weight: 600;
  white-space: nowrap;
}
.workbench-name {
  border-left: 1px solid var(--line);
  padding-left: 20px;
  font-size: .875rem;
  color: var(--muted);
}
.logout { margin-left: auto; white-space: nowrap; }
main { max-width: 1380px; margin: auto; padding: 0 32px 56px; }
.sections {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.sections button {
  padding: 16px 3px 13px;
  min-height: 52px;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
}
.sections button[aria-current] {
  color: var(--ink);
  font-weight: 650;
  border-bottom-color: var(--ink);
}
.section-heading, .board-heading, .actions, .filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-heading { margin-bottom: 22px; }
.board-heading { padding: 15px 19px; min-height: 57px; }
.board-heading span, .hint { color: var(--muted); font-size: .875rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 600;
  font-size: .875rem;
}
.primary { background: var(--ink); color: var(--white); }
.primary:hover:not(:disabled) { background: var(--navy-hover); }
.secondary { border-color: var(--line); background: var(--white); }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { background: var(--paper); }
.quiet { padding-inline: 9px; }

.login {
  max-width: 460px;
  margin: 9vh auto 0;
  background: var(--white);
  padding: 34px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
}
.login > p { color: var(--muted); margin-top: 10px; }
.login form { margin-top: 25px; }
.login .primary { width: 100%; margin-top: 18px; }
label { display: block; color: var(--muted); font-size: .875rem; }
input, select {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 5px;
  padding: 7px 11px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #aea899;
  border-radius: 0;
}
input::placeholder { color: var(--muted); }

.filters {
  display: grid;
  grid-template-columns: minmax(170px, 1.55fr) repeat(3, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 20px 0 12px;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.order-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.order-stats > div { padding: 3px 16px; }
.order-stats > div + div { border-inline-start: 1px solid var(--line); }
.order-stats dt { font-size: .875rem; color: var(--muted); }
.order-stats dd {
  margin: 4px 0 0;
  font-size: 1.5rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.order-layout.has-detail { grid-template-columns: minmax(0, 1.9fr) minmax(290px, 1fr); }
.order-board, .detail {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
}
.order-list { list-style: none; padding: 0; margin: 0; }
.order-list li { min-width: 0; border-top: 1px solid var(--line); }
.order-row, .entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(76px, .75fr) minmax(80px, .75fr) minmax(96px, .9fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding: 12px 19px;
  background: var(--white);
  border: 0;
  color: var(--ink);
  text-align: left;
}
.order-row:hover, .order-row[aria-current="true"] { background: var(--paper); }
.order-row strong, .entry-row strong {
  font-variant-numeric: tabular-nums;
  font-size: .9375rem;
  overflow-wrap: anywhere;
}
.row-meta { display: block; color: var(--muted); font-size: .8125rem; margin-top: 4px; line-height: 1.4; }
.row-number { font-variant-numeric: tabular-nums; font-weight: 750; font-size: 1.375rem; }
.row-amount { font-weight: 650; font-variant-numeric: tabular-nums; font-size: .9375rem; }
.row-amount small { margin-right: 2px; }
.status {
  display: inline-block;
  padding: 3px 7px;
  border: 1px solid transparent;
  background: #e8e9ed;
  color: #3d495c;
  font-weight: 600;
  font-size: .8125rem;
  line-height: 1.4;
}
.status[data-tone="positive"] { background: #e2eee7; color: #21553d; }
.status[data-tone="waiting"] { background: #f2e9d4; color: #6a4c14; }
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 19px;
  border-top: 1px solid var(--line);
  font-size: .875rem;
}
.empty { padding: 23px 19px; color: var(--muted); font-size: .875rem; }
.message { margin: 10px 0; color: #304c49; font-size: .875rem; overflow-wrap: anywhere; }
.message:empty { display: none; }
.message[data-error="true"] { color: #8e322b; }
.detail .board-heading { border-bottom: 1px solid var(--line); }
.detail #detail-content, .detail-message { padding-inline: 19px; }
.detail #detail-content { padding-bottom: 20px; }
.detail-status { padding-block: 15px 5px; }
.detail-fields div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: .875rem;
}
.detail-fields dt { color: var(--muted); }
.detail-fields dd { margin: 0; overflow-wrap: anywhere; }
.shipment, #refund-list { margin-top: 14px; overflow-wrap: anywhere; }
.detail-form { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.detail-form label { margin-top: 10px; }
.detail-form button { margin-top: 12px; }

.giveaway-filters {
  grid-template-columns: minmax(0, 340px) auto;
  justify-content: start;
  margin: 0 19px 13px;
}
.entry-row { grid-template-columns: minmax(0, 1fr) max-content; }
.entry-phone { text-align: right; }
.entry-phone .row-meta { margin: 0 0 3px; }

@media (max-width: 990px) {
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filter-search { grid-column: 1 / -1; }
  .filter-actions { justify-content: start; }
  .giveaway-filters { grid-template-columns: minmax(0, 340px) auto; }
}
@media (max-width: 850px) {
  .order-layout.has-detail { grid-template-columns: minmax(0, 1fr); }
  .order-layout.has-detail .detail { grid-row: 1; }
}
@media (max-width: 575px) {
  .topbar-inner { padding: 0 14px; min-height: 58px; gap: 9px; }
  .brand { font-size: 1.2rem; }
  .workbench-name { padding-left: 9px; font-size: .75rem; }
  .logout { padding-inline: 2px; font-size: .75rem; }
  main { padding: 0 12px 36px; }
  .sections { margin-bottom: 22px; }
  h1 { font-size: 1.44rem; }
  .section-heading { gap: 7px; margin-bottom: 14px; }
  .actions { gap: 5px; }
  .actions .button { padding-inline: 8px; }
  .order-stats { grid-template-columns: 1fr 1fr; row-gap: 10px; }
  .order-stats > div:nth-child(3) { border-inline-start: 0; }
  .filters { padding: 11px; gap: 9px; margin-top: 11px; }
  .filters input, .filters select { padding-inline: 8px; }
  .order-row { grid-template-columns: minmax(0, 1fr) minmax(84px, auto); gap: 8px 11px; }
  .row-number { grid-column: 2; grid-row: 1; text-align: right; }
  .order-row > :last-child { text-align: right; }
  .board-heading, .order-row, .entry-row, .pagination { padding-inline: 12px; }
  .giveaway-filters { margin-inline: 12px; }
  .login { padding: 22px; }
}

