/* 安书管站 www.safedoc.online — 编辑风深底：靛青微光 + 铜强调
 * 字体：Noto Serif SC（标题杂志感）+ Noto Sans SC（正文）+ JetBrains Mono（标注）
 */

:root {
  color-scheme: dark;
  --ink: #05070a;
  --ink-2: #0c1018;
  --paper: #ebe8e2;
  --muted: #969188;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --amber: #d4a24d;
  --amber-dim: rgba(212, 162, 77, 0.12);
  --amber-bright: #e8bc6a;
  --celadon: #6fb8a8;
  --celadon-dim: rgba(111, 184, 168, 0.14);
  --danger: #c45c3e;
  --accent-muted: #6a7a72;
  --font-display: "Noto Serif SC", "Noto Sans SC", "Source Han Serif SC", serif;
  --font-body: "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --r-pad: clamp(1.25rem, 4vw, 2.5rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.22s;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  color: var(--paper);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--amber-bright);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
}
.skip-link:focus {
  left: 0.5rem;
}

/* 背景：噪点 + 侧向光斑 */
.bg-noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.45;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.bg-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 75% 50% at 12% 8%, rgba(212, 162, 77, 0.1), transparent 58%),
    radial-gradient(ellipse 55% 45% at 88% 22%, rgba(111, 184, 168, 0.09), transparent 52%),
    radial-gradient(ellipse 40% 35% at 70% 88%, rgba(80, 120, 160, 0.06), transparent 55%),
    linear-gradient(195deg, #070a10 0%, var(--ink) 42%, #040508 100%);
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* --- Header --- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem var(--r-pad);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: linear-gradient(145deg, var(--amber-bright), #c97a1a);
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.brand__mark--cn {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
}

.brand__word {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.15rem;
}

.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out);
}
.nav__link:hover {
  color: var(--paper);
}
.nav__link--accent {
  color: var(--celadon);
}
.nav__link--accent:hover {
  color: #9fd9cc;
}

.header-cta {
  display: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--amber);
  text-decoration: none;
  border-radius: 6px;
  transition: background var(--t-fast) var(--ease-out), transform 0.15s var(--ease-out);
}
.header-cta:hover {
  background: var(--amber-bright);
  transform: translateY(-1px);
}
@media (min-width: 900px) {
  .header-cta {
    display: inline-flex;
  }
}

/* --- Hero --- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) var(--r-pad) 3.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: start;
  position: relative;
  overflow: hidden;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: stretch;
  }
}

.hero__rail {
  display: none;
}
@media (min-width: 960px) {
  .hero__rail {
    display: block;
    position: absolute;
    left: calc(57.5% - 0.5px);
    top: 12%;
    bottom: 18%;
    width: 1px;
    background: linear-gradient(
      180deg,
      transparent 0%,
      color-mix(in srgb, var(--celadon) 55%, transparent) 35%,
      color-mix(in srgb, var(--amber) 45%, transparent) 65%,
      transparent 100%
    );
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
  }
}

.hero__grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 0%, #000 30%, transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}

.hero__content,
.hero__panel {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}

.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--amber-dim);
  animation: pulse-dot 2.2s var(--ease-out) infinite;
}

.eyebrow--portal {
  text-transform: none;
  letter-spacing: 0.08em;
}

@media (prefers-reduced-motion: reduce) {
  .eyebrow__dot {
    animation: none;
  }
}

@keyframes pulse-dot {
  50% {
    box-shadow: 0 0 0 5px var(--amber-dim);
  }
}

.hero__title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.8vw, 3rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: 0.02em;
  color: #f5f1ea;
  text-wrap: balance;
}

.hide-sm {
  display: none;
}
@media (min-width: 480px) {
  .hide-sm {
    display: inline;
  }
}

.hero__lede {
  margin: 0 0 2rem;
  max-width: 36em;
  font-size: 1.0625rem;
  color: #c4c0b8;
  font-weight: 300;
}
.hero__lede strong {
  font-weight: 500;
  color: var(--paper);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  transition:
    background var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    transform 0.15s var(--ease-out);
}
.btn--primary {
  color: var(--ink);
  background: var(--amber);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset;
}
.btn--primary:hover {
  background: var(--amber-bright);
  transform: translateY(-1px);
}
.btn--ghost {
  color: var(--paper);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
}
.btn--ghost:hover {
  border-color: var(--amber);
  color: var(--amber-bright);
  background: var(--amber-dim);
}
.btn--light {
  color: var(--ink);
  background: #f5f2eb;
  border: none;
}
.btn--light:hover {
  background: #fff;
  transform: translateY(-1px);
}

/* Spec 侧栏 */
.spec-card {
  padding: 1.5rem 1.4rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(120deg, var(--celadon-dim) 0%, transparent 38%),
    var(--ink-2);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.38);
}

.spec-card__label {
  margin: 0 0 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  opacity: 0.9;
}

.spec-card__body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #b8b3a8;
  font-weight: 400;
}

.spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.spec-list__k {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.spec-list__v {
  display: block;
  font-size: 0.875rem;
  color: #d5d0c7;
  line-height: 1.5;
}

/* 入场动效 */
.animate-in {
  opacity: 0;
  transform: translateY(16px);
  animation: enter-up 0.75s var(--ease-out) forwards;
  animation-delay: var(--enter-delay, 0ms);
}
@media (prefers-reduced-motion: reduce) {
  .animate-in {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

[data-delay="0"] {
  --enter-delay: 0.05s;
}
[data-delay="1"] {
  --enter-delay: 0.14s;
}
[data-delay="2"] {
  --enter-delay: 0.24s;
}
[data-delay="3"] {
  --enter-delay: 0.36s;
}
[data-delay="4"] {
  --enter-delay: 0.5s;
}

@keyframes enter-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Sections --- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3.5rem var(--r-pad) 3rem;
  border-top: 1px solid var(--line);
}

.section--tight {
  padding-top: 2.75rem;
}

.section__head {
  margin-bottom: 2.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1.5rem;
  align-items: start;
  max-width: none;
}
@media (min-width: 560px) {
  .section__head {
    grid-template-columns: auto 1fr;
    gap: 1rem 2rem;
  }
}

.section__index {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--accent-muted);
  padding-top: 0.45rem;
  line-height: 1;
}

.section__head-text {
  min-width: 0;
}

.section__head--row {
  max-width: none;
}
@media (min-width: 800px) {
  .section__head--row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
    align-items: end;
  }
}

.section__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.4vw, 1.95rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #f0ebe3;
}
.section__sub {
  margin: 0;
  font-size: 0.98rem;
  color: #9a958c;
  font-weight: 300;
  line-height: 1.75;
}
.section__sub--inline {
  max-width: 32rem;
}

/* 个人站正文：随笔式介绍 */
.personal-prose {
  max-width: 42rem;
}
.personal-prose p {
  margin: 0 0 1rem;
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.85;
  font-weight: 300;
}
.personal-prose p:last-child {
  margin-bottom: 0;
}
.personal-prose ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
  font-weight: 300;
}
.personal-prose li {
  margin-bottom: 0.35rem;
}

.section--last {
  padding-bottom: 3.25rem;
}

.value-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .value-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.value-card {
  padding: 1.4rem 1.35rem 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color var(--t-fast) var(--ease-out), background 0.25s var(--ease-out);
}
.value-card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}
.value-card--accent {
  background: linear-gradient(145deg, var(--amber-dim), rgba(255, 255, 255, 0.02));
  border-color: rgba(232, 165, 75, 0.28);
}

.value-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ebe6dc;
}
.value-card__text {
  margin: 0;
  font-size: 0.9rem;
  color: #9a948a;
  line-height: 1.65;
  font-weight: 300;
}

/* Feature steps */
.feature-steps {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feature-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.5rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.feature-step:first-child {
  border-top: none;
  padding-top: 0;
}
.feature-step:last-child {
  padding-bottom: 0;
}

.feature-step__n {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--amber);
  padding-top: 0.1rem;
}

.feature-step__h {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #e8e4dc;
}
.feature-step__p {
  margin: 0;
  font-size: 0.9rem;
  color: #9a948a;
  font-weight: 300;
  line-height: 1.7;
  max-width: 46rem;
}

/* Flow */
.section--flow {
  border-top: none;
  padding-top: 0.5rem;
}

.flow-inner {
  padding: 2.5rem 1.75rem 2.6rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(232, 165, 75, 0.06) 0%, rgba(0, 0, 0, 0) 40%),
    var(--ink-2);
  position: relative;
  overflow: hidden;
}
.flow-inner::after {
  content: "";
  position: absolute;
  right: -20%;
  top: 0;
  width: 50%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(232, 165, 75, 0.09), transparent 60%);
  pointer-events: none;
}

.flow__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.flow-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #b5afa5;
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.85;
  max-width: 32rem;
  position: relative;
  z-index: 1;
}
.flow-list li {
  margin-bottom: 0.4rem;
}
.flow-list li::marker {
  color: var(--amber);
}

/* CTA */
.cta-band {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  padding: 0 var(--r-pad) 0;
}
.cta-band__inner {
  padding: 2.5rem 1.75rem;
  text-align: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #1a1510 0%, #0f0e0c 50%, #121820 100%);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.cta-band__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.7rem);
  font-weight: 800;
  color: #faf6ef;
}
.cta-band__text {
  margin: 0 auto 1.35rem;
  max-width: 32rem;
  font-size: 0.95rem;
  color: #9a948a;
  font-weight: 300;
  line-height: 1.7;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #050506;
  padding: 2rem var(--r-pad) 2.5rem;
}

.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: stretch;
}

.site-footer__top {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}
@media (min-width: 600px) {
  .site-footer__top {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
  }
}

.site-footer__intro {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.site-footer__legal {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  line-height: 1.65;
  color: #5c5852;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.site-footer__legal-link {
  color: #7a756c;
  text-decoration: none;
  text-underline-offset: 2px;
}
.site-footer__legal-link:hover {
  color: var(--celadon);
  text-decoration: underline;
}

.site-footer__sep {
  color: #4a4743;
  user-select: none;
}

.site-footer__brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: #e0dbd2;
  letter-spacing: 0.04em;
}

.site-footer__colophon {
  margin: 0;
  max-width: 26rem;
  font-size: 0.8rem;
  font-weight: 300;
  line-height: 1.65;
  color: #7d776d;
  letter-spacing: 0.02em;
}

.site-footer__meta {
  margin: 0;
  font-size: 0.8rem;
  color: #6b6660;
}
/* 窄屏：导航收纳为换行，隐藏冗余项可选 */
@media (max-width: 420px) {
  .nav {
    width: 100%;
    order: 3;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
  }
  .site-header__inner {
    flex-wrap: wrap;
  }
}
