/* ================================================
   BSPORTS「CN」共享样式表
   文件位置：/assets/site.css
   ================================================ */

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

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

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

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

ul,
ol {
  list-style: none;
}

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

input,
textarea,
select {
  font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: clamp(32px, 5.2vw, 56px); }
h2 { font-size: clamp(24px, 3.2vw, 34px); }
h3 { font-size: 20px; }
h4 { font-size: 18px; }

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

/* ---------- 2. CSS Variables ---------- */
:root {
  --color-bg: #0B1026;
  --color-panel: #1C2541;
  --color-panel-light: #232D4D;
  --color-accent: #39FF14;
  --color-gold: #FFD700;
  --color-text: #E5E7EB;
  --color-text-dim: #94A3B8;
  --color-link: #00E5FF;
  --color-warn: #FF3366;
  --font-head: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-body: "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  --header-width: 240px;
  --header-height: 64px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-bg-start: rgba(11, 16, 38, 0.72);
  --header-bg-end: rgba(11, 16, 38, 0.97);
}

/* ---------- 3. Accessibility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  background: var(--color-accent);
  color: var(--color-bg);
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  transition: top 0.25s ease;
}

.skip-link:focus {
  top: 16px;
  color: var(--color-bg);
  outline: none;
  box-shadow: 0 0 0 4px rgba(57, 255, 20, 0.35);
}

/* ---------- 4. Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--header-width);
  height: 100vh;
  height: 100dvh;
  z-index: 1000;
  background: var(--header-bg-start);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-right: 1px solid rgba(57, 255, 20, 0.12);
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(57, 255, 20, 0.03) 25%, transparent 25%),
    linear-gradient(225deg, rgba(57, 255, 20, 0.03) 25%, transparent 25%);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.site-header[data-scrolled="true"] {
  background: var(--header-bg-end);
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.45);
  border-right-color: rgba(57, 255, 20, 0.25);
}

.site-header[data-open="true"] {
  background: var(--color-panel);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.header-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: rgba(57, 255, 20, 0.08);
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.header-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--color-accent), var(--color-gold));
  transform-origin: 0 0;
  transform: scaleY(0);
  transition: transform 0.2s ease-out;
}

.header-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px 20px 24px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
}

/* ---------- 5. Brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-weight: 900;
  font-size: 18px;
  text-decoration: none;
  line-height: 1;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-head);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.brand-cn {
  color: var(--color-gold);
  font-size: 0.78em;
  font-weight: 800;
}

/* ---------- 6. Mobile Nav Toggle ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(57, 255, 20, 0.25);
  background: rgba(28, 37, 65, 0.8);
  transition: border-color 0.3s ease;
}

.nav-toggle:hover {
  border-color: var(--color-accent);
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.site-header[data-open="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header[data-open="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header[data-open="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 7. Navigation ---------- */
.site-nav {
  flex: 1;
  min-height: 0;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--color-text-dim);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-link:hover {
  background: rgba(57, 255, 20, 0.07);
  color: var(--color-accent);
}

.nav-link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(57, 255, 20, 0.12), transparent);
  color: var(--color-text);
}

.nav-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--color-accent);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.5);
}

.nav-link[aria-current="page"] .nav-label {
  color: var(--color-accent);
}

.nav-index {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  min-width: 20px;
  color: var(--color-text-dim);
  font-family: "SF Mono", Consolas, monospace;
}

.nav-link:hover .nav-index,
.nav-link[aria-current="page"] .nav-index {
  color: var(--color-accent);
}

.nav-empty {
  display: none;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--color-text-dim);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  margin-top: 12px;
}

.nav-empty.is-visible {
  display: block;
}

/* ---------- 8. Header Tools ---------- */
.header-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.search-wrap {
  position: relative;
}

.search-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--color-text-dim);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.search-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.search-toggle[aria-expanded="true"] {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.search-toggle-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.search-toggle-text {
  font-size: 14px;
  font-weight: 500;
}

.search-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--color-panel-light);
  border: 1px solid rgba(57, 255, 20, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px;
  box-shadow: var(--shadow);
  z-index: 20;
}

.search-panel[hidden] {
  display: none;
}

.search-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(11, 16, 38, 0.7);
  color: var(--color-text);
  font-size: 14px;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.search-hint {
  display: block;
  font-size: 11px;
  color: var(--color-text-dim);
  margin-top: 6px;
  padding: 0 4px;
}

/* ---------- 9. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

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

.btn-gold {
  background: var(--color-gold);
  color: var(--color-bg);
}

.btn-gold:hover {
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
  color: var(--color-bg);
}

.btn-compare {
  width: 100%;
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---------- 10. Main Content ---------- */
.main-content {
  margin-left: var(--header-width);
  min-height: 80vh;
}

.main-content:focus {
  outline: none;
}

.main-content:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 64px 0;
}

/* ---------- 11. Grids ---------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------- 12. Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text-dim);
  padding: 16px 0;
}

.breadcrumb a {
  color: var(--color-text-dim);
  text-decoration: none;
  transition: color 0.25s ease;
}

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

.breadcrumb-sep {
  opacity: 0.5;
}

.breadcrumb-current {
  color: var(--color-text);
  font-weight: 600;
}

/* ---------- 13. Cards ---------- */
.card {
  background: var(--color-panel);
  border: 1px solid rgba(57, 255, 20, 0.08);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(57, 255, 20, 0.25);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

/* ---------- 14. Image Frames ---------- */
.img-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-panel);
}

.img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.img-frame:hover img {
  transform: scale(1.03);
}

.img-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(57, 255, 20, 0.12);
  border-radius: inherit;
  pointer-events: none;
}

.img-frame-4-3 {
  aspect-ratio: 4 / 3;
}

.img-frame-16-9 {
  aspect-ratio: 16 / 9;
}

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

/* ---------- 15. Page Hero ---------- */
.page-hero {
  padding: 56px 0 72px;
  position: relative;
}

.page-hero-title {
  font-family: var(--font-head);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.02em;
  transform: skewX(-3deg);
  display: inline-block;
  position: relative;
}

.page-hero-desc {
  max-width: 640px;
  margin-top: 16px;
  color: var(--color-text-dim);
  font-size: 16px;
  line-height: 1.7;
}

/* ---------- 16. Footer ---------- */
.site-footer {
  position: relative;
  margin-left: var(--header-width);
  background: var(--color-panel);
  border-top: 1px solid rgba(57, 255, 20, 0.1);
  padding-top: 48px;
}

.site-footer::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-gold), transparent);
  pointer-events: none;
}

.site-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 600px 300px at 80% 100%, rgba(57, 255, 20, 0.04), transparent);
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.4fr;
  gap: 48px;
}

.footer-brand-col .brand {
  font-size: 20px;
  margin-bottom: 18px;
}

.footer-brand .brand-mark {
  width: 42px;
  height: 42px;
}

.footer-trust {
  color: var(--color-text-dim);
  font-size: 14px;
  line-height: 1.7;
  max-width: 380px;
}

.footer-service {
  color: var(--color-text-dim);
  font-size: 13px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: inline-block;
}

.footer-heading {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 8px;
}

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

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--color-text-dim);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.3s ease, padding-left 0.3s ease;
}

.footer-links a:hover {
  color: var(--color-accent);
  padding-left: 6px;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-dim);
}

.footer-contact p {
  word-break: break-all;
}

.footer-bottom {
  margin-top: 48px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--color-text-dim);
}

/* ---------- 17. Responsive ---------- */
@media (max-width: 1100px) {
  .site-header {
    height: auto;
    width: 100%;
    max-height: 100vh;
    border-right: none;
    border-bottom: 1px solid rgba(57, 255, 20, 0.12);
    overflow: hidden;
  }

  .site-header:not([data-open="true"]) {
    height: var(--header-height);
  }

  .site-header[data-open="true"] {
    background: var(--color-panel);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
  }

  .header-progress {
    display: none;
  }

  .header-shell {
    padding: 0;
  }

  .header-top {
    width: 100%;
    height: var(--header-height);
    margin-bottom: 0;
    padding: 0 20px;
  }

  .nav-toggle {
    display: flex;
    flex-shrink: 0;
  }

  .site-nav,
  .header-tools {
    display: none;
  }

  .site-header[data-open="true"] .site-nav {
    display: block;
    padding: 8px 20px;
  }

  .site-header[data-open="true"] .header-tools {
    display: flex;
    padding: 16px 20px 24px;
    margin-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
  }

  .main-content {
    margin-left: 0;
    padding-top: var(--header-height);
  }

  .site-footer {
    margin-left: 0;
  }

  .footer-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

@media (max-width: 768px) {
  .container,
  .footer-inner {
    padding: 0 20px;
  }

  .section {
    padding: 40px 0;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .footer-heading {
    margin-top: 8px;
  }
}

@media (max-width: 480px) {
  .container,
  .footer-inner {
    padding: 0 16px;
  }

  .header-top {
    padding: 0 16px;
  }

  .site-header[data-open="true"] .site-nav {
    padding: 8px 16px;
  }

  .site-header[data-open="true"] .header-tools {
    padding: 16px 16px 20px;
  }
}

/* ---------- 18. 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;
  }
}
