/* ==========================================================
   半岛数据 · Site Kit 共享样式
   路径 /assets/site.css
   结构：变量 / 重置 / 无障碍 / 容器 / 页头 / 页脚 / 组件 / 动效
   ========================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  color-scheme: dark;

  --bg-deep: #0A192F;
  --bg-panel: #112240;
  --bg-raised: #1E3A5F;
  --bg-overlay: rgba(17, 34, 64, 0.78);
  --border-color: #1E3A5F;
  --border-light: #2E4E77;

  --accent-green: #00E676;
  --accent-green-soft: rgba(0, 230, 118, 0.12);
  --accent-orange: #FF6D00;
  --accent-orange-soft: rgba(255, 109, 0, 0.12);
  --accent-purple: #9C27B0;
  --accent-purple-soft: rgba(156, 39, 176, 0.16);

  --text-primary: #FFFFFF;
  --text-secondary: #B0BEC5;
  --text-muted: #5C6B7A;
  --success: #69F0AE;
  --danger: #FF5252;

  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, Georgia, serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Courier New", monospace;

  --container-max: 1200px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --header-height: 72px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 400px at 85% -10%, var(--accent-purple-soft) 0%, transparent 60%),
    radial-gradient(1000px 360px at -10% 20%, var(--accent-green-soft) 0%, transparent 55%),
    var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

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

ul,
ol {
  list-style: none;
}

a {
  color: var(--accent-green);
  text-decoration: none;
  transition: color var(--transition), background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

a:hover {
  color: var(--success);
}

/* ---------- 3. 无障碍 ---------- */
:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1200;
  padding: 10px 22px;
  background: var(--accent-green);
  color: var(--bg-deep);
  font-size: 14px;
  font-weight: 800;
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 24px rgba(0, 230, 118, 0.4);
  transform: translateY(-300%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
  opacity: 1;
}

#main-content {
  scroll-margin-top: calc(var(--header-height) + 20px);
  padding-top: calc(var(--header-height) + 24px);
}

section[id] {
  scroll-margin-top: calc(var(--header-height) + 20px);
}

/* ---------- 4. 容器与工具 ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

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

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-green);
}

.section-label::before {
  content: "";
  width: 24px;
  height: 2px;
  flex-shrink: 0;
  background: var(--accent-green);
  border-radius: 2px;
}

.section-title {
  margin-top: 12px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.section-subtitle {
  margin-top: 12px;
  max-width: 56ch;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.breadcrumb {
  padding: 4px 0 24px;
  font-size: 13px;
}

.breadcrumb ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent-green);
}

.breadcrumb [aria-current="page"] {
  color: var(--accent-green);
  font-weight: 700;
}

/* ---------- 5. 页头与导航 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 14px clamp(12px, 3vw, 32px);
}

.nav-capsule {
  max-width: var(--container-max);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 18px;
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-mark:hover {
  color: var(--text-primary);
}

.brand-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-green), #00C853);
  color: var(--bg-deep);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 230, 118, 0.35);
}

.brand-text {
  color: var(--text-primary);
  font-weight: 800;
}

.brand-text em {
  font-style: normal;
  color: var(--accent-green);
}

.site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

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

.site-nav a {
  display: inline-block;
  padding: 8px 14px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: var(--radius-pill);
}

.site-nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.site-nav a[aria-current="page"] {
  color: var(--bg-deep);
  background: var(--accent-green);
  font-weight: 800;
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.35);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--accent-green);
  color: var(--bg-deep);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  border-radius: var(--radius-pill);
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.nav-cta::after {
  content: "→";
  font-size: 16px;
  line-height: 1;
}

.nav-cta:hover {
  color: var(--bg-deep);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 230, 118, 0.4);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  transition: background-color var(--transition), border-color var(--transition);
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-toggle-line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-purple) 70%, var(--accent-orange));
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.5);
  z-index: 1100;
  pointer-events: none;
  transition: width 0.12s linear;
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: 80px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-purple) 50%, var(--accent-orange));
  opacity: 0.9;
}

.site-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr;
  gap: 48px;
  padding-top: 64px;
  padding-bottom: 56px;
}

.footer-block,
.footer-brand-block,
.footer-nav-block,
.footer-contact-block {
  min-width: 0;
}

.footer-brand {
  display: inline-flex;
  margin-bottom: 16px;
}

.footer-statement {
  max-width: 46ch;
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.trust-statement {
  max-width: 46ch;
  padding: 10px 16px;
  border-left: 2px solid var(--accent-green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-green-soft);
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
}

.footer-heading {
  position: relative;
  margin-bottom: 18px;
  padding-bottom: 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.footer-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent-green);
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 14px;
}

.footer-links a::before {
  content: "▸";
  color: var(--accent-green);
  font-size: 12px;
  transition: transform var(--transition);
}

.footer-links a:hover {
  color: var(--accent-green);
}

.footer-links a:hover::before {
  transform: translateX(3px);
}

.footer-contact-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.contact-label {
  flex-shrink: 0;
  min-width: 46px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-orange);
}

.contact-value {
  flex: 1;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-all;
}

.footer-contact a.contact-value {
  color: var(--text-secondary);
}

.footer-contact a.contact-value:hover {
  color: var(--accent-green);
}

.footer-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.footer-meta {
  border-top: 1px solid var(--border-color);
  padding: 18px 0;
}

.footer-meta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.footer-copyright,
.footer-icp {
  margin: 0;
  font-size: 12px;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-left: auto;
}

.footer-legal a {
  color: var(--text-muted);
  font-size: 12px;
}

.footer-legal a:hover {
  color: var(--accent-green);
}

/* ---------- 7. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), border-color var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--accent-green);
  color: var(--bg-deep);
}

.btn-primary:hover {
  color: var(--bg-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 230, 118, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

.btn-outline:hover {
  color: var(--accent-green);
  border-color: var(--accent-green);
  background: var(--accent-green-soft);
}

.btn-orange {
  background: var(--accent-orange);
  color: var(--bg-deep);
}

.btn-orange:hover {
  color: var(--bg-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 109, 0, 0.4);
}

.data-panel {
  position: relative;
  padding: 24px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--accent-green);
}

.data-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--text-primary);
}

.data-panel-body {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.metric-bar {
  position: relative;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  overflow: hidden;
}

.metric-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-green), var(--success));
  width: 50%;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.tag-green {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.tag-orange {
  background: var(--accent-orange-soft);
  color: var(--accent-orange);
}

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

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

.img-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-panel), var(--bg-raised));
}

.img-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, rgba(0, 230, 118, 0.06) 25%, transparent 25%, transparent 75%, rgba(0, 230, 118, 0.06) 75%),
    linear-gradient(45deg, rgba(0, 230, 118, 0.06) 25%, transparent 25%, transparent 75%, rgba(0, 230, 118, 0.06) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

.img-shell::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  text-align: center;
}

.img-shell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.img-shell--wide {
  aspect-ratio: 21 / 9;
}

.img-shell--square {
  aspect-ratio: 1 / 1;
}

.img-shell--portrait {
  aspect-ratio: 4 / 5;
}

.content-prose {
  max-width: 760px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-secondary);
}

.content-prose h2 {
  margin: 48px 0 16px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.3;
  color: var(--text-primary);
}

.content-prose h3 {
  margin: 32px 0 12px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.content-prose p {
  margin-bottom: 16px;
}

.content-prose ul {
  margin-bottom: 16px;
}

.content-prose li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 6px;
}

.content-prose li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent-green);
}

.content-prose a {
  color: var(--accent-green);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.content-prose a:hover {
  color: var(--success);
}

/* ---------- 8. 滚动显现 ---------- */
[data-reveal] {
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

[data-reveal].reveal-hidden {
  opacity: 0;
  transform: translateY(24px);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 9. 响应式 ---------- */
@media (max-width: 899px) {
  #main-content {
    padding-top: calc(var(--header-height) + 8px);
  }

  .nav-capsule {
    padding: 8px 8px 8px 16px;
    border-radius: 28px;
  }

  .nav-cta {
    margin-left: auto;
  }

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

  .site-nav {
    display: none;
    flex: 1 1 100%;
    order: 4;
    justify-content: stretch;
    margin-top: 10px;
    padding: 10px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
  }

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

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .site-nav a {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 48px;
    padding-bottom: 40px;
  }

  .footer-meta-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .footer-legal {
    margin-left: 0;
    padding-top: 4px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 899px) and (min-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

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

@media (max-width: 480px) {
  .nav-capsule {
    gap: 8px;
    padding: 6px 6px 6px 14px;
    border-radius: 24px;
  }

  .brand-symbol {
    width: 32px;
    height: 32px;
    font-size: 17px;
    border-radius: 10px;
  }

  .brand-text {
    font-size: 16px;
  }

  .nav-cta {
    padding: 8px 14px;
    font-size: 13px;
  }

  .nav-cta::after {
    font-size: 14px;
  }

  .footer-grid {
    padding-top: 40px;
    padding-bottom: 32px;
  }
}

/* ---------- 10. 弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  [data-reveal],
  [data-reveal].reveal-hidden,
  [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
  }

  .reading-progress {
    transition: none;
  }
}
