:root {
  --green: #2ad0b8;
  --green-dark: #16aa94;
  --green-soft: #ddf8f3;
  --green-pale: #f3fcfa;
  --ink: #173d3a;
  --text: #2f4543;
  --muted: #667976;
  --line: #d8ebe7;
  --paper: #fbfdfc;
  --shadow: 0 12px 34px rgb(17 84 75 / 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--paper); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.page-main { flex: 1; background: radial-gradient(circle at 8% 8%, rgb(42 208 184 / .08), transparent 24rem); }
.content-width, .site-header__inner, .site-footer__inner { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header { min-height: 82px; background: var(--green); border-bottom: 1px solid rgb(23 61 58 / .14); }
.site-header__inner { min-height: 82px; display: flex; align-items: center; gap: 34px; }
.site-brand-group { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.site-brand { color: var(--ink); font-size: 1.2rem; font-weight: 850; letter-spacing: -.035em; text-decoration: none; }
.site-badge { padding: 4px 9px; color: var(--green); background: var(--ink); border-radius: 999px; font-size: .62rem; font-weight: 850; letter-spacing: .08em; }
.site-nav { display: flex; align-items: center; gap: 25px; margin-right: auto; }
.site-nav a { position: relative; color: var(--ink); font-size: .84rem; font-weight: 650; text-decoration: none; }
.site-nav a::after { position: absolute; right: 0; bottom: -8px; left: 0; height: 3px; content: ""; background: var(--ink); border-radius: 99px; opacity: 0; transform: scaleX(.4); transition: .16s ease; }
.site-nav a:hover::after { opacity: 1; transform: scaleX(1); }

.dictionary-page { padding: 28px 0 84px; }
.word-hero { position: relative; min-height: 390px; overflow: hidden; padding: 54px 64px 46px; background: linear-gradient(125deg, #effaf7, #f9fdfb 62%, #eaf8f3); border: 1px solid #d7ebe3; border-radius: 28px; }
.word-hero__watermark { position: absolute; right: 34px; bottom: -74px; color: rgb(22 170 148 / .07); font-family: STKaiti, KaiTi, serif; font-size: 23rem; font-weight: 800; line-height: 1; pointer-events: none; }
.word-hero__content { position: relative; z-index: 1; }
.eyebrow { display: flex; align-items: center; gap: 13px; color: #168f7d; font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.eyebrow strong { padding: 7px 10px; background: var(--green-soft); border-radius: 8px; }
.word-title { display: flex; align-items: baseline; gap: 22px; margin: 22px 0 0; }
.word-title h1 { margin: 0; color: #123f32; font-family: STKaiti, KaiTi, "Noto Serif SC", serif; font-size: clamp(5rem, 10vw, 7.5rem); font-weight: 700; line-height: 1; letter-spacing: -.07em; }
.traditional { color: #5b746c; font-family: STKaiti, KaiTi, serif; font-size: 2rem; }
.pronunciation { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.pinyin { color: #168f7d; font-size: 1.65rem; font-weight: 750; }
.level { padding: 5px 9px; color: #397367; border: 1px solid #a9dfd4; border-radius: 7px; font-size: .72rem; font-weight: 800; }
.summary { max-width: 670px; margin: 22px 0 0; color: #526a64; font-size: 1rem; line-height: 1.75; }
.facts { display: flex; flex-wrap: wrap; gap: 34px; margin-top: 26px; }
.facts div { display: flex; align-items: baseline; gap: 7px; }
.facts span { color: #71847f; font-size: .72rem; font-weight: 650; letter-spacing: .03em; }
.facts strong { color: var(--ink); font-size: 1.15rem; }

.word-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; margin-top: 62px; }
.section-heading { display: flex; gap: 16px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.section-number { display: grid; width: 44px; height: 44px; place-items: center; flex: 0 0 auto; color: var(--green-dark); background: var(--green-soft); border-radius: 50%; font-size: .82rem; font-weight: 800; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 1.55rem; letter-spacing: -.025em; }
.section-heading p { margin: 3px 0 0; color: #7c918e; font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.pos-block { padding: 34px 0 40px; border-bottom: 1px solid var(--line); }
.pos-heading { display: flex; gap: 13px; align-items: center; margin: 0 0 24px; }
.pos-number { display: grid; width: 36px; height: 36px; place-items: center; color: #fff; background: var(--green-dark); border-radius: 10px; font-size: .9rem; }
.pos-heading h3 { margin: 0; color: var(--ink); font-size: 1.15rem; text-transform: capitalize; }
.pos-code { margin-left: 8px; color: #82948f; font-size: .76rem; font-weight: 700; }
.sense-list { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; counter-reset: senses; }
.sense-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); counter-increment: senses; }
.definition { display: grid; grid-template-columns: 34px 1fr; padding: 24px 26px; }
.definition::before { content: counter(senses) "."; color: var(--green-dark); font-weight: 800; }
.definition-zh { margin: 0 0 7px; color: #536b65; font-size: .94rem; }
.meaning { margin: 0; color: var(--ink); font-size: 1.25rem; font-weight: 750; }
.language { margin-right: 9px; color: #81938e; font-size: .64rem; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.examples { margin: 0; padding: 5px 26px 23px 60px; list-style: none; }
.example { display: grid; grid-template-columns: 31px 1fr; gap: 10px; padding: 17px 0; border-top: 1px dashed #dce9e6; }
.example-mark { display: grid; width: 28px; height: 28px; place-items: center; color: #168f7d; background: var(--green-pale); border-radius: 50%; font-size: .65rem; font-weight: 800; }
.example blockquote { margin: 1px 0 4px; color: #283f3a; font-size: 1.04rem; font-weight: 650; }
.example-pinyin { margin-bottom: 4px; color: #4f8277; font-size: .78rem; }
.example p { margin: 0; color: var(--muted); font-size: .91rem; }
.word-aside { position: sticky; top: 24px; display: grid; gap: 18px; }
.entry-card { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 17px; }
.entry-card h2 { margin: 0 0 17px; padding-bottom: 15px; color: var(--ink); border-bottom: 1px solid var(--line); font-size: 1rem; }
.entry-card dl { margin: 0; }
.entry-card dl div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; }
.entry-card dt { color: #81918d; font-size: .78rem; }
.entry-card dd { margin: 0; color: #344b46; font-size: .86rem; font-weight: 700; text-align: right; }
.entry-card .pinyin-value { color: #168f7d; }
.related-card { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 17px; }
.related-card h2 { margin: 0 0 10px; color: var(--ink); font-size: 1rem; }
.related-card__intro { margin: 0 0 15px; color: #81918d; font-size: .76rem; line-height: 1.5; }
.related-list { display: grid; gap: 0; margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.related-list li { border-bottom: 1px solid #e8f1ef; }
.related-list li:last-child { border-bottom: 0; }
.related-list a { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 12px 2px; text-decoration: none; }
.related-list a:hover .related-list__word { color: var(--green-dark); }
.related-list__word { color: var(--ink); font-family: STKaiti, KaiTi, "Noto Serif SC", serif; font-size: 1.15rem; font-weight: 700; transition: color .16s ease; }
.related-list__meta { color: #758985; font-size: .74rem; text-align: right; }
.related-list__arrow { margin-left: 4px; color: var(--green-dark); font-size: .86rem; }

.site-footer { color: #fff; background: var(--ink); border-top: 6px solid var(--green); }
.site-footer__cta { display: grid; justify-items: center; padding: clamp(48px, 7vw, 76px) 20px; text-align: center; border-bottom: 1px solid rgb(255 255 255 / .14); }
.site-footer__cta h2 { margin: 0; color: #fff; font-size: clamp(2rem, 4vw, 3.35rem); letter-spacing: -.04em; }
.site-footer__cta p { margin: 13px 0 24px; color: rgb(255 255 255 / .58); }
.site-footer__bar { min-height: 112px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 30px; }
.site-footer__brand { color: #fff; font-size: 1.1rem; font-weight: 800; text-decoration: none; }
.site-footer nav { display: flex; gap: 25px; }
.site-footer nav a { color: rgb(255 255 255 / .76); font-size: .8rem; font-weight: 600; text-decoration: none; }
.site-footer__copyright { color: rgb(255 255 255 / .52); font-size: .72rem; text-align: right; }

/* Dictionary home and not-found pages */
.search-page { display: grid; min-height: min(720px, calc(100vh - 82px)); place-items: center; padding: 64px 0 86px; }
.search-hero { position: relative; width: 100%; overflow: hidden; padding: clamp(54px, 8vw, 92px); background: linear-gradient(125deg, #effaf7, #f9fdfb 62%, #eaf8f3); border: 1px solid #d7ebe3; border-radius: 28px; text-align: center; }
.search-hero::before { position: absolute; right: -20px; bottom: -145px; color: rgb(22 170 148 / .055); content: "词典"; font-family: STKaiti, KaiTi, serif; font-size: clamp(14rem, 34vw, 27rem); font-weight: 800; line-height: 1; pointer-events: none; }
.search-hero__content { position: relative; z-index: 1; width: min(720px, 100%); margin-inline: auto; }
.search-kicker { display: inline-flex; padding: 7px 11px; color: #168f7d; background: var(--green-soft); border-radius: 8px; font-size: .7rem; font-weight: 850; letter-spacing: .12em; }
.search-hero h1 { margin: 22px 0 12px; color: var(--ink); font-size: clamp(2.5rem, 6vw, 4.6rem); line-height: 1.06; letter-spacing: -.055em; }
.search-hero__lead { max-width: 610px; margin: 0 auto; color: var(--muted); font-size: clamp(1rem, 2vw, 1.16rem); line-height: 1.7; }
.dictionary-search { display: flex; gap: 10px; width: min(650px, 100%); margin: 34px auto 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.dictionary-search:focus-within { border-color: var(--green-dark); box-shadow: 0 0 0 4px rgb(42 208 184 / .14), var(--shadow); }
.dictionary-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dictionary-search input { min-width: 0; flex: 1; padding: 13px 15px; color: var(--ink); background: transparent; border: 0; outline: 0; font: inherit; font-size: 1.05rem; }
.dictionary-search input::placeholder { color: #92a39f; }
.dictionary-search button { min-width: 112px; padding: 12px 22px; color: #fff; background: var(--ink); border: 0; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 750; transition: background .16s ease, transform .16s ease; }
.dictionary-search button:hover { background: #0e554e; transform: translateY(-1px); }
.dictionary-search button:focus-visible { outline: 3px solid rgb(42 208 184 / .45); outline-offset: 2px; }
.search-hint { margin: 18px 0 0; color: #78908b; font-size: .82rem; }
.search-samples { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 22px; }
.search-samples a { padding: 7px 12px; color: #276e63; background: rgb(255 255 255 / .75); border: 1px solid #cfe9e3; border-radius: 999px; font-size: .84rem; font-weight: 650; text-decoration: none; }
.search-samples a:hover { background: #fff; border-color: #9bd8cc; }
.not-found-code { margin: 0; color: var(--green-dark); font-size: .78rem; font-weight: 850; letter-spacing: .14em; }
.not-found-page .search-hero h1 { font-size: clamp(2.25rem, 5vw, 4rem); }

@media (max-width: 850px) {
  .word-hero { padding: 44px 36px; }
  .word-layout { grid-template-columns: 1fr; gap: 35px; }
  .word-aside { position: static; }
}
@media (max-width: 760px) {
  .site-header, .site-header__inner { min-height: 68px; }
  .site-header__inner { gap: 12px; }
  .site-brand { font-size: 1.05rem; }
  .site-badge { font-size: .52rem; }
  .site-nav { display: none; }
  .site-footer__bar { grid-template-columns: 1fr; align-items: start; padding: 32px 0; gap: 20px; }
  .site-footer nav { flex-wrap: wrap; }
  .site-footer__copyright { text-align: left; }
}
@media (max-width: 560px) {
  .content-width, .site-header__inner, .site-footer__inner { width: min(100% - 24px, 1180px); }
  .dictionary-page { padding-top: 16px; }
  .word-hero { min-height: 350px; padding: 36px 24px; border-radius: 20px; }
  .word-hero__watermark { right: -30px; font-size: 16rem; }
  .word-title h1 { font-size: 4.8rem; }
  .summary { font-size: .9rem; }
  .word-layout { margin-top: 42px; }
  .definition { padding: 21px 18px; }
  .examples { padding: 4px 18px 18px; }
  .site-footer__cta { padding-right: 0; padding-left: 0; }
  .search-page { padding: 24px 0 52px; }
  .search-hero { padding: 48px 20px; border-radius: 20px; }
  .dictionary-search { display: grid; }
  .dictionary-search button { width: 100%; }
}
