:root {
  --ink: #18201c;
  --muted: #68706b;
  --paper: #f6f4ed;
  --white: #fffefa;
  --yellow: #ffd84d;
  --blue: #246bfe;
  --line: #d8d8cf;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header {
  width: min(1180px, calc(100% - 40px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 38px; border-radius: 11px; color: #111; background: var(--yellow); transform: rotate(-3deg); font-size: 12px; font-weight: 950; letter-spacing: -.04em; }
.header-link { padding-bottom: 4px; border-bottom: 1px solid var(--ink); font-size: 14px; font-weight: 650; }

.compact-header { gap: 28px; }
.compact-search { width: min(340px, 42vw); height: 44px; }
.library-direct {
  min-height: calc(100vh - 88px);
  padding-top: 40px;
  border-top: 0;
}

.hero {
  width: min(1180px, calc(100% - 40px));
  min-height: 570px;
  margin: 0 auto;
  padding: 96px 0 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  align-items: center;
  gap: 72px;
}
.eyebrow, .section-kicker { margin: 0 0 18px; color: #71776f; font-size: 12px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; max-width: 760px; font-family: Georgia, "Songti SC", serif; font-size: clamp(58px, 7.6vw, 108px); font-weight: 500; line-height: .98; letter-spacing: -.07em; }
.hero-description { max-width: 650px; margin: 34px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 21px); line-height: 1.75; }
.hero-note {
  position: relative;
  min-height: 230px;
  padding: 45px 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--yellow);
  box-shadow: 8px 10px 0 rgba(24, 32, 28, .12);
  transform: rotate(2.5deg);
}
.note-pin { position: absolute; top: 17px; left: 50%; width: 12px; height: 12px; border-radius: 50%; background: #e25e3e; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.hero-note strong { font-family: Georgia, serif; font-size: 72px; font-weight: 500; line-height: 1; }
.hero-note span { margin-top: 7px; font-size: 18px; font-weight: 750; }
.hero-note small { margin-top: 28px; font-size: 12px; font-weight: 700; letter-spacing: .1em; opacity: .65; }

.library { padding: 86px max(20px, calc((100% - 1180px) / 2)) 110px; background: var(--white); border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.section-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 6vw, 72px); font-weight: 500; letter-spacing: -.055em; }
.search-box { width: min(390px, 100%); height: 54px; padding: 0 18px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.search-box span { font-size: 26px; line-height: 1; transform: rotate(-20deg); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box input::placeholder { color: #989d98; }
.filter-row { display: flex; gap: 9px; margin: 44px 0 28px; }
.filter { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; color: #646a65; background: transparent; font-size: 13px; font-weight: 700; }
.filter.active { color: var(--white); border-color: var(--ink); background: var(--ink); }
.entry-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.entry-card { min-height: 500px; padding: 26px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: #fbfaf5; transition: transform .2s ease, box-shadow .2s ease; }
.entry-card:hover { transform: translateY(-5px); box-shadow: 0 18px 44px rgba(35, 43, 38, .1); }
.entry-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.card-topline { display: flex; align-items: center; justify-content: space-between; }
.category { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.arrow { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; font-size: 18px; transition: transform .2s ease; }
.entry-card:hover .arrow { transform: rotate(45deg); }
.card-illustration { position: relative; height: 176px; margin: 28px 0 34px; display: flex; align-items: end; justify-content: center; gap: 8px; border-radius: 14px; background: #e7eefc; overflow: hidden; }
.card-illustration::after { content: ''; position: absolute; right: -26px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.7); }
.book { z-index: 1; width: 48px; height: 92px; padding-top: 12px; border: 2px solid #18201c; border-radius: 5px 9px 9px 5px; color: #18201c; background: #fff; text-align: center; font-family: Georgia, serif; font-size: 18px; box-shadow: inset 5px 0 0 rgba(36,107,254,.14); }
.book-two { height: 116px; background: var(--yellow); }
.book-three { height: 82px; }
.index-tab { z-index: 2; position: absolute; left: 50%; bottom: 16px; padding: 6px 14px; border-radius: 5px; color: white; background: var(--blue); font-size: 12px; font-weight: 800; transform: translateX(-50%) rotate(-2deg); }
.entry-card.coral .category { color: #d64e38; }
.entry-card.orange .category { color: #c96b12; }
.entry-card.violet .category { color: #6254d9; }
.card-illustration.pandas { align-items: center; background: #fff0eb; }
.data-chip, .tool-box { z-index: 1; display: grid; place-items: center; min-width: 64px; height: 64px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 15px; background: #ffd166; font-size: 22px; font-weight: 900; transform: rotate(-5deg); }
.flow-arrow, .plus { z-index: 1; font-size: 27px; font-weight: 900; }
.mini-table { z-index: 1; display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--ink); background: white; }
.mini-table i { min-width: 58px; padding: 7px; border: 1px solid var(--ink); font-style: normal; font-size: 11px; text-align: center; }
.mini-table i:nth-child(-n+2) { color: white; background: #e24a33; font-weight: 900; }
.card-illustration.sklearn { align-items: center; background: #fff3df; }
.tool-box { min-width: 90px; color: white; background: #f28e2b; transform: rotate(0); font-family: ui-monospace, monospace; font-size: 17px; }
.model-dot { z-index: 1; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; color: white; background: #55a253; font-family: Georgia, serif; font-size: 34px; font-weight: 900; box-shadow: 0 0 0 8px #dcefd9; }
.model-dot small { margin-top: -23px; font-family: inherit; font-size: 10px; }
.card-illustration.boosting { align-items: center; gap: 4px; background: #eeefff; }
.tree { z-index: 1; display: grid; place-items: center; width: 55px; height: 74px; border: 2px solid var(--ink); border-radius: 28px 28px 12px 12px; color: white; background: #5b5ce2; font-size: 17px; font-weight: 900; }
.tree-two { height: 88px; background: #00a6a6; }
.tree-three { height: 66px; background: #e45756; }
.entry-card h3 { margin: 0 0 14px; font-family: Georgia, "Songti SC", serif; font-size: 31px; font-weight: 600; line-height: 1.25; letter-spacing: -.035em; }
.entry-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.card-meta { margin-top: auto; padding-top: 26px; display: flex; justify-content: space-between; color: #858b85; font-size: 12px; font-weight: 650; }
.empty-state { grid-column: 1 / -1; min-height: 260px; display: grid; place-content: center; gap: 8px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 20px; }
.empty-state strong { color: var(--ink); font-size: 22px; }
footer { width: min(1180px, calc(100% - 40px)); min-height: 120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; color: #737972; font-size: 13px; }

@media (max-width: 820px) {
  .hero { min-height: auto; padding: 72px 0; grid-template-columns: 1fr; gap: 48px; }
  .hero-note { width: 240px; min-height: 190px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .entry-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .site-header { height: auto; min-height: 72px; padding: 14px 0; }
  .compact-header { align-items: stretch; flex-direction: column; gap: 12px; }
  .compact-search { width: 100%; }
  .brand { font-size: 14px; }
  .header-link { display: none; }
  h1 { font-size: 54px; }
  .hero-description { font-size: 16px; }
  .library { padding-top: 64px; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-card { min-height: 470px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
