:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --line: #dbe3ef;
  --text: #1c2431;
  --text-soft: #5d6878;
  --brand: #2f6bff;
  --brand-soft: #e7efff;
  --shadow: 0 12px 38px rgba(29, 49, 84, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  background:
    radial-gradient(1200px 320px at 20% -120px, #e6efff 0%, transparent 60%),
    radial-gradient(1100px 300px at 80% -180px, #edf3ff 0%, transparent 62%),
    var(--bg);
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, #f4f7fb 84%, transparent);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px clamp(16px, 3vw, 28px);
  display: grid;
  grid-template-columns: 250px 1fr auto;
  align-items: center;
  gap: 16px;
}

.brand {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, #fff);
  background: #fff;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-family: "Sora", sans-serif;
  font-size: 15px;
  color: var(--text);
}

.search-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 0 13px;
  height: 50px;
}

.search-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  margin-right: 10px;
  color: var(--text-soft);
}

.search-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-wrap input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  color: var(--text);
  font-size: 14px;
}

.topbar-meta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.meta-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  padding: 7px 11px;
  white-space: nowrap;
}

.github-link {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  transition: 0.2s ease;
}

.github-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.github-link:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  box-shadow: 0 4px 14px rgba(40, 62, 103, 0.12);
}

.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px clamp(16px, 3vw, 28px) 28px;
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 18px;
}

.sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  height: fit-content;
  position: sticky;
  top: 78px;
}

.side-section + .side-section {
  margin-top: 16px;
}

.side-section h2 {
  margin: 0 0 10px;
  font-family: "Sora", sans-serif;
  font-size: 13px;
  color: var(--text-soft);
}

.side-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-btn {
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  padding: 10px 10px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s ease;
}

.side-btn:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.side-btn.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 20%, white);
  font-weight: 600;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
  padding: 8px 2px;
}

.status-row + .status-row {
  border-top: 1px dashed var(--line);
}

.status-row b {
  color: var(--text);
  font-weight: 600;
}

.content {
  min-width: 0;
}

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

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 12px;
  font-family: "Sora", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.content-head h1 {
  margin: 6px 0 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.14;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 12px;
  padding: 8px 12px;
  cursor: pointer;
}

.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

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

.tool-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 42px rgba(36, 58, 96, 0.13);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-cover {
  height: 132px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cover-chem {
  background:
    radial-gradient(220px 120px at 80% 10%, rgba(255, 255, 255, 0.25), transparent),
    linear-gradient(130deg, #1b8f68, #3ab78a);
}

.cover-math {
  background:
    radial-gradient(210px 140px at 90% 5%, rgba(255, 255, 255, 0.3), transparent),
    linear-gradient(135deg, #4254d8, #6f73f5);
}

.cover-badge {
  align-self: flex-start;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.cover-title {
  color: #fff;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
}

.card-body {
  padding: 14px;
}

.card-body h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 18px;
  line-height: 1.2;
}

.card-body p {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.65;
  min-height: 64px;
}

.tag-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row span {
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 11px;
  padding: 5px 9px;
}

.card-foot {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-soft);
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.card-foot b {
  color: var(--brand);
}

.is-hidden {
  display: none;
}

.footer {
  width: 100%;
  text-align: center;
  color: var(--text-soft);
  font-size: 12px;
  padding: 0 16px 24px;
}

@media (max-width: 940px) {
  .topbar-inner {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .content-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 800px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .topbar-meta {
    flex-wrap: wrap;
  }
}
