:root {
  --ink: #141414;
  --ink-soft: #2a2826;
  --paper: #fffdf8;
  --cream: #fff2dc;
  --butter: #f2c96f;
  --tomato: #ef5538;
  --tomato-dark: #b83e2b;
  --matcha: #748461;
  --matcha-dark: #3f5138;
  --berry: #d74462;
  --coffee: #6b4b35;
  --line: rgba(20, 20, 20, 0.13);
  --muted: rgba(20, 20, 20, 0.64);
  --shadow: 0 22px 58px rgba(58, 37, 20, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(239, 85, 56, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(116, 132, 97, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, #fff8eb 0%, #fffdf8 44%, #fff1e4 100%);
  background-size: 76px 76px, 76px 76px, auto;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

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

button,
input {
  font: inherit;
}

.site-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 52px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  background: rgba(255, 248, 235, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
}

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

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
}

.topnav a {
  padding: 8px 11px;
  border-radius: 6px;
  color: rgba(20, 20, 20, 0.76);
  font-size: 13px;
  font-weight: 700;
}

.topnav a:hover,
.topnav a:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Avenir Next Condensed", "Arial Black", Impact, "PingFang SC", sans-serif;
  letter-spacing: 0;
}

h1 {
  max-width: 800px;
  margin-bottom: 18px;
  font-size: 60px;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

h2 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.08;
}

h3 {
  margin-bottom: 9px;
  font-size: 18px;
  line-height: 1.2;
}

.section-kicker {
  margin: 0 0 11px;
  color: var(--tomato-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 34px;
  align-items: center;
  min-height: 78vh;
  padding: 34px 0 22px;
}

.hero-copy {
  min-width: 0;
}

.lead {
  max-width: 690px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 18px;
  overflow-wrap: break-word;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(20, 20, 20, 0.13);
  outline: none;
}

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

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

.button-light {
  border-color: rgba(255, 253, 248, 0.44);
  background: var(--paper);
  color: var(--ink);
}

.signal-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 620px;
  margin-bottom: 0;
}

.signal-row div {
  min-height: 78px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
}

.signal-row dt {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 25px;
  font-weight: 900;
  line-height: 1.1;
}

.signal-row dd {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-visual {
  position: relative;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.96), rgba(255, 242, 220, 0.92)),
    var(--paper);
  box-shadow: var(--shadow);
}

.cat-illustration {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
  transform-origin: 50% 85%;
  transition: transform 220ms ease;
}

.hero-visual:hover .cat-illustration {
  transform: rotate(-1deg) translateY(-3px);
}

.floating-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  padding: 0 11px;
  border: 1px solid rgba(20, 20, 20, 0.12);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 12px 26px rgba(20, 20, 20, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.chip-cake {
  right: 24px;
  top: 26px;
  color: var(--berry);
}

.chip-matcha {
  left: 22px;
  bottom: 32px;
  color: var(--matcha-dark);
}

.chip-coffee {
  right: 44px;
  bottom: 58px;
  color: var(--coffee);
}

.featured-lab {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(300px, 1fr);
  gap: 28px;
  align-items: center;
  margin-top: 8px;
  padding: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
}

.featured-lab .section-kicker {
  color: var(--butter);
}

.featured-copy p:not(.section-kicker) {
  max-width: 600px;
  color: rgba(255, 253, 248, 0.75);
}

.featured-copy .button {
  margin-top: 12px;
}

.lab-preview {
  min-height: 290px;
  overflow: hidden;
  border: 1px solid rgba(255, 253, 248, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(242, 201, 111, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 253, 248, 0.08) 1px, transparent 1px),
    #1f211f;
  background-size: 44px 44px, 44px 44px, auto;
}

.preview-header {
  display: flex;
  gap: 7px;
  padding: 15px;
  border-bottom: 1px solid rgba(255, 253, 248, 0.12);
}

.preview-header span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tomato);
}

.preview-header span:nth-child(2) {
  background: var(--butter);
}

.preview-header span:nth-child(3) {
  background: var(--matcha);
}

.preview-body {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  padding: 18px;
}

.preview-sidebar,
.preview-title,
.preview-bars span,
.preview-grid span {
  border-radius: 7px;
}

.preview-sidebar {
  min-height: 210px;
  background: rgba(255, 253, 248, 0.1);
}

.preview-title {
  width: 68%;
  height: 30px;
  margin-bottom: 20px;
  background: var(--paper);
}

.preview-bars {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.preview-bars span {
  display: block;
  height: 9px;
  background: rgba(255, 253, 248, 0.42);
}

.preview-bars span:nth-child(2) {
  width: 72%;
}

.preview-bars span:nth-child(3) {
  width: 46%;
}

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

.preview-grid span {
  min-height: 58px;
  background: rgba(242, 201, 111, 0.18);
}

.preview-grid span:nth-child(2) {
  background: rgba(116, 132, 97, 0.22);
}

.preview-grid span:nth-child(3) {
  background: rgba(239, 85, 56, 0.2);
}

.preview-grid span:nth-child(4) {
  background: rgba(255, 253, 248, 0.13);
}

.profile-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 42px 0 34px;
}

.profile-band p:not(.section-kicker) {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 18px;
}

.library-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow);
}

.library-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.search-box span {
  color: var(--tomato-dark);
  font-size: 20px;
  line-height: 1;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.filter-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: rgba(20, 20, 20, 0.72);
  cursor: pointer;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

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

.deck-card {
  display: flex;
  flex-direction: column;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.deck-card.is-featured-card {
  border-color: rgba(116, 132, 97, 0.45);
  box-shadow: 0 14px 34px rgba(116, 132, 97, 0.16);
}

.deck-visual {
  position: relative;
  min-height: 150px;
  padding: 18px;
  background: var(--ink);
}

.deck-visual::after {
  position: absolute;
  right: 17px;
  bottom: 15px;
  width: 58px;
  height: 8px;
  border-radius: 99px;
  content: "";
  background: rgba(255, 253, 248, 0.24);
}

.visual-topline,
.visual-title,
.visual-row,
.visual-blocks span {
  display: block;
  border-radius: 5px;
}

.visual-topline {
  width: 64px;
  height: 7px;
  margin-bottom: 18px;
  background: var(--butter);
}

.visual-title {
  width: 72%;
  height: 22px;
  margin-bottom: 16px;
  background: var(--paper);
}

.visual-row {
  width: 88%;
  height: 8px;
  margin-bottom: 9px;
  background: rgba(255, 253, 248, 0.58);
}

.visual-row.short {
  width: 55%;
}

.visual-blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 17px;
}

.visual-blocks span {
  height: 32px;
  background: rgba(255, 253, 248, 0.14);
}

.theme-sage .visual-topline,
.theme-sage .tag-row span:first-child {
  background: var(--matcha);
}

.theme-tomato .visual-topline,
.theme-tomato .tag-row span:first-child {
  background: var(--tomato);
}

.deck-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.deck-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 12px;
}

.deck-category {
  font-weight: 900;
  color: var(--tomato-dark);
}

.deck-title {
  min-height: 44px;
}

.deck-summary {
  min-height: 88px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

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

.tag-row span {
  padding: 5px 8px;
  border: 1px solid rgba(20, 20, 20, 0.1);
  border-radius: 999px;
  background: var(--cream);
  color: rgba(20, 20, 20, 0.72);
  font-size: 12px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 900;
  transition: transform 180ms ease, background-color 180ms ease;
}

.action-link:hover,
.action-link:focus-visible {
  transform: translateY(-1px);
  background: var(--tomato-dark);
  outline: none;
}

.action-link.is-disabled {
  border: 1px dashed rgba(20, 20, 20, 0.24);
  background: var(--paper);
  color: var(--muted);
}

.empty-state {
  padding: 42px 12px;
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state span {
  margin-top: 4px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .site-shell {
    width: min(760px, calc(100vw - 24px));
    padding-top: 10px;
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  .topnav a {
    min-width: 0;
  }

  .hero,
  .featured-lab,
  .profile-band,
  .library-heading {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
    padding-top: 28px;
  }

  h1 {
    font-size: 42px;
  }

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

  .deck-card {
    min-height: 0;
  }
}

@media (max-width: 540px) {
  .site-shell {
    width: calc(100vw - 20px);
  }

  .topnav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    max-width: 370px;
  }

  .topnav a {
    padding-right: 6px;
    padding-left: 6px;
    text-align: center;
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  h1 {
    font-size: 32px;
    max-width: 12ch;
  }

  h2 {
    font-size: 28px;
  }

  .lead,
  .profile-band p:not(.section-kicker) {
    font-size: 16px;
  }

  .hero-copy,
  .hero-visual,
  .signal-row {
    width: 100%;
    max-width: 370px;
  }

  .lead {
    max-width: 32ch;
  }

  .section-kicker {
    max-width: 34ch;
    font-size: 11px;
  }

  .signal-row {
    grid-template-columns: 1fr;
  }

  .hero-visual,
  .featured-lab,
  .library-panel {
    padding: 18px;
  }

  .preview-body {
    grid-template-columns: 1fr;
  }

  .preview-sidebar {
    min-height: 42px;
  }

  .floating-chip {
    display: none;
  }
}
