/* ============================================================
   KAIYUN 主站 · 共享样式层 /assets/site.css
   奶油纸底 · 红黄牌语义 · 居中刊头 · 编辑式留白
   ============================================================ */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a { color: inherit; }

address { font-style: normal; }

[hidden] { display: none !important; }

/* ---------- 2. 设计变量 ---------- */
:root {
  --c-red: #E63946;
  --c-red-deep: #A4161A;
  --c-yellow: #FFD166;
  --c-ink: #1A1A1A;
  --c-cool: #F0F0F0;
  --c-cream: #FFF8E7;
  --c-blue: #00B4D8;
  --c-brown: #3B2F2A;
  --c-paper: #FCFAF4;
  --c-green: #2A9D8F;

  --c-line: rgba(26, 26, 26, .14);
  --c-line-strong: rgba(26, 26, 26, .34);
  --c-ink-soft: rgba(26, 26, 26, .68);
  --c-cream-soft: rgba(255, 248, 231, .78);

  --font-editorial: "Source Serif 4", "Source Serif Pro", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-display: "Archivo Black", "Arial Black", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);

  --w-max: 1240px;
  --gutter: 24px;

  --scroll-progress: 0;
}

/* ---------- 3. 基础排版 ---------- */
body {
  background-color: var(--c-cream);
  background-image: linear-gradient(rgba(26, 26, 26, .035) 1px, transparent 1px);
  background-size: 100% 42px;
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.01em;
}

strong, b { font-weight: 800; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: .92em;
  background: var(--c-cool);
  padding: 2px 6px;
  border-radius: 2px;
}

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

:focus-visible {
  outline: 3px solid var(--c-red-deep);
  outline-offset: 3px;
}

.site-footer :focus-visible,
.search-pill:focus-visible,
.masthead-brand:focus-visible {
  outline-color: var(--c-yellow);
}

/* ---------- 4. 布局骨架 ---------- */
.container {
  width: 100%;
  max-width: var(--w-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: 72px; }
.section--tight { padding-block: 40px; }
.section--wide { padding-block: 104px; }

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ---------- 5. 页头 ---------- */
.site-header {
  position: relative;
  z-index: 90;
  background: var(--c-cream);
}

.skip-link {
  position: absolute;
  top: -140px;
  left: var(--gutter);
  z-index: 999;
  padding: 12px 20px;
  background: var(--c-ink);
  color: var(--c-cream);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
  border-radius: 2px;
  transition: top .18s var(--ease);
}
.skip-link:focus { top: 12px; }

.masthead-wrap {
  max-width: var(--w-max);
  margin-inline: auto;
  padding: 28px var(--gutter) 0;
}

.masthead-rule {
  height: 4px;
  background: var(--c-ink);
}
.masthead-rule--hair {
  height: 1px;
  margin-top: 5px;
  background: var(--c-ink);
}

.masthead-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 16px 0 14px;
}

.masthead-marker {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.3;
}
.masthead-marker--end {
  align-items: flex-end;
  text-align: right;
}

.marker-key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

.marker-val {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--c-brown);
}

.masthead-marker--end .marker-val::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--c-green);
  vertical-align: 1px;
}

.masthead-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  text-decoration: none;
  transition: color .18s var(--ease);
}

.masthead-brand-word {
  font-family: var(--font-editorial);
  font-size: clamp(38px, 5.4vw, 64px);
  font-weight: 700;
  letter-spacing: .12em;
  text-indent: .12em;
  color: var(--c-ink);
  transition: color .18s var(--ease);
}

.masthead-brand-sub {
  margin-top: 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--c-red);
}

.masthead-brand:hover .masthead-brand-word { color: var(--c-red-deep); }

/* ---------- 6. 导航 ---------- */
.nav-bar {
  position: relative;
  border-top: 1px solid var(--c-line-strong);
  border-bottom: 1px solid var(--c-line-strong);
  background: var(--c-cream);
}

.nav-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--c-red), var(--c-yellow));
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: 0 50%;
  pointer-events: none;
}

.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: var(--w-max);
  margin-inline: auto;
  min-height: 58px;
  padding: 0 var(--gutter);
}

.site-nav { display: flex; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--c-ink);
  text-decoration: none;
  transition: color .18s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: var(--c-blue);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .2s var(--ease);
}

.nav-link:hover { color: var(--c-red-deep); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-link[aria-current="page"] { color: var(--c-red); }
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--c-red);
}

.nav-actions {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--c-ink);
  color: var(--c-cream);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .05em;
  text-decoration: none;
  transition: background .18s var(--ease), color .18s var(--ease);
}

.search-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-yellow);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, .22);
  transition: background .18s var(--ease);
}

.search-pill:hover {
  background: var(--c-red);
  color: #fff;
}
.search-pill:hover .search-pill-dot { background: #fff; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border: 2px solid var(--c-ink);
  background: transparent;
  color: var(--c-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.nav-cta:hover {
  background: var(--c-ink);
  color: var(--c-cream);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  color: var(--c-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
}

.nav-toggle-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 22px;
  height: 16px;
}

.nav-toggle-icon span {
  display: block;
  height: 2px;
  background: var(--c-ink);
  transition: transform .2s var(--ease), opacity .16s linear;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 7. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: 96px;
  background: var(--c-ink);
  color: var(--c-cream);
  overflow: hidden;
}

.footer-slab {
  position: absolute;
  top: -1px;
  right: -8%;
  width: 64%;
  height: 100%;
  background: var(--c-red-deep);
  clip-path: polygon(26% 0, 100% 0, 100% 100%, 0 100%);
  opacity: .34;
  pointer-events: none;
}

.footer-frame {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.7fr;
  gap: 40px;
  max-width: var(--w-max);
  margin-inline: auto;
  padding: 64px var(--gutter) 44px;
}

.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.footer-brand-en {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: .1em;
  line-height: 1;
  color: var(--c-cream);
}

.footer-brand-cn {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--c-yellow);
}

.footer-note {
  max-width: 30ch;
  font-size: 14px;
  line-height: 1.75;
  color: var(--c-cream-soft);
}

.footer-col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--c-yellow);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  display: inline-block;
  font-size: 14px;
  color: var(--c-cream-soft);
  text-decoration: none;
  transition: color .16s var(--ease), transform .16s var(--ease);
}
.footer-links a:hover {
  color: #fff;
  transform: translateX(4px);
}

.footer-address { margin: 0; }

.footer-row {
  display: flex;
  gap: 12px;
  margin-bottom: 9px;
  font-size: 13.5px;
  line-height: 1.6;
}

.footer-key {
  flex: 0 0 36px;
  padding-top: 1px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--c-yellow);
}

.footer-val {
  color: var(--c-cream-soft);
  word-break: break-word;
}

.footer-base {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--w-max);
  margin-inline: auto;
  padding: 20px var(--gutter) 32px;
  border-top: 1px solid rgba(255, 248, 231, .16);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .05em;
  color: rgba(255, 248, 231, .62);
}

/* ---------- 8. 通用组件 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-red);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--c-red);
}

.display-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -.02em;
}

.editorial-title {
  font-family: var(--font-editorial);
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1.22;
}

.lede {
  max-width: 62ch;
  font-size: 18px;
  line-height: 1.75;
  color: var(--c-ink-soft);
}

.prose {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.8;
}
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 24px; margin-top: 2em; }
.prose h3 { font-size: 19px; margin-top: 1.6em; }
.prose p { color: var(--c-ink-soft); }
.prose a {
  color: var(--c-red-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border: 2px solid var(--c-ink);
  background: transparent;
  color: var(--c-ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease);
}
.btn:hover { background: var(--c-ink); color: var(--c-cream); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--c-red);
  border-color: var(--c-red);
  color: #fff;
}
.btn--primary:hover {
  background: var(--c-red-deep);
  border-color: var(--c-red-deep);
  color: #fff;
}

.btn--ghost {
  background: var(--c-paper);
  border-color: var(--c-ink);
}

.btn--quiet {
  border-color: transparent;
  padding-inline: 0;
  background: transparent;
}
.btn--quiet::after {
  content: "→";
  transition: transform .18s var(--ease);
}
.btn--quiet:hover {
  background: transparent;
  color: var(--c-red-deep);
}
.btn--quiet:hover::after { transform: translateX(4px); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--c-line-strong);
  border-radius: 999px;
  background: var(--c-paper);
  color: var(--c-brown);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.tag:hover {
  border-color: var(--c-blue);
  color: var(--c-ink);
}
.tag--red {
  background: rgba(230, 57, 70, .1);
  border-color: rgba(230, 57, 70, .42);
  color: var(--c-red-deep);
}
.tag--yellow {
  background: rgba(255, 209, 102, .3);
  border-color: rgba(255, 209, 102, .82);
  color: #6b4d00;
}
.tag--blue {
  background: rgba(0, 180, 216, .12);
  border-color: rgba(0, 180, 216, .45);
  color: #045b6b;
}
.tag--solid-red {
  background: var(--c-red);
  border-color: var(--c-red);
  color: #fff;
}

.card {
  position: relative;
  padding: 24px;
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 1px var(--c-blue);
}

.card--glass {
  background: rgba(252, 250, 244, .62);
  border-color: rgba(26, 26, 26, .12);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

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

.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--c-cool);
  border: 1px solid var(--c-line);
}
.media-frame img,
.media-frame svg,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--angle {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 32px), calc(100% - 32px) 100%, 0 100%);
}
.media-frame--tilt { transform: rotate(-1.2deg); }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--c-ink-soft);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.breadcrumb li {
  display: flex;
  align-items: center;
}
.breadcrumb li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--c-line-strong);
}
.breadcrumb a {
  color: var(--c-brown);
  text-decoration: none;
  transition: color .16s var(--ease);
}
.breadcrumb a:hover { color: var(--c-red-deep); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
}
.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--c-line);
}
.data-table thead th {
  background: var(--c-ink);
  color: var(--c-cream);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}
.data-table tbody tr:nth-child(even) td { background: var(--c-cool); }

/* ---------- 9. 响应式 ---------- */
@media (max-width: 1100px) {
  .nav-cta { display: none; }
}

@media (max-width: 900px) {
  :root { --gutter: 18px; }

  .section { padding-block: 48px; }
  .section--wide { padding-block: 64px; }

  .masthead-wrap { padding-top: 18px; }
  .masthead-row {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
    padding: 12px 0 10px;
  }
  .masthead-marker { display: none; }

  .nav-inner {
    justify-content: space-between;
    min-height: 54px;
  }
  .nav-toggle { display: inline-flex; }
  .nav-actions {
    position: static;
    transform: none;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    background: var(--c-paper);
    border-top: 2px solid var(--c-ink);
    border-bottom: 2px solid var(--c-ink);
    box-shadow: 0 28px 44px -28px rgba(26, 26, 26, .5);
    z-index: 80;
  }
  .site-nav[data-open] { display: block; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0;
  }
  .nav-item + .nav-item { border-top: 1px solid var(--c-line); }
  .nav-link {
    display: block;
    padding: 14px var(--gutter);
    font-size: 15px;
  }
  .nav-link::after { display: none; }
  .nav-link[aria-current="page"] {
    background: rgba(230, 57, 70, .08);
    box-shadow: inset 3px 0 0 var(--c-red);
  }

  .footer-frame {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 48px var(--gutter) 32px;
  }
  .footer-lede,
  .footer-contact { grid-column: 1 / -1; }

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

@media (max-width: 640px) {
  .footer-frame { grid-template-columns: 1fr; }
  .footer-lede,
  .footer-contact { grid-column: auto; }
  .footer-base {
    flex-direction: column;
    align-items: flex-start;
  }
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: 1fr; }
  .lede { font-size: 16px; }
}

@media (max-width: 480px) {
  .masthead-brand-word { letter-spacing: .08em; text-indent: .08em; }
  .masthead-brand-sub { font-size: 10px; letter-spacing: .16em; }
  .search-pill { padding: 6px 11px; font-size: 11px; }
  .btn { padding: 11px 18px; font-size: 13px; }
}

/* ---------- 10. 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
  .nav-bar::after { transition: none !important; }
  .btn:active { transform: none; }
}
