/* ───────────────────────────────────────────────
   包裹代收 · 下单系统
   形状规则：卡片 14 / 输入 10 / 主按钮与状态片 999
   色彩：暖中性打底，只有一个主色（松绿）花在主要动作上
   ─────────────────────────────────────────────── */

:root {
  --paper: #f7f4ef;
  --surface: #ffffff;
  --surface-2: #fbf9f6;
  --ink: #17181a;
  --ink-2: #4a4742;
  --muted: #837d75;
  --line: #e3ddd4;
  --line-2: #efe9e0;

  --accent: #0b6b5b;
  --accent-press: #085548;
  --accent-soft: #e4f1ee;

  --ok: #1f7a53;
  --ok-soft: #e8f3ec;
  --warn: #9a6b1f;
  --warn-soft: #f7efdf;
  --info: #2f5f8f;
  --info-soft: #e9f0f7;
  --danger: #a33a2c;
  --danger-soft: #f9eae7;
  --muted-soft: #efebe5;

  --r-card: 14px;
  --r-input: 10px;
  --r-pill: 999px;

  --shadow: 0 1px 2px rgba(23, 24, 26, .04), 0 8px 24px -12px rgba(23, 24, 26, .14);
  --font: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button, input, textarea, select { font: inherit; color: inherit; }

/* ───────── 顶栏 ───────── */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(16px, 4vw, 32px);
  background: rgba(247, 244, 239, .88);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -.01em;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand .mark {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--accent);
}

.tabs { display: flex; gap: 2px; flex: none; }

.tab {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-size: 13.5px;
  color: var(--muted);
  transition: background .15s, color .15s;
}

.tab:hover { background: var(--surface); color: var(--ink); }
.tab.on { background: var(--ink); color: #fff; }

/* ───────── 容器 ───────── */

.shell {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 24px) 64px;
}

.shell.wide { max-width: 1180px; }

.intro { margin: 4px 0 22px; }

.intro h1 {
  margin: 0 0 6px;
  font-size: clamp(23px, 5vw, 30px);
  line-height: 1.2;
  letter-spacing: -.025em;
  font-weight: 700;
}

.intro p { margin: 0; color: var(--ink-2); font-size: 14.5px; max-width: 52ch; }

/* ───────── 区块 ───────── */

.block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.block-head { margin-bottom: 16px; }

.block-head h2 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 3px;
  font-size: 16px;
  letter-spacing: -.015em;
  font-weight: 650;
}

.block-head .num {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .06em;
}

.block-head .sub { margin: 0; color: var(--muted); font-size: 13px; }

/* ───────── 仓库选择 ───────── */

.pick { display: grid; gap: 10px; }

.pick-item {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 15px 13px 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.pick-item:hover { border-color: #cfc7bb; background: #fff; }

.pick-item.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.pick-item .dot {
  position: absolute;
  left: 15px;
  top: 15px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid #cfc7bb;
  background: #fff;
}

.pick-item.on .dot { border-color: var(--accent); }
.pick-item.on .dot::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: var(--accent);
}

.pick-item .nm { display: flex; align-items: center; gap: 8px; font-weight: 620; font-size: 14.5px; }
.pick-item .ad { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.pick-item .hr { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }

.pick-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  min-height: 1em;
}

/* ───────── 分段控件 ───────── */

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  margin-bottom: 16px;
}

.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 9px 8px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}

.seg-btn.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(23, 24, 26, .1);
}

.pane[hidden] { display: none; }

/* ───────── 字段 ───────── */

.field { display: block; margin-bottom: 14px; }

.field:last-child { margin-bottom: 0; }

.label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.label em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: var(--r-pill);
  letter-spacing: .02em;
}

.label em.opt { color: var(--muted); background: var(--muted-soft); font-weight: 500; }

input[type="text"], input:not([type]), textarea, input[type="file"] {
  width: 100%;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  font-size: 14.5px;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus, textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(11, 107, 91, .12);
}

input.bad, textarea.bad { border-color: var(--danger); background: var(--danger-soft); }

textarea { resize: vertical; min-height: 92px; line-height: 1.6; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 460px) { .row2 { grid-template-columns: 1fr; gap: 0; } }

.err { display: block; margin-top: 5px; font-size: 12px; color: var(--danger); min-height: 0; }
.err:empty { display: none; }

.hint { margin: 7px 0 0; font-size: 12px; color: var(--muted); }

.counter {
  display: block;
  text-align: right;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* ───────── 图片 ───────── */

.shots { display: flex; flex-wrap: wrap; gap: 8px; }

.shot {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: var(--r-input);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.shot .del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 24, 26, .72);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.shot-add {
  width: 84px;
  height: 84px;
  border: 1px dashed #cfc7bb;
  border-radius: var(--r-input);
  background: var(--surface-2);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 3px;
  cursor: pointer;
  color: var(--muted);
  font-size: 11.5px;
  transition: border-color .15s, color .15s, background .15s;
}

.shot-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.shot-add svg { width: 20px; height: 20px; }
.shot-add[hidden] { display: none; }

/* ───────── 提交 ───────── */

.submit-bar { margin-top: 22px; }

.submit-note { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: .01em;
  cursor: pointer;
  transition: background .15s, transform .08s;
  text-decoration: none;
}

.btn-primary:hover { background: var(--accent-press); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { background: #9fb6b0; cursor: not-allowed; }

.as-link { text-align: center; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.form-err {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--danger);
  min-height: 0;
}
.form-err:empty { display: none; }

/* ───────── 成功卡 ───────── */

.done { animation: rise .28s ease-out both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .done { animation: none; }
  * { transition: none !important; }
}

.done[hidden] { display: none; }

.done-head { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }

.done-ico {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  padding: 9px;
}

.done-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.done-head p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }

.ticket {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.ticket::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.ticket-no { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }

.ticket-no .label { margin: 0; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.ticket-no strong { font-family: var(--mono); font-size: 17px; letter-spacing: .01em; }

.ticket-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 0; }
@media (max-width: 520px) { .ticket-meta { grid-template-columns: 1fr 1fr; } }

.ticket-meta dt { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.ticket-meta dd { margin: 1px 0 0; font-size: 13.5px; font-weight: 600; }

.timeline { list-style: none; margin: 16px 0 0; padding: 0; }

.timeline li {
  position: relative;
  padding: 0 0 14px 22px;
  border-left: 1px solid var(--line-2);
}

.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.timeline li:first-child::before { background: var(--accent); }

.timeline .t { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.timeline .x { font-size: 13.5px; }

.done-actions { display: flex; gap: 10px; margin-top: 20px; }
.done-actions .btn-primary { width: auto; flex: 1; }

/* ───────── 状态片 ───────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .02em;
  white-space: nowrap;
}

.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.chip.ok { color: var(--ok); background: var(--ok-soft); }
.chip.warn { color: var(--warn); background: var(--warn-soft); }
.chip.info { color: var(--info); background: var(--info-soft); }
.chip.muted { color: var(--muted); background: var(--muted-soft); }
.chip.danger { color: var(--danger); background: var(--danger-soft); }

/* ───────── 页脚 ───────── */

.foot {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px) 32px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

/* ───────── 我的订单 ───────── */

.search-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.search-card .row-inline { display: flex; gap: 10px; }
.search-card .row-inline input { flex: 1; }

.order-list { display: grid; gap: 12px; }

.order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.oc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.oc-no { font-family: var(--mono); font-size: 13.5px; font-weight: 650; letter-spacing: .02em; }
.oc-date { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

.oc-body { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
@media (max-width: 480px) { .oc-body { grid-template-columns: 1fr; } }

.oc-row .k { font-size: 11.5px; color: var(--muted); }
.oc-row .v { font-size: 13.5px; }

.oc-msg {
  margin-top: 10px;
  padding: 9px 11px;
  background: var(--surface-2);
  border-radius: var(--r-input);
  font-size: 13px;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.oc-thumbs { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.oc-thumbs img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.oc-toggle {
  margin-top: 10px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.oc-timeline { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.oc-timeline[hidden] { display: none; }

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--muted);
  font-size: 13.5px;
  border: 1px dashed var(--line);
  border-radius: var(--r-card);
  background: var(--surface-2);
}

/* ───────── 后台 ───────── */

.admin-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-bar h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; flex: 1; min-width: 140px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; margin-bottom: 16px; }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  padding: 11px 13px;
}

.stat .k { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.stat .v { font-family: var(--mono); font-size: 20px; font-weight: 650; margin-top: 2px; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }

.filter-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.filter-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.admin-list { display: grid; gap: 10px; }

.a-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.a-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.a-no { font-family: var(--mono); font-size: 13px; font-weight: 650; }
.a-when { font-size: 11.5px; color: var(--muted); font-family: var(--mono); margin-left: auto; }

.a-grid { margin-top: 9px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px 14px; }
@media (max-width: 640px) { .a-grid { grid-template-columns: 1fr 1fr; } }

.a-row .k { font-size: 11px; color: var(--muted); }
.a-row .v { font-size: 13px; word-break: break-word; }

.a-msg {
  margin-top: 9px;
  padding: 8px 11px;
  background: var(--warn-soft);
  border-radius: var(--r-input);
  font-size: 13px;
  color: #6b4a12;
  white-space: pre-wrap;
  word-break: break-word;
}

.a-shots { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.a-shots a { display: block; }
.a-shots img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.a-actions { margin-top: 11px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.a-actions select {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--surface-2);
  font-size: 13px;
  -webkit-appearance: none;
  appearance: none;
  padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.a-actions input.track {
  width: 190px;
  padding: 8px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  font-size: 13px;
  font-family: var(--mono);
}

.a-actions .save {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 9px 17px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.a-actions .save:hover { background: var(--accent-press); }
.a-actions .save[disabled] { background: #a8bfba; cursor: default; }

.a-note {
  width: 100%;
  margin-top: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--surface-2);
  font-size: 13px;
  resize: vertical;
  min-height: 40px;
}

/* 登录卡 */
.login-card {
  max-width: 380px;
  margin: 8vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 26px 24px;
}

.login-card h1 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.02em; }
.login-card p { margin: 0 0 18px; font-size: 13px; color: var(--muted); }

/* 设置抽屉 */
.settings {
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px;
}
.settings[hidden] { display: none; }
.settings h2 { margin: 0 0 10px; font-size: 15px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}

.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 仓库编辑卡（后台设置里；不复用 .a-card，避免被订单列表的接线误抓） */
.w-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.w-card .field { margin-bottom: 0; }
