:root {
  color-scheme: light;
  --bg: #fbf7ee;
  --paper: #fffdf8;
  --paper-strong: #fff8e7;
  --ink: #1e1c18;
  --muted: #716b60;
  --line: #eadfcb;
  --accent: #0f8a73;
  --accent-soft: #dff5ed;
  --gold: #efbc42;
  --shadow: 0 24px 70px rgba(74, 55, 24, 0.14);
  --shadow-sm: 0 10px 30px rgba(74, 55, 24, 0.1);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(232, 217, 189, 0.28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 217, 189, 0.28) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
}

body.drawer-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(255, 253, 248, 0.86);
  border-bottom: 1px solid rgba(232, 223, 203, 0.8);
  backdrop-filter: blur(18px);
}

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

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.brand span {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 18px;
  line-height: 1;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a,
.button,
.filter,
.copy-tab {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.nav-links a {
  padding: 0 15px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

main {
  overflow: hidden;
}

.hero-shell {
  width: min(1180px, calc(100% - 36px));
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  padding: clamp(42px, 8vw, 92px) 0 54px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.75fr);
  align-items: center;
  gap: clamp(34px, 7vw, 82px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.98;
  font-weight: 900;
}

.hero-lede {
  max-width: 610px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  border: 1px solid var(--line);
  padding: 0 24px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
}

.button.primary {
  color: #fffdf8;
  background: #15130f;
  border-color: #15130f;
  box-shadow: 0 14px 30px rgba(21, 19, 15, 0.22);
}

.button.secondary {
  color: #155f52;
  background: var(--accent-soft);
  border-color: #a7ded2;
}

.button.wide {
  width: 100%;
}

.hero-board {
  position: relative;
  min-height: 560px;
}

.hero-board::before {
  content: "";
  position: absolute;
  inset: 34px 0 28px 22px;
  border: 1px solid rgba(232, 215, 175, 0.8);
  border-radius: 42px;
  transform: rotate(-3deg);
  background: rgba(255, 248, 229, 0.5);
}

.board-card {
  position: relative;
  overflow: hidden;
  border-radius: 38px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card-large {
  width: min(100%, 420px);
  margin-left: auto;
}

.card-large img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  background: #f4ecd9;
}

.card-large div {
  display: grid;
  gap: 7px;
  padding: 22px 24px 26px;
}

.card-large span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.card-large strong {
  font-size: 26px;
  line-height: 1.1;
}

.board-note {
  position: absolute;
  left: -32px;
  bottom: 150px;
  width: min(310px, 78%);
  padding: 22px;
  border-radius: 28px;
  background: #15130f;
  color: #fffdf8;
  box-shadow: var(--shadow);
}

.board-note span {
  display: block;
  color: rgba(255, 253, 248, 0.62);
  font-size: 13px;
  margin-bottom: 10px;
}

.board-note strong {
  font-size: 20px;
  line-height: 1.35;
}

.section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 76px 0;
}

.section.compact {
  padding-top: 34px;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 30px;
}

.section-heading.split {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
}

.section-heading p:not(.eyebrow) {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.motivation-grid,
.process-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.motivation-grid article,
.process-line article {
  min-height: 220px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow-sm);
}

.motivation-grid .index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.motivation-grid h3,
.process-line strong {
  display: block;
  margin: 22px 0 10px;
  font-size: 23px;
  line-height: 1.2;
}

.motivation-grid p,
.process-line p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.filter-row {
  max-width: 100%;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  padding: 0 18px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.8);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.filter.active {
  color: #117563;
  background: var(--accent-soft);
  border-color: #8fd1c2;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.inspiration-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-sm);
}

.inspiration-card button {
  appearance: none;
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #f4ecd9;
  overflow: hidden;
}

.thumb[data-ratio="2.35:1"],
.thumb[data-ratio="2.35:1"] img {
  aspect-ratio: 2.35 / 1;
}

.thumb[data-ratio="9:16"],
.thumb[data-ratio="9:16"] img {
  aspect-ratio: 9 / 16;
}

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

.card-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.card-body strong {
  font-size: 19px;
  line-height: 1.25;
}

.card-body p {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

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

.tag-row span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #23675c;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.process {
  padding-top: 34px;
}

.miniapp-band {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto 90px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: clamp(28px, 5vw, 52px);
  border-radius: 36px;
  background: #15130f;
  color: #fffdf8;
  box-shadow: var(--shadow);
}

.miniapp-band h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
}

.miniapp-band p:not(.eyebrow) {
  max-width: 720px;
  margin: 16px 0 0;
  color: rgba(255, 253, 248, 0.68);
  font-size: 17px;
  line-height: 1.8;
}

.code-card {
  width: 180px;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 14px 14px 18px;
  border-radius: 28px;
  background: #fffdf8;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.detail-drawer {
  position: fixed;
  right: 18px;
  top: 18px;
  bottom: 18px;
  z-index: 60;
  width: min(960px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.8fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 36px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transform: translateX(calc(100% + 36px));
  transition: transform 260ms ease;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.88);
  cursor: pointer;
}

.drawer-close::before,
.drawer-close::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 21px;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.drawer-close::before {
  transform: rotate(45deg);
}

.drawer-close::after {
  transform: rotate(-45deg);
}

.drawer-media {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 34px;
  background: var(--paper-strong);
}

.drawer-media img {
  max-height: calc(100vh - 110px);
  width: min(100%, 560px);
  height: auto;
  object-fit: contain;
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
}

.drawer-body {
  overflow-y: auto;
  padding: 54px 34px 34px;
}

.drawer-body h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.drawer-body p {
  color: var(--muted);
  line-height: 1.75;
}

.copy-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 24px;
}

.copy-tab {
  min-width: 0;
  border: 1px solid var(--line);
  padding: 0 8px;
  color: var(--muted);
  background: #fffdf8;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.copy-tab.active {
  color: #146c5d;
  background: var(--accent-soft);
  border-color: #8fd1c2;
}

.prompt-box {
  min-height: 190px;
  margin: 14px 0 16px;
  padding: 18px;
  white-space: pre-wrap;
  color: var(--ink);
  background: #fff8e7;
  border: 1px solid var(--line);
  border-radius: 24px;
  font: 500 14px/1.75 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(21, 19, 15, 0.28);
  backdrop-filter: blur(4px);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  color: #fffdf8;
  background: #15130f;
  box-shadow: var(--shadow-sm);
  transform: translate(-50%, 120px);
  transition: transform 220ms ease;
  font-weight: 800;
}

.toast.show {
  transform: translate(-50%, 0);
}

@media (max-width: 940px) {
  .site-header {
    align-items: flex-start;
  }

  .nav-links {
    display: none;
  }

  .hero-shell {
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .hero-board {
    min-height: auto;
  }

  .card-large {
    margin: 0 auto;
  }

  .card-large img {
    height: 380px;
  }

  .card-large strong {
    font-size: 22px;
  }

  .board-note {
    position: relative;
    left: auto;
    bottom: auto;
    width: min(100%, 420px);
    margin: 14px auto 0;
  }

  .motivation-grid,
  .process-line,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .miniapp-band,
  .detail-drawer {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    left: 12px;
    right: 12px;
    top: 12px;
    bottom: 12px;
    width: auto;
    overflow-y: auto;
  }

  .drawer-media {
    min-height: auto;
    padding: 24px 18px 0;
  }

  .drawer-media img {
    max-height: 46vh;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 14px 16px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .hero-shell,
  .section,
  .miniapp-band {
    width: min(100% - 24px, 1180px);
  }

  h1 {
    font-size: 44px;
  }

  .hero-lede,
  .section-heading p:not(.eyebrow),
  .miniapp-band p:not(.eyebrow) {
    font-size: 16px;
  }

  .hero-actions,
  .hero-actions .button {
    width: 100%;
  }

  .gallery-grid,
  .motivation-grid,
  .process-line {
    grid-template-columns: 1fr;
  }

  .section-heading.split {
    display: grid;
    align-items: start;
  }

  .miniapp-band {
    margin-bottom: 52px;
  }

  .code-card {
    width: 100%;
    grid-template-columns: 86px 1fr;
    text-align: left;
  }

  .detail-drawer {
    border-radius: 26px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
