:root {
  --ink: #19221d;
  --muted: #667169;
  --paper: #f5f1e8;
  --card: #fffdf8;
  --green: #235c45;
  --green-dark: #184330;
  --line: #ded9ce;
  --gold: #d29b45;
  font-family: Inter, "Noto Sans Thai", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 12px; overflow-x: hidden; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 5%, #e4eadf 0, transparent 28%), var(--paper); overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
#reviewSection, #addSection, #librarySection, #searchArea { scroll-margin-top: 12px; }
.page { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 80px; }
header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
h1 { font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(32px, 6vw, 58px); line-height: 1.05; margin: 0; }
h2 { margin: 0; font-size: 24px; }
.title-count { display: inline-grid; place-items: center; min-width: 34px; padding: 2px 9px; margin-left: 6px; border-radius: 999px; background: #e7efe9; color: var(--green); font-size: 14px; vertical-align: middle; }
.subtitle { color: var(--muted); margin: 12px 0 0; }
.counter { border-left: 1px solid var(--line); padding-left: 24px; display: grid; }
.counter strong { font: 40px Georgia, serif; color: var(--green); }
.counter span { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stats div { display: grid; gap: 4px; padding: 14px 18px; background: rgba(255,253,248,.8); border: 1px solid var(--line); border-radius: 12px; }
.stats strong { color: var(--green); font: 25px Georgia, serif; }
.stats span { color: var(--muted); font-size: 12px; }
.card, .home-card { background: rgba(255,253,248,.92); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 34px rgba(37,54,43,.06); padding: 24px; }
.learning-home { display: grid; gap: 16px; margin-bottom: 18px; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.review-card { background: linear-gradient(135deg, rgba(255,253,248,.96), rgba(235,242,232,.9)); }
.mistake-card { background: linear-gradient(145deg, rgba(255,253,248,.96), rgba(248,231,226,.72)); }
.mistake-note { margin: -6px 0 11px; color: var(--muted); font-size: 13px; }
.home-section.collapsed .mistake-note { display: none; }
.game-card { background: linear-gradient(145deg, #fffdf8, #eaf4ec 58%, #f7ead5); border-color: rgba(35,92,69,.18); }
.game-panel { display: grid; gap: 12px; }
.game-progress { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 800; }
.game-bar { height: 8px; border-radius: 999px; background: rgba(35,92,69,.12); overflow: hidden; }
.game-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width .25s ease; }
.game-word-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.game-tool-button { min-height: 38px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,254,251,.84); color: var(--muted); padding: 7px 12px; font-size: 13px; font-weight: 850; }
.game-tool-button.active { border-color: rgba(210,155,69,.5); background: #fff4df; color: #9a6518; }
.game-tool-button.danger-text { border-color: transparent; background: transparent; color: #a24a42; }
.game-question { border: 1px solid rgba(35,92,69,.18); border-radius: 22px; background: #fffefb; padding: 20px; display: grid; gap: 10px; min-height: 150px; align-content: center; text-align: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.game-question span { color: var(--muted); font-size: 13px; }
.game-question strong { font-size: clamp(28px, 7vw, 48px); line-height: 1.15; }
.game-prompt-line { display: grid; gap: 10px; justify-items: center; }
.game-speak { border: 0; border-radius: 999px; background: #edf4ef; color: var(--green); font-weight: 900; padding: 7px 13px; }
.game-hint-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.game-hint-row .secondary { padding: 8px 14px; min-height: 0; }
.game-hint { color: var(--muted); background: #fffefb; border: 1px dashed var(--line); border-radius: 999px; padding: 7px 11px; font-size: 13px; }
.game-answer { border: 1px solid var(--line); border-radius: 16px; background: #fffefb; padding: 15px; display: grid; gap: 10px; }
.game-answer-audio { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.game-answer-audio button { min-height: 44px; border: 0; border-radius: 13px; background: #e7f1ea; color: var(--green); font-weight: 900; }
.game-answer p { margin: 0; display: grid; gap: 5px; }
.game-answer span { color: var(--muted); font-size: 12px; }
.game-answer strong { font-size: 18px; line-height: 1.35; }
.game-feedback { border-radius: 14px; padding: 10px 12px; font-size: 13px; font-weight: 850; }
.game-feedback.good { background: #e3f0e7; color: #245d3e; }
.game-feedback.bad { background: #f6e2df; color: #8c3027; }
.game-feedback.neutral { background: #f2eee5; color: var(--muted); }
.game-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.game-typing { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.game-option { min-height: 82px; border: 1px solid var(--line); border-radius: 16px; background: #fffefb; color: var(--ink); display: grid; gap: 5px; align-content: center; text-align: left; padding: 13px; }
.game-option strong { font-size: 18px; }
.game-option span { color: var(--muted); font-size: 12px; }
.game-option.correct { border-color: #2d8f5d; background: #e8f5ed; }
.game-option.selected-wrong { border-color: #cf3f35; background: #f8e5e1; }
.game-option.selected-correct { border-color: #2d8f5d; background: #dff2e7; box-shadow: 0 0 0 3px rgba(45,143,93,.12); }
.game-option:disabled { opacity: 1; }
.game-actions { display: grid; grid-template-columns: .85fr 1.15fr; gap: 8px; align-items: center; }
.game-actions .primary { min-height: 52px; font-size: 16px; }
.section-title.compact { margin-bottom: 14px; }
.section-title.compact h2 { font-size: 20px; }
.section-title.compact span, .section-title.compact .text-button { color: var(--muted); font-size: 13px; }
.section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.section-toggle { border: 0; background: #edf4ef; color: var(--green); border-radius: 999px; padding: 7px 11px; font-size: 13px; font-weight: 850; white-space: nowrap; }
.home-section.collapsed .study-stack,
.home-section.collapsed .mini-list,
.home-section.collapsed .hint { display: none; }
.text-button { border: 0; background: transparent; padding: 0; color: var(--green) !important; font-weight: 800; }
.small-link { margin: -8px 0 10px; font-size: 13px; }
.study-stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.study-card, .mini-item { border: 1px solid var(--line); background: #fffefb; color: inherit; text-align: left; border-radius: 14px; padding: 13px; display: grid; gap: 8px; min-width: 0; }
.study-card { min-height: 108px; align-content: start; }
.category-pill:hover { border-color: rgba(35,92,69,.45); box-shadow: 0 8px 20px rgba(37,54,43,.07); }
.home-card-top { display: flex; justify-content: flex-end; min-height: 0; }
.home-favorite { border: 0; background: transparent; color: #a8afa9; font-size: 22px; line-height: 1; padding: 0; }
.home-favorite.active { color: var(--gold); }
.home-word-main { border: 0; background: transparent; color: inherit; text-align: left; padding: 0; display: grid; gap: 4px; }
.study-card strong, .mini-item strong { font-size: 17px; overflow-wrap: anywhere; }
.study-card span, .mini-item span { color: #2d2f2b; overflow-wrap: anywhere; }
.study-card em, .mini-item em { color: var(--muted); font-style: normal; overflow-wrap: anywhere; }
.home-speak-row { display: flex; gap: 6px; flex-wrap: wrap; }
.home-speak-row button { border: 0; border-radius: 999px; background: #edf4ef; color: var(--green); font-size: 12px; font-weight: 850; padding: 5px 10px; }
.study-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.study-actions button { border: 0; border-radius: 999px; background: #f2eee5; color: var(--muted); font-size: 12px; font-weight: 800; padding: 7px 6px; }
.study-actions button.active { background: var(--green); color: #fff; }
.home-word-detail { border-top: 1px solid var(--line); padding-top: 10px; }
.home-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.home-detail-grid p { margin: 0; display: grid; gap: 3px; }
.home-detail-grid span { color: var(--muted); font-size: 12px; }
.home-detail-grid strong { font-size: 13px; font-weight: 650; line-height: 1.45; }
.synonym-detail { padding: 10px 12px; border-radius: 13px; background: #edf4ef; }
.synonym-detail strong, .synonym-detail p { color: var(--green); line-height: 1.65; }
.home-detail-wide { grid-column: 1 / -1; }
.mini-list { display: grid; gap: 8px; max-height: 330px; overflow: auto; padding-right: 2px; }
.mini-item { grid-template-columns: minmax(72px, .75fr) minmax(0, 1fr); align-items: start; }
.mini-item em { grid-column: 2; }
.mini-empty { color: var(--muted); border: 1px dashed #d8d2c7; border-radius: 14px; padding: 18px; font-size: 13px; }
.category-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 330px; overflow: auto; }
.category-pill { border: 1px solid var(--line); background: #fffefb; border-radius: 999px; padding: 9px 12px; color: var(--ink); display: inline-flex; gap: 8px; align-items: center; }
.category-pill span { color: var(--green); background: #e7efe9; border-radius: 999px; min-width: 26px; padding: 2px 8px; font-size: 12px; font-weight: 800; }
.batch-action-bar { position: fixed; left: 50%; bottom: 24px; z-index: 60; width: min(520px, calc(100% - 24px)); transform: translateX(-50%); display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid rgba(222,217,206,.94); border-radius: 18px; background: rgba(255,253,248,.97); box-shadow: 0 14px 40px rgba(37,54,43,.22); backdrop-filter: blur(12px); }
.batch-action-bar span { font-size: 14px; color: var(--muted); }
.batch-action-bar strong { color: var(--green); font-size: 18px; }
.batch-selecting .vocab-item, .batch-selecting .home-word-card { cursor: pointer; }
.vocab-item.batch-selected, .home-word-card.batch-selected { border-color: var(--green); box-shadow: inset 0 0 0 2px rgba(35,92,69,.2), 0 8px 20px rgba(35,92,69,.08); background: #f1f8f3; }
.vocab-item.batch-selected::after, .home-word-card.batch-selected::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 999px; background: var(--green); color: #fff; font-size: 14px; font-weight: 900; }
.home-word-card { position: relative; }
.query-card label { font-weight: 700; display: block; margin-bottom: 10px; }
.query-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(35,92,69,.1); }
.primary, .secondary { border: 0; border-radius: 10px; padding: 12px 20px; font-weight: 750; }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.primary:disabled { opacity: .6; cursor: wait; }
.secondary { background: #e7ece8; color: var(--green); }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.result-card { margin-top: 18px; }
.import-card { margin-top: 18px; }
.section-title, .library-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
#resultStatus { color: var(--green); font-size: 13px; }
.section-title span { color: var(--muted); font-size: 13px; }
.import-row { display: grid; grid-template-columns: 220px auto; gap: 10px; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 18px; }
.form-grid label { font-size: 13px; color: var(--muted); }
.form-grid input, .form-grid select, .form-grid textarea { margin-top: 6px; color: var(--ink); }
.wide { grid-column: 1 / -1; }
.library { margin-top: 26px; }
.search-label { color: var(--muted); font-size: 13px; margin: -12px 0 12px; }
.exports { display: flex; gap: 8px; }
.toolbar { display: grid; grid-template-columns: 1fr 190px 180px auto; gap: 10px; margin-bottom: 15px; }
.view-tabs { display: flex; gap: 6px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.tab-button { border: 0; border-radius: 8px; padding: 8px 13px; background: transparent; color: var(--muted); font-weight: 800; white-space: nowrap; }
.tab-button.active { background: var(--green); color: #fff; }
.favorite-filter { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
.favorite-filter input { width: auto; }
.vocab-list { display: grid; gap: 10px; }
.vocab-item { position: relative; display: grid; grid-template-columns: 34px 42px minmax(0, 1fr) 46px auto; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; overflow: hidden; touch-action: pan-y; }
.item-index { align-self: start; justify-self: center; min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: #f1ede4; color: var(--muted); font-size: 12px; font-weight: 850; }
.star { border: 0; background: transparent; font-size: 25px; color: #a8afa9; align-self: start; }
.star.active { color: var(--gold); }
.chinese { font-size: 20px; font-weight: 800; }
.summary-button { border: 0; background: transparent; padding: 0; text-align: left; color: inherit; }
.speak-button { border: 0; width: 42px; height: 42px; border-radius: 999px; background: #edf4ef; color: var(--green); font-size: 14px; font-weight: 800; align-self: center; display: grid; place-items: center; }
.speak-button:hover { background: #dfece4; }
.english span { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 7px; }
.translations { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-top: 7px; }
.translations i { width: 1px; height: 16px; background: var(--line); }
.quick-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.word-main p { margin: 10px 0 5px; color: var(--muted); }
.word-main small { display: block; color: #747d76; margin-top: 3px; }
.meta { display: flex; flex-direction: column; gap: 8px; align-items: end; color: var(--muted); font-size: 12px; }
.tag { color: var(--green); background: #e7efe9; padding: 5px 9px; border-radius: 99px; }
.empty { color: var(--muted); text-align: center; border: 1px dashed #c9c4ba; border-radius: 14px; padding: 50px 20px; }
.message { margin-bottom: 12px; padding: 11px 14px; border-radius: 9px; }
.message.success { background: #e3f0e7; color: #245d3e; }
.message.error { background: #f6e2df; color: #8c3027; }
.detail { grid-column: 3 / -1; border-top: 1px solid var(--line); padding-top: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-grid div { display: grid; gap: 4px; }
.detail-grid span { color: var(--muted); font-size: 12px; }
.detail-grid strong, .detail-grid p { margin: 0; font-size: 14px; }
.speak-line { display: flex; align-items: center; gap: 8px; }
.mini-speak { border: 0; border-radius: 999px; background: #edf4ef; color: var(--green); font-size: 12px; font-weight: 800; padding: 4px 9px; }
.detail-wide { grid-column: 1 / -1; }
.item-actions { display: flex; gap: 8px; margin-top: 18px; }
.danger, .plain { border: 0; border-radius: 9px; padding: 10px 16px; font-weight: 700; }
.danger { background: #f6e2df; color: #8c3027; }
.plain { background: transparent; color: var(--muted); }
.quick-delete { display: none; }
.long-pressing { outline: 2px solid rgba(207,63,53,.42); transform: scale(.995); }
dialog { width: min(460px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 16px; padding: 24px; color: var(--ink); }
dialog::backdrop { background: rgba(20,30,24,.42); }
dialog h3 { margin: 0 0 8px; }
dialog p { color: var(--muted); }
.dialog-actions { display: grid; gap: 8px; margin-top: 20px; }
.settings-link { color: var(--green); text-decoration: none; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.settings-card { max-width: 720px; }
.settings-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 22px 0; }
.settings-form label { color: var(--muted); font-size: 13px; }
.settings-form input, .settings-form select { margin-top: 6px; color: var(--ink); }
.settings-form small { display: block; margin-top: 6px; color: var(--muted); }
.settings-placeholder { max-width: 720px; margin-top: 35px; padding: 0 6px; color: var(--muted); }
.settings-placeholder h2 { color: var(--ink); font-size: 18px; }
.mobile-bottom-nav { display: none; }
.hidden { display: none !important; }
@media (max-width: 680px) {
  body { background: #f6f2ea; }
  .page { width: 100%; max-width: 100vw; padding: 14px 10px calc(98px + env(safe-area-inset-bottom)); overflow-x: hidden; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  header { align-items: center; margin: 0 0 12px; padding: 4px 2px 2px; }
  .eyebrow { font-size: 10px; letter-spacing: .12em; margin-bottom: 5px; }
  h1 { font-size: 27px; letter-spacing: -.04em; }
  h2 { font-size: 20px; }
  .subtitle { font-size: 12px; margin-top: 6px; }
  .settings-link { padding: 8px 10px; border-radius: 999px; background: rgba(255,253,248,.72); }
  .learning-home { gap: 12px; margin-bottom: 12px; }
  .card, .home-card { padding: 14px; border-radius: 18px; box-shadow: 0 8px 24px rgba(37,54,43,.05); }
  .home-grid { display: grid; grid-template-columns: 1fr; gap: 10px; overflow: visible; margin: 0; padding: 0; }
  .home-grid .home-card { min-width: 0; width: 100%; }
  .section-title.compact { margin-bottom: 10px; }
  .section-title.compact h2 { font-size: 18px; }
  .section-actions { gap: 6px; }
  .section-toggle { min-height: 36px; padding: 8px 12px; }
  .review-card { padding: 16px 14px 14px; }
  .game-question { min-height: 150px; padding: 18px; }
  .game-word-toolbar { margin-top: -2px; }
  .game-tool-button { min-height: 40px; padding: 8px 12px; }
  .game-options { grid-template-columns: 1fr 1fr; gap: 8px; }
  .game-typing { grid-template-columns: 1fr; }
  .game-option { min-height: 78px; padding: 12px; }
  .game-actions {
    position: sticky;
    bottom: 76px;
    z-index: 8;
    grid-template-columns: .8fr 1.2fr;
    padding: 8px;
    margin: 0 -4px;
    border: 1px solid rgba(222,217,206,.88);
    border-radius: 18px;
    background: rgba(255,253,248,.94);
    box-shadow: 0 10px 24px rgba(37,54,43,.10);
    backdrop-filter: blur(8px);
  }
  .game-actions .primary,
  .game-actions .secondary { min-height: 48px; border-radius: 14px; }
  .game-answer { padding: 12px; gap: 8px; }
  .game-answer strong { font-size: 16px; }
  .game-answer-audio { position: sticky; top: 8px; z-index: 3; margin: -4px -4px 2px; padding: 4px 4px 10px; background: #fffefb; }
  .review-card .section-title, .review-card .hint { padding-right: 0; }
  .study-stack { display: grid; grid-template-columns: 1fr; gap: 10px; overflow: visible; padding: 0; }
  .study-card { width: 100%; min-height: 0; padding: 16px; border-radius: 18px; }
  .study-card strong { font-size: 22px; }
  .study-card span { font-size: 17px; }
  .study-card em { font-size: 15px; }
  .mini-list, .category-grid { max-height: none; }
  .mini-item { grid-template-columns: 1fr; min-height: 74px; padding: 12px; border-radius: 15px; }
  .mini-item strong { font-size: 17px; }
  .mini-item em { grid-column: auto; }
  .home-word-main { min-height: 0; }
  .home-speak-row button { min-height: 34px; padding: 6px 12px; }
  .study-actions button { min-height: 34px; }
  .home-detail-grid { grid-template-columns: 1fr; }
  .category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 230px; overflow-y: auto; padding: 1px 2px 3px; }
  .category-pill { width: 100%; min-width: 0; justify-content: space-between; padding: 10px 11px; min-height: 44px; border-radius: 14px; text-align: left; }
  .category-pill strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .query-card { margin-bottom: 14px; }
  .counter { display: none; }
  .query-row, .toolbar, .form-grid, .import-row { grid-template-columns: 1fr; }
  input, select, textarea { min-height: 46px; border-radius: 14px; font-size: 16px; }
  .primary, .secondary { min-height: 46px; border-radius: 14px; }
  .view-tabs { width: 100%; }
  .tab-button { flex: 1; min-height: 42px; border-radius: 12px; }
  .wide { grid-column: auto; }
  .library { margin-top: 18px; }
  .library-heading { align-items: end; margin-bottom: 14px; }
  .search-label { margin-top: -8px; }
  .toolbar { position: static; background: transparent; padding: 0; margin-bottom: 12px; gap: 8px; }
  .vocab-list { gap: 8px; }
  .vocab-item { grid-template-columns: 30px 32px minmax(0, 1fr) 42px; gap: 8px; padding: 15px 13px; border-radius: 18px; }
  .item-index { min-width: 26px; height: 26px; font-size: 11px; }
  .star { font-size: 22px; min-width: 32px; min-height: 38px; }
  .chinese { font-size: 20px; line-height: 1.2; }
  .translations { flex-direction: column; align-items: flex-start; gap: 3px; font-size: 15px; margin-top: 5px; }
  .translations i { display: none; }
  .speak-button { width: 40px; height: 40px; font-size: 13px; }
  .meta { grid-column: 3 / -1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
  .meta .query-count { display: none; }
  .meta .last-view { display: none; }
  .quick-note { font-size: 12px; }
  .detail { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: 1fr; }
  .item-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .long-pressing { background: #fff7f5; }
  .exports { flex-direction: column; }
  .settings-form { grid-template-columns: 1fr; }
  .import-card { margin-top: 28px; }
  .mobile-bottom-nav { position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; border: 1px solid rgba(222,217,206,.92); border-radius: 22px; background: rgba(255,253,248,.94); box-shadow: 0 10px 30px rgba(37,54,43,.16); backdrop-filter: blur(12px); }
  .mobile-bottom-nav a { position: relative; text-decoration: none; color: var(--muted); text-align: center; font-size: 13px; font-weight: 850; padding: 11px 4px; border-radius: 16px; transition: background .18s ease, color .18s ease, transform .18s ease; }
  .mobile-bottom-nav a.active, .mobile-bottom-nav a:active { background: #e5efe8; color: var(--green); }
  .mobile-bottom-nav a.active::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 16px; height: 2px; border-radius: 99px; background: var(--green); transform: translateX(-50%); }
  .mobile-bottom-nav a:active { transform: scale(.97); }
  .batch-action-bar { bottom: calc(76px + env(safe-area-inset-bottom)); grid-template-columns: 1fr auto auto; border-radius: 18px; padding: 9px 10px; }
  .batch-action-bar .plain, .batch-action-bar .danger { min-height: 42px; padding: 9px 11px; }
  .search-label, .query-card .hint { display: none; }
  .query-card label { font-size: 18px; margin-bottom: 12px; }
  .query-row { gap: 8px; }
  .query-row .primary { width: 100%; }
  .home-section.collapsed { padding-top: 13px; padding-bottom: 13px; }
  .home-section.collapsed .section-title { margin-bottom: 0; }
  .game-card > .hint { margin-top: 8px; line-height: 1.45; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.collocation-block > span { display: block; margin-bottom: 9px; }
.collocation-list { display: grid; gap: 8px; }
.collocation-pair { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f1f5ee; line-height: 1.45; }
.collocation-pair strong { color: #153f34; font-size: 1rem; }
.collocation-speak, .related-speak { flex: 0 0 auto; min-width: 36px; min-height: 32px; padding: 4px 8px; border: 0; border-radius: 999px; background: #dfece4; color: #15513f; font-size: .9rem; cursor: pointer; }
.collocation-speak:active, .related-speak:active { transform: scale(.95); }
.related-speak { margin-left: 10px; vertical-align: middle; }
.collocation-pair span { color: #59645e; font-size: .92rem; }
.collocation-pair span::before { content: "｜"; margin-right: 10px; color: #a5afa8; }
.collocation-empty { color: #8a938e; }

@media (max-width: 520px) {
  .collocation-pair { align-items: flex-start; padding: 9px 10px; }
}
