/* 晚霞猎人 · 活的暮色
   设计基调：气象仪器 × 暮色天际线。
   核心与以前相同——天空由真实数据绘制（云量、指数、降水概率），
   但这一版整个天空是 Canvas 实时渲染：云在漂、星在闪、余晖在呼吸。 */

:root {
  --bg: #0b0d16;
  --ink: #ece7dd;
  --dim: rgba(236, 231, 221, .55);
  --faint: rgba(236, 231, 221, .34);
  --line: rgba(236, 231, 221, .13);
  --panel-line: rgba(236, 231, 221, .1);

  /* 分档主题色（随 data-grade 切换） */
  --accent: #ffb454;
  --accent-soft: rgba(255, 180, 84, .15);

  --card-overlap: 84px;

  --mono: ui-monospace, "Cascadia Code", "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

body[data-grade="worth"]  { --accent: #ff8f4a; --accent-soft: rgba(255, 143, 74,  .16); }
body[data-grade="maybe"]  { --accent: #93a6c4; --accent-soft: rgba(147, 166, 196, .16); }
body[data-grade="skip"]   { --accent: #6b7688; --accent-soft: rgba(107, 118, 136, .18); }

* { box-sizing: border-box; }

html, body { margin: 0; }

html { overflow-x: hidden; }

body {
  min-height: 100vh;
  background:
    radial-gradient(120% 55% at 50% 112%, rgba(255, 142, 80, .09), transparent 58%),
    linear-gradient(180deg, #0a0c14 0%, var(--bg) 42%, #0d0a14 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 细微胶片颗粒 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  z-index: 40;
}

.wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 活的天空（全幅 hero） ---------- */

.hero {
  position: relative;
  height: clamp(340px, 46vh, 440px);
  overflow: hidden;
  background: linear-gradient(180deg, #070a16 0%, #241c3a 62%, #472845 88%, #0b0d16 89%);
}

.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  padding-top: 26px;
}

.hero-labels {
  position: absolute;
  z-index: 2;
  width: 100%;
  max-width: 660px;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--card-overlap) + 14px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.sky-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  color: rgba(236, 231, 221, .66);
  text-shadow: 0 1px 3px rgba(8, 8, 16, .8);
}

.sky-label.strong { color: rgba(250, 244, 232, .95); font-size: 11px; }

/* ---------- 页头（浮在天空上） ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  flex-wrap: wrap;
}

.brand {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(6, 8, 16, .7);
}

.brand-latin {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .34em;
  color: rgba(236, 231, 221, .45);
}

.search { display: flex; gap: 8px; }

.search input {
  width: 200px;
  padding: 9px 12px;
  font: 13px/1.4 var(--sans);
  color: var(--ink);
  background: rgba(10, 12, 22, .38);
  border: 1px solid rgba(236, 231, 221, .22);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  outline-offset: 2px;
  transition: border-color .2s ease, background .2s ease;
}

.search input::placeholder { color: rgba(236, 231, 221, .42); }

.search input:focus {
  border-color: var(--accent);
  background: rgba(10, 12, 22, .55);
}

.search input:focus-visible { outline: 2px solid var(--accent); }

.search button {
  position: relative;
  overflow: hidden;
  padding: 9px 15px;
  font: 600 13px/1.4 var(--sans);
  color: #221204;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  outline-offset: 2px;
  transition: filter .15s ease, transform .15s ease;
}

.search button:hover { filter: brightness(1.1); }

.search button:active { transform: scale(.97); }

.search button:focus-visible { outline: 2px solid var(--ink); }

.search button:disabled { filter: grayscale(.35) brightness(.8); cursor: wait; }

/* 按钮高光扫过 */
.search button::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  left: -70%;
  width: 46%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-18deg);
  transition: left .5s ease;
}

.search button:hover::after { left: 130%; }

.status {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: #ffb08d;
  text-shadow: 0 1px 3px rgba(8, 8, 16, .8);
}

.candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}

.candidates button {
  padding: 6px 12px;
  font: 500 12px/1.4 var(--mono);
  color: rgba(236, 231, 221, .78);
  background: rgba(10, 12, 22, .42);
  border: 1px solid rgba(236, 231, 221, .24);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: chip-in .28s cubic-bezier(.2, 1.4, .4, 1) both;
  transition: color .15s ease, border-color .15s ease, transform .15s ease;
}

.candidates button:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(6px) scale(.94); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 主面板（玻璃卡片，压在天空上） ---------- */

.panel {
  position: relative;
  z-index: 3;
  margin-top: calc(-1 * var(--card-overlap));
  background: rgba(14, 17, 28, .66);
  border: 1px solid rgba(236, 231, 221, .12);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .2);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

.panel.tilting { transition: none; }

.panel.drop-in { animation: panel-in .65s cubic-bezier(.2, .7, .2, 1) both; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

.panel.is-busy { opacity: .6; }

/* 鼠标光斑 */
.glare {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
  background: radial-gradient(380px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .07), transparent 62%);
}

.panel.tilting .glare { opacity: 1; }

/* ---------- 结论区 ---------- */

.verdict { padding: 22px 26px 20px; }

.verdict-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.place-name { font-size: 15px; font-weight: 700; letter-spacing: .02em; }

.place-date {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: .06em;
}

.grade {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 7px 12px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, transparent);
  background: var(--accent-soft);
  border-radius: 10px;
  animation: breathe 3.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50%      { box-shadow: 0 0 24px -6px color-mix(in srgb, var(--accent) 55%, transparent); }
}

.grade-label { font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }

.grade-hint { font-size: 11px; color: var(--dim); margin-top: 1px; }

/* 大分数 + 仪表环 */

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
}

.score-block {
  position: relative;
  width: 196px;
  height: 196px;
  flex: none;
}

.gauge { position: absolute; inset: 0; width: 100%; height: 100%; }

.gauge-track {
  fill: none;
  stroke: rgba(236, 231, 221, .09);
  stroke-width: 3;
}

.gauge-progress {
  fill: none;
  stroke: url(#gauge-grad);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 540.35;
  stroke-dashoffset: 540.35;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1.05s cubic-bezier(.25, .8, .25, 1);
}

.score {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.score-value {
  font-family: var(--mono);
  font-size: 68px;
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
}

.score-value.punch { animation: punch .5s cubic-bezier(.2, 1.6, .3, 1); }

@keyframes punch {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.score-unit { font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: .06em; }

/* 最佳窗口 + 实时倒计时 */

.window { text-align: right; }

.window-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .22em;
  color: var(--faint);
}

.window-range {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.window-range .dash { margin: 0 5px; color: var(--faint); font-weight: 400; }

.countdown {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 6px;
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.countdown[data-state="now"] { color: var(--accent); font-weight: 600; }

.countdown[data-state="after"] { color: var(--faint); }

.pulse-dot {
  display: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
}

.countdown[data-state="now"] .pulse-dot {
  display: inline-block;
  animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70%  { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* 今日时间轴 */

.timeline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.tl-caption {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .05em;
  color: var(--faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tl-track {
  position: relative;
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(236, 231, 221, .1);
}

.tl-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent) 75%, transparent));
  transition: width .6s ease;
}

.tl-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px var(--accent), 0 0 3px #fff;
  transition: left .6s ease;
}

.tl-sunset {
  position: absolute;
  top: 50%;
  left: 0;
  width: 2px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: 1px;
  background: var(--accent);
  opacity: .85;
}

/* AI 预告 */

.copy {
  margin-top: 16px;
  padding: 12px 14px 13px;
  border-left: 2px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%);
}

.copy-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  color: var(--faint);
}

.copy-text {
  margin: 6px 0 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink);
}

.copy.copy-anim { animation: copy-in .6s ease both; }

@keyframes copy-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 因子读数 ---------- */

.factors { padding: 2px 26px 18px; }

.factors-head {
  padding: 12px 0 10px;
  border-top: 1px solid var(--panel-line);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .22em;
  color: var(--faint);
}

.factor {
  display: grid;
  grid-template-columns: 96px 62px 1fr 34px;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
}

.factor-name { font-size: 13px; font-weight: 600; }

.factor-weight {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .08em;
  color: var(--faint);
  margin-top: 1px;
}

.factor-read {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar { height: 6px; background: rgba(255, 255, 255, .07); border-radius: 2px; overflow: hidden; }

.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 45%, transparent), var(--accent));
  border-radius: 2px;
  transition: width .9s cubic-bezier(.2, .7, .2, 1);
}

.factor:hover .bar i { box-shadow: 0 0 12px -2px var(--accent); }

.factor-score {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- 首屏署名 ---------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(120% 60% at 50% 110%, rgba(255, 142, 80, .12), transparent 60%),
    rgba(9, 11, 20, .95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity .6s ease;
  cursor: pointer;
}

.splash.hide { opacity: 0; pointer-events: none; }

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  animation: splash-rise .8s cubic-bezier(.2, .7, .2, 1) both;
}

.splash-brand { font-size: clamp(24px, 5vw, 30px); font-weight: 700; letter-spacing: .12em; }

.splash-latin {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .4em;
  padding-left: .4em;
  color: var(--faint);
}

.splash-rule {
  width: 44px;
  height: 1px;
  background: rgba(236, 231, 221, .25);
  margin: 16px 0 12px;
}

.splash-credit {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: .08em;
  color: var(--ink);
  animation: splash-rise .8s cubic-bezier(.2, .7, .2, 1) .18s both;
}

.splash-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .32em;
  padding-left: .32em;
  color: var(--accent);
  animation: splash-rise .8s cubic-bezier(.2, .7, .2, 1) .34s both;
}

@keyframes splash-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 页脚 ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 26px 16px;
  border-top: 1px solid var(--panel-line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--faint);
}

.foot-sep { opacity: .6; }

.page-foot {
  margin: 18px 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--faint);
}

/* ---------- 响应式 ---------- */

@media (max-width: 430px) {
  /* 窄屏时三条天际线标签太挤，只留 SUNSET 与方位 */
  .hero-labels .sky-label:first-child { display: none; }
}

@media (max-width: 560px) {
  :root { --card-overlap: 58px; }

  .wrap { padding: 0 14px; }

  .hero { height: 330px; }

  .hero-inner { padding-top: 20px; }

  .masthead { flex-direction: column; align-items: stretch; }

  .search input { flex: 1; width: auto; }

  .verdict { padding: 18px 18px 16px; }

  .score-row { flex-direction: column; align-items: flex-start; gap: 4px; }

  .score-block { width: 164px; height: 164px; }

  .score-value { font-size: 56px; }

  .window { text-align: left; }

  .countdown { justify-content: flex-start; }

  .factors { padding: 2px 18px 14px; }

  .factor { grid-template-columns: 84px 56px 1fr 30px; gap: 8px; }

  .foot { padding: 10px 18px 14px; }
}

/* ---------- 减少动态偏好 ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
