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

:root {
  --green: #2E8B57;
  --green-deep: #1E6B3F;
  --red: #E63946;
  --red-deep: #C02633;
  --gray-dark: #333333;
  --gray-mid: #666666;
  --gray-light: #F5F5F5;
  --white: #FFFFFF;
  --green-light: #C8E6C9;
  --red-orange: #FF8A80;
  --border-w: 3px;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  --shadow-solid: 4px 4px 0 var(--gray-dark);
  --font-head: "Alibaba PuHuiTi", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-body: "Alibaba PuHuiTi", "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "Roboto Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --content-max: 1200px;
  --gap: 24px;
  --radius: 0px;
}

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray-dark);
  background: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--green);
  color: var(--white);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--gray-dark);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin-block: 0.5em 0; }

a {
  color: var(--green);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--green-deep); }

ul, ol { list-style-position: inside; }

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

/* ===== Container & Layout ===== */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: 20px;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}

.column-pair {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 40px;
  align-items: start;
}

.field-strip {
  position: relative;
  padding: 48px 0;
  background: linear-gradient(
    100deg,
    var(--green) 0%,
    var(--green) 38%,
    var(--gray-light) 38%,
    var(--gray-light) 62%,
    var(--green) 62%,
    var(--green) 100%
  );
  border-top: var(--border-w) solid var(--gray-dark);
  border-bottom: var(--border-w) solid var(--gray-dark);
}

/* ===== Accessibility & Focus ===== */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 999;
  background: var(--gray-dark);
  color: var(--white);
  padding: 12px 24px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
  outline: 3px solid var(--red);
  outline-offset: -3px;
}

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  border: var(--border-w) solid var(--gray-dark);
  box-shadow: var(--shadow-solid);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--gray-dark); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--gray-dark); }

.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-deep); color: var(--white); }

.btn-outline { background: var(--white); color: var(--green); border-color: var(--green); box-shadow: 4px 4px 0 var(--green); }
.btn-outline:hover { background: var(--green); color: var(--white); box-shadow: 2px 2px 0 var(--green); }

/* ===== Header ===== */
.site-header {
  position: relative;
  width: 100%;
  z-index: 100;
  background: var(--white);
  border-bottom: 4px solid var(--gray-dark);
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green) 70%, var(--red) 70%, var(--red) 100%);
  z-index: 1;
}

.header-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  width: 100%;
  height: 4px;
  pointer-events: none;
}

.header-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0%, var(--green) 70%, var(--red) 100%);
  transition: width 0.08s linear;
}

.header-command {
  background: var(--white);
  border-bottom: 2px solid var(--gray-light);
}

.header-command-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-block: 8px;
}

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

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gray-dark);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 20px;
  border: 3px solid var(--gray-dark);
  box-shadow: 2px 2px 0 var(--gray-dark);
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-note {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-mid);
  border-left: 2px solid var(--green);
  padding-left: 6px;
  letter-spacing: 0.12em;
  max-height: 50px;
  overflow: hidden;
  user-select: none;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--gray-dark);
  background: var(--white);
  padding: 6px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.2);
}

.search-icon {
  position: relative;
  width: 12px;
  height: 12px;
  border: 2px solid var(--gray-mid);
  border-radius: 50%;
  flex-shrink: 0;
}

.search-icon::after {
  content: '';
  position: absolute;
  width: 7px;
  height: 2px;
  background: var(--gray-mid);
  border-radius: 1px;
  bottom: -4px;
  right: -5px;
  transform: rotate(45deg);
}

.search-input {
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--gray-dark);
  background: transparent;
  width: 130px;
}

.search-input::placeholder {
  color: var(--gray-mid);
  font-size: 12px;
}

.score-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: var(--border-w) solid var(--gray-dark);
  background: var(--red);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--gray-dark);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  white-space: nowrap;
}

.score-toggle:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--gray-dark);
  background: var(--red-deep);
}

.score-toggle[data-active] {
  background: var(--gray-dark);
  color: var(--white);
}

.score-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--white);
  animation: dot-pulse 1.6s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

/* Nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  border: var(--border-w) solid var(--gray-dark);
  background: var(--white);
  padding: 7px 12px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--gray-dark);
}

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

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--gray-dark);
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.25s ease;
}

.nav-toggle-label {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 800;
  color: var(--gray-dark);
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

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

.nav-toggle[aria-expanded="true"] .nav-toggle-bar {
  background: var(--red);
}

/* ===== Navigation ===== */
.site-nav {
  background: var(--white);
  display: block;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-item {
  flex: 0 0 auto;
  border-right: 2px solid var(--gray-light);
}

.nav-item:first-child {
  border-left: 2px solid var(--gray-light);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 14px;
  color: var(--gray-dark);
  text-decoration: none;
  background: var(--white);
  border-block: 2px solid transparent;
  position: relative;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--red));
  transition: width 0.25s ease;
}

.nav-link:hover {
  background: var(--green);
  color: var(--white);
}

.nav-link:hover .nav-index {
  color: var(--green-light);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link[aria-current="page"] {
  background: var(--gray-dark);
  color: var(--white);
}

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

.nav-link[aria-current="page"]::after {
  width: 100%;
  background: var(--red);
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--gray-mid);
  transition: color 0.2s ease;
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  background: var(--gray-dark);
  color: rgba(255, 255, 255, 0.85);
  border-top: 6px solid var(--green);
  margin-top: auto;
  overflow: hidden;
}

.site-footer::before {
  content: '趣';
  position: absolute;
  right: 24px;
  bottom: -30px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 180px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.04);
  pointer-events: none;
  z-index: 0;
}

.site-footer .container {
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 40px;
  padding: 52px 0 36px;
}

.footer-brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer-brand-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 22px;
  color: var(--white);
  letter-spacing: 0.03em;
}

.footer-desc {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
  max-width: 360px;
}

.footer-trust {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.5);
  border-left: 3px solid var(--green);
  padding-left: 12px;
  max-width: 360px;
}

.footer-heading {
  font-size: 14px;
  font-weight: 800;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--red);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: var(--green-light);
  padding-left: 4px;
}

.footer-contact-col .footer-contact-line {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 8px;
  line-height: 1.6;
}

.footer-contact-col .footer-contact-line:last-of-type {
  margin-bottom: 0;
}

.footer-bottom {
  border-top: 2px solid rgba(255, 255, 255, 0.15);
  padding-block: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.footer-icp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 16px 0;
  border-bottom: 2px solid var(--gray-light);
  margin-bottom: 32px;
  font-size: 14px;
}

.breadcrumb-item {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.breadcrumb-item:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  display: inline-block;
  margin-inline: 8px;
  color: var(--gray-mid);
  font-weight: 400;
  user-select: none;
}

.breadcrumb-current {
  color: var(--gray-dark);
  font-weight: 800;
}

/* ===== Cards & Panels ===== */
.panel-card {
  border: var(--border-w) solid var(--gray-dark);
  box-shadow: var(--shadow);
  background: var(--white);
  padding: 28px;
  position: relative;
}

.panel-card::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 24px;
  height: 24px;
  border-top: 4px solid var(--red);
  border-left: 4px solid var(--red);
  pointer-events: none;
}

.data-card {
  border: var(--border-w) solid var(--gray-dark);
  background: var(--white);
  box-shadow: var(--shadow-solid);
  padding: 20px;
  position: relative;
}

.data-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-mid);
  margin-bottom: 6px;
}

.data-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-dark);
  line-height: 1.2;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--green);
}

/* ===== Section Title ===== */
.section-title {
  position: relative;
  display: inline-block;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 24px;
  padding-bottom: 10px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green) 70%, var(--red) 100%);
  transform: skewX(-20deg);
  transform-origin: left bottom;
}

/* ===== Image Frame ===== */
.image-frame {
  position: relative;
  border: var(--border-w) solid var(--gray-dark);
  background: var(--gray-light);
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.image-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 44%,
    var(--green-light) 44%,
    var(--green-light) 49%,
    transparent 49%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 1;
}

.image-frame::after {
  content: attr(data-ratio);
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-mid);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border: 1px solid var(--gray-light);
  z-index: 2;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Decorative ===== */
.diag-line {
  position: relative;
  display: block;
}

.diag-line::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 49.8%,
    var(--red) 49.8%,
    var(--red) 50.2%,
    transparent 50.2%
  );
  pointer-events: none;
}

/* ===== Skill Tree ===== */
.skill-tree {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.skill-tree-step {
  border: var(--border-w) solid var(--gray-dark);
  background: var(--white);
  box-shadow: var(--shadow-solid);
  padding: 24px 20px;
  position: relative;
  transition: transform 0.2s ease;
}

.skill-tree-step:hover {
  transform: translate(-2px, -2px);
}

.skill-tree-step::before {
  content: attr(data-step);
  display: block;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 8px;
}

.skill-tree-step h3 {
  margin-bottom: 8px;
}

.skill-tree-step p {
  font-size: 14px;
  color: var(--gray-mid);
}

/* ===== Responsive ===== */
@media (max-width: 1023px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    border-top: 3px solid var(--green);
  }

  .site-nav[data-open] {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    padding-block: 8px;
  }

  .nav-item {
    border-right: none;
    border-bottom: 1px solid var(--gray-light);
  }

  .nav-item:first-child {
    border-left: none;
  }

  .nav-link {
    width: 100%;
    padding: 14px 20px;
    justify-content: flex-start;
    border-block: none;
  }

  .nav-link:hover {
    background: var(--green-light);
    color: var(--gray-dark);
  }

  .nav-link:hover .nav-index {
    color: var(--green);
  }

  .nav-link[aria-current="page"] {
    background: var(--green);
    color: var(--white);
  }

  .nav-link::after {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 40px 0 28px;
  }
}

@media (max-width: 767px) {
  .container {
    padding-inline: 16px;
  }

  .header-command-row {
    flex-wrap: wrap;
    gap: 10px;
    padding-block: 10px;
  }

  .brand-lockup {
    flex: 1;
  }

  .brand-text {
    font-size: 17px;
  }

  .brand-note {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .header-tools {
    gap: 8px;
  }

  .search-box {
    order: 3;
    width: 100%;
    flex-basis: 100%;
  }

  .search-input {
    flex: 1;
    width: auto;
  }

  .score-toggle {
    padding: 8px 12px;
    font-size: 12px;
  }

  .score-toggle span:last-child {
    font-size: 12px;
  }

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

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

  .footer-icp {
    font-size: 11px;
  }

  .column-pair {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  .skill-tree {
    grid-template-columns: 1fr;
  }

  .image-frame {
    aspect-ratio: 3/2;
  }
}

@media (min-width: 1024px) {
  .site-nav {
    display: block !important;
  }
}

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

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

  .header-progress-bar {
    transition: none;
  }

  .nav-toggle-bar {
    transition: none;
  }

  .btn {
    transition: none;
  }
}
