:root {
  --bg: #fbf8f3; --card: #fff; --ink: #161c28; --ink2: #4a5262; --ink3: #8a909c; --line: #e4ddd2; --soft: #f3efe8;
  --accent: #d2582a; --accent-soft: #fbe7dc; --gold: #f2c46e; --blue: #2d57b5; --blue-soft: #e3eaf8;
  --plum: #7a4e8c; --plum-soft: #f0e6f4; --red: #c2362b; --red-soft: #f9e1de; --green: #2f6b4f;
  --ease: cubic-bezier(.22, .8, .24, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body { font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding: max(16px, env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); }
.boot { display: grid; place-items: center; min-height: 70vh; }
.mark { width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: var(--gold); display: grid; place-items: center; font-weight: 700; font-size: 19px; box-shadow: inset 0 -3px 0 rgba(233, 169, 58, .6); }
.boot .mark { animation: breathe 1.4s ease-in-out infinite; }
.reveal { opacity: 0; transform: translateY(12px); animation: up .5s var(--ease) forwards; }

/* header */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.brand .t { font-weight: 700; font-size: 16px; letter-spacing: .03em; }
.brand .s { font-size: 12px; color: var(--ink3); }
.brand .out { margin-left: auto; font-size: 13px; color: var(--ink3); background: none; border: 0; padding: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; margin-bottom: 12px; }
h1 { font-size: 22px; letter-spacing: .01em; }
.lead { color: var(--ink2); font-size: 13px; margin: 4px 0 14px; }
.lead b { color: var(--red); }

/* login */
.login { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; }
.login .mark { width: 56px; height: 56px; font-size: 26px; border-radius: 16px; margin-bottom: 18px; }
.login h1 { font-size: 24px; }
.field { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; color: var(--ink2); }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 14px; font-size: 16px; color: var(--ink); }
.field textarea { min-height: 76px; resize: vertical; }
.field small { color: var(--ink3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 600; font-size: 15px; cursor: pointer; transition: transform .16s var(--ease), box-shadow .2s, opacity .2s; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; }
.btn.pri { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -12px rgba(210, 88, 42, .8); }
.btn.ink { background: var(--ink); color: #fff; }
.btn.sec { background: var(--card); border: 1px solid var(--line); }
.btn.block { width: 100%; margin-top: 18px; }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* groups & task cards */
.gh { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink3); margin: 16px 0 8px; }
.gh i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.gh .n { margin-left: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 10px; position: relative; overflow: hidden; }
.card.late { border-color: #f0c9c4; }
.card.late::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.task { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.task .k { font-size: 11px; color: var(--ink3); }
.task .t { font-size: 15px; font-weight: 600; margin: 2px 0; }
.task .d { font-size: 12px; color: var(--ink2); }
.due { text-align: right; line-height: 1.15; }
.due b { display: block; font-size: 20px; }
.due small { font-size: 11px; color: var(--ink3); }
.due.r b { color: var(--red); } .due.a b { color: var(--accent); }
.go { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.empty { text-align: center; color: var(--ink3); padding: 28px 10px; font-size: 14px; }

/* orders */
.order { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; width: 100%; text-align: left; transition: transform .2s var(--ease); }
.order:active { transform: scale(.98); }
.order .t { font-weight: 600; }
.order .d { font-size: 12px; color: var(--ink2); }
.ring { width: 52px; height: 52px; position: relative; }
.ring svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.ring .bg { stroke: #eee8df; }
.ring .fg { stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.ring .in { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1; }
.ring .in b { font-size: 15px; } .ring .in small { display: block; font-size: 9px; color: var(--ink3); margin-top: 2px; }

/* order detail */
.hero { border-radius: 22px; background: var(--ink); color: #fff; padding: 16px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(closest-side, rgba(233, 169, 58, .32), transparent); animation: float 7s ease-in-out infinite; }
.hero > * { position: relative; z-index: 1; }
.hero .meta { font-size: 12px; color: #b5bcc9; }
.big { display: flex; align-items: flex-end; gap: 10px; margin-top: 10px; }
.big .v { font-size: 48px; font-weight: 700; line-height: .9; }
.big .u { font-size: 13px; color: #b5bcc9; padding-bottom: 4px; }
.big .u b { color: #fff; }
.big .v.late { color: #ff9a8a; }
.bar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .1); display: flex; overflow: hidden; gap: 2px; margin-top: 14px; }
.bar i { height: 100%; transform-origin: left; transform: scaleX(0); animation: fill .9s var(--ease) forwards; }
.bar .c { background: var(--gold); } .bar .p { background: #7e93b5; animation-delay: .2s; } .bar .x { background: #ff7a6a; }
.barlab { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: #b5bcc9; margin-top: 6px; }
.barlab .g { color: var(--gold); } .barlab .r { color: #ff9a8a; }
.contact { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 13px; }
.contact a { color: var(--blue); text-decoration: none; font-weight: 600; }
.styles { display: grid; gap: 8px; margin-top: 12px; }
.style { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.style img, .style .ph { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--soft); }
.style .t { font-weight: 600; font-size: 14px; }
.style .d { font-size: 12px; color: var(--ink2); }
.sect { font-size: 13px; color: var(--ink3); margin: 18px 0 8px; display: flex; justify-content: space-between; }
.mat .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mat .head .t { font-weight: 600; }
.chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; font-style: normal; animation: pop .32s var(--spring); }
.h-factory { background: var(--accent-soft); color: var(--accent); }
.h-transit_to_us { background: #efeaf8; color: var(--plum); }
.h-us { background: var(--blue-soft); color: var(--blue); }
.h-customer { background: var(--plum-soft); color: var(--plum); }
.h-done { background: #e6f1ea; color: var(--green); }
.chip.late { background: var(--red-soft); color: var(--red); }
.mat .sub { font-size: 12px; color: var(--ink2); margin-top: 4px; }
.tl { list-style: none; margin: 10px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.tl li { position: relative; padding: 0 0 10px 8px; font-size: 13px; opacity: 0; transform: translateX(-6px); animation: upx .4s var(--ease) forwards; }
.tl li::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid #c9c0b0; }
.tl li.f::before { border-color: var(--accent); background: var(--accent); }
.tl li.u::before { border-color: var(--blue); background: var(--blue); }
.tl .when { color: var(--ink3); font-size: 12px; margin-right: 6px; }
.tl .note { display: block; margin-top: 4px; background: var(--accent-soft); border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.tl .bits { display: block; color: var(--ink3); font-size: 12px; }
.thumbs { display: flex; gap: 6px; margin-top: 6px; }
.thumbs img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.round { font-size: 12px; color: var(--ink3); margin: 6px 0 4px -14px; padding-left: 14px; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.sheet-dim { position: absolute; inset: 0; background: rgba(22, 28, 40, .45); animation: fade .25s ease both; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 10px 18px calc(24px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; animation: rise .45s var(--spring) both; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: #d8d0c3; margin: 0 auto 12px; }
.sheet h3 { font-size: 18px; }
.sheet .hint { font-size: 12px; color: var(--ink3); margin-top: 4px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg label { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 0; font-size: 14px; background: var(--card); transition: background .2s, color .2s; }
.seg input { display: none; }
.seg input:checked + span { color: #fff; }
.seg label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.ups { display: flex; flex-wrap: wrap; gap: 8px; }
.ups .up { width: 68px; height: 68px; border-radius: 12px; object-fit: cover; animation: pop .35s var(--spring); }
.ups .add { width: 68px; height: 68px; border-radius: 12px; border: 1.5px dashed #cfc6b7; display: grid; place-items: center; color: var(--ink3); font-size: 12px; text-align: center; background: none; }
.ok { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none; }
.ok .c { width: 104px; height: 104px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; animation: pop .45s var(--spring) both; box-shadow: 0 20px 50px -10px rgba(22, 28, 40, .6); }
.ok svg path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s .15s var(--ease) forwards; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; width: max-content; max-width: 90vw; z-index: 40; animation: toastIn .3s var(--ease) both; }

@keyframes up { to { opacity: 1; transform: none; } }
@keyframes upx { to { opacity: 1; transform: none; } }
@keyframes fill { to { transform: scaleX(1); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes float { 50% { transform: translate(-20px, 20px); } }
@keyframes breathe { 50% { transform: scale(.92); opacity: .7; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; animation-delay: 0s !important; transition-duration: .01s !important; } }
