
:root {
  --ink: #171714;
  --muted: #6c6a62;
  --paper: #f7f4ed;
  --card: #fffdf8;
  --line: #d9d4c8;
  --lime: #dafa57;
  --lime-deep: #bfd83b;
  --dark: #20211d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.copy-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: calc(100% - 44px);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #3f4236;
  background: var(--dark);
  color: #f7f5ed;
  padding: 14px 18px;
  box-shadow: 0 14px 40px rgba(20, 21, 17, 0.2);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.copy-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.copy-toast span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--dark);
  font-weight: 800;
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #739100;
  outline-offset: 3px;
}

.hero {
  min-height: 610px;
  background:
    radial-gradient(circle at 82% 20%, rgba(218, 250, 87, 0.2), transparent 24%),
    linear-gradient(138deg, #1c1e19 0%, #262821 62%, #181a16 100%);
  color: #f9f7ef;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "“";
  position: absolute;
  right: 4vw;
  bottom: -0.34em;
  color: rgba(218, 250, 87, 0.08);
  font-family: Georgia, serif;
  font-size: clamp(280px, 40vw, 620px);
  line-height: 1;
  pointer-events: none;
}

.topbar,
.hero-content,
.library,
.guide,
footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  position: relative;
  z-index: 1;
}

.brand {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--dark);
  font-family: Georgia, serif;
  font-size: 27px;
  line-height: 1;
}

.guide-link {
  color: #d8d8cf;
  font-size: 14px;
  text-decoration: none;
  transition: color 160ms ease;
}

.guide-link:hover {
  color: var(--lime);
}

.hero-content {
  padding: 84px 0 96px;
  position: relative;
  z-index: 1;
}

.kicker {
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--lime);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.kicker span {
  width: 32px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(64px, 8vw, 110px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

.hero h1 em {
  color: var(--lime);
  font-weight: 400;
}

.hero-copy {
  margin: 38px 0 0;
  color: #bebfb7;
  font-size: 17px;
  line-height: 1.85;
}

.hero-note {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(218, 250, 87, 0.38);
  border-radius: 999px;
  padding: 10px 16px;
  color: #e7efbc;
  font-size: 13px;
}

.hero-note span {
  color: var(--lime);
}

.hero-start {
  margin-top: 18px;
  border: 0;
  border-bottom: 1px solid rgba(218, 250, 87, 0.55);
  background: transparent;
  color: var(--lime);
  padding: 8px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.hero-start span {
  margin-left: 8px;
}

.library {
  padding: 68px 0 96px;
  scroll-margin-top: 12px;
}

.starter {
  margin-bottom: 28px;
  border: 1px solid #cfd2b3;
  background: #f0f2df;
  padding: 30px;
}

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

.starter-heading p {
  margin: 0 0 7px;
  color: #72820d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.starter-heading h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 30px;
  font-weight: 400;
}

.starter-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #cfd2b3;
  border-left: 1px solid #cfd2b3;
}

.quick-grid button {
  min-height: 80px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  border: 0;
  border-right: 1px solid #cfd2b3;
  border-bottom: 1px solid #cfd2b3;
  background: rgba(255, 255, 255, 0.48);
  padding: 16px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}

.quick-grid button:hover {
  background: var(--lime);
}

.quick-grid strong {
  font-size: 14px;
}

.quick-grid span {
  grid-column: 1;
  color: var(--muted);
  font-size: 11px;
}

.quick-grid i {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: #74820d;
  font-style: normal;
}

.mini-steps {
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
}

.mini-steps li {
  color: #5f6254;
  font-size: 11px;
  line-height: 1.5;
}

.mini-steps span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--dark);
  color: var(--lime);
  font-weight: 700;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--line);
  background: #eeebe3;
}

.filter {
  min-width: 0;
  min-height: 104px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 18px 20px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  position: relative;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.filter:last-child {
  border-right: 0;
}

.filter:hover {
  background: #e4e1d7;
}

.filter.active {
  background: var(--lime);
}

.filter span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.filter strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.filter small {
  position: absolute;
  right: 16px;
  top: 16px;
  color: #858379;
  font-size: 11px;
}

.search-shell {
  height: 70px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0 20px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.search-shell:focus-within {
  border-color: #7c8f2b;
  box-shadow: 0 0 0 3px rgba(218, 250, 87, 0.34);
}

.search-icon {
  width: 18px;
  height: 18px;
  margin-right: 14px;
  border: 1.8px solid #727167;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 1.8px;
  right: -5px;
  bottom: -3px;
  background: #727167;
  transform: rotate(45deg);
}

.search-shell input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-shell input::placeholder {
  color: #969289;
}

.search-shell kbd {
  padding: 5px 8px;
  border: 1px solid #ded9ce;
  border-radius: 5px;
  background: #f1eee7;
  color: #7a786f;
  font-size: 11px;
  white-space: nowrap;
}

.clear-search {
  border: 0;
  background: transparent;
  color: #647500;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.result-meta {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.result-meta p,
.result-meta span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sections {
  display: flex;
  flex-direction: column;
  gap: 78px;
  padding-top: 50px;
}

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

.section-heading span {
  display: block;
  margin-bottom: 8px;
  color: #778d16;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.section-heading > p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.phrase-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 26px;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.phrase-card:hover {
  border-color: #a9a393;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 35, 29, 0.06);
}

.card-topline {
  min-height: 22px;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scenario {
  color: #727067;
  font-size: 12px;
  line-height: 1.5;
}

.edit-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f0eecb;
  color: #6f6c18;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 700;
}

blockquote {
  margin: 0 0 24px;
  color: #20211d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.48;
}

.translation {
  margin-top: auto;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  border-top: 1px solid #e3ded3;
  padding-top: 18px;
}

.translation span {
  color: #809517;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.translation p {
  margin: 0;
  color: #66645d;
  font-size: 13px;
  line-height: 1.7;
}

.card-actions {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.copy-button {
  min-height: 42px;
  border: 1px solid #d5d0c5;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.copy-button:hover {
  border-color: #9a9689;
  background: #f2efe7;
}

.copy-button.primary {
  border-color: var(--dark);
  background: var(--dark);
  color: #fff;
}

.copy-button.primary:hover {
  border-color: #36392e;
  background: #36392e;
}

.copy-button span {
  margin-right: 8px;
}

.state-card {
  margin-top: 42px;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 48px;
  color: var(--muted);
  text-align: center;
}

.state-card.error {
  border-color: #cf998c;
  color: #8a3b2a;
}

.state-card.empty span {
  color: #b9cf3d;
  font-family: Georgia, serif;
  font-size: 64px;
  line-height: 1;
}

.state-card.empty h2 {
  margin: 4px 0 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 28px;
  font-weight: 400;
}

.state-card.empty p {
  margin: 0 0 22px;
}

.state-card.empty button {
  border: 0;
  background: var(--lime);
  padding: 10px 18px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.guide {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 100px;
  border-top: 1px solid #46473f;
  background: var(--dark);
  box-shadow: 0 0 0 100vmax var(--dark);
  clip-path: inset(0 -100vmax);
  padding: 96px 0;
}

.guide {
  color: #f8f6ee;
  position: relative;
}

.guide h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(42px, 5vw, 66px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.guide-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 18px;
  border-top: 1px solid #46473f;
  padding: 25px 0;
}

.guide-list li:last-child {
  border-bottom: 1px solid #46473f;
}

.guide-list > li > span {
  color: var(--lime);
  font-family: Georgia, serif;
  font-size: 13px;
}

.guide-list h3 {
  margin: 0 0 7px;
  font-size: 15px;
}

.guide-list p {
  margin: 0;
  color: #b5b6ae;
  font-size: 13px;
  line-height: 1.7;
}

footer {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #c7c8c0;
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  inset: 0 50%;
  width: 100vw;
  z-index: -1;
  background: #181915;
  transform: translateX(-50%);
}

footer p,
footer > a:last-child {
  color: #96978f;
  font-size: 12px;
}

footer > a:last-child {
  text-decoration: none;
}

.onboarding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(17, 18, 15, 0.72);
  backdrop-filter: blur(6px);
}

.onboarding-backdrop[hidden] {
  display: none;
}

.onboarding {
  width: min(520px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  position: relative;
  border-top: 7px solid var(--lime);
  background: var(--card);
  padding: 38px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.onboarding-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
}

.onboarding-eyebrow {
  margin: 0 0 10px;
  color: #72820d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.onboarding h2 {
  max-width: 390px;
  margin: 0 0 27px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 35px;
  font-weight: 400;
  line-height: 1.18;
}

.onboarding ol {
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.onboarding li {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.onboarding li > span {
  color: #809517;
  font-family: Georgia, serif;
  font-size: 12px;
}

.onboarding strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.onboarding li p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.onboarding-primary,
.onboarding-secondary {
  width: 100%;
  min-height: 48px;
  border: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.onboarding-primary {
  background: var(--dark);
  color: white;
}

.onboarding-primary span {
  margin-left: 8px;
  color: var(--lime);
}

.onboarding-secondary {
  margin-top: 6px;
  background: transparent;
  color: var(--muted);
}

@media (max-width: 820px) {
  .hero {
    min-height: 570px;
  }

  .topbar,
  .hero-content,
  .library,
  .guide,
  footer {
    width: min(100% - 28px, 660px);
  }

  .hero-content {
    padding-top: 74px;
  }

  .hero h1 {
    font-size: clamp(58px, 17vw, 88px);
  }

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

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

  .mini-steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .filter {
    min-height: 82px;
    border-bottom: 1px solid var(--line);
  }

  .filter:first-child {
    grid-column: 1 / -1;
  }

  .filter:nth-child(2),
  .filter:nth-child(4) {
    border-left: 0;
  }

  .filter:nth-child(3),
  .filter:nth-child(5) {
    border-right: 0;
  }

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

  .guide {
    grid-template-columns: 1fr;
    gap: 58px;
  }
}

@media (max-width: 520px) {
  .topbar {
    height: 72px;
  }

  .hero {
    min-height: 520px;
  }

  .hero-content {
    padding: 60px 0 74px;
  }

  .hero h1 {
    font-size: 58px;
  }

  .hero-copy {
    font-size: 14px;
  }

  .desktop-break {
    display: none;
  }

  .library {
    padding: 38px 0 68px;
  }

  .starter {
    padding: 22px 16px;
  }

  .starter-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .starter-heading h2 {
    font-size: 27px;
  }

  .quick-grid button {
    min-height: 76px;
    padding: 13px;
  }

  .filter {
    padding: 14px;
  }

  .filter strong {
    font-size: 14px;
  }

  .search-shell {
    height: 62px;
    padding-inline: 16px;
  }

  .search-shell input {
    font-size: 14px;
  }

  .search-shell kbd {
    display: none;
  }

  .result-meta {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
  }

  .sections {
    gap: 60px;
    padding-top: 38px;
  }

  .phrase-card {
    padding: 22px 18px 18px;
  }

  blockquote {
    font-size: 18px;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }

  .guide {
    padding: 72px 0;
  }

  .onboarding {
    padding: 32px 22px 24px;
  }

  .onboarding h2 {
    padding-right: 28px;
    font-size: 29px;
  }

  .copy-toast {
    right: 14px;
    bottom: 14px;
    max-width: calc(100% - 28px);
  }

  footer {
    min-height: 170px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
  }

  footer p {
    margin: 0;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
