/* cmylense.com — 解析流场细丝 / analytic flow-field filaments
   炭灰 · 灰青 · 柔和米白 */

:root {
  --ink:        #171c1f;
  --ink-2:      #1f272b;
  --charcoal:   #2c363b;
  --teal-deep:  #3c5a60;
  --teal:       #6f9499;
  --teal-soft:  #9db8ba;
  --cream:      #f2ece0;
  --cream-dim:  #d8d2c6;
  --cream-mute: #a9a79e;
  --hair:       rgba(157, 184, 186, 0.22);
  --hair-strong:rgba(157, 184, 186, 0.42);

  --shell-max: 1240px;
  --pad-x: clamp(18px, 4.5vw, 64px);

  --f-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--cream-dim);
  /* 动画失败时的静态兜底背景，与流场配色一致 */
  background:
    radial-gradient(120% 78% at 14% 8%, rgba(60, 90, 96, 0.40) 0%, rgba(23, 28, 31, 0) 62%),
    radial-gradient(96% 70% at 88% 96%, rgba(111, 148, 153, 0.18) 0%, rgba(23, 28, 31, 0) 58%),
    linear-gradient(168deg, #1b2124 0%, #171c1f 46%, #141a1d 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

/* ---------- 背景画布 ---------- */

.filament-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 900ms ease;
}
.filament-field.is-live { opacity: 1; }

/* 细丝与正文之间的柔化层，保证可读性而不遮挡 */
.field-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(20, 25, 28, 0.62) 0%, rgba(20, 25, 28, 0.30) 38%, rgba(20, 25, 28, 0.04) 62%, rgba(20, 25, 28, 0.28) 100%),
    linear-gradient(to bottom, rgba(20, 25, 28, 0.46) 0%, rgba(20, 25, 28, 0) 24%, rgba(20, 25, 28, 0) 76%, rgba(20, 25, 28, 0.52) 100%);
}

/* ---------- 外壳 ---------- */

.shell {
  position: relative;
  z-index: 2;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--pad-x) 56px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- 顶栏 ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 26px 0 22px;
  border-bottom: 1px solid var(--hair);
}

.mark {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mark__img {
  width: 54px;
  height: 54px;
  border-radius: 3px;
  object-fit: cover;
  filter: grayscale(0.25) contrast(1.04);
  box-shadow: 0 0 0 1px var(--hair-strong), 0 10px 26px rgba(0, 0, 0, 0.42);
}

.mark__domain {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-soft);
}

.masthead__control {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.motion-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  font-family: var(--f-sans);
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--cream);
  background: rgba(44, 54, 59, 0.62);
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}
.motion-btn:hover { background: rgba(60, 90, 96, 0.58); border-color: var(--teal); }
.motion-btn:focus-visible { outline: 2px solid var(--teal-soft); outline-offset: 3px; }

.motion-btn__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(111, 148, 153, 0.20);
}
.motion-btn[aria-pressed="true"] .motion-btn__dot {
  background: var(--cream-mute);
  box-shadow: none;
}

.motion-note {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--cream-mute);
  min-height: 1em;
}

/* ---------- 主体左右分栏 ---------- */

.layout {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: clamp(30px, 5vw, 76px);
  padding: clamp(36px, 6vw, 72px) 0 clamp(34px, 5vw, 64px);
  align-items: start;
}

.layout__left { min-width: 0; }
.layout__right { min-width: 0; }

/* ---------- 首屏引导 ---------- */

.intro__eyebrow {
  margin: 0 0 18px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--teal);
}

.intro__title {
  margin: 0 0 22px;
  font-size: clamp(38px, 6.6vw, 68px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cream);
  text-wrap: balance;
}

.intro__lede {
  margin: 0;
  max-width: 44ch;
  font-size: clamp(14.5px, 1.5vw, 16px);
  color: var(--cream-dim);
}

.rule {
  margin: 30px 0 0;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--hair-strong), rgba(157, 184, 186, 0.04));
}

/* ---------- 辅助内容 ---------- */

.notes { margin-top: 30px; }

.notes__title {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--teal-soft);
}

.notes__list { margin: 0; }

.note {
  position: relative;
  padding: 0 0 16px 18px;
  margin: 0 0 16px;
  border-bottom: 1px solid rgba(157, 184, 186, 0.12);
}
.note:last-child { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; }

.note::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 7px;
  height: 1px;
  background: var(--teal);
}

.note__term {
  margin: 0;
  display: inline;
  font-weight: 600;
  color: var(--cream);
  font-size: 14.5px;
}

.note__desc {
  margin: 0;
  display: inline;
  font-size: 14.5px;
  color: var(--cream-mute);
}

/* ---------- 导航区 ---------- */

.portal {
  border: 1px solid var(--hair);
  border-radius: 4px;
  background: linear-gradient(170deg, rgba(31, 39, 43, 0.78) 0%, rgba(23, 28, 31, 0.86) 100%);
  backdrop-filter: blur(3px);
  padding: clamp(20px, 3vw, 30px) clamp(16px, 2.4vw, 28px) clamp(14px, 2vw, 20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

.portal__title {
  margin: 0 0 4px;
  padding-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--teal-soft);
  border-bottom: 1px solid var(--hair);
}

.portal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(14px, 2vw, 26px);
}

.portal__item { min-width: 0; }

.entry {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 4px;
  text-decoration: none;
  color: var(--cream-dim);
  border-bottom: 1px solid rgba(157, 184, 186, 0.13);
  transition: color 180ms ease, padding-left 220ms ease;
}

.entry::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1px;
  background: var(--teal);
  transition: width 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.entry:hover,
.entry:focus-visible { color: var(--cream); padding-left: 10px; }
.entry:hover::after,
.entry:focus-visible::after { width: 100%; }
.entry:focus-visible { outline: 2px solid var(--teal-soft); outline-offset: 2px; }

.entry__idx {
  flex: 0 0 auto;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--teal-deep);
  transition: color 180ms ease;
}
.entry:hover .entry__idx,
.entry:focus-visible .entry__idx { color: var(--teal); }

.entry__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15.5px;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.entry__arrow {
  flex: 0 0 auto;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--teal-deep);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 200ms ease, transform 200ms ease, color 200ms ease;
}
.entry:hover .entry__arrow,
.entry:focus-visible .entry__arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--teal);
}

/* ---------- 页脚 ---------- */

.footer {
  flex: 0 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--hair);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px 30px;
  flex-wrap: wrap;
}

.footer__note {
  margin: 0;
  flex: 1 1 340px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--cream-mute);
}

.footer__copy {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--teal-deep);
  white-space: nowrap;
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .field-veil {
    background: linear-gradient(to bottom, rgba(20, 25, 28, 0.74) 0%, rgba(20, 25, 28, 0.52) 30%, rgba(20, 25, 28, 0.52) 70%, rgba(20, 25, 28, 0.80) 100%);
  }
}

@media (max-width: 620px) {
  .portal__list { grid-template-columns: minmax(0, 1fr); }
  .masthead { padding: 20px 0 16px; }
  .masthead__control { width: 100%; justify-content: space-between; }
  .mark__img { width: 46px; height: 46px; }
  .footer { flex-direction: column; align-items: flex-start; }
  .footer__copy { white-space: normal; }
  .entry { padding: 13px 2px; }
  .entry:hover, .entry:focus-visible { padding-left: 2px; }
}

@media (max-width: 380px) {
  .intro__title { font-size: 33px; }
  .motion-note { display: none; }
  .entry__name { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Decorative arrow is generated outside the anchor text. */
.entry::before { content: "→"; order: 2; margin-left: auto; color: var(--teal-deep); opacity: 0; transform: translateX(-4px); transition: opacity .2s ease, transform .2s ease; }
.entry:hover::before, .entry:focus-visible::before { opacity: 1; transform: translateX(0); color: var(--teal); }
