@font-face {
  font-family: 'WordMemory Brand Display';
  src: url('assets/fonts/word-memory-brand-display-bold.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'HarmonyOS Sans SC';
  src: url('assets/fonts/harmonyos-sans-sc-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'WordMemory Header Kai';
  src: url('assets/fonts/word-memory-header-kai.woff2?v=20261026-floating-slogan') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'WordMemory Detail Serif';
  src: url('assets/fonts/word-memory-detail-serif-regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'WordMemory Detail Serif';
  src: url('assets/fonts/word-memory-detail-serif-bold.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  --brand: #246e6b;
  --brand-dark: #195b59;
  --brand-soft: #e9f2ed;
  --ink: #303d37;
  --muted: #607064;
  --line: #e8e8dd;
  --paper: #f8f7f1;
  --surface: #fffefa;
  --sidebar: #eef3e9;
  --section-title: #246e6b;
  --section-title-bg: #dcebe1;
  --section-body: #f0f5ec;
  --section-body-ink: #384e42;
  --section-body-line: #dbe6d6;
  --sans: 'HarmonyOS Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
* { box-sizing: border-box; letter-spacing: 0 !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.8 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { transition: background .15s, border-color .15s; }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 3px; }
[hidden] { display: none !important; }
.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; }
.icon { width: 17px; height: 17px; display: block; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.skip-link { position: fixed; top: -80px; left: 15px; z-index: 50; background: white; padding: 10px; color: var(--brand); }
.skip-link:focus { top: 10px; }
.masthead { background: white; border-top: 4px solid var(--brand); border-bottom: 1px solid #d5e2d3;  box-shadow: 0 3px 18px #303d3710; }
.masthead-inner { max-width: 1440px; margin: auto; min-height: 94px; padding: 18px 36px; display: flex; gap: 26px; align-items: center; }
.brand-lockup { display: flex; align-items: center; gap: 23px; min-width: 0; flex-shrink: 0; }
.brand-logo { width: 178px; height: auto; display: block; margin-left: auto; flex-shrink: 0; }
.brand-product { padding-left: 0; }
.brand-product strong { font-size: 23px; line-height: 1.3; display: block; font-weight: 700;  color: var(--brand-dark); }
.brand-motto { margin: 8px 0 0; color: #e1eee3; font: 500 17px/1.65 'WordMemory Header Kai',serif; font-synthesis: none; }
.brand-motto > span { display: block; white-space: nowrap; }
.header-intro { flex: 1; min-width: 0; padding: 0 8px; text-align: center; }
.header-intro p { margin: 0; }
.header-tagline { color: var(--brand-dark); font-family: 'WordMemory Brand Display',var(--sans); font-size: clamp(24px,2.8vw,38px); font-weight: 700; line-height: 1.5; text-wrap: balance; }
.header-tagline > span { display: inline-block; letter-spacing: .04em !important; transform: skewX(-8deg); -webkit-text-stroke: .3px currentColor; }
.header-title-break { display: none; }
@media (max-width:480px) { .header-title-break { display: block; } }
.header-intro .header-caption { margin-top: 10px; color: var(--muted); font-size: 17px; line-height: 1.6; }
@media (max-width:620px) {
  .masthead-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .brand-lockup { grid-column: 1; grid-row: 1; }
  .brand-logo { grid-column: 2; grid-row: 1; justify-self: end; }
  .header-intro { grid-column: 1 / -1; grid-row: 2; padding: 4px 0 0; }
  .header-tagline { font-size: 24px; }
  .header-intro .header-caption { font-size: 15px; }
}
.gallery-button { display: flex; align-items: center; gap: 9px; margin-left: auto; min-height: 39px; background: white; border: 1px solid #d5e2d3; padding: 8px 13px; border-radius: 6px; font-size: 12px; white-space: nowrap; }
.gallery-button:hover { background: #e9f2e5; }
.gallery-count { border-left: 1px solid var(--line); padding-left: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.workspace { max-width: 1440px; margin: auto; display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 24px; padding: 28px 30px; }
.sidebar { min-width: 0;    padding: 20px 17px; border: 1px solid #d5e2d3; border-radius: 12px; background: var(--sidebar); align-self: start; box-shadow: 0 8px 24px #303d3710; }
.study-modes { border: 0; margin: 0 0 20px; padding: 0 0 20px; border-bottom: 1px solid #a5bda9; min-width: 0; }
.study-modes legend { font-size: 17px; font-weight: 650; margin-bottom: 12px; padding: 0;  color: var(--brand-dark); }
.mode-options { display: grid; gap: 8px; }
.mode-option { display: grid; grid-template-columns: 15px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 44px; padding: 9px 10px; background: #fffefa; border: 1px solid #a5bda9; border-radius: 8px; cursor: pointer; font-size: 15px;  color: #303d37; }
.mode-option:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fffefa;  box-shadow: 0 4px 10px #246e6b24; }
.mode-option input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.mode-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.learning-status { color: var(--muted); font-size: 13px; white-space: nowrap; }
.learning-status[data-learned="true"] { color: #246e6b; }
.learn-button[aria-pressed="true"] .icon { fill: currentColor; }

.catalog>summary { display: flex; justify-content: space-between; align-items: center; font-size: 17px; font-weight: 650; list-style: none; cursor: pointer; gap: 8px;  color: var(--brand-dark); }
.catalog>summary::-webkit-details-marker { display: none; }
.count-badge { padding: 2px 7px; background: #e9f2e5; border-radius: 4px; color: #526c5d; font-size: 12px; font-weight: 400; white-space: nowrap;  border: 1px solid #d5e2d3; }
.sidebar-caption { font-size: 14px; color: var(--muted); margin: 6px 0 15px;  line-height: 1.65; }
.search-field { display: flex; align-items: center; gap: 8px; background: #fffefa; border: 1px solid #a5bda9; border-radius: 8px; padding: 9px; min-height: 42px; color: #526c5d; }
.search-field:focus-within { border-color: var(--brand); }
.search-field input { min-width: 0; width: 100%; border: 0; outline: none; background: transparent; font-size: 14px; }
.search-field button { background: none; border: 0; font-size: 20px; padding: 0; }
.filters { display: grid; gap: 12px; margin-top: 16px; }
.filter-field { display: grid; gap: 5px; }
.filter-field>label { font-size: 13px; color: var(--muted);  font-weight: 550; }
.filter-field select { width: 100%; min-width: 0; background: #fffefa; border: 1px solid #a5bda9; padding: 8px; border-radius: 8px; font-size: 14px; min-height: 44px;  color: #303d37; }
.word-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 18px; max-height: 330px; overflow-y: auto; padding: 2px 3px 3px 0; scrollbar-width: thin; scrollbar-color: #d5e2d3 transparent; }
.word-item { position: relative; min-height: 39px; padding: 7px 3px; background: white; border: 1px solid #d5e2d3; border-radius: 5px; font-size: 12px; overflow-wrap: anywhere; }
.word-item:hover { border-color: #a5bda9; background: #fffefa; }
.word-item[aria-current="true"] { background: var(--brand); color: white; border-color: var(--brand); font-weight: 650; }
.word-item[data-learned="true"]::after { content: ''; width: 4px; height: 4px; position: absolute; right: 5px; top: 5px; background: #246e6b; border-radius: 50%; }
.word-item[aria-current="true"][data-learned="true"]::after { background: white; }
.sidebar-progress { margin-top: 22px; padding-top: 17px; border-top: 1px solid #a5bda9; }
.progress-label { display: flex; align-items: center; gap: 8px; font-size: 14px;  color: var(--brand-dark); }
.progress-label strong { font-weight: 500; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); display: inline-block; flex-shrink: 0; }
.sidebar-progress .status-dot { background: var(--brand); }
.muted { color: var(--muted); }
.progress-track { height: 5px; background: #d5e2d3; border-radius: 2px; margin-top: 12px; overflow: hidden; }
.progress-track>span { height: 100%; display: block; background: var(--brand); }
.sidebar-progress p, .sidebar-footnote, .list-empty { color: #607064; font-size: 12px; }
.text-button { border: 0; background: none; color: var(--brand); padding: 0; font-size: 14px; }
.text-button:hover { text-decoration: underline; }
.methods-link { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.sidebar-footnote { margin-top: 25px; display: flex; gap: 8px; }
.sidebar-footnote .icon { width: 14px; margin-top: 3px; }
.study-area { min-width: 0; }
.study-toolbar { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-bottom: 20px; min-height: 38px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #526c5d; white-space: nowrap; }
.breadcrumb strong { font-weight: 500; color: var(--brand-dark); }
.tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.tool-button { display: flex; align-items: center; gap: 6px; border: 1px solid #d5e2d3; border-radius: 7px; background: #fffefa; padding: 7px 9px; font-size: 13px; min-height: 35px; white-space: nowrap;  color: #526c5d; }
.tool-button .icon { width: 14px; height: 14px; }
.tool-button:hover { background: #e9f2e5; }
.tool-button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); border-color: #d5e2d3; }
.speed-field { display: flex; align-items: center; gap: 5px; color: #607064; font-size: 13px; }
.speed-field select { min-height: 35px; padding: 6px 3px; border: 1px solid #d5e2d3; border-radius: 5px; background: #fffefa; font-size: 13px;  color: #526c5d; }
.word-card { background: var(--surface); border: 1px solid #d5e2d3; border-top: 0; overflow: hidden;  border-radius: 12px; box-shadow: 0 12px 34px #303d3710; }
.card-heading { padding: 13px 24px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #246e6b; font-size: 13px; color: #e9f2e5;  background: var(--brand); }
.card-heading>div, .collection-label { display: flex; align-items: center; gap: 9px; }
.sequence { color: #e9f2e5; font-size: 12px; font-variant-numeric: tabular-nums; }
.collection-label { font-size: 12px; }
.collection-label .icon { width: 13px; height: 13px; }
.card-content { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: 24px; padding: 36px 20px 24px; }
.word-content { min-width: 0; }
.word-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-height: 24px; }
.method-chip { color: #246e6b; background: #d5e2d3; padding: 3px 8px; border-radius: 5px; font-size: 12px;  line-height: 1.4; }
.memory-method-control { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.memory-method-select { width: auto; max-width: 100%; min-height: 32px; padding: 4px 8px; border: 1px solid #b4cfc4; border-radius: 6px; background: #e5eee2; color: #246e6b; font: inherit; font-size: 13px; cursor: pointer; }
.memory-method-select:focus-visible { outline: 2px solid #246e6b; outline-offset: 2px; }
.memory-method-count { flex-shrink: 0; color: #657872; font-size: 12px; white-space: nowrap; }

.word-length { color: var(--muted); font-size: 13px; }
/* Shared reading palette and spacing for every word-detail section. */
.word-heading { display: flex; align-items: center; gap: 12px; margin: 6px 0 28px; min-width: 0; }
h1 { font: 700 clamp(30px,3.75vw,54px)/1.15 var(--sans); margin: 0; color: #303d37; white-space: nowrap; }
h1[data-long="true"] { font-size: clamp(26px,3.1vw,46px); }
.pronunciation { position: relative; display: flex; align-items: center; flex-shrink: 0; gap: 6px; }
.audio-button { display: flex; align-items: center; gap: 4px; padding: 5px 7px; border: 1px solid #d5e2d3; background: #e9f2e5; border-radius: 6px; font-size: 12px; min-height: 30px; color: #246e6b; line-height: 1.4; white-space: nowrap; }
.audio-button:hover, .audio-button.is-speaking { border-color: #607064; background: #d5e2d3; color: var(--brand); }
.audio-button .icon { color: var(--brand); width: 12px; height: 12px; }
.stop-audio { position: absolute; top: calc(100% + 2px); right: 0; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; line-height: 1.2; white-space: nowrap; text-decoration: underline; }
.audio-notice { font-size: 13px; color: var(--muted); margin: 0 0 18px; }
.definition-section, .cue-section, .memory-note, .example-section { padding: 0; border: 0; }
.definition-section, .memory-content { margin-bottom: 20px; }
.memory-content { display: grid; gap: 20px; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-label h2, .small-heading, .note-heading h2 { display: inline-flex; align-items: center; margin: 0; padding: 2px 7px; border-radius: 4px; color: var(--section-title); background: var(--section-title-bg); font-size: 14px; font-weight: 700; line-height: 1.4; }
.small-heading { display: flex; width: fit-content; }
.definition, .section-content, .cue-sentence { margin: 7px 0 0; padding: 6px 10px; border: 1px solid var(--section-body-line); border-radius: 8px; background: var(--section-body); color: var(--section-body-ink); }
.definition { display: grid; gap: 5px; min-width: 0; line-height: 1.65; }
.definition-row { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: start; gap: 8px; }
.definition-pos { color: var(--section-title); font-size: 13px; font-weight: 650; white-space: nowrap; line-height: 1.65; background: var(--section-title-bg); padding: 1px 3px; border-radius: 4px; text-align: center; align-self: start; }
.definition-meaning { font-size: 16.5px; font-weight: 400; overflow-wrap: anywhere; line-height: 1.65; color: var(--section-body-ink); }
.definition-meaning .definition-current { background: #d4eadd; color: #195b59; font-weight: 700; border-radius: 3px; padding: 1px 2px; box-shadow: inset 0 -2px 0 #246e6b; }
.definition-row[data-note="true"] { grid-template-columns: 1fr; padding-left: 42px; }
.definition-row[data-note="true"] .definition-meaning { font-size: 15px; }
.page-footnote a { color: inherit; text-underline-offset: 3px; }
.reveal-answer { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #a5bda9; background: #fffefa; color: var(--brand); border-radius: 5px; padding: 10px; margin-top: 10px; font-size: 15px; }
.cue-parts { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: 7px; }
.cue-part { flex: 1; min-width: 80px; max-width: 100%; background: var(--section-body); border: 1px solid var(--section-body-line); border-radius: 7px; overflow: hidden; text-align: center; }
.cue-part strong { display: block; background: var(--section-title-bg); color: var(--section-title); font-size: 20px; line-height: 1.3; padding: 3px 8px; overflow-wrap: anywhere; }
.cue-part>span { display: block; padding: 5px; font-size: 13px; line-height: 1.4; color: var(--section-body-ink); }
.cue-plus { align-self: center; color: var(--section-body-ink); }
.cue-sentence { display: block; width: 100%; margin: 0; font-size: 17px; line-height: 1.65; }
.cue-sentence mark { color: var(--section-title); background: var(--section-title-bg); padding: 1px 3px; }
.note-heading { display: flex; align-items: center; gap: 7px; color: var(--section-title); }
.note-heading .icon { width: 13px; height: 13px; }
.memory-body>p { font-size: 16px; line-height: 1.7; margin: 0; }
.memory-body .memory-boundary { font-size: 13px; line-height: 1.6; margin-top: 5px; }
.memory-boundary:empty { display: none; }
.example-section { margin-top: 0; }
.example-en { font-size: 17px; line-height: 1.65; color: var(--section-body-ink); margin: 0 0 3px; }
.example-en mark, .example-zh mark { background: transparent; color: #b52e2e; font-weight: 700; }
.example-zh { font-size: 16px; line-height: 1.65; color: var(--section-body-ink); margin: 0; }
.visual-column { min-width: 0; align-self: start; }
.word-visual { aspect-ratio: 1; margin: 0; position: relative; background: #d5e2d3; border-radius: 10px; overflow: hidden;  border: 1px solid #d5e2d3; box-shadow: 0 4px 16px #303d3710; }
.image-button { display: block; position: relative; width: 100%; height: 100%; border: 0; background: none; padding: 0; }
.image-button>img { display: block; width: 100%; height: 100%; object-fit: cover; }
.image-caption { display: none; }
.expand-image { position: absolute; right: 12px; bottom: 12px; padding: 7px; background: #e9f2e5f2; border: 1px solid #d5e2d3; border-radius: 7px; color: #246e6b; }
.visual-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 10px; font-size: 13px; color: #607064; }
.visual-footer>span { display: flex; gap: 5px; align-items: center; }
.visual-footer .icon { width: 12px; height: 12px; }
.image-cover { position: absolute; inset: 0; width: 100%; border: 0; background: #d5e2d3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #526c5d; }
.image-cover>.icon { width: 38px; height: 38px; }
.image-cover>strong { font-weight: 500; font-size: 18px; }
.image-cover>span { font-size: 14px; }
.study-navigation { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }
.navigation-button, .learn-button, .primary-button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 9px 14px; border: 1px solid #a5bda9; border-radius: 8px; background: #fffefa; font-size: 14px; white-space: nowrap;  color: #526c5d; }
.navigation-button:hover, .learn-button:hover { background: #d5e2d3;  border-color: #a5bda9; }
.navigation-center { display: grid; gap: 2px; text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.keyboard-hint { font-size: 12px; color: #607064; }
.navigation-actions { display: flex; align-items: center; gap: 9px; }
.learn-button[aria-pressed="true"] { color: var(--brand); background: #d5e2d3; border-color: #a5bda9; }
.primary-button { background: var(--brand); color: #fffefa; border-color: var(--brand);  box-shadow: 0 4px 10px #246e6b22; }
.primary-button:hover { background: var(--brand-dark); }
.next-button { gap: 23px; }
.page-footnote { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: #526c5d; margin: 18px 0 0; }
.study-empty { min-height: 450px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.study-empty>.icon { width: 38px; height: 38px; color: #607064; }
.study-empty h2 { font-size: 23px; }
.study-empty p { font-size: 16px; color: var(--muted); }
dialog { padding: 0; border: 1px solid #a5bda9; border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 70px #303d3738; max-height: 90dvh; }
dialog::backdrop { background: #303d37a3; }
body:has(dialog[open]) { overflow: hidden; }
.gallery-dialog { width: min(1080px,94vw); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; padding: 22px 24px; border-bottom: 1px solid #d5e2d3; background: #e9f2e5; position: sticky; top: 0; z-index: 2; }
.eyebrow { font-size: 9px; color: var(--muted); }
.dialog-heading h2 { font-size: 23px; margin: 3px 0 0; }
.dialog-heading h2>span { color: var(--brand); background: var(--brand-soft); font-size: 12px; padding: 2px 7px; border-radius: 4px; }
.dialog-heading p { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.close-dialog { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; font-size: 24px; border: 1px solid #a5bda9; border-radius: 6px; background: #fffefa;  color: var(--brand-dark); }
.close-dialog:hover { background: #d5e2d3; }
.gallery-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; padding: 22px; }
.gallery-item { border: 1px solid var(--line); border-radius: 6px; background: white; padding: 0; overflow: hidden; text-align: left; }
.gallery-item:hover { border-color: #a5bda9; }
.gallery-item img { display: block; width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; }
.gallery-item>div { padding: 9px 11px; }
.gallery-item strong { font-size: 18px; overflow-wrap: anywhere; }
.gallery-item span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.image-dialog { width: min(800px,94vw); overflow: hidden; }
.image-dialog-heading { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; font-size: 23px; font-weight: 600; }
.image-dialog>img { display: block; width: 100%; height: auto; max-height: calc(90dvh - 60px); object-fit: contain; }
.methods-dialog { width: min(650px,94vw); }
.methods-list { padding: 0 24px 20px; }
.method-row { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 15px; padding: 17px 0; border-bottom: 1px solid #dbe6d6; }
.method-row:last-child { border: 0; }
.method-row h3 { font-size: 16px; color: var(--brand); margin: 0; }
.method-row p { font-size: 15px; color: #526c5d; margin: 0; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); max-width: 90vw; background: #195b59; color: #fffefa; padding: 10px 18px; border-radius: 6px; z-index: 50; font-size: 14px;  box-shadow: 0 6px 18px #303d3730; }
@media (min-width:1550px) { .masthead-inner, .workspace { max-width: 1510px; } .card-content { gap: 40px; padding: 42px 30px 30px; } }
@media (max-width:1150px) { .workspace { grid-template-columns: 190px minmax(0,1fr); gap: 24px; padding: 24px; } .sidebar { padding-right: 16px; } .card-content { gap: 20px; padding: 34px 22px 22px; } .study-toolbar { flex-wrap: wrap; } .collection-label { display: none; } }
@media (max-width:950px) { .card-content { grid-template-columns: 1fr; } .word-content { display: contents; } .word-meta { grid-row: 1; } h1 { grid-row: 2; margin: 4px 0 8px; } .pronunciation { grid-row: 3; margin: 0 0 14px; } .audio-notice { grid-row: 4; } .visual-column { grid-row: 5; margin-bottom: 5px; } .definition-section { grid-row: 6; } .memory-content { grid-row: 7; } .example-section { grid-row: 8; } .keyboard-hint { display: none; } .page-footnote>span { display: none; } .gallery-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width:620px) { .masthead-inner { min-height: 78px; padding: 13px 16px; gap: 10px; } .brand-lockup { gap: 12px; } .brand-logo { width: 111px; } .brand-product { padding-left: 0; } .brand-product strong { font-size: 18px; white-space: nowrap; } .brand-motto { font-size: 14px; margin-top: 6px; } .gallery-button { padding: 7px 9px; font-size: 11px; min-height: 36px; } .gallery-count { display: none; } .gallery-button>.icon { width: 14px; } .workspace { display: block; padding: 20px 16px; } .sidebar { border: 0; border-bottom: 1px solid var(--line); padding: 0 0 18px; margin-bottom: 17px; } .catalog>summary { font-size: 16px; } .catalog>summary::after { content: '展开 / 收起'; font-weight: 400; font-size: 10px; color: var(--muted); margin-left: auto; } .sidebar-caption { margin: 4px 0 12px; } .filters { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 12px; } .word-list { grid-template-columns: repeat(3,minmax(0,1fr)); max-height: 132px; margin-top: 12px; } .word-item { min-height: 38px; } .sidebar-progress { border: 0; margin-top: 12px; padding: 0; } .sidebar-progress p, .progress-track, .methods-link, .sidebar-footnote { display: none; } .progress-label { font-size: 13px; } .study-toolbar { margin-bottom: 14px; gap: 12px; } .tools { justify-content: flex-start; width: 100%; gap: 6px; } .tool-button { padding: 6px 8px; font-size: 12px; } .tool-button .icon { display: none; } .speed-field { font-size: 12px; margin-left: auto; } .speed-field select { font-size: 12px; } .card-heading { padding: 12px 16px; font-size: 12px; } .card-heading>div { gap: 7px; } .card-content { padding: 30px 16px 18px; row-gap: 0; } h1 { font-size: 51px; margin: 8px 0 12px; } h1[data-long="true"] { font-size: 42px; } .word-meta { margin-bottom: 3px; } .pronunciation { margin-bottom: 18px; } .visual-column { margin-bottom: 18px; }  .memory-note>p { font-size: 17px; }  .study-navigation { position: sticky; bottom: 0; background: #f8f7f1f5; padding: 12px 0 5px; z-index: 3; gap: 6px; } .navigation-button, .learn-button, .primary-button { font-size: 13px; padding: 9px; min-height: 42px; gap: 6px; } .learn-button .icon { width: 12px; } .navigation-center { font-size: 12px; } .gallery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 15px; gap: 11px; } .dialog-heading { padding: 16px; } .dialog-heading h2 { font-size: 20px; } .method-row { grid-template-columns: 87px minmax(0,1fr); gap: 10px; } .methods-list { padding: 0 17px 15px; } }
@media (prefers-reduced-motion:reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (max-width:620px) { .study-navigation { position: static; background: transparent; padding-top: 16px; } }

@media (max-width:620px) {
  .study-modes { margin-bottom: 18px; padding-bottom: 18px; }
  .study-modes legend { font-size: 16px; }
  .mode-options { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
  .mode-option { grid-template-columns: 14px minmax(0,1fr); gap: 5px 6px; padding: 10px 8px; font-size: 13px; }
  .mode-option>span:not(.mode-count) { grid-column: 1 / -1; grid-row: 1; white-space: nowrap; text-align: center; }
  .mode-option input { grid-column: 1; grid-row: 2; }
  .mode-option input { width: 14px; height: 14px; }
  .mode-count { grid-column: 2; font-size: 12px; }
  .filters .filter-field:last-child { grid-column: 1 / -1; }
  .catalog-body { padding-top: 10px; }
  .learning-status { font-size: 12px; }
}

@media (max-width:620px) {
  .definition-meaning { font-size: 17px; }
  .definition-pos { font-size: 14px; }
  .cue-sentence { font-size: 17px; }
  .example-en { font-size: 18px; }
  .example-zh { font-size: 16px; }
  .page-footnote { font-size: 12px; }
}

@media (min-width:951px) {
  .card-content { row-gap: 0; align-items: stretch; }
  .visual-column { display: contents; }
  .word-visual { grid-column: 2; grid-row: 1; width: 100%; }
  .visual-footer { grid-column: 2; grid-row: 2; }
  .word-content { grid-column: 1; grid-row: 1; position: relative; min-height: 0; }
  .word-details { position: absolute; inset: 0; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; padding-right: 6px; scrollbar-width: thin; scrollbar-color: #607064 #e9f2e5; }
  .word-details>* { flex-shrink: 0; }
  .word-details:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 3px; }
}
@media (max-width:950px) {
  .word-details { display: contents; }
  .example-section { margin-top: 0; }
}

/* Brand hierarchy shared by the desktop and mobile layouts. */
.mode-option:hover { border-color: #607064; background: #e9f2e5; }
.mode-option:has(input:checked):hover { background: var(--brand-dark); }
.mode-option:has(input:checked) .mode-count { color: #e9f2e5; }
.mode-option:has(input:checked) input { accent-color: #e9f2e5; }
.mode-option:focus-within { outline: 2px solid var(--brand-dark); outline-offset: 2px; }
.card-heading .status-dot { background: #c3d9ce; }
.tool-button[aria-pressed="true"] { color: #246e6b; border-color: #a5bda9; background: #d5e2d3; }
@media (max-width:1150px) {
  .sidebar { padding: 18px 13px; }
}
@media (max-width:620px) {
  .sidebar { padding: 16px; border: 1px solid #d5e2d3; border-radius: 12px; background: var(--sidebar); }
  .mode-options { gap: 6px; }
  .mode-option { padding: 9px 6px; font-size: 13px; }
  .mode-option>span:not(.mode-count) { white-space: normal; }
  .study-navigation { background: transparent; }
  .definition { gap: 6px; }
  .definition-meaning { font-size: 17px; }
}

@media (max-width:950px) {
  .card-content { row-gap: 0; }
  .word-meta, .word-heading, .audio-notice, .visual-column, .definition-section, .memory-content, .example-section { grid-row: auto; }
  .word-meta { order: 1; }
  .word-heading { order: 2; }
  .word-heading h1 { margin: 0; }
  .word-heading .pronunciation { margin: 0; }
  .audio-notice { order: 3; }
  .visual-column { order: 4; margin-bottom: 22px; }
  .definition-section { order: 5; }
  .memory-content { order: 6; }
  .example-section { order: 7; margin-top: 0; }
}
@media (max-width:620px) {
  .word-heading { gap: 10px; }
  .word-heading h1 { font-size: clamp(30px,9.2vw,44px); }
  .word-heading h1[data-long="true"] { font-size: clamp(26px,7.8vw,34px); }
  .pronunciation { gap: 4px; }
  .audio-button { font-size: 11px; padding: 4px 6px; min-height: 32px; gap: 3px; }
  .audio-button .icon { width: 11px; height: 11px; }
}

@media (min-width:951px) and (max-width:1024px) {
  .word-heading h1 { font-size: 32px; }
  .word-heading h1[data-long="true"] { font-size: 28px; }
}

/* Keep the original teal masthead and ivory logo treatment. */
.masthead { background: #246e6b; color: #f8faf2; border-top: 0; border-bottom: 1px solid #205f5c; box-shadow: none; }
.masthead-inner { min-height: 130px; padding-top: 24px; padding-bottom: 24px; }
.brand-product strong, .header-tagline { color: #f8faf2; }
.brand-motto, .header-intro .header-caption { color: #e1eee3; }
.brand-logo { padding: 8px 12px; background: #f8f8ed; border-radius: 8px; }
.sidebar { background: #eef3e9; border-color: #dbe6d6; }
.word-card { background: #fffefa; }
@media (max-width:620px) {
  .masthead-inner { padding-top: 16px; padding-bottom: 16px; }
  .brand-logo { width: 136px; }
  .sidebar { background: #eef3e9; border-color: #dbe6d6; }
}

/* Serve the same serif glyphs to every client, including all four Chinese bodies. */
.word-details {
  --detail-serif: 'WordMemory Detail Serif',serif;
  --detail-sans: -apple-system,BlinkMacSystemFont,'PingFang SC','Noto Sans CJK SC','Microsoft YaHei',sans-serif;
  font-family: var(--detail-sans);
}
.word-heading h1, .definition-meaning, .cue-sentence, .cue-part strong, .example-en { font-family: var(--detail-serif); }
.memory-body, .example-zh, .cue-part>span { font-family: var(--detail-serif); }
.definition-pos { font-family: var(--detail-sans); }
.cue-part strong { font-weight: 400; }
.example-en { font-style: italic; }

@media (max-width:360px) {
  .word-heading .audio-button { padding-left: 3px; padding-right: 3px; }
}
@media (min-width:951px) and (max-width:1280px) {
  .word-heading { gap: 10px; }
  .word-heading .audio-button { padding-left: 3px; padding-right: 3px; }
}

.brand-signature { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 200px; margin-left: auto; padding: 8px 12px 10px; background: transparent; border-radius: 8px; }
.brand-signature .brand-logo { width: 100%; height: auto; aspect-ratio: 1834 / 528; object-fit: cover; object-position: center; margin-left: 0; padding: 0; background: transparent; border-radius: 0; }
.brand-tagline { margin: 6px 0 0; color: #eef6ee; font: 12px/1.6 var(--sans); white-space: nowrap; }
@media (max-width:620px) {
  .brand-signature { width: 164px; padding: 8px 8px 10px; grid-column: 2; grid-row: 1; justify-self: end; margin-left: 0; }
  .brand-tagline { font-size: 11px; }
}

.brand-product strong { font-size: 32px; }
@media (min-width:621px) and (max-width:900px) {
  .masthead-inner { gap: 18px; padding-left: 24px; padding-right: 24px; }
  .brand-product strong { font-size: 28px; }
}
@media (max-width:620px) {
  .brand-product strong { font-size: 26px; }
}

/* Account and sense controls share the existing green palette. */
.account-bar{max-width:1380px;margin:0 auto;padding:12px 30px 0;display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:13px;color:var(--muted)}
.account-bar p{margin:0}.account-bar nav{display:flex;gap:18px;white-space:nowrap}a{color:var(--brand-dark)}
.sense-navigation{display:flex;align-items:center;justify-content:center;gap:20px;margin:12px 0 0;font-size:13px}.sense-navigation button{border:1px solid #a5bda9;border-radius:50%;background:var(--surface);width:34px;height:34px}
.image-placeholder{position:absolute;top:45%;left:12%;right:12%;text-align:center;color:var(--muted);pointer-events:none}.visual-column{position:relative}.word-visual{background:#e9eee5}.word-visual:has(img[hidden]){min-height:250px}.image-button{min-height:100%}
.contact-logo{display:block;width:min(100%,260px);height:auto;margin:24px auto}.methods-dialog p{line-height:1.9}.methods-dialog .primary-button{display:inline-block;text-decoration:none}.methods-dialog .text-button{margin-left:18px}
.account-page{min-height:100vh;display:grid;place-items:center;padding:32px 20px}.account-panel{width:min(100%,470px);padding:36px;background:var(--surface);border:1px solid #d5e2d3;border-radius:16px;box-shadow:0 12px 40px #303d370c}.account-brand{font-size:30px;text-decoration:none;font-weight:700}.account-panel h1{font-size:25px;margin:28px 0 8px}.account-panel form p{margin:18px 0}.account-panel label{display:block;margin-bottom:7px}.account-panel input{width:100%;padding:11px 12px;border:1px solid #a5bda9;border-radius:6px;background:white}.account-panel .primary-button{display:inline-block;margin:12px 0;text-decoration:none}.account-panel .errorlist{color:#963e3e;padding-left:20px;font-size:14px}.account-panel .helptext{display:block;color:var(--muted);font-size:13px}.account-panel footer{border-top:1px solid var(--line);margin-top:28px;padding-top:20px}.account-panel details{font-size:14px;margin-top:24px}.account-panel dd{margin:0 0 16px}.word-card[aria-busy=true]{opacity:.55}.study-navigation{flex-wrap:wrap}
@media(max-width:620px){.account-bar{padding:12px 18px 0;align-items:flex-start}.account-bar p{max-width:66%}.account-panel{padding:26px}.sense-navigation{margin-top:10px}.image-placeholder{top:35%}}
@media(min-width:951px){.visual-bottom{grid-column:2;grid-row:2}.word-visual:has(img[hidden]){min-height:0}}
.skip-link:not(:focus){clip-path:inset(50%);width:1px;height:1px;overflow:hidden;padding:0}

/* Prefix lookup stays separate from the learning filters. */
.word-search { position: relative; }
.search-results-panel { margin-top: 7px; border: 1px solid #a5bda9; border-radius: 8px; background: #fffefa; overflow: hidden; }
.search-result-count { margin: 0; padding: 9px 11px; font-size: 12px; color: var(--muted); border-bottom: 1px solid #d5e2d3; }
.search-results { max-height: 244px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.search-option { display: block; width: 100%; min-height: 40px; padding: 9px 12px; border: 0; border-bottom: 1px solid #edf0e7; background: transparent; color: var(--brand-dark); font-size: 15px; text-align: left; overflow-wrap: anywhere; }
.search-option:last-child { border-bottom: 0; }
.search-option:hover, .search-option[aria-selected="true"] { background: #e9f2e5; color: #195b59; }
.search-option mark { background: transparent; color: inherit; font-weight: 750; }
.lookup-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 15px; padding: 11px 15px; background: #e9f2e5; border: 1px solid #d5e2d3; border-radius: 8px; color: var(--brand-dark); }
.lookup-banner>div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; }
.lookup-banner strong { font-size: 14px; }
.lookup-banner span { font-size: 12px; color: var(--muted); }
.lookup-banner .tool-button { flex-shrink: 0; }

body[data-search-mode="prefix"] #search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
