:root {
  --ink: #10243e;
  --navy: #172f50;
  --paper: #f3f0e9;
  --white: #fffdfa;
  --gold: #b88134;
  --gold-light: #f3e6ca;
  --line: #ddd5c8;
  --muted: #687688;
  --shadow: 0 18px 48px rgba(16, 36, 62, .09);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.8 "Microsoft YaHei", "PingFang SC", sans-serif; }
a { color: inherit; text-decoration: none; }
.site-header, main, .site-footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.site-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(221, 213, 200, .75); }
.brand { font-size: 21px; font-weight: 800; letter-spacing: .08em; }
.brand span { color: var(--gold); }
.site-header p, .site-footer span, .header-link { color: var(--muted); font-size: 14px; }
.header-link { padding-bottom: 2px; border-bottom: 1px solid var(--gold); }

.hero-search { position: relative; overflow: hidden; margin: 40px 0 64px; padding: clamp(52px, 8vw, 96px); color: #fff; background: linear-gradient(125deg, #0d2038, #244d77); }
.hero-search::after { position: absolute; right: -54px; bottom: -98px; width: 310px; height: 310px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; content: ""; }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .16em; }
.hero-search h1 { position: relative; z-index: 1; margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(20px, 4.5vw, 62px); line-height: 1.24; letter-spacing: .04em; white-space: nowrap; }
.hero-search > p:not(.eyebrow) { position: relative; z-index: 1; max-width: none; color: #dbe4ed; white-space: nowrap; }
#search-form { position: relative; z-index: 1; width: 100%; margin: 30px auto 0; }
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; min-width: 0; height: 56px; padding: 0 18px; border: 0; border-radius: 2px; color: var(--ink); font: inherit; }
.search-row button, button { min-height: 56px; border: 0; border-radius: 2px; padding: 0 24px; background: var(--gold); color: white; font: inherit; font-weight: 700; cursor: pointer; }
.partner-ads { display: flex; gap: 10px; margin-top: 18px; }
.partner-ads a { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid rgba(255,255,255,.52); color: #fff; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .18s; }
.partner-ads a:hover { background: rgba(255,255,255,.12); }
.dictionary-entry > [data-ad-slot] { padding: 0 clamp(28px, 5vw, 64px); background: var(--white); }
.dictionary-entry > [data-ad-slot] .partner-ads { margin: 0; padding: 24px 0; border-top: 1px solid var(--line); }
.dictionary-entry > [data-ad-slot] .partner-ads a { border-color: var(--line); color: var(--ink); background: #faf7f0; }

.idiom-library, .related-section { margin-bottom: 72px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 30px; letter-spacing: .04em; }
.section-heading > div:last-child { display: flex; align-items: center; gap: 14px; }
.idiom-count, .section-heading > span { color: var(--muted); font-size: 13px; }
.section-heading button { min-height: 40px; padding: 0 18px; border: 1px solid var(--line); background: transparent; color: var(--ink); }
.idiom-grid, .related-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.idiom-link { padding: 13px 16px; border: 1px solid var(--line); background: rgba(255,253,250,.78); text-align: center; transition: border-color .18s, color .18s, transform .18s; }
.idiom-link { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idiom-link:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.site-footer { display: flex; justify-content: space-between; padding: 28px 0 34px; border-top: 1px solid var(--line); }

.breadcrumb { margin: 28px 0 22px; color: var(--muted); font-size: 13px; }
.breadcrumb span { margin: 0 10px; color: var(--gold); }
.dictionary-entry { background: var(--white); box-shadow: var(--shadow); }
.entry-hero { position: relative; overflow: hidden; padding: clamp(38px, 6vw, 72px); color: #fff; background: linear-gradient(120deg, #10243e, #1d4770); }
.entry-hero::after { position: absolute; top: -100px; right: 7%; width: 230px; height: 230px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; content: ""; }
.entry-hero .eyebrow { position: relative; z-index: 1; color: #edc47f; }
.entry-hero h1 { position: relative; z-index: 1; margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(40px, 5vw, 62px); line-height: 1.18; letter-spacing: .1em; }
.pinyin { position: relative; z-index: 1; margin: 10px 0 6px; color: #d4dfeb; font-family: Georgia, serif; letter-spacing: .08em; }
.entry-lead { position: relative; z-index: 1; margin: 24px 0 0; color: #bfcddd; font-size: 14px; }
.definition-sheet { padding: clamp(28px, 5vw, 64px); }
.sheet-heading { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 15px; border-bottom: 2px solid var(--ink); }
.sheet-heading p { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 25px; font-weight: 700; }
.sheet-heading span { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.definition-sheet dl { margin: 0; }
.definition-row { display: grid; grid-template-columns: 144px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.definition-row dt { padding: 21px 24px; background: #faf7f0; color: var(--muted); font-size: 14px; font-weight: 700; }
.definition-row dd { min-width: 0; margin: 0; padding: 21px 28px; white-space: pre-wrap; overflow-wrap: anywhere; }
.definition-short dd { color: #253e5c; font-weight: 700; }
.definition-long dd { line-height: 1.95; }
.definition-tags dd { color: var(--gold); letter-spacing: .02em; }
.empty-value { color: #9aa3ae; font-weight: 400; }

@media (max-width: 640px) {
  .site-header, main, .site-footer { width: min(100% - 32px, 1180px); }
  .site-header { min-height: 68px; }
  .site-header p { display: none; }
  .hero-search { margin: 18px 0 48px; padding: 42px 24px; }
  .hero-search h1 { text-align: center; font-size: clamp(20px, 6vw, 26px); font-weight: 800; white-space: nowrap; text-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
  .hero-search > p:not(.eyebrow) { white-space: normal; }
  .search-row { display: block; }
  .search-row input, .search-row button { width: 100%; }
  .search-row button { margin-top: 10px; }
  .partner-ads { gap: 8px; }
  .partner-ads a { padding: 9px 8px; font-size: 13px; }
  .section-heading { align-items: center; }
  .section-heading h2 { font-size: 25px; }
  .idiom-count, .section-heading > span { display: none; }
  .idiom-grid, .related-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .idiom-link { padding: 11px 12px; font-size: 14px; }
  .breadcrumb { margin: 20px 0 14px; }
  .entry-hero { padding: 36px 24px; }
  .definition-sheet { padding: 24px 16px; }
  .definition-row { grid-template-columns: 1fr; }
  .definition-row dt { padding: 12px 16px 3px; background: transparent; }
  .definition-row dd { padding: 3px 16px 17px; }
  .site-footer { display: block; text-align: center; }
  .site-footer span { display: block; margin-top: 5px; }
}
