:root {
  --paper: #f6f7f2;
  --surface: #ffffff;
  --surface-alt: #eef1e9;
  --ink: #172b29;
  --muted: #5d6b66;
  --green: #194c40;
  --green-dark: #10362d;
  --lime: #d1f579;
  --line: #dce2d9;
  --warn-bg: #fff7e6;
  --warn-ink: #8a5300;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 10px rgba(23, 43, 41, 0.04);
  --shadow-md: 0 10px 30px rgba(23, 43, 41, 0.07);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #76a931;
  outline-offset: 3px;
}

.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.brand-logo svg {
  width: 36px;
  height: 36px;
}

.brand-logo small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.6px;
  color: var(--muted);
  line-height: 1.2;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 500;
}

.main-nav a {
  position: relative;
  padding: 6px 0;
  color: var(--ink);
  transition: color 0.15s;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--green);
  font-weight: 600;
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.header-cta:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.header-cta .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
}

.mobile-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 600;
}

/* Quick anchor bar (inspired by jcvpn.blog) */
.anchor-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.anchor-bar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 0;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.anchor-bar a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.anchor-bar a:hover {
  background: var(--surface-alt);
  color: var(--green);
}

.anchor-num {
  font-weight: 700;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

/* Hero */
.hero {
  padding: 44px 0 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
  align-items: stretch;
}

.hero-main {
  background: var(--green);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(209, 245, 121, 0.16);
  color: var(--lime);
  border: 1px solid rgba(209, 245, 121, 0.35);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
}

.hero-main h1 {
  margin: 18px 0 12px;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.hero-main p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 15px;
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-lime {
  background: var(--lime);
  color: var(--ink);
}

.btn-lime:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

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

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-dark {
  background: var(--green);
  color: #fff;
}

.btn-dark:hover {
  background: var(--green-dark);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-outline:hover {
  border-color: var(--green);
  color: var(--green);
}

.hero-aside {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.aside-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-aside h2 {
  margin: 8px 0 6px;
  font-size: 22px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.kpi-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.kpi-box strong {
  display: block;
  font-size: 20px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.kpi-box span {
  font-size: 12px;
  color: var(--muted);
}

/* Sections */
.section {
  padding: 36px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.2px;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.section-more {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green);
  border-bottom: 1px solid var(--green);
  padding-bottom: 2px;
}

/* Cards & Grids */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #b7c4ba;
}

.node-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.rank-pill.top1 {
  background: var(--lime);
  color: var(--ink);
}

.score-badge {
  font-size: 22px;
  font-weight: 800;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.score-badge small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.node-title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
}

.node-desc {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
}

.tag.highlight {
  background: rgba(209, 245, 121, 0.35);
  border-color: #b6d962;
  font-weight: 600;
}

.node-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  font-size: 13px;
}

.node-meta span {
  color: var(--muted);
  display: block;
  font-size: 11.5px;
}

.node-card-actions {
  display: flex;
  gap: 10px;
}

.node-card-actions .btn {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

th, td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  background: var(--surface-alt);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  color: var(--green);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(246, 247, 242, 0.7);
}

/* Coupon Card */
.coupon-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--paper);
  border: 1px dashed var(--green);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 12px;
}

.coupon-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 15px;
  color: var(--green);
}

.copy-btn {
  border: none;
  background: var(--green);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.copy-btn.copied {
  background: #2b7a4b;
}

/* Article / Markdown Prose */
.page-banner {
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

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

.page-banner h1 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.3;
}

.page-banner p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  padding: 32px 0 56px;
}

.prose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
}

.prose h2 {
  margin: 28px 0 12px;
  font-size: 22px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin: 22px 0 8px;
  font-size: 18px;
}

.prose p {
  margin: 0 0 14px;
}

.prose ul, .prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

.prose blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--paper);
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
}

.prose blockquote p {
  margin: 0;
}

.prose code {
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.prose pre {
  background: #172b29;
  color: #f6f7f2;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.prose a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 18px;
}

.sidebar-box h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  font-size: 13.5px;
}

.sidebar-list a:hover {
  color: var(--green);
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-q {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 18px 22px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-q::after {
  content: "+";
  font-size: 20px;
  color: var(--green);
  font-weight: 400;
}

.faq-item.open .faq-q::after {
  content: "−";
}

.faq-a {
  display: none;
  padding: 0 22px 18px;
  color: var(--muted);
  font-size: 14.5px;
}

.faq-item.open .faq-a {
  display: block;
}

/* Notice banner */
.notice {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 1px solid #f0d7a8;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  background: var(--ink);
  color: rgba(255, 255, 255, 0.8);
  padding: 44px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-grid h4 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 14px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--lime);
}

.footer-bottom {
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.6);
}

/* Mobile Responsive */
@media (max-width: 960px) {
  .hero-grid,
  .article-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main-nav, .header-cta {
    display: none;
  }
  .mobile-toggle {
    display: inline-flex;
  }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 16px 24px 20px;
    gap: 12px;
    box-shadow: var(--shadow-md);
  }
  .grid-3, .grid-2, .grid-4 {
    grid-template-columns: 1fr;
  }
  .prose {
    padding: 20px;
  }
}
