:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-2: #f0f2ee;
  --ink: #17201d;
  --muted: #68726d;
  --line: #dfe4df;
  --green: #17785d;
  --green-2: #32a87f;
  --green-soft: #dcefe7;
  --coral: #ee765c;
  --amber: #dba83f;
  --danger: #bd433b;
  --shadow: 0 18px 50px rgba(29, 47, 40, .12);
  --sidebar: 232px;
}

* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; color: var(--ink); background: var(--bg); font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button, select { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(480px, 1.1fr); background: var(--surface); }
.auth-story { position: relative; min-height: 100vh; padding: clamp(32px, 5vw, 72px); overflow: hidden; display: flex; flex-direction: column; color: white; background: linear-gradient(145deg, #123d31 0%, #17785d 57%, #2a9a75 100%); }
.auth-story::before, .auth-story::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.auth-story::before { width: 620px; height: 620px; right: -330px; top: -230px; }
.auth-story::after { width: 430px; height: 430px; left: -270px; bottom: -210px; }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark span { box-shadow: 0 4px 12px rgba(0,0,0,.16); }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 18px; }
.auth-brand small { margin-top: 2px; color: rgba(255,255,255,.67); font-size: 9px; font-weight: 700; }
.auth-story-copy { position: relative; z-index: 1; margin: auto 0; max-width: 560px; }
.auth-story-copy .eyebrow { color: #a9e1ca; }
.auth-story-copy h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(38px, 5vw, 66px); font-weight: 500; line-height: 1.2; letter-spacing: -.03em; }
.auth-story-copy > p:last-child { max-width: 480px; margin: 24px 0 0; color: rgba(255,255,255,.7); font-family: Georgia, "Songti SC", serif; font-size: 14px; line-height: 2; }
.auth-security { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.68); font-size: 10px; }
.auth-security i { width: 7px; height: 7px; border: 1px solid rgba(255,255,255,.7); border-radius: 50%; background: #79ddb5; box-shadow: 0 0 0 4px rgba(121,221,181,.13); }
.auth-panel { min-height: 100vh; padding: 40px; display: grid; place-items: center; background: #f7f8f5; }
.auth-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 24px 70px rgba(29,47,40,.1); }
.auth-card-head h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 30px; font-weight: 500; }
.auth-card-head > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.auth-tabs { margin: 27px 0 22px; padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: 7px; background: var(--surface-2); }
.auth-tabs button { height: 36px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 700; }
.auth-tabs button.active { color: var(--green); background: white; box-shadow: 0 2px 8px rgba(31,48,40,.08); }
.auth-form { display: grid; gap: 16px; }
.auth-form .auth-submit { width: 100%; min-height: 43px; margin-top: 4px; }
.auth-message { min-height: 17px; margin: 15px 0 0; color: var(--danger); text-align: center; font-size: 10px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; width: var(--sidebar); padding: 26px 18px 20px; display: flex; flex-direction: column; background: #fbfcfa; border-right: 1px solid var(--line); }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 28px; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; margin-top: 2px; color: #84908a; font-size: 9px; font-weight: 700; }
.brand-mark { position: relative; width: 34px; height: 34px; flex: 0 0 34px; }
.brand-mark span { position: absolute; width: 17px; height: 21px; border-radius: 50% 50% 46% 54%; transform: rotate(35deg); }
.brand-mark span:nth-child(1) { left: 1px; top: 5px; background: var(--green); }
.brand-mark span:nth-child(2) { right: 1px; top: 2px; background: var(--coral); transform: rotate(-28deg); }
.brand-mark span:nth-child(3) { left: 10px; bottom: 1px; background: var(--amber); transform: rotate(7deg); mix-blend-mode: multiply; }

.primary-nav { display: grid; gap: 5px; }
.nav-item { width: 100%; height: 44px; padding: 0 12px; display: flex; gap: 12px; align-items: center; border: 0; border-radius: 7px; background: transparent; color: #66706b; text-align: left; font-size: 14px; }
.nav-item svg { width: 19px; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { color: var(--green); background: var(--green-soft); font-weight: 700; }
.side-summary { margin: 32px 7px 0; padding-top: 22px; border-top: 1px solid var(--line); }
.side-summary-head { display: flex; justify-content: space-between; margin-bottom: 15px; color: var(--muted); font-size: 11px; font-weight: 700; }
.side-summary-head span:last-child { color: var(--green); }
.mini-stat { display: flex; align-items: baseline; gap: 8px; margin: 9px 0; }
.mini-stat strong { min-width: 28px; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.mini-stat span { color: var(--muted); font-size: 12px; }
.progress-track { height: 3px; margin-top: 16px; overflow: hidden; border-radius: 3px; background: #e5e9e4; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--green-2); transition: width .5s ease; }
.account-card { margin-top: auto; width: 100%; min-width: 0; padding: 10px 8px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.account-card:hover { background: var(--surface-2); }
.account-card > svg { width: 18px; color: var(--muted); }
.avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: 12px; font-weight: 700; }
.account-copy { flex: 1; min-width: 0; }
.account-copy strong, .account-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-copy strong { font-size: 12px; }
.account-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.account-copy i { display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%; background: var(--green-2); }

.main-area { grid-column: 2; min-width: 0; min-height: 100vh; }
.topbar { height: 72px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(247, 248, 245, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.breadcrumbs { display: flex; align-items: center; min-width: 0; color: var(--muted); font-size: 13px; }
.breadcrumbs button { padding: 6px 4px; border: 0; background: transparent; white-space: nowrap; }
.breadcrumbs button:hover, .breadcrumbs button:last-child { color: var(--ink); }
.breadcrumbs svg { width: 14px; height: 14px; margin: 0 4px; color: #9aa29e; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search-box { width: min(290px, 28vw); height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 7px; background: white; transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(50, 168, 127, .12); }
.search-box svg { width: 17px; color: #7c8681; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; color: #87918c; background: #f7f8f6; font-family: inherit; font-size: 9px; }
.primary-button, .secondary-button, .text-button { min-height: 38px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 7px; border: 1px solid transparent; font-size: 12px; font-weight: 700; }
.primary-button { color: white; background: var(--green); }
.primary-button:hover { background: #11694f; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.primary-button svg { width: 17px; }
.secondary-button { border-color: var(--line); background: white; }
.secondary-button:hover { background: var(--surface-2); }
.text-button { padding: 0; color: var(--green); background: transparent; }
.text-button svg { width: 16px; }
.icon-button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: white; }
.icon-button:hover { background: var(--surface-2); }
.icon-button svg { width: 17px; }
.icon-button.danger { color: var(--danger); }
.mobile-search, .mobile-account { display: none; }

.view { display: none; }
.view.active { display: block; }
.map-workspace { height: calc(100vh - 72px); display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.map-stage { min-width: 0; padding: 28px 28px 22px; display: flex; flex-direction: column; overflow: hidden; }
.map-heading { padding: 0 3px 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 9px; line-height: 1; font-weight: 800; }
.map-heading h1, .page-header h1 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(24px, 3vw, 36px); font-weight: 500; }
.map-heading > div > p:last-child, .page-header > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.map-summary { display: flex; gap: 20px; }
.map-summary span { display: grid; gap: 3px; text-align: right; }
.map-summary strong { font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.map-summary small { color: var(--muted); font-size: 9px; }

.map-viewport { position: relative; flex: 1; min-height: 360px; overflow: hidden; border: 1px solid #d5ddd8; border-radius: 8px; background: #e9efec; box-shadow: 0 12px 35px rgba(40,64,53,.08); isolation: isolate; }
.leaflet-map { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; background-color: #e9efec; background-image: linear-gradient(rgba(96,120,108,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(96,120,108,.055) 1px, transparent 1px); background-size: 40px 40px; }
.leaflet-tile-pane { filter: saturate(.55) contrast(.94) brightness(1.04); }
.leaflet-control-container { font-family: inherit; }
.leaflet-bar { overflow: hidden; border: 1px solid rgba(188,201,194,.9) !important; border-radius: 6px !important; box-shadow: 0 7px 18px rgba(36,54,46,.12) !important; }
.leaflet-bar a { width: 30px !important; height: 30px !important; border-bottom-color: var(--line) !important; color: #415149 !important; background: rgba(255,255,255,.94) !important; line-height: 30px !important; }
.leaflet-bar a:hover { color: var(--green) !important; background: white !important; }
.leaflet-control-zoom { margin-right: 13px !important; margin-bottom: 30px !important; }
.leaflet-control-scale { margin-left: 13px !important; margin-bottom: 52px !important; }
.leaflet-control-scale-line { border: 0 !important; border-top: 2px solid #596a61 !important; color: #596a61 !important; background: transparent !important; font-size: 8px !important; }
.leaflet-control-attribution { padding: 2px 5px !important; color: #87928c !important; background: rgba(255,255,255,.76) !important; font-size: 7px !important; }
.leaflet-control-attribution a { color: #63786d !important; }
.map-region-label-wrap { background: transparent; border: 0; }
.map-region-label { position: relative; display: inline-flex; align-items: center; gap: 4px; transform: translate(-50%, -50%); color: #33443b; text-shadow: 0 1px 0 rgba(255,255,255,.96), 1px 0 0 rgba(255,255,255,.96), -1px 0 0 rgba(255,255,255,.96), 0 -1px 0 rgba(255,255,255,.96), 0 0 5px rgba(255,255,255,.9); white-space: nowrap; font-size: 10px; font-weight: 700; pointer-events: none; }
.map-region-label.city { font-size: 11px; }
.map-region-label.district { font-size: 9px; font-weight: 600; }
.map-region-label i { width: 5px; height: 5px; flex: 0 0 5px; border: 1px solid white; border-radius: 50%; background: var(--coral); box-shadow: 0 1px 3px rgba(35,56,46,.22); }
.leaflet-tooltip.region-hover { padding: 8px 10px; border: 0; border-radius: 5px; color: white; background: rgba(24,37,31,.92); box-shadow: 0 8px 20px rgba(23,37,31,.18); font-size: 10px; }
.leaflet-tooltip.region-hover::before { border-top-color: rgba(24,37,31,.92); }
.memory-map-icon { background: transparent; border: 0; }
.memory-map-pin { position: relative; width: 28px; height: 28px; display: grid; place-items: center; border: 3px solid white; border-radius: 50% 50% 50% 8px; color: white; background: var(--coral); box-shadow: 0 6px 16px rgba(67,54,43,.28); transform: rotate(-45deg); }
.memory-map-pin svg { width: 13px; height: 13px; stroke-width: 2.2; transform: rotate(45deg); }
.memory-map-label { padding: 5px 8px !important; border: 1px solid var(--line) !important; border-radius: 5px !important; color: var(--ink) !important; background: rgba(255,255,255,.94) !important; box-shadow: 0 5px 14px rgba(29,46,38,.12) !important; font-size: 9px !important; font-weight: 700; }
.memory-map-label::before { display: none; }
.map-loading { position: absolute; z-index: 850; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: #62736a; background: rgba(233,239,236,.82); backdrop-filter: blur(2px); transition: opacity .2s; font-size: 10px; pointer-events: none; }
.map-loading[hidden] { display: none; }
.map-loading i { width: 18px; height: 18px; border: 2px solid #b9cbc1; border-top-color: var(--green); border-radius: 50%; animation: geoSpin .75s linear infinite; }
.map-level-badge { position: absolute; z-index: 750; right: 14px; top: 14px; height: 34px; padding: 0 9px; display: flex; align-items: baseline; gap: 5px; border: 1px solid rgba(210,220,214,.9); border-radius: 6px; color: var(--muted); background: rgba(255,255,255,.9); box-shadow: 0 5px 15px rgba(34,53,44,.1); backdrop-filter: blur(8px); font-size: 9px; pointer-events: none; }
.map-level-badge span { color: var(--ink); font-weight: 700; }
.map-level-badge strong { color: var(--green); font-family: Georgia, serif; font-size: 15px; font-weight: 500; }
.map-level-badge small { font-size: 8px; }
.map-svg { position: absolute; inset: 22px 22px 34px; z-index: 2; width: calc(100% - 44px); height: calc(100% - 56px); overflow: visible; }
.province-shape { stroke: #fff; stroke-width: 3; fill: #d6ddd8; cursor: pointer; transition: transform .18s ease, fill .18s ease, filter .18s ease; transform-box: fill-box; transform-origin: center; }
.province-shape:hover, .province-shape:focus { fill: #b9c8c0; filter: drop-shadow(0 5px 8px rgba(42,69,58,.18)); transform: translateY(-3px); outline: none; }
.province-shape.visited { fill: var(--green-2); }
.province-shape.visited:hover { fill: var(--green); }
.province-shape.hot { fill: var(--coral); }
.geo-area { fill: #d9e0dc; stroke: rgba(255,255,255,.96); stroke-width: 1.35; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .16s ease, filter .16s ease, opacity .16s ease; }
.geo-area:hover, .geo-area:focus { fill: #aebfb6; filter: drop-shadow(0 3px 4px rgba(27,55,43,.16)); outline: none; }
.geo-area.visited { fill: #55ad8d; }
.geo-area.visited:hover, .geo-area.hot { fill: var(--coral); }
.geo-auxiliary { fill: none; stroke: #9fb8ab; stroke-width: .8; stroke-dasharray: 2 4; opacity: .42; pointer-events: none; vector-effect: non-scaling-stroke; }
.geo-label { fill: #36463e; paint-order: stroke; stroke: rgba(255,255,255,.88); stroke-width: 2.8px; stroke-linejoin: round; pointer-events: none; font-weight: 700; }
.geo-label-province { font-size: 10px; }
.geo-label-city { font-size: 12px; }
.geo-label-district { font-size: 9px; font-weight: 600; }
.geo-label-link { stroke: rgba(88,108,98,.5); stroke-width: .75; stroke-dasharray: 2 2; pointer-events: none; vector-effect: non-scaling-stroke; }
.geo-memory-dot { fill: var(--coral); stroke: white; stroke-width: 1.5; pointer-events: none; }
.geo-loading circle { fill: none; stroke: #c7d5ce; stroke-width: 3; stroke-dasharray: 24 18; animation: geoSpin .8s linear infinite; transform-origin: 430px 275px; }
.geo-loading text, .geo-error { fill: #718078; font-size: 11px; }
.district-focus-label { fill: #23342c; paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 5px; font-family: Georgia, "Songti SC", serif; font-size: 25px; pointer-events: none; }
.island-shape { fill: #ced8d2; stroke: #fff; stroke-width: 2; }
.city-region { cursor: pointer; stroke: white; stroke-width: 3; fill: #d8dfdb; transition: fill .2s, transform .2s; transform-box: fill-box; transform-origin: center; }
.city-region:hover { fill: #b9c9c0; transform: translateY(-2px); }
.city-region.visited { fill: #75bca2; }
.city-region.current { fill: var(--coral); }
.region-label { pointer-events: none; fill: #314139; font-size: 17px; font-weight: 700; text-anchor: middle; }
.region-count { pointer-events: none; fill: #637169; font-size: 10px; text-anchor: middle; }
.road-major, .road-minor, .water-line { fill: none; stroke-linecap: round; }
.road-major { stroke: #fff; stroke-width: 14; }
.road-major-edge { fill: none; stroke: #cfd8d3; stroke-width: 17; stroke-linecap: round; }
.road-minor { stroke: #fff; stroke-width: 6; opacity: .95; }
.water-line { stroke: #afcfda; stroke-width: 28; opacity: .65; }
.road-label { fill: #7b8982; font-size: 10px; font-weight: 600; }
.district-block { fill: rgba(182, 199, 190, .24); stroke: rgba(141, 160, 150, .35); stroke-width: 1; }
.poi-pin { cursor: pointer; transition: transform .18s ease; transform-box: fill-box; transform-origin: center bottom; }
.poi-pin:hover { transform: translateY(-4px) scale(1.04); }
.pin-halo { fill: rgba(23,120,93,.13); }
.pin-circle { fill: var(--green); stroke: white; stroke-width: 3; }
.pin-heart { fill: white; stroke: none; }
.pin-label-bg { fill: white; stroke: #d9e0dc; stroke-width: 1; }
.pin-label { fill: #213029; font-size: 11px; font-weight: 700; }
.map-tooltip { position: absolute; z-index: 8; min-width: 120px; padding: 9px 11px; pointer-events: none; border: 1px solid rgba(255,255,255,.65); border-radius: 6px; color: white; background: rgba(24,36,31,.9); box-shadow: 0 10px 24px rgba(20,30,26,.18); opacity: 0; transform: translate(-50%, -110%); transition: opacity .12s; font-size: 11px; }
.map-tooltip.visible { opacity: 1; }
.map-tooltip strong { display: block; margin-bottom: 2px; font-size: 12px; }
.map-tooltip span { color: #cbd5d0; }
.map-legend { position: absolute; z-index: 750; left: 14px; bottom: 14px; padding: 7px 9px; display: flex; gap: 12px; border: 1px solid rgba(215,224,218,.8); border-radius: 5px; background: rgba(255,255,255,.88); color: var(--muted); backdrop-filter: blur(7px); font-size: 9px; pointer-events: none; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.map-source { position: absolute; z-index: 750; right: 10px; bottom: 20px; color: #7d8982; font-size: 7px; pointer-events: none; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; background: #d6ddd8; }
.legend-dot.visited { background: var(--green-2); }
.map-compass { position: absolute; z-index: 3; right: 17px; top: 16px; width: 28px; color: #65736c; text-align: center; font-family: Georgia, serif; font-size: 9px; }
.map-compass i { display: block; width: 1px; height: 24px; margin: 3px auto; background: linear-gradient(var(--coral) 50%, #87948d 50%); }
.map-back { position: absolute; z-index: 750; left: 14px; top: 14px; width: 34px; height: 34px; display: none; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.94); box-shadow: 0 5px 15px rgba(34,53,44,.1); }
.map-back.visible { display: grid; }
.map-back svg { width: 17px; }

.memory-panel { min-width: 0; padding: 27px 19px 18px; overflow: hidden; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #fbfcfa; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 0 3px 15px; }
.panel-header h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 500; }
.panel-header .icon-button { width: 32px; height: 32px; }
.panel-tabs { margin: 0 3px 13px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border-radius: 6px; background: #edf0ed; }
.panel-tabs button { height: 30px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.panel-tabs button.active { color: var(--green); background: white; box-shadow: 0 1px 4px rgba(32,49,41,.08); }
.panel-tabs span { margin-left: 3px; font-family: Georgia, serif; font-size: 10px; font-weight: 500; }
.region-directory { flex: 1; min-height: 0; overflow: auto; padding: 0 3px 20px; scrollbar-width: thin; scrollbar-color: #ccd5cf transparent; }
.region-directory-head { padding: 2px 1px 9px; display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }
.region-search { height: 34px; margin-bottom: 6px; padding: 0 9px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.region-search svg { width: 14px; color: #7b8780; }
.region-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 9px; }
.region-row { width: 100%; min-height: 42px; padding: 7px 5px; display: grid; grid-template-columns: 24px minmax(0,1fr) auto 15px; align-items: center; gap: 7px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.region-row:hover { color: var(--green); background: rgba(220,239,231,.45); }
.region-index { color: #a0aaa4; font-family: Georgia, serif; font-size: 10px; }
.region-copy { min-width: 0; }
.region-copy strong, .region-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.region-copy strong { font-size: 11px; }
.region-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.region-state { width: 7px; height: 7px; border-radius: 2px; background: #d5dcd8; }
.region-state.visited { background: var(--green-2); }
.region-row > svg { width: 13px; color: #a0aaa4; }
.region-directory-empty { padding: 40px 12px; color: var(--muted); text-align: center; font-size: 10px; }
.active-filter { display: none; margin-bottom: 10px; padding: 7px 10px; align-items: center; justify-content: space-between; border-radius: 5px; color: var(--green); background: var(--green-soft); font-size: 10px; }
.active-filter.visible { display: flex; }
.active-filter button { border: 0; background: transparent; color: inherit; font-size: 15px; line-height: 1; }
.memory-list { flex: 1; overflow: auto; padding: 0 3px 20px; scrollbar-width: thin; scrollbar-color: #ccd5cf transparent; }
.memory-card { width: 100%; padding: 15px 0; display: block; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.memory-card:first-child { padding-top: 4px; }
.memory-card:hover h3 { color: var(--green); }
.memory-meta { display: flex; align-items: center; justify-content: space-between; color: #8a938e; font-size: 9px; }
.memory-location { max-width: 67%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memory-location svg { width: 11px; height: 11px; margin-right: 3px; vertical-align: -2px; color: var(--coral); }
.memory-card h3 { margin: 8px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; transition: color .15s; }
.memory-card p { margin: 0; display: -webkit-box; overflow: hidden; color: var(--muted); font-family: Georgia, "Songti SC", serif; font-size: 11px; line-height: 1.7; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tag-row { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag { padding: 3px 6px; border-radius: 4px; color: #5f6d65; background: #edf0ed; font-size: 8px; }
.media-count { margin-left: auto; display: flex; align-items: center; gap: 3px; color: var(--green); font-size: 9px; }
.media-count svg { width: 12px; height: 12px; }
.panel-empty { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; }
.panel-empty > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); }
.panel-empty h3 { margin: 12px 0 5px; font-size: 13px; }
.panel-empty p { margin: 0 0 9px; color: var(--muted); font-size: 10px; }

.scroll-view { height: calc(100vh - 72px); padding: 38px max(28px, 5vw) 80px; overflow: auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; max-width: 1120px; margin: 0 auto 36px; }
.page-header select { min-width: 120px; height: 36px; padding: 0 30px 0 11px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); font-size: 11px; }
.timeline { position: relative; max-width: 900px; margin: 0 auto; }
.timeline::before { content: ""; position: absolute; left: 91px; top: 10px; bottom: 20px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 72px 1fr; gap: 38px; margin-bottom: 26px; }
.timeline-date { padding-top: 13px; text-align: right; }
.timeline-date strong { display: block; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.timeline-date span { color: var(--muted); font-size: 9px; }
.timeline-dot { position: absolute; left: 87px; top: 17px; width: 9px; height: 9px; border: 2px solid var(--bg); border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px #fac9be; }
.timeline-card { padding: 17px 19px; border: 1px solid var(--line); border-radius: 7px; background: white; transition: transform .2s, box-shadow .2s; cursor: pointer; }
.timeline-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(31,48,40,.08); }
.timeline-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.timeline-card h3 { margin: 0 0 5px; font-size: 14px; }
.timeline-card .place { color: var(--green); font-size: 9px; }
.timeline-card p { margin: 11px 0 0; color: var(--muted); font-family: Georgia, "Songti SC", serif; font-size: 11px; line-height: 1.8; }
.timeline-empty { padding: 70px 20px; color: var(--muted); text-align: center; }

.stat-grid { max-width: 1120px; margin: 0 auto 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { min-height: 122px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 7px; background: white; }
.stat-card span { color: var(--muted); font-size: 10px; }
.stat-card strong { font-family: Georgia, serif; font-size: 31px; font-weight: 500; }
.stat-card small { color: var(--green); font-size: 9px; }
.stat-card.accent { color: white; background: var(--green); border-color: var(--green); }
.stat-card.accent span, .stat-card.accent small { color: rgba(255,255,255,.75); }
.insight-grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; }
.insight-section { min-height: 270px; padding: 21px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.insight-section.wide { grid-column: 1 / -1; min-height: 210px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: 14px; }
.section-heading span { color: var(--muted); font-size: 9px; }
.bar-list { display: grid; gap: 14px; }
.bar-item { display: grid; grid-template-columns: 70px 1fr 22px; align-items: center; gap: 10px; font-size: 10px; }
.bar-item > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 7px; overflow: hidden; border-radius: 2px; background: #edf0ed; }
.bar-track i { display: block; height: 100%; background: var(--green-2); }
.bar-item strong { font-family: Georgia, serif; font-size: 12px; font-weight: 500; text-align: right; }
.mood-cloud { min-height: 190px; display: flex; flex-wrap: wrap; gap: 8px; align-content: center; justify-content: center; }
.mood-chip { --size: 50px; width: var(--size); height: var(--size); display: grid; place-items: center; border-radius: 50%; color: #31423a; background: var(--green-soft); font-size: calc(var(--size) * .19); }
.mood-chip:nth-child(3n+2) { background: #f9dfd9; }
.mood-chip:nth-child(3n) { background: #f3e8c9; }
.month-density { height: 105px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; }
.month-column { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.month-column i { width: min(30px, 55%); min-height: 4px; border-radius: 3px 3px 1px 1px; background: var(--green-2); transition: height .4s ease; }
.month-column span { color: var(--muted); font-size: 8px; }

.modal-layer, .drawer-layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; }
.modal-backdrop, .drawer-backdrop { position: absolute; inset: 0; background: rgba(16, 26, 22, .45); backdrop-filter: blur(5px); animation: fadeIn .18s ease; }
.modal-card { position: relative; width: min(700px, 100%); max-height: min(780px, calc(100vh - 36px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 8px; background: white; box-shadow: var(--shadow); animation: modalIn .22s ease; }
.modal-card.compact { width: min(430px, 100%); }
.modal-header { padding: 21px 24px 17px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 500; }
.modal-card form { min-height: 0; display: flex; flex-direction: column; }
.form-scroll { padding: 20px 24px; overflow: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { position: relative; display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; margin-bottom: 15px; }
.form-grid .field.full { margin-bottom: 0; }
.field label, .field > span { color: #4c5953; font-size: 10px; font-weight: 700; }
.field b { color: var(--coral); }
.field input, .field textarea, .field select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: #fbfcfa; color: var(--ink); font-size: 11px; transition: border .15s, box-shadow .15s; }
.field input, .field select { height: 39px; padding: 0 11px; }
.field textarea { padding: 11px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(50,168,127,.1); }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 10px; top: 11px; width: 15px; color: #8c9690; }
.input-icon input { padding-left: 32px; }
.char-count { position: absolute; right: 8px; bottom: 6px; color: #9aa39e; font-size: 8px; }
.upload-section { margin-top: 21px; padding-top: 18px; border-top: 1px solid var(--line); }
.upload-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11px; }
.upload-title span { color: #4c5953; font-size: 10px; font-weight: 700; }
.upload-title small { color: #909994; font-size: 8px; }
.upload-row { display: flex; flex-wrap: wrap; gap: 9px; }
.upload-tile { width: 78px; height: 70px; display: grid; place-content: center; justify-items: center; gap: 5px; border: 1px dashed #bfc9c2; border-radius: 6px; color: var(--muted); background: #fafbf9; cursor: pointer; font-size: 8px; }
.upload-tile:hover { border-color: var(--green-2); color: var(--green); background: var(--green-soft); }
.upload-tile input { display: none; }
.upload-tile svg { width: 18px; }
.media-preview { display: contents; }
.preview-item { position: relative; width: 78px; height: 70px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #edf0ed; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item.audio { padding: 7px; display: grid; place-content: center; text-align: center; color: var(--green); }
.preview-item.audio svg { margin: auto; width: 18px; }
.preview-item.audio span { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 7px; }
.preview-item button { position: absolute; right: 3px; top: 3px; width: 19px; height: 19px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; color: white; background: rgba(20,30,26,.75); }
.preview-item button svg { width: 11px; height: 11px; }
.modal-footer { padding: 14px 24px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #fafbf9; }

.drawer-layer { justify-items: end; padding: 0; }
.detail-drawer { position: relative; width: min(470px, 100%); height: 100%; overflow: auto; background: white; box-shadow: -14px 0 40px rgba(20,33,27,.14); animation: drawerIn .25s ease; }
.detail-drawer > header { position: sticky; z-index: 4; top: 0; padding: 15px 18px; display: flex; justify-content: space-between; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.drawer-actions { display: flex; gap: 7px; }
.detail-content { padding: 27px 28px 60px; }
.detail-location { display: flex; align-items: center; gap: 5px; color: var(--green); font-size: 10px; }
.detail-location svg { width: 14px; }
.detail-content h2 { margin: 12px 0 8px; font-family: Georgia, "Songti SC", serif; font-size: 29px; font-weight: 500; line-height: 1.35; }
.detail-date { color: var(--muted); font-size: 10px; }
.detail-story { margin: 25px 0; padding: 19px 0; border-block: 1px solid var(--line); color: #435049; font-family: Georgia, "Songti SC", serif; font-size: 13px; line-height: 2; white-space: pre-wrap; }
.detail-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-fact { display: grid; gap: 5px; }
.detail-fact span { color: var(--muted); font-size: 8px; }
.detail-fact strong { font-size: 11px; }
.detail-media { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-media img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.detail-media audio { grid-column: 1 / -1; width: 100%; height: 38px; }
.account-form { padding: 23px; gap: 18px; }
.account-modal-body { min-height: 0; overflow: auto; }
.account-identity { margin: 22px 23px 0; padding: 0 0 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.account-identity .avatar { width: 40px; height: 40px; flex-basis: 40px; font-size: 14px; }
.account-identity strong, .account-identity small { display: block; }
.account-identity strong { font-size: 13px; }
.account-identity small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.account-password-form { border-top: 1px solid var(--line); }
.account-section-title { color: var(--ink); font-size: 11px; font-weight: 800; }
.account-logout { padding: 0 23px 23px; }
.account-logout button { width: 100%; }
.danger-outline { color: var(--danger); border-color: rgba(189,67,59,.3); }
.danger-outline:hover { background: #fff2f0; }
.sync-status { padding: 13px; display: flex; align-items: center; gap: 11px; border-radius: 6px; color: var(--green); background: var(--green-soft); }
.sync-status svg { flex: 0 0 22px; }
.sync-status strong, .sync-status small { display: block; }
.sync-status strong { font-size: 10px; }
.sync-status small { margin-top: 3px; color: #5f766c; font-size: 8px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: min(360px, calc(100vw - 30px)); padding: 10px 15px; border-radius: 6px; color: white; background: #22322b; box-shadow: 0 10px 25px rgba(18,30,24,.2); opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: opacity .2s, transform .2s; font-size: 11px; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.mobile-nav { display: none; }

.admin-page-header { max-width: 1220px; }
.admin-toolbar { display: flex; gap: 8px; }
.admin-toolbar a { text-decoration: none; }
.admin-stat-grid { max-width: 1220px; margin: 0 auto 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.admin-stat-card { min-height: 110px; padding: 18px; display: grid; align-content: space-between; border: 1px solid var(--line); border-radius: 7px; background: white; }
.admin-stat-card span { color: var(--muted); font-size: 9px; }
.admin-stat-card strong { font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.admin-section { max-width: 1220px; margin: 0 auto 18px; padding: 21px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.admin-section .section-heading { margin-bottom: 14px; }
.admin-table-wrap { overflow: auto; }
.admin-table { width: 100%; min-width: 760px; border-collapse: collapse; text-align: left; }
.admin-table th { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 800; }
.admin-table td { padding: 11px 10px; border-bottom: 1px solid #edf0ed; color: #48554f; font-size: 9px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table strong, .admin-table small { display: block; }
.admin-table strong { color: var(--ink); font-size: 10px; }
.admin-table small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.status-badge { display: inline-flex; padding: 4px 7px; border-radius: 10px; color: var(--green); background: var(--green-soft); font-size: 8px; font-weight: 700; }
.status-badge.disabled { color: var(--danger); background: #fae4e0; }
.role-badge { color: var(--muted); font-size: 8px; font-weight: 700; }
.role-badge.admin { color: var(--coral); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.admin-actions button { min-height: 27px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--green); background: white; font-size: 8px; }
.admin-actions button:hover { background: var(--green-soft); }
.admin-actions button.danger { color: var(--danger); }
.admin-empty { padding: 24px !important; color: var(--muted) !important; text-align: center; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes drawerIn { from { transform: translateX(100%); } }
@keyframes geoSpin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: minmax(320px, .75fr) minmax(440px, 1.25fr); }
  .auth-story { padding: 38px; }
  :root { --sidebar: 82px; }
  .sidebar { padding-inline: 12px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > div:last-child, .nav-item span, .side-summary, .account-copy, .account-card > svg { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .account-card { justify-content: center; }
  .map-workspace { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 790px) {
  .auth-shell { display: block; background: #f7f8f5; }
  .auth-story { min-height: 210px; padding: 27px 24px 34px; }
  .auth-story-copy { margin: 34px 0 0; }
  .auth-story-copy h1 { font-size: 31px; }
  .auth-story-copy > p:last-child, .auth-security { display: none; }
  .auth-panel { min-height: auto; padding: 0 15px 30px; }
  .auth-card { margin-top: -18px; padding: 25px 21px; border-radius: 10px; }
  :root { --sidebar: 0px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-area { min-height: 100vh; }
  .topbar { position: sticky; z-index: 20; top: 0; height: 60px; padding: 0 14px; }
  .breadcrumbs { max-width: 42vw; overflow: hidden; }
  .search-box { display: none; }
  .mobile-search, .mobile-account { display: grid; }
  .primary-button { min-height: 36px; padding-inline: 11px; }
  .top-actions .primary-button span { display: none; }
  .map-workspace { height: auto; display: block; }
  .map-stage { height: auto; padding: 20px 14px 12px; overflow: visible; }
  .map-heading { padding: 0 2px 14px; }
  .map-heading h1 { font-size: 25px; }
  .map-heading > div > p:last-child { display: none; }
  .map-summary { gap: 12px; }
  .map-summary strong { font-size: 18px; }
  .map-viewport { flex: none; height: min(59vh, 500px); min-height: 390px; }
  .map-svg { inset: 20px 5px 32px; width: calc(100% - 10px); height: calc(100% - 52px); }
  .memory-panel { height: auto; min-height: 330px; padding: 22px 16px 86px; border-left: 0; border-top: 1px solid var(--line); }
  .memory-list { overflow: visible; }
  .mobile-nav { position: fixed; z-index: 30; left: 10px; right: 10px; bottom: 9px; height: 58px; padding: 4px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid rgba(217,224,219,.9); border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: 0 12px 30px rgba(27,45,37,.16); backdrop-filter: blur(14px); }
  .mobile-nav.admin-enabled { grid-template-columns: repeat(4, 1fr); }
  .mobile-nav button { display: grid; place-content: center; justify-items: center; gap: 2px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 8px; }
  .mobile-nav button.active { color: var(--green); background: var(--green-soft); }
  .mobile-nav svg { width: 18px; height: 18px; }
  .scroll-view { height: auto; min-height: calc(100vh - 60px); padding: 26px 16px 92px; }
  .page-header { align-items: flex-start; margin-bottom: 27px; }
  .page-header h1 { font-size: 27px; }
  .timeline::before { left: 65px; }
  .timeline-item { grid-template-columns: 50px 1fr; gap: 31px; }
  .timeline-dot { left: 61px; }
  .timeline-date strong { font-size: 15px; }
  .timeline-card { padding: 15px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .insight-section.wide { grid-column: auto; }
  .month-density { gap: 4px; }
  .modal-layer { padding: 0; place-items: end center; }
  .modal-card { width: 100%; max-height: 94vh; border-radius: 8px 8px 0 0; }
  .modal-header { padding: 17px 17px 14px; }
  .form-scroll { padding: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .modal-footer { padding: 12px 17px; }
  .upload-title { align-items: flex-start; gap: 8px; }
  .upload-title small { text-align: right; }
  .detail-content { padding-inline: 20px; }
  .admin-page-header { display: grid; gap: 16px; }
  .admin-toolbar { width: 100%; }
  .admin-toolbar > * { flex: 1; }
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-section { padding: 16px; }
}

@media (max-width: 430px) {
  .map-summary span:last-child { display: none; }
  .map-viewport { height: 420px; min-height: 420px; }
  .map-legend { left: 10px; bottom: 9px; }
  .map-source { display: none; }
  .map-compass { right: 10px; top: 10px; }
  .stat-card { min-height: 108px; padding: 16px; }
  .stat-card strong { font-size: 27px; }
  .page-header select { min-width: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
