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

:root {
  --paper-warm: #F5F0E8;
  --ink-deep: #1C1C1C;
  --accent-orange: #FF5A00;
  --accent-blue: #1A3D5C;
  --accent-green: #4CAF50;
  --divider: #D9CFC2;
  --muted-text: #6A6259;
  --card-bg: #FFF9EF;
  --shadow: rgba(0, 0, 0, 0.08);
  --highlight: #FF3366;
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --container-max: 1200px;
  --container-pad: clamp(16px, 4vw, 36px);
  --header-h: 72px;
  --font-display: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-card: 0 1px 2px var(--shadow), 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 4px 12px rgba(0, 0, 0, 0.08), 0 16px 48px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: var(--font-body);
  background: var(--paper-warm);
  color: var(--ink-deep);
  line-height: 1.7;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

ul,
ol {
  list-style: none;
}

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

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

:focus-visible {
  outline: 3px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: 2px;
}

::selection {
  background: var(--accent-orange);
  color: #fff;
}

/* ============ Container ============ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ============ Skip Link ============ */
.skip-link {
  position: fixed;
  z-index: 9999;
  top: 12px;
  left: 12px;
  padding: 10px 18px;
  background: var(--accent-blue);
  color: #fff;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transform: translateY(-120%);
  transition: transform 0.2s var(--ease-out);
}

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

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 800;
  background: var(--paper-warm);
  border-bottom: 1px solid var(--divider);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
}

/* Brand */
.brand {
  flex-shrink: 0;
}

.brand__link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand__logo {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

.brand__logo-field {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue) 0%, #0E2A44 100%);
  border: 2px solid var(--accent-blue);
  overflow: hidden;
}

.brand__logo-field::before {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 2px;
  background: var(--accent-orange);
  transform: rotate(-12deg);
}

.brand__logo-field::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  bottom: 18%;
  height: 2px;
  background: var(--accent-green);
  transform: rotate(8deg);
  opacity: 0.7;
}

.brand__logo-ball {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  z-index: 1;
  box-shadow: 0 0 0 3px var(--accent-orange);
}

.brand__logo-seam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  background: var(--accent-blue);
  transform-origin: left center;
  z-index: 2;
}

.brand__logo-seam--one {
  transform: translate(-50%, -50%) rotate(35deg) translateX(5px);
}

.brand__logo-seam--two {
  transform: translate(-50%, -50%) rotate(-35deg) translateX(5px);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--ink-deep);
}

.brand__caption {
  font-size: 11px;
  color: var(--muted-text);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

/* Navigation */
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-deep);
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
  letter-spacing: 0.02em;
}

.site-nav__link:hover {
  background: rgba(255, 90, 0, 0.08);
}

.site-nav__link[aria-current="page"] {
  background: var(--accent-blue);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 0 var(--accent-orange);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-actions__btn {
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid var(--divider);
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.nav-toggle:hover {
  background: rgba(255, 90, 0, 0.08);
  border-color: var(--accent-orange);
}

.nav-toggle__line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink-deep);
  border-radius: 2px;
  transition: transform 0.25s var(--ease-out), opacity 0.2s;
}

.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);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s var(--ease-out), color 0.2s var(--ease-out);
  cursor: pointer;
}

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

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--accent-orange);
  color: #1C1C1C;
}

.btn--primary:hover {
  box-shadow: 0 8px 20px rgba(255, 90, 0, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.btn--ghost:hover {
  background: var(--accent-blue);
  color: #fff;
}

/* ============ Panel System ============ */
.panel-section {
  padding: clamp(56px, 10vw, 96px) 0;
  position: relative;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: clamp(20px, 4vw, 48px);
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.panel-index {
  font-family: var(--font-mono);
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 700;
  line-height: 1;
  color: var(--accent-orange);
  position: relative;
  letter-spacing: -0.04em;
}

.panel-index::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--accent-blue);
  transform: rotate(45deg);
}

.panel-head__main {
  flex: 1;
  min-width: 240px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink-deep);
}

.panel-desc {
  margin-top: 8px;
  max-width: 560px;
  color: var(--muted-text);
  font-size: 15px;
  line-height: 1.8;
}

/* ============ Data Card ============ */
.data-card {
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.data-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-orange);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s var(--ease-out);
}

.data-card:hover::before {
  transform: scaleY(1);
}

.data-card--blue::before {
  background: var(--accent-blue);
}

.data-card--green::before {
  background: var(--accent-green);
}

.data-card__label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted-text);
  text-transform: uppercase;
}

.data-card__value {
  font-family: var(--font-mono);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: var(--ink-deep);
  margin-top: 6px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.data-card__meta {
  font-size: 13px;
  color: var(--muted-text);
  margin-top: 6px;
}

/* ============ Page Header ============ */
.page-header {
  padding: clamp(40px, 8vw, 76px) 0 clamp(32px, 5vw, 48px);
  position: relative;
  border-bottom: 1px solid var(--divider);
}

.page-breadcrumb {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-text);
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-breadcrumb a {
  color: var(--accent-blue);
  font-weight: 500;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-deep);
}

.page-lede {
  margin-top: 12px;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--muted-text);
}

/* ============ Footer ============ */
.site-footer {
  background: var(--accent-blue);
  color: rgba(255, 255, 255, 0.85);
  margin-top: clamp(72px, 10vw, 120px);
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-orange) 0%, var(--accent-orange) 30%, var(--accent-green) 30%, var(--accent-green) 44%, var(--accent-blue) 44%, var(--accent-blue) 78%, #fff 78%, #fff 100%);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1.2fr;
  gap: clamp(24px, 4vw, 48px);
  padding: clamp(40px, 6vw, 64px) 0 32px;
}

.site-footer__logo {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
}

.site-footer__logo-field {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent-orange);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.site-footer__logo-field::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  transform: rotate(-12deg);
}

.site-footer__logo-ball {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.site-footer__brand-name {
  font-size: 20px;
  font-weight: 900;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: #fff;
}

.site-footer__brand-desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.78;
  color: rgba(255, 255, 255, 0.7);
  max-width: 320px;
}

.site-footer__heading {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-orange);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.site-footer__nav li + li {
  margin-top: 6px;
}

.footer-link {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s var(--ease-out), padding-left 0.2s var(--ease-out);
  position: relative;
}

.footer-link:hover {
  color: #fff;
  padding-left: 4px;
}

.footer-link::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent-orange);
  transition: width 0.2s var(--ease-out);
}

.footer-link:hover::before {
  width: 100%;
}

.site-footer__contact-list li + li {
  margin-top: 10px;
}

.footer-contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-contact-item__label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.footer-contact-item__value {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.2s var(--ease-out);
}

a.footer-contact-item__value:hover {
  color: var(--accent-orange);
}

.site-footer__meta {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.site-footer__icp,
.site-footer__service {
  letter-spacing: 0.03em;
}

/* ============ Reveal Animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Ticker Bar ============ */
.ticker-bar {
  background: var(--accent-blue);
  color: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-float);
}

.ticker-bar__viewport {
  overflow: hidden;
  width: 100%;
}

.ticker-list {
  display: flex;
  gap: 0;
  transition: transform 0.5s var(--ease-out);
}

.ticker-item {
  flex: 0 0 100%;
  min-width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  font-size: 14px;
}

.ticker-match {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.ticker-score {
  color: var(--accent-orange);
  font-weight: 700;
}

.ticker-status {
  color: var(--accent-green);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.ticker-previous,
.ticker-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease-out);
  z-index: 2;
}

.ticker-previous {
  left: 8px;
}

.ticker-next {
  right: 8px;
}

.ticker-previous:hover,
.ticker-next:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ============ Scrollspy ============ */
.section-scrollspy {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

[data-scrollspy] .panel-index {
  transition: color 0.3s var(--ease-out);
}

[data-scrollspy].is-active .panel-index {
  color: var(--accent-blue);
}

[data-scrollspy].is-active .panel-index::after {
  background: var(--accent-orange);
}

/* ============ Back to Top ============ */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: var(--ink-deep);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-float);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0.3s;
  cursor: pointer;
  z-index: 900;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
}

/* ============ Speed Lines ============ */
.speed-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.speed-lines::before,
.speed-lines::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  background: repeating-linear-gradient(
    105deg,
    transparent 0px,
    transparent 18px,
    rgba(255, 255, 255, 0.4) 19px,
    transparent 22px
  );
  opacity: 0.06;
}

.speed-lines--light::before {
  background: repeating-linear-gradient(
    105deg,
    transparent 0px,
    transparent 18px,
    rgba(26, 61, 92, 0.5) 19px,
    transparent 22px
  );
  opacity: 0.12;
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .site-header__inner {
    gap: 16px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 60px;
  }

  .site-header__inner {
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .brand__logo {
    width: 36px;
    height: 36px;
  }

  .brand__name {
    font-size: 18px;
  }

  .brand__caption {
    font-size: 10px;
  }

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

  .header-actions__btn {
    display: none;
  }

  .site-nav {
    position: fixed;
    top: calc(var(--header-h) + 4px);
    right: 16px;
    left: 16px;
    z-index: 850;
    background: rgba(245, 240, 232, 0.98);
    border: 1px solid var(--divider);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-float);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0.3s;
  }

  .site-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .site-nav__link {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 16px;
  }

  .site-nav__link[aria-current="page"] {
    background: var(--accent-blue);
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 40px;
  }

  .site-footer__meta {
    flex-direction: column;
    gap: 8px;
  }

  .panel-head {
    gap: 16px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }

  .ticker-previous,
  .ticker-next {
    display: none;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .brand__caption {
    display: none;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .ticker-list {
    transition: none;
  }

  .back-to-top {
    transition: opacity 0.01ms, transform 0.01ms, visibility 0.01ms;
  }
}
