:root {
  --ink: #252442;
  --muted: #74738b;
  --paper: #fffaf0;
  --white: #ffffff;
  --purple: #5b56d6;
  --purple-dark: #433cb7;
  --purple-soft: #eeecff;
  --coral: #ff7867;
  --coral-soft: #fff0e9;
  --mint: #48bfa1;
  --mint-soft: #e4f8f1;
  --yellow: #ffc95c;
  --yellow-soft: #fff5d8;
  --blue: #5aa9e6;
  --blue-soft: #e8f4ff;
  --line: #e9e5dc;
  --shadow: 0 18px 50px rgba(62, 54, 105, .09);
  --shadow-hover: 0 24px 60px rgba(62, 54, 105, .15);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --font: "Microsoft YaHei", "微软雅黑", "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", "WenQuanYi Micro Hei", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font); line-height: 1.6; }
body.modal-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
p, h1, h2, h3, h4 { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.035em; }
/* 中韩文没有字形间距概念，负字距会把字挤在一起发虚 —— 中文/韩文界面改回正常字距 */
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) h4,
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3, :lang(ko) h4,
:lang(zh) .brand-copy strong, :lang(ko) .brand-copy strong,
:lang(zh) .hero h1, :lang(ko) .hero h1,
:lang(zh) .home-page .hero-home h1, :lang(ko) .home-page .hero-home h1,
:lang(zh) .topic-tile h3, :lang(ko) .topic-tile h3,
:lang(zh) .unit-map-head strong, :lang(ko) .unit-map-head strong { letter-spacing: normal; }
p { color: var(--muted); }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: #dcd8ff; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.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; }
.skip-link { position: fixed; z-index: 200; left: 16px; top: -60px; padding: 12px 18px; border-radius: 12px; color: white; background: var(--purple); }
.skip-link:focus { top: 12px; }
.background-shapes { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.shape { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; }
.shape-one { width: 430px; height: 430px; top: 40px; right: -180px; background: radial-gradient(circle, #e7e3ff 0, transparent 70%); }
.shape-two { width: 500px; height: 500px; top: 640px; left: -260px; background: radial-gradient(circle, #ddf7ee 0, transparent 70%); }
.shape-three { width: 400px; height: 400px; right: -100px; bottom: 0; background: radial-gradient(circle, #ffe8d5 0, transparent 70%); }

.site-header { position: sticky; z-index: 50; top: 0; padding: 14px 24px; background: rgba(255, 250, 240, .88); border-bottom: 1px solid rgba(233, 229, 220, .8); backdrop-filter: blur(18px); }
.header-inner { width: min(1180px, 100%); min-height: 58px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; color: var(--purple); transform: rotate(-4deg); transition: transform .2s; }
.brand:hover .brand-mark { transform: rotate(0) translateY(-1px); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
.brand-mark.small { width: 30px; height: 30px; }
.brand-copy { display: flex; align-items: center; }
.brand-copy strong { font-size: 17px; font-weight: 900; letter-spacing: -.035em; }
.main-nav { display: flex; align-items: center; gap: 30px; margin-left: auto; }
.main-nav a { position: relative; padding: 7px 2px; font-size: 15.5px; font-weight: 750; color: #656379; transition: color .2s, background .2s; }
.main-nav a::after { content: ""; position: absolute; height: 3px; left: 0; right: 100%; bottom: -8px; border-radius: 10px; background: var(--coral); transition: right .2s; }
.main-nav a:hover { color: var(--purple); }
.main-nav a:hover::after { right: 0; }
body.is-home:not(.is-topics-view) .main-nav a[href="/"],
body.is-topics-view .main-nav a[href="/#topics"],
body:not(.is-home) .main-nav a[href="/#topics"] { color: var(--purple-dark); font-weight: 900; }
.main-nav .nav-home-link { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.72); line-height: 1; transition: transform .2s, border-color .2s, background .2s, color .2s; }
.main-nav .nav-home-link .icon { width: 16px; height: 16px; }
.main-nav .nav-home-link::after { display: none; }
.main-nav .nav-home-link:hover { transform: translateY(-1px); border-color: #d7d1fa; background: var(--purple-soft); }
body.is-home:not(.is-topics-view) .main-nav .nav-home-link { border-color: #d7d1fa; background: var(--purple-soft); }
.mini-avatar { width: 29px; height: 29px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; color: white; background: var(--coral); font-size: 12px; font-weight: 900; }
.mini-avatar svg { width: 100%; height: 100%; }

main { min-height: 70vh; }
.page-loader { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }
.page-loader p { font-size: 14px; font-weight: 700; }
.loader-orbit { width: 48px; height: 48px; border: 4px solid var(--purple-soft); border-top-color: var(--purple); border-radius: 50%; animation: spin 1s linear infinite; }
.page { animation: pageIn .45s ease both; }
.container { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.section { padding: 86px 0; }
.section.compact { padding: 52px 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--purple); font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-heading h2 { max-width: 670px; margin-bottom: 10px; font-size: clamp(30px, 4vw, 46px); }
.section-heading p { max-width: 540px; margin-bottom: 0; font-size: 15px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--purple); font-size: 14px; font-weight: 850; white-space: nowrap; }
.text-link:hover { color: var(--purple-dark); }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 22px; border: 1px solid transparent; border-radius: 15px; font-size: 14px; font-weight: 850; line-height: 1.2; transition: transform .2s, box-shadow .2s, background .2s; }
.button:hover { transform: translateY(-3px); }
.button.primary { color: white; background: var(--purple); box-shadow: 0 10px 22px rgba(91,86,214,.22); }
.button.primary:hover { background: var(--purple-dark); box-shadow: 0 14px 28px rgba(91,86,214,.28); }
.button.secondary { color: var(--ink); border-color: var(--line); background: white; }
.button.secondary:hover { border-color: #d4cffa; box-shadow: var(--shadow); }
.button.coral { color: white; background: var(--coral); box-shadow: 0 10px 22px rgba(255,120,103,.22); }
.button.ghost { min-height: 42px; padding: 9px 14px; color: var(--purple); background: var(--purple-soft); }
.button.full { width: 100%; }
.button.small { min-height: 40px; padding: 9px 14px; font-size: 12px; }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }
.icon { width: 20px; height: 20px; display: inline-block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-size: 24px; line-height: 1; }
.icon-button:hover { color: var(--ink); background: #f2efe8; }

.hero { position: relative; padding: 84px 0 72px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 64px; }
.hero-copy { position: relative; z-index: 2; }
.hero h1 { max-width: 700px; margin-bottom: 24px; font-size: clamp(46px, 6.5vw, 78px); letter-spacing: -.055em; }
.hero h1 .highlight { position: relative; display: inline-block; color: var(--purple); white-space: nowrap; }
.hero h1 .highlight::after { content: ""; position: absolute; z-index: -1; height: 13px; left: 0; right: 0; bottom: 4px; border-radius: 50%; background: var(--yellow); transform: rotate(-2deg); opacity: .65; }
.hero-description { max-width: 570px; margin-bottom: 30px; font-size: 17px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { display: flex; align-items: center; gap: 10px; margin-top: 24px; color: var(--muted); font-size: 12px; font-weight: 750; }
.hero-note .avatar-stack { display: flex; padding-left: 8px; }
.hero-note .avatar-stack span { width: 30px; height: 30px; display: grid; place-items: center; margin-left: -8px; overflow: hidden; border: 3px solid var(--paper); border-radius: 50%; background: var(--purple-soft); }
.hero-note svg { width: 100%; height: 100%; }
.hero-art { position: relative; min-height: 480px; display: grid; place-items: center; }
.art-blob { position: absolute; width: 420px; height: 420px; border-radius: 42% 58% 63% 37% / 47% 38% 62% 53%; background: #e9e5ff; transform: rotate(-8deg); animation: blobMorph 10s ease-in-out infinite alternate; }
.art-blob::after { content: ""; position: absolute; inset: 22px; border: 2px dashed rgba(91,86,214,.2); border-radius: inherit; }
.mission-card { position: relative; z-index: 2; width: min(370px, 100%); padding: 26px; border: 2px solid var(--ink); border-radius: 28px; background: white; box-shadow: 9px 10px 0 var(--ink); transform: rotate(2deg); animation: cardFloat 5s ease-in-out infinite; }
.mission-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.mission-label { color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.xp-pill { padding: 5px 10px; border-radius: 20px; color: #8a6515; background: var(--yellow-soft); font-size: 11px; font-weight: 900; }
.mission-card h3 { margin-bottom: 8px; font-size: 25px; }
.mission-card > p { margin-bottom: 22px; font-size: 13px; }
.mission-characters { display: flex; align-items: end; justify-content: center; gap: 4px; height: 150px; margin: 0 -8px 18px; }
.mission-character { position: relative; width: 33.33%; }
.mission-character:nth-child(1) { transform: rotate(-5deg) translateY(5px); }
.mission-character:nth-child(2) { z-index: 2; transform: translateY(-8px); }
.mission-character:nth-child(3) { transform: rotate(5deg) translateY(5px); }
.mission-character .avatar-svg { width: 100%; filter: drop-shadow(0 8px 4px rgba(37,36,66,.1)); }
.character-name { position: absolute; left: 50%; bottom: -4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 20px; background: white; font-size: 9px; font-weight: 900; white-space: nowrap; transform: translateX(-50%); }
.mission-progress-label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 850; }
.progress-track { height: 9px; overflow: hidden; border-radius: 20px; background: #efedf4; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), #78d8bd); transition: width .5s ease; }
.floating-chip { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 1.5px solid var(--ink); border-radius: 13px; background: white; box-shadow: 4px 5px 0 var(--ink); font-size: 11px; font-weight: 900; animation: chipFloat 4s ease-in-out infinite; }
.floating-chip .icon { width: 16px; height: 16px; }
.chip-one { top: 68px; right: -6px; color: var(--coral); transform: rotate(5deg); }
.chip-two { left: -28px; bottom: 94px; color: var(--mint); animation-delay: -1.5s; transform: rotate(-5deg); }
.chip-three { right: 4px; bottom: 32px; color: var(--purple); animation-delay: -2.8s; transform: rotate(3deg); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 68px; padding-top: 28px; border-top: 1px solid var(--line); }
.hero-stat { display: flex; align-items: center; gap: 12px; }
.stat-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; }
.stat-icon.purple { color: var(--purple); background: var(--purple-soft); }
.stat-icon.coral { color: var(--coral); background: var(--coral-soft); }
.stat-icon.mint { color: #278c73; background: var(--mint-soft); }
.hero-stat strong { display: block; font-size: 14px; }
.hero-stat small { color: var(--muted); font-size: 11px; }

.hero-home > .container { width: 100%; }
.hero-home .hero-art { min-height: min(480px, 58svh); }
.hero-home .art-blob { width: min(420px, 50svh); height: min(420px, 50svh); }

.topics-section { background: rgba(255,255,255,.45); border-block: 1px solid var(--line); }
.topic-grid { display: grid; grid-template-columns: 1.2fr .9fr .9fr; gap: 22px; }
.topic-card { position: relative; min-height: 360px; display: flex; flex-direction: column; overflow: hidden; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; transition: transform .25s, box-shadow .25s, border-color .25s; }
.topic-card:hover { transform: translateY(-7px); border-color: #d7d1fa; box-shadow: var(--shadow-hover); }
.topic-card.featured { color: white; border-color: var(--purple); background: var(--purple); }
.topic-card.featured p, .topic-card.featured .topic-meta { color: rgba(255,255,255,.72); }
.topic-card.featured::after { content: ""; position: absolute; width: 220px; height: 220px; right: -85px; bottom: -85px; border: 35px solid rgba(255,255,255,.08); border-radius: 50%; }
.topic-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.topic-number { font-size: 12px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.topic-badge { padding: 5px 10px; border-radius: 20px; color: var(--purple); background: var(--purple-soft); font-size: 10px; font-weight: 900; }
.featured .topic-badge { color: var(--yellow); background: rgba(255,255,255,.12); }
.topic-card h3 { margin-bottom: 12px; font-size: 30px; }
.topic-card p { margin-bottom: 22px; font-size: 13px; line-height: 1.75; }
.topic-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: auto; margin-bottom: 20px; color: var(--muted); font-size: 11px; font-weight: 800; }
.topic-meta span { display: inline-flex; align-items: center; gap: 5px; }
.topic-meta .icon { width: 15px; height: 15px; }
.topic-card .text-link { margin-top: 4px; }
.featured .text-link { color: white; }
.topic-card.soon { align-items: center; justify-content: center; text-align: center; border-style: dashed; background: rgba(255,255,255,.55); }
.topic-card.soon:hover { transform: none; box-shadow: none; }
.soon-icon { width: 70px; height: 70px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 24px; color: #aaa5bc; background: #f0ede7; transform: rotate(-6deg); }
.soon-icon .icon { width: 31px; height: 31px; }
.topic-card.soon h3 { color: #918da0; font-size: 22px; }
.topic-card.soon p { max-width: 220px; font-size: 12px; }

.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.how-card { position: relative; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.step-number { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 22px; border: 2px solid var(--ink); border-radius: 14px; color: var(--ink); background: var(--yellow); box-shadow: 3px 4px 0 var(--ink); font-size: 15px; font-weight: 950; transform: rotate(-4deg); }
.how-card:nth-child(2) .step-number { color: white; background: var(--coral); transform: rotate(4deg); }
.how-card:nth-child(3) .step-number { color: white; background: var(--mint); }
.how-card h3 { margin-bottom: 12px; font-size: 21px; }
.how-card p { margin-bottom: 0; font-size: 13px; }
.group-banner { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; overflow: hidden; padding: 46px 50px; border: 2px solid var(--ink); border-radius: var(--radius-lg); color: white; background: var(--ink); box-shadow: 8px 9px 0 var(--yellow); }
.group-banner::before { content: ""; position: absolute; width: 300px; height: 300px; right: 100px; top: -170px; border: 45px solid rgba(255,255,255,.04); border-radius: 50%; }
.group-banner h2 { max-width: 650px; margin-bottom: 12px; font-size: clamp(30px, 4vw, 44px); }
.group-banner p { max-width: 600px; margin-bottom: 0; color: rgba(255,255,255,.66); }
.group-banner .button { position: relative; z-index: 1; }

.topic-hero { padding: 52px 0 36px; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; margin-bottom: 28px; color: var(--muted); font-size: 12px; font-weight: 750; }
.breadcrumbs a:hover { color: var(--purple); }
.topic-hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; align-items: center; gap: 50px; }
.topic-hero-copy { width: 100%; }
.topic-hero h1 { margin-bottom: 16px; font-size: clamp(48px, 6vw, 74px); }
.topic-tagline { max-width: 100%; margin-bottom: 18px; color: var(--ink); font-size: 20px; font-weight: 750; }
.topic-description { max-width: 100%; font-size: 16px; line-height: 1.8; }
.topic-tags { display: flex; flex-wrap: wrap; gap: 9px; margin: 24px 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: white; font-size: 11px; font-weight: 850; }
.tag .icon { width: 14px; height: 14px; }
.topic-hero-art { position: relative; min-height: 270px; display: flex; align-items: center; justify-content: center; }
.topic-hero-art .art-blob { width: 290px; height: 290px; background: #ffe3d9; }
.topic-hero-art .mission-character { width: 135px; margin: 0 -13px; }
.topic-hero-art .mission-character:nth-child(1) { transform: rotate(-7deg) translateY(25px); }
.topic-hero-art .mission-character:nth-child(2) { z-index: 2; transform: translateY(-12px) scale(1.1); }
.topic-hero-art .mission-character:nth-child(3) { transform: rotate(7deg) translateY(25px); }
.topic-hero-art .topic-hero-art-img { width: 100%; max-width: 420px; height: auto; border-radius: 22px; box-shadow: var(--shadow); }
.emergency-notice { display: flex; align-items: flex-start; gap: 15px; margin: 16px 0 0; padding: 18px 22px; border: 1px solid #f1d2b8; border-radius: 17px; background: #fff4e7; }
.emergency-notice > .icon { width: 23px; height: 23px; margin-top: 2px; color: #c66b31; }
.emergency-notice strong { display: block; margin-bottom: 3px; color: #9b5125; font-size: 13px; }
.emergency-notice p { margin-bottom: 0; color: #936d53; font-size: 12px; }
.scenario-card { display: grid; grid-template-columns: .78fr 1.22fr; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow); }
.scenario-visual { position: relative; min-height: 310px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--mint-soft); }
.scenario-visual::before { content: ""; position: absolute; width: 260px; height: 260px; border: 35px solid rgba(72,191,161,.1); border-radius: 50%; }
.scenario-visual .mission-character { z-index: 1; width: 145px; margin: 0 -17px; }
.scenario-visual .mission-character:nth-child(1) { transform: rotate(-5deg); }
.scenario-visual .mission-character:nth-child(2) { transform: translateY(-10px); }
.scenario-bubble { position: absolute; z-index: 3; top: 24px; right: 20px; max-width: 170px; padding: 11px 14px; border: 1.5px solid var(--ink); border-radius: 15px 15px 15px 3px; background: white; box-shadow: 3px 4px 0 var(--ink); font-size: 11px; font-weight: 850; transform: rotate(3deg); animation: chipFloat 4s ease-in-out infinite; }
.scenario-content { padding: 40px; }
.scenario-content h2 { margin-bottom: 9px; font-size: 32px; }
.scenario-setting { display: flex; align-items: center; gap: 7px; margin-bottom: 20px; color: var(--purple); font-size: 12px; font-weight: 850; }
.scenario-setting .icon { width: 16px; height: 16px; }
.scenario-content > p { font-size: 14px; line-height: 1.85; }
.scenario-goal { display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; padding: 14px 16px; border-radius: 13px; background: var(--yellow-soft); color: #836720; font-size: 12px; font-weight: 750; }
.scenario-goal .icon { width: 18px; height: 18px; margin-top: 1px; }

.practice-section { background: #f3f0ff; border-block: 1px solid #e5e0fa; }
.practice-shell { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 24px; align-items: start; }
.practice-sidebar { position: sticky; top: 105px; padding: 24px; border: 1px solid #e2ddf8; border-radius: var(--radius-md); background: rgba(255,255,255,.8); }
.practice-sidebar h3 { margin-bottom: 8px; font-size: 17px; }
.practice-sidebar > p { margin-bottom: 20px; font-size: 11px; }
.role-options { display: grid; gap: 9px; }
.role-option { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px; border: 1.5px solid transparent; border-radius: 14px; color: var(--ink); background: #f7f5fc; text-align: left; transition: border .2s, background .2s, transform .2s; }
.role-option:hover { transform: translateX(3px); }
.role-option.active { border-color: var(--purple); background: var(--purple-soft); }
.role-option .role-avatar { width: 43px; height: 43px; flex: 0 0 auto; overflow: hidden; border-radius: 13px; background: white; }
.role-option .role-avatar svg { width: 100%; height: 100%; }
.role-option strong { display: block; font-size: 12px; }
.role-option small { display: block; color: var(--muted); font-size: 9px; line-height: 1.3; }
.solo-progress { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.solo-progress-label { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 11px; font-weight: 850; }
.solo-progress .progress-track { background: #e9e5f4; }
.practice-main { min-width: 0; }
.practice-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.step-dots { display: flex; gap: 7px; }
.step-dot { width: 28px; height: 7px; padding: 0; border: 0; border-radius: 10px; background: #dcd6f2; transition: width .25s, background .25s; }
.step-dot.active { width: 45px; background: var(--purple); }
.step-dot.complete { background: var(--mint); }
.practice-xp { display: inline-flex; align-items: center; gap: 6px; color: #876315; font-size: 11px; font-weight: 900; }
.practice-xp .icon { width: 16px; height: 16px; color: #d79a24; }
.practice-card { overflow: hidden; border: 1px solid #e0daf5; border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow); }
.practice-card-head { display: flex; align-items: center; gap: 17px; padding: 27px 30px; border-bottom: 1px solid #efecf7; background: #fdfcff; }
.practice-card-head .role-avatar { width: 68px; height: 68px; flex: 0 0 auto; overflow: hidden; border-radius: 20px; background: var(--purple-soft); }
.practice-card-head .role-avatar svg { width: 100%; height: 100%; }
.practice-step-label { margin-bottom: 5px; color: var(--purple); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.practice-card-head h3 { margin-bottom: 4px; font-size: 24px; }
.practice-card-head p { margin-bottom: 0; font-size: 12px; }
.practice-card-body { padding: 30px; }
.partner-cue { position: relative; margin-bottom: 24px; padding: 17px 20px; border-radius: 16px 16px 16px 4px; color: #4f4b69; background: #f2effa; font-size: 14px; font-weight: 700; }
.partner-cue::before { content: ""; position: absolute; width: 12px; height: 12px; left: 0; bottom: -6px; background: #f2effa; transform: rotate(45deg); }
.hint-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 22px; }
.hint-chip { padding: 6px 10px; border: 1px dashed #cfc8e8; border-radius: 9px; color: #736c91; background: #fcfbff; font-size: 10px; font-weight: 750; }
.practice-textarea { width: 100%; min-height: 118px; resize: vertical; padding: 16px 18px; border: 1.5px solid #dfd9ee; border-radius: 15px; outline: none; color: var(--ink); background: white; font-size: 14px; line-height: 1.7; transition: border .2s, box-shadow .2s; }
.practice-textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(91,86,214,.09); }
.practice-textarea::placeholder { color: #aaa5ba; }
.textarea-meta { display: flex; justify-content: space-between; margin: 7px 2px 16px; color: #9893a7; font-size: 10px; }
.practice-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.practice-actions .button.primary { margin-left: auto; }
.model-answer { margin-top: 22px; padding: 20px; border: 1px solid #cceadd; border-radius: 16px; background: #f1fbf7; animation: reveal .3s ease both; }
.model-answer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.model-answer-head strong { color: #277e67; font-size: 12px; }
.model-answer > p { margin-bottom: 5px; color: #315e53; font-size: 15px; font-weight: 650; }
.model-answer .translation { margin-bottom: 0; color: #6d9388; font-size: 11px; }
.check-result { margin-top: 18px; padding: 15px 17px; border: 1px solid #eadfbf; border-radius: 14px; background: #fffaf0; animation: reveal .3s ease both; }
.check-result.good { border-color: #c8e8da; background: #f0faf5; }
.check-result strong { display: block; margin-bottom: 6px; font-size: 12px; }
.check-result p { margin-bottom: 0; font-size: 11px; }
.keyword-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.keyword-list span { padding: 4px 8px; border-radius: 7px; color: #856d32; background: #f8edcf; font-size: 9px; font-weight: 800; }
.keyword-list span.found { color: #26785f; background: #d9f0e6; }
.practice-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 30px; border-top: 1px solid #efecf7; background: #fdfcff; }
.practice-footer small { color: var(--muted); font-size: 10px; }

.vocabulary-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 22px; padding: 9px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); }
.filter-button { padding: 8px 15px; border: 1.5px solid transparent; border-radius: 20px; color: #5f5a70; background: #f7f5fc; font-size: 12px; font-weight: 850; white-space: nowrap; transition: color .2s, background .2s, border-color .2s, transform .2s, box-shadow .2s; }
.filter-button:hover { transform: translateY(-1px); color: var(--purple); border-color: #d7d1fa; background: var(--purple-soft); }
.filter-button.active { color: white; border-color: var(--purple); background: var(--purple); box-shadow: 0 8px 18px rgba(91,86,214,.2); }
.filter-button.active:hover { transform: none; color: white; border-color: var(--purple-dark); background: var(--purple-dark); }
.vocabulary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.vocab-card { display: grid; grid-template-columns: 42px 1fr; align-items: start; gap: 13px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: white; transition: transform .2s, box-shadow .2s; }
.vocab-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.vocab-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; }
.vocab-icon.symptoms { color: var(--coral); background: var(--coral-soft); }
.vocab-icon.pain { color: #c08b1d; background: var(--yellow-soft); }
.vocab-icon.history { color: var(--purple); background: var(--purple-soft); }
.vocab-icon.help { color: #278c73; background: var(--mint-soft); }
.vocab-icon .icon { width: 20px; height: 20px; }
.vocab-category { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.vocab-card h3 { margin-bottom: 4px; font-size: 15px; letter-spacing: -.01em; }
.vocab-meaning { margin-bottom: 5px; font-size: 11px; }
.vocab-example { margin-bottom: 0; color: #9792a4; font-size: 10px; font-style: italic; }
.discussion-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.discussion-card { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.discussion-number { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 11px; color: var(--purple); background: var(--purple-soft); font-size: 12px; font-weight: 950; }
.discussion-card h3 { margin-bottom: 13px; font-size: 19px; line-height: 1.4; }
.sentence-starter { padding: 12px 14px; border-left: 3px solid var(--yellow); border-radius: 0 10px 10px 0; background: #fffaf0; }
.sentence-starter small { display: block; margin-bottom: 4px; color: #a18b58; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.sentence-starter p { margin-bottom: 0; color: #7a6c48; font-size: 11px; font-weight: 700; }
.topic-group-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 46px; padding: 28px 32px; border: 1px solid #ded9f6; border-radius: 20px; background: var(--purple-soft); }
.topic-group-cta h3 { margin-bottom: 6px; font-size: 21px; }
.topic-group-cta p { margin-bottom: 0; font-size: 12px; }

.room-page { padding: 34px 0 70px; }
.room-topline { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.room-code-box { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.room-code-box small { color: var(--muted); font-size: 10px; font-weight: 800; }
.room-code-box strong { color: var(--purple); font-size: 16px; letter-spacing: .12em; }
.copy-button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: #f4f1eb; }
.copy-button .icon { width: 15px; height: 15px; }
.room-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; align-items: start; }
.room-stage, .room-sidebar { border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.room-stage { overflow: hidden; }
.room-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 25px; border-bottom: 1px solid var(--line); }
.room-stage-head h1 { margin-bottom: 3px; font-size: 23px; }
.room-stage-head p { margin-bottom: 0; font-size: 11px; }
.timer { min-width: 80px; padding: 8px 12px; border-radius: 12px; color: var(--purple); background: var(--purple-soft); text-align: center; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer.running { color: #27866e; background: var(--mint-soft); }
.room-members-strip { display: flex; gap: 10px; overflow-x: auto; padding: 18px 25px; border-bottom: 1px solid var(--line); background: #fdfcff; }
.room-member-chip { min-width: 90px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.room-member-chip .mini-avatar { width: 32px; height: 32px; border-radius: 10px; }
.room-member-chip strong { display: block; max-width: 90px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.room-member-chip small { display: block; color: var(--muted); font-size: 8px; }
.room-member-chip.offline { opacity: .5; }
.room-stage-body { padding: 26px; }
.room-prompt { padding: 18px 20px; border-radius: 15px; background: var(--purple-soft); }
.room-prompt .practice-step-label { margin-bottom: 6px; }
.room-prompt h2 { margin-bottom: 8px; font-size: 22px; }
.room-prompt p { margin-bottom: 0; color: #686184; font-size: 12px; }
.room-transcript { display: grid; gap: 12px; margin: 22px 0; }
.transcript-empty { padding: 26px; border: 1px dashed #ddd7e9; border-radius: 14px; text-align: center; }
.transcript-empty .icon { width: 28px; height: 28px; margin: 0 auto 10px; color: #b3abc9; }
.transcript-empty p { margin-bottom: 0; font-size: 11px; }
.transcript-message { display: grid; grid-template-columns: 38px 1fr; gap: 11px; align-items: start; animation: reveal .3s ease both; }
.transcript-message .mini-avatar { width: 38px; height: 38px; border-radius: 12px; }
.transcript-bubble { min-width: 0; padding: 12px 15px; border-radius: 4px 15px 15px 15px; background: #f5f2fa; }
.transcript-bubble strong { display: block; margin-bottom: 3px; font-size: 10px; }
.transcript-bubble p { margin-bottom: 0; color: #5f596f; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.room-response-form textarea { min-height: 100px; }
.room-response-form .practice-actions { margin-top: 12px; }
.room-response-form .practice-actions .button.primary { margin-left: 0; }
.room-sidebar { overflow: hidden; }
.sidebar-section { padding: 22px; border-bottom: 1px solid var(--line); }
.sidebar-section:last-child { border-bottom: 0; }
.sidebar-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; font-size: 15px; }
.sidebar-section h3 .icon { width: 17px; height: 17px; color: var(--purple); }
.role-switcher { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.role-switcher button { padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: white; font-size: 9px; font-weight: 850; }
.role-switcher button.active { color: white; border-color: var(--purple); background: var(--purple); }
.room-roster { display: grid; gap: 11px; }
.roster-person { display: flex; align-items: center; gap: 9px; }
.roster-person .mini-avatar { width: 34px; height: 34px; }
.roster-person strong { display: block; max-width: 140px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.roster-person small { display: block; color: var(--muted); font-size: 9px; }
.host-badge { margin-left: auto; padding: 3px 6px; border-radius: 6px; color: #886518; background: var(--yellow-soft); font-size: 8px; font-weight: 900; }
.host-controls { display: grid; gap: 8px; }
.host-controls .button { width: 100%; }
.sidebar-tip { margin-bottom: 0; color: var(--muted); font-size: 10px; }
.room-error-card, .room-welcome-card { max-width: 650px; margin: 60px auto; padding: 45px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow); text-align: center; }
.room-error-card .soon-icon, .room-welcome-card .soon-icon { margin-inline: auto; }
.room-error-card h1, .room-welcome-card h1 { margin-bottom: 13px; font-size: 32px; }
.room-error-card p, .room-welcome-card p { margin-bottom: 24px; font-size: 14px; }
.not-found { min-height: 60vh; display: grid; place-items: center; padding: 60px 24px; text-align: center; }
.not-found h1 { font-size: 42px; }
.not-found p { margin-bottom: 24px; }


.modal { width: min(460px, calc(100% - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 38px; border: 1px solid var(--line); border-radius: 28px; color: var(--ink); background: var(--paper); box-shadow: 0 30px 100px rgba(37,36,66,.25); }
.modal::backdrop { background: rgba(37,36,66,.42); backdrop-filter: blur(5px); }
.modal[open] { animation: modalIn .25s ease both; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal-kicker { margin-bottom: 10px; color: var(--purple); font-size: 10px; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.modal h2 { margin-bottom: 11px; font-size: 30px; }
.modal > p { margin-bottom: 24px; font-size: 12px; }
.field-label { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 850; }
.modal input { width: 100%; height: 50px; padding: 0 15px; border: 1.5px solid #ded9cf; border-radius: 13px; outline: 0; color: var(--ink); background: white; font-size: 14px; }
.modal input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(91,86,214,.09); }
.avatar-label { margin-top: 20px; }
.avatar-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.avatar-choice { aspect-ratio: 1; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 13px; background: #ede9f7; transition: transform .2s, border .2s; }
.avatar-choice svg { width: 100%; height: 100%; }
.avatar-choice:hover { transform: translateY(-3px); }
.avatar-choice.active { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.form-error { min-height: 18px; margin: 12px 0 8px; color: #c44d4d; font-size: 11px; font-weight: 700; }
.privacy-note { display: block; margin-top: 14px; color: #9a95a5; font-size: 9px; text-align: center; }
.modal-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #aaa4b1; font-size: 10px; }
.modal-divider::before, .modal-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
#room-code { font-size: 22px; font-weight: 900; letter-spacing: .2em; text-align: center; text-transform: uppercase; }
.toast { position: fixed; z-index: 150; left: 50%; bottom: 28px; max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 13px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 12px; font-weight: 750; transform: translateX(-50%); animation: toastIn .25s ease both; }
.confetti { position: fixed; z-index: 140; inset: 0; overflow: hidden; pointer-events: none; }
.confetti-piece { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: confettiFall 1.8s ease-in forwards; }

.site-footer { padding: 26px 24px; border-top: 1px solid var(--line); background: rgba(255,255,255,.55); }
.footer-inner { width: min(1180px, 100%); margin: auto; display: flex; align-items: center; justify-content: center; gap: 20px; text-align: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 900; }
.footer-inner p, .footer-inner > span { margin-bottom: 0; font-size: 10px; }
.footer-copyright { color: var(--muted); }
.footer-picker { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: white; font-size: 10px; font-weight: 850; transition: all .2s; }
.footer-picker:hover { color: var(--purple); border-color: #d7d1fa; background: var(--purple-soft); }
.footer-picker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.footer-picker.is-active { color: white; border-color: var(--purple); background: var(--purple); }
.footer-picker.is-active .footer-picker-dot { background: white; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes cardFloat { 0%,100% { transform: rotate(2deg) translateY(0); } 50% { transform: rotate(1deg) translateY(-9px); } }
@keyframes chipFloat { 0%,100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes blobMorph { 0% { border-radius: 42% 58% 63% 37% / 47% 38% 62% 53%; transform: rotate(-8deg); } 100% { border-radius: 57% 43% 38% 62% / 61% 55% 45% 39%; transform: rotate(3deg); } }
@keyframes confettiFall { to { transform: translate3d(var(--drift), 105vh, 0) rotate(720deg); opacity: 0; } }

@media (max-width: 1050px) {
  .main-nav { gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.68); }
  .main-nav a { padding: 6px 10px; border-radius: 9px; font-size: 12px; white-space: nowrap; }
  .main-nav a::after { display: none; }
  .main-nav a:hover { background: var(--purple-soft); }
  .main-nav .nav-home-link { padding: 6px 10px; border-color: transparent; background: transparent; }
  body.is-home:not(.is-topics-view) .main-nav a[href="/"],
  body.is-topics-view .main-nav a[href="/#topics"],
  body:not(.is-home) .main-nav a[href="/#topics"] { background: var(--purple-soft); }
  .hero-grid { gap: 28px; }
  .hero h1 { font-size: clamp(44px, 6.5vw, 66px); }
  .hero-art { min-height: 420px; }
  .art-blob { width: 350px; height: 350px; }
  .floating-chip { font-size: 9px; }
  .chip-one { right: 0; }
  .chip-two { left: 0; }
  .topic-grid { grid-template-columns: 1fr 1fr; }
  .topic-card.featured { grid-row: span 2; }
  .practice-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .practice-sidebar { padding: 18px; }
  .room-grid { grid-template-columns: minmax(0, 1fr) 270px; }
}

@media (max-width: 800px) {
  .site-header { padding: 10px 16px; }
  .header-inner { gap: 12px; }
  .brand-copy strong { font-size: 14px; }
  .brand-mark { width: 38px; height: 38px; }
  .container { width: min(100% - 32px, 1180px); }
  .section { padding: 62px 0; }
  .hero { padding: 54px 0 50px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-description { margin-inline: auto; }
  .hero-actions, .hero-note { justify-content: center; }
  .hero-art { min-height: 430px; }
  .hero-stats { margin-top: 45px; }
  .section-heading { display: block; }
  .section-heading .text-link { margin-top: 14px; }
  .topic-grid { grid-template-columns: 1fr; }
  .topic-card.featured { grid-row: auto; }
  .topic-card { min-height: 310px; }
  .topic-card.soon { min-height: 240px; }
  .how-grid { grid-template-columns: 1fr; }
  .group-banner { grid-template-columns: 1fr; padding: 35px; }
  .group-banner .button { justify-self: start; }
  .topic-hero-grid { grid-template-columns: 1fr; }
  .topic-hero-copy { text-align: center; }
  .topic-tagline, .topic-description { margin-inline: auto; }
  .topic-tags { justify-content: center; }
  .topic-hero-art { min-height: 240px; }
  .scenario-card { grid-template-columns: 1fr; }
  .scenario-visual { min-height: 270px; }
  .practice-shell { grid-template-columns: 1fr; }
  .practice-sidebar { position: static; }
  .role-options { grid-template-columns: repeat(3, 1fr); }
  .role-option { flex-direction: column; text-align: center; }
  .role-option small { display: none; }
  .solo-progress { margin-top: 18px; padding-top: 15px; }
  .vocabulary-grid, .discussion-grid { grid-template-columns: 1fr; }
  .topic-group-cta { align-items: flex-start; flex-direction: column; }
  .room-grid { grid-template-columns: 1fr; }
  .room-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .sidebar-section { border-right: 1px solid var(--line); }
  .sidebar-section:last-child { border-right: 0; }
  .footer-inner { flex-wrap: wrap; justify-content: center; text-align: center; }
}

@media (max-width: 520px) {
  .brand-copy { display: none; }
  .hero h1 { font-size: 43px; }
  .hero-description { font-size: 14px; }
  .hero-actions .button { width: 100%; }
  .hero-art { min-height: 390px; }
  .art-blob { width: 300px; height: 300px; }
  .mission-card { padding: 21px; box-shadow: 6px 7px 0 var(--ink); }
  .floating-chip { padding: 8px 10px; box-shadow: 3px 3px 0 var(--ink); }
  .chip-one { top: 30px; }
  .chip-two { bottom: 50px; }
  .chip-three { display: none; }
  .hero-stats { grid-template-columns: 1fr; gap: 18px; }
  .hero-stat { justify-content: center; }
  .section-heading h2 { font-size: 32px; }
  .topic-card { padding: 25px; }
  .group-banner { padding: 28px; box-shadow: 5px 6px 0 var(--yellow); }
  .topic-hero h1 { font-size: 48px; }
  .topic-tagline { font-size: 17px; }
  .scenario-content { padding: 26px; }
  .scenario-content h2 { font-size: 27px; }
  .role-options { gap: 6px; }
  .role-option { padding: 8px 4px; }
  .role-option .role-avatar { width: 36px; height: 36px; }
  .practice-topbar { align-items: flex-start; }
  .step-dots { gap: 4px; }
  .step-dot { width: 18px; }
  .step-dot.active { width: 30px; }
  .practice-card-head { padding: 21px; }
  .practice-card-head .role-avatar { width: 55px; height: 55px; }
  .practice-card-head h3 { font-size: 20px; }
  .practice-card-body { padding: 21px; }
  .practice-actions .button { flex: 1; }
  .practice-actions .button.primary { margin-left: 0; }
  .practice-footer { padding: 16px 21px; }
  .practice-footer small { display: none; }
  .practice-footer .button { width: 100%; }
  .vocab-card { grid-template-columns: 36px 1fr; gap: 10px; padding: 16px; }
  .vocab-icon { width: 36px; height: 36px; }
  .vocab-card h3 { font-size: 13px; }
  .room-topline { align-items: flex-start; flex-direction: column; }
  .room-stage-head, .room-stage-body { padding: 20px; }
  .room-members-strip { padding: 15px 20px; }
  .room-sidebar { grid-template-columns: 1fr; }
  .sidebar-section { border-right: 0; }
  .modal { padding: 32px 24px; }
  .modal h2 { font-size: 27px; }
  .avatar-picker { gap: 5px; }
  .room-error-card, .room-welcome-card { padding: 32px 24px; }
}

@media (max-width: 800px) {
  .hero.hero-home { min-height: calc(100svh - 79px); padding: 20px 0; }
  .hero-home .hero-grid { gap: 16px; }
  .hero-home .eyebrow { margin-bottom: 10px; font-size: 10px; }
  .hero.hero-home h1 { margin-bottom: 14px; font-size: clamp(34px, 10vw, 43px); }
  .hero-home .hero-description { margin-bottom: 18px; font-size: 13px; line-height: 1.6; }
  .hero-home .hero-actions { flex-wrap: nowrap; gap: 8px; }
  .hero-home .hero-actions .button { width: auto; flex: 1; min-height: 44px; padding: 11px 10px; font-size: 12px; }
  .hero-home .hero-note { display: none; }
  .hero-home .hero-art { min-height: 300px; }
  .hero-home .art-blob { width: 260px; height: 260px; }
  .hero-home .mission-card { width: min(320px, 100%); padding: 17px; border-radius: 22px; box-shadow: 6px 7px 0 var(--ink); }
  .hero-home .mission-top { margin-bottom: 12px; }
  .hero-home .mission-card h3 { font-size: 21px; }
  .hero-home .mission-card > p { margin-bottom: 10px; font-size: 11px; }
  .hero-home .mission-characters { height: 110px; margin-bottom: 14px; }
  .hero-home .floating-chip { display: none; }
}

@media (max-width: 800px) and (max-height: 740px) {
  .hero-home .hero-art { min-height: 230px; }
  .hero-home .mission-card > p,
  .hero-home .mission-progress-label,
  .hero-home .mission-card .progress-track { display: none; }
  .hero-home .mission-characters { height: 90px; margin-bottom: 4px; }
}

@media (max-width: 800px) and (max-height: 620px) {
  .hero.hero-home { padding: 12px 0; }
  .hero-home .hero-grid { gap: 8px; }
  .hero.hero-home h1 { margin-bottom: 6px; font-size: 32px; }
  .hero-home .hero-description { display: none; }
}

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

.home-page .hero.hero-home { min-height: calc(100svh - 175px); display: flex; align-items: center; padding: clamp(34px, 5vh, 58px) 0 clamp(30px, 4vh, 46px); }
.home-page .hero-home > .container { width: min(1180px, calc(100% - 64px)); }
.home-page .hero-home .hero-grid { grid-template-columns: 1.04fr .96fr; gap: clamp(30px, 5vw, 72px); }
.home-page .hero-home h1 { max-width: 620px; margin-bottom: 22px; font-size: clamp(44px, 5.2vw, 68px); line-height: 1.02; letter-spacing: -.06em; }
.home-page .hero-home .hero-description { max-width: 590px; margin-bottom: 28px; }
.hero-description > span { display: block; }
.hero-description > span:first-child { color: #5f5c72; font-size: 16px; line-height: 1.75; }
.browse-button { min-width: 184px; min-height: 54px; justify-content: space-between; gap: 18px; padding: 12px 13px 12px 21px; border-radius: 17px; background: linear-gradient(135deg, #6b65e8, var(--purple-dark)); box-shadow: 0 12px 25px rgba(91,86,214,.24); }
.browse-button:hover { box-shadow: 0 17px 30px rgba(91,86,214,.3); }
.button-arrow { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); transition: transform .2s, background .2s; }
.button-arrow .icon { width: 17px; height: 17px; }
.browse-button:hover .button-arrow { background: rgba(255,255,255,.28); transform: translateX(2px); }
.home-page .hero-home .hero-note { margin-top: 18px; }
.home-page .hero-home .hero-art { position: relative; min-height: 370px; display: block; }
.home-page .hero-home .art-blob { width: min(370px, 34vw); height: min(370px, 34vw); top: 50%; left: 50%; translate: -50% -50%; }
.home-page .hero-person { position: absolute; z-index: 2; width: 150px; filter: drop-shadow(0 16px 9px rgba(37,36,66,.12)); transform-origin: bottom center; }
.home-page .hero-person .avatar-svg { width: 100%; }
.home-page .person-one { left: 2%; bottom: 8px; transform: rotate(-6deg); animation: personBob 5s ease-in-out infinite; }
.home-page .person-two { z-index: 3; left: 50%; bottom: 0; width: 174px; translate: -50% 0; animation: personBob 5s ease-in-out -.8s infinite; }
.home-page .person-three { right: 1%; bottom: 10px; transform: rotate(6deg); animation: personBob 5s ease-in-out -1.6s infinite; }
.speech-bubble { position: absolute; z-index: 5; padding: 9px 13px; border: 1.5px solid var(--ink); border-radius: 14px 14px 14px 4px; background: white; box-shadow: 3px 4px 0 var(--ink); font-size: 11px; font-weight: 900; white-space: nowrap; animation: chipFloat 4s ease-in-out infinite; }
.speech-bubble::after { content: ""; position: absolute; left: 12px; bottom: -7px; width: 11px; height: 11px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); background: inherit; transform: rotate(45deg); }
.bubble-one { top: 36px; left: 0; color: var(--purple); transform: rotate(-4deg); }
.bubble-two { top: 4px; right: 4%; color: #278c73; transform: rotate(4deg); animation-delay: -1.2s; }
.bubble-three { right: 0; bottom: 116px; color: #c45b4c; transform: rotate(3deg); animation-delay: -2.4s; }
.club-sticker { position: absolute; z-index: 6; left: 4%; bottom: 126px; width: 74px; height: 74px; display: grid; place-content: center; border: 2px solid var(--ink); border-radius: 50%; color: var(--ink); background: var(--yellow); box-shadow: 4px 5px 0 var(--ink); text-align: center; transform: rotate(-10deg); }
.club-sticker strong { font-size: 26px; line-height: 1; }
.club-sticker span { margin-top: 3px; font-size: 9px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }

.unit-map-art { display: grid; place-items: center; }
.unit-map-card { position: relative; z-index: 2; width: min(420px, 100%); padding: 20px; border: 2px solid var(--ink); border-radius: 28px; background: white; box-shadow: 9px 10px 0 var(--ink); transform: rotate(1.5deg); }
.unit-map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.unit-map-head > div { display: flex; flex-direction: column; }
.unit-map-head span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.unit-map-head strong { font-size: 24px; line-height: 1.2; letter-spacing: -.035em; }
.unit-map-spark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #a67516 !important; background: var(--yellow-soft); transform: rotate(7deg); }
.unit-map-spark .icon { width: 20px; height: 20px; }
.unit-map-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.unit-map-tile { --tile: var(--purple); --tile-soft: var(--purple-soft); position: relative; min-width: 0; aspect-ratio: 1.28; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px solid color-mix(in srgb, var(--tile) 16%, white); border-radius: 12px; color: var(--tile); background: var(--tile-soft); }
.unit-map-tile > span { font-size: 8px; font-weight: 950; letter-spacing: .08em; opacity: .72; }
.unit-map-tile .icon { width: 21px; height: 21px; }
.unit-map-tile.is-ready { border-color: var(--tile); box-shadow: inset 0 0 0 1px var(--tile); }
.unit-map-tile.is-ready::after { content: ""; position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--tile); }
.unit-map-tile.accent-purple { --tile: #5b56d6; --tile-soft: #eeecff; }
.unit-map-tile.accent-coral { --tile: #ef705f; --tile-soft: #fff0e9; }
.unit-map-tile.accent-blue { --tile: #4097d8; --tile-soft: #e8f4ff; }
.unit-map-tile.accent-yellow { --tile: #d79b24; --tile-soft: #fff5d8; }
.unit-map-tile.accent-mint { --tile: #36a98b; --tile-soft: #e4f8f1; }
.unit-map-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.unit-map-avatars { display: flex; padding-left: 7px; }
.unit-map-avatars .avatar-svg { width: 38px; height: 44px; margin-left: -7px; padding: 2px 3px 0; border: 2px solid white; border-radius: 12px; background: var(--purple-soft); }
.unit-map-avatars .avatar-svg:nth-child(2) { background: var(--mint-soft); }
.unit-map-avatars .avatar-svg:nth-child(3) { background: var(--coral-soft); }
.unit-map-progress { min-width: 0; flex: 1; }
.unit-map-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.unit-map-progress span { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.unit-map-progress strong { color: var(--purple); font-size: 10px; white-space: nowrap; }
.unit-map-progress-track { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.unit-map-progress-track span { height: 5px; border-radius: 5px; background: #ece9f3; }
.unit-map-progress-track span.is-ready { background: var(--mint); }

.home-topics { display: none; padding: 32px 0 50px; scroll-margin-top: 88px; }
.home-page.is-topics-view .hero-home { display: none; }
.home-page.is-topics-view .home-topics { display: block; min-height: calc(100svh - 175px); animation: topicsViewIn .36s ease both; }

@keyframes topicsViewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
.home-topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.topic-tile { --tile: var(--purple); --tile-soft: var(--purple-soft); position: relative; min-width: 0; min-height: 205px; display: flex; flex-direction: column; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 21px; color: var(--ink); background: white; text-align: left; box-shadow: 0 7px 20px rgba(62,54,105,.035); transition: transform .22s, box-shadow .22s, border-color .22s; }
.topic-tile:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--tile) 38%, white); box-shadow: 0 17px 34px rgba(62,54,105,.11); }
.topic-tile:focus-visible { outline-offset: 3px; }
.topic-tile.accent-purple { --tile: #5b56d6; --tile-soft: #eeecff; }
.topic-tile.accent-coral { --tile: #ef705f; --tile-soft: #fff0e9; }
.topic-tile.accent-blue { --tile: #4097d8; --tile-soft: #e8f4ff; }
.topic-tile.accent-yellow { --tile: #d79b24; --tile-soft: #fff5d8; }
.topic-tile.accent-mint { --tile: #36a98b; --tile-soft: #e4f8f1; }
.topic-tile::before { content: ""; position: absolute; width: 120px; height: 120px; right: -58px; top: -58px; border-radius: 50%; background: var(--tile-soft); }
.topic-tile-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.unit-chip { color: var(--tile); font-size: 9px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.topic-status { padding: 3px 7px; border-radius: 10px; color: var(--muted); background: #f5f2ec; font-size: 8px; font-weight: 900; white-space: nowrap; }
.is-ready .topic-status { color: #247a63; background: #e4f7ef; }
.topic-tile-body { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; gap: 6px; padding: 14px 0 12px; }
.topic-tile-copy { min-width: 0; width: 69%; }
.topic-tile h3 { margin-bottom: 4px; font-size: 17px; line-height: 1.18; letter-spacing: -.025em; }
.topic-alt-title { margin-bottom: 8px; color: var(--tile); font-size: 10px; font-weight: 850; line-height: 1.35; }
.home-topic-grid .topic-tagline { display: -webkit-box; margin-bottom: 0; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.topic-tile-art { position: relative; width: 31%; align-self: stretch; flex: 0 0 31%; }
.topic-tile-art .avatar-svg { position: absolute; z-index: 2; right: -12px; bottom: -13px; width: 82px; max-width: none; filter: drop-shadow(0 7px 4px rgba(37,36,66,.09)); }
.topic-icon-bubble { position: absolute; z-index: 3; top: 3px; right: -2px; width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 11px; color: var(--tile); background: white; box-shadow: 2px 3px 0 var(--ink); transform: rotate(7deg); }
.topic-icon-bubble .icon { width: 17px; height: 17px; }
.topic-tile-footer { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid #f0ede7; color: var(--tile); font-size: 9px; font-weight: 900; }
.topic-tile-footer .icon { width: 15px; height: 15px; transition: transform .2s; }
.topic-tile:hover .topic-tile-footer .icon { transform: translateX(3px); }
.topic-tile.is-soon { background: #fffdf9; }
.topic-tile.is-soon .topic-tile-art { opacity: .82; }

@keyframes personBob { 0%,100% { translate: 0 0; } 50% { translate: 0 -7px; } }

@media (max-width: 1100px) {
  .home-topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-page .hero-person { width: 132px; }
  .home-page .person-two { width: 152px; }
  .bubble-three { bottom: 104px; }
}

/* ---------- Unit 9 topic modules: key vocabulary, symptom library, dialogue studio ---------- */
.module-block { margin-bottom: 46px; }
.module-block:last-child { margin-bottom: 0; }
.module-title { margin-bottom: 18px; font-size: 21px; }
.module-title-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.module-title-row .module-title { margin-bottom: 0; }
.module-hint { color: var(--muted); font-size: 12px; }

.pattern-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pattern-card { position: relative; display: grid; grid-template-rows: auto auto auto auto; gap: 8px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: white; transition: transform .2s, box-shadow .2s; }
.pattern-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pattern-index { position: absolute; top: 14px; right: 16px; color: #ded8f7; font-size: 22px; font-weight: 950; letter-spacing: -.04em; }
.pattern-card h4 { margin: 0; padding-right: 34px; font-size: 17px; line-height: 1.4; }
.pattern-card .slot { padding: 1px 3px; border-radius: 6px; color: #5b4c12; background: var(--yellow-soft); font-weight: 900; }
.pattern-meaning { margin: 0; font-size: 12px; }
.pattern-example { margin: 0; color: #9792a4; font-size: 11px; font-style: italic; }

.strategy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.strategy-card { position: relative; padding: 24px; border: 1px solid #ded9f6; border-radius: 18px; background: #fbfaff; }
.strategy-index { display: inline-block; margin-bottom: 10px; padding: 4px 9px; border-radius: 8px; color: white; background: var(--purple); font-size: 10px; font-weight: 900; }
.strategy-card h4 { margin-bottom: 7px; font-size: 17px; }
.strategy-card p { margin-bottom: 10px; font-size: 12px; }
.strategy-example { margin: 0; padding: 11px 13px; border-left: 3px solid var(--mint); border-radius: 0 10px 10px 0; color: #315e53; background: var(--mint-soft); font-size: 13px; font-weight: 700; }

.condition-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.condition-card { padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: white; }
.condition-card.chronic { border-color: #cceadd; background: #f6fdfa; }
.condition-card.acute { border-color: #f2d7cd; background: #fff9f6; }
.condition-card h4 { margin-bottom: 6px; font-size: 19px; }
.condition-note { margin-bottom: 14px; font-size: 12px; }
.condition-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 18px; padding: 0; list-style: none; }
.condition-list li { padding: 5px 11px; border: 1px solid var(--line); border-radius: 20px; color: #5f5a70; background: white; font-size: 11px; font-weight: 800; }
.condition-examples small { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.condition-examples p { margin-bottom: 6px; padding: 9px 12px; border-radius: 10px; color: #4f4b69; background: white; font-size: 12px; font-weight: 700; }

.symptom-section { background: rgba(255,255,255,.5); border-block: 1px solid var(--line); }
.symptom-hint { margin-bottom: 18px; padding: 12px 15px; border-radius: 12px; color: #6b6480; background: var(--purple-soft); font-size: 12px; font-weight: 700; }
.symptom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.symptom-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: white; transition: transform .2s, box-shadow .2s; }
.symptom-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.symptom-card.is-urgent { border-color: #f2c4b8; background: #fff6f3; }
.symptom-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.symptom-card h3 { margin: 0; font-size: 16px; }
.symptom-urgent { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; padding: 4px 8px; border-radius: 8px; color: #b5503c; background: #ffe4dc; font-size: 9px; font-weight: 900; }
.symptom-urgent .icon { width: 12px; height: 12px; }
.symptom-say { margin: 0; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.6; }
.symptom-translation { margin: 0; color: #9792a4; font-size: 11px; }
.symptom-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.symptom-link { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 0; border-radius: 8px; color: var(--purple); background: var(--purple-soft); font-size: 10px; font-weight: 850; transition: all .2s; }
.symptom-link:hover { color: white; background: var(--purple); }
.symptom-link .icon { width: 13px; height: 13px; }

#symptom-content { flex: 1; display: flex; flex-direction: column; }
#dialogue-content { flex: 1; display: flex; flex-direction: column; }
.symptom-layout { flex: 1; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 22px; align-items: stretch; }
.symptom-nav { position: sticky; top: 156px; align-self: start; max-height: calc(100vh - 178px); overflow-y: auto; padding: 16px; border: 1px solid #e2ddf8; border-radius: var(--radius-md); background: rgba(255,255,255,.82); box-shadow: 0 12px 30px rgba(62,54,105,.06); scrollbar-width: thin; }
.symptom-nav-title { margin: 0 0 12px; padding: 0 3px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.symptom-nav-tabs { display: grid; gap: 5px; }
.symptom-nav-tab { width: 100%; padding: 9px 12px; border: 1.5px solid transparent; border-radius: 11px; color: #5f5a70; background: #f7f5fc; font-size: 12px; font-weight: 850; text-align: left; transition: color .2s, border-color .2s, background .2s, transform .2s, box-shadow .2s; }
.symptom-nav-tab:hover { transform: translateX(2px); color: var(--purple); border-color: #d7d1fa; background: white; }
.symptom-nav-tab.active { color: white; border-color: var(--purple); background: var(--purple); box-shadow: 0 8px 18px rgba(91,86,214,.2); }

.symptom-keyword-groups { display: grid; gap: 18px; }
.symptom-keyword-group { display: flex; flex-direction: column; padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.symptom-keyword-group-title { margin: 0 0 14px; font-size: 15px; }
.symptom-keyword-list { flex: 1; display: flex; flex-wrap: wrap; align-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.symptom-keyword-list li { padding: 7px 12px; border: 1px solid #e4dff7; border-radius: 20px; color: #4f4b69; background: #f8f6ff; font-size: 12px; font-weight: 750; transition: color .2s, background .2s, border-color .2s; }
.symptom-keyword-list li:hover { color: white; border-color: var(--purple); background: var(--purple); }

.dialogue-section { background: #f3f0ff; border-block: 1px solid #e5e0fa; }
.dialogue-layout { flex: 1; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 22px; align-items: stretch; }
.dialogue-nav { position: sticky; top: 156px; align-self: start; max-height: calc(100vh - 178px); overflow-y: auto; padding: 18px 20px 20px; border: 1px solid #e2ddf8; border-radius: var(--radius-md); background: rgba(255,255,255,.82); }
/* 父级＝分区标题（深色、加粗、带分隔线和圆形箭头）；子级＝缩进列表项（浅色、小字、挂在竖向导轨上） */
.dialogue-group { margin-top: 16px; }
.dialogue-group:first-of-type { margin-top: 0; }
.dialogue-pair { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 2px 12px; border: 0; border-top: 1.5px solid var(--line); border-radius: 0; color: var(--ink); background: transparent; font-size: 14.5px; font-weight: 900; letter-spacing: .01em; text-align: left; cursor: pointer; transition: color .2s; }
.dialogue-group:first-of-type .dialogue-pair { border-top: 0; padding-top: 2px; }
.dialogue-pair:hover { color: var(--purple); }
.dialogue-group.is-open .dialogue-pair { color: var(--purple); }
.dialogue-pair-label { display: inline-flex; align-items: center; gap: 8px; }
.dialogue-pair-arrow { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; color: var(--muted); background: #f1eefc; transition: transform .22s ease, color .2s, background .2s; }
.dialogue-pair-arrow .icon { width: 13px; height: 13px; }
.dialogue-group.is-open .dialogue-pair-arrow { color: white; background: var(--purple); transform: rotate(90deg); }
.dialogue-tabs { display: grid; gap: 4px; margin: 8px 0 0 5px; padding-left: 13px; border-left: 2px solid var(--line); }
.dialogue-tabs[hidden] { display: none; }
.dialogue-tab { width: 100%; padding: 10px 12px; border: 1.5px solid transparent; border-radius: 10px; color: #6b6680; background: transparent; font-size: 13px; font-weight: 700; line-height: 1.45; text-align: left; transition: all .2s; }
.dialogue-tab:hover { color: var(--purple); border-color: #d7d1fa; background: white; }
.dialogue-tab.active { color: white; border-color: var(--purple); background: var(--purple); font-weight: 800; }
.dialogue-panel { min-width: 0; padding: 26px; border: 1px solid #e0daf5; border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow); }
.dialogue-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #efecf7; }
.dialogue-head h3 { margin-bottom: 6px; font-size: 24px; }
.dialogue-setting { display: flex; align-items: center; gap: 7px; margin-bottom: 0; color: var(--purple); font-size: 11px; font-weight: 750; }
.dialogue-setting .icon { width: 15px; height: 15px; flex: 0 0 auto; }
.dialogue-lines { display: grid; gap: 14px; }
.dialogue-line { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: start; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: white; transition: border-color .25s, background .25s; }
.dialogue-avatar { width: 46px; height: 46px; display: block; overflow: hidden; border-radius: 14px; background: var(--purple-soft); }
.dialogue-avatar svg { width: 100%; height: 100%; }
.dialogue-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.dialogue-meta strong { color: var(--ink); font-size: 12px; }
.dialogue-text { margin-bottom: 5px; color: var(--ink); font-size: 15px; font-weight: 650; line-height: 1.6; }
.dialogue-translation { margin: 0; color: #9792a4; font-size: 11px; }

.culture-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.culture-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: white; }
.culture-index { display: inline-block; margin-bottom: 10px; padding: 4px 9px; border-radius: 8px; color: #9b5125; background: #fff4e7; font-size: 10px; font-weight: 900; }
.culture-card h3 { margin-bottom: 8px; font-size: 16px; }
.culture-card p { margin-bottom: 0; font-size: 12px; line-height: 1.7; }

@media (max-width: 1000px) {
  .pattern-grid { grid-template-columns: repeat(2, 1fr); }
  .symptom-grid { grid-template-columns: repeat(2, 1fr); }
  .culture-grid { grid-template-columns: repeat(2, 1fr); }
  .dialogue-layout { grid-template-columns: 1fr; }
  .dialogue-nav { position: static; }
  .dialogue-tabs { grid-template-columns: 1fr; }
  .symptom-layout { grid-template-columns: 1fr; }
  .symptom-nav { position: static; max-height: none; overflow: visible; }
  .symptom-nav-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  .symptom-nav-tab { width: auto; }
  .symptom-nav-tab:hover { transform: none; }
}

@media (max-width: 640px) {
  .pattern-grid, .strategy-grid, .condition-grid, .symptom-grid, .culture-grid { grid-template-columns: 1fr; }
  .dialogue-tabs { grid-template-columns: 1fr; }
  .dialogue-panel { padding: 18px; }
  .dialogue-line { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 13px; }
  .dialogue-avatar { width: 38px; height: 38px; border-radius: 12px; }
  .dialogue-text { font-size: 14px; }
}

@media (max-width: 800px) {
  .home-page .hero.hero-home { min-height: auto; padding: 28px 0 24px; }
  .home-page .hero-home > .container { width: calc(100% - 32px); }
  .home-page .hero-home .hero-grid { grid-template-columns: 1fr; gap: 12px; }
  .home-page .hero-home .hero-copy { text-align: center; }
  .home-page .hero-home h1 { margin-bottom: 18px; font-size: clamp(34px, 9.5vw, 46px); }
  .home-page .hero-home .hero-description { margin-bottom: 22px; }
  .home-page .hero-description > span:first-child { font-size: 14px; line-height: 1.65; }
  .home-page .hero-home .hero-art { min-height: 330px; }
  .home-page .hero-home .art-blob { width: 300px; height: 300px; }
  .home-page .hero-person { width: 132px; }
  .home-page .person-two { width: 154px; }
  .bubble-one { left: 8%; }
  .bubble-two { right: 8%; }
  .bubble-three { right: 7%; bottom: 105px; }
  .club-sticker { left: 10%; bottom: 112px; }
  .home-topics { padding: 30px 0 46px; }
  .home-page.is-topics-view .home-topics { min-height: auto; }
  .home-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .home-page .hero-home .hero-actions .browse-button { width: min(220px, 100%); min-height: 50px; margin-inline: auto; padding: 10px 12px 10px 18px; font-size: 13px; }
  .home-page .hero-home .hero-art { min-height: 300px; }
  .unit-map-art { padding: 4px 10px 12px 4px; }
  .unit-map-card { box-shadow: 6px 7px 0 var(--ink); transform: rotate(.8deg); }
  .home-page .hero-person { width: 116px; }
  .home-page .person-two { width: 136px; }
  .speech-bubble { padding: 7px 10px; font-size: 9px; }
  .bubble-one { top: 28px; left: 2%; }
  .bubble-two { top: 5px; right: 2%; }
  .bubble-three { display: none; }
  .club-sticker { left: 3%; bottom: 96px; width: 62px; height: 62px; }
  .club-sticker strong { font-size: 22px; }
  .club-sticker span { font-size: 8px; }
  .home-topic-grid { grid-template-columns: 1fr; gap: 12px; }
  .topic-tile { min-height: 196px; padding: 17px 18px; }
  .topic-tile-copy { width: 72%; }
  .topic-tile h3 { font-size: 19px; }
  .topic-tile-art { flex-basis: 28%; width: 28%; }
  .topic-tile-art .avatar-svg { width: 92px; }
}

/* ---------- Topic page tabbed layout ---------- */
.topic-page .topic-hero { padding: 34px 0 22px; }
.topic-page .topic-hero-art { min-height: 230px; }
.topic-page .topic-hero-art .art-blob { width: 240px; height: 240px; }
.topic-page .emergency-notice { margin-top: 12px; padding: 13px 18px; }

.topic-tabs { position: sticky; z-index: 45; top: 86px; width: min(1180px, calc(100% - 48px)); margin-inline: auto; display: flex; justify-content: safe center; gap: 8px; margin-bottom: 30px; padding: 9px; overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,250,240,.94); box-shadow: 0 12px 30px rgba(62,54,105,.08); backdrop-filter: blur(16px); scroll-margin-top: 98px; scrollbar-width: none; }
.topic-tabs::-webkit-scrollbar { display: none; }
.topic-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding: 10px 15px; border: 1.5px solid transparent; border-radius: 12px; color: var(--muted); background: transparent; font-size: 13.5px; font-weight: 850; white-space: nowrap; transition: color .2s, background .2s, border-color .2s, transform .2s; }
.topic-tab .icon { width: 16px; height: 16px; }
.topic-tab:hover { color: var(--purple); background: var(--purple-soft); transform: translateY(-1px); }
.topic-tab.active { color: white; border-color: var(--purple); background: var(--purple); box-shadow: 0 8px 18px rgba(91,86,214,.2); }
.topic-tab.active:hover { color: white; background: var(--purple-dark); }

.topic-panel { display: none; --topic-panel-min: 500px; padding: 0 0 58px; }
.topic-panel.is-active { display: flex; flex-direction: column; min-height: var(--topic-panel-min); animation: reveal .25s ease both; }
.topic-panel.is-active > .container { flex: 1; display: flex; flex-direction: column; }
.topic-panel .section-heading { margin-bottom: 22px; }
.topic-panel .section-heading h2 { font-size: clamp(26px, 3.4vw, 38px); }
.topic-panel .discussion-heading { margin-top: 46px; }
.topic-panel .module-block { margin-bottom: 24px; }
.topic-panel[data-topic-panel="practice"] { padding: 28px 0 58px; border-block: 1px solid #e5e0fa; background: #f3f0ff; }

.keyword-phrase-list { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); grid-auto-rows: 1fr; gap: 12px; }
.keyword-phrase { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: white; transition: transform .2s, border-color .2s, background .2s, box-shadow .2s; }
.keyword-phrase:hover { transform: translateY(-2px); border-color: #d7d1fa; background: #fdfcff; box-shadow: var(--shadow); }
.keyword-phrase-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px var(--coral-soft); transition: background .2s, box-shadow .2s; }
.keyword-phrase:hover .keyword-phrase-dot { background: var(--purple); box-shadow: 0 0 0 4px var(--purple-soft); }
.keyword-phrase p { margin: 0; color: var(--ink); font-size: 15px; font-weight: 750; line-height: 1.55; }
.keyword-phrase-hint { display: block; margin-top: 5px; color: #9792a4; font-size: 12px; font-weight: 600; line-height: 1.5; }

.sub-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; padding: 7px; border: 1px solid var(--line); border-radius: 16px; background: #f8f6f1; }
.sub-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1.5px solid transparent; border-radius: 11px; color: var(--muted); background: white; font-size: 11px; font-weight: 850; transition: color .2s, border-color .2s, background .2s; }
.sub-tab .icon { width: 15px; height: 15px; }
.sub-tab:hover { color: var(--purple); border-color: #d7d1fa; }
.sub-tab.active { color: white; border-color: var(--purple); background: var(--purple); }
.sub-panel { display: none; }
.sub-panel.is-active { display: block; animation: reveal .22s ease both; }

@media (max-width: 800px) {
  .topic-page .topic-hero { padding: 26px 0 18px; }
  .topic-page .topic-hero-art { min-height: 200px; }
  .topic-page .topic-hero-art .art-blob { width: 210px; height: 210px; }
  .topic-tabs { top: 62px; width: calc(100% - 32px); margin-bottom: 22px; padding: 7px; border-radius: 15px; scroll-margin-top: 76px; }
  .topic-tab { padding: 9px 12px; font-size: 12.5px; }
  .topic-panel { padding-bottom: 42px; }
  .topic-panel .section-heading { margin-bottom: 18px; }
  .topic-panel .discussion-heading { margin-top: 34px; }
  .sub-tabs { gap: 6px; padding: 6px; }
  .sub-tab { padding: 8px 10px; font-size: 10px; }
}

@media (max-width: 520px) {
  .topic-tabs { top: 58px; }
  .topic-tab .icon { width: 14px; height: 14px; }
  .topic-panel[data-topic-panel="practice"] { padding-top: 20px; }
}

/* ---------- Header language switcher ---------- */
.language-switcher { position: relative; flex: 0 0 auto; }
.language-button { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: rgba(255,255,255,.72); font-size: 13.5px; font-weight: 850; transition: transform .2s, border-color .2s, background .2s; }
.language-button .icon { width: 16px; height: 16px; color: var(--purple); }
.language-button:hover { transform: translateY(-1px); border-color: #d7d1fa; background: var(--purple-soft); }
.language-menu { position: absolute; z-index: 60; top: calc(100% + 8px); right: 0; min-width: 140px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow); animation: reveal .18s ease both; }
.language-option { width: 100%; display: block; padding: 9px 12px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 850; text-align: left; }
.language-option:hover { color: var(--purple); background: var(--purple-soft); }
.language-option.active { color: white; background: var(--purple); }

@media (max-width: 1050px) {
  .language-button { min-height: 34px; padding: 6px 10px; font-size: 12.5px; }
}

@media (max-width: 800px) {
  .language-button { min-height: 32px; gap: 6px; padding: 6px 9px; }
  .language-button .icon { width: 14px; height: 14px; }
  .language-menu { right: -4px; }
}

