/* =============================================================
   狗万安卓指南 · /assets/site.css
   共享层：tokens / reset / 中文排版 / 头部 / 页脚 / 通用组件
   ============================================================= */

/* ---------- 1. 设计变量 ---------- */
:root {
  --ink: #06080B;
  --surface: #0D1218;
  --surface-2: #0A0E13;
  --line: #161E27;
  --line-soft: #1C2732;
  --dim: #33414F;
  --faint: #63747F;

  --cyan: #2BE3C8;
  --cyan-deep: #1F6F63;
  --amber: #FFB43C;
  --violet-a: #7C8CF8;
  --violet-b: #A46BE0;

  --text: #E9F1F7;
  --muted: #93A3B3;

  --font-head: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: var(--font-head);
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", "Roboto Mono", Menlo, Consolas, "Noto Sans Mono CJK SC", monospace;

  --wrap: 1280px;
  --gutter: 24px;
  --header-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --radius: 2px;
}

/* ---------- 2. reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 底层电路网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(28, 39, 50, .62) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 39, 50, .62) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: radial-gradient(120% 78% at 50% 0%, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 78%);
  mask-image: radial-gradient(120% 78% at 50% 0%, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 78%);
  opacity: .55;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

::selection { background: var(--amber); color: #100B00; }

html.nav-open,
html.nav-open body { overflow: hidden; }

/* ---------- 3. 排版与布局工具 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

main {
  display: block;
  position: relative;
  z-index: 1;
  padding-top: var(--header-h);
}

.section { padding-block: clamp(48px, 7vw, 88px); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 22px;
  height: 1px;
  background: currentColor;
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .08em;
  color: var(--muted);
}

.lede {
  font-size: 17px;
  line-height: 1.9;
  color: var(--muted);
  max-width: 34em;
}

.prose { max-width: 38em; }
.prose p { margin-bottom: 1.1em; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- 4. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.2;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: border-color .12s linear, background .12s linear, color .12s linear;
}
.btn:hover,
.btn:focus-visible { border-color: var(--cyan); color: var(--cyan); }

.btn--primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #04140F;
  font-weight: 700;
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: #4FF0D8;
  border-color: #4FF0D8;
  color: #04140F;
}

.btn--ghost {
  background: transparent;
  border-color: var(--cyan-deep);
  color: var(--cyan);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: rgba(43, 227, 200, .08);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* ---------- 5. 标签 / 面包屑 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--muted);
  line-height: 1.6;
}
.chip--hit {
  background: rgba(255, 180, 60, .14);
  border-color: var(--amber);
  color: var(--amber);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}
.breadcrumb a {
  color: var(--muted);
  transition: color .12s linear;
}
.breadcrumb a:hover,
.breadcrumb a:focus-visible { color: var(--cyan); }
.breadcrumb__sep { color: var(--dim); }

/* ---------- 6. 网格 ---------- */
.grid { display: grid; gap: var(--gutter); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

/* ---------- 7. 图片容器（供页面阶段放置占位） ---------- */
.media {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}
.media::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}
.media img,
.media picture,
.media video,
.media .media__ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media__ph {
  background:
    repeating-linear-gradient(135deg, rgba(124, 140, 248, .10) 0 2px, transparent 2px 12px),
    radial-gradient(120% 100% at 10% 0%, rgba(43, 227, 200, .22), transparent 62%),
    linear-gradient(160deg, #101820 0%, #0A0E13 72%);
}
.media__tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
}
.media--wide::before { padding-top: 42%; }
.media--tall::before { padding-top: 124%; }
.media--square::before { padding-top: 100%; }

/* ---------- 8. 显现动画 ---------- */
[data-reveal] {
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}
[data-reveal="pending"] {
  opacity: 0;
  transform: translateY(12px);
}

/* ---------- 9. 跳过链接 ---------- */
.skip-link {
  position: fixed;
  left: 16px;
  top: 0;
  z-index: 200;
  transform: translateY(-160%);
  padding: 12px 18px;
  background: var(--cyan);
  color: #02120E;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  transition: transform .16s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(12px); }

/* ---------- 10. 头部 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: linear-gradient(180deg, rgba(6, 8, 11, .90) 0%, rgba(6, 8, 11, .58) 60%, rgba(6, 8, 11, 0) 100%);
  border-bottom: 1px solid transparent;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.site-header[data-scrolled="true"] {
  background: rgba(6, 8, 11, .96);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.read-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  pointer-events: none;
}
.read-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--violet-a), var(--cyan));
  transition: width .08s linear;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
}

/* 品牌锁形 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-block: 10px;
  flex: none;
}
.brand__mark {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--cyan-deep);
  background: var(--surface);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.brand__mark::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 10px;
  width: 12px;
  height: 12px;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(43, 227, 200, .7);
}
.brand__mark::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 5px;
  height: 5px;
  background: var(--amber);
}
.brand__text { display: block; }
.brand__name {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1.2;
  color: var(--text);
}
.brand__wordmark {
  display: block;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--faint);
  line-height: 1.2;
}

/* 主导航（桌面） */
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  counter-reset: navitem;
}
.site-nav__item { display: block; }
.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: color .12s linear;
}
.site-nav__link::before {
  counter-increment: navitem;
  content: counter(navitem, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--dim);
  transition: color .12s linear;
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .16s var(--ease);
}
.site-nav__link:hover,
.site-nav__link:focus-visible { color: var(--text); }
.site-nav__link:hover::after,
.site-nav__link:focus-visible::after { transform: scaleX(1); }
.site-nav__link[aria-current="page"] { color: var(--text); }
.site-nav__link[aria-current="page"]::before { color: var(--cyan); }
.site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

.site-nav__cta {
  margin-left: 10px;
  padding: 9px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color .12s linear;
}
.nav-toggle__bars {
  display: grid;
  gap: 4px;
  width: 18px;
  flex: none;
}
.nav-toggle__bars i {
  display: block;
  height: 1px;
  width: 100%;
  background: var(--cyan);
  transition: transform .16s var(--ease), opacity .16s linear;
}
.nav-toggle__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted);
  transition: color .12s linear;
}
.nav-toggle[aria-expanded="true"] { border-color: var(--cyan); }
.nav-toggle[aria-expanded="true"] .nav-toggle__label { color: var(--cyan); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:first-child {
  transform: translateY(2.5px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:last-child {
  transform: translateY(-2.5px) rotate(-45deg);
}

/* ---------- 11. 页脚 ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: clamp(56px, 8vw, 96px);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: min(420px, 46%);
  background: linear-gradient(90deg, var(--cyan), var(--violet-a), transparent);
}

.footer__inner {
  padding-block: clamp(40px, 6vw, 72px) 24px;
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
}

.footer__wordmark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--cyan);
  line-height: 1.6;
}
.footer__name {
  margin-top: 10px;
  font-size: clamp(22px, 2.4vw, 26px);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--text);
}
.footer__tagline {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  max-width: 24em;
}

.footer__contact {
  margin-top: 22px;
  display: grid;
  gap: 0;
  max-width: 30em;
}
.footer__contact li {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-top: 1px dashed var(--line-soft);
}
.footer__contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--dim);
  line-height: 1.95;
}
.footer__contact-value {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  word-break: break-word;
}
.footer__note {
  margin-top: 16px;
  max-width: 34em;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--faint);
}

.footer__col { min-width: 0; }
.footer__col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
  line-height: 1.6;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.footer__col-title::before {
  content: "";
  flex: none;
  width: 14px;
  height: 1px;
  background: var(--cyan);
}
.footer__links {
  margin-top: 8px;
  display: grid;
  gap: 0;
}
.footer__link {
  display: block;
  padding: 7px 0;
  font-size: 14px;
  color: var(--muted);
  transition: color .12s linear, padding-left .12s var(--ease);
}
.footer__link:hover,
.footer__link:focus-visible {
  color: var(--cyan);
  padding-left: 6px;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--faint);
}
.footer__copy { color: var(--faint); }
.footer__icp {
  color: var(--faint);
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
}

/* ---------- 12. 平板 ---------- */
@media (max-width: 980px) {
  :root { --header-h: 64px; }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px clamp(20px, 4vw, 40px) 22px;
    background: rgba(10, 14, 19, .985);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s linear;
  }
  .site-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .site-nav__item { border-bottom: 1px solid var(--line); }
  .site-nav__link {
    display: flex;
    align-items: baseline;
    padding: 15px 2px;
    font-size: 15px;
    color: var(--text);
  }
  .site-nav__link::after { display: none; }
  .site-nav__link::before { color: var(--cyan); }
  .site-nav__cta {
    margin: 18px 0 0;
    width: 100%;
    padding: 13px 16px;
    font-size: 13px;
  }

  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--12 { grid-template-columns: repeat(8, minmax(0, 1fr)); }

  .footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .footer__brand { grid-column: 1 / -1; }
}

/* ---------- 13. 手机 ---------- */
@media (max-width: 640px) {
  :root { --header-h: 60px; --gutter: 16px; }

  body { font-size: 15.5px; line-height: 1.85; }

  .brand { gap: 10px; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__mark::before { left: 8px; top: 8px; width: 11px; height: 11px; }
  .brand__name { font-size: 16px; }
  .brand__wordmark { font-size: 9px; letter-spacing: .16em; }

  .grid--2,
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .grid--12 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .lede { font-size: 16px; }
  .btn { padding: 12px 18px; }

  .footer__top { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .footer__contact li { grid-template-columns: 60px minmax(0, 1fr); }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .footer__icp { border-left: 0; padding-left: 0; }
}

/* ---------- 14. 降低动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal="pending"] {
    opacity: 1;
    transform: none;
  }
  .read-progress__bar { transition: none; }
}
