/* 订单后台 · 与 PC 工具同一套视觉 */
:root {
  --bg: #eef1f6; --panel: #fff; --chrome: #f5f7fb; --text: #111827; --text-2: #4b5563; --muted: #8a94a6;
  --line: #e3e7ee; --line-2: #d5dbe5; --accent: #2563eb; --accent-soft: #e8f0ff;
  --red: #e5484d; --red-soft: #fdecec; --green: #16a34a; --green-soft: #e7f6ec; --amber: #d97706; --amber-soft: #fff4e5;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
}
* { box-sizing: border-box; }
body { margin: 0; font: 13px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); cursor: pointer; }
button:hover { border-color: #b9c2d3; background: #f8fafc; }
button svg, .logo svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
input { height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.muted { color: var(--muted); font-size: 12px; }
.spacer { flex: 1; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px; background: var(--chrome); border-bottom: 1px solid var(--line); }
.logo { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; }
.brand { font-size: 15px; font-weight: 600; margin-right: 16px; }
nav { display: flex; gap: 4px; }
nav a { padding: 6px 12px; border-radius: 8px; color: var(--text-2); }
nav a:hover { background: #e9edf4; }
nav a.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); font-weight: 500; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; }
h1 { font-size: 20px; font-weight: 600; margin: 0 0 16px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; color: var(--text-2); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.card .label { color: var(--text-2); font-size: 12px; }
.card .value { font-size: 24px; font-weight: 600; margin-top: 2px; }
.card .hint { color: var(--muted); font-size: 12px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input { width: 300px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--text-2); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.row { cursor: pointer; }
tr.row:hover td { background: #f8fafc; }
tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.break { word-break: break-all; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 20px; padding: 0 9px; border-radius: 10px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.gray { background: #eef0f4; color: var(--text-2); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 12px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; word-break: break-all; }
.videos { display: grid; gap: 12px; }
.videos video { width: 100%; max-height: 420px; background: #0b1020; border-radius: 8px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f3f5f9; }
pre { margin: 6px 0 0; padding: 10px 12px; background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: 240px; font-size: 12px; }
.empty { padding: 36px; text-align: center; color: var(--text-2); }
.paths li { margin: 4px 0; }
.err { color: var(--red); }

/* 登录 */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 360px; max-width: 100%; display: grid; gap: 12px; padding: 32px 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); text-align: center; }
.login-card .logo { width: 44px; height: 44px; border-radius: 12px; margin: 0 auto; }
.login-card .logo svg { width: 22px; height: 22px; }
.login-card h1 { margin: 4px 0 0; font-size: 18px; }
.login-card p { margin: 0 0 6px; }
.login-card input { height: 40px; font-size: 14px; }
.login-card .btn-primary { height: 40px; justify-content: center; font-size: 14px; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* 订单流水线 */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 10px; }
.stage { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--chrome); }
.stage:hover { border-color: var(--accent); }
.stage .label { font-size: 12px; color: var(--text-2); }
.stage .value { font-size: 20px; font-weight: 600; }
.stage.hot { border-color: var(--red); background: var(--red-soft); }
.stage.hot .value { color: var(--red); }

/* 审核 */
.nav-badge { margin-left: 6px; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: 8px; background: var(--red); color: #fff; }
.nav-badge:empty { display: none; }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: #e6eaf1; gap: 2px; }
.seg button { height: 28px; border: none; background: transparent; color: var(--text-2); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.verdicts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.verdicts button { height: 40px; justify-content: center; font-size: 14px; }
.verdicts button.on.confirmed { background: var(--green); border-color: var(--green); color: #fff; }
.verdicts button.on.corrected { background: var(--accent); border-color: var(--accent); color: #fff; }
.verdicts button.on.doubt { background: var(--amber); border-color: var(--amber); color: #fff; }
.items { display: grid; gap: 8px; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 72px 30px; gap: 6px; }
.item-row input { width: 100%; min-width: 0; }
.item-row .del { width: 30px; padding: 0; justify-content: center; color: var(--text-2); }
textarea { width: 100%; min-height: 64px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; resize: vertical; background: var(--panel); color: inherit; outline: none; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.submit-row { display: flex; gap: 8px; align-items: center; }
.submit-row .btn-primary { height: 40px; padding: 0 20px; font-size: 14px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label { color: var(--text-2); font-size: 12px; }
.history li { margin: 6px 0; }
.sticky { position: sticky; top: 68px; }

/* 窄屏：顶栏不折字，表格横向滚动 */
.brand, nav a, #scan-info, button { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
td { white-space: nowrap; }
td.break, td .break { white-space: normal; }
@media (max-width: 720px) {
  .top { padding: 0 12px; gap: 6px; }
  .brand { margin-right: 4px; }
  #scan-info { display: none; }
  #rescan { padding: 0 8px; }
  #rescan .btn-label { display: none; }
}
@media (max-width: 600px) {
  .brand { display: none; }
  nav a { padding: 6px 8px; }
  main { padding: 16px 12px 40px; }
  .toolbar input { width: 100%; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1020; --panel: #151c2e; --chrome: #0f1526; --text: #e6e9f0; --text-2: #b4bccb; --muted: #7d889c; --line: #232c40; --line-2: #2e3850; --accent-soft: #1b2a4a; --red-soft: rgba(229,72,77,.16); --green-soft: rgba(34,197,94,.14); --amber-soft: rgba(217,119,6,.16); }
  button:hover, nav a:hover, tr.row:hover td { background: #1b2337; }
  pre { background: #10172a; }
  .pill.gray { background: #1f283c; }
}
.logout-msg { color: #b42318; font-size: 12px; }
