:root {
  --ground: #f2f4f7;
  --surface: #fff;
  --raised: #eee;
  --border: #e6e6e6;
  --rule: #f0f0f0;
  --control: #d4d4d4;
  --text: #141414;
  --muted: #595959;
  --blue: #1d5fbf;
  --positive: #20642c;
  --warning: #92400e;
  --negative: #a82328;
  --radius: 8px;
  --control-radius: 6px;
  --gap: 12px;
  --pad: 24px;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--ground); font: 400 14px/1.6 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.bar { border-bottom: 1px solid var(--border); }
.bar-inner { min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: var(--gap); }
.bar-account { display: flex; gap: var(--gap); align-items: center; }
.signout { padding-inline: 6px; background: transparent; border: 0; color: var(--muted); }
.signout:hover { color: var(--text); text-decoration: underline; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; font-weight: 600; }
.brand svg { color: var(--text); }
.title { margin: 25px 0 20px; }
h1, h2, p, dl, dd { margin: 0; }
h1 { font-size: 24px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
h2 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.title p { margin-top: 6px; color: var(--muted); }
.muted, .hint, .identity small, dt { color: var(--muted); }
.hint, dt, .back, .identity small { font-size: 12px; }
.back { display: inline-block; margin-bottom: 9px; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--pad); margin-bottom: var(--gap); }
.panel:last-child { margin-bottom: 30px; }
.panel > p { margin-top: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: var(--gap); }
.section-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--border); margin-bottom: var(--gap); }
.section-nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--muted); text-decoration: none; }
.section-nav a:hover { color: var(--text); text-decoration: underline; }
.flash { background: var(--surface); border: 1px solid var(--border); border-radius: var(--control-radius); padding: 10px 12px; margin-bottom: var(--gap); }
.signin { max-width: 420px; }
.signin form { display: grid; gap: var(--gap); }
.signin .primary { justify-self: start; }
.new-order { display: grid; grid-template-columns: 2.1fr 1.35fr 1fr .85fr; gap: var(--gap); margin-top: 16px; align-items: end; }
.new-order .hint { grid-column: 1 / -2; align-self: center; }
.new-order button { justify-self: end; grid-column: -2 / -1; }
.new-order [data-named-tier-price][hidden] { display: none; }
.order-confirmation { width: min(500px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: var(--pad); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.order-confirmation::backdrop { background: rgb(0 0 0 / .46); }
.confirmation-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-block: 14px; }
.confirmation-details > div { min-width: 0; }
.confirmation-details > :first-child, .confirmation-details > :last-child { grid-column: 1 / -1; }
.confirmation-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: var(--gap); margin-top: 16px; }
.confirmation-actions > button { min-height: 44px; }
label { display: block; font-weight: 500; min-width: 0; }
input, select, button { font: inherit; }
input:not([type=checkbox]), select { display: block; width: 100%; min-height: 38px; background: var(--surface); border: 1px solid var(--control); color: var(--text); border-radius: var(--control-radius); padding: 7px 10px; margin-top: 5px; }
input::placeholder { color: var(--muted); opacity: 1; }
input[readonly] { background: var(--ground); }
button, .secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border-radius: var(--control-radius); padding: 7px 13px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.primary { color: #fff; background: var(--text); border: 1px solid var(--text); }
.primary:hover { background: #333; }
.secondary { color: var(--text); background: var(--surface); border: 1px solid var(--control); }
.secondary:hover { background: var(--raised); }
.panel > .secondary { margin-block-start: 11px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.orders { list-style: none; padding: 0; margin: 12px 0 0; }
.orders-head, .order-row { display: grid; grid-template-columns: minmax(0, 1fr) 135px 96px 165px 16px; gap: var(--gap); align-items: center; }
.orders-head { padding: 0 9px 8px; font-size: 12px; color: var(--muted); }
.order-row { padding: 8px 9px; min-height: 52px; border-top: 1px solid var(--rule); color: inherit; text-decoration: none; }
.order-row:hover { background: var(--ground); }
.identity { min-width: 0; overflow-wrap: anywhere; }
.identity strong, .identity small { display: block; }
.identity strong { font-weight: 600; }
.numeric, .amount { font-variant-numeric: tabular-nums; }
.numeric, .go { text-align: right; }
.state { justify-self: start; font-size: 12px; color: var(--muted); white-space: nowrap; }
.state::before { content: ''; display: inline-block; vertical-align: .08em; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; background: currentColor; }
.state.checkout { color: var(--blue); }
.state.review, .warning { color: var(--warning); }
.state.complete, .state.paid { color: var(--positive); }
.empty { border: 1px dashed var(--control); border-radius: var(--control-radius); padding: 10px 12px; margin-top: 12px; color: var(--muted); }
.facts { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: 14px; }
.facts > div { border-top: 1px solid var(--rule); padding-top: 9px; min-width: 0; }
dd { margin-top: 2px; overflow-wrap: anywhere; }
.checkout-facts { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.compact-form, .copyline { display: flex; gap: var(--gap); align-items: end; margin-top: 12px; }
.compact-form label { width: min(100%, 430px); }
.record-form, .handoff { margin-top: 13px; }
.record-fields { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: var(--gap); }
.check { display: flex; align-items: center; gap: 7px; margin: 9px 0; min-height: 33px; }
input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--text); }
.alternatives { display: flex; gap: var(--gap); align-items: start; margin-top: 14px; flex-wrap: wrap; }
.management { margin-top: 9px; border-top: 1px solid var(--rule); }
.management form { margin-top: 5px; }
.management-list { padding: 0; margin: 12px 0 0; list-style: none; }
.management-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 124px; align-items: center; gap: var(--gap); border-top: 1px solid var(--rule); padding: 8px 0; }
.management-list strong, .management-list small { display: block; overflow-wrap: anywhere; }
.management-list small { color: var(--muted); font-size: 12px; }
.management-list a, .hint a { color: var(--blue); }
.pagination { display: flex; align-items: center; gap: var(--gap); margin-top: 10px; }
summary { cursor: pointer; padding: 7px 0; }
.copyline { margin-top: 0; }
.handoff .hint { margin-top: 9px; }
.error { color: var(--negative); }

@media (max-width: 800px) {
  .new-order { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .orders-head, .order-row { grid-template-columns: minmax(0, 1fr) 100px 65px 126px 10px; }
}
@media (max-width: 620px) {
  :root { --pad: 14px; }
  .shell { width: calc(100% - 32px); }
  .title { margin: 18px 0 14px; }
  .new-order label:nth-of-type(-n+2), .new-order .hint { grid-column: 1 / -1; }
  .new-order button { grid-column: 1 / -1; justify-self: stretch; }
  .orders-head { display: none; }
  .order-row { grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; }
  .duration { grid-column: 1; text-align: left; color: var(--muted); font-size: 12px; }
  .state { justify-self: end; }
  .go { display: none; }
  .facts, .checkout-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-fields { grid-template-columns: minmax(0, 1fr); }
  .compact-form { display: grid; }
  .management-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .management-list .state { grid-column: 1 / -1; justify-self: start; }
  .section-nav { justify-content: space-between; gap: 4px 8px; }
  .section-nav a { min-height: 44px; }
  .bar-account .muted { max-width: 115px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  input:not([type=checkbox]), select, button, .secondary, .check, summary { min-height: 44px; }
}
