/* ========== CSS Variables ========== */
:root {
  --color-primary: #0A1F44;
  --color-primary-light: #1E3A5F;
  --color-accent: #FF6B35;
  --color-accent-dark: #E85A28;
  --color-accent-soft: rgba(255, 107, 53, 0.12);
  --color-bg: #F5F7FA;
  --color-surface: #FFFFFF;
  --color-text: #1F2937;
  --color-text-secondary: #6B7280;
  --color-border: #E5E7EB;
  --color-data: #3B82F6;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --font-display: 'Roboto Condensed', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Source Serif', 'Noto Serif SC', Georgia, 'Songti SC', 'SimSun', serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Courier New', monospace;
  --header-height: 72px;
  --container-max: 1240px;
  --container-pad: 24px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(10, 31, 68, 0.08);
  --shadow-md: 0 6px 20px rgba(10, 31, 68, 0.10);
  --transition: 0.25s ease;
}

/* ========== Reset & Base ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

body > main {
  flex: 1 0 auto;
}

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

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--color-primary);
}

p {
  margin: 0;
}

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

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

/* ========== Utilities ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ya-main {
  width: 100%;
}

.ya-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-primary);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.header-inner {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  background: var(--color-accent);
  z-index: 2;
  transition: width 0.1s linear;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 2000;
  background: var(--color-accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 6px 6px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  transition: top 0.2s ease;
}

.skip-link:focus-visible {
  top: 0;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.brand-icon::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 5px;
  height: 5px;
  background: var(--color-primary);
  border-radius: 50%;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1.2;
}

.brand-meta {
  margin-left: 2px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.4;
}

/* Navigation */
.site-nav {
  flex-shrink: 0;
}

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

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-link[aria-current="page"] {
  color: #fff;
  background: rgba(255, 107, 53, 0.14);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-accent);
  letter-spacing: 0.5px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nav-toggle:hover {
  border-color: var(--color-accent);
  background: rgba(255, 255, 255, 0.04);
}

.toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.2s ease, background-color 0.2s ease;
}

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

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

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

/* ========== Footer ========== */
.site-footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.75);
}

.footer-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 64px 24px 48px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.62);
  max-width: 320px;
  margin-top: 12px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1.3;
}

.footer-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--color-accent);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 16px;
  padding-bottom: 8px;
  position: relative;
}

.footer-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 24px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px;
}

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

.footer-links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

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

.footer-contact .contact-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.7;
  margin-bottom: 8px;
  overflow-wrap: break-word;
}

.footer-bottom {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* ========== Buttons ========== */
.ya-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ya-btn:focus-visible,
.ya-btn-primary:focus-visible,
.ya-btn-outline:focus-visible,
.ya-btn-light:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.ya-btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.ya-btn-primary:hover {
  background: var(--color-accent-dark);
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.3);
}

.ya-btn-outline {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}

.ya-btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.ya-btn-light {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.ya-btn-light:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ========== Breadcrumb ========== */
.ya-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
}

.ya-breadcrumb a {
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

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

.ya-breadcrumb .sep {
  color: rgba(0, 0, 0, 0.3);
  user-select: none;
}

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

/* ========== Section ========== */
.ya-section {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}

.ya-section + .ya-section {
  margin-top: 24px;
}

.ya-section-tight {
  padding: 20px;
}

/* ========== Card ========== */
.ya-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.ya-card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

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

.ya-col-3 {
  grid-column: span 3;
}

.ya-col-4 {
  grid-column: span 4;
}

.ya-col-6 {
  grid-column: span 6;
}

.ya-col-8 {
  grid-column: span 8;
}

/* ========== Tag ========== */
.ya-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 4px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.ya-tag-green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.ya-tag-blue {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-data);
}

/* ========== Image ========== */
.ya-image {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #EDF0F4, #E2E8F0);
  min-height: 160px;
  border: 1px solid var(--color-border);
}

.ya-image > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ========== Note ========== */
.ya-note {
  background: var(--color-bg);
  border-left: 3px solid var(--color-accent);
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.7;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ========== Content ========== */
.ya-content {
  max-width: 720px;
  font-size: 16px;
  line-height: 1.8;
}

.ya-content h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 32px 0 16px;
}

.ya-content h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
}

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

.ya-content ul,
.ya-content ol {
  margin: 0 0 16px 24px;
  list-style: disc;
}

.ya-content ol {
  list-style: decimal;
}

.ya-content li {
  margin-bottom: 6px;
}

/* ========== Data Label ========== */
.ya-data-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.ya-data-label::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 2px;
}

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

@media (max-width: 960px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, visibility 0.35s;
  }

  .site-nav[data-open] {
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 8px 24px 16px;
  }

  .nav-item + .nav-item,
  .nav-list li + li {
    margin-top: 0;
  }

  .nav-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .nav-list li:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 14px 8px;
    font-size: 16px;
    border-radius: 0;
  }

  .nav-link::after {
    left: 8px;
    right: auto;
    bottom: 0;
    width: 0;
    transform: none;
    transition: width 0.2s ease;
  }

  .nav-link:hover::after,
  .nav-link[aria-current="page"]::after {
    width: 32px;
    transform: none;
  }

  .nav-index {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .brand-meta {
    display: none;
  }

  .ya-col-3,
  .ya-col-4 {
    grid-column: span 6;
  }

  .ya-col-6,
  .ya-col-8 {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0 16px;
    height: 64px;
  }

  .site-header {
    --header-height: 64px;
  }

  .ya-container {
    --container-pad: 16px;
  }

  .brand-name {
    font-size: 19px;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
    border-radius: 6px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    padding: 48px 16px 32px;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .ya-col-3,
  .ya-col-4,
  .ya-col-6,
  .ya-col-8 {
    grid-column: span 12;
  }

  .ya-section {
    padding: 24px;
  }
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .skip-link {
    transition: none;
  }

  .header-progress {
    transition: none !important;
  }

  .site-nav {
    transition: none !important;
  }
}
