/* =========================================================
   GATTACA — 设计系统
   冷峻 / 克制 / 纵深感：近黑底 + 银灰 + 冷白 + 淡蓝点缀
   ========================================================= */

:root {
  /* 底色 */
  --void:      #07080A;
  --panel:     #0C0E11;
  --panel-2:   #11141A;
  --panel-3:   #161A21;

  /* 线条 */
  --line:      rgba(198, 214, 229, 0.09);
  --line-2:    rgba(198, 214, 229, 0.16);
  --line-3:    rgba(198, 214, 229, 0.26);

  /* 文字 */
  --text:      #DCE3EA;
  --text-2:    #98A3AF;
  --text-3:    #66717E;
  --text-4:    #454E59;

  /* 冷色点缀 */
  --ice:       #8FC7D8;
  --ice-soft:  rgba(143, 199, 216, 0.14);
  --ice-line:  rgba(143, 199, 216, 0.38);
  --steel:     #5E8C9E;
  --silver:    #C6CFD8;
  --warn:      #C9A227;

  /* 字体：全部本地字体，不依赖外网 */
  --font-mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", "SF Mono",
               "SFMono-Regular", Consolas, "DejaVu Sans Mono", monospace;
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;

  /* 尺度 */
  --maxw: 1080px;
  --pad: clamp(20px, 5vw, 48px);
  --nav-h: 66px;

  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
  --slow: 620ms;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: 0.015em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景：冷光晕 + 网格 + 暗角，制造纵深 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 76% -8%, rgba(143, 199, 216, 0.09), transparent 60%),
    radial-gradient(900px 600px at 6% 4%, rgba(94, 140, 158, 0.07), transparent 62%),
    linear-gradient(180deg, #090B0E 0%, #07080A 42%, #050608 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(140% 100% at 50% 0%, #000 12%, transparent 74%);
  -webkit-mask-image: radial-gradient(140% 100% at 50% 0%, #000 12%, transparent 74%);
  opacity: 0.85;
}

img { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 240ms var(--ease), border-color 240ms var(--ease);
}

a:hover { color: var(--ice); }

::selection {
  background: var(--ice);
  color: var(--void);
}

:focus-visible {
  outline: 1px solid var(--ice);
  outline-offset: 3px;
}

/* ---------------- 排版 ---------------- */

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: clamp(22px, 3.2vw, 30px); }
h3 { font-size: 18px; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.muted { color: var(--text-2); }
.dim   { color: var(--text-3); }
.ice   { color: var(--ice); }

/* ---------------- 布局 ---------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

main { padding-top: var(--nav-h); }

.section {
  padding: clamp(56px, 8vw, 96px) 0;
  border-top: 1px solid var(--line);
}

.section--tight { padding: clamp(36px, 5vw, 56px) 0; }
.section:first-of-type { border-top: 0; }

/* 章节头：SEQ 编号 + 标题 + 细线 */
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 34px;
}

.sec-head__seq {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ice);
  padding-top: 4px;
  white-space: nowrap;
}

.sec-head__title { flex: 0 1 auto; }

.sec-head__rule {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
  margin-bottom: 6px;
}

.sec-head__note {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-3);
  white-space: nowrap;
}

/* 页头（内页通用） */
.page-head {
  padding: clamp(48px, 7vw, 88px) 0 clamp(28px, 4vw, 44px);
}
.page-head__seq {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--ice);
  margin-bottom: 18px;
}
.page-head h1 { margin-bottom: 14px; }
.page-head__lede {
  max-width: 60ch;
  color: var(--text-2);
  font-size: 15px;
}

/* ---------------- 导航 ---------------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background 400ms var(--ease), border-color 400ms var(--ease),
              backdrop-filter 400ms var(--ease);
}

.nav.is-scrolled {
  background: rgba(7, 8, 10, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.34em;
  color: var(--text);
  text-indent: 0.34em;
}
.nav__brand:hover { color: var(--text); }

.nav__mark {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--ice);
  text-indent: 0;
  opacity: 0.9;
}
.nav__brand:hover .nav__mark { opacity: 1; }

.nav__links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
}

.nav__link {
  position: relative;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 6px 0;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--ice);
  transition: right 420ms var(--ease);
}

.nav__link:hover { color: var(--text); }
.nav__link:hover::after { right: 0; }

.nav__link.is-active { color: var(--ice); }
.nav__link.is-active::after { right: 0; background: var(--ice-line); }

.nav__toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav__toggle:hover { border-color: var(--ice-line); color: var(--ice); }
.nav__toggle svg { width: 18px; height: 18px; }

/* 顶部序列条：缓慢推进的高光 */
.nav__scan {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  overflow: hidden;
  opacity: 0.65;
}
.nav__scan::before {
  content: "";
  position: absolute;
  top: 0;
  left: -30%;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--ice), transparent);
  animation: scan 9s linear infinite;
}
@keyframes scan {
  to { left: 100%; }
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 24px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 320ms var(--ease), background 320ms var(--ease),
              color 320ms var(--ease), transform 320ms var(--ease);
}

.btn:hover {
  border-color: var(--ice-line);
  color: var(--ice);
  background: var(--ice-soft);
}
.btn:active { transform: translateY(1px); }

.btn--solid {
  background: var(--ice);
  border-color: var(--ice);
  color: #06181E;
}
.btn--solid:hover {
  background: #A6D6E4;
  border-color: #A6D6E4;
  color: #06181E;
}

.btn--ghost { border-color: transparent; color: var(--text-2); }

/* ---------------- 标签 ---------------- */

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  white-space: nowrap;
}

.tag--ice {
  color: var(--ice);
  border-color: var(--ice-line);
  background: var(--ice-soft);
}

.tag--warn { color: var(--warn); border-color: rgba(201, 162, 39, 0.4); }

/* 状态点 */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-2);
}
.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(143, 199, 216, 0.12);
}
.status--live { color: var(--ice); }
.status--done { color: var(--text-3); }
.status--done::before { box-shadow: none; }

/* ---------------- 卡片 / 条目 ---------------- */

.grid {
  display: grid;
  gap: 18px;
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(143, 199, 216, 0.035), transparent 55%), rgba(12, 14, 17, 0.72);
  transition: border-color 380ms var(--ease), background 380ms var(--ease),
              transform 380ms var(--ease);
}

.card:hover {
  border-color: var(--line-3);
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(143, 199, 216, 0.07), transparent 60%), rgba(17, 20, 26, 0.8);
}

/* 角标：标本框的暗示 */
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  opacity: 0;
  transition: opacity 380ms var(--ease);
}
.card::before {
  top: -1px; left: -1px;
  border-top: 1px solid var(--ice);
  border-left: 1px solid var(--ice);
}
.card::after {
  bottom: -1px; right: -1px;
  border-bottom: 1px solid var(--ice);
  border-right: 1px solid var(--ice);
}
.card:hover::before,
.card:hover::after { opacity: 0.85; }

.card__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ice);
  margin-bottom: 12px;
}
.card__title { margin-bottom: 10px; }
.card__desc { color: var(--text-2); font-size: 14px; }
.card__foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

/* 列表条目 */
.rows { border-top: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  transition: background 320ms var(--ease), padding-left 320ms var(--ease);
}
.row:hover {
  background: linear-gradient(90deg, var(--ice-soft), transparent 70%);
  padding-left: 12px;
}
.row__date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.row__title { font-size: 17px; margin-bottom: 6px; }
.row__desc { color: var(--text-2); font-size: 14px; }
.row__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  white-space: nowrap;
}
.row:hover .row__title { color: var(--ice); }

/* ---------------- 表单 ---------------- */

.field { margin-bottom: 22px; }
.field__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 9px;
}
.field__input,
.field__area {
  width: 100%;
  background: rgba(12, 14, 17, 0.8);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 13px 15px;
  transition: border-color 300ms var(--ease), background 300ms var(--ease);
}
.field__area { min-height: 148px; resize: vertical; line-height: 1.8; }
.field__input:focus,
.field__area:focus {
  outline: none;
  border-color: var(--ice-line);
  background: rgba(17, 20, 26, 0.9);
}
.field__input::placeholder,
.field__area::placeholder { color: var(--text-4); }
.field__err {
  display: none;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--warn);
}
.field.is-invalid .field__input,
.field.is-invalid .field__area { border-color: rgba(201, 162, 39, 0.55); }
.field.is-invalid .field__err { display: block; }

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

.foot {
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  margin-top: 20px;
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
  justify-content: space-between;
}
.foot__brand {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.32em;
  color: var(--text-2);
  text-indent: 0.32em;
}
.foot__sig {
  margin-top: 12px;
  max-width: 34ch;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.9;
}
.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.foot__links a { color: var(--text-2); }
.foot__bottom {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-4);
}

/* ---------------- 入场动效 ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
}

.reveal.is-in {
  animation: rise var(--slow) var(--ease) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

/* 无 JS 时兜底：内容可见 */
.no-js .reveal { opacity: 1; transform: none; }

/* ---------------- 移动端导航 ---------------- */

@media (max-width: 820px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }

  .nav.is-open {
    background: rgba(7, 8, 10, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--line);
  }

  .nav.is-open .nav__links {
    display: flex;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 18px var(--pad) 40px;
    margin: 0;
    background: rgba(7, 8, 10, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow-y: auto;
    animation: menu-in 320ms var(--ease) both;
  }

  .nav.is-open .nav__link {
    width: 100%;
    font-size: 15px;
    letter-spacing: 0.2em;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
  }
  .nav.is-open .nav__link::after { display: none; }
  .nav.is-open .nav__link.is-active { color: var(--ice); }

  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .row__meta { justify-self: start; }
}

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

/* ---------------- 降低动效 ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
