:root {
  --bg: #07080a;
  --panel: rgba(18, 21, 23, 0.72);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #e9eeea;
  --muted: #8f9c96;
  --accent: #8ef2c0;
  --accent-dim: rgba(142, 242, 192, 0.16);
  --warn: #f0c36a;
  --radius: 16px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 10% -6%, rgba(57, 230, 255, 0.10), transparent 62%),
    radial-gradient(820px 520px at 92% 6%, rgba(255, 47, 160, 0.09), transparent 64%),
    radial-gradient(1100px 620px at 50% -12%, rgba(142, 242, 192, 0.08), transparent 62%),
    radial-gradient(760px 460px at 88% 108%, rgba(120, 170, 255, 0.07), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 44px),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* CRT 扫描线 + 暗角 */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.028) 0px,
    rgba(255, 255, 255, 0.028) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: screen;
  opacity: 0.5;
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(120% 100% at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.55) 100%);
}

.hero {
  position: relative;
  z-index: 4;
  max-width: 880px;
  margin: 0 auto;
  padding: 64px 22px 14px;
  text-align: center;
}

.brand {
  font-family: var(--mono);
  font-size: clamp(30px, 6vw, 46px);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #f4fbf7;
  text-shadow:
    0 0 18px rgba(142, 242, 192, 0.55),
    0 0 52px rgba(142, 242, 192, 0.22),
    -2px 0 0 rgba(57, 230, 255, 0.45),
    2px 0 0 rgba(255, 47, 160, 0.40);
}
.brand span {
  margin: 0 0.16em;
  color: var(--accent);
}

.sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.06em;
}

/* ---------------- 头图: 一排缩略图 + 悬停弹出 ---------------- */
.hero-gallery {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
  padding: 84px 10px 20px;
}

.thumb {
  position: relative;
  flex: 0 0 156px;
  height: 104px;
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #0b0d10;
  cursor: zoom-in;
  z-index: 1;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(57, 230, 255, 0.5),
    0 6px 18px rgba(0, 0, 0, 0.55);
  transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.2, 1),
              box-shadow 0.32s ease, opacity 0.3s ease, filter 0.3s ease;
  will-change: transform;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.02);
}

/* 悬停/键盘聚焦: 原地放大弹出, 盖住相邻缩略图 */
.thumb:hover,
.thumb:focus-visible {
  transform: translateY(-6px) scale(2.4);
  z-index: 20;
  outline: none;
  box-shadow:
    0 0 0 1px rgba(150, 248, 255, 0.95),
    0 0 30px rgba(255, 47, 160, 0.42),
    0 24px 52px rgba(0, 0, 0, 0.7);
}

/* 首尾两张向内放大, 避免弹出画面被页面边缘裁掉 */
.thumb:first-child { transform-origin: left center; }
.thumb:last-child { transform-origin: right center; }

/* 鼠标在整排上时, 其它缩略图淡出, 突出重点 */
.hero-gallery:hover .thumb:not(:hover) {
  opacity: 0.55;
  filter: saturate(0.7) brightness(0.85);
}

/* 静态扫描线: 浅色细横纹 + 青/洋红色偏, 只压暗不糊图 */
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(140deg, rgba(57, 230, 255, 0.08), transparent 42%, rgba(255, 47, 160, 0.10) 100%),
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.14) 0px,
      rgba(0, 0, 0, 0.14) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.7;
}

/* 悬停时只有一条柔和的扫描光带缓慢自上而下扫过 */
.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to bottom, transparent, rgba(170, 252, 255, 0.28) 50%, transparent) 0 -40px / 100% 32px no-repeat;
  transition: opacity 0.3s ease;
}

.thumb:hover::before,
.thumb:focus-visible::before {
  opacity: 1;
  animation: crt-sweep 6s linear infinite;
}

/* 光带约 6 秒扫完一趟, 慢而不抢戏 */
@keyframes crt-sweep {
  from { background-position: 0 -40px; }
  to { background-position: 0 130px; }
}

.thumb figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 14px 8px 5px;
  background: linear-gradient(to top, rgba(4, 6, 8, 0.85), transparent);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.thumb .shot-tag {
  color: #d9fff4;
  text-shadow: 0 0 10px rgba(142, 242, 192, 0.55);
}

/* 触屏设备没有悬停, 关掉弹出、淡出与扫描动画 */
@media (hover: none) {
  .thumb:hover,
  .thumb:focus-visible {
    transform: none;
    box-shadow:
      0 0 0 1px rgba(57, 230, 255, 0.5),
      0 6px 18px rgba(0, 0, 0, 0.55);
  }
  .hero-gallery:hover .thumb:not(:hover) { opacity: 1; filter: none; }
  .thumb::before,
  .thumb:hover::before,
  .thumb:focus-visible::before {
    opacity: 0;
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thumb { transition: none; }
  .thumb:hover, .thumb:focus-visible { transform: none; }
  .thumb:hover::before,
  .thumb:focus-visible::before { animation: none; opacity: 0; }
}

main {
  position: relative;
  z-index: 4;
  max-width: 880px;
  margin: 0 auto;
  padding: 26px 22px 60px;
  display: grid;
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px 22px;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.pill {
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(142, 242, 192, 0.3);
  white-space: nowrap;
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.meta > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}
.meta dt {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.meta dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-family: var(--mono);
  word-break: break-all;
}

.install-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 18px;
}
.choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}
.choice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.choice-head h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--text);
}
.choice-desc {
  margin: 0;
  flex: 1;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}
.choice esp-web-install-button {
  display: block;
  width: 100%;
}
.choice .btn-primary {
  width: 100%;
}

.installer {
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}

.btn-primary {
  display: inline-block;
  padding: 13px 34px;
  border-radius: 999px;
  border: 1px solid rgba(142, 242, 192, 0.55);
  background: linear-gradient(180deg, rgba(142, 242, 192, 0.24), rgba(142, 242, 192, 0.10));
  color: #eafff5;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 0 26px rgba(142, 242, 192, 0.22);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 36px rgba(142, 242, 192, 0.38);
  background: linear-gradient(180deg, rgba(142, 242, 192, 0.32), rgba(142, 242, 192, 0.14));
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.btn-ghost:hover {
  border-color: rgba(142, 242, 192, 0.5);
  color: var(--accent);
  background: rgba(142, 242, 192, 0.06);
}

.hint {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--warn);
  background: rgba(240, 195, 106, 0.08);
  border: 1px solid rgba(240, 195, 106, 0.28);
}

.diag {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: #66736d;
  word-break: break-all;
}

.open-new { margin: 10px 0 0; }
.open-new a { text-decoration: none; }

.steps {
  margin: 18px 0 0;
  padding: 0 0 0 22px;
  font-size: 14px;
  color: #c9d3ce;
}
.steps li { margin: 6px 0; }
.steps code, .note code, .markdown code {
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
}

.note {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.loading {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* 本次更新内容 */
.changelog {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.changelog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.changelog h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.markdown.compact {
  max-height: none;
  overflow: visible;
  font-size: 13.5px;
  padding: 0;
}
.markdown.compact p { margin: 6px 0; }
.markdown.compact ul { margin: 4px 0; }
.markdown.compact li { margin: 3px 0; }
.markdown.compact strong { color: #eaf3ee; }

/* 使用说明正文 */
.markdown {
  margin-top: 6px;
  font-size: 14.5px;
  color: #d6ded9;
  max-height: 72vh;
  overflow: auto;
  padding-right: 6px;
}
.markdown::-webkit-scrollbar { width: 8px; }
.markdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}
.markdown h1 { font-size: 22px; margin: 10px 0 14px; color: #f2f8f4; }
.markdown h2 {
  font-size: 17px;
  margin: 26px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
}
.markdown h3 { font-size: 15px; margin: 18px 0 8px; }
.markdown p { margin: 8px 0; }
.markdown ul, .markdown ol { padding-left: 22px; }
.markdown li { margin: 4px 0; }
.markdown hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 22px 0;
}
.markdown blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 3px solid rgba(142, 242, 192, 0.5);
  background: rgba(142, 242, 192, 0.05);
  color: #b7c6be;
  border-radius: 0 8px 8px 0;
}
.markdown table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13.5px;
}
.markdown th, .markdown td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
}
.markdown th {
  background: rgba(255, 255, 255, 0.05);
  color: #eef6f1;
  font-weight: 600;
}
.markdown tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}
.markdown pre {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  overflow: auto;
}
.markdown pre code {
  background: none;
  border: 0;
  padding: 0;
}

footer {
  position: relative;
  z-index: 4;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 22px 46px;
  text-align: center;
  font-size: 12.5px;
  color: #6f7c76;
}
footer .icp {
  margin: 6px 0 0;
}
footer .icp a {
  color: #6f7c76;
  text-decoration: none;
  border-bottom: 1px dotted rgba(143, 156, 150, 0.5);
  transition: color 0.2s ease, border-color 0.2s ease;
}
footer .icp a:hover {
  color: var(--accent);
  border-bottom-color: rgba(142, 242, 192, 0.6);
}

@media (max-width: 620px) {
  .hero { padding-top: 44px; }
  .card { padding: 18px 16px; }
  .meta { grid-template-columns: 1fr; }
  .markdown { max-height: none; }
  .install-choices { grid-template-columns: 1fr; }
  .hero-gallery {
    justify-content: flex-start;
    overflow-x: auto;
    margin: 14px -22px 0;
    padding: 14px 22px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .thumb { flex: 0 0 136px; height: 88px; scroll-snap-align: start; }
  .thumb:first-child, .thumb:last-child { transform-origin: center; }
  .hero-gallery::-webkit-scrollbar { height: 4px; }
  .hero-gallery::-webkit-scrollbar-thumb { background: rgba(142, 242, 192, 0.25); border-radius: 2px; }
}
