/* 全站 V3 统一视觉层：覆盖旧页面，不改变原有业务脚本结构 */
:root {
  --v3-ink: #10131a;
  --v3-muted: #64748b;
  --v3-line: #e5e7eb;
  --v3-soft: #f5f7fb;
  --v3-violet: #4f46e5;
  --v3-cyan: #22d3ee;
  --v3-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--v3-ink);
  background: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

a {
  color: inherit;
}

.navbar,
.navbar.scrolled {
  height: 100px;
  min-height: 100px;
  padding: 0 !important;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.navbar .container,
.navbar-container,
.nav-container {
  width: min(1200px, calc(100% - 48px));
  min-height: 100px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
}

.navbar-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #8b5cf6 !important;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.navbar-brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: block;
}

.navbar-brand-name {
  color: #7c3aed;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0;
}

.navbar-brand:hover {
  transform: none;
}

.navbar-menu {
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 24px;
}

.navbar-menu > li {
  margin: 0;
}

.navbar-menu a {
  font-weight: 800;
}

.navbar-menu > li > a {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  padding: 14px 0;
  color: #0f172a;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.navbar .navbar-menu > li > a::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 5px -12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.navbar .navbar-menu > li > a:hover,
.navbar .navbar-menu > li > a.active,
.navbar .navbar-menu > li.dropdown.current > a {
  color: #6d28d9 !important;
  background: transparent !important;
}

.navbar .navbar-menu > li > a:hover::before {
  border-color: rgba(139, 92, 246, 0.12);
  background: rgba(139, 92, 246, 0.05);
}

.navbar .navbar-menu > li > a.active::before,
.navbar .navbar-menu > li.dropdown.current > a::before {
  border-color: rgba(139, 92, 246, 0.16);
  background:
    linear-gradient(90deg, #8b5cf6, #22d3ee) center calc(100% - 4px) / 20px 3px no-repeat,
    linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(34, 211, 238, 0.06));
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.08);
}

.dropdown-toggle::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  font-family: inherit;
  vertical-align: middle;
}

.dropdown:hover .dropdown-toggle::after {
  transform: rotate(225deg) translateY(-2px);
}

.dropdown-menu.active {
  max-height: 500px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-toggle {
  flex: 0 0 auto;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: #0f172a;
}

.hero,
.subject-hero,
.competition-hero,
.aurora-bg {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(5, 8, 16, 0.9), rgba(5, 8, 16, 0.64)),
    url("https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?auto=format&fit=crop&w=1800&q=80") center / cover !important;
  border-radius: 0;
}

.hero .container,
.subject-hero .container,
.hero-content {
  max-width: 1200px;
}

.hero h1,
.subject-title,
.hero-title {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  color: #ffffff;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: 0;
}

.hero p,
.subject-subtitle,
.subject-description,
.hero-subtitle {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 650;
  line-height: 1.8;
}

.hero-stats,
.stats-grid {
  gap: 16px;
}

.stat-item,
.stat-card {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.14) !important;
  box-shadow: none !important;
  backdrop-filter: blur(14px);
}

.section,
.content-wrapper,
.main-content .container {
  max-width: 1200px;
}

.section-title,
.section h2,
.content-wrapper h2,
.competition-detail-section h2 {
  color: var(--v3-ink);
  font-weight: 900;
  letter-spacing: 0;
}

.subject-intro,
.competition-card,
.competition-item,
.competition-card-modern,
.guide-card,
.info-card,
.feature-card,
.timeline-card,
.comparison-card,
.contest-filter,
.filters,
.modal-content,
.card {
  border: 1px solid var(--v3-line) !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: var(--v3-shadow) !important;
}

.competition-card:hover,
.competition-item:hover,
.guide-card:hover,
.info-card:hover,
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12) !important;
}

.filter-btn,
.filter-tag,
.sort-option,
.btn,
.btn-primary,
.btn-secondary,
button {
  border-radius: 999px;
  letter-spacing: 0;
}

.btn-primary,
.filter-tag.active,
.sort-option.active,
.filter-btn.active {
  background: var(--v3-ink) !important;
  border-color: var(--v3-ink) !important;
  color: #ffffff !important;
}

.status-label,
.card-status,
.competition-status,
.status-badge,
.tag {
  border-radius: 999px !important;
  font-weight: 800 !important;
}

.competition-detail-section .container,
.detail-container,
.article-container {
  max-width: 980px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--v3-line);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--v3-shadow);
}

.competition-detail-section p,
.competition-detail-section li,
.content-wrapper p,
.content-wrapper li {
  color: #475569;
  line-height: 1.85;
}

.footer {
  background: #10131a !important;
}

.site-breadcrumbs {
  width: min(1120px, calc(100% - 48px));
  margin: 20px auto 0;
  padding-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.site-breadcrumbs a {
  color: #334155;
  text-decoration: none;
}

.site-breadcrumbs a:hover {
  color: var(--v3-violet);
}

.site-breadcrumbs-separator {
  color: #cbd5e1;
}

.detail-source-panel {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fbff;
  color: #334155;
}

.detail-current-summary {
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.detail-current-summary h2 {
  margin-top: 0;
}

.detail-current-summary .info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.detail-current-summary .info-card {
  padding: 16px;
  border-radius: 12px !important;
  box-shadow: none !important;
}

.detail-current-summary .info-card h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 15px;
}

.detail-current-source a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.detail-source-panel > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 8px;
}

.detail-source-panel strong {
  color: #0f172a;
}

.detail-source-panel span,
.detail-source-panel p {
  color: #64748b;
  line-height: 1.7;
}

.detail-source-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.site-search-trigger {
  flex: 0 0 auto;
  min-width: 83px;
  min-height: 38px;
  margin-left: 0;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
}

.site-search-trigger:hover {
  border-color: #c4b5fd;
  color: var(--v3-violet);
}

.site-search-trigger .fa-search::before,
.site-search-box .fa-search::before {
  content: "\f002";
}

.site-search-box .fa-times::before {
  content: "\f00d";
}

.site-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  padding: 88px 16px 24px;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(8px);
}

.site-search-overlay.active {
  display: block;
}

.site-search-open {
  overflow: hidden;
}

.site-search-panel {
  width: min(680px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.24);
}

.site-search-box {
  display: grid;
  grid-template-columns: 24px 1fr 36px;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.site-search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 750;
}

.site-search-box button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  background: #f1f5f9;
  color: #475569;
  cursor: pointer;
}

.site-search-results {
  max-height: min(56vh, 460px);
  overflow: auto;
  padding: 8px;
}

.site-search-result {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #0f172a;
  text-decoration: none;
}

.site-search-result:hover {
  background: #f8fafc;
}

.site-search-result span {
  font-weight: 850;
}

.site-search-result small,
.site-search-empty {
  color: #64748b;
  font-weight: 650;
}

.site-search-empty {
  padding: 26px 16px;
  text-align: center;
}

.site-toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.site-toast {
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 16px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.18);
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.site-toast.active {
  opacity: 1;
  transform: translateY(0);
}

.site-toast-error {
  border-color: #fecaca;
  color: #991b1b;
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  .navbar,
  .navbar.scrolled {
    height: 72px;
    min-height: 72px;
  }

  .navbar .container,
  .navbar-container,
  .nav-container {
    width: min(100% - 24px, 1200px);
    min-height: 72px;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
  }

  .menu-toggle {
    display: flex;
  }

  .navbar-brand-mark {
    width: 34px;
    height: 34px;
  }

  .navbar-brand-name {
    font-size: 22px;
  }

  .navbar-menu:not(.active),
  .nav-menu:not(.active) {
    display: none !important;
  }

  .navbar-menu.active,
  .nav-menu.active {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .navbar-menu.active > li,
  .nav-menu.active > li,
  .navbar-menu.active a,
  .nav-menu.active a {
    width: 100%;
    max-width: 100%;
  }

  .hero,
  .subject-hero,
  .competition-hero,
  .aurora-bg {
    padding: 52px 16px !important;
  }

  .hero-stats,
  .stats-grid,
  .intro-grid,
  .contest-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .contest-filter {
    position: static !important;
    width: 100% !important;
  }

  .site-search-trigger {
    min-width: 42px;
    min-height: 38px;
    margin: 0 0 0 auto;
    padding: 0 12px;
    justify-content: center;
  }

  .site-search-trigger span {
    display: none;
  }

  .site-search-overlay {
    padding-top: 74px;
  }

  .competition-card,
  .competition-item,
  .subject-intro {
    width: 100% !important;
    min-width: 0 !important;
  }

  .detail-current-summary .info-grid {
    grid-template-columns: 1fr;
  }
}
