/* ==========================================================================
   搬山搬家 · 设计系统
   概念：运单 / 装车清单。牛皮纸底、墨色字、朱砂印、等宽数字、虚线裁切边。
   ========================================================================== */

:root {
  --ink: #17130f;
  --ink-2: #2c2620;
  --ink-3: #5b5348;
  --ink-4: #8a8073;
  --paper: #efe6d5;
  --paper-2: #f8f2e6;
  --paper-3: #e6dac4;
  --kraft: #d9c8a8;
  --accent: #c4441c;
  --accent-2: #a83714;
  --jade: #24554a;
  --mustard: #c8961f;
  --line: rgba(23, 19, 15, 0.16);
  --line-strong: rgba(23, 19, 15, 0.42);
  --shadow: 3px 3px 0 rgba(23, 19, 15, 0.1);
  --shadow-lg: 6px 6px 0 rgba(23, 19, 15, 0.14);
  --serif: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --sans: 'Noto Sans SC', 'Source Han Sans SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
  --mono: 'Bahnschrift', 'DIN Alternate', 'Consolas', 'SFMono-Regular', monospace;
  --r: 4px;
  --rail: 232px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(23, 19, 15, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(23, 19, 15, 0.04));
  background-size: 22px 22px, 100% 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; margin: 0; letter-spacing: 0.01em; }

p { margin: 0; line-height: 1.72; }

a { color: inherit; text-decoration: none; }

button { font-family: inherit; color: inherit; cursor: pointer; }

input, select, textarea { font-family: inherit; color: inherit; font-size: 14px; }

::selection { background: rgba(196, 68, 28, 0.22); }

/* ---------- 通用排版 ---------- */
.mono { font-family: var(--mono); letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); }
.kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.muted { color: var(--ink-3); }
.faint { color: var(--ink-4); }
.accent { color: var(--accent); }
.jade { color: var(--jade); }
.num-xl { font-family: var(--mono); font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: 0.01em; }
.num-lg { font-family: var(--mono); font-size: 26px; line-height: 1.1; font-weight: 600; }
.num-md { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.dash { border: 0; border-top: 1px dashed var(--line-strong); margin: 16px 0; }

/* ---------- 徽记 / 印章 ---------- */
.seal {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2px solid currentColor;
  border-radius: 3px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: var(--accent);
  position: relative;
  padding: 2px;
  text-align: center;
}
.seal::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid currentColor;
  border-radius: 1px;
  opacity: 0.55;
}
.seal--sm { width: 30px; height: 30px; font-size: 10px; }
.seal--lg { width: 64px; height: 64px; font-size: 20px; }
.stamp {
  display: inline-block;
  padding: 6px 12px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: rotate(-4deg);
  opacity: 0.9;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper-2);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(23, 19, 15, 0.14); }
.btn--accent { background: var(--accent); border-color: var(--accent-2); color: #fff8ef; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); box-shadow: none; }
.btn--ghost:hover { background: rgba(23, 19, 15, 0.05); box-shadow: none; }
.btn--sm { height: 30px; padding: 0 11px; font-size: 12px; box-shadow: 2px 2px 0 rgba(23, 19, 15, 0.1); }
.btn--lg { height: 50px; padding: 0 26px; font-size: 15px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: transparent;
  padding: 0;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(23, 19, 15, 0.06); }

/* ---------- 纸卡片 ---------- */
.card {
  position: relative;
  background: var(--paper-2);
  border: 1.5px solid var(--ink);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card--flat { box-shadow: none; }
.card--dashed { border-style: dashed; border-color: var(--line-strong); box-shadow: none; background: transparent; }
.card--ink { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card__head h3 { font-size: 16px; }
.card__head .kicker { white-space: nowrap; }

/* 票根缺口 */
.ticket { position: relative; }
.ticket::before, .ticket::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}
.ticket::before { left: -10px; clip-path: inset(0 0 0 50%); }
.ticket::after { right: -10px; clip-path: inset(0 50% 0 0); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}
.tag--accent { color: var(--accent); border-color: rgba(196, 68, 28, 0.45); background: rgba(196, 68, 28, 0.07); }
.tag--jade { color: var(--jade); border-color: rgba(36, 85, 74, 0.42); background: rgba(36, 85, 74, 0.07); }
.tag--mustard { color: #7c5c0c; border-color: rgba(200, 150, 31, 0.5); background: rgba(200, 150, 31, 0.1); }
.tag--ink { color: var(--paper-2); background: var(--ink); border-color: var(--ink); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- 状态 ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(23, 19, 15, 0.07); }
.s-pending { color: #9a6b0c; }
.s-assigned, .s-accepted { color: #2f5f86; }
.s-enroute, .s-arrived { color: var(--accent); }
.s-moving { color: var(--accent); }
.s-done { color: var(--jade); }
.s-cancelled { color: var(--ink-4); }

/* ---------- 表格（运单清单） ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
  padding: 0 12px 10px;
  border-bottom: 1.5px solid var(--ink);
  white-space: nowrap;
}
.table td { padding: 13px 12px; border-bottom: 1px dashed var(--line); font-size: 13px; vertical-align: middle; }
.table tbody tr { transition: background 0.12s ease; cursor: pointer; }
.table tbody tr:hover { background: rgba(196, 68, 28, 0.05); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }

/* ---------- 表单 ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 11px; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 600; }
.input, select.input, textarea.input {
  height: 38px;
  width: 100%;
  min-width: 0;
  padding: 0 11px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.5);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196, 68, 28, 0.12); }
.input::placeholder { color: var(--ink-4); }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.spacer { flex: 1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* 复选 / 开关 */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--paper-3); border: 1.5px solid var(--line-strong); position: relative; transition: 0.15s; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--ink-3); transition: 0.15s; }
.switch input:checked { background: var(--jade); border-color: var(--jade); }
.switch input:checked::after { left: 18px; background: #fff; }

/* ---------- 抽屉 / 弹层 ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(23, 19, 15, 0.45);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 100;
}
.scrim.is-on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; top: 0; right: 0; height: 100%; width: min(560px, 94vw);
  background: var(--paper-2); border-left: 2px solid var(--ink);
  transform: translateX(102%); transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.2, 1);
  z-index: 101; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(23, 19, 15, 0.18);
}
.sheet.is-on { transform: translateX(0); }
.sheet__head { padding: 20px 24px; border-bottom: 1.5px solid var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet__body { padding: 22px 24px 40px; overflow: auto; flex: 1; }
.sheet__foot { padding: 14px 24px; border-top: 1.5px solid var(--ink); display: flex; gap: 10px; justify-content: flex-end; background: var(--paper-3); }

.modal {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 102;
  opacity: 0; pointer-events: none; transition: opacity 0.18s;
}
.modal.is-on { opacity: 1; pointer-events: auto; }
.modal__box {
  width: min(460px, 92vw); background: var(--paper-2); border: 2px solid var(--ink);
  border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 22px; transform: translateY(8px); transition: transform 0.2s;
}
.modal.is-on .modal__box { transform: none; }

.toast-wrap { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; }
.toast {
  background: var(--ink); color: var(--paper-2); padding: 11px 18px; border-radius: var(--r);
  font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn 0.25s ease;
  border-left: 3px solid var(--accent);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: 150px; overflow: visible; }
.chart text { font-family: var(--mono); font-size: 9px; fill: var(--ink-4); letter-spacing: 0.08em; }
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 42px; align-items: center; gap: 10px; font-size: 12px; }
.bar-track { height: 8px; background: rgba(23, 19, 15, 0.08); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--ink); border-radius: 99px; transition: width 0.5s cubic-bezier(0.2, 0.9, 0.2, 1); }
.bar-fill--accent { background: var(--accent); }
.bar-fill--jade { background: var(--jade); }

/* ---------- 空状态 ---------- */
.empty { padding: 48px 20px; text-align: center; color: var(--ink-4); }
.empty .seal { opacity: 0.35; margin-bottom: 12px; }

/* ---------- 骨架 ---------- */
.skel { background: linear-gradient(90deg, rgba(23,19,15,.05), rgba(23,19,15,.1), rgba(23,19,15,.05)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 3px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(23, 19, 15, 0.22); border-radius: 99px; border: 2px solid var(--paper); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
