:root {
  --ink: #122018;
  --ink-soft: #2a3b31;
  --accent: #c8f135;
  --accent-2: #1f8a70;
  --warn: #e07a3a;
  --line: rgba(18, 32, 24, 0.12);
  --font-display: "Syne", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --track-学习工作: #1f8a70;
  --track-生活娱乐: #d97706;
  --track-社会服务: #2563eb;
  --track-硬件交互: #7c3aed;
  --track-未标注: #64748b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1000px 520px at 8% -8%, #d9f5c8 0%, transparent 55%),
    radial-gradient(800px 420px at 92% 0%, #ffe3b8 0%, transparent 50%),
    linear-gradient(180deg, #f7f4ec 0%, #eef5ef 50%, #f3f0e7 100%);
  min-height: 100vh;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.hero,
main,
.footer {
  position: relative;
  z-index: 1;
}

.hero {
  padding: 24px clamp(18px, 4vw, 64px) 36px;
  overflow: hidden;
}

.hero-compact .hero-copy {
  padding-top: 36px;
  max-width: 820px;
  animation: rise 0.7s ease both;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(31, 138, 112, 0.16), transparent 42%),
    radial-gradient(circle at 72% 36%, rgba(200, 241, 53, 0.3), transparent 42%);
  animation: drift 14s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes drift {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.04) translate3d(-1%, 1%, 0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.88rem;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.lede {
  margin: 14px 0 22px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 48ch;
}

.view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.view-tab {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--ink-soft);
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.view-tab.active {
  color: var(--accent);
  background: var(--ink);
  box-shadow: 0 4px 14px rgba(18, 32, 24, 0.16);
}

.search-bar {
  display: flex;
  gap: 10px;
  max-width: 640px;
}

.search-bar input {
  flex: 1;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  outline: none;
}

.search-bar input:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.14);
}

.search-bar button,
.more-btn {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  padding: 13px 20px;
  cursor: pointer;
}

.meta-line {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.stats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  text-decoration: none;
}

.stat .num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat .label {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
}

.stat.total {
  background: var(--ink);
  color: var(--accent);
  border-color: var(--ink);
}

.stat.total .label {
  color: rgba(200, 241, 53, 0.75);
}

.commercial-num {
  color: #a55716;
}

.track-section {
  padding: 42px clamp(18px, 4vw, 64px);
  border-top: 1px solid var(--line);
}

.track-section:nth-child(even) {
  background: rgba(255, 255, 255, 0.28);
}

.total-rank {
  background: linear-gradient(180deg, rgba(200, 241, 53, 0.12), rgba(255, 255, 255, 0.2));
}

.track-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  background: color-mix(in srgb, var(--pill) 18%, white);
  border: 1px solid color-mix(in srgb, var(--pill) 35%, transparent);
}

.track-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.track-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
}

.track-head h2 .dot {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  margin-right: 0.35em;
  vertical-align: 0.05em;
}

.track-count {
  color: var(--ink-soft);
  font-weight: 600;
}

.rank-table {
  width: 100%;
  border-collapse: collapse;
}

.rank-table th,
.rank-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.rank-table th {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}

.rank {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--ink-soft);
  width: 52px;
}

.rank.top3 {
  color: var(--warn);
}

.title-cell a {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.35;
}

.title-cell a:hover {
  color: var(--accent-2);
}

.votes {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--accent-2);
  white-space: nowrap;
}

.commercial-score {
  color: #a55716;
  white-space: nowrap;
  font-family: var(--font-display);
}

.commercial-score strong {
  font-size: 1.05rem;
}

.meta-cell {
  color: var(--ink-soft);
  font-size: 0.88rem;
  white-space: nowrap;
}

.section-foot {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.footer {
  padding: 24px clamp(18px, 4vw, 64px) 48px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

.footer a {
  color: var(--accent-2);
}

.empty {
  padding: 18px 0;
  color: var(--ink-soft);
}

.commercial-rank {
  background: linear-gradient(180deg, rgba(255, 221, 153, 0.22), rgba(255, 255, 255, 0.22));
}

.commercial-dot {
  background: #d97706;
}

.section-kicker {
  margin: 0 0 6px;
  color: #a55716;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.method-section {
  background: rgba(18, 32, 24, 0.94);
  color: #f7f4ec;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.method-grid article {
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.method-grid strong,
.method-grid span {
  display: block;
}

.method-grid strong {
  margin-bottom: 18px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.7rem;
}

.method-grid span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.88rem;
  line-height: 1.4;
}

.method-note {
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.55;
}

@media (max-width: 720px) {
  .hero {
    padding: 16px 14px 24px;
  }

  .hero-compact .hero-copy {
    padding-top: 24px;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 10vw, 2.5rem);
  }

  .topnav {
    align-items: flex-start;
  }

  .nav-links {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 0 6px;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a {
    flex: 0 0 auto;
  }

  .view-switch {
    display: flex;
    width: 100%;
  }

  .view-tab {
    flex: 1;
    padding-inline: 10px;
  }

  .search-bar {
    gap: 8px;
  }

  .search-bar input {
    min-width: 0;
    padding: 12px 14px;
  }

  .search-bar button {
    flex: 0 0 auto;
    padding: 12px 16px;
  }

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

  .stat {
    min-width: 0;
    padding: 12px;
  }

  .stat .num {
    font-size: 1.45rem;
  }

  .track-section {
    padding: 28px 14px;
  }

  .track-head {
    align-items: flex-start;
  }

  .track-count {
    font-size: 0.84rem;
  }

  .rank-table,
  .rank-table tbody {
    display: block;
    width: 100%;
  }

  .rank-table thead {
    display: none;
  }

  .rank-table tbody {
    display: grid;
    gap: 10px;
  }

  .rank-table tr {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 7px;
    padding: 13px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 7px 22px rgba(18, 32, 24, 0.045);
  }

  .rank-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .rank-table .rank {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: auto;
  }

  .rank-table .title-cell {
    grid-column: 2;
    grid-row: 1;
    overflow-wrap: anywhere;
  }

  .rank-table .title-cell a {
    display: block;
    font-size: 0.94rem;
    line-height: 1.42;
  }

  .rank-table .track-cell {
    grid-column: 2;
    grid-row: 2;
  }

  .rank-table .votes,
  .rank-table .commercial-score {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }

  .commercial-table .votes {
    grid-row: 2;
    color: var(--ink-soft);
    font-family: var(--font-body);
    font-size: 0.78rem;
  }

  .likes-cell,
  .views-cell {
    display: none !important;
  }

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

  .method-grid article {
    min-height: 98px;
    padding: 14px;
  }

  .method-grid article:last-child {
    grid-column: 1 / -1;
  }

  .footer {
    padding: 22px 14px 36px;
  }
}
