* { box-sizing:border-box }
:root { font:16px/1.5 "DM Sans","PingFang SC","Microsoft YaHei",sans-serif; color:#292e29; background:#f6f6f0 }
body { margin:0 }
main { max-width:620px; margin:auto; padding:22px 16px 40px }
header,.heading,nav,li { display:flex; align-items:center }
header { gap:11px; margin-bottom:18px }
h1,h2,p { margin:0 }
h1 { font:700 clamp(1.38rem,6vw,1.85rem)/1.3 "Songti SC",serif }
.seal { background:#983d31; color:white; width:36px; height:38px; border-radius:9px 4px; display:grid; place-items:center; font:700 24px "Songti SC",serif }
nav { gap:4px; margin-bottom:12px; padding:3px; background:#e8ebe2; border-radius:25px }
button { font:inherit; cursor:pointer }
nav button { flex:1; min-height:44px; padding:2px; border:0; border-radius:24px; background:transparent; font-weight:600; font-size:.9rem; color:#39493c }
nav button[aria-pressed=true] { background:#294b3a; color:white }
.mapbox { position:relative; height:clamp(210px,32vh,310px); border-radius:16px; overflow:hidden; border:1px solid #cfd9ce }
#preview,#map { position:absolute; inset:0 }
#preview { background-color:#e7eee6; background-image:linear-gradient(#d6e2d777 1px,transparent 1px),linear-gradient(90deg,#d6e2d777 1px,transparent 1px); background-size:24px 24px }
.caption { position:absolute; left:10px; bottom:8px; background:#fafcf8; border-radius:6px; padding:2px 7px; font-size:.78rem; color:#354d40 }
.pin,.badge { background:var(--tone); color:white; font-weight:bold; display:grid; place-items:center }
.pin { width:25px; height:25px; border-radius:50% 50% 50% 4px; border:2px solid white; box-shadow:0 1px 4px #30483366; font-size:.8rem }
#preview .pin { position:absolute; transform:translate(-50%,-100%) }
#status { font-size:.84rem; margin:8px 2px 20px; color:#526055 }
a { color:#31553e }
.heading { justify-content:space-between; margin-bottom:7px }
h2 { font:700 1.35rem "Songti SC",serif }
#count,.meta { font-size:.84rem; color:#576359 }
ul { margin:0; padding:0; list-style:none }
li { gap:12px; border-bottom:1px solid #dcded4; padding:14px 2px }
.badge { width:32px; height:32px; flex:none; border-radius:10px; font-size:.9rem }
.details { flex:1; min-width:0; overflow-wrap:anywhere }
strong { font-size:1rem }
small { color:#846138; font-size:.8rem }

main { height:100vh; height:100dvh; min-height:550px; display:flex; flex-direction:column; padding:14px 14px max(8px,env(safe-area-inset-bottom)) }
header { margin-bottom:10px }
#search,select,.location button { font:inherit; color:#294b3a; background:white; border:1px solid #ccd5c9; border-radius:10px; padding:7px 10px; min-height:44px }
#search { width:100%; margin-bottom:7px }
nav { margin-bottom:6px }
.location { display:flex; gap:8px }
.location select { flex:1; min-width:0 }
#location-status { font-size:.82rem; color:#506054; padding:3px 0 }
.mapbox { flex:1 1 220px; min-height:106px }
#status { margin:2px 0; flex:none }
.collection { display:flex; flex-direction:column; flex:0 1 28%; min-height:100px; background:#fff; border-radius:16px 16px 0 0; border:1px solid #d5dbd0; overflow:hidden }
.expanded .collection { flex-basis:58% }
.collection:has(#card:not([hidden])) { flex:0 0 auto; max-height:50% }
#drawer { display:flex; align-items:center; width:100%; gap:10px; min-height:44px; background:#fff; border:0; border-bottom:1px solid #e6e9e2; padding:10px 14px; color:#283e31; touch-action:none }
#drawer b { font:700 1.15rem "Songti SC",serif }
#action { margin-left:auto; font-size:.88rem }
#list,#card { overflow:auto; overscroll-behavior:contain }
#card:not([hidden]) + #list { display:none }
#card { padding:12px 14px; overflow-wrap:anywhere }
#card .close { float:right; min-height:44px; padding:4px 10px; background:transparent; border:0; color:#395643 }
.routes { display:flex; gap:10px; align-items:center; margin-top:6px }
.routes a { min-height:44px; display:inline-flex; align-items:center; padding:4px 12px }
.routes .primary { color:white; background:#294b3a; border-radius:10px; text-decoration:none }
li { display:block; padding:0 }
li.meta { padding:14px }
.shop { display:flex; width:100%; align-items:center; gap:12px; text-align:left; padding:10px 14px; background:transparent; border:0; color:inherit }
.shop .details>* { display:block }
.distance { font-size:.82rem; color:#395940 }
.offline-state { display:flex; align-items:center; gap:8px; color:#395940; font-size:.8rem }
.offline-state button { border:0; padding:5px 10px; border-radius:8px; background:#e8ebe2; color:#294b3a }
#manage,.search-row button,dialog button,.tools button,.tools a { font:inherit; border:1px solid #c6d2c4; background:#fbfcf9; color:#2c4837; border-radius:10px; padding:7px 11px; min-height:44px }
#manage { margin-left:auto }
.search-row,.tools,.dlg-head { display:flex; align-items:center; gap:7px }
.search-row { margin-bottom:7px }
.search-row #search { flex:1; min-width:0; margin:0 }
#due[aria-pressed=true],#shop-form button[type=submit],#add { background:#294b3a; color:white }
dialog { width:min(430px,94vw); max-height:88dvh; overflow:auto; border:1px solid #c6d2c4; border-radius:16px; padding:18px; color:#292e29 }
dialog::backdrop { background:#16281d70 }
.dlg-head { justify-content:space-between; margin-bottom:10px }
.tools { flex-wrap:wrap; margin:8px 0 }
.tools a { text-decoration:none }
#fields { display:grid; gap:9px; grid-template-columns:repeat(2,minmax(0,1fr)) }
#fields label { grid-column:span 2; display:grid; gap:3px; font-size:.88rem }
#fields label.half { grid-column:span 1 }
#fields input,#fields select,#fields textarea { width:100%; min-width:0; border:1px solid #bccbbb; border-radius:8px; padding:8px; font:inherit; font-size:1rem }
#fields input[readonly] { background:#f2f4ef }
#remove,#form-error { color:#923d32 }
#form-error,#import-result { white-space:pre-line; overflow-wrap:anywhere }
