:root {
  --g: #4a9b45; --g2: #6dbe63; --g-dark: #357a32; --bg: #e9edf0;
  --card: #ffffff; --text: #2e3039; --sub: #646f87; --muted: #9fa9be;
  --line: #e9edf0; --radius: 12px; --warn: #e6a23c; --danger: #d9534f; --ok: #4a9b45;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif; background: #dfe4e8; color: var(--text); font-size: 14px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

.page { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 78px; position: relative; }
.topbar { position: sticky; top: 0; z-index: 30; height: 52px; background: linear-gradient(135deg, var(--g2), var(--g)); color: #fff; display: flex; align-items: center; padding: 0 14px; gap: 10px; box-shadow: 0 2px 8px rgba(60,120,55,.18); }
.topbar .tt { font-size: 17px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .tb { color: #fff; font-size: 13px; opacity: .95; padding: 4px 8px; }
.topbar .back { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.topbar .back svg { width: 18px; height: 18px; fill: #fff; }
.searchbar { display: flex; align-items: center; background: rgba(255,255,255,.22); border-radius: 20px; padding: 6px 12px; flex: 1; color: #fff; }
.searchbar input { background: transparent; border: 0; outline: 0; color: #fff; width: 100%; font-size: 13px; }
.searchbar input::placeholder { color: rgba(255,255,255,.8); }

.banner { margin: 0; padding: 30px 20px 26px; background: linear-gradient(135deg, #6dbe63, #35803a); color: #fff; position: relative; overflow: hidden; }
.banner:after { content: ""; position: absolute; right: -40px; top: -40px; width: 170px; height: 170px; border-radius: 50%; background: rgba(255,255,255,.09); }
.banner h1 { font-size: 22px; margin: 0 0 8px; position: relative; z-index: 1; }
.banner p { margin: 0; font-size: 13px; opacity: .9; position: relative; z-index: 1; }

.trust-strip { display: flex; background: #fff; margin: 0; padding: 14px 8px; }
.trust-strip .ts { flex: 1; text-align: center; border-right: 1px solid var(--line); }
.trust-strip .ts:last-child { border-right: 0; }
.trust-strip .ts b { display: block; font-size: 18px; color: var(--g); }
.trust-strip .ts span { font-size: 11px; color: var(--muted); }

.card { background: var(--card); border-radius: var(--radius); margin: 12px; padding: 16px; box-shadow: 0 1px 4px rgba(40,60,50,.05); }
.card.tight { padding: 12px; }
.card h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card h2:before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--g2); }
.card .hint { font-size: 12px; color: var(--muted); margin: -6px 0 12px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 4px 0; }
.cat-item { text-align: center; }
.cat-item .ci { width: 48px; height: 48px; margin: 0 auto 6px; border-radius: 16px; background: linear-gradient(135deg,#e8f5e3,#cfe8c4); color: var(--g-dark); font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.cat-item span { font-size: 12px; color: var(--sub); }

.pcard { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 4px rgba(40,60,50,.06); }
.pcard img { width: 100%; height: 118px; object-fit: cover; background: #dfe9d8; }
.pcard .pi { padding: 9px 10px 11px; }
.pcard .pn { font-size: 13px; font-weight: 600; line-height: 1.4; height: 36px; overflow: hidden; }
.pcard .pm { font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pt { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }

.tag { display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 10px; background: #eef6ea; color: var(--g-dark); }
.tag.line { background: #fff; border: 1px solid #d8e8d2; }
.tag.warn { background: #fdf3e2; color: #b8860b; }
.tag.gray { background: #f1f3f5; color: #8892a4; }
.tag.red { background: #fdecea; color: #c0392b; }
.badge { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 12px; }
.badge.ok { background: #e8f5e3; color: #3b7d37; }
.badge.warn { background: #fdf3e2; color: #b8860b; }
.badge.bad { background: #fdecea; color: #c0392b; }
.badge.gray { background: #eef0f2; color: #7c8798; }

.kv { display: flex; justify-content: space-between; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { font-size: 14px; font-weight: 600; color: var(--sub); flex: 0 0 88px; }
.kv .v { font-size: 13px; color: var(--muted); flex: 1; text-align: right; word-break: break-all; }
.kv .ic { width: 26px; height: 26px; border-radius: 8px; background: #f2f6f0; margin-left: 10px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--g); flex: 0 0 26px; }

.hscroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: 0 0 auto; }
.thumb { width: 96px; height: 128px; border-radius: 8px; overflow: hidden; background: #f2f5f1; border: 1px solid #e6ece2; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .tc { font-size: 10px; color: var(--muted); text-align: center; padding: 4px; }

.doc-card { width: 150px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.doc-card .dc-img { height: 100px; background: #f7f4e9; overflow: hidden; }
.doc-card .dc-img img { width: 100%; height: 100%; object-fit: cover; }
.doc-card .dc-b { padding: 8px; }
.doc-card .dc-t { font-size: 12px; font-weight: 600; height: 32px; overflow: hidden; }
.doc-card .dc-m { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.timeline { position: relative; padding-left: 26px; }
.timeline .step { position: relative; padding-bottom: 18px; }
.timeline .step:last-child { padding-bottom: 0; }
.timeline .step:before { content: ""; position: absolute; left: -26px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--g2); border: 3px solid #e8f5e3; z-index: 1; }
.timeline .step:after { content: ""; position: absolute; left: -20px; top: 18px; bottom: -4px; width: 2px; background: #e0e8dc; }
.timeline .step:last-child:after { display: none; }
.timeline .st-t { font-size: 14px; font-weight: 600; }
.timeline .st-d { font-size: 11px; color: var(--muted); }
.timeline .st-x { font-size: 12px; color: var(--sub); margin-top: 3px; }
.timeline img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; margin-top: 8px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs .tab { flex: 1; text-align: center; padding: 9px 0; font-size: 13px; color: var(--muted); position: relative; cursor: pointer; }
.tabs .tab.on { color: var(--g); font-weight: 600; }
.tabs .tab.on:after { content: ""; position: absolute; bottom: -1px; left: 25%; right: 25%; height: 2px; background: var(--g); }
.stat-row { display: flex; gap: 10px; }
.stat-box { flex: 1; background: #f7faf5; border-radius: 10px; padding: 12px; text-align: center; }
.stat-box b { display: block; font-size: 20px; color: var(--g-dark); }
.stat-box span { font-size: 11px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 22px; padding: 10px 18px; font-size: 14px; cursor: pointer; background: #eef2ee; color: var(--sub); }
.btn-primary { background: linear-gradient(135deg, var(--g2), var(--g)); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid #d8e4d2; color: var(--g-dark); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actionbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 35; background: #fff; border-top: 1px solid var(--line); padding: 9px 12px; display: flex; gap: 8px; align-items: center; box-shadow: 0 -2px 10px rgba(0,0,0,.05); }
.actionbar .ab-side { display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--muted); min-width: 46px; cursor: pointer; }
.actionbar .ab-side .abi { width: 22px; height: 22px; border-radius: 50%; background: #eef6ea; color: var(--g); display: flex; align-items: center; justify-content: center; font-size: 11px; margin-bottom: 2px; }
.actionbar .btn-primary { flex: 1; }
.actionbar.no-cta .ab-side { flex: 1; }

.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 58px; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 30; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10px; color: var(--muted); }
.tabbar a.on { color: var(--g); font-weight: 600; }
.tabbar .ti { width: 20px; height: 20px; border-radius: 6px; background: #eef2ee; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.tabbar a.on .ti { background: #e3f2dd; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 5px; font-weight: 600; }
.field label i { color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #dde4dc; border-radius: 9px; padding: 10px 11px; outline: 0; background: #fff; color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--g2); }
.field textarea { min-height: 76px; resize: vertical; }
.field .tip { font-size: 11px; color: var(--muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.notice { background: #f0f7ed; border-left: 3px solid var(--g2); padding: 10px 12px; border-radius: 6px; font-size: 12px; color: var(--sub); margin-bottom: 12px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 13px; }

.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; max-height: 88vh; overflow-y: auto; padding: 18px; }
.modal.wide { max-width: 720px; border-radius: 14px; margin: auto; }
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .mclose { float: right; color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 100; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 6px; }
.lightbox .lb-t { color: #fff; font-size: 12px; margin-top: 12px; opacity: .8; }
.watermark-layer { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; color: rgba(192,57,43,.28); font-size: 20px; font-weight: 700; transform: rotate(-24deg); }
.preview-wrap { position: relative; border-radius: 8px; overflow: hidden; background: #f7f4e9; }
.preview-wrap img { width: 100%; max-height: 340px; object-fit: contain; }
.pg-count { font-size: 12px; color: var(--sub); margin: 0 0 8px; }
.pg-nav { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.pg-nav button { border: 0; border-radius: 14px; padding: 4px 12px; font-size: 12px; background: rgba(255,255,255,.9); color: #333; cursor: pointer; }
.pg-nav span { color: #fff; font-size: 12px; font-weight: 700; }
.pg-thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 4px; }
.pg-thumb { position: relative; flex: 0 0 56px; height: 56px; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: #f4f6f2; }
.pg-thumb.on { border-color: var(--g); }
.pg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pg-thumb span { position: absolute; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; padding: 0 4px; border-radius: 4px 0 0 0; }

#toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: rgba(30,40,30,.9); color: #fff; padding: 9px 16px; border-radius: 20px; font-size: 13px; z-index: 200; max-width: 80%; text-align: center; }
.result-ok { border: 1px solid #cfe8c4; background: #f3faf0; border-radius: 12px; padding: 16px; }
.result-bad { border: 1px solid #f3d2ce; background: #fdf4f3; border-radius: 12px; padding: 16px; }
.result-h { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.result-ok .result-h { color: #3b7d37; }
.result-bad .result-h { color: #c0392b; }
.qr-box { display: flex; gap: 14px; align-items: center; }
.qr-box img { width: 108px; height: 108px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qr-box .qc { flex: 1; font-size: 12px; color: var(--sub); }
.qr-box .qc b { display: block; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.link { color: var(--g); cursor: pointer; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--muted); font-size: 12px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb8 { margin-bottom: 8px; }
