:root {
  --bg: #FFF8F2;
  --surface: #FFFFFF;
  --pink: #E0728E;
  --pink-strong: #C93A62;
  --pink-soft: #FBE3EA;
  --text: #2B2230;
  --muted: #554A58;
  --line: #EADCDF;
  --s-not_yet: #8E8794;
  --s-soon: #E99AB0;
  --s-peak: #C93A62;
  --s-past: #9A7457;
  --s-unknown: #B9B1BD;
  --tabbar-h: 60px;
  --radius: 14px;
  --content-w: 640px;
  --side-w: 220px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.pages { flex: 1; min-height: 0; display: flex; }
.page { flex: 1; min-height: 0; min-width: 0; }
.placeholder { padding: 24px; }
.placeholder p { color: var(--muted); }

/* ---------- 地图页 ---------- */
.map-page { display: flex; flex-direction: column; }
.map-header { padding: calc(10px + env(safe-area-inset-top)) 14px 6px; background: var(--bg); border-bottom: 1px solid var(--line); }
.search-row { display: flex; gap: 8px; }
#search { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
#search:focus { outline: 2px solid var(--pink); outline-offset: 1px; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 0 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--pink); color: #fff; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--pink-soft); border-color: var(--pink); color: var(--pink-strong); font-weight: 600; }
.chip:disabled { opacity: .45; cursor: not-allowed; }
select.chip { max-width: 180px; }

.date-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; font-size: 14px; }
.date-label span { color: var(--muted); }
.link-btn { border: 0; background: none; color: var(--pink-strong); cursor: pointer; padding: 4px 0; }
.link-btn:disabled { color: var(--muted); opacity: .5; cursor: default; }
#date-slider { width: 100%; accent-color: var(--pink); margin: 4px 0 0; }
.note { margin: 4px 0 0; font-size: 13px; color: var(--pink-strong); }
.count { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

.map-wrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; }
.fab { position: absolute; right: 10px; top: 86px; width: 30px; height: 30px; border-radius: 4px; border: 0; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.1); cursor: pointer; font-size: 17px; line-height: 1; }
.legend { position: absolute; left: 8px; top: 8px; right: 52px; display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 6px 10px; background: rgba(255,255,255,.92); border-radius: 10px; font-size: 12px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 4px; }
.legend-sep { margin-left: 4px; }
.map-error { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 3; background: var(--surface); padding: 12px 14px; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.12); font-size: 14px; }
.map-error p { margin: 0 0 10px; }
.map-error .card-actions { margin: 0; }
.loading { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); background: #fff; padding: 10px 16px; border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.12); font-size: 14px; }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--c, var(--s-unknown)); flex: none; }
.dot.solid { background: var(--c, var(--s-unknown)); }
.dot.hollow { background: #fff; }
.s-not_yet { --c: var(--s-not_yet); }
.s-soon { --c: var(--s-soon); }
.s-peak { --c: var(--s-peak); }
.s-past { --c: var(--s-past); }
.s-opening { --c: var(--s-soon); }
.s-falling { --c: var(--s-past); }
.s-unknown { --c: var(--s-unknown); }

.user-dot { width: 16px; height: 16px; border-radius: 50%; background: #3B82F6; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(59,130,246,.35); }

/* 底部卡片 */
.card { position: absolute; left: 10px; right: 10px; bottom: 10px; max-width: 520px; margin: 0 auto; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 6px 24px rgba(43,34,48,.18); }
.card-close { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 24px; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.card-title { margin: 0 28px 4px 0; font-size: 17px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-addr { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
.source { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.src-inferred { color: var(--muted); }
.forecast { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-size: 14px; text-decoration: none; cursor: pointer; }
a.btn { color: var(--text); }
.btn.primary { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: 600; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 列表 */
.list-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 14px 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.list-item { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 12px 2px; cursor: pointer; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li-title { font-weight: 600; }
.li-sub { font-size: 13px; color: var(--muted); }
.li-dist { font-size: 13px; color: var(--muted); white-space: nowrap; }
.empty { padding: 24px 0; text-align: center; color: var(--muted); }

.updated { margin: 0; padding: 4px 14px; font-size: 11px; color: var(--muted); background: var(--bg); border-top: 1px solid var(--line); }

/* 底部导航 */
.tabbar { display: flex; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tabbar button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); cursor: pointer; }
.tabbar .ti { font-size: 19px; line-height: 1; }
.tabbar button[aria-current="true"] { color: var(--pink-strong); font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px); transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 10; max-width: 90vw; }

/* ======================= 通用页面 ======================= */
.page-view { overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg); }
.page-body { padding: 12px 14px 96px; max-width: var(--content-w); margin: 0 auto; }
.page-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; padding: calc(10px + env(safe-area-inset-top)) 10px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0; font-size: 18px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }
.back { border: 0; background: none; font-size: 30px; line-height: 1; padding: 0 8px 4px; color: var(--text); cursor: pointer; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 12px; box-shadow: 0 1px 0 var(--line); }
.panel h2 { margin: 0 0 8px; font-size: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sub { font-size: 14px; margin: 14px 0 6px; color: var(--muted); }
.btn.block { display: block; width: 100%; text-align: center; margin-top: 10px; }
.btn.on { background: var(--pink-soft); border-color: var(--pink); color: var(--pink-strong); }
.link-btn { text-decoration: none; font-size: 14px; }
.link-btn.danger { color: #A3324F; margin-top: 8px; }
.footnote { font-size: 12px; color: var(--muted); text-align: center; margin: 16px 0 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--pink-soft); color: var(--text); }
.tag-plain { background: #F3EEF0; color: var(--muted); }
.tag-warn { background: #FFF1D6; color: #7A5200; }
.s-unsure { --c: #8E8794; }
.empty { padding: 24px 0; text-align: center; color: var(--muted); list-style: none; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; margin: 0 0 8px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.note-panel { background: var(--pink-soft); }
.seg.wide { margin-bottom: 10px; }
.seg.wide button { flex: 1; padding: 8px 0; }

/* ======================= 首页 ======================= */
.home-hero { padding: calc(18px + env(safe-area-inset-top)) 16px 6px; max-width: var(--content-w); margin: 0 auto; }
.home-hero h1 { margin: 0; font-size: 24px; color: var(--pink-strong); }
.home-hero p { margin: 4px 0 0; }
.brief-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 10px; }
.brief-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--bg); border-radius: 10px; padding: 8px 4px; }
.brief-num { font-size: 22px; font-weight: 700; }
.brief-label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.brief-line { margin: 0 0 6px; line-height: 1.6; }
.basis { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.pick-list { list-style: none; margin: 4px 0 0; padding: 0; }
.pick { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; text-decoration: none; color: var(--text); cursor: pointer; }
.pick-list li:last-child .pick { border-bottom: 0; }
.shortcuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.shortcuts a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; background: var(--surface); border-radius: var(--radius); text-decoration: none; color: var(--text); font-size: 13px; box-shadow: 0 1px 0 var(--line); }
.sc-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--pink-soft); color: var(--pink-strong); display: grid; place-items: center; font-size: 19px; }
.event-mini { list-style: none; margin: 0; padding: 0; }
.event-mini a { display: flex; flex-direction: column; padding: 8px 0; color: var(--text); text-decoration: none; }
.remind { border: 1px solid var(--pink); }
.remind ul { margin: 0; padding-left: 18px; line-height: 1.7; }

/* ======================= 详情页 ======================= */
.photos { margin: 0 0 12px; }
.photo-strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
.photo-strip figure { margin: 0; flex: 0 0 85%; scroll-snap-align: start; }
.photo-strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--pink-soft); display: block; }
.photo-strip figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.photo-empty { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 12px 16px; }
.photo-empty p { margin: 0; }
.progress { margin: 10px 0 6px; }
.progress-track { height: 10px; background: #F3EEF0; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--c); border-radius: 999px; }
.progress-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; gap: 6px; }
.cv-list { list-style: none; margin: 0; padding: 0; }
.cv-row { display: flex; gap: 10px; align-items: flex-start; }
.cv-row p { margin: 4px 0 0; }
.cv-row .tag { margin-left: 4px; }
.report-list { list-style: none; margin: 0; padding: 0; }
.report-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.report-list p { margin: 4px 0 0; font-size: 14px; }
.action-bar { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 14px; background: rgba(255,248,242,.96); border-top: 1px solid var(--line); max-width: var(--content-w); margin: -84px auto 0; }
.action-bar .btn { flex: 1; text-align: center; }

/* ======================= 上报页 ======================= */
.step h2 { display: flex; align-items: center; gap: 8px; }
.step-no { width: 22px; height: 22px; border-radius: 50%; background: var(--pink); color: #fff; font-size: 13px; display: grid; place-items: center; flex: none; }
.step.disabled { opacity: .5; pointer-events: none; }
.req { font-size: 12px; color: #fff; background: var(--pink-strong); border-radius: 4px; padding: 1px 6px; font-weight: 600; }
.tree-confirm { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.tree-confirm p { margin: 4px 0 0; }
.tree-confirm .link-btn { white-space: nowrap; }
#tree-search { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.photo-pick { display: grid; place-items: center; min-height: 120px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); cursor: pointer; overflow: hidden; background: var(--bg); }
.photo-pick img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.status-options { display: grid; grid-template-columns: 1fr; gap: 8px; }
.status-opt { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.status-opt svg { grid-row: 1 / 3; }
.so-label { font-weight: 700; font-size: 15px; }
.so-hint { font-size: 12px; color: var(--muted); }
.status-opt.selected { border-color: var(--pink-strong); background: var(--pink-soft); }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); resize: vertical; }
#submit:disabled { background: #D9CFD4; border-color: #D9CFD4; color: #fff; opacity: 1; }

/* ======================= 图鉴 ======================= */
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid; margin-right: 4px; vertical-align: -1px; }
.calendar { padding-top: 10px; }
.cal-axis { position: relative; height: 18px; margin-left: 88px; font-size: 12px; color: var(--muted); }
.cal-axis span { position: absolute; transform: translateX(-2px); }
.cal-rows { list-style: none; margin: 0; padding: 0; }
.cal-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; text-decoration: none; color: var(--text); }
.cal-name { width: 80px; flex: none; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-track { position: relative; flex: 1; height: 14px; }
.cal-grid { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.cal-today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--pink-strong); z-index: 1; }
.cal-today-key { display: inline-block; width: 2px; height: 10px; background: var(--pink-strong); margin-right: 4px; }
.cal-bar { position: absolute; top: 1px; bottom: 1px; border: 1.5px solid; border-radius: 999px; }
.cv-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cv-card { display: flex; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 1px 0 var(--line); transition: box-shadow .3s; }
.cv-card.flash { box-shadow: 0 0 0 3px var(--pink); }
.cv-art { width: 64px; height: 64px; flex: none; background: var(--bg); border-radius: 12px; display: grid; place-items: center; }
.cv-body h3 { margin: 0 0 2px; font-size: 16px; }
.cv-body p { margin: 2px 0; }
.cv-meta { font-size: 13px; color: var(--pink-strong); }

/* ======================= 路线 ======================= */
.route-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.route-card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 0 var(--line); overflow: hidden; }
.route-head { width: 100%; text-align: left; border: 0; background: none; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.route-title { font-weight: 700; font-size: 16px; }
.route-meta { font-size: 13px; color: var(--muted); }
.route-card.open .route-head { border-bottom: 1px solid var(--line); }
.route-body { padding: 12px 14px 14px; }
.route-diagram { margin: 0 0 10px; }
.diagram-svg { width: 100%; height: auto; display: block; }
.stop-list { list-style: none; margin: 0 0 10px; padding: 0; counter-reset: stop; }
.stop-list li a { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.stop-list li a::before { counter-increment: stop; content: counter(stop); width: 20px; height: 20px; border-radius: 50%; background: var(--pink-soft); color: var(--pink-strong); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }

/* ======================= 活动 ======================= */
.date-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.ds-day { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 6px 10px; display: flex; flex-direction: column; align-items: center; font-size: 12px; cursor: pointer; }
.ds-day[aria-pressed="true"] { background: var(--pink); color: #fff; border-color: var(--pink); }
.event-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.event-card { background: var(--surface); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 1px 0 var(--line); }
.event-card h3 { margin: 8px 0 4px; font-size: 16px; }
.event-card p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.ev-top { display: flex; gap: 6px; flex-wrap: wrap; }

/* ======================= 我的 ======================= */
.pp-count { font-size: 14px; color: var(--muted); }
.pp-count strong { font-size: 22px; color: var(--pink-strong); }
.milestones { list-style: none; margin: 10px 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.milestones li { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; background: var(--bg); font-size: 13px; }
.milestones li > span:last-child { display: flex; flex-direction: column; }
.ms-badge { width: 30px; height: 30px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; flex: none; color: var(--muted); font-weight: 700; }
.milestones li.done .ms-badge { border: 0; background: var(--pink-strong); color: #fff; }
.stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stamp { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px; }
.stamp.got { border: 2px solid var(--pink-strong); background: var(--pink-soft); transform: rotate(-6deg); }
.stamp-mark { font-size: 20px; color: var(--pink-strong); height: 22px; }
.stamp-name { font-size: 11px; font-weight: 600; line-height: 1.25; }
.stamp-date { font-size: 10px; color: var(--muted); }
.row-toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row-toggle > span { display: flex; flex-direction: column; gap: 2px; }
.row-toggle input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--pink-strong); flex: none; }
.row-toggle select { border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; background: var(--surface); }

/* 演示模式横幅 */
.demo-bar { flex: none; background: #3B2E3F; color: #fff; font-size: 12px; line-height: 1.4; padding: 6px 12px; padding-top: calc(6px + env(safe-area-inset-top)); }
.demo-bar a { color: #FBD3DF; margin-left: 6px; font-weight: 600; }

/* ---------- 多语言、v4 新增 ---------- */
:root:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif; }
:root:lang(en) { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif; }

/* 语言切换 */
.lang-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.lang-switch button { border: 1px solid rgba(255,255,255,.45); background: transparent; color: inherit; border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; min-height: 28px; }
.lang-switch button[aria-pressed="true"] { background: #fff; color: #3B2E3F; font-weight: 700; }
.lang-switch.big button { border-color: var(--line); padding: 6px 12px; font-size: 14px; min-height: 36px; }
.lang-switch.big button[aria-pressed="true"] { background: var(--pink-soft); border-color: var(--pink); color: var(--pink-strong); }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.lang-row { flex-wrap: wrap; }

/* 头部：首页右上角搜索 + 头像；二级页右侧头像 */
.home-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hero-actions { display: flex; gap: 8px; flex: none; }
.me-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-strong); text-decoration: none; flex: none; }
.me-btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.page-head .me-btn { margin-left: auto; width: 38px; height: 38px; }

/* 地图三种模式 */
.mode-seg { margin: 8px 0 0; }
.mode-seg button { padding: 6px 0; }
.line-key { display: inline-block; width: 20px; height: 5px; border-radius: 3px; flex: none; background: var(--c, var(--s-unknown)); }
.line-key.dashed { background: repeating-linear-gradient(90deg, var(--c, var(--s-unknown)) 0 6px, #fff 6px 9px); box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.area-key { display: inline-block; width: 14px; height: 12px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.legend-title { width: 100%; font-weight: 600; color: var(--text); }
.list-item .line-key, .list-item .area-key { margin-top: 4px; }
.source .line-key, .source .area-key { margin-right: 6px; vertical-align: middle; }
#hood-chip { background: var(--pink-soft); border-color: var(--pink); color: var(--pink-strong); }

/* 我的 */
.stamps.latin .stamp-name { font-size: 9.5px; word-break: break-word; hyphens: auto; }
.extra-stamps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.extra-stamps li { display: flex; align-items: center; gap: 10px; }
.extra-stamps li > span:last-child { display: flex; flex-direction: column; }
.extra-stamps .stamp-mark { width: 40px; height: 40px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; flex: none; }
.extra-stamps li.got .stamp-mark { border: 2px solid var(--pink-strong); background: var(--pink-soft); transform: rotate(-6deg); }
.me-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.me-counts div { display: flex; flex-direction: column; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--bg); }
.me-counts strong { font-size: 22px; color: var(--pink-strong); }

/* 樱花知识 */
.kicker { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--pink-strong); margin: 0 0 4px; }
.feature-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; margin: 12px 0; border-radius: var(--radius); background: var(--pink-soft); color: var(--text); text-decoration: none; }
.feature-card strong { font-size: 18px; }
.feature-art { display: flex; gap: 6px; }
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.topic-grid a { display: flex; flex-direction: column; gap: 2px; padding: 12px; min-height: 64px; border-radius: 12px; background: var(--surface); box-shadow: 0 1px 0 var(--line); color: var(--text); text-decoration: none; }
.stages dt { display: flex; align-items: center; gap: 6px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--pink-soft); display: grid; gap: 10px; }
.timeline li { display: flex; flex-direction: column; gap: 2px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); }
.tl-year { font-weight: 700; color: var(--pink-strong); }
.numbered { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.quiz { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.quiz p { margin: 0 0 6px; }
.quiz-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.right, .quick-opt.right { border: 2px solid #2F6B4F; background: #E3F0E8; color: #1F4D37; opacity: 1; }
.chip.wrong, .quick-opt.wrong { border: 2px solid var(--pink-strong); background: var(--pink-soft); color: #8F2445; opacity: 1; }
.ok { color: #1F4D37; }
.bad { color: #8F2445; }
.quiz-score { display: flex; align-items: center; gap: 12px; margin: 12px 0 0; }
.article-title { margin: 0 0 8px; font-size: 22px; }
.checks { list-style: none; margin: 12px 0; padding: 0; }
.checks h3 { margin: 0 0 8px; font-size: 16px; display: flex; align-items: center; }
.compare { display: flex; gap: 12px; }
.compare figure { margin: 0; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 12px; background: var(--bg); font-size: 13px; }
.quick-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.quick-opt { min-height: 96px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }

/* 逐站导览 */
.go-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.go-steps li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface); }
.go-steps .li-sub { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.go-no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; border: 2px solid var(--pink); color: var(--pink-strong); flex: none; }
.go-done { opacity: .65; }
.go-done .go-no { background: var(--pink); color: #fff; }
.go-cur { box-shadow: 0 0 0 2px var(--text); }
.go-st { margin-left: auto; font-size: 12px; color: var(--muted); flex: none; }
.go-leg h2 { font-size: 16px; }
.action-bar { gap: 6px; padding: 10px 10px; }
.action-bar .btn { padding: 8px 4px; font-size: 13px; white-space: nowrap; }
:root:lang(ja) .cal-name, :root:lang(en) .cal-name { width: 104px; font-size: 12px; }


/* ======================= 自适应：手机 / 平板 / 电脑 ======================= */
/* 手机（<600px）就是上面的默认样式。下面只在更宽的屏幕上覆盖。 */
.nav-brand, .tab-wide { display: none !important; }

/* 平板与小窗口（≥600px）：保留底部导航，内容变宽，卡片两列 */
@media (min-width: 600px) {
  :root { --content-w: 760px; }
  .page-body { padding-left: 20px; padding-right: 20px; }
  .home-hero { padding-left: 20px; padding-right: 20px; }
  .map-header { padding-left: 20px; padding-right: 20px; }
  .tabbar button { flex-direction: row; gap: 6px; font-size: 14px; }
  .route-list, .event-list, .cv-cards { grid-template-columns: 1fr 1fr; align-items: start; }
  .status-options { grid-template-columns: 1fr 1fr; }
  .photo-strip figure { flex-basis: 48%; }
  .stamps { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
  .milestones { grid-template-columns: repeat(4, 1fr); }
  .topic-grid { grid-template-columns: repeat(4, 1fr); }
  .facts { grid-template-columns: 110px 1fr; }
  .cal-name, :root:lang(ja) .cal-name, :root:lang(en) .cal-name { width: 140px; font-size: 13px; }
  .cal-axis { margin-left: 148px; }
  .card { left: 16px; right: auto; bottom: 16px; width: 400px; margin: 0; }
  .legend { right: auto; max-width: 560px; }
  .toast { max-width: 520px; }
}

/* 电脑（≥1024px）：左侧栏导航；地图页左边筛选 + 列表、右边地图 */
@media (min-width: 1024px) {
  :root { --content-w: 880px; --tabbar-h: 0px; }
  body {
    display: grid;
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "demo demo" "nav main";
  }
  .demo-bar { grid-area: demo; }
  .pages { grid-area: main; }
  body:not(.is-demo) { grid-template-rows: minmax(0, 1fr); grid-template-areas: "nav main"; }

  .tabbar {
    grid-area: nav; flex-direction: column; height: auto; padding: 16px 12px; gap: 4px;
    border-top: 0; border-right: 1px solid var(--line); overflow-y: auto;
  }
  .nav-brand { display: flex !important; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--pink-strong); font-weight: 700; font-size: 15px; line-height: 1.3; text-decoration: none; }
  .nav-brand img { flex: none; }
  .tab-wide { display: flex !important; margin-top: auto; }
  .tabbar button { flex: none; justify-content: flex-start; gap: 12px; padding: 10px 14px; border-radius: 10px; font-size: 15px; min-height: 44px; }
  .tabbar .ti { width: 22px; text-align: center; }
  .tabbar button[aria-current="true"] { background: var(--pink-soft); }
  /* 侧栏里已有“我的”，页面右上角的头像就不重复了 */
  .hero-actions .me-btn:not(.ghost), .page-head .me-btn:not(.ghost) { display: none; }

  /* 地图页：两栏 */
  .map-page {
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "head map" "list map" "upd map";
  }
  .map-header { grid-area: head; padding: 16px 20px 8px; border-right: 1px solid var(--line); }
  .map-header .search-row .seg { display: none; } /* 宽屏地图和列表同时显示，不用切换 */
  .chips { flex-wrap: wrap; overflow: visible; }
  .list-wrap { grid-area: list; border-right: 1px solid var(--line); border-top: 1px solid var(--line); padding: 8px 20px 16px; }
  .updated { grid-area: upd; border-right: 1px solid var(--line); padding: 6px 20px; }
  .map-wrap { grid-area: map; }
  .list-item { padding: 10px 8px; border-radius: 10px; }
  .list-item.sel { background: var(--pink-soft); border-bottom-color: transparent; }
  .card { left: 20px; bottom: 20px; width: 420px; }
  .fab { right: 10px; }

  .page-head { padding: 14px 24px; }
  .page-body { padding: 16px 24px 96px; }
  .home-hero { padding: 28px 24px 8px; }
  .home-hero h1 { font-size: 30px; }
  .route-list, .event-list, .cv-cards { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .quick-opts { grid-template-columns: repeat(4, 1fr); }
  .toast { bottom: 24px; left: calc(50% + var(--side-w) / 2); }
}

/* 大屏（≥1440px）：地图侧栏和内容再放宽一点 */
@media (min-width: 1440px) {
  :root { --content-w: 960px; --side-w: 240px; }
  .map-page { grid-template-columns: 440px minmax(0, 1fr); }
}

/* 鼠标设备：悬停反馈（触屏不加，避免点完一直高亮） */
@media (hover: hover) and (pointer: fine) {
  .tabbar button:hover, .list-item:hover, .pick:hover { background: var(--pink-soft); }
  .btn:hover:not(:disabled) { border-color: var(--pink); }
  .btn.primary:hover:not(:disabled) { background: var(--pink-strong); border-color: var(--pink-strong); }
  .chip:hover:not(:disabled), .ds-day:hover { border-color: var(--pink); }
  .shortcuts a:hover, .topic-grid a:hover, .route-card:hover, .event-card:hover, .cv-card:hover { box-shadow: 0 0 0 1px var(--pink), 0 4px 14px rgba(43,34,48,.08); }
  .link-btn:hover { text-decoration: underline; }
}

/* 横屏手机（矮屏）：地图头部压缩，给地图留空间 */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1023px) {
  :root { --tabbar-h: 48px; }
  .tabbar .ti { font-size: 16px; }
  .map-header { padding-top: calc(6px + env(safe-area-inset-top)); }
  .map-header .chips { padding-top: 6px; }
  .date-row { margin-top: 2px; }
}

/* ---------- 账号与提醒（邮箱登录、关注、花况提醒） ---------- */
.follow-slot { display: contents; }
.follow-btn { white-space: nowrap; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.account-actions .link-btn { margin-left: auto; }
.consent-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.consent-row input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--pink-strong); }
.follow-list { list-style: none; margin: 0; padding: 0; }
.follow-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.follow-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.follow-notify { display: flex; align-items: center; gap: 4px; }
.follow-notify input { width: 18px; height: 18px; accent-color: var(--pink-strong); }
.radius-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; }
.addr-form label, .sheet label { display: block; font-weight: 600; margin-top: 10px; }
.addr-form input, .sheet input { display: block; width: 100%; min-height: 44px; margin-top: 6px; padding: 0 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.addr-results { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.addr-pick { text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); line-height: 1.4; cursor: pointer; }
.addr-pick:hover { border-color: var(--pink); }
.sheet-wrap { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: rgba(43, 34, 48, .4); }
.sheet { width: 100%; max-width: 480px; background: var(--surface); border-radius: 18px 18px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); max-height: 90vh; overflow-y: auto; }
.sheet h2 { margin: 0 0 6px; font-size: 18px; }
.sheet .code-input { letter-spacing: .4em; font-size: 22px; text-align: center; }
.sheet-err { color: var(--pink-strong); font-size: 14px; min-height: 1.2em; margin: 8px 0 0; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 14px; }
@media (min-width: 600px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 18px; } }
