:root {
  --bg: #FBF7F2; --card: #fff; --ink: #2b2118; --sub: #6f6358; --line: #ece4da;
  --danger: #E5372A; --warn: #C46A00; --ok: #1E8E3E; --unknown: #6B5FA8; --due: #B25E00;
  --radius: 20px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 18px/1.5 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif; }
button { font: inherit; }
.wrap { max-width: 560px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.top h1 { font-size: 26px; margin: 0; letter-spacing: .5px; }
.top .when { color: var(--sub); font-size: 16px; }

/* 一句话总结 */
.hero { background: var(--card); border-radius: var(--radius); padding: 18px 18px 16px; display: flex; gap: 14px; align-items: center; box-shadow: 0 1px 0 var(--line); }
.hero .big { font-size: 24px; font-weight: 800; line-height: 1.3; }
.hero .small { color: var(--sub); font-size: 16px; margin-top: 4px; }
.counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 20px; }
.count { background: var(--card); border-radius: 16px; padding: 10px 6px; text-align: center; box-shadow: 0 1px 0 var(--line); }
.count b { display: block; font-size: 26px; line-height: 1.1; }
.count span { font-size: 14px; color: var(--sub); }
.c-danger b { color: var(--danger); } .c-due b { color: var(--due); } .c-warn b { color: var(--warn); } .c-ok b { color: var(--ok); }

/* 店铺列表 */
.list { display: flex; flex-direction: column; gap: 10px; }
.shop { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--radius); padding: 12px 14px; border: 0; text-align: left; width: 100%; color: inherit; box-shadow: 0 1px 0 var(--line); cursor: pointer; }
.shop .name { font-size: 20px; font-weight: 700; }
.shop .line { font-size: 16px; color: var(--sub); }
.shop .tag { margin-left: auto; font-size: 16px; font-weight: 700; white-space: nowrap; }
.shop.s-danger { box-shadow: inset 0 0 0 3px var(--danger); }
.t-danger { color: var(--danger); } .t-warn { color: var(--warn); } .t-ok { color: var(--ok); } .t-unknown { color: var(--unknown); }
.t-due { color: var(--due); } .t-waiting { color: var(--sub); } .t-handled { color: var(--ok); }
.section { font-size: 15px; color: var(--sub); margin: 18px 4px 8px; }

/* 详情 */
.sheet-bg { position: fixed; inset: 0; background: rgba(30,20,10,.35); display: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; transform: translateY(105%); transition: transform .22s ease, visibility .22s; visibility: hidden; }
.open .sheet-bg { display: block; } .open .sheet { transform: none; visibility: visible; }
.sheet h2 { margin: 0 0 4px; font-size: 24px; }
.sheet img { width: 100%; border-radius: 16px; margin: 12px 0; display: block; background: #eee; }
.finding { background: var(--card); border-radius: 14px; padding: 10px 12px; margin: 8px 0; font-size: 18px; }
.finding small { color: var(--sub); font-size: 15px; margin-left: 6px; }
.btn { display: block; width: 100%; border: 0; border-radius: 16px; padding: 16px; font-size: 20px; font-weight: 700; background: var(--ink); color: #fff; margin-top: 14px; cursor: pointer; }
.btn.light { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn:disabled { opacity: .5; }
.muted { color: var(--sub); font-size: 15px; }
.foot { margin-top: 28px; text-align: center; }
.foot a, .foot button { color: var(--sub); font-size: 15px; background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 6px; }
.links a { display: block; background: var(--card); border-radius: 14px; padding: 12px 14px; margin: 8px 0; color: var(--ink); text-decoration: none; font-weight: 600; }

/* 拍照端 */
.center { text-align: center; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 24px 0 8px; }
.stage .big { font-size: 26px; font-weight: 800; line-height: 1.3; }
.stage .small { color: var(--sub); }
.preview { width: 100%; border-radius: 18px; margin-top: 14px; display: none; }
.good { color: var(--ok); font-size: 18px; margin: 4px 0; }
.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: 16px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.m-thinking { animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .m-thinking { animation: none; } .sheet { transition: none; } }
