/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img, picture, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; padding: 0; cursor: pointer; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--color-accent-green); color: var(--color-bg); }

/* ============ CSS Variables ============ */
:root {
  --color-bg: #0B1E3F;
  --color-surface: #122A4F;
  --color-light-surface: #F5F7FA;
  --color-accent-green: #39FF14;
  --color-accent-orange: #FF6A00;
  --color-text-light: #E6EDF5;
  --color-text-dark: #1A2332;
  --color-red: #FF2A2A;
  --color-gold: #FFD700;
  --color-aux-blue: #8B9DC3;
  --color-wine: #4A1E2E;
  --color-indigo: #2B1466;
  --font-headline: 'Archivo Black', 'Arial Black', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Roboto', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --container-max: 1200px;
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.32);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============ Base Typography ============ */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-light);
  background-color: var(--color-bg);
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  font-weight: 900;
  line-height: 1.15;
  color: var(--color-text-light);
}
h1 { font-size: clamp(32px, 5vw, 56px); }
h2 { font-size: clamp(24px, 3.6vw, 36px); }
h3 { font-size: clamp(18px, 2.4vw, 26px); }
a { color: var(--color-accent-green); transition: color 0.25s ease; }
a:hover { color: var(--color-accent-orange); }
#main-content { scroll-margin-top: 110px; }

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-surface); border-radius: 5px; border: 2px solid var(--color-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--color-aux-blue); }

/* ============ Container ============ */
.container {
  width: min(var(--container-max), 100% - 48px);
  margin-inline: auto;
}

/* ============ Sections ============ */
.section { padding-block: clamp(48px, 8vw, 88px); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-title { margin-bottom: 8px; }
.section-desc { font-size: 16px; color: var(--color-aux-blue); }
.section-light { background: var(--color-light-surface); color: var(--color-text-dark); }
.section-light h1, .section-light h2, .section-light h3,
.section-light h4, .section-light h5, .section-light h6 { color: var(--color-text-dark); }
.section-light .section-desc { color: #4A5770; }
.section-light a:not(.btn) { color: var(--color-text-dark); text-decoration: underline; text-decoration-color: rgba(255, 106, 0, 0.5); text-underline-offset: 3px; }
.section-light a:not(.btn):hover { color: var(--color-accent-orange); }
.section-wine { background: var(--color-wine); }
.section-indigo { background: var(--color-indigo); }

/* ============ Chapter Label / Display Title / Keyline ============ */
.chapter-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent-green);
  margin-bottom: 14px;
}
.chapter-label::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--color-accent-green);
  border-radius: 2px;
}
.section-light .chapter-label { color: #0E5C16; }
.section-light .chapter-label::before { background: #0E5C16; }
.display-title {
  font-family: var(--font-headline);
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-text-light);
}
.section-light .display-title { color: var(--color-text-dark); }
.keyline {
  height: 2px;
  border: 0;
  margin: 32px 0;
  background: linear-gradient(90deg, var(--color-accent-green), var(--color-accent-orange) 60%, transparent);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--color-accent-green); color: var(--color-bg); }
.btn-primary:hover { box-shadow: 0 0 28px rgba(57, 255, 20, 0.35); color: var(--color-bg); }
.btn-outline { border-color: var(--color-accent-orange); color: var(--color-accent-orange); }
.btn-outline:hover { background: var(--color-accent-orange); color: var(--color-bg); }
.btn-sm { min-height: 36px; padding: 6px 16px; font-size: 13px; }
.section-light .btn-outline { border-color: var(--color-bg); color: var(--color-bg); }
.section-light .btn-outline:hover { background: var(--color-bg); color: var(--color-light-surface); }

/* ============ Grid ============ */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============ Card ============ */
.card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid rgba(139, 157, 195, 0.16);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(57, 255, 20, 0.4);
  box-shadow: var(--shadow-lg);
}
.card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-surface), #091A36);
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 24px;
}
.card-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent-orange);
}
.card-title { font-size: 18px; line-height: 1.3; }
.card-text { font-size: 14px; line-height: 1.65; color: var(--color-aux-blue); }
.section-light .card { background: #FFFFFF; border-color: rgba(26, 35, 50, 0.1); }
.section-light .card-title { color: var(--color-text-dark); }
.section-light .card-text { color: #4A5770; }

/* ============ Figure Frame ============ */
.figure-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(57, 255, 20, 0.06) 0%, transparent 42%),
    linear-gradient(315deg, rgba(255, 106, 0, 0.05) 0%, transparent 36%),
    linear-gradient(180deg, var(--color-surface), #091A36);
}
.figure-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(255, 255, 255, 0.022) 14px 16px);
}
.figure-frame::after {
  content: attr(data-label);
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 1;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(230, 237, 245, 0.45);
}
.figure-frame--wide { aspect-ratio: 21 / 9; }
.figure-frame--tall { aspect-ratio: 4 / 5; }
.section-light .figure-frame { background: #FFFFFF; border: 1px solid rgba(26, 35, 50, 0.08); }
.section-light .figure-frame::after { color: rgba(26, 35, 50, 0.4); }

/* ============ Breadcrumb ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 18px 0;
  font-size: 14px;
}
.breadcrumb-item { color: var(--color-aux-blue); }
.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  margin-right: 8px;
  color: rgba(139, 157, 195, 0.5);
}
.breadcrumb-item.is-current { color: var(--color-accent-green); font-weight: 500; }
.section-light .breadcrumb-item { color: #4A5770; }
.section-light .breadcrumb-item.is-current { color: var(--color-bg); }

/* ============ Skip Link ============ */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 2000;
  background: var(--color-accent-green);
  color: var(--color-bg);
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  transform: translateY(-160%);
  transition: transform 0.25s ease;
}
.skip-link:focus-visible { transform: translateY(0); }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--color-bg);
  border-bottom: 1px solid rgba(139, 157, 195, 0.12);
}
.header-top {
  position: relative;
  background: linear-gradient(180deg, #0A1935 0%, #0C2044 100%);
  overflow: hidden;
}
.header-top::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(57, 255, 20, 0.07) 14px 15px);
  pointer-events: none;
}
.header-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  padding-block: 5px;
  position: relative;
}
.header-brand-line {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--color-aux-blue);
  white-space: nowrap;
}
.header-bookmark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 2px 14px;
  border: 1px solid rgba(255, 106, 0, 0.7);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-accent-orange);
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.header-bookmark:hover {
  background: var(--color-accent-orange);
  color: var(--color-bg);
}
.header-bookmark.is-saving {
  background: var(--color-accent-orange);
  border-color: var(--color-accent-orange);
  color: var(--color-bg);
  animation: pulse-glow 0.6s ease;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 106, 0, 0); }
  50% { box-shadow: 0 0 20px rgba(255, 106, 0, 0.45); }
}
.header-main {
  position: relative;
  z-index: 700;
  background: linear-gradient(180deg, var(--color-bg) 0%, #0D2149 100%);
}
.header-main::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent-green) 0%, var(--color-accent-orange) 55%, transparent 100%);
  opacity: 0.55;
  pointer-events: none;
}
.header-main-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brand-logo-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--color-accent-green);
  color: var(--color-bg);
  font-family: var(--font-headline);
  font-size: 19px;
  font-weight: 900;
  clip-path: polygon(0 0, 82% 0, 100% 18%, 100% 100%, 18% 100%, 0 82%);
  box-shadow: 0 0 14px rgba(57, 255, 20, 0.25);
}
.brand-logo-text {
  font-family: var(--font-headline);
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--color-text-light);
}
.brand-logo-text::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--color-accent-orange);
  vertical-align: middle;
}

/* ============ Nav ============ */
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-link {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--color-text-light);
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: calc(100% - 14px);
  bottom: 2px;
  height: 2px;
  background: var(--color-accent-green);
  transition: right 0.3s var(--ease-out);
}
.nav-link:hover::after, .nav-link[aria-current="page"]::after { right: 14px; }
.nav-link:hover { color: var(--color-accent-green); }
.nav-link[aria-current="page"] { color: var(--color-accent-green); }

/* ============ Nav Toggle ============ */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 46px;
  height: 44px;
  border: 1px solid rgba(139, 157, 195, 0.25);
  border-radius: var(--radius-sm);
  background: rgba(139, 157, 195, 0.06);
}
.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text-light);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s ease;
}
.nav-toggle:hover { border-color: var(--color-accent-green); }
.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) { transform: translateY(6px) 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(-6px) rotate(-45deg); }

/* ============ Scroll Progress ============ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 950;
  background: rgba(139, 157, 195, 0.12);
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--color-accent-green), var(--color-accent-orange));
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.35);
  transition: width 0.15s linear;
}

/* ============ Footer ============ */
.site-footer {
  position: relative;
  background: linear-gradient(180deg, #091731 0%, #071229 100%);
  border-top: 1px solid rgba(139, 157, 195, 0.14);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent-green), var(--color-accent-orange) 55%, transparent);
  opacity: 0.6;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.6fr;
  gap: 36px;
  padding-block: 56px 44px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.footer-logo {
  font-family: var(--font-headline);
  font-size: 26px;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
}
.footer-logo::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--color-accent-green);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.55);
  vertical-align: middle;
}
.footer-tagline {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: var(--color-accent-orange);
}
.footer-note {
  font-size: 14px;
  line-height: 1.75;
  color: var(--color-aux-blue);
  max-width: 34em;
}
.footer-trust {
  position: relative;
  margin-top: 4px;
  padding-left: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-light);
  border-left: 3px solid var(--color-accent-orange);
}
.footer-col-title {
  font-family: var(--font-headline);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-bottom: 18px;
}
.footer-col-title::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  margin-top: 6px;
  background: var(--color-accent-orange);
  border-radius: 2px;
}
.footer-links {
  display: grid;
  gap: 10px;
}
.footer-links a {
  font-size: 14px;
  color: var(--color-aux-blue);
  transition: color 0.25s ease, padding-left 0.25s ease;
}
.footer-links a:hover { color: var(--color-accent-green); padding-left: 4px; }
.footer-contact p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--color-aux-blue);
  word-break: break-all;
}
.footer-contact strong {
  color: var(--color-text-light);
  font-weight: 500;
}
.footer-time-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(139, 157, 195, 0.16);
  font-size: 12px;
  color: rgba(139, 157, 195, 0.7);
}
.footer-bottom {
  border-top: 1px solid rgba(139, 157, 195, 0.14);
  padding-block: 18px;
}
.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--color-aux-blue);
}

/* ============ Reveal Animation ============ */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.24s; }
.reveal-delay-3 { transition-delay: 0.36s; }

/* ============ Focus Visible ============ */
:focus-visible {
  outline: 3px solid var(--color-accent-orange);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 991px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    background: rgba(7, 18, 41, 0.97);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 110px 32px 40px;
    z-index: 699;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
  }
  .site-nav[data-open] { opacity: 1; visibility: visible; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 6px; }
  .nav-link {
    display: block;
    padding: 16px 20px;
    font-size: 20px;
    font-family: var(--font-headline);
    font-weight: 900;
    border-bottom: 1px solid rgba(139, 157, 195, 0.12);
  }
  .nav-link::after { display: none; }
  .nav-link[aria-current="page"] { color: var(--color-accent-green); }
  .header-main { z-index: 700; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 36px; padding-block: 44px 32px; }
  .container { width: min(var(--container-max), 100% - 32px); }
  .header-top-inner { min-height: 30px; }
  .header-brand-line { font-size: 11px; letter-spacing: 0.04em; overflow: hidden; text-overflow: ellipsis; }
  .header-main-inner { min-height: 60px; gap: 12px; }
  .brand-logo-mark { width: 36px; height: 36px; font-size: 17px; }
  .brand-logo-text { font-size: 17px; }
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ============ Reduced Motion ============ */
@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;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .scroll-progress span { transition: none; }
}
