/* 盐News · 参数化版本：和 ClearArc 同一套黑金配色 */
:root {
  --bg: #050505;
  --panel: #0d0c0b;
  --ink: #f4f1ea;
  --ink-soft: rgba(244, 241, 234, 0.6);
  --ink-faint: rgba(244, 241, 234, 0.32);
  --line: rgba(244, 241, 234, 0.09);
  --gold: #d8b25c;
  --gold-soft: rgba(216, 178, 92, 0.14);
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --latin: "Cormorant Garamond", Georgia, serif;
  --mono: Inter, -apple-system, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  margin: 0;
  /* 极淡的点阵网格，像建模软件的底板 */
  background-image: radial-gradient(rgba(244, 241, 234, 0.07) 1px, transparent 1.2px);
  background-size: 28px 28px;
  background-attachment: fixed;
}

a { color: inherit; }

/* ================= 首屏 ================= */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: radial-gradient(120% 80% at 50% 45%, #14110b 0%, var(--bg) 62%);
  border-bottom: 1px solid var(--line);
}
.hero-mini { height: 62vh; min-height: 420px; }

#field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hud {
  position: absolute;
  z-index: 2;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  display: flex;
  gap: 18px;
  align-items: baseline;
  animation: fadeIn 1.2s var(--ease) 0.2s both;
}
.hud-tl { top: 26px; left: 32px; }
.hud-tr { top: 28px; right: 32px; font-variant-numeric: tabular-nums; }
.hud b { color: var(--gold); font-weight: 500; }
.hud .t { display: inline-block; min-width: 2.4em; text-align: right; }

.brand {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
}
.brand em {
  font-family: var(--latin);
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  color: var(--gold);
}
.hud-sub { text-transform: uppercase; }

.hero-copy {
  position: absolute;
  z-index: 2;
  left: 32px;
  right: 32px;
  bottom: 13vh;
  max-width: 760px;
  pointer-events: none;
}

.kicker {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: rise 1s var(--ease) 0.35s both;
}
.kicker::after {
  content: "";
  width: 64px;
  height: 1px;
  background: var(--gold);
  transform-origin: left;
  animation: grow 1.2s var(--ease) 0.8s both;
}

.date {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 7.4vw, 92px);
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-shadow: 0 4px 40px rgba(5, 5, 5, 0.9);
  animation: rise 1.1s var(--ease) 0.5s both;
}

.tagline {
  margin: 18px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
  animation: rise 1.1s var(--ease) 0.7s both;
}

.scroll-cue {
  position: absolute;
  z-index: 2;
  right: 32px;
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  text-decoration: none;
  animation: fadeIn 1s var(--ease) 1.2s both;
}
.scroll-cue i {
  width: 1px;
  height: 44px;
  background: linear-gradient(var(--gold), transparent);
  position: relative;
  overflow: hidden;
}
.scroll-cue i::after {
  content: "";
  position: absolute;
  left: 0;
  top: -40%;
  width: 1px;
  height: 40%;
  background: var(--ink);
  animation: drip 1.8s var(--ease) infinite;
}
.scroll-cue:hover { color: var(--gold); }

/* ================= 正文 ================= */
.rail {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 24px 96px;
  display: flex;
  flex-direction: column;
}

.back-link {
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
  margin-bottom: 32px;
  display: inline-block;
}
.back-link:hover { color: var(--gold); }
.back-link[hidden] { display: none; }

/* 比例尺 */
.ratio { margin-bottom: 40px; }
.ratio:empty { display: none; }
.ratio-bar { display: flex; gap: 4px; height: 6px; }
.ratio-bar span {
  flex: 1;
  background: rgba(244, 241, 234, 0.22);
  transform-origin: left;
  animation: grow 0.9s var(--ease) both;
  animation-delay: calc(var(--i) * 60ms + 200ms);
}
.ratio-bar span.china { background: var(--gold); }
.ratio-legend {
  margin: 12px 0 0;
  display: flex;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.ratio-legend span:first-child { color: var(--ink-soft); margin-right: auto; }
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  background: rgba(244, 241, 234, 0.4);
  vertical-align: 0;
}
.dot.china { background: var(--gold); }

/* 新闻列表 */
.list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.item {
  border-bottom: 1px solid var(--line);
  position: relative;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), background 0.4s ease;
  transition-delay: calc(var(--i) * 50ms);
}
.item.in { opacity: 1; transform: none; }
/* 左侧一根金线，展开时从上往下画出来 */
.item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--gold);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.6s var(--ease);
}
.item[open]::before { transform: scaleY(1); }
.item[open] { background: linear-gradient(90deg, var(--gold-soft), transparent 70%); }

.item summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 34px 48px 1fr 14px;
  align-items: center;
  gap: 18px;
  padding: 24px 14px 24px 16px;
  -webkit-tap-highlight-color: transparent;
}
.item summary::-webkit-details-marker { display: none; }

.num {
  font-family: var(--latin);
  font-size: 22px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}
.item[open] .num { color: var(--gold); }

/* 由标题生成的小图形 */
.glyph-wrap { width: 48px; height: 48px; display: block; }
.glyph {
  width: 48px;
  height: 48px;
  display: block;
  overflow: visible;
  transition: transform 1.2s var(--ease);
}
.glyph path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 0.7;
  opacity: calc(0.9 - var(--ring) * 0.18);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.in .glyph path,
.archive-cell.in .glyph path {
  animation: draw 1.8s var(--ease) both;
  animation-delay: calc(var(--ring) * 140ms + 200ms);
}
.item[open] .glyph { transform: rotate(90deg) scale(1.08); }

.item-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.item-meta { display: flex; align-items: center; gap: 12px; }

.tag {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 2px 8px;
}
.tag.china { color: var(--gold); border-color: rgba(216, 178, 92, 0.4); }

.formula {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.4s ease, transform 0.4s var(--ease);
}
.item[open] .formula { opacity: 1; transform: none; }

.headline {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.55;
  transition: color 0.25s ease;
}

.chev {
  width: 9px;
  height: 9px;
  border-right: 1.2px solid var(--gold);
  border-bottom: 1.2px solid var(--gold);
  transform: rotate(-45deg);
  transition: transform 0.4s var(--ease);
}
.item[open] .chev { transform: rotate(45deg); }

.detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}
.item[open] .detail { grid-template-rows: 1fr; }
.detail-inner { min-height: 0; overflow: hidden; padding-left: 132px; padding-right: 30px; }

.summary-text {
  margin: 0;
  padding-top: 2px;
  font-size: 15px;
  line-height: 1.9;
  color: rgba(244, 241, 234, 0.82);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.4s ease 0.1s, transform 0.5s var(--ease) 0.1s;
}
.item[open] .summary-text { opacity: 1; transform: none; }

.meta-row { padding: 16px 0 28px; font-size: 13px; }
.read-link {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.read-link:hover { border-bottom-color: var(--gold); }

.read-link:focus-visible,
.item summary:focus-visible,
.back-link:focus-visible,
.archive-cell:focus-visible,
.scroll-cue:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 3px;
}

/* 页脚 */
.site-footer {
  margin-top: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer .maker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; color: var(--ink-faint); }

/* ================= 归档页 ================= */
.archive-group + .archive-group { margin-top: 56px; }

.archive-month {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.archive-month span { font-family: var(--latin); font-size: 18px; color: var(--ink-faint); }
.archive-month b { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.archive-month i { margin-left: auto; font-style: normal; font-size: 12px; color: var(--ink-faint); }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.archive-cell {
  background: var(--bg);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 8px 14px;
  text-decoration: none;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.8s var(--ease), background 0.3s ease;
}
.archive-cell.in { opacity: 1; }
.archive-cell .glyph { width: 46px; height: 46px; margin-bottom: 4px; }
.archive-date { font-family: var(--latin); font-size: 24px; line-height: 1; }
.archive-count { font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.error-note { font-size: 14px; color: var(--ink-soft); line-height: 1.8; padding-top: 24px; }

/* ================= 悬停（只对有鼠标的设备） ================= */
@media (hover: hover) and (pointer: fine) {
  .item summary:hover .headline { color: var(--gold); }
  .item summary:hover .glyph { transform: rotate(45deg); }
  .item[open] summary:hover .glyph { transform: rotate(135deg) scale(1.08); }
  .archive-cell:hover { background: #12100c; }
  .archive-cell:hover .glyph { transform: rotate(60deg) scale(1.1); }
}

/* ================= 手机 ================= */
@media (max-width: 640px) {
  .hud-tl { top: 20px; left: 20px; }
  .hud-tr { top: auto; bottom: 34px; left: 20px; right: auto; gap: 12px; font-size: 10px; }
  .hud-sub { display: none; }
  .hero-copy { left: 20px; right: 20px; bottom: 96px; }
  .scroll-cue { right: 20px; bottom: 30px; }
  .scroll-cue span { display: none; }
  .rail { padding: 48px 16px 72px; }
  .item summary { grid-template-columns: 40px 1fr 12px; gap: 14px; padding: 20px 6px 20px 10px; }
  .num { display: none; }
  .glyph-wrap, .glyph { width: 40px; height: 40px; }
  .headline { font-size: 16.5px; }
  .detail-inner { padding-left: 64px; padding-right: 12px; }
  .site-footer { flex-direction: column; gap: 16px; }
}

/* ================= 淡金色光点鼠标 ================= */
.has-glow-cursor, .has-glow-cursor * { cursor: none !important; }
/* 输入文字的地方还是用普通光标，方便定位 */
.has-glow-cursor input, .has-glow-cursor textarea { cursor: text !important; }

.cursor-dot, .cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.cursor-on .cursor-dot, .cursor-on .cursor-glow { opacity: 1; }

/* 中心的小亮点 */
.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: #f6e3b0;
  box-shadow: 0 0 6px 2px rgba(246, 227, 176, 0.75), 0 0 14px 4px rgba(216, 178, 92, 0.45);
}

/* 慢半拍跟过来的柔光 */
.cursor-glow {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
}
.cursor-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 200, 120, 0.32) 0%, rgba(216, 178, 92, 0.12) 38%, rgba(216, 178, 92, 0) 70%);
  transition: transform 0.45s var(--ease), opacity 0.3s ease;
}
/* 移到能点的东西上：光晕放大、多一圈细金环 */
.cursor-hot .cursor-glow::before { transform: scale(1.7); }
.cursor-glow::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px solid rgba(216, 178, 92, 0.6);
  transform: scale(0.4);
  opacity: 0;
  transition: transform 0.45s var(--ease), opacity 0.3s ease;
}
.cursor-hot .cursor-glow::after { transform: scale(1); opacity: 1; }
/* 按下去时收一下 */
.cursor-down .cursor-glow::before { transform: scale(0.8); }
.cursor-down .cursor-dot { transform-origin: center; }

/* ================= 动画 ================= */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drip { to { top: 110%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .item, .archive-cell { opacity: 1; transform: none; }
  .glyph path { stroke-dashoffset: 0; }
}
