* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --brand: #e84c3d;
  --brand-dark: #c03a2b;
  --bg: #f5f5f7;
  --card: #fff;
  --ink: #1a1a1a;
  --muted: #888;
  --line: #ebebeb;
  --ok: #16a34a;
  --ok-bg: #dcfce7;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
}
html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }

.header { background: linear-gradient(135deg, var(--brand) 0%, #ff8c69 100%); position: relative; overflow: hidden; }
.header::before, .header::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.header::before { top: -40px; right: -40px; width: 180px; height: 180px; }
.header::after { bottom: -30px; left: -20px; width: 120px; height: 120px; background: rgba(255,255,255,.06); }
.header-inner { position: relative; z-index: 1; padding: 32px 20px 40px; text-align: center; }
.header h1 { color: #fff; font-size: 22px; font-weight: 700; letter-spacing: .5px; }

.shell { max-width: 30rem; margin: 0 auto; }
.search-card {
  background: var(--card); border-radius: 20px 20px 0 0; margin-top: -18px;
  padding: 22px 18px 16px; position: relative; z-index: 2; box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.search-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.input-row { display: flex; gap: 10px; }
.order-input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px; font-size: 15px; color: var(--ink);
  background: #fafafa; border: 1.5px solid var(--line); border-radius: 12px; outline: none;
  -webkit-appearance: none; transition: border-color .2s;
}
.order-input:focus { border-color: var(--brand); background: #fff; }
.order-input::placeholder { color: #bbb; font-size: 14px; }
.search-btn {
  height: 48px; padding: 0 20px; border: none; border-radius: 12px; background: var(--brand);
  color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .2s, transform .1s;
}
.search-btn:active { background: var(--brand-dark); transform: scale(.97); }
.search-btn:disabled { background: #f0a090; pointer-events: none; }

.content { padding: 0 18px 24px; }

.loading { text-align: center; padding: 40px 0; color: var(--muted); }
.spinner {
  width: 36px; height: 36px; margin: 0 auto 12px; border-radius: 50%;
  border: 3px solid #f0f0f0; border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fail { margin-top: 16px; border-radius: 14px; overflow: hidden; background: #fff5f5; border: 1px solid #ffcdd2; }
.fail-banner { background: var(--brand); color: #fff; font-size: 15px; font-weight: 700; padding: 12px 16px; }
.fail-body { padding: 12px 16px 16px; }
.fail-body h3 { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 8px; }
.fail-body li { font-size: 13px; color: #444; line-height: 1.7; margin-left: 1.1em; }

.order-card { background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.06); margin-top: 16px; }
.order-head { background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%); padding: 16px 18px; display: flex; align-items: center; gap: 10px; }
.order-head .id-wrap { flex: 1; min-width: 0; }
.order-head .id-label { font-size: 11px; color: rgba(255,255,255,.5); margin-bottom: 3px; }
.order-head .id-val { font-size: 14px; color: rgba(255,255,255,.9); font-family: ui-monospace, "Courier New", monospace; overflow-wrap: anywhere; }
.badge { flex-shrink: 0; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #f3f4f6; color: #6b7280; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.doing { background: #eff6ff; color: #1d4ed8; }

.product { padding: 16px 18px; display: flex; gap: 12px; border-bottom: 1px solid var(--line); }
.product img, .product .ph {
  width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  background: #f5f5f5; border: 1px solid var(--line);
}
.product .ph { display: flex; align-items: center; justify-content: center; font-size: 26px; background: linear-gradient(135deg, #ffe4d6, #ffd0c0); }
.product .info { flex: 1; min-width: 0; }
.product .title { font-size: 14px; line-height: 1.5; margin-bottom: 8px; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: #f5f5f5; color: var(--muted); overflow-wrap: anywhere; }

.stats { padding: 14px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: #fafafa; border-radius: 12px; padding: 12px; }
.stat .k { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat .v { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.stat .v.brand { color: var(--brand); }
.stat .v.green { color: var(--ok); }

.timeline { padding: 4px 18px 18px; }
.timeline h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.tl { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #d9d9d9; flex-shrink: 0; }
.dot.done { background: var(--ok); }
.tl .ev { flex: 1; font-size: 13px; }
.tl .at { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.notice { margin: 14px 18px 24px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 14px; }
.notice h2 { font-size: 13px; font-weight: 600; color: var(--warn); padding: 12px 14px; }
.notice ol { padding: 0 14px 12px 30px; border-top: 1px solid #fde68a; margin-top: 0; }
.notice li { font-size: 12px; color: #78350f; line-height: 1.7; padding: 4px 0; }

.closed { text-align: center; padding: 25vh 1rem; color: var(--muted); }
