:root {
  --paper: #f5f0e6;
  --paper-deep: #ebe4d7;
  --card: #fffdf8;
  --ink: #191915;
  --muted: #747168;
  --faint: #aaa397;
  --line: #dcd4c6;
  --coral: #ff695e;
  --yellow: #ffbf47;
  --mint: #40cda0;
  --violet: #7f7cff;
  --blue: #4ca7ff;
  --pink: #ef7bd5;
  --shadow: 0 18px 50px rgba(52, 43, 28, 0.09);
  --radius: 18px;
  --display: "Arial Black", "Microsoft YaHei", "PingFang SC", sans-serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 82px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 240, 230, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 45px;
  height: 45px;
  color: var(--paper);
  border-radius: 13px;
  background: var(--ink);
  place-items: center;
  transform: rotate(-2deg);
}

.brand-mark svg {
  width: 31px;
  stroke-width: 1.7;
}

.brand-mark circle {
  fill: var(--coral);
  stroke: var(--ink);
}

.brand strong {
  display: block;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.22em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-chip {
  padding: 9px 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  font: 700 11px var(--mono);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  place-items: center;
  transition: 160ms ease;
}

.icon-button:hover {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
  transform: rotate(-8deg);
}

.icon-button svg {
  width: 18px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--ink);
  border-radius: 11px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  cursor: pointer;
  transition: 160ms ease;
}

.primary-button {
  min-height: 42px;
  padding: 0 17px;
  font-size: 13px;
}

.primary-button:hover {
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.primary-button svg {
  width: 17px;
}

.button-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.is-loading .button-spinner {
  display: block;
}

.is-loading .refresh-icon {
  display: none;
}

.secondary-button {
  padding: 10px 16px;
  background: transparent;
  color: var(--ink);
}

.secondary-button:hover {
  background: var(--ink);
  color: var(--paper);
}

.app-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 4vw;
}

.sidebar {
  position: sticky;
  top: 82px;
  align-self: start;
  height: calc(100vh - 82px);
  padding: 36px 26px 30px 0;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-label {
  margin: 0 0 14px 8px;
  color: var(--faint);
  font: 700 10px var(--mono);
  letter-spacing: 0.16em;
}

.category-link,
.ranking-link {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 11px;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #545149;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: 140ms ease;
}

.category-link + .category-link {
  margin-top: 3px;
}

.category-link:hover,
.ranking-link:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.category-link.active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 5px 18px rgba(59, 48, 31, 0.06);
  font-weight: 700;
}

.category-link.active::after {
  position: absolute;
  top: 12px;
  right: 8px;
  bottom: 12px;
  width: 3px;
  border-radius: 4px;
  background: var(--category-color, var(--coral));
  content: "";
}

.category-link b {
  margin-left: auto;
  padding-right: 3px;
  color: var(--faint);
  font: 600 10px var(--mono);
}

.category-icon {
  display: grid;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  color: var(--category-color, var(--ink));
  background: color-mix(in srgb, var(--category-color, var(--ink)) 13%, transparent);
  place-items: center;
}

.category-icon svg {
  width: 15px;
}

.all-icon {
  color: var(--ink);
  background: var(--paper-deep);
}

.sidebar-divider {
  height: 1px;
  margin: 24px 9px 22px;
  background: var(--line);
}

.ranking-link {
  min-height: 38px;
  padding: 7px 10px;
}

.ranking-link.active {
  color: var(--ink);
  font-weight: 700;
}

.ranking-link.active span:last-child::after {
  display: inline-block;
  width: 17px;
  height: 1px;
  margin-left: 9px;
  background: var(--coral);
  vertical-align: middle;
  content: "";
}

.rank-number {
  color: var(--faint);
  font: 700 10px var(--mono);
}

.sidebar-card {
  position: relative;
  margin-top: 30px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #292923;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
}

.sidebar-card::after {
  position: absolute;
  right: -17px;
  bottom: -23px;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  content: "";
}

.sidebar-card p {
  margin: 0 0 8px;
  color: var(--yellow);
  font: 700 9px var(--mono);
  letter-spacing: 0.16em;
}

.sidebar-card strong {
  display: block;
  font-size: 13px;
}

.sidebar-card small {
  display: block;
  width: 80%;
  margin-top: 7px;
  color: #a8a69e;
  font-size: 10px;
  line-height: 1.6;
}

.pulse-dot {
  position: absolute;
  top: 19px;
  right: 18px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(64, 205, 160, 0.11);
  animation: pulse 2s infinite;
}

main {
  min-width: 0;
  padding: 0 0 80px clamp(28px, 4vw, 62px);
}

.hero {
  position: relative;
  display: flex;
  min-height: 360px;
  padding: 68px 0 48px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: 72%;
}

.eyebrow,
.section-kicker {
  color: var(--muted);
  font: 700 10px var(--mono);
  letter-spacing: 0.16em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}

.eyebrow span {
  width: 22px;
  height: 1px;
  background: var(--coral);
}

.hero h1 {
  margin: 20px 0 17px;
  font-family: var(--display);
  font-size: clamp(38px, 4.2vw, 66px);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.055em;
}

.hero h1 em {
  position: relative;
  color: var(--coral);
  font-style: normal;
  white-space: nowrap;
}

.hero h1 em::after {
  position: absolute;
  right: 2px;
  bottom: -5px;
  left: 4px;
  height: 7px;
  border-top: 2px solid var(--coral);
  border-radius: 50%;
  content: "";
  transform: rotate(-1deg);
}

.hero-copy > p {
  max-width: 560px;
  margin: 0;
  color: #69665e;
  font-size: 14px;
  line-height: 1.9;
}

.hero-visual {
  position: absolute;
  top: 34px;
  right: 1%;
  width: 290px;
  height: 290px;
}

.orbit {
  position: absolute;
  border: 1px solid #cfc5b4;
  border-radius: 50%;
}

.orbit-one {
  inset: 20px;
  transform: rotate(-14deg) scaleY(0.56);
}

.orbit-two {
  inset: 53px -1px;
  transform: rotate(58deg) scaleY(0.52);
}

.orb {
  position: absolute;
  display: grid;
  border: 1px solid var(--ink);
  border-radius: 50%;
  box-shadow: 4px 5px 0 rgba(25, 25, 21, 0.13);
  font: 900 13px var(--mono);
  place-items: center;
}

.orb-one {
  top: 42px;
  left: 102px;
  width: 82px;
  height: 82px;
  background: var(--coral);
  transform: rotate(-8deg);
}

.orb-two {
  right: 15px;
  bottom: 31px;
  width: 66px;
  height: 66px;
  background: var(--mint);
  transform: rotate(9deg);
}

.orb-three {
  bottom: 17px;
  left: 23px;
  width: 44px;
  height: 44px;
  background: var(--yellow);
  font-size: 21px;
  transform: rotate(-10deg);
}

.hero-squiggle {
  position: absolute;
  top: 140px;
  right: 33px;
  width: 100px;
  color: var(--ink);
  stroke-width: 1.5;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.55fr;
  min-height: 93px;
  border-bottom: 1px solid var(--line);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 18px;
  border-right: 1px solid var(--line);
}

.stat-item:first-child {
  padding-left: 0;
}

.stat-item:last-child {
  border-right: 0;
}

.stat-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  place-items: center;
  transform: rotate(-3deg);
}

.stat-icon svg {
  width: 20px;
  stroke-width: 1.6;
}

.stat-icon.coral {
  background: #ffd4d0;
}

.stat-icon.yellow {
  background: #ffe9b8;
}

.stat-icon.mint {
  background: #c8f0e3;
}

.stat-item strong {
  display: block;
  font: 800 20px var(--display);
  letter-spacing: -0.03em;
}

.stat-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.latest-update {
  justify-content: flex-end;
}

.latest-update strong {
  font: 700 12px var(--sans);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 4px;
  background: #dff5e9;
  color: #257c58;
  font: 800 8px var(--mono);
  letter-spacing: 0.1em;
}

.live-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #33a874;
}

.radar-section,
.library-section {
  padding-top: 42px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-kicker {
  display: block;
  margin-bottom: 8px;
  color: #9a9284;
}

.section-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.heading-note,
.result-count {
  color: var(--muted);
  font-size: 11px;
}

.radar-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: repeat(2, 180px);
  gap: 14px;
}

.radar-card {
  position: relative;
  display: flex;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
}

.radar-card:first-child {
  grid-row: span 2;
}

.radar-art {
  position: relative;
  width: 41%;
  overflow: hidden;
  border-right: 1px solid var(--ink);
  background: var(--accent);
}

.radar-card:first-child .radar-art {
  width: 43%;
}

.radar-art::before {
  position: absolute;
  top: 13%;
  left: 50%;
  width: 57%;
  aspect-ratio: 1;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 54%, white);
  content: "";
  transform: translateX(-50%);
}

.radar-art::after {
  position: absolute;
  top: 30%;
  left: 50%;
  width: 27%;
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  background: var(--ink);
  box-shadow: 11px 13px 0 color-mix(in srgb, var(--accent) 42%, white);
  content: "";
  transform: translateX(-50%) rotate(16deg);
}

.radar-card:first-child .radar-art::before {
  top: 22%;
  width: 68%;
}

.radar-card:first-child .radar-art::after {
  top: 39%;
  width: 35%;
}

.radar-index {
  position: absolute;
  top: 13px;
  left: 13px;
  z-index: 2;
  font: 900 11px var(--mono);
}

.radar-lines {
  position: absolute;
  right: -22px;
  bottom: -22px;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(25, 25, 21, 0.4);
  border-radius: 50%;
}

.radar-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 22px;
}

.radar-card:first-child .radar-copy {
  padding: 28px;
}

.radar-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--muted);
  font: 700 9px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.radar-label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.radar-copy h3 {
  max-width: 98%;
  margin: 0 0 9px;
  overflow: hidden;
  font: 800 20px/1.2 var(--display);
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-card:first-child h3 {
  font-size: 28px;
}

.radar-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #6e6a61;
  font-size: 11px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.radar-card:first-child p {
  font-size: 12px;
  -webkit-line-clamp: 4;
}

.radar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 15px;
  color: #777269;
  font: 700 10px var(--mono);
}

.radar-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.radar-meta svg {
  width: 12px;
}

.radar-card .card-link-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.radar-card:hover {
  box-shadow: 5px 6px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.radar-card {
  transition: 180ms ease;
}

.skeleton-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(100deg, transparent 20%, rgba(255,255,255,.45) 40%, transparent 60%) 0 0 / 220% 100%,
    #e9e2d5;
  animation: shimmer 1.4s infinite linear;
}

.skeleton-card.large {
  grid-row: span 2;
}

.library-section {
  padding-top: 62px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  flex: 1;
  align-items: center;
  height: 46px;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.7);
  transition: 150ms ease;
}

.search-box:focus-within {
  background: var(--card);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(25, 25, 21, 0.06);
}

.search-box svg {
  width: 18px;
  color: var(--muted);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.search-box input::placeholder {
  color: #a19a8d;
}

.search-box kbd {
  padding: 3px 6px;
  color: #9c9589;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  font: 600 9px var(--mono);
}

.sort-tabs {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.38);
}

.sort-tab {
  height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.sort-tab.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 7px rgba(44, 36, 23, 0.1);
  font-weight: 700;
}

.filter-button {
  display: flex;
  align-items: center;
  height: 44px;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.filter-button:hover,
.filter-button[aria-expanded="true"] {
  border-color: var(--ink);
  background: var(--card);
}

.filter-button svg {
  width: 15px;
}

.topic-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,253,248,.6);
}

.topic-filter[hidden] {
  display: none;
}

.topic-pill {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.topic-pill:hover,
.topic-pill.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

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

.project-card {
  position: relative;
  display: flex;
  min-height: 277px;
  flex-direction: column;
  padding: 19px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
  transition: 170ms ease;
}

.project-card:hover {
  border-color: var(--ink);
  box-shadow: 4px 5px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.project-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: 180ms ease;
}

.project-card:hover::before {
  transform: scaleX(1);
}

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

.card-owner {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.owner-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--accent);
  color: var(--ink);
  font: 900 12px var(--mono);
  place-items: center;
}

.owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.owner-info {
  min-width: 0;
}

.owner-name {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font: 600 9px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-info strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.star-count {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border-radius: 6px;
  background: #f1ecdf;
  color: #5e5a52;
  font: 700 9px var(--mono);
  white-space: nowrap;
}

.star-count svg {
  width: 11px;
  fill: var(--yellow);
  stroke: none;
}

.project-card h3 {
  margin: 17px 0 9px;
  overflow: hidden;
  font: 800 18px var(--display);
  letter-spacing: -0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card h3 a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.project-card:hover h3 a {
  color: color-mix(in srgb, var(--accent) 72%, var(--ink));
}

.project-description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #69655d;
  font-size: 11px;
  line-height: 1.72;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 13px;
}

.card-tag {
  max-width: 100%;
  padding: 4px 7px;
  overflow: hidden;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 13%, #f6f1e7);
  color: #5d5850;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #ebe5da;
  color: #8c867b;
  font: 600 9px var(--mono);
}

.lang-dot {
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.updated-label {
  margin-left: auto;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-action {
  display: grid;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: #68645c;
  cursor: pointer;
  place-items: center;
  transition: 130ms ease;
}

.card-action:hover,
.card-action.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.card-action svg {
  width: 13px;
}

.growth-badge {
  position: absolute;
  top: -1px;
  right: 55px;
  padding: 4px 7px 5px;
  border-radius: 0 0 6px 6px;
  background: var(--accent);
  color: var(--ink);
  font: 800 8px var(--mono);
}

.empty-state {
  padding: 72px 20px;
  text-align: center;
}

.empty-state > span {
  color: var(--coral);
  font-size: 50px;
}

.empty-state h3 {
  margin: 12px 0 6px;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
}

.load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  gap: 9px;
  margin-top: 20px;
  border: 1px dashed #bdb4a6;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.load-more:hover {
  border-color: var(--ink);
  background: var(--card);
  color: var(--ink);
}

.load-more[hidden] {
  display: none;
}

footer {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 95px;
  padding: 24px 4vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.footer-brand {
  margin-right: auto;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.footer-brand span {
  margin-right: 5px;
  color: var(--coral);
}

footer p {
  margin: 0;
}

dialog {
  padding: 0;
  border: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(20, 19, 16, 0.58);
  backdrop-filter: blur(5px);
}

.detail-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(840px, calc(100vh - 40px));
  color: var(--ink);
}

.dialog-content {
  position: relative;
  padding: 34px;
  overflow: auto;
  overflow-x: hidden;
  border: 1px solid var(--ink);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 12px 13px 0 rgba(0, 0, 0, 0.25);
  scroll-behavior: smooth;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0 0 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-size: 21px;
  cursor: pointer;
  place-items: center;
}

.dialog-close:hover {
  color: var(--paper);
  background: var(--ink);
}

.detail-hero {
  position: relative;
  margin: -34px -34px 27px;
  height: 130px;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background: var(--accent);
}

.detail-hero::before,
.detail-hero::after {
  position: absolute;
  border: 1px solid rgba(25, 25, 21, 0.65);
  border-radius: 50%;
  content: "";
}

.detail-hero::before {
  top: 21px;
  left: 35px;
  width: 88px;
  height: 88px;
}

.detail-hero::after {
  top: -37px;
  right: 68px;
  width: 160px;
  height: 160px;
}

.detail-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--ink);
  border-radius: 99px;
  background: var(--card);
  font: 700 9px var(--mono);
}

.detail-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.doc-jump {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.doc-jump:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.detail-category i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.detail-dialog h2 {
  margin: 16px 0 5px;
  font: 800 31px var(--display);
  letter-spacing: -0.045em;
}

.detail-fullname {
  color: var(--muted);
  font: 600 10px var(--mono);
}

.detail-summary {
  margin: 22px 0;
  padding: 18px;
  border-left: 3px solid var(--accent);
  background: #f7f2e8;
  font-size: 13px;
  line-height: 1.85;
}

.original-description {
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.original-description small {
  color: var(--faint);
  font: 700 9px var(--mono);
}

.original-description p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin: 22px 0;
}

.detail-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.detail-stat strong {
  display: block;
  font: 800 16px var(--display);
}

.detail-stat small {
  color: var(--muted);
  font-size: 9px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.detail-actions .primary-button,
.detail-actions .secondary-button {
  flex: 1;
  min-height: 43px;
  font-size: 11px;
}

.project-document {
  margin: 25px -34px 0;
  padding: 27px 34px 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 253, 248, 0.93), rgba(255, 253, 248, 0.93)),
    repeating-linear-gradient(0deg, transparent 0, transparent 27px, rgba(25,25,21,.04) 28px);
}

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

.document-heading > div:first-child {
  min-width: 0;
}

.document-heading h3 {
  margin: 0;
  font: 800 21px var(--display);
  letter-spacing: -0.035em;
}

.document-source {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  color: var(--faint);
  font: 600 8px var(--mono);
}

.document-source a {
  color: var(--ink);
  font: 700 9px var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.document-notice {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #e6d294;
  border-radius: 8px;
  background: #fff6d8;
  color: #756226;
  font-size: 10px;
  line-height: 1.6;
}

.use-case-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px;
  border: 1px solid #e8e0d2;
  border-radius: 10px;
  background: rgba(255,255,255,.65);
}

.use-case-row > small {
  flex: 0 0 auto;
  padding-top: 3px;
  color: var(--faint);
  font: 700 8px var(--mono);
  letter-spacing: 0.08em;
}

.use-case-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.use-case-row span {
  padding: 4px 7px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: #5f5a50;
  font-size: 9px;
}

.document-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 17px 0 5px;
  padding-bottom: 15px;
  border-bottom: 1px dashed var(--line);
}

.document-toc a {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--muted);
  font: 600 8px var(--mono);
  transition: 130ms ease;
}

.document-toc a:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.document-chapter {
  padding: 20px 0 18px;
  border-bottom: 1px solid #e9e2d7;
  scroll-margin-top: 18px;
}

.document-chapter:last-child {
  border-bottom: 0;
}

.chapter-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.chapter-heading > div {
  min-width: 0;
}

.chapter-heading > span {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--paper);
  font: 700 8px var(--mono);
  place-items: center;
}

.chapter-heading h4 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.015em;
}

.chapter-heading small {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font: 500 8px var(--mono);
}

.chapter-body {
  color: #565249;
  font-size: 11px;
  line-height: 1.9;
}

.chapter-body p {
  margin: 0 0 10px;
}

.chapter-body ul {
  margin: 7px 0 11px;
  padding-left: 18px;
}

.chapter-body li {
  margin: 4px 0;
}

.chapter-body li::marker {
  color: var(--accent);
}

.document-chapter pre {
  max-width: 100%;
  margin: 12px 0 0;
  padding: 13px;
  overflow: auto;
  border: 1px solid #33332d;
  border-radius: 8px;
  background: #1d1d19;
  color: #e9e4d9;
  font: 9px/1.7 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.document-footnote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.6;
}

.document-footnote span:first-child {
  flex: 1;
  min-width: 190px;
}

.document-footnote button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 8px;
  text-decoration: underline;
  cursor: pointer;
}

.document-loading {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 105px;
  padding: 20px;
  border: 1px dashed #c9c0b1;
  border-radius: 10px;
  background: rgba(255,255,255,.52);
}

.document-loading strong {
  font-size: 11px;
}

.document-loading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.document-loader {
  width: 25px;
  height: 25px;
  border: 2px solid var(--line);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.document-error {
  padding: 16px;
  border: 1px solid #e4b7b2;
  border-radius: 9px;
  background: #fff0ee;
}

.document-error p {
  margin: 0 0 12px;
  color: #7b3e38;
  font-size: 10px;
}

.history-dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 32px;
  border: 1px solid var(--ink);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 10px 11px 0 rgba(0,0,0,.23);
}

.history-dialog h2 {
  margin: 6px 0;
  font: 800 28px var(--display);
}

.dialog-intro {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 450px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.history-item strong {
  font: 700 11px var(--mono);
}

.history-item span {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.toast-region {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 255px;
  max-width: 360px;
  padding: 13px 16px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 4px 5px 0 rgba(255,105,94,.55);
  font-size: 11px;
  line-height: 1.5;
  animation: toast-in 200ms ease-out;
}

.toast.error {
  background: #9d342f;
  box-shadow: 4px 5px 0 rgba(25,25,21,.35);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: 180ms ease;
}

.download-dock {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 180;
  width: 310px;
  padding: 14px;
  border: 1px solid var(--ink);
  border-radius: 11px;
  background: var(--card);
  box-shadow: 4px 5px 0 var(--ink);
}

.download-dock[hidden] {
  display: none;
}

.download-dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 10px;
}

.download-dock-header button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
}

.download-dock strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  height: 4px;
  margin: 10px 0 7px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--paper-deep);
}

.progress-bar {
  height: 100%;
  width: 5%;
  background: var(--coral);
  transition: width 250ms ease;
}

.download-dock small {
  color: var(--muted);
  font-size: 9px;
}

.download-dock a {
  display: inline-block;
  margin-top: 9px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 8px rgba(64, 205, 160, 0); }
}

@keyframes shimmer {
  to { background-position: -220% 0, 0 0; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1180px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-copy {
    width: 78%;
  }

  .hero-visual {
    right: -45px;
    opacity: 0.74;
  }

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

  .stat-item:nth-child(2) {
    border-right: 0;
  }

  .stat-item:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .latest-update {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .topbar {
    height: 70px;
  }

  .app-shell {
    display: block;
    padding: 0 20px;
  }

  .sidebar {
    position: static;
    display: flex;
    height: auto;
    gap: 8px;
    padding: 15px 0;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar nav {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
  }

  #categoryNav {
    display: flex;
    gap: 3px;
  }

  .nav-label,
  .sidebar-divider,
  .sidebar-card,
  .ranking-link {
    display: none;
  }

  .category-link {
    width: auto;
    min-height: 38px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  .category-link b,
  .category-link.active::after {
    display: none;
  }

  main {
    padding-left: 0;
  }

  .hero {
    min-height: 320px;
    padding-top: 52px;
  }

  .hero-copy {
    width: 88%;
  }

  .hero-visual {
    top: 70px;
    right: -86px;
    transform: scale(0.78);
  }

  footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 0 16px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
  }

  .brand strong {
    font-size: 16px;
  }

  .date-chip,
  .icon-button {
    display: none;
  }

  .primary-button {
    min-height: 38px;
    width: 40px;
    padding: 0;
    font-size: 10px;
  }

  #refreshButton span:last-child {
    display: none;
  }

  .app-shell {
    padding: 0 15px;
  }

  .hero {
    min-height: 310px;
    padding: 38px 0;
  }

  .hero-copy {
    width: 100%;
  }

  .hero h1 {
    margin-top: 16px;
    font-size: 37px;
    line-height: 1.22;
  }

  .hero h1 em {
    white-space: normal;
  }

  .hero-rest {
    display: block;
  }

  .hero-copy > p {
    max-width: 91%;
    font-size: 12px;
    line-height: 1.8;
  }

  .hero-visual {
    top: 95px;
    right: -118px;
    opacity: 0.32;
    transform: scale(0.66);
  }

  .stats-strip {
    grid-template-columns: 1fr 1fr;
  }

  .stat-item {
    padding: 13px 10px;
  }

  .stat-item:first-child {
    padding-left: 10px;
  }

  .stat-icon {
    width: 33px;
    height: 33px;
  }

  .stat-item strong {
    font-size: 17px;
  }

  .latest-update {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
  }

  .latest-update strong {
    font-size: 10px;
  }

  .radar-section,
  .library-section {
    padding-top: 38px;
  }

  .radar-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .radar-card,
  .radar-card:first-child {
    grid-row: auto;
    min-height: 158px;
  }

  .radar-card:first-child {
    min-height: 270px;
    flex-direction: column;
  }

  .radar-art,
  .radar-card:first-child .radar-art {
    width: 100%;
    min-height: 100px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .radar-card:first-child .radar-art {
    min-height: 130px;
  }

  .radar-copy,
  .radar-card:first-child .radar-copy {
    padding: 18px;
  }

  .radar-card:first-child h3 {
    font-size: 23px;
  }

  .section-heading h2 {
    font-size: 21px;
  }

  .heading-note,
  .result-count {
    display: none;
  }

  .toolbar {
    flex-wrap: wrap;
  }

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

  .search-box kbd {
    display: none;
  }

  .sort-tabs {
    flex: 1;
  }

  .sort-tab {
    flex: 1;
    padding: 0 7px;
    font-size: 10px;
  }

  .filter-button {
    height: 41px;
  }

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

  .project-card {
    min-height: 260px;
  }

  .detail-dialog {
    width: calc(100vw - 20px);
  }

  .dialog-content {
    padding: 24px;
  }

  .project-document {
    margin: 22px -24px 0;
    padding: 23px 24px 25px;
  }

  .document-heading {
    align-items: flex-start;
  }

  .document-heading h3 {
    font-size: 19px;
  }

  .document-source span {
    display: none;
  }

  .use-case-row {
    display: block;
  }

  .use-case-row > div {
    margin-top: 8px;
  }

  .document-toc {
    flex-wrap: nowrap;
    padding-bottom: 12px;
    overflow-x: auto;
  }

  .document-toc a {
    flex: 0 0 auto;
  }

  .detail-actions > * {
    flex-basis: 100%;
  }

  .detail-hero {
    margin: -24px -24px 24px;
  }

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

  .history-dialog {
    padding: 24px;
  }

  footer {
    display: block;
    padding: 24px 17px;
  }

  footer p {
    margin-top: 8px;
    line-height: 1.6;
  }

  .download-dock {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
  }

  .toast-region {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
