/* 懂一点实验室 · DYD Tech 全站样式。零构建、不下载字体、不用 JavaScript。
   视觉语言来自 ref/stitch_ 那版设计：墨线分格 + 硬边偏移投影 + 荧光笔黄。
   原稿用 Tailwind CDN、Google Fonts 和 Material Symbols，这里全部换成了
   系统字体和内联 SVG，因为那些外链在国内加载不出来。 */

:root {
  color-scheme: light;

  --paper: #ffffff;
  --canvas: #fafafa;
  --ink: #111111;
  --ink-2: #555555;
  --ink-3: #707070;
  --hairline: #e5e5e5;
  --hi: #ffe066;

  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --serif: Georgia, "Iowan Old Style", "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", SimSun, serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: 24px;
  --maxw: 1120px;
  --stroke: 1.5px;
  --sh-sm: 2px 2px 0 var(--ink);
  --sh-md: 3px 3px 0 var(--ink);
  --drop: 0 8px 30px rgba(17, 17, 17, .07);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #101011;
    --canvas: #17181a;
    --ink: #f2f1ec;
    --ink-2: #a5a49d;
    --ink-3: #9a9892;
    --hairline: #2c2d30;
    --hi: #ffd84d;
    --drop: 0 8px 30px rgba(0, 0, 0, .55);
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1 {
  font-size: clamp(2.125rem, 7.4vw, 3.75rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.025em;
}
h2 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.02em;
}
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.4; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .18em; }

::selection { background: var(--hi); color: var(--ink); }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-narrow { max-width: 760px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 16px;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 16px;
}
.skip:focus { left: 16px; }

/* 通用小标签：等宽、字号小、字距拉开，像制图时的标注 */
.eyebrow {
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* 荧光笔：只用来标最想说的那一句 */
.hi {
  background: linear-gradient(180deg, transparent 62%, var(--hi) 62%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-inline: .08em;
}

/* ---------- 悬浮胶囊导航 ---------- */
.masthead {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding-inline: 16px;
  pointer-events: none;
}
.pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 940px;
  padding: 9px 10px 9px 16px;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: var(--drop);
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand svg { width: 22px; height: 22px; display: block; }
.brand .name { font-size: .875rem; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.brand .sub {
  font-family: var(--mono);
  font-size: .6875rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: auto;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: .75rem;
  white-space: nowrap;
  color: var(--ink-2);
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: var(--stroke) solid var(--ink);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: var(--sh-sm);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-line { background: var(--paper); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn:hover { transform: translate(-1px, -1px); box-shadow: var(--sh-md); }
.btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }

/* ---------- 面板与标签 ---------- */
.panel {
  border: var(--stroke) solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--sh-md);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 700;
}
.tag .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  background: var(--hi);
  flex: none;
}

/* ---------- 版面节奏 ---------- */
main { padding-top: 104px; }
section { padding-block: clamp(64px, 9vw, 112px); scroll-margin-top: 104px; }
.band { background: var(--canvas); border-block: 1px solid var(--hairline); }
.center { text-align: center; }
.sec-head { display: grid; gap: 8px; justify-items: center; margin-bottom: clamp(32px, 5vw, 48px); }
.sec-head p { color: var(--ink-2); max-width: 34em; }

/* ---------- 首屏 ---------- */
.hero { display: grid; gap: 24px; justify-items: center; }
.hero h1 { max-width: 18em; }
.hero .lede {
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 2.4vw, 1.25rem);
  line-height: 1.85;
  color: var(--ink-2);
  max-width: 30em;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding-top: 8px; }

/* ---------- 三大板块 ---------- */
.grid3 {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}
.card { display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.card:hover { transform: translateY(-2px); transition: transform .15s ease; }
.card .icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: var(--stroke) solid var(--ink);
  border-radius: 9px;
  background: var(--paper);
}
.card .icon svg { width: 21px; height: 21px; }
.card .body { display: grid; gap: 8px; }
.card .body p { font-size: .875rem; line-height: 1.85; color: var(--ink-2); }
.card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: .6875rem;
}
.card .foot .who { color: var(--ink-3); }
.card .foot a { font-weight: 700; }

/* ---------- 极轻浏览器 ---------- */
.split {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
@media (max-width: 56rem) { .split { grid-template-columns: minmax(0, 1fr); } }
.split .copy { display: grid; gap: 14px; justify-items: start; }
.split .flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}
.split .flag svg { width: 15px; height: 15px; }
.split .copy p { font-size: .875rem; line-height: 1.9; color: var(--ink-2); }
.split .quote {
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.8;
  color: var(--ink);
}

/* 浏览器示意图：顶部标题栏 + 中间那条悬浮工具栏 */
.mock { overflow: hidden; }
.mock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--canvas);
  border-bottom: var(--stroke) solid var(--ink);
}
.mock-bar .dots { display: flex; gap: 6px; flex: none; }
.mock-bar .dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--ink);
}
.mock-bar .dots i:last-child { background: var(--ink); }
.mock-bar .url { font-family: var(--mono); font-size: .6875rem; color: var(--ink-2); }
.mock-bar .chip {
  padding: 2px 8px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .625rem;
  font-weight: 700;
  white-space: nowrap;
}
.mock-body {
  display: grid;
  gap: 18px;
  justify-items: center;
  align-content: center;
  min-height: 280px;
  padding: 40px 24px;
  text-align: center;
}
.mock-body.short { min-height: 190px; padding-block: 32px; }
.toolbar {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 6px 18px rgba(17, 17, 17, .22);
}
.toolbar svg { width: 15px; height: 15px; flex: none; }
.toolbar .addr { font-family: var(--mono); font-size: .6875rem; color: color-mix(in srgb, var(--paper) 62%, var(--ink)); }
.toolbar .up { color: var(--hi); }
.mock-body h4 { font-size: 1.125rem; font-weight: 800; }
.mock-body .sub { font-family: var(--serif); font-style: italic; font-size: .875rem; color: var(--ink-2); }
.mock-body .stat { font-family: var(--mono); font-size: .6875rem; color: var(--ink-3); letter-spacing: .02em; }

/* ---------- 理念 ---------- */
.chips {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.chip {
  display: grid;
  gap: 4px;
  padding: 18px 14px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.chip:hover { box-shadow: var(--sh-sm); }
.chip b { font-size: .9375rem; font-weight: 800; }
.chip span { font-family: var(--mono); font-size: .6875rem; color: var(--ink-2); }

/* ---------- 页脚 ---------- */
.site-foot { border-top: 1px solid var(--hairline); padding-block: 40px; }
.foot-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.foot-line .who { display: flex; align-items: center; gap: 9px; font-size: .875rem; font-weight: 700; }
.foot-line .who svg { width: 20px; height: 20px; }
.foot-line .copy { font-family: var(--mono); font-size: .6875rem; color: var(--ink-3); }
.foot-line nav { display: flex; gap: 18px; font-family: var(--mono); font-size: .75rem; }
.foot-line nav a { color: var(--ink-2); }
.foot-line nav a:hover { color: var(--ink); }

/* ---------- 404 ---------- */
.lost { display: grid; gap: 24px; justify-items: center; min-height: calc(100vh - 200px); align-content: center; }
.lost .code {
  font-size: clamp(4rem, 20vw, 9rem);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.05em;
}

@media (max-width: 40rem) {
  .brand .sub { display: none; }
  main { padding-top: 92px; }
  section { scroll-margin-top: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  .btn:hover, .btn:active { transform: none; }
  .card:hover { transform: none; }
}
