:root {
  --ocean: #E6EBEF;
  --ocean-deep: #D9E0E6;
  --grid: rgba(110, 128, 145, 0.085);
  --world-land: #D5D9DE;
  --world-stroke: #C6CBD2;
  --china-top: #F7F4ED;
  --china-wall: #CFC8BC;
  --china-border: #DBD4C8;
  --plaster-grad: linear-gradient(112deg, #F3EEE6 0%, #E7DFD2 54%, #DBD3C5 100%);
  --plaster-flat: #EAE3D7;
  --surface-glass: rgba(251, 248, 242, 0.88);
  --surface-card: #F8F4EC;
  --text-1: #26231F;
  --text-2: #6B655B;
  --text-3: #999184;
  --gold: #C8A768;
  --gold-deep: #967438;
  --gold-soft: #F3EAD7;
  --border-soft: rgba(105, 92, 74, 0.16);
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif CN", Georgia, serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
  --glaze-0: #C2D6CB; --wall-0: #9CB4A7;
  --glaze-1: #DFC3B6; --wall-1: #BC9C8E;
  --glaze-2: #E2CE9F; --wall-2: #BFA874;
  --glaze-3: #C1D1DF; --wall-3: #99AEBF;
  --glaze-4: #D2C8DA; --wall-4: #ACA0B7;
  --glaze-5: #CAD2B7; --wall-5: #A4AE8E;
}

[data-theme="night"] {
  --ocean: #101621;
  --ocean-deep: #0B1018;
  --grid: rgba(180, 200, 224, 0.065);
  --world-land: #1A2230;
  --world-stroke: #263144;
  --china-top: #253042;
  --china-wall: #141B27;
  --china-border: #37465E;
  --plaster-grad: linear-gradient(112deg, #1E2533 0%, #171D29 55%, #111621 100%);
  --plaster-flat: #181F2C;
  --surface-glass: rgba(24, 31, 45, 0.88);
  --surface-card: #1C2434;
  --text-1: #F3EFE7;
  --text-2: #A6B0C0;
  --text-3: #6C7688;
  --gold-soft: rgba(200, 167, 104, 0.18);
  --border-soft: rgba(200, 167, 104, 0.2);
  --glaze-0: #4A7A68; --wall-0: #305346;
  --glaze-1: #8E5D51; --wall-1: #623D34;
  --glaze-2: #9C804A; --wall-2: #6D582F;
  --glaze-3: #4E6E8A; --wall-3: #334A5E;
  --glaze-4: #6D5E82; --wall-4: #4A3F5B;
  --glaze-5: #667855; --wall-5: #455339;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: var(--font-sans); background: var(--plaster-grad); color: var(--text-1);
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app-shell { position: relative; width: 100%; height: 100dvh; overflow: hidden; z-index: 2; }

/* Floating Glass Top Capsule */
.app-top-capsule {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 14px; right: 14px; z-index: 35;
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px 8px 16px; border-radius: 999px;
  background: var(--surface-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 8px 24px rgba(35, 42, 52, 0.11);
}
.app-top-left { display: flex; flex-direction: column; gap: 0; cursor: pointer; min-width: 0; line-height: 1.15; }
.app-top-title { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.app-top-stats { font-size: 10px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.app-top-stats strong { color: var(--text-1); font-weight: 700; }
@media (max-width: 639px) {
  .app-top-capsule { padding: 6px 9px 6px 13px; gap: 6px; }
  .app-top-icons { gap: 4px; }
  .mini-circle-btn { width: 28px; height: 28px; font-size: 12px; }
  .app-top-icons button[title="大屏展示模式"] { display: none; }
  .account-pill { padding: 2px 8px 2px 3px; font-size: 11px; gap: 4px; }
}
@media (min-width: 640px) {
  .app-top-left { flex-direction: row; align-items: baseline; gap: 8px; }
  .app-top-title { font-size: 17px; }
  .app-top-stats { font-size: 11.5px; }
}

.desktop-nav-pills {
  display: none; align-items: center; gap: 3px;
  background: rgba(105, 92, 74, 0.10); padding: 3px; border-radius: 999px;
}
.dnav-btn {
  border: none; background: transparent; color: var(--text-2);
  padding: 5px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.dnav-btn.active { background: var(--surface-card); color: var(--text-1); box-shadow: 0 2px 6px rgba(40,34,24,0.12); }

.app-top-icons { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mini-circle-btn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-soft);
  background: var(--surface-card); color: var(--text-1); cursor: pointer;
  display: grid; place-items: center; font-size: 13px; transition: all .18s; flex-shrink: 0;
}
.mini-circle-btn:hover { border-color: var(--gold); color: var(--gold-deep); }
.account-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px;
  border-radius: 999px; border: 1px solid rgba(200, 167, 104, 0.45);
  background: var(--gold-soft); color: var(--gold-deep); font-size: 11.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.acct-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #E2C58B, #967438); color: #FFFDF8;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 700;
}
.acct-big-avatar {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto;
  background: linear-gradient(135deg, #E2C58B, #967438); color: #FFFDF8;
  display: grid; place-items: center; font-size: 24px; font-weight: 700;
}

.toast-banner {
  position: fixed; top: calc(max(12px, env(safe-area-inset-top)) + 56px); left: 50%; transform: translateX(-50%);
  z-index: 90; background: rgba(30, 35, 44, 0.92); color: #F7F4EC; font-size: 12px;
  padding: 8px 15px; border-radius: 999px; max-width: 90vw; text-align: center;
  box-shadow: 0 8px 22px rgba(0,0,0,0.24); opacity: 0; pointer-events: none; transition: opacity .24s;
}
.toast-banner.show { opacity: 1; }

.tab-view { position: absolute; inset: 0; display: none; flex-direction: column; overflow: hidden; }
.tab-view.active { display: flex; }

/* Interactive 2.5D Ceramic Map */
.map-viewport {
  flex: 1; position: relative; overflow: hidden;
  background: radial-gradient(circle at 30% 25%, var(--ocean) 0%, var(--ocean-deep) 100%);
  cursor: grab; user-select: none; touch-action: none;
}
.map-viewport::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 36px 36px;
}
.map-viewport:active { cursor: grabbing; }
.map-svg { width: 100%; height: 100%; display: block; position: relative; z-index: 2; }
.world-poly { fill: var(--world-land); stroke: var(--world-stroke); stroke-width: 0.55; cursor: pointer; transition: fill .2s; }
.world-poly:hover { fill: #CBD0D7; }
.prov-wall { fill: var(--china-wall); stroke: var(--china-wall); stroke-width: 0.8; }
.prov-wall.visited-0 { fill: var(--wall-0); stroke: var(--wall-0); }
.prov-wall.visited-1 { fill: var(--wall-1); stroke: var(--wall-1); }
.prov-wall.visited-2 { fill: var(--wall-2); stroke: var(--wall-2); }
.prov-wall.visited-3 { fill: var(--wall-3); stroke: var(--wall-3); }
.prov-wall.visited-4 { fill: var(--wall-4); stroke: var(--wall-4); }
.prov-wall.visited-5 { fill: var(--wall-5); stroke: var(--wall-5); }

.province-poly {
  fill: var(--china-top); stroke: var(--china-border); stroke-width: 0.85;
  cursor: pointer; transition: fill .28s ease, filter .22s ease;
}
.province-poly:hover { filter: brightness(0.98); }
.province-poly.visited-0 { fill: var(--glaze-0); }
.province-poly.visited-1 { fill: var(--glaze-1); }
.province-poly.visited-2 { fill: var(--glaze-2); }
.province-poly.visited-3 { fill: var(--glaze-3); }
.province-poly.visited-4 { fill: var(--glaze-4); }
.province-poly.visited-5 { fill: var(--glaze-5); }
.province-poly.selected { stroke: var(--gold-deep); stroke-width: 1.8; }

.city-poly {
  fill: var(--china-top); stroke: rgba(138, 128, 112, 0.36); stroke-width: 0.65;
  stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke;
  cursor: pointer; transition: fill .22s ease;
}
.city-poly:hover { filter: brightness(0.96); }
.city-poly.visited-0 { fill: var(--glaze-0); }
.city-poly.visited-1 { fill: var(--glaze-1); }
.city-poly.visited-2 { fill: var(--glaze-2); }
.city-poly.visited-3 { fill: var(--glaze-3); }
.city-poly.visited-4 { fill: var(--glaze-4); }
.city-poly.visited-5 { fill: var(--glaze-5); }
.city-poly.selected { stroke: var(--gold-deep); stroke-width: 1.6; }
.city-label {
  fill: var(--text-2); font-weight: 500; text-anchor: middle; dominant-baseline: central;
  pointer-events: none; paint-order: stroke; stroke: rgba(250, 248, 242, 0.92);
  stroke-linejoin: round; stroke-linecap: round;
}
.city-label.is-visited-lbl { fill: var(--text-1); font-weight: 600; }
[data-theme="night"] .city-label { fill: #DCE3EE; stroke: rgba(18, 24, 36, 0.85); }
.map-pin-g { cursor: pointer; }

.lod-pill {
  position: fixed; top: calc(max(12px, env(safe-area-inset-top)) + 54px); left: 16px; z-index: 20;
  padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--surface-glass); backdrop-filter: blur(12px);
  border: 1px solid var(--border-soft); color: var(--text-2);
  box-shadow: 0 4px 12px rgba(32,38,48,0.08); pointer-events: none;
}
.lod-pill.city-mode { border-color: var(--gold); color: var(--gold-deep); background: var(--gold-soft); }

.map-zoom-controls {
  position: fixed; left: 16px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 78px); z-index: 20;
  display: flex; flex-direction: column; gap: 6px;
}
.zoom-btn {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--surface-glass); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.65); color: var(--text-1);
  font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(32,38,48,0.12);
}
.zoom-btn.text-sm { font-size: 10.5px; }

.fab-add-place {
  position: fixed; right: 16px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 78px); z-index: 22;
  padding: 11px 18px; border-radius: 999px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #E2C58B 0%, #C29D5C 55%, #A37D3E 100%);
  color: #FFFDF9; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 24px rgba(150, 116, 56, 0.38), inset 0 1px 1px rgba(255,255,255,0.55);
}

/* Cast / Big-Screen Mode */
.cast-controls, .tv-spotlight-card, .tv-bottom-ribbon { display: none; }
.app-shell.cast-mode #mainTopBar,
.app-shell.cast-mode #mobileBottomTabs,
.app-shell.cast-mode .fab-add-place,
.app-shell.cast-mode .map-zoom-controls,
.app-shell.cast-mode .lod-pill { display: none !important; }
.app-shell.cast-mode .cast-controls {
  display: flex; gap: 8px; position: fixed; top: 18px; right: 20px; z-index: 40;
}
.tv-pill {
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-glass); backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.65); color: var(--text-1); cursor: pointer;
}
.app-shell.cast-mode .tv-spotlight-card {
  display: block; position: fixed; right: 24px; top: 72px; width: 256px; z-index: 38;
  background: var(--surface-glass); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.65); border-radius: 22px; padding: 18px 16px;
  box-shadow: 0 18px 40px rgba(24,30,40,0.16); text-align: center;
}
.app-shell.cast-mode .tv-bottom-ribbon {
  display: block; position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 38;
  padding: 10px 24px; border-radius: 999px; background: var(--surface-glass); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.65); font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 12px 28px rgba(20, 26, 36, 0.14);
}
.tv-bottom-ribbon span { color: var(--gold-deep); }

/* Bottom Navigation (Mobile) */
.bottom-tabs {
  position: fixed; left: 16px; right: 16px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 26;
  max-width: 440px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 5px; border-radius: 26px;
  background: var(--surface-glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 12px 28px rgba(32, 38, 48, 0.14);
}
.tab-btn {
  border: none; background: transparent; color: var(--text-2);
  padding: 6px 4px; border-radius: 20px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10.5px; font-weight: 500; transition: all .2s;
}
.tab-btn .t-ic { font-size: 16px; line-height: 1.1; }
.tab-btn.active { background: var(--gold-soft); color: var(--gold-deep); font-weight: 700; }

/* Province Sheet (Mobile Bottom Sheet -> Desktop Side Panel) */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 36; background: rgba(25, 29, 36, 0.22);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.province-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; height: 60dvh; z-index: 38;
  background: var(--plaster-grad); border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 36px rgba(25, 30, 38, 0.2);
  transform: translateY(105%); transition: transform .3s cubic-bezier(.22,1,.36,1);
  display: flex; flex-direction: column; overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
.province-sheet.open { transform: translateY(0); }
.sheet-handle { width: 38px; height: 4px; border-radius: 99px; background: var(--border-soft); margin: 10px auto 6px; }
.sheet-head { padding: 4px 18px 10px; display: flex; align-items: center; justify-content: space-between; }
.sheet-head h3 { font-family: var(--font-display); font-size: 20px; }
.sheet-head span { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; flex-shrink: 0; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: 1px solid var(--border-soft); background: rgba(255,252,246,0.72);
  color: var(--text-2); font-size: 11.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.chip.active { background: var(--text-1); color: var(--surface-card); border-color: var(--text-1); }
.sheet-list { flex: 1; overflow-y: auto; padding: 4px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.lm-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 16px;
  background: rgba(255, 253, 248, 0.78); border: 1px solid var(--border-soft); cursor: pointer;
}
.lm-row:hover { border-color: var(--gold); }
.lm-row-info { flex: 1; min-width: 0; }
.lm-row-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-row-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.status-pill {
  padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border-soft); background: var(--surface-card); color: var(--text-2);
  cursor: pointer; flex-shrink: 0;
}
.status-pill.collected { background: linear-gradient(135deg, #E2C58B, #BC9653); color: #FFFDF8; border-color: transparent; }
.status-pill.wishlist { background: var(--gold-soft); color: var(--gold-deep); border-color: var(--gold); }
.sheet-cam-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-soft);
  background: rgba(255,253,248,0.88); color: var(--gold-deep); cursor: pointer;
  display: grid; place-items: center; font-size: 12px; flex-shrink: 0;
}
.sheet-cam-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.sheet-ugc-bar {
  margin: 6px 16px 12px; padding: 10px; border-radius: 14px;
  border: 1px dashed var(--gold); background: var(--gold-soft); color: var(--gold-deep);
  font-size: 12px; font-weight: 600; text-align: center; cursor: pointer;
}

/* Museum Enamel Pin & Carved Plaster Tiles */
.enamel-pin-img {
  display: block; object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(4px 8px 6px rgba(48, 38, 22, 0.28)) drop-shadow(1px 2.5px 2px rgba(48, 38, 22, 0.22));
  transition: transform .22s cubic-bezier(.22,1,.36,1);
}
.enamel-pin-img:hover { transform: translateY(-2px) scale(1.035); }
.plaster-groove-tile {
  position: relative; border-radius: 8px; background: transparent;
  box-shadow: inset 1.5px 1.5px 2px rgba(105, 92, 74, 0.30), inset -1.5px -1.5px 2px rgba(255, 255, 255, 0.85), 1px 1px 0 rgba(255, 255, 255, 0.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s ease;
}
[data-theme="night"] .plaster-groove-tile {
  box-shadow: inset 1.5px 1.5px 3px rgba(0, 0, 0, 0.55), inset -1.5px -1.5px 2px rgba(255, 255, 255, 0.08);
}
.plaster-groove-tile:hover { background: rgba(255, 252, 245, 0.22); }

/* Inner Pages (Cabinet / Collections / UGC) */
.inner-page {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: var(--plaster-grad);
  padding-top: calc(max(12px, env(safe-area-inset-top)) + 58px);
  padding-bottom: calc(max(12px, env(safe-area-inset-bottom)) + 74px);
}
.page-container {
  width: 100%; max-width: 1120px; margin: 0 auto; flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}
.inner-header { padding: 6px 16px 10px; display: flex; align-items: baseline; justify-content: space-between; }
.inner-header h2 { font-family: var(--font-display); font-size: 22px; }
.count-badge {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,253,248,0.72); border: 1px solid var(--border-soft);
  color: var(--text-2); font-variant-numeric: tabular-nums;
}
.search-box {
  margin: 0 16px 10px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--border-soft); background: rgba(255,253,248,0.82);
  color: var(--text-1); font-size: 13px; outline: none;
}
.cab-head-row { padding: 4px 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cab-mode-switch {
  display: inline-flex; align-items: center; gap: 2px;
  background: rgba(105, 92, 74, 0.12); padding: 3px; border-radius: 999px;
  border: 1px solid var(--border-soft);
}
.cab-mode-btn {
  border: none; background: transparent; color: var(--text-2);
  padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.cab-mode-btn.active { background: var(--surface-card); color: var(--text-1); box-shadow: 0 2px 6px rgba(45, 36, 22, 0.12); }
.cab-back-btn {
  border: 1px solid var(--border-soft); background: rgba(255,253,248,0.86);
  color: var(--text-1); padding: 5px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.album-expand-banner {
  margin: 0 16px 10px; padding: 11px 14px; border-radius: 16px;
  background: rgba(255, 253, 248, 0.78); border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.album-expand-banner h3 { font-family: var(--font-display); font-size: 18px; }
.album-expand-banner p { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.cabinet-scroll-area { flex: 1; min-height: 0; overflow-y: auto; }
.album-grid {
  padding: 4px 16px 24px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.cabinet-grid {
  padding: 4px 16px 24px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: start;
}
.album-card {
  border-radius: 14px; padding: 10px; position: relative; overflow: hidden;
  background: rgba(255, 253, 248, 0.56);
  box-shadow: inset 1.5px 1.5px 2px rgba(105, 92, 74, 0.28), inset -1.5px -1.5px 2px rgba(255, 255, 255, 0.88), 0 6px 14px rgba(45, 36, 22, 0.06);
  cursor: pointer; transition: transform .2s; display: flex; flex-direction: column; gap: 8px;
}
[data-theme="night"] .album-card { background: rgba(26, 35, 51, 0.7); box-shadow: inset 1.5px 1.5px 3px rgba(0,0,0,0.5); }
.album-card:hover { transform: translateY(-2px); }
.album-card.has-visited { border-left: 3.5px solid var(--gold); }
.album-mosaic {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; padding: 7px; border-radius: 9px;
  background: var(--plaster-grad);
  box-shadow: inset 1px 1px 2px rgba(105, 92, 74, 0.22), inset -1px -1px 1.5px rgba(255,255,255,0.75);
}
.album-mosaic-slot { aspect-ratio: 1 / 1; display: grid; place-items: center; }
.album-meta-top { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.album-title { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; }
.album-count { font-size: 11px; font-weight: 600; color: var(--gold-deep); font-variant-numeric: tabular-nums; }
.album-sub { font-size: 10px; color: var(--text-3); display: flex; justify-content: space-between; }
.album-prog { height: 3.5px; border-radius: 99px; background: rgba(110, 98, 80, 0.15); overflow: hidden; }
.album-prog > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #E2C58B, #B8914D); }
.album-lit-badge {
  position: absolute; top: 8px; right: 8px; z-index: 3; font-size: 8.5px; font-weight: 700;
  padding: 1.5px 6px; border-radius: 999px; background: linear-gradient(135deg, #E4C78A, #BA934E); color: #FFFDF8;
}

.cabinet-cell { padding: 12px 8px 10px; gap: 6px; }
.cabinet-cell .cell-name {
  font-size: 11.5px; font-weight: 600; text-align: center; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cabinet-cell.locked-cell .cell-name { color: var(--text-3); font-weight: 500; }
.cabinet-cell .cell-prov { font-size: 9.5px; color: var(--text-3); }
.wish-ribbon { position: absolute; top: 6px; right: 7px; font-size: 11px; color: var(--gold-deep); }
.visit-times-tag { position: absolute; top: 6px; right: 6px; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 99px; background: var(--gold); color: #FFF; }
.tag-5a {
  display: inline-block; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 5px;
  margin-left: 4px; background: linear-gradient(135deg, #E5C88B, #BA924C); color: #FFFDF8;
}
.tag-5a-corner {
  position: absolute; top: 6px; left: 6px; font-size: 8.5px; font-weight: 700; padding: 1px 4.5px;
  border-radius: 5px; background: rgba(200, 167, 104, 0.22); color: #87662C; border: 1px solid rgba(200, 167, 104, 0.45);
}

.col-scroll { flex: 1; overflow-y: auto; padding: 4px 16px 24px; display: grid; grid-template-columns: 1fr; gap: 10px; align-content: start; }
.col-card {
  background: rgba(255,253,248,0.78); border-radius: 18px; padding: 14px;
  border: 1px solid var(--border-soft); display: flex; gap: 12px; align-items: center;
}
[data-theme="night"] .col-card, [data-theme="night"] .vote-row, [data-theme="night"] .ugc-hero { background: rgba(28, 36, 52, 0.8); }
.col-crest {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #F0E0B5, #C8A768 55%, #967438);
  display: grid; place-items: center; font-size: 22px; color: #FFF;
}
.col-crest.unmet { filter: grayscale(0.85) opacity(0.5); }
.col-body { flex: 1; min-width: 0; }
.col-title { font-size: 13.5px; font-weight: 700; }
.col-sub { font-size: 11px; color: var(--text-2); margin: 2px 0 7px; }
.prog-track { height: 6px; border-radius: 99px; background: rgba(110,98,80,0.16); overflow: hidden; }
.prog-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #E2C58B, #B8914D); transition: width .3s; }
.col-meta { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-2); margin-top: 4px; }

.ugc-hero {
  margin: 0 16px 12px; padding: 16px; border-radius: 20px;
  background: rgba(255,252,244,0.8); border: 1px solid rgba(200,167,104,0.38); text-align: center;
}
.ugc-hero h3 { font-family: var(--font-display); font-size: 17px; margin: 4px 0; }
.ugc-hero p { font-size: 11.5px; color: var(--text-2); margin-bottom: 10px; line-height: 1.5; }
.gold-btn {
  width: 100%; border: none; padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(135deg, #E2C58B, #B8914D); color: #FFFDF8;
  font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 16px rgba(150,116,56,0.28);
}
.vote-row {
  background: rgba(255,253,248,0.78); border: 1px solid var(--border-soft);
  border-radius: 16px; padding: 11px 13px; display: flex; align-items: center; gap: 10px;
}
.vote-btn {
  border: 1px solid var(--gold); background: var(--gold-soft); color: var(--gold-deep);
  padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.vote-btn.voted { background: var(--gold); color: #FFF; }

/* Modals + Medal Memory Vault */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(24, 22, 18, 0.48); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.flip-scene { width: 100%; max-width: 368px; height: min(616px, 88dvh); perspective: 1100px; }
.flip-card {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d; transition: transform .62s cubic-bezier(.22,1,.36,1);
}
.flip-card.flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--plaster-grad); border-radius: 28px; padding: 15px 16px 14px;
  border: 1px solid rgba(255,255,255,0.6); box-shadow: 0 24px 50px rgba(20, 18, 14, 0.32);
  display: flex; flex-direction: column; overflow: hidden;
  transition: opacity 0.14s ease 0.2s, visibility 0s linear 0.2s;
}
.flip-front { transform: rotateY(0deg) translateZ(1px); z-index: 2; }
.flip-back { transform: rotateY(180deg) translateZ(1px); z-index: 1; }
.flip-card:not(.flipped) .flip-back,
.flip-card.flipped .flip-front {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.14s ease 0.14s, visibility 0s linear 0.28s;
}
.flip-card.flipped .flip-back { z-index: 3; }

.modal-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 10px; flex-shrink: 0; }
.modal-tag { font-size: 11px; color: var(--text-2); padding: 3px 9px; border-radius: 99px; background: rgba(255,253,248,0.7); }
.modal-mode-tabs {
  display: inline-flex; align-items: center; gap: 2px; flex: 1;
  background: rgba(105, 92, 74, 0.12); padding: 3px; border-radius: 999px; border: 1px solid var(--border-soft);
}
.modal-tab-btn {
  flex: 1; border: none; background: transparent; color: var(--text-2);
  padding: 5.5px 6px; border-radius: 999px; font-size: 11px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.modal-tab-btn.active { background: var(--surface-card); color: var(--text-1); box-shadow: 0 2px 6px rgba(45, 36, 22, 0.12); }
.modal-tab-pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.modal-tab-pane.active { display: flex; }
.badge-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 10px 12px; min-height: 0; }

.medal-album-strip { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.album-entry-pill {
  border: 1px solid var(--border-soft); background: rgba(255, 253, 248, 0.8);
  border-radius: 12px; padding: 7px 9px; cursor: pointer; display: flex; align-items: center; gap: 6px; text-align: left;
}
.album-entry-pill:hover { border-color: var(--gold); }
.album-entry-pill .aep-ic {
  width: 25px; height: 25px; border-radius: 8px; flex-shrink: 0;
  background: var(--gold-soft); color: var(--gold-deep); display: grid; place-items: center; font-size: 12px;
}
.album-entry-pill.is-pub .aep-ic { background: rgba(74, 122, 104, 0.14); color: #3D6B5A; }
.album-entry-pill .aep-txt { min-width: 0; flex: 1; }
.album-entry-pill .aep-t { font-size: 10.5px; font-weight: 700; color: var(--text-1); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-entry-pill .aep-s { font-size: 9.2px; color: var(--text-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.album-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-shrink: 0; }
.album-pane-head .aph-sub { font-size: 10.5px; color: var(--text-2); }
.album-add-btn {
  border: none; border-radius: 999px; padding: 5px 11px; cursor: pointer;
  background: linear-gradient(135deg, #E2C58B, #B8914D); color: #FFFDF8; font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.album-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.album-create-box {
  background: rgba(255, 253, 248, 0.88); border: 1px solid rgba(200, 167, 104, 0.45);
  border-radius: 16px; padding: 11px; display: none; flex-direction: column; gap: 7px; margin-bottom: 8px; flex-shrink: 0;
}
[data-theme="night"] .album-create-box, [data-theme="night"] .travel-album-card { background: rgba(28, 36, 52, 0.85); }
.album-create-box.open { display: flex; }
.album-create-row { display: flex; gap: 6px; align-items: center; }
.album-photo-drafts { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.album-photo-drafts img { width: 42px; height: 42px; border-radius: 7px; object-fit: cover; border: 1px solid var(--border-soft); }
.album-upload-chip {
  border: 1px dashed var(--gold); background: var(--gold-soft); color: var(--gold-deep);
  font-size: 10.5px; font-weight: 600; padding: 5px 9px; border-radius: 9px; cursor: pointer;
}
.travel-album-card {
  background: rgba(255, 253, 248, 0.8); border: 1px solid var(--border-soft);
  border-radius: 16px; padding: 10px 11px; display: flex; flex-direction: column; gap: 7px;
}
.tac-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.tac-title { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.tac-meta { font-size: 10px; color: var(--text-3); margin-top: 2px; }
.privacy-toggle {
  border: 1px solid var(--border-soft); background: rgba(110, 98, 80, 0.10);
  color: var(--text-2); font-size: 10px; font-weight: 700; padding: 3.5px 8px;
  border-radius: 999px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.privacy-toggle.is-public {
  background: linear-gradient(135deg, rgba(84, 140, 118, 0.18), rgba(200, 167, 104, 0.22));
  border-color: #548C76; color: #2F6853;
}
[data-theme="night"] .privacy-toggle.is-public { color: #8CE0BE; border-color: #59A587; }
.tac-filmstrip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.tac-photo-wrap {
  aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--plaster-flat);
  cursor: pointer; border: 1px solid rgba(105, 92, 74, 0.14);
}
.tac-photo-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tac-add-photo-tile {
  aspect-ratio: 4 / 3; border-radius: 8px; border: 1px dashed var(--gold);
  background: rgba(243, 234, 215, 0.45); color: var(--gold-deep);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 600; cursor: pointer;
}
.tac-note { font-size: 11px; color: var(--text-2); line-height: 1.45; }
.tac-author-row { display: flex; align-items: center; gap: 7px; }
.tac-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #E2C58B, #967438); color: #FFFDF8;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
}
.tac-foot { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--text-3); }
.tac-like-btn {
  border: 1px solid var(--border-soft); background: rgba(255,253,248,0.75);
  color: var(--text-2); padding: 2.5px 8px; border-radius: 999px; font-size: 10px; font-weight: 600; cursor: pointer;
}
.tac-like-btn.liked { border-color: #D46A5E; color: #C24B3E; background: rgba(212, 106, 94, 0.12); }
.mine-pub-tag {
  font-size: 9px; font-weight: 700; padding: 1.5px 6px; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold-deep); border: 1px solid rgba(200,167,104,0.45);
}

.album-lightbox {
  position: absolute; inset: 0; z-index: 70; border-radius: 28px;
  background: rgba(18, 17, 15, 0.95); backdrop-filter: blur(8px);
  display: none; flex-direction: column; padding: 14px; color: #F5F1E9;
}
.album-lightbox.open { display: flex; }
.lb-img-frame { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; margin: 10px 0; }
.lb-img-frame img { max-width: 100%; max-height: 100%; border-radius: 12px; object-fit: contain; border: 3px solid rgba(248, 244, 236, 0.88); }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.28); background: rgba(25,24,22,0.7); color: #FFF; font-size: 16px; cursor: pointer;
}
.lb-nav.prev { left: 4px; }
.lb-nav.next { right: 4px; }

.backplate {
  width: 112px; height: 112px; border-radius: 50%; margin: 4px auto 12px;
  background: conic-gradient(from 40deg, #EAD8AA, #B59252, #F3E5BF, #9A793D, #EAD8AA);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 6px rgba(255,255,255,0.65), 0 10px 22px rgba(96,76,36,0.28); position: relative; cursor: pointer;
}
.clutch-pin { width: 32px; height: 32px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFF4D4, #A38041); border: 2px solid #7C5E28; }
.backplate small { position: absolute; bottom: 12px; font-size: 9px; font-weight: 700; color: #5B431A; }
.state-segment {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  background: rgba(110,98,80,0.12); padding: 4px; border-radius: 14px; margin: 10px 0 6px;
}
.state-segment button { border: none; background: transparent; padding: 8px 4px; border-radius: 10px; font-size: 12px; color: var(--text-2); cursor: pointer; font-weight: 600; }
.state-segment button.active { background: linear-gradient(135deg, #E2C58B, #B8914D); color: #FFF; }
.note-area { width: 100%; border: 1px dashed var(--border-soft); border-radius: 14px; background: rgba(255,253,248,0.75); color: var(--text-1); padding: 10px; font-size: 12px; resize: none; height: 74px; font-family: inherit; }

/* Form / Auth / Poster Modals */
.form-card {
  width: 100%; max-width: 368px; max-height: 90dvh; overflow-y: auto;
  background: var(--plaster-grad); border-radius: 28px; padding: 18px;
  border: 1px solid rgba(255,255,255,0.65); box-shadow: 0 24px 50px rgba(20,18,14,0.3);
}
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.form-group label .req-star { color: #B94A3E; margin-left: 2px; }
.form-input, .form-select {
  width: 100%; padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--border-soft); background-color: rgba(255,253,248,0.9); color: var(--text-1);
  font-size: 12.5px; line-height: 1.35; outline: none;
}
[data-theme="night"] .form-input, [data-theme="night"] .form-select, [data-theme="night"] .search-box, [data-theme="night"] .note-area {
  background-color: rgba(28, 36, 52, 0.9);
}
.form-select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.75 4.5L6 7.75L9.25 4.5' stroke='%236B655B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px 12px;
}
.form-select.is-locked-city { background-image: none; padding-right: 12px; opacity: 0.78; }
.form-select.is-placeholder { color: var(--text-3); }
.form-error { border-color: #C45145 !important; }
.form-err-msg { font-size: 11px; color: #B94A3E; margin-bottom: 8px; display: none; }
.form-err-msg.show { display: block; }
.live-stamp-preview { padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 12px; }

.poster-frame {
  width: 332px; background: #F5F0E7; color: #22262C; border-radius: 22px; padding: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35); border: 1px solid rgba(200,167,104,0.35);
}
.poster-title { font-family: var(--font-display); font-size: 22px; text-align: center; letter-spacing: 0.08em; margin-bottom: 10px; }
.poster-map-box { background: #E6EBEF; border-radius: 14px; overflow: hidden; height: 228px; border: 1px solid rgba(110,102,88,0.14); }
.poster-pins-row { display: flex; justify-content: center; gap: 6px; margin: 12px 0; }
.poster-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(110,102,88,0.16); padding-top: 10px; font-size: 12px; }

/* True 3D Solid Extruded Metallic Plaque */
.medal3d-stage { position: relative; perspective: 820px; cursor: grab; user-select: none; touch-action: none; margin: 4px auto 10px; }
.medal3d-stage:active { cursor: grabbing; }
.medal3d-rig { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; will-change: transform; }
.m3d-layer { position: absolute; inset: 0; pointer-events: none; }
.m3d-front, .m3d-back { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.m3d-front-img, .m3d-edge-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.m3d-front-img { filter: drop-shadow(0 1px 1px rgba(48, 36, 18, 0.25)); }
.m3d-edge { background: transparent; }
.m3d-edge.edge-deep .m3d-edge-img { filter: brightness(0.78) contrast(1.12); }
.m3d-back { display: flex; align-items: center; justify-content: center; }
.m3d-back-img { width: 100%; height: 100%; object-fit: contain; display: block; transform: scaleX(-1); filter: brightness(1.04) contrast(1.06); }
.medal3d-stage[data-metal="roseGold"] .m3d-edge-img, .medal3d-stage[data-metal="roseGold"] .m3d-back-img { filter: hue-rotate(-18deg) saturate(1.12); }
.medal3d-stage[data-metal="moonSilver"] .m3d-edge-img, .medal3d-stage[data-metal="moonSilver"] .m3d-back-img { filter: saturate(0.08) brightness(1.06); }
.medal3d-stage[data-metal="roseGold"] .m3d-edge.edge-deep .m3d-edge-img { filter: hue-rotate(-18deg) saturate(1.12) brightness(0.8); }
.medal3d-stage[data-metal="moonSilver"] .m3d-edge.edge-deep .m3d-edge-img { filter: saturate(0.08) brightness(0.84); }
.m3d-clutch-assembly { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.m3d-clutch-cap {
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #FFF7DC 0%, #D2B170 48%, #7E5E24 100%);
  border: 1.5px solid #6E511D; box-shadow: 0 4px 8px rgba(45, 32, 10, 0.42); position: relative;
}
.m3d-clutch-cap::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 1.2px solid rgba(90, 66, 22, 0.55); background: radial-gradient(circle at 35% 35%, #FFF4D0, #B5924E); }
.m3d-clutch-wing { position: absolute; top: 8px; width: 14px; height: 11px; border-radius: 5px; background: linear-gradient(180deg, #F5E3B7, #9E7B3B); border: 1px solid #755822; }
.m3d-clutch-wing.left { left: -9px; transform: rotate(-14deg); }
.m3d-clutch-wing.right { right: -9px; transform: rotate(14deg); }
.m3d-engraved-serial { margin-top: 7px; font-size: 8.5px; font-weight: 700; letter-spacing: 0.1em; color: rgba(74, 52, 18, 0.85); }
.medal3d-shadow {
  position: absolute; left: 50%; bottom: -9px; width: 68%; height: 13px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(46, 36, 20, 0.36) 0%, rgba(46, 36, 20, 0) 74%);
  transform: translateX(-50%) scaleX(1); pointer-events: none;
}
.spin-mini-actions { display: flex; gap: 6px; justify-content: center; margin-top: 2px; }
.spin-chip {
  border: 1px solid rgba(150, 116, 56, 0.34); background: rgba(255, 252, 245, 0.78);
  color: #7D5E29; font-size: 10.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.spin-chip:hover { background: #F3EAD7; border-color: #C8A768; }

/* Desktop & Tablet Responsive Enhancements (>= 840px) */
@media (min-width: 840px) {
  .desktop-nav-pills { display: inline-flex; }
  .bottom-tabs { display: none; }
  .inner-page { padding-bottom: 24px; }
  .map-zoom-controls { bottom: 26px; left: 24px; }
  .fab-add-place { bottom: 26px; right: 24px; }
  .album-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .cabinet-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
  .col-scroll { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .province-sheet {
    left: auto; right: 20px; top: 80px; bottom: 20px; height: auto; width: 380px;
    border-radius: 26px; transform: translateX(115%);
    box-shadow: 0 20px 50px rgba(24, 28, 36, 0.22);
  }
  .province-sheet.open { transform: translateX(0); }
  .sheet-handle { display: none; }
}
