:root {
  --ink: #0b1b2a;
  --muted: #587089;
  --fog: #eef3f8;
  --mist: #ffffff;
  --line: #d5e0ea;
  --sea: #1e4fd8;
  --above: #0e9488;
  --sun: #ef9a2e;
  --night: #243a5e;
  --bad: #b91c1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Spline Sans", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: linear-gradient(180deg, #e3edf7 0%, var(--fog) 26%, #fbfdff 74%, var(--mist) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.cloud { position: absolute; display: block; border-radius: 50%; background: #fff; filter: blur(46px); opacity: .5; animation: drift linear infinite; }
.c1 { width: 380px; height: 150px; top: 6%; left: -12%; animation-duration: 90s; }
.c2 { width: 520px; height: 190px; top: 40%; left: -22%; opacity: .32; animation-duration: 128s; animation-delay: -40s; }
.c3 { width: 320px; height: 140px; top: 74%; left: -14%; opacity: .3; animation-duration: 110s; animation-delay: -20s; }
.c4 { display: none; }
@keyframes drift { from { transform: translateX(-16vw); } to { transform: translateX(132vw); } }

.wrap { width: min(1120px, 92vw); margin: 0 auto; position: relative; z-index: 1; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(12px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.logo { font-size: 26px; line-height: 1; color: var(--sea); }
h1 { font-family: "Fraunces", serif; font-size: 21px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.tagline { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }

.header-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pill-btn {
  background: var(--mist); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 12px; font-size: 12px; font-family: inherit; cursor: pointer; transition: .15s; white-space: nowrap;
}
.pill-btn:hover { border-color: var(--sea); color: var(--sea); }
.btn-accent {
  background: var(--sea); color: #fff; border: 1px solid var(--sea); border-radius: 6px;
  padding: 7px 14px; font-size: 12.5px; font-family: inherit; font-weight: 600; cursor: pointer; transition: .15s;
}
.btn-accent:hover { background: #1740b8; }
.lang-btn {
  background: var(--ink); color: #fff; text-decoration: none; border-radius: 6px;
  padding: 7px 14px; font-size: 12px; font-weight: 600; transition: .15s;
}
.lang-btn:hover { background: var(--sea); }
.link-btn { font-size: 12px; color: var(--sea); text-decoration: none; border-bottom: 1px solid rgba(30,79,216,.35); padding-bottom: 1px; }
.link-btn:hover { border-color: var(--sea); }

main { padding: 22px 0 40px; }

.panel {
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2, .about h2 { font-family: "Fraunces", serif; font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.hint, .muted { color: var(--muted); font-size: 12px; }
.small { font-size: 12px; }

.hero {
  position: relative; border-radius: 6px; overflow: hidden; margin-bottom: 16px;
  background: #0b1b2a; min-height: 440px;
  display: flex; align-items: flex-end;
}
.hero-media { position: absolute; inset: 0; background-size: cover; background-position: center; transition: background-image .5s; }
.hero-scrim { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6,20,34,.30) 0%, rgba(6,20,34,.55) 55%, rgba(6,20,34,.88) 100%); }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: end; padding: 26px; width: 100%; }

.hero-copy { color: #f2f7fc; max-width: 620px; }
.hero-kicker { margin: 0 0 8px; font-size: 12.5px; color: #b7c9dc; letter-spacing: .04em; }
.hero-title { font-family: "Fraunces", serif; font-size: clamp(28px, 4.4vw, 44px); font-weight: 600; line-height: 1.05; margin: 0 0 10px; letter-spacing: -.02em; }
.hero-verdict { font-size: 17px; font-weight: 600; margin: 0 0 10px; color: #ffd9a0; }

.status-line { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 4px; margin: 0 0 12px; }
.status-line.ok { background: rgba(14,148,136,.95); color: #fff; }
.status-line.bad { background: rgba(185,28,28,.95); color: #fff; }
.status-line.none { background: rgba(71,85,105,.9); color: #fff; }
.status-line.night { background: rgba(36,58,94,.97); color: #dbe6ff; }

.reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.reasons li { font-size: 12px; color: #e8f0f8; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 4px; padding: 4px 9px; }

.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.22); }
.fact { display: flex; flex-direction: column; gap: 3px; }
.fact-k { font-size: 11px; color: #9fb4c9; letter-spacing: .04em; }
.fact-v { font-size: 15px; font-weight: 600; color: #f2f7fc; }
.sun-info { display: flex; gap: 10px; }

.hero-figure { align-self: end; background: rgba(255,255,255,.94); border-radius: 8px; padding: 14px 14px 12px; }
.section-fig { width: 100%; }
.section-fig svg { width: 100%; height: auto; display: block; }
.hero-score { font-family: "Fraunces", serif; font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.02em; margin-top: 6px; }
.hero-score-unit { font-family: "Spline Sans", sans-serif; font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.section-cap { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.hero-credit { position: absolute; right: 14px; top: 12px; margin: 0; font-size: 10px; color: rgba(255,255,255,.78); z-index: 2; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 10px; }
.loc-card {
  border: 1px solid var(--line); background: var(--mist); border-radius: 6px; overflow: hidden; cursor: pointer;
  padding: 0; text-align: left; display: flex; flex-direction: column; transition: border-color .15s, transform .15s;
}
.loc-card:hover { border-color: var(--sea); transform: translateY(-2px); }
.loc-card.active { border-color: var(--sea); box-shadow: inset 0 0 0 1px var(--sea); }
.loc-photo { display: block; height: 104px; background-size: cover; background-position: center; background-color: #e6f0fb; filter: saturate(.95); }
.loc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.loc-name { font-size: 14px; font-weight: 600; }
.loc-sub { font-size: 11px; color: var(--muted); }
.loc-badges { display: flex; align-items: center; justify-content: space-between; margin-top: 3px; }
.loc-elev { font-size: 11px; color: var(--muted); }
.score-badge { font-size: 12.5px; font-weight: 600; border-radius: 4px; padding: 2px 8px; }

.map { height: 430px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.score-marker span { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 6px; font-weight: 600; font-size: 13px; border: 1px solid rgba(255,255,255,.85); }
.score-marker.selected span { outline: 2px solid var(--sea); outline-offset: 1px; }
.leaflet-container { font: inherit; background: #e9f0f7; }
.leaflet-popup-content { font-size: 13px; line-height: 1.5; }

.profile { width: 100%; }
.profile-svg { width: 100%; height: auto; display: block; }
.chart-label { font-size: 11px; fill: var(--muted); font-family: "Spline Sans", sans-serif; }
.chart-legend { font-size: 12px; font-weight: 600; font-family: "Spline Sans", sans-serif; }
.profile-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.lg::before { content: ""; width: 12px; height: 12px; display: inline-block; border-radius: 2px; margin-right: 6px; vertical-align: -1px; border: 1px solid transparent; }
.lg.below::before { background: rgba(14,148,136,.18); border-color: var(--above); }
.lg.in::before { background: rgba(185,28,28,.14); border-color: var(--bad); }
.lg.rise::before { background: var(--sun); border-color: var(--sun); }
.lg.set::before { background: var(--sea); border-color: var(--sea); }
.lg.night::before { background: rgba(36,58,94,.25); border-color: var(--night); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mini-strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; }
.mini-cell { height: 46px; border-radius: 3px; border: 1px solid rgba(15,34,51,.05); cursor: pointer; transition: transform .12s; }
.mini-cell:hover { transform: translateY(-2px); }
.mini-cell.night { background: repeating-linear-gradient(135deg, #dbe3ec 0, #dbe3ec 4px, #c9d4e0 4px, #c9d4e0 8px); }
.legend { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 12px; }
.legend.wide { margin-top: 14px; }
.legend-bar { height: 8px; flex: 1; border-radius: 2px;
  background: linear-gradient(90deg, #e2e8f0, #bfdbfe, #93c5fd, #38bdf8, #2dd4bf, #fbbf24, #f97316); }

.livecam-body { border-radius: 6px; overflow: hidden; background: #e9f0f7; border: 1px solid var(--line); position: relative; }
.livecam-body img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.livecam-note { font-size: 12px; color: var(--muted); padding: 9px 12px; margin: 0; }
.livecam-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.livecam-actions { display: flex; align-items: center; gap: 12px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--bad); letter-spacing: .06em; }
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s ease-in-out infinite; }
.live-badge.off { color: var(--muted); }
.live-badge.off i { background: var(--muted); animation: none; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .35; transform: scale(1.3);} }

.timeline { overflow-x: auto; padding-bottom: 6px; }
.tl-row { display: grid; grid-template-columns: 78px repeat(24, minmax(20px, 1fr)); gap: 3px; align-items: center; margin-bottom: 4px; }
.tl-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-label b { color: var(--ink); font-weight: 600; }
.tl-cell { height: 22px; border-radius: 3px; border: 1px solid rgba(15,34,51,.05); cursor: pointer; }
.tl-cell:hover { outline: 2px solid rgba(15,34,51,.4); outline-offset: -1px; }
.tl-cell.sel { outline: 2px solid var(--ink); outline-offset: -1px; }
.tl-cell.now { outline: 2px solid var(--sea); outline-offset: -1px; }
.tl-cell.sunrise { box-shadow: inset 0 0 0 2px var(--sun); }
.tl-cell.sunset { box-shadow: inset 0 0 0 2px var(--sea); }
.tl-cell.night { background: repeating-linear-gradient(135deg, #dbe3ec 0, #dbe3ec 4px, #c9d4e0 4px, #c9d4e0 8px); }

.windows { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.win-card { background: var(--mist); border: 1px solid var(--line); border-left: 3px solid var(--sea); border-radius: 6px; padding: 12px 14px; cursor: pointer; transition: border-color .15s, transform .15s; }
.win-card:hover { transform: translateY(-2px); border-color: var(--sea); }
.win-card .win-day { font-size: 12px; color: var(--muted); }
.win-card .win-time { font-size: 17px; font-weight: 600; font-family: "Fraunces", serif; margin: 3px 0; }
.win-card .win-meta { font-size: 12px; color: var(--muted); }
.win-card .win-score { float: right; font-family: "Fraunces", serif; font-size: 22px; font-weight: 600; }

.ranking { display: flex; flex-direction: column; gap: 6px; }
.rank-row {
  display: grid; grid-template-columns: 26px 54px 1fr auto auto; gap: 12px; align-items: center;
  background: var(--mist); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px;
  cursor: pointer; text-align: left; transition: border-color .15s;
}
.rank-row:hover { border-color: var(--sea); }
.rank-row.active { border-color: var(--sea); box-shadow: inset 0 0 0 1px var(--sea); }
.rank-no { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-photo { width: 54px; height: 36px; border-radius: 4px; background-size: cover; background-position: center; background-color: #e6f0fb; }
.rank-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rank-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { font-size: 11px; color: var(--muted); }
.rank-when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rank-score { font-family: "Fraunces", serif; font-size: 17px; font-weight: 600; min-width: 34px; text-align: center; border-radius: 4px; padding: 2px 6px; }

.detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
.detail-item { background: var(--fog); border-radius: 6px; padding: 12px 14px; }
.detail-item .k { font-size: 11px; color: var(--muted); }
.detail-item .v { font-family: "Fraunces", serif; font-size: 21px; font-weight: 600; margin-top: 4px; }
.detail-item .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.about p { font-size: 13.5px; line-height: 1.75; color: #2f4a66; max-width: 70ch; }
.about ul { margin: 10px 0; padding-left: 20px; }
.about li { font-size: 13.5px; line-height: 1.7; color: #2f4a66; margin-bottom: 4px; }
.about a { color: var(--sea); }
.credits { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.credits li { font-size: 12px; color: var(--muted); }
.credits a { color: var(--sea); text-decoration: none; }

.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(16px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 13px; opacity: 0; pointer-events: none; transition: .22s; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.site-footer { border-top: 1px solid var(--line); padding: 18px 0; color: var(--muted); font-size: 12px; background: rgba(255,255,255,.7); }
.site-footer .wrap { display: flex; justify-content: space-between; }

.page-reveal { animation: reveal .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .hero { min-height: 0; }
  .hero-facts { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-figure { justify-self: start; max-width: 340px; }
  .two-col { grid-template-columns: 1fr; }
  .map { height: 320px; }
  .rank-row { grid-template-columns: 22px 44px 1fr auto; }
  .rank-when { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud { animation: none; }
  .page-reveal { animation: none; }
  * { transition: none !important; }
}
