/* ============================================================
   YUNAPP / site.css — 共享外壳与基础组件
   ============================================================ */

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

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

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

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

img, svg {
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  color: inherit;
}

a { color: inherit; }

:where(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--c-orange);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 2. Tokens ---------- */
:root {
  --c-teal: #0B5C7A;
  --c-glacier: #0F6E8C;
  --c-lake: #E7F4F8;
  --c-salt: #FBFDFE;
  --c-snow: #FFFFFF;
  --c-orange: #F07A2B;
  --c-ember: #C33A10;
  --c-ink: #1E3037;
  --c-mist: #5F737C;
  --c-grid: #C7DBE2;
  --c-deep: #0A1C24;
  --c-mint: #D8F0EC;

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius-pill: 999px;
  --radius-sharp: 2px;
  --shell-max: 1280px;
  --gutter: clamp(24px, 5vw, 72px);
  --gap: clamp(16px, 2.4vw, 28px);
  --header-pad: clamp(10px, 1.5vw, 20px);
  --ease-out: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 3. Typography ---------- */
body {
  background: var(--c-salt);
  color: var(--c-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-teal);
}

h1 { font-size: clamp(2.25rem, 4.4vw, 4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.125rem); font-weight: 800; }
h3 { font-size: clamp(1.125rem, 1.6vw, 1.375rem); font-weight: 700; }

p { max-width: 68ch; }

::selection {
  background: var(--c-mint);
  color: var(--c-deep);
}

#main-content { scroll-margin-top: 112px; }

/* ---------- 4. Layout ---------- */
.shell {
  width: min(100% - var(--gutter), var(--shell-max));
  margin-inline: auto;
}

.section { padding-block: clamp(32px, 4.6vw, 64px); }

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

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

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

/* ---------- 5. Buttons & tags ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s var(--ease-out), color .2s var(--ease-out),
              border-color .2s var(--ease-out), transform .2s var(--ease-out);
}

.btn--primary {
  background: var(--c-ember);
  color: var(--c-snow);
  box-shadow: 0 14px 26px -18px rgba(195, 58, 16, .9);
}

.btn--primary:hover { background: #A22F0B; }
.btn--primary:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  border-color: var(--c-grid);
  color: var(--c-teal);
}

.btn--ghost:hover {
  background: var(--c-lake);
  border-color: var(--c-teal);
}

.btn--sm {
  padding: 9px 16px;
  font-size: 0.8125rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid var(--c-glacier);
  border-radius: var(--radius-pill);
  background: var(--c-snow);
  color: var(--c-glacier);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-glacier);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--c-orange);
}

/* ---------- 6. Cards & media ---------- */
.card {
  padding: clamp(18px, 2.4vw, 28px);
  background: var(--c-snow);
  border: 1px solid var(--c-grid);
  border-radius: var(--radius-sharp);
}

.card--lake {
  background: var(--c-lake);
  border-color: var(--c-grid);
}

.card--ink {
  background: var(--c-deep);
  border-color: rgba(199, 219, 226, .26);
  color: #D6E6EC;
}

.card--ink h2,
.card--ink h3 { color: var(--c-snow); }

.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background:
    linear-gradient(142deg, var(--c-lake) 0%, var(--c-snow) 52%, var(--c-mint) 100%);
  border: 1px solid var(--c-grid);
  border-radius: var(--radius-sharp);
}

.media-frame > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }

/* ---------- 7. Section head & breadcrumbs ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 32px;
  margin-bottom: clamp(22px, 3.2vw, 38px);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-grid);
}

.section-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.5rem, 2.6vw, 2.125rem);
  letter-spacing: -0.02em;
  color: var(--c-teal);
}

.section-head__note {
  margin: 0;
  max-width: 46ch;
  font-size: 0.9375rem;
  color: var(--c-mist);
}

.breadcrumbs {
  padding-top: clamp(20px, 3vw, 36px);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--c-mist);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--c-grid);
}

.breadcrumbs a {
  color: var(--c-glacier);
  text-decoration: none;
}

.breadcrumbs a:hover { text-decoration: underline; }

/* ---------- 8. Long-form ---------- */
.prose {
  max-width: 68ch;
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--c-ink);
}

.prose p { max-width: none; margin-bottom: 1.1em; }

.prose h2,
.prose h3 {
  margin: 1.7em 0 0.6em;
  letter-spacing: -0.01em;
}

.prose ul,
.prose ol {
  list-style: disc;
  padding-left: 1.3em;
  margin-bottom: 1.1em;
}

.prose ol { list-style: decimal; }
.prose li { margin: 0.35em 0; }

.prose a {
  color: var(--c-glacier);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose strong { font-weight: 700; color: var(--c-deep); }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.price {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--c-ember);
  letter-spacing: -0.01em;
}

/* ---------- 9. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  isolation: isolate;
  padding: var(--header-pad) 0 0;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -30px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    var(--c-salt) 0%,
    rgba(251, 253, 254, .94) 58%,
    rgba(251, 253, 254, 0) 100%);
}

.header-shell,
.footer-shell {
  width: min(100% - var(--gutter), var(--shell-max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -120px;
  z-index: 130;
  padding: 10px 22px;
  border-radius: 0 0 8px 8px;
  background: var(--c-deep);
  color: var(--c-snow);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateX(-50%);
  transition: top .2s var(--ease-out);
}

.skip-link:focus { top: 0; }

.scroll-progress {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
}

.scroll-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg,
    var(--c-teal) 0%,
    var(--c-glacier) 46%,
    var(--c-orange) 78%,
    var(--c-ember) 100%);
}

.nav-capsule {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vw, 22px);
  padding: 8px 8px 8px 14px;
  background: rgba(255, 255, 255, .93);
  border: 1px solid var(--c-grid);
  border-radius: var(--radius-pill);
  box-shadow: 0 22px 44px -32px rgba(10, 28, 36, .75);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: padding .3s var(--ease-out),
              box-shadow .3s var(--ease-out),
              background .3s var(--ease-out),
              border-radius .3s var(--ease-out);
}

.site-header[data-scrolled="true"] .nav-capsule {
  padding: 4px 6px 4px 12px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 14px 30px -26px rgba(10, 28, 36, .85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-end: auto;
  min-width: 0;
  text-decoration: none;
}

.brand__mark {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding-left: 9px;
  background: var(--c-teal);
  border-radius: 6px;
  transition: transform .3s var(--ease-out);
}

.site-header[data-scrolled="true"] .brand__mark { transform: scale(.92); }

.brand__mark-line {
  display: block;
  align-self: flex-start;
  height: 2px;
  border-radius: 2px;
  background: var(--c-snow);
}

.brand__mark-line:nth-child(1) { width: 14px; opacity: .95; }
.brand__mark-line:nth-child(2) { width: 18px; opacity: .68; }
.brand__mark-line:nth-child(3) { width: 10px; opacity: .42; }

.brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.0625rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--c-teal);
}

.brand__subline {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.35;
  letter-spacing: 0.05em;
  color: var(--c-mist);
  white-space: nowrap;
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}

.site-header[data-scrolled="true"] .brand__subline {
  opacity: .5;
  transform: translateY(-1px);
}

.nav { min-width: 0; }

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

.nav__item { flex: 0 0 auto; }

.nav__link {
  display: block;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--c-teal);
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}

.nav__link:hover {
  background: var(--c-lake);
  color: var(--c-deep);
}

.nav__link[aria-current="page"] {
  background: var(--c-teal);
  color: var(--c-snow);
  font-weight: 700;
}

.nav__link[aria-current="page"]:hover {
  background: var(--c-glacier);
  color: var(--c-snow);
}

.nav-capsule__cta { flex: 0 0 auto; }

.nav-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--c-grid);
  border-radius: var(--radius-pill);
  background: var(--c-snow);
  cursor: pointer;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}

.nav-toggle:hover {
  border-color: var(--c-teal);
  background: var(--c-lake);
}

.nav-toggle__lines {
  display: block;
  width: 18px;
}

.nav-toggle__lines span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--c-teal);
  transition: transform .25s var(--ease-out);
}

.nav-toggle__lines span + span { margin-top: 5px; }

.nav-capsule[data-open] .nav-toggle__lines span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-capsule[data-open] .nav-toggle__lines span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* ---------- 10. Footer ---------- */
.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-top: clamp(56px, 9vw, 120px);
  padding: clamp(44px, 6vw, 84px) 0 26px;
  background: var(--c-deep);
  color: #D6E6EC;
  font-size: 0.9375rem;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 85% at 92% -12%, rgba(15, 110, 140, .55), rgba(15, 110, 140, 0) 58%),
    radial-gradient(70% 60% at 4% 0%, rgba(240, 122, 43, .16), rgba(240, 122, 43, 0) 56%),
    repeating-linear-gradient(90deg, rgba(199, 219, 226, .085) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(199, 219, 226, .06) 0 1px, transparent 1px 96px);
}

.site-footer::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  z-index: -1;
  background: linear-gradient(90deg,
    var(--c-teal) 0%,
    var(--c-glacier) 40%,
    var(--c-orange) 78%,
    var(--c-ember) 100%);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(28px, 4vw, 48px);
  border-bottom: 1px solid rgba(199, 219, 226, .18);
}

.footer-brand__label {
  display: block;
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--c-snow);
}

.footer-brand__label::after {
  content: "";
  display: block;
  width: 52px;
  height: 3px;
  margin-top: 16px;
  background: var(--c-orange);
}

.footer-summary {
  margin-bottom: 22px;
  max-width: 34ch;
  color: #A9C6D2;
  line-height: 1.8;
}

.footer-brand__cta {
  border-color: rgba(199, 219, 226, .42);
  background: transparent;
  color: var(--c-snow);
}

.footer-brand__cta:hover {
  background: var(--c-snow);
  border-color: var(--c-snow);
  color: var(--c-deep);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.footer-group__title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7FA8B8;
}

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

.footer-link {
  color: #D6E6EC;
  text-decoration: none;
  transition: color .2s var(--ease-out);
}

.footer-link:hover {
  color: var(--c-snow);
  text-decoration: underline;
  text-decoration-color: var(--c-orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.footer-contact {
  display: flex;
  flex-direction: column;
}

.footer-mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  color: #C6DCE5;
  word-break: break-all;
}

.footer-text {
  color: #B7D0DA;
}

.footer-note {
  margin-top: 12px;
  max-width: 32ch;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #8FB0BE;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  padding-top: 22px;
  font-size: 0.8125rem;
  color: #8FB0BE;
}

.footer-copy { margin: 0; max-width: none; }

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-legal a {
  color: #B7D0DA;
  text-decoration: none;
  transition: color .2s var(--ease-out);
}

.footer-legal a:hover {
  color: var(--c-snow);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-icp {
  margin: 0;
  max-width: none;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ---------- 11. Back to top ---------- */
.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 34px);
  bottom: clamp(14px, 3vw, 34px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid rgba(199, 219, 226, .35);
  border-radius: var(--radius-pill);
  background: var(--c-deep);
  color: var(--c-snow);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 20px 34px -22px rgba(10, 28, 36, .95);
  transition: background .2s var(--ease-out), transform .2s var(--ease-out);
}

.to-top:hover {
  background: #123240;
  transform: translateY(-2px);
}

.to-top__arrow {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1;
}

.to-top[hidden] { display: none; }

/* ---------- 12. Responsive ---------- */
@media (min-width: 1025px) and (max-width: 1180px) {
  .nav__link { padding: 7px 10px; font-size: 0.875rem; }
  .brand__subline { display: none; }
}

@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; }

  .nav-capsule {
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 8px 8px 12px;
    border-radius: 24px;
  }

  .site-header[data-scrolled="true"] .nav-capsule {
    padding: 6px 6px 6px 10px;
  }

  .brand {
    order: 1;
    margin-inline-end: 0;
  }

  .nav-toggle {
    order: 2;
    margin-inline-start: auto;
  }

  .nav {
    order: 3;
    flex: 1 0 100%;
    display: none;
  }

  .nav-capsule__cta {
    order: 4;
    flex: 1 0 100%;
    display: none;
  }

  .nav-capsule[data-open] .nav { display: block; }

  .nav-capsule[data-open] .nav-capsule__cta {
    display: inline-flex;
    justify-content: center;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 8px;
    border-top: 1px solid var(--c-grid);
  }

  .nav__link {
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 1rem;
  }
}

@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

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

  .footer-brand,
  .footer-contact { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .grid--2,
  .grid--3 { grid-template-columns: minmax(0, 1fr); }

  .footer-summary { max-width: none; }
}

@media (max-width: 640px) {
  .brand__subline { display: none; }
  .brand__mark { width: 32px; height: 32px; padding-left: 8px; }
  .brand__name { font-size: 1rem; }

  .footer-top { grid-template-columns: minmax(0, 1fr); }
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .to-top { padding: 10px 14px; font-size: 0.75rem; }
}

/* ---------- 13. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
