/* 门店端与管理后台（电脑浏览器） */
:root {
  --bg: #f4f5f7;
  --card: #fff;
  --text: #1d2330;
  --muted: #6b7280;
  --line: #e3e6eb;
  --primary: #1f3a68;
  --primary-hover: #284a85;
  --danger: #b42318;
  --warn-bg: #fff7e6;
  --warn-line: #f5c26b;
  --ok: #157f3b;
  font-family: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  min-height: 100vh;
}
.loading {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
a {
  color: var(--primary);
}
h1,
h2,
h3 {
  margin: 0 0 12px;
  font-weight: 600;
}
h2 {
  font-size: 19px;
}
h3 {
  font-size: 15px;
  margin-top: 20px;
}
.muted {
  color: var(--muted);
}
.error {
  color: var(--danger);
  min-height: 1em;
}
.why {
  color: var(--danger);
  font-size: 13px;
  margin: 6px 0 0;
}
.mono {
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}
.strong {
  font-weight: 600;
}
.big {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1px;
}

/* 按钮与表单 */
button,
.button {
  font: inherit;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}
button:hover:not(:disabled),
.button:hover {
  border-color: #c3c8d0;
}
button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}
button.danger {
  color: var(--danger);
  border-color: #f0c4bf;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.link {
  border: none;
  background: none;
  color: var(--primary);
  padding: 4px 6px;
}
input,
select,
textarea {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid #cfd4dc;
  border-radius: 6px;
  background: #fff;
}
textarea {
  width: 100%;
  resize: vertical;
}
input.wide {
  width: 100%;
  max-width: 560px;
}
input.num {
  width: 90px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.row.center {
  justify-content: center;
}

/* 登录 */
.login {
  max-width: 340px;
  margin: 12vh auto 0;
  background: var(--card);
  padding: 32px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.login h1 {
  font-size: 22px;
  margin-bottom: 4px;
}
.login input {
  width: 100%;
}
.login button {
  width: 100%;
  padding: 10px;
}

/* 顶栏与标签 */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
}
header .brand {
  display: flex;
  gap: 14px;
  align-items: baseline;
}
header .brand strong {
  font-size: 17px;
}
header .who {
  display: flex;
  gap: 10px;
  align-items: center;
}
header .who .muted {
  color: #c7d1e4;
}
header button.link {
  color: #fff;
}
nav.tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
nav.tabs button {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 12px 14px 9px;
  background: none;
  color: var(--muted);
}
nav.tabs button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.badge {
  display: inline-block;
  min-width: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 10px;
  background: #e5e8ee;
  color: var(--text);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}
.badge.hot {
  background: var(--danger);
  color: #fff;
}
main {
  padding: 20px 24px 60px;
  max-width: 1280px;
}
.card {
  background: var(--card);
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
}
.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0 14px;
}
.warn p {
  margin: 6px 0 10px;
}
.warn label {
  margin-bottom: 10px;
}

/* 开单二维码 */
.qr-card {
  text-align: center;
  max-width: 520px;
}
img.qr {
  width: 300px;
  height: 300px;
  image-rendering: pixelated;
  display: block;
  margin: 0 auto;
}
.qr-card .big {
  margin: 10px 0 2px;
}

/* 搜索与表格 */
.search {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search input.wide {
  max-width: 320px;
}
table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.list th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  white-space: nowrap;
}
table.list td {
  border-bottom: 1px solid #f0f1f4;
  padding: 9px 10px;
  vertical-align: top;
}
table.list td.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
table.list tr.clickable {
  cursor: pointer;
}
table.list tr.clickable:hover td {
  background: #f6f8fc;
}
table.list tr.total td {
  font-weight: 600;
  border-top: 2px solid var(--line);
}
table.list tr.off td {
  color: var(--muted);
}
.empty {
  color: var(--muted);
  padding: 24px 0;
  text-align: center;
}
.st {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 13px;
  background: #eef0f4;
}
.st.pending_print {
  background: #fde8e6;
  color: var(--danger);
  font-weight: 600;
}
.st.printed {
  background: #e7eefb;
  color: var(--primary);
}
.st.delivered {
  background: #e5f4ea;
  color: var(--ok);
}
.st.voided {
  background: #f1f1f1;
  color: #999;
  text-decoration: line-through;
}

/* 订单详情 */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 16px;
  overflow-y: auto;
  z-index: 10;
}
.modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 980px;
}
.modal.small {
  max-width: 400px;
  margin-top: 15vh;
}
.modal .close {
  position: absolute;
  right: 12px;
  top: 10px;
  border: none;
  font-size: 24px;
  line-height: 1;
  padding: 4px 10px;
  background: none;
  color: var(--muted);
}
.detail {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
}
.visual {
  text-align: center;
}
img.preview {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
}
.info dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 12px;
  margin: 0 0 18px;
  font-size: 14px;
}
.info dt {
  color: var(--muted);
}
.info dd {
  margin: 0;
  word-break: break-all;
}
ul.events {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}
ul.events li {
  padding: 4px 0;
  border-bottom: 1px dashed #eceef2;
}

/* 提示 */
.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  z-index: 20;
}
.toast {
  max-width: 420px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #333;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 20;
}
.toast.ok {
  background: var(--ok);
}
.toast.err {
  background: var(--danger);
}
