@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/lora-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/lora-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/lora-vietnamese-700.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/lora-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/lora-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/lora-italic-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  color-scheme: light;
  --ink: #241b36;
  --muted: #645a73;
  --purple: #5935a9;
  --deep: #46268c;
  --border: #e7e0ef;
  --page: #faf9fd;
  --serif: "Lora", "Segoe UI", serif;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #7547ca;
  outline-offset: 3px;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2 { line-height: 1.15; }
button:disabled { cursor: default; }
.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip:focus { position: absolute; z-index: 5; padding: 12px; background: white; }
.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.header-inner, .shell, .footer-inner { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.header-inner { min-height: 72px; display: flex; align-items: center; gap: 42px; }
.brand { display: inline-flex; align-items: center; gap: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.055em; }
.brand > span:last-child { color: var(--purple); }
.brand-mark {
  width: 35px; height: 35px; margin-right: 10px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; gap: 2px; background: #5935a9;
}
.brand-mark i { width: 4px; height: 12px; border-radius: 4px; background: #fff; transform: rotate(25deg); }
.brand-mark i:nth-child(2) { height: 18px; background: #d5c4ff; }
.brand-mark i:nth-child(3) { height: 9px; }
.header-inner nav { display: flex; gap: 6px; }
.header-inner nav a, .saved-nav { padding: 8px 13px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.header-inner [aria-current="page"], .header-inner nav a:hover, .saved-nav:hover { background: #f1ebfc; color: var(--deep); }
.saved-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.bookmark-icon { width: .72em; height: .9em; flex: none; display: inline-block; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%); }
.shell { min-height: calc(100vh - 170px); padding-block: 32px 60px; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; display: grid;
  grid-template-columns: 1.1fr .9fr; align-items: center; gap: 12px;
  min-height: 386px; padding: clamp(30px, 5.1vw, 66px);
  border: 1px solid #e2d4f8; border-radius: 27px;
  background: linear-gradient(111deg, #f4efff 6%, #eee5ff 60%, #e5d8fb);
}
.hero-label, .result-label {
  display: flex; align-items: center; gap: 9px; color: var(--deep); font-size: .875rem; font-weight: 750;
}
.hero-label { margin-bottom: 13px; }
.hero-label span, .result-label span { width: 8px; height: 8px; border-radius: 2px; background: #784dc5; transform: rotate(45deg); }
.hero h1, .subheader h1 { font: 700 clamp(2.7rem, 5.1vw, 4.15rem)/1.06 var(--serif); letter-spacing: -.035em; }
.hero h1 em { color: var(--purple); font-weight: inherit; }
.hero-description { margin: 17px 0 20px; color: #514467; max-width: 420px; }
.search {
  display: flex; align-items: center; gap: 12px; background: white;
  border: 1px solid #d2c0ee; border-radius: 13px; max-width: 480px; padding: 6px 6px 6px 15px;
  box-shadow: 0 8px 18px #49277b12;
}
.search:focus-within { border-color: #7547ca; }
.search-icon { position: relative; width: 14px; height: 14px; flex: none; border: 2px solid #6d5c89; border-radius: 50%; margin-right: 3px; }
.search-icon::after { content: ""; width: 7px; height: 2px; background: #6d5c89; position: absolute; top: 10px; left: 9px; transform: rotate(45deg); border-radius: 5px; }
.search input { width: 100%; min-width: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink); padding: 6px 1px; }
.search input::placeholder { color: #6b6277; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; min-height: 42px; border-radius: 10px; white-space: nowrap;
  font-weight: 650; border: 1px solid transparent; line-height: 1.25;
}
.primary { color: #fff; background: var(--purple); }
.primary:hover { background: var(--deep); }
.secondary { color: var(--deep); background: #fff; border-color: #ded4ed; }
.secondary:hover, .secondary[aria-pressed="true"] { background: #f1e9ff; border-color: #cdb9ee; }
.examples { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 13px; font-size: .875rem; color: var(--muted); }
.examples span { margin-right: 3px; }
.examples a { color: var(--deep); background: #ffffffa3; border: 1px solid #d9c9f4; border-radius: 7px; padding: 2px 9px; }
.examples a:hover { background: #fff; }
.hero-art { position: relative; width: 100%; height: 286px; pointer-events: none; }
.orbit { position: absolute; border: 1px solid #a88bd76d; border-radius: 50%; width: 91%; height: 54%; top: 24%; left: 4%; transform: rotate(-24deg); }
.orbit-inner { width: 83%; height: 66%; left: 11%; top: 17%; transform: rotate(28deg); border-style: dashed; }
.word-slip {
  position: absolute; display: flex; flex-direction: column; justify-content: center; align-items: center;
  width: 32%; padding: 17px 7px; border: 1px solid #fff7; border-radius: 17px;
  box-shadow: 0 12px 28px #4832682b; line-height: 1.25;
}
.word-slip span { font: 700 clamp(1.9rem, 4.4vw, 3.4rem)/1.15 var(--serif); }
.word-slip small { font-size: .9rem; }
.slip-left { top: 29%; left: 2%; transform: rotate(-14deg); background: #e7f4e9; color: #2d5944; }
.slip-right { top: 44%; right: 1%; transform: rotate(13deg); background: #fff0db; color: #784516; }
.slip-root { width: 40%; top: 20%; left: 30%; padding: 25px 8px; transform: rotate(-4deg); color: #fff; background: linear-gradient(148deg, #764cc8, #4a2695); }
.slip-root span { font-size: clamp(2.6rem, 5.7vw, 4.45rem); letter-spacing: -.07em; }
.slip-root small { margin-top: 5px; color: #eee4ff; font-family: var(--serif); font-style: italic; }
.slip-root b { font-size: .875rem; padding: 2px 11px; margin-top: 9px; background: #fff2; border-radius: 10px; }
.spark { position: absolute; color: #7753b8; font-size: 2.4rem; line-height: 1; }
.spark-top { top: 7%; right: 13%; }
.spark-bottom { bottom: 10%; left: 17%; font-size: 1.6rem; }
#view { scroll-margin-top: 18px; }
.hero:not([hidden]) + #view { margin-top: 35px; }
#view > .result-label { margin: 0 0 12px 3px; }
.word-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 19px; }
.definition { padding: clamp(21px, 3vw, 35px); }
.definition-top { display: flex; gap: 15px; justify-content: space-between; align-items: start; flex-wrap: wrap; }
.definition h2 { font: 700 clamp(2.05rem, 4.1vw, 3.55rem)/1.05 var(--serif); letter-spacing: -.045em; overflow-wrap: anywhere; }
.word-actions, .pronunciation { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pronunciation { margin-top: 9px; color: var(--muted); gap: 12px; }
.part-of-speech { font-size: .875rem; background: #f2edf9; border-radius: 6px; padding: 2px 8px; color: var(--deep); }
.meaning { font-size: 1.17rem; font-weight: 680; margin: 13px 0 23px; }
.word-parts h3, .example h3, .family-list h4 { font-size: 1rem; margin-bottom: 10px; }
.parts { display: flex; flex-wrap: wrap; gap: 9px; }
.morpheme { display: flex; flex-direction: column; gap: 2px; flex: 1 1 130px; border-radius: 11px; padding: 11px 13px; color: #285944; background: #edf7f0; }
.morpheme strong { font: 700 1.75rem/1.17 var(--serif); }
.morpheme .part-label { font-size: .875rem; font-weight: 650; }
.morpheme.root { background: #efe7fc; color: #4a278e; }
.morpheme.suffix { background: #fff2df; color: #754822; }
.morpheme.stem { background: #eaf1fd; color: #2d527c; }
.part-note { margin-top: 8px; color: var(--muted); font-size: .875rem; }
.example { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.example p[lang="en"] { font-size: 1.08rem; }
.example p + p { color: var(--muted); margin-top: 3px; }
.source { display: inline-block; margin-top: 18px; color: var(--deep); text-decoration: underline; text-underline-offset: .2em; font-size: .875rem; }
.dictionary-details { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--border); }
.dictionary-details summary { cursor: pointer; font-weight: 660; color: var(--deep); }
.dictionary { padding: 16px 0; }
.dictionary h3 { font: 700 1.6rem var(--serif); }
.dictionary audio { display: block; width: min(100%, 340px); margin-top: 10px; }
.dictionary-meanings { margin: 12px 0; }
.dictionary-meanings ul { margin: 5px 0 12px; padding-left: 21px; }
.dictionary-meanings li { margin-bottom: 4px; }
.dictionary-meanings i { display: block; color: var(--muted); }
.dictionary-source { font-size: .875rem; }
.dictionary-source a { text-decoration: underline; color: var(--deep); text-underline-offset: .2em; }
.violet { --tint: #f1eafb; --tint-border: #e4d6f6; --accent: #51338a; }
.mint { --tint: #edf7ef; --tint-border: #d5e9db; --accent: #295642; }
.peach { --tint: #fcf0e3; --tint-border: #f1dfc9; --accent: #784b24; }
.rose { --tint: #f9edf1; --tint-border: #f0dbe4; --accent: #813f59; }
.blue { --tint: #eaf2fc; --tint-border: #d8e5f6; --accent: #315688; }
.root-panel { background: var(--tint); border-color: var(--tint-border); padding: 24px; }
.root-panel h3, .root-card h2 { margin-top: 10px; font: 700 2rem/1.1 var(--serif); color: var(--accent); letter-spacing: -.035em; }
.root-panel > p { margin-top: 6px; color: var(--accent); }
.root-panel .result-label { color: var(--accent); }
.family-list { margin: 21px 0 17px; }
.word-link { display: inline-flex; align-items: center; gap: 8px; line-height: 1.3; }
.word-link:hover strong { text-decoration: underline; text-underline-offset: .2em; }
.word-link span { color: var(--muted); font-size: .875rem; }
.family-list .word-link { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--tint-border); }
.family-list .word-link span { text-align: right; }
.subheader { background: var(--tint, #f1eafb); border: 1px solid var(--tint-border, #e4d6f6); border-radius: 22px; padding: clamp(23px, 4vw, 48px); margin-bottom: 22px; }
.subheader h1 { font-size: clamp(2.3rem, 4.5vw, 3.8rem); color: var(--accent, var(--ink)); }
.subheader p { color: var(--muted); margin-top: 9px; }
.subheader .result-label { margin-bottom: 11px; }
.back { display: inline-block; margin: 0 0 12px 2px; color: var(--deep); text-decoration: underline; text-underline-offset: .2em; }
.root-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.root-card { display: block; padding: 22px; border-color: var(--tint-border); background: var(--tint); }
.root-card:hover { box-shadow: 0 5px 18px #22154018; border-color: var(--accent); }
.root-card h2 { margin: 0 0 7px; }
.root-card span { display: inline-block; margin-top: 15px; font-size: .875rem; color: var(--accent); }
.root-family h2 { margin: 0 0 15px 2px; }
.family-diagram { display: grid; grid-template-columns: 1fr 2fr; align-items: center; padding: 23px; border: 1px solid var(--tint-border); border-radius: 19px; background: white; }
.family-center { display: flex; flex-direction: column; justify-content: center; padding: 13px 17px; color: var(--accent); background: var(--tint); border: 1px solid var(--tint-border); border-radius: 12px; }
.family-center strong { font: 700 1.6rem var(--serif); }
.family-branches { display: grid; gap: 8px; border-left: 2px solid var(--tint-border); }
.family-branches .word-link { position: relative; display: flex; flex-wrap: wrap; margin-left: 21px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--tint-border); background: var(--tint); }
.family-branches .word-link::before { content: ""; position: absolute; width: 22px; height: 2px; top: 50%; right: 100%; background: var(--tint-border); }
.empty, .quiz-panel { padding: clamp(22px, 4vw, 40px); }
.empty p { color: var(--muted); margin: 8px 0 17px; }
.word-links { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.word-links .word-link { border: 1px solid var(--border); padding: 6px 9px; border-radius: 8px; color: var(--deep); }
.saved-list { padding: 4px 22px; }
.saved-list .word-link { display: flex; justify-content: space-between; padding: 14px 0; }
.saved-list .word-link + .word-link { border-top: 1px solid var(--border); }
.quiz-panel { max-width: 680px; }
.quiz-progress { display: flex; gap: 16px; align-items: center; color: var(--muted); margin-bottom: 20px; font-size: .875rem; }
.quiz-progress span { white-space: nowrap; }
.quiz-progress progress { accent-color: var(--purple); width: 100%; }
.quiz-panel h2 { font: 700 clamp(1.8rem, 4.6vw, 2.9rem)/1.1 var(--serif); }
.quiz-panel > p { color: var(--muted); margin-top: 8px; }
.quiz-options { display: grid; gap: 8px; margin-top: 19px; }
.option { display: flex; gap: 9px; align-items: center; justify-content: space-between; text-align: left; padding: 11px 13px; color: var(--ink); background: #fff; border: 1px solid var(--border); border-radius: 9px; }
.option span { text-align: right; }
.option:not(:disabled):hover { background: #f3edfd; border-color: #cdb9ee; }
.option.correct { background: #e9f7ed; border-color: #82bd94; }
.option.incorrect { background: #fcebed; border-color: #d69ca7; }
.quiz-feedback p { margin: 14px 0 11px; }
.quiz-review { display: grid; margin: 14px 0 17px; }
.quiz-review > div { display: flex; justify-content: space-between; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.quiz-review > div > span { color: var(--muted); text-align: right; }
.site-footer { border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 19px 0; color: var(--muted); font-size: .875rem; }
.footer-inner strong { color: var(--deep); }

@media (max-width: 820px) {
  .header-inner, .shell, .footer-inner { width: calc(100% - 36px); }
  .header-inner { gap: 16px; }
  .word-layout { grid-template-columns: minmax(0, 1.45fr) minmax(240px, 1fr); gap: 13px; }
  .root-panel { padding: 18px; }
}
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; gap: 6px; padding: 10px 0 6px; }
  .header-inner nav { flex-basis: 100%; order: 3; margin-left: -8px; gap: 4px; }
  .header-inner nav a, .saved-nav { padding: 7px 9px; font-size: .9rem; }
  .shell { padding-block: 18px 34px; }
  .hero { display: block; min-height: 0; padding: 25px 19px; border-radius: 20px; }
  .hero h1 { font-size: clamp(2.3rem, 8vw, 3.35rem); }
  .hero-art { display: none; }
  .hero-description { margin-top: 12px; }
  .hero:not([hidden]) + #view { margin-top: 24px; }
  .word-layout { grid-template-columns: minmax(0, 1fr); }
  .root-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .root-card { padding: 14px; }
  .root-card h2 { font-size: 1.55rem; }
  .family-diagram { padding: 12px; }
  .family-center { padding: 9px; }
  .family-center strong { font-size: 1.15rem; }
  .family-branches .word-link { margin-left: 12px; padding: 7px; }
  .family-branches .word-link::before { width: 13px; }
}
