/* ===== RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--dark-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

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

:focus-visible {
  outline: 2px solid var(--primary-red);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== CSS VARIABLES ===== */
:root {
  --primary-red: #E63946;
  --secondary-blue: #1D3557;
  --metallic-silver: #B0BEC5;
  --dark-bg: #0B0C10;
  --cream-bg: #FAF3E0;
  --accent-orange: #F4A261;
  --text-primary: #FFFFFF;
  --text-secondary: #B0BEC5;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --glow-red: rgba(230, 57, 70, 0.4);
  --header-width: 260px;
  --header-width-collapsed: 72px;
  --transition-speed: 0.35s;
  --font-heading: 'Montserrat', 'PingFang SC', sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --content-max: 1200px;
  --z-header: 1000;
  --z-nav-overlay: 1100;
  --z-skip: 1200;
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: fixed;
  top: -100%;
  left: 0;
  z-index: var(--z-skip);
  padding: 0.75rem 1.5rem;
  background: var(--primary-red);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 4px 0;
  transition: top 0.25s ease;
}
.skip-link:focus {
  top: 0;
}

/* ===== HEADER / NAV TRACK ===== */
.header-track {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--header-width);
  height: 100vh;
  background: var(--dark-bg);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: var(--z-header);
  padding: 1.75rem 1.25rem;
  transition: transform var(--transition-speed) ease;
  overflow-y: auto;
}

.header-brand {
  margin-bottom: 2.5rem;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}
.logo:hover {
  color: var(--primary-red);
}
.logo-icon {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--primary-red);
}

.slogan {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===== NAVIGATION RAIL ===== */
.nav-rail {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.25s ease;
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary-red);
  border-radius: 0 3px 3px 0;
  transition: height 0.25s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(230, 57, 70, 0.08);
}
.nav-link:hover::before {
  height: 60%;
}

.nav-link[aria-current="page"] {
  color: var(--text-primary);
  background: rgba(230, 57, 70, 0.12);
  box-shadow: inset 3px 0 0 var(--primary-red);
}
.nav-link[aria-current="page"]::before {
  height: 70%;
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-red);
  opacity: 0.7;
  min-width: 1.8rem;
  letter-spacing: 0.02em;
}

.nav-link[aria-current="page"] .nav-index {
  opacity: 1;
  color: var(--primary-red);
}

.nav-label {
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ===== NAV TOGGLE ===== */
.nav-toggle {
  display: none;
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  z-index: 10;
  transition: background 0.2s ease;
}
.nav-toggle:hover {
  background: rgba(230, 57, 70, 0.15);
}
.toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

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

/* ===== HEADER CTA ===== */
.header-meta {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.header-cta {
  display: block;
  text-align: center;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== BUTTON ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-red), var(--secondary-blue));
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, var(--glow-red), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn:hover::after {
  opacity: 1;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--glow-red);
}
.btn:active {
  transform: translateY(0);
}

/* ===== MAIN CONTENT ===== */
#main-content {
  margin-left: var(--header-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ===== SCROLL PROGRESS ===== */
[data-scroll-progress] {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 900;
  pointer-events: none;
}
[data-scroll-progress]::after {
  content: '';
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-red), var(--secondary-blue));
  transition: width 0.05s linear;
  will-change: width;
}
@media (prefers-reduced-motion: reduce) {
  [data-scroll-progress]::after {
    transition: none;
  }
}

/* ===== CONTENT CONTAINER ===== */
.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem 2rem;
  width: 100%;
  flex: 1;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
}
.breadcrumb a {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}
.breadcrumb a:hover {
  color: var(--primary-red);
}
.breadcrumb .sep {
  color: var(--primary-red);
  opacity: 0.6;
}
.breadcrumb [aria-current="page"] {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== SECTION NUMBER ===== */
.section-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 700;
  color: var(--primary-red);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: -0.3em;
  letter-spacing: -0.03em;
  user-select: none;
}

/* ===== IMAGE CONTAINER ===== */
.img-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: var(--metallic-silver);
  background-image: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.05) 0%, transparent 60%);
  border-radius: 8px;
  overflow: hidden;
}
.img-container img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== FOOTER ===== */
.site-footer {
  margin-left: var(--header-width);
  background: var(--dark-bg);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 2rem 1.5rem;
  color: var(--text-secondary);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}
.footer-logo:hover {
  color: var(--primary-red);
}

.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 300;
  letter-spacing: 0.06em;
}

.footer-trust {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 1rem;
  opacity: 0.8;
  max-width: 32em;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-nav,
.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: inline-block;
}
.footer-link:hover {
  color: var(--primary-red);
  padding-left: 4px;
}

.footer-address {
  font-size: 0.85rem;
  color: var(--text-secondary);
  opacity: 0.7;
  font-style: normal;
}

.footer-bottom {
  max-width: var(--content-max);
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.footer-icp,
.footer-copy {
  font-size: 0.75rem;
}

/* ===== TABLET ===== */
@media (max-width: 1199px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ===== MOBILE ===== */
@media (max-width: 1023px) {
  :root {
    --header-width: 0px;
  }

  .header-track {
    width: 100%;
    height: auto;
    min-height: 60px;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    transform: none;
  }

  .header-brand {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .logo {
    font-size: 1.2rem;
  }
  .logo-icon {
    font-size: 1.4rem;
  }

  .slogan {
    display: none;
  }

  .nav-rail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--dark-bg);
    z-index: var(--z-nav-overlay);
    padding: 5rem 1.5rem 2rem;
    transform: translateX(-100%);
    transition: transform var(--transition-speed) ease;
    overflow-y: auto;
    border-right: 1px solid var(--border-subtle);
  }
  .nav-rail[data-open] {
    transform: translateX(0);
  }

  .nav-list {
    gap: 0.15rem;
  }
  .nav-link {
    padding: 0.85rem 0.75rem;
    font-size: 1rem;
  }
  .nav-index {
    font-size: 0.8rem;
    min-width: 2rem;
  }

  .nav-toggle {
    display: flex;
  }

  .header-meta {
    display: none;
  }

  #main-content {
    margin-left: 0;
  }

  .site-footer {
    margin-left: 0;
    padding: 2rem 1.25rem 1.25rem;
  }

  .content {
    padding: 1.5rem 1.25rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .footer-brand {
    grid-column: 1;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== SMALL MOBILE ===== */
@media (max-width: 480px) {
  .logo {
    font-size: 1rem;
  }
  .logo-icon {
    font-size: 1.2rem;
  }
  .nav-toggle {
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
  }
  .content {
    padding: 1rem 0.75rem;
  }
  .section-number {
    font-size: 2.8rem;
  }
  .footer-heading {
    font-size: 0.8rem;
  }
}
