/* ---------- 主题变量：默认白天模式，[data-theme="dark"] 为夜晚模式 ---------- */
:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --bg-2: #ffffff;
  --bg-3: #eef1ef;
  --line: #e1e5e2;
  --text: #1a1f1c;
  --text-2: #3b443f;
  --muted: #6b756f;
  --accent: #138a52;
  --accent-text: #0f6b41;
  --accent-soft: #e2efe7;
  --accent-ink: #ffffff;
  --danger: #b9402a;
  --warn: #946200;
  --cyan: #0e7490;
  --map-bg: #e3e7e4;
  --attr-bg: rgba(255, 255, 255, .78);
  --attr-fg: #5b665f;
  --scroll-thumb: rgba(26, 31, 28, .22);
  --scroll-thumb-hover: rgba(26, 31, 28, .46);
  --shadow: 0 8px 24px rgba(23, 37, 30, .08);
  --on-photo: #eef2ef;
  --on-map-accent: #7fe0ad;
  --radius: 16px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1211;
  --bg-2: #151a18;
  --bg-3: #1c2320;
  --line: #27302c;
  --text: #e8ebe9;
  --text-2: #c9d0cc;
  --muted: #8f9a94;
  --accent: #34b378;
  --accent-text: #5cc890;
  --accent-soft: rgba(52, 179, 120, .14);
  --accent-ink: #07130d;
  --danger: #f08c6c;
  --warn: #e0b04a;
  --cyan: #45c4e0;
  --map-bg: #0e1211;
  --attr-bg: rgba(14, 18, 17, .72);
  --attr-fg: #8a958f;
  --scroll-thumb: rgba(255, 255, 255, .18);
  --scroll-thumb-hover: rgba(255, 255, 255, .38);
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
  display: flex; flex-direction: column; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { display: block; max-width: 100%; }
code { padding: 1px 6px; border-radius: 6px; background: var(--bg-3); font-size: .92em; }

/* ---------- 滚动条：跟随主题色，不使用系统默认样式 ---------- */
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: background-color .2s ease;
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: padding-box; }
  ::-webkit-scrollbar-corner { background: transparent; }
}
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000; flex: none;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  padding: 0 clamp(14px, 2.2vw, 48px); height: 62px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: .5px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M6 11h5l2-3h6l2 3h5v14H6z' fill='%23ffffff'/%3E%3Ccircle cx='16' cy='18' r='4.2' fill='%23138a52'/%3E%3Ccircle cx='16' cy='18' r='2' fill='%23ffffff'/%3E%3C/svg%3E") center/cover no-repeat;
}
.brand-text small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 3px; font-weight: 500; line-height: 1; }
.tabs { display: flex; gap: 4px; justify-content: center; }
.tabs a {
  padding: 8px 16px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: .2s; white-space: nowrap;
}
.tabs a:hover { color: var(--text); background: var(--bg-3); }
.tabs a.active { color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.search input {
  width: clamp(180px, 22vw, 340px); padding: 9px 14px 9px 36px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2396a59d' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") 12px center/16px no-repeat;
  color: var(--text); font-family: inherit; font-size: 14px; outline: none; transition: border-color .2s ease, background-color .25s ease;
}
.search input:focus { border-color: var(--accent); }
.theme-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--accent-text);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: .2s;
}
.theme-btn:hover { border-color: var(--accent); transform: rotate(15deg); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .icon-moon, [data-theme="dark"] .theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-moon { display: block; }

/* ---------- Layout：全宽自适应，不固定宽度居中 ---------- */
.view { width: 100%; flex: 1 0 auto; padding: 24px clamp(14px, 2.2vw, 48px) 20px; }
.site-footer {
  flex: none; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px;
  padding: 16px clamp(14px, 2.2vw, 48px); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: .5px; line-height: 1.25; }
.page-head h1 .eyebrow { display: block; margin-bottom: 6px; }
.page-head h1 small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 4px; letter-spacing: 0; }
.date-nav { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.date-nav button {
  width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--text); cursor: pointer; font-size: 18px; line-height: 1;
}
.date-nav button:hover { background: var(--bg-3); }
.date-nav button:disabled { opacity: .3; cursor: default; }
.date-nav span { min-width: 118px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.date-nav span.is-today { color: var(--accent-text); }
.eyebrow { color: var(--muted); font-weight: 600; letter-spacing: 2px; font-size: 12px; text-transform: uppercase; }

/* ---------- Cards ---------- */
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.grid > .card:only-child { max-width: min(100%, 560px); } /* 只有一张时不铺满整行，避免卡片过大 */
.card {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--bg-2);
  aspect-ratio: 3 / 2; cursor: pointer; isolation: isolate; box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  transition: transform .35s ease, box-shadow .35s ease;
}
.hero-grid .card { aspect-ratio: 16 / 11; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; background: var(--bg-3); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card:hover img { transform: scale(1.05); }
.card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(8, 9, 14, .55) 70%, rgba(8, 9, 14, .92) 100%);
}
.card-body { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 16px 18px; }
.card-title { color: #fff; font-size: 19px; font-weight: 700; line-height: 1.3; margin: 0 0 4px; }
.card-meta { color: var(--on-photo); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.card-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta .dot { opacity: .5; }
.card-meta svg { width: 13px; height: 13px; flex: none; color: var(--on-map-accent); }
.tags { position: absolute; left: 14px; top: 14px; display: flex; gap: 6px; z-index: 2; }
.tag {
  font-size: 12px; padding: 3px 9px; border-radius: 999px; font-weight: 600;
  background: rgba(13, 15, 20, .6); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .12);
}
.tag.accent { background: rgba(13, 15, 20, .62); color: var(--on-map-accent); border-color: transparent; }
.tag.time { color: #e6ebe8; }
.tag.region { color: #c5d3cd; }
.card.is-replay .card-title::after { content: "回看"; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .85); margin-left: 8px; vertical-align: middle; border: 1px solid rgba(255, 255, 255, .35); padding: 0 6px; border-radius: 6px; }
.card-placeholder { aspect-ratio: 16/11; border-radius: var(--radius); border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 20px; font-size: 14px; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 26px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-right: 14px; border-right: 1px solid var(--line); }
.chip-group:last-child { border-right: 0; }
.chip-group-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--muted); font-size: 13px; cursor: pointer; transition: .15s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 600; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 24px 0 16px; font-size: 20px; }
.section-title .count { color: var(--muted); font-size: 14px; font-weight: 400; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day-row { margin-bottom: 28px; }
.day-row:last-child { margin-bottom: 0; } /* 最后一天不再叠加下边距，避免卡片和页脚之间留白过高 */
.day-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.day-head b { color: var(--text); font-size: 16px; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Map ---------- */
.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.map-wrap.tall { height: calc(100vh - 150px); min-height: 480px; }
.map-wrap.week { height: 480px; }
.map-box { position: absolute; inset: 0; }
.leaflet-container { background: var(--map-bg); font-family: var(--font); }
.map-toolbar { position: absolute; top: 12px; right: 12px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.map-switch { display: flex; flex-direction: column; background: rgba(13, 15, 20, .9); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; overflow: hidden; }
.map-switch button {
  border: 0; background: transparent; color: #b8c2cf; padding: 7px 12px; text-align: left; cursor: pointer; font-size: 13px; white-space: nowrap;
}
.map-switch button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.map-switch button.active { color: var(--on-map-accent); font-weight: 600; }
.map-hint {
  position: absolute; left: 12px; bottom: 12px; z-index: 500; font-size: 12px; color: #e3e9f2;
  background: rgba(13, 15, 20, .82); border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; padding: 6px 10px; backdrop-filter: blur(8px); max-width: 75%;
}
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.map-legend .l-spot { background: var(--accent); }
.map-legend .l-subj { background: var(--cyan); }

/* markers */
.mk-thumb { width: 58px; height: 58px; border-radius: 12px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .6); background: #222; cursor: pointer; transition: transform .15s; }
.mk-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mk-thumb:hover { transform: scale(1.12); }
.mk-thumb.active { border-color: #fff; box-shadow: 0 0 0 3px var(--accent), 0 4px 14px rgba(0, 0, 0, .6); }
.mk-thumb.dot { border-radius: 50%; border-width: 2px; }
.mk-thumb.dot img { visibility: hidden; }
.mk-spot, .mk-subj { position: relative; }
.mk-spot .core, .mk-subj .core {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .55);
}
.mk-spot .core { background: var(--accent); }
.mk-subj .core { background: var(--cyan); }
.mk-spot .core svg, .mk-subj .core svg { transform: rotate(45deg); width: 18px; height: 18px; }
.mk-spot .pulse, .mk-subj .pulse { position: absolute; left: -8px; top: -8px; width: 50px; height: 50px; border-radius: 50%; animation: pulse 2.2s ease-out infinite; pointer-events: none; }
.mk-spot .pulse { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.mk-subj .pulse { background: color-mix(in srgb, var(--cyan) 35%, transparent); }
@keyframes pulse { 0% { transform: scale(.4); opacity: .9 } 100% { transform: scale(1.3); opacity: 0 } }
.leaflet-tooltip.mk-label { white-space: nowrap; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: rgba(13, 15, 20, .88); color: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.leaflet-tooltip.mk-label::before { display: none; }
.leaflet-tooltip.mk-label.c { color: var(--on-map-accent); }
.leaflet-tooltip.mk-label.s { color: var(--cyan); }
.leaflet-tooltip.mk-label.d { color: #dfe6ee; font-weight: 600; font-variant-numeric: tabular-nums; }
.leaflet-popup-content-wrapper { background: var(--bg-2); color: var(--text); border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--bg-2); }
.leaflet-popup-content { margin: 12px 14px; font-family: var(--font); font-size: 14px; line-height: 1.5; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-attribution { background: var(--attr-bg) !important; color: var(--attr-fg) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--attr-fg) !important; text-decoration: underline; }
.popup-title { font-weight: 700; margin-bottom: 2px; }
.popup-sub { color: var(--muted); font-size: 12px; margin-bottom: 8px; }

/* ---------- Detail ---------- */
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); background: var(--bg-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.1); }
.btn svg { width: 15px; height: 15px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 460px); gap: 26px; align-items: start; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.panel h2 svg { width: 18px; height: 18px; color: var(--accent-text); flex: none; }
.panel p { margin: 0 0 10px; color: var(--text-2); }
.panel p:last-child { margin-bottom: 0; }
.photo-frame { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-3); box-shadow: var(--shadow); }
.photo-frame img { width: 100%; height: auto; }
.photo-credit {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px; font-size: 12px; color: var(--on-photo);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .78)); display: flex; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap;
}
.photo-credit a { color: #cfe9db; }
.title-block h1 { margin: 0 0 6px; font-size: 32px; line-height: 1.2; }
.title-block .sub { color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.title-block .sub span { display: inline-flex; align-items: center; gap: 5px; }
.title-block .sub svg { width: 15px; height: 15px; flex: none; color: var(--accent-text); }
.sticky-col { position: sticky; top: 80px; }
.map-wrap.spot-map { height: 430px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.stat { background: var(--bg-3); border-radius: 12px; padding: 10px 12px; }
.stat .k { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.stat .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.focal-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.focal-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }
.focal-row output { min-width: 110px; font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.presets button { padding: 3px 9px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.presets button.active { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; font-weight: 600; }
.light-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.light { background: var(--bg-3); border-radius: 12px; padding: 10px 12px; }
.light .k { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.light .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.light .s { font-size: 11px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.kv { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text-2); }
.tips { list-style: none; padding: 0; margin: 0; }
.tips li { position: relative; padding: 6px 0 6px 26px; color: var(--text-2); }
.tips li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.acc { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.acc.high { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.acc.mid { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.acc.low { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.refs { display: flex; flex-wrap: wrap; gap: 8px; }
.refs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--bg-3); border: 1px solid var(--line); font-size: 13px; word-break: break-all; }
.refs a:hover { border-color: var(--accent); color: var(--accent-text); }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); flex: 1 1 220px; min-width: 0; }
.pager a:hover { border-color: var(--accent); }
.pager small { color: var(--muted); font-size: 12px; }
.pager b { font-size: 14px; }
.pager .next { text-align: right; }

/* ---------- Map overview ---------- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 18px; }
.map-list { max-height: calc(100vh - 150px); overflow: auto; padding-right: 6px; }
.map-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 8px; border-radius: 12px; cursor: pointer; align-items: center; }
.map-item:hover, .map-item.active { background: var(--bg-2); }
.map-item img { width: 92px; height: 62px; object-fit: cover; border-radius: 8px; }
.map-item b { display: block; font-size: 14px; line-height: 1.3; }
.map-item span { font-size: 12px; color: var(--muted); }

/* ---------- Quiz ---------- */
/* ---------- Quiz：照片按原始比例占满宽度（不裁切），答案栏紧随其下，页脚照常显示 ---------- */
.quiz-head { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; margin-bottom: 12px; flex: none; }
.quiz-progress { display: flex; gap: 4px; flex: 1 1 120px; max-width: 240px; }
.quiz-progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.quiz-progress i.done { background: var(--accent); }
.quiz-progress i.cur { background: var(--accent-text); }
.quiz-title { margin: 0; font-size: clamp(17px, 1.5vw, 22px); white-space: nowrap; }
.quiz-title small { color: var(--muted); font-weight: 500; font-size: 13px; margin-right: 8px; }
.quiz-hint { display: flex; gap: 6px; flex-wrap: wrap; }
.quiz-hint span { font-size: 12px; color: var(--muted); background: var(--bg-3); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.quiz-score { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); margin-left: auto; }
.quiz-score b { color: var(--accent-text); font-size: 18px; }
.quiz-q { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; flex: none; }
.quiz-q button { padding: clamp(8px, 1.2vh, 14px) 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; text-align: center; transition: .15s; min-width: 0; }
.quiz-q button b { display: block; font-size: clamp(15px, 1.4vw, 18px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-q button small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.quiz-q button:hover:not(:disabled) { border-color: var(--accent); }
.quiz-q button.ok { border-color: var(--accent); background: var(--accent-soft); }
.quiz-q button.bad { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.quiz-q button:disabled { cursor: default; }
/* 竖屏（默认）：照片占满宽度，按比例自然展开，页面正常滚动 */
.quiz-view { display: flex; flex-direction: column; }
.quiz-photo { margin-top: 12px; }
.quiz-photo img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
/* 横屏：整体一屏，照片等比放大铺满剩余区域，超出高度的上下部分裁掉，只显示垂直水平居中的部分 */
@media (orientation: landscape) {
  .quiz-view { height: calc(100vh - var(--quiz-fixed, 100px)); height: calc(100dvh - var(--quiz-fixed, 100px)); min-height: 420px; padding-bottom: 12px; }
  .quiz-photo { flex: 1 1 0; min-height: 0; }
  .quiz-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
}
.quiz-answer { /* 作答后在照片下方显示一行答案和按钮 */
  display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.quiz-answer h2 { margin: 0; font-size: 15px; flex: 1 1 260px; }
.quiz-answer .actions { margin: 0; margin-left: auto; }
.quiz-score { display: flex; gap: 14px; font-size: 14px; color: var(--muted); align-items: center; }
.quiz-score b { color: var(--accent-text); font-size: 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 2000;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow); font-size: 14px; max-width: calc(100vw - 28px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive：笔记本大屏到手机全宽自适应 ---------- */
@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
  .map-layout { grid-template-columns: 1fr; }
  .map-list { max-height: 360px; }
  .light-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr auto; height: auto; padding: 10px 14px; gap: 10px; }
  .tabs { grid-column: 1 / -1; order: 3; justify-content: flex-start; overflow-x: auto; }
  .topbar-right { order: 2; }
  .brand { font-size: 17px; }
  .view { padding: 18px 14px 60px; }
  .grid { gap: 12px; }
  .title-block h1 { font-size: 24px; }
  .map-wrap.spot-map { height: 340px; }
  .quiz-q { grid-template-columns: 1fr 1fr; }
  .quiz-title { white-space: normal; }
  .quiz-score { margin-left: 0; }
}
@media (max-width: 520px) {
  .page-head h1 { font-size: 22px; }
  .title-block h1 { font-size: 22px; }
  .tabs a { padding: 7px 12px; font-size: 14px; }
  .hero-grid, .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { border-radius: 14px; }
  .hero-grid .card { aspect-ratio: 4 / 3; }
  .card-title { font-size: 17px; }
  .stats, .light-row { grid-template-columns: 1fr 1fr; }
  .panel { padding: 16px; }
  .quiz-head { gap: 8px; margin-bottom: 10px; }
  .quiz-progress { flex-basis: 100%; max-width: none; }
  .quiz-photo { margin-top: 10px; }
  .quiz-answer { padding: 10px 12px; }
  .map-wrap.tall { height: 70vh; min-height: 380px; }
  .map-wrap.week { height: 360px; }
  .map-list { max-height: 300px; }
  .day-head { gap: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
