/* =====================================================
   安装APP 共享样式
   File: /assets/site.css
   ===================================================== */

/* ---------- 0. Design Tokens ---------- */
:root {
  --pitch-900: #0A5C36;
  --pitch-500: #17B06B;
  --pitch-100: #DCF4E9;
  --energy-500: #FF7A1A;
  --tech-500: #1F7CE4;
  --surface-100: #F4FBF7;
  --surface-200: #E8F3EE;
  --ink-900: #0A1F17;
  --ink-700: #3A5A4E;
  --live-500: #00C2A8;

  --font-head: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-data: 'JetBrains Mono', 'SFMono-Regular', 'Cascadia Code', monospace;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-sm: 4px;
  --radius: 6px;
  --shadow-sm: 0 1px 4px rgba(10,31,23,0.08);
  --shadow-md: 0 6px 24px rgba(10,31,23,0.14);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--surface-100);
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-900);
  background-color: var(--surface-100);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--tech-500);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--ink-900);
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

strong,
b {
  font-weight: 700;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  color: var(--ink-900);
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

p + p {
  margin-top: 0.6em;
}

::selection {
  background: var(--pitch-500);
  color: var(--ink-900);
}

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

/* ---------- 2. Utility & Base Layout ---------- */
.page-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter);
}

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

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--radius);
  border: 2px solid transparent;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease,
    transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-primary {
  background: var(--pitch-500);
  color: #fff;
}

.btn-primary:hover {
  background: var(--pitch-900);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-accent {
  background: var(--energy-500);
  color: var(--ink-900);
}

.btn-accent:hover {
  background: #ff8f3d;
  color: var(--ink-900);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  border-color: var(--tech-500);
  color: var(--tech-500);
}

.btn-ghost:hover {
  background: var(--tech-500);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ---------- 4. Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-700);
  margin: 0 0 1.5rem;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.breadcrumb li + li::before {
  content: '/';
  margin-right: 0.35rem;
  color: var(--pitch-500);
  font-weight: 600;
}

.breadcrumb a {
  color: var(--tech-500);
}

.breadcrumb a:hover {
  color: var(--ink-900);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--ink-700);
}

/* ---------- 5. Section Label ---------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-data);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--tech-500);
}

.section-label::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--energy-500);
  flex-shrink: 0;
}

.section-label--green {
  color: var(--pitch-500);
}

.section-label--orange {
  color: var(--energy-500);
}

/* ---------- 6. Split Layout ---------- */
.split-layout {
  display: grid;
  grid-template-columns: var(--split, 2fr 3fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.split-aside,
.split-main {
  min-width: 0;
}

/* ---------- 7. Figure Placeholder ---------- */
.figure-block {
  position: relative;
  overflow: hidden;
  background: var(--pitch-100);
  border-radius: var(--radius);
}

.figure-block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure-block--wide {
  aspect-ratio: 16 / 8;
}

.figure-block--portrait {
  aspect-ratio: 3 / 4;
}

.figure-block--card {
  aspect-ratio: 4 / 3;
}

/* ---------- 8. Data Chip ---------- */
.data-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  background: var(--surface-200);
  border-left: 3px solid var(--tech-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-data);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-700);
}

.data-chip--orange {
  border-left-color: var(--energy-500);
}

.data-chip--green {
  border-left-color: var(--pitch-500);
}

/* ---------- 9. Header ---------- */
.site-header {
  position: relative;
  z-index: 100;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--gutter);
  z-index: 999;
  padding: 0.6rem 1.2rem;
  background: var(--energy-500);
  color: var(--ink-900);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-md);
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 0;
  color: var(--ink-900);
}

/* --- Masthead --- */
.masthead {
  background:
    linear-gradient(110deg, rgba(23, 176, 107, 0.16) 0%, transparent 42%),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 12px
    ),
    var(--pitch-900);
  color: #fff;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.masthead-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.85rem var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  min-height: 68px;
}

.masthead-side {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.masthead-notes {
  justify-self: start;
}

.masthead-actions {
  justify-self: end;
}

.masthead-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--live-500);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.masthead-note {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.masthead-brand {
  text-align: center;
}

.brand-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #fff;
  line-height: 1.15;
  transition: opacity 0.18s ease;
}

.brand-link:hover,
.brand-link:focus-visible {
  color: #fff;
  opacity: 0.88;
}

.brand-word {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fff;
}

.brand-sub {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: var(--energy-500);
  color: var(--ink-900);
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.header-cta:hover {
  background: #ff8f3d;
  color: var(--ink-900);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.14);
  text-decoration: none;
}

.cta-mono {
  font-family: var(--font-data);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
}

/* --- Scroll Progress --- */
.scroll-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background-color: var(--tech-500);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 5;
  pointer-events: none;
}

/* --- Nav Strip --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 80;
  background-color: var(--surface-100);
  border-bottom: 1px solid var(--surface-200);
  box-shadow: 0 1px 0 rgba(10, 31, 23, 0.02);
}

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.35rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  flex-wrap: wrap;
  position: relative;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-900);
  border-radius: var(--radius-sm);
  background: var(--surface-200);
  transition: background-color 0.18s ease;
}

.nav-toggle:hover {
  background: var(--pitch-100);
}

.nav-toggle-icon {
  width: 18px;
  height: 14px;
  position: relative;
  display: block;
  flex-shrink: 0;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease;
}

.nav-toggle-icon::before {
  top: 0;
}

.nav-toggle-icon::after {
  bottom: 0;
}

.site-nav[data-open] .nav-toggle-icon::before {
  transform: translateY(6px) rotate(45deg);
}

.site-nav[data-open] .nav-toggle-icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-toggle-text {
  line-height: 1;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.1rem;
}

.nav-item {
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  color: var(--ink-700);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  position: relative;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.15rem;
  height: 2px;
  background: var(--pitch-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-link:hover {
  color: var(--pitch-900);
  background: rgba(220, 244, 233, 0.35);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-link[aria-current="page"] {
  color: var(--pitch-900);
  font-weight: 600;
  background: rgba(220, 244, 233, 0.45);
}

/* ---------- 10. Footer ---------- */
.site-footer {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 18px
    ),
    var(--ink-900);
  color: rgba(235, 245, 240, 0.85);
  position: relative;
}

.site-footer::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--pitch-500) 0 45%,
    var(--energy-500) 45% 62%,
    var(--tech-500) 62% 100%
  );
}

.footer-grid {
  max-width: var(--container);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 2rem;
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 1.1fr;
  gap: 2rem;
  align-items: start;
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.footer-brand-word {
  font-family: var(--font-head);
  font-size: 1.55rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.footer-brand-sub {
  font-size: 0.82rem;
  color: rgba(220, 244, 233, 0.6);
}

.footer-statement {
  font-size: 0.9rem;
  line-height: 1.8;
  color: rgba(235, 245, 240, 0.72);
  padding-left: 1rem;
  border-left: 3px solid var(--pitch-500);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.86rem;
  color: rgba(235, 245, 240, 0.75);
}

.footer-mail {
  font-family: var(--font-data);
  font-size: 0.82rem;
  color: var(--pitch-500);
}

.footer-phone {
  font-family: var(--font-data);
  font-size: 0.82rem;
  color: rgba(235, 245, 240, 0.85);
}

.footer-address {
  font-size: 0.78rem;
  line-height: 1.6;
  color: rgba(235, 245, 240, 0.55);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  margin-top: 0.6rem;
}

.footer-links a {
  color: rgba(220, 244, 233, 0.8);
  font-size: 0.84rem;
  padding: 0.15rem 0.3rem;
  border-radius: var(--radius-sm);
  transition: color 0.18s ease, background-color 0.18s ease;
}

.footer-links a:hover {
  color: var(--energy-500);
  background: rgba(255, 122, 26, 0.1);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.85rem var(--gutter) 1rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: rgba(235, 245, 240, 0.45);
}

/* ---------- 11. Responsive ---------- */
@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .footer-statement {
    grid-column: 1 / -1;
    padding-left: 0;
    border-left: none;
    border-top: 3px solid var(--pitch-500);
    padding-top: 0.75rem;
  }
}

@media (max-width: 900px) {
  .masthead-note {
    display: none;
  }
}

@media (max-width: 768px) {
  /* header */
  .masthead-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    min-height: 58px;
  }

  .masthead-notes {
    display: none;
  }

  .masthead-brand {
    text-align: left;
  }

  .brand-link {
    align-items: flex-start;
  }

  .brand-word {
    font-size: 1.3rem;
  }

  .header-cta {
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
  }

  .cta-mono {
    font-size: 1rem;
  }

  /* nav */
  .nav-inner {
    justify-content: flex-end;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    min-height: 48px;
  }

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

  .nav-list {
    order: 2;
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0.35rem;
    gap: 0.1rem;
  }

  .site-nav[data-open] .nav-list {
    display: flex;
  }

  .nav-link {
    display: block;
    padding: 0.7rem 0.8rem;
    font-size: 0.95rem;
  }

  .nav-link::after {
    display: none;
  }

  /* split */
  .split-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding-top: 2rem;
  }
}

@media (max-width: 480px) {
  .cta-mono {
    display: none;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 12. Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
