:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --ink: #17243d;
  --muted: #5d6b84;
  --primary: #1f6feb;
  --success: #1a9b6d;
  --line: #dbe4f0;
  --shadow: 0 14px 34px rgba(18, 33, 64, 0.1);
}

/* 2026-04 mobile game-app refresh */
:root {
  --mobile-max-width: 600px;
  --mobile-safe-bottom: 104px;
  --game-bg-1: #fff2d0;
  --game-bg-2: #ffe1a6;
  --game-panel: rgba(255, 250, 241, 0.82);
  --game-panel-strong: rgba(255, 253, 248, 0.92);
  --game-line: rgba(217, 164, 79, 0.26);
  --game-text-soft: #8a6b46;
  --game-shadow: 0 22px 44px rgba(163, 105, 23, 0.14);
}

html {
  background:
    radial-gradient(circle at top, #fff7e4 0, #ffe6b7 34%, #ffc97f 100%);
}

body.app-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 251, 234, 0.9), transparent 24%),
    radial-gradient(circle at top right, rgba(130, 211, 255, 0.22), transparent 20%),
    linear-gradient(180deg, var(--game-bg-1) 0%, var(--game-bg-2) 100%);
}

.app-shell {
  width: min(100%, var(--mobile-max-width));
  min-height: 100vh;
  margin: 0 auto;
  position: relative;
}

.topbar.app-header {
  width: min(100%, var(--mobile-max-width));
  margin: 0 auto;
  padding: 16px 14px 12px;
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.96), rgba(255, 244, 219, 0.88));
  backdrop-filter: blur(22px);
}

.app-header-main,
.app-top-controls {
  width: 100%;
}

.app-top-controls {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.app-progress-badge,
.app-select-card {
  border-radius: 18px;
  border: 1px solid var(--game-line);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 24px rgba(181, 122, 37, 0.08);
}

.app-progress-badge {
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
}

.app-progress-badge span {
  font-size: 11px;
  color: #a17c53;
}

.app-progress-badge strong {
  margin-top: 2px;
  font-size: 18px;
  color: #6f4c1c;
}

.app-select-card {
  padding: 8px 10px 10px;
}

.brand-copy h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.app-section-title {
  margin-left: 6px;
  font-size: 16px;
  font-weight: 700;
  color: #8c7157;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.brand-copy p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8c7358;
}

.layout.app-main {
  width: 100%;
  max-width: none;
  padding: 10px 12px calc(var(--mobile-safe-bottom) + 16px);
  gap: 14px;
}

.layout.app-main > .card {
  border-radius: 28px;
  border: 1px solid var(--game-line);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.9), rgba(255, 245, 226, 0.82));
  box-shadow: var(--game-shadow);
}

.home-screen,
.feature-section {
  min-height: calc(100vh - 176px);
}

.section-kicker,
.feature-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 197, 88, 0.16);
  color: #b46a17;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hero-panel {
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 18px;
  border-radius: 28px;
}

.home-hero-copy h2 {
  margin: 10px 0 10px;
  font-size: 34px;
  line-height: 1.14;
}

.home-hero-copy p {
  max-width: none;
  color: var(--game-text-soft);
  font-size: 15px;
}

.hero-quick-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.hero-action,
.sub-menu-btn {
  justify-content: flex-start;
}

.home-hero-visual {
  justify-items: stretch;
}

.home-hero-avatar {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 5 / 4;
}

.home-hero-avatar img {
  object-position: center top;
}

.home-hero-bubbles {
  justify-content: stretch;
}

.hero-bubble {
  flex: 1 1 0;
}

.home-badge-strip {
  width: 100%;
}

.home-title {
  margin-top: 16px;
}

.home-title h2 {
  font-size: 28px;
}

.home-title p {
  margin-top: 6px;
  color: var(--game-text-soft);
  line-height: 1.6;
}

.hero-grid,
.stats-grid,
.home-dashboard-grid,
.home-sub-menu,
.settings-grid,
.playground-hero,
.playground-toolbar,
.buddy-hero,
.buddy-chat-layout,
.original-study-shell,
.funqa-shell,
.control-grid,
.question-list-filters,
.records-grid {
  grid-template-columns: 1fr;
}

.hero-grid {
  gap: 12px;
}

.feature-card {
  min-height: 164px;
  padding: 18px;
}

.feature-card h2 {
  margin-top: 12px;
  font-size: 23px;
}

.feature-card p {
  color: #8a725b;
}

.stats-grid > div,
.home-dashboard-card,
.records-toolbar,
.records-table-shell,
.playground-hero,
.playground-toolbar,
.playground-mode-note,
.original-study-main,
.original-study-sidebar,
.buddy-profile-card,
.buddy-task-card,
.buddy-panel,
.question-list-toolbar,
.question-list-filters {
  background: var(--game-panel);
  border: 1px solid var(--game-line);
  box-shadow: 0 16px 30px rgba(181, 122, 37, 0.08);
}

.home-dashboard-card,
.buddy-profile-card,
.buddy-task-card,
.buddy-panel,
.records-table-shell,
.original-study-main,
.original-study-sidebar {
  border-radius: 24px;
}

.home-task-card,
.home-memory-card,
.buddy-storyline-card,
.buddy-chapter-card,
.original-subtitle-item,
.playground-option,
.question-record-card {
  border-radius: 20px;
  background: var(--game-panel-strong);
}

.section-header {
  gap: 12px;
}

.section-header h3 {
  font-size: 26px;
}

.tab-row {
  width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.tab-row::-webkit-scrollbar {
  display: none;
}

.tab-btn,
.btn,
select,
input,
textarea {
  min-height: 50px;
  border-radius: 18px;
}

.tab-btn {
  white-space: nowrap;
}

.btn,
.tab-btn {
  font-weight: 800;
}

.records-toolbar,
.records-summary,
.records-pagination,
.buddy-profile-top,
.buddy-panel-head,
.buddy-profile-metrics,
.buddy-task-meta,
.buddy-task-actions,
.playground-pill-row,
.question-list-pagination,
.original-study-sidebar-header,
.original-dubbing-header {
  flex-direction: column;
  align-items: flex-start;
}

.records-tools,
.playground-pill-row {
  justify-content: flex-start;
}

.records-search,
.records-tools label {
  min-width: 100%;
}

.records-table {
  min-width: 860px;
}

.funqa-live2d-panel {
  width: 100%;
  position: relative;
  inset: auto;
  border-radius: 22px;
}

.funqa-live2d-stage {
  height: 280px;
}

.daily-live2d-widget,
.mistake-live2d-widget {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
  margin: 8px 0 14px;
  cursor: default;
}

.daily-live2d-stage,
.mistake-live2d-stage {
  width: 100%;
  height: 208px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.12) 42%),
    linear-gradient(180deg, rgba(216, 238, 255, 0.9), rgba(252, 244, 219, 0.75));
}

.mistake-guide-panel {
  padding-top: 0;
}

.question-list-filters {
  position: sticky;
  top: 96px;
  z-index: 5;
}

.playground-question {
  font-size: 24px;
}

.playground-options {
  grid-template-columns: 1fr;
}

.buddy-chat-box,
.chat-box,
.coach-reply {
  min-height: 220px;
}

.original-player {
  min-height: 240px;
}

.original-study-file-row,
.original-study-control-row,
.question-list-pagination {
  display: grid;
  grid-template-columns: 1fr;
}

.app-bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  width: auto;
  max-width: calc(var(--mobile-max-width) - 24px);
  margin: 0 auto;
  z-index: 30;
  padding: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  border-radius: 28px;
  border: 1px solid rgba(229, 185, 106, 0.4);
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.96), rgba(255, 238, 201, 0.92));
  box-shadow: 0 24px 38px rgba(152, 104, 26, 0.22);
  backdrop-filter: blur(20px);
}

.app-nav-btn {
  min-height: 64px;
  border-radius: 20px;
}

.app-nav-btn span:last-child {
  font-size: 12px;
}

.app-nav-icon {
  width: 34px;
  height: 34px;
}

@media (max-width: 520px) {
  .app-top-controls {
    grid-template-columns: 1fr;
  }

  .home-hero-copy h2 {
    font-size: 28px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, #cfe6ff 0, rgba(207, 230, 255, 0) 35%),
    radial-gradient(circle at 90% 12%, #ffe7c5 0, rgba(255, 231, 197, 0) 30%),
    linear-gradient(160deg, #eef4ff 0%, #f8fbff 48%, #f5f8ff 100%);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid #d4e2f8;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(150deg, #1f6feb, #13c2c2);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.layout {
  padding: 22px;
  display: grid;
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid #dbe8fb;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.home-screen {
  display: none;
  background: linear-gradient(145deg, #f9fcff 0%, #ffffff 40%, #f8fbff 100%);
}

.home-screen.active-home {
  display: block;
}

.home-title {
  text-align: center;
}

.home-title h2 {
  margin: 0;
  font-size: 28px;
}

.home-title p {
  margin: 8px 0 0;
  color: var(--muted);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
  justify-content: center;
  max-width: 940px;
  margin: 20px auto 0;
}

.feature-card {
  border: 1px solid #d7e4f8;
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(165deg, #ffffff, #f4f8ff);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(29, 61, 120, 0.15);
}

.feature-card.active {
  border-color: var(--primary);
  background: linear-gradient(160deg, #e9f2ff, #ffffff);
}

.feature-card h2 {
  margin: 0;
  font-size: 20px;
}

.feature-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.stats-grid {
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 940px;
}

.stats-grid > div {
  border: 1px solid #d6e4fa;
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.8);
}

.stats-grid span {
  display: block;
  font-size: 22px;
  font-weight: 700;
}

.stats-grid small {
  color: var(--muted);
}

.home-dashboard-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.home-dashboard-card {
  border: 1px solid #dbe5f5;
  border-radius: 24px;
  padding: 18px 20px;
  background:
    radial-gradient(circle at top left, rgba(93, 167, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 18px 32px rgba(18, 45, 91, 0.08);
}

.home-dashboard-head h3 {
  margin: 0;
  color: #173a71;
}

.home-dashboard-head p {
  margin: 6px 0 0;
  color: #627792;
  line-height: 1.6;
}

.home-task-list,
.home-memory-profile {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.home-task-card,
.home-memory-card {
  border: 1px solid #dce7f6;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.home-task-card {
  cursor: pointer;
}

.home-task-card:hover {
  border-color: #9cbbed;
  box-shadow: 0 12px 20px rgba(35, 76, 150, 0.1);
}

.home-task-card h4,
.home-memory-card h4 {
  margin: 0;
  color: #173a71;
}

.home-task-card p,
.home-memory-card p {
  margin: 8px 0 0;
  color: #5d728d;
  line-height: 1.6;
}

.home-task-meta,
.home-memory-tags {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.home-task-tag,
.home-memory-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: #2d5697;
  font-size: 12px;
  font-weight: 700;
}

.home-memory-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  color: #5f758f;
}

.sub-menu {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header h3 {
  margin: 0;
}

.tab-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.tab-btn.active {
  border-color: var(--primary);
  color: var(--primary);
}

.tab-panel {
  display: none;
  margin-top: 14px;
}

.tab-panel.active-panel {
  display: block;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

select,
input,
textarea,
button {
  font: inherit;
}

select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.success {
  background: var(--success);
  color: #fff;
}

.btn.ghost {
  background: #fff;
  border-color: var(--line);
}

.hint,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.item-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.item-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
}

.item-row .input-row {
  grid-template-columns: 1fr auto auto 120px;
}

.learn-answer-row,
.learn-control-row {
  display: grid;
  gap: 8px;
  align-items: center;
}

.learn-answer-row {
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: start;
}

.learn-control-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.learn-answer-row input,
.learn-answer-row textarea {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  width: 100%;
  min-width: 0;
}

.learn-answer-row textarea {
  min-height: 88px;
}

.learn-answer-asr-btn {
  min-width: 42px;
  width: 42px;
  min-height: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.learn-answer-asr-btn.is-recording {
  color: #fff;
  background: linear-gradient(180deg, #ef5b4f 0%, #c93028 100%);
  border-color: rgba(171, 28, 28, 0.68);
  box-shadow: 0 10px 18px rgba(201, 48, 40, 0.2);
}

.learn-control-row .btn,
.learn-control-row select {
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 999px;
}

.review-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  min-height: 120px;
}

.review-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.coach-box {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

.input-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 8px;
}

.compact-row {
  grid-template-columns: 1fr auto auto auto auto;
  align-items: center;
}

.pronunciation-row {
  grid-template-columns: repeat(4, auto);
  justify-content: flex-start;
}

.tight-grid {
  grid-template-columns: 220px;
  margin-top: 10px;
}

.coach-reply,
.chat-box {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-height: 110px;
  max-height: 360px;
  overflow: auto;
  background: #fbfdff;
}

.buddy-shell {
  display: grid;
  gap: 16px;
}

.buddy-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

.buddy-profile-card,
.buddy-task-card,
.buddy-panel {
  border: 1px solid #dbe5f5;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(90, 166, 255, 0.12), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 16px 32px rgba(18, 45, 91, 0.08);
  padding: 18px 20px;
}

.buddy-profile-top,
.buddy-panel-head,
.buddy-task-meta,
.buddy-task-actions,
.buddy-profile-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.buddy-eyebrow {
  margin: 0 0 6px;
  color: #5c7aa1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.buddy-profile-card h4,
.buddy-task-card h4,
.buddy-panel-head h4 {
  margin: 0;
  color: #16345f;
}

.buddy-profile-text,
.buddy-task-goal,
.buddy-panel-head p {
  margin: 8px 0 0;
  color: #5e748f;
  line-height: 1.7;
}

.buddy-profile-metric {
  min-width: 120px;
  display: grid;
  gap: 4px;
}

.buddy-profile-metric span,
.buddy-task-meta span {
  color: #6d819d;
  font-size: 12px;
}

.buddy-profile-metric strong,
.buddy-task-meta strong {
  color: #173a71;
}

.buddy-task-actions {
  margin-top: 18px;
  justify-content: flex-start;
}

.buddy-english-task-detail {
  display: grid;
  gap: 12px;
}

.buddy-english-task-detail-card {
  border: 1px solid #dce7f6;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.buddy-english-task-detail-card h5 {
  margin: 0;
  color: #173a71;
}

.buddy-english-task-detail-card p {
  margin: 8px 0 0;
  color: #5f7590;
  line-height: 1.6;
}

.buddy-storyline-list,
.buddy-chapter-list {
  display: grid;
  gap: 12px;
}

.buddy-storyline-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.buddy-storyline-card,
.buddy-chapter-card {
  border: 1px solid #d9e5f6;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.buddy-storyline-card {
  cursor: pointer;
}

.buddy-storyline-card:hover,
.buddy-chapter-card:hover {
  transform: translateY(-1px);
  border-color: #93b6ec;
  box-shadow: 0 14px 24px rgba(27, 67, 131, 0.1);
}

.buddy-storyline-card.active,
.buddy-chapter-card.active {
  border-color: #2c67ce;
  background: linear-gradient(180deg, #fefefe 0%, #edf4ff 100%);
  box-shadow: 0 18px 30px rgba(31, 78, 163, 0.14);
}

.buddy-storyline-card h5,
.buddy-chapter-card h5 {
  margin: 0;
  color: #183963;
  font-size: 17px;
}

.buddy-storyline-card p,
.buddy-chapter-card p {
  margin: 8px 0 0;
  color: #5d728d;
  line-height: 1.6;
}

.buddy-storyline-meta,
.buddy-chapter-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.buddy-meta-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #305893;
  font-size: 12px;
  font-weight: 700;
}

.buddy-chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.buddy-chat-panel,
.buddy-side-panel {
  min-width: 0;
}

.buddy-side-panel {
  display: grid;
  gap: 16px;
}

.buddy-mini-panel {
  padding-bottom: 16px;
}

.buddy-chat-box {
  min-height: 420px;
  max-height: 560px;
}

.buddy-message {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px dashed #dce6f5;
}

.buddy-message:last-child {
  border-bottom: 0;
}

.buddy-message-role {
  font-size: 12px;
  font-weight: 700;
  color: #5f799c;
}

.buddy-message.user .buddy-message-role {
  color: #9b5f18;
}

.buddy-message-card {
  border-radius: 16px;
  padding: 14px;
  background: #f4f8ff;
  color: #1d3558;
  line-height: 1.7;
}

.buddy-message.user .buddy-message-card {
  background: #fff6ea;
}

.buddy-message-main {
  font-weight: 600;
}

.buddy-message-sub {
  margin-top: 6px;
  color: #62758f;
  font-size: 13px;
}

.buddy-message-actions,
.buddy-quick-replies,
.buddy-focus-tags,
.buddy-summary-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.buddy-quick-replies {
  margin-top: 12px;
}

.buddy-quick-btn {
  border: 1px solid #d7e4f7;
  border-radius: 999px;
  background: #fff;
  color: #29529f;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.buddy-focus-box,
.buddy-summary-box {
  display: grid;
  gap: 10px;
}

.buddy-summary-card {
  border: 1px solid #deebfa;
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.buddy-summary-card h5 {
  margin: 0 0 8px;
  color: #173a71;
}

.buddy-summary-list,
.buddy-focus-list {
  display: grid;
  gap: 8px;
  color: #576f8e;
  font-size: 14px;
}

.funqa-shell {
  position: relative;
  padding-right: 286px;
}

.funqa-live2d-panel {
  position: absolute;
  top: 10px;
  right: 0;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background:
    radial-gradient(circle at top, rgba(111, 188, 255, 0.2), rgba(111, 188, 255, 0) 45%),
    linear-gradient(180deg, #f8fcff 0%, #eef7ff 100%);
  box-shadow: 0 10px 22px rgba(20, 62, 125, 0.12);
}

.funqa-live2d-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.funqa-live2d-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.live2d-model-select {
  min-width: 88px;
  border: 1px solid rgba(31, 111, 235, 0.18);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary);
  font-size: 12px;
}

.live2d-emotion-tag {
  border: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(31, 111, 235, 0.1);
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
}

.live2d-emotion-tag:hover {
  background: rgba(31, 111, 235, 0.18);
}

.funqa-live2d-stage {
  position: relative;
  margin-top: 8px;
  height: 290px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.2) 40%),
    linear-gradient(180deg, #dff0ff 0%, #eff7ff 46%, #dceeff 100%);
}

.funqa-live2d-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.funqa-live2d-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  display: block;
}

.mistake-guide-panel {
  position: relative;
}

#daily-section,
#mistake-section {
  position: relative;
}

.hidden {
  display: none !important;
}

.daily-live2d-widget,
.mistake-live2d-widget {
  position: absolute;
  top: 78px;
  right: 16px;
  width: 172px;
  z-index: 3;
  user-select: none;
  cursor: grab;
}

.daily-live2d-widget:active,
.mistake-live2d-widget:active {
  cursor: grabbing;
}

.daily-live2d-stage,
.mistake-live2d-stage {
  position: relative;
  width: 172px;
  height: 210px;
  overflow: hidden;
  background: transparent;
}

.daily-live2d-frame,
.mistake-live2d-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  display: block;
  pointer-events: none;
}

.live2d-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

#learn-ai-reply {
  margin-top: 12px;
  white-space: pre-wrap;
}

.chat-line {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
}

.chat-line.user {
  background: #e8f3ff;
}

.chat-line.assistant {
  background: #eefbf6;
}

.assistant-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.assistant-line:last-child {
  margin-bottom: 0;
}

.assistant-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-tts {
  padding: 4px 10px;
  font-size: 12px;
}

.chat-image-actions {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 10px;
}

.mini-print {
  padding: 4px 10px;
  font-size: 12px;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.mistake-question-picker,
.mistake-structured-result {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.mistake-question-picker {
  padding: 16px;
}

.mistake-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mistake-picker-title {
  margin: 0;
  font-size: 16px;
}

.mistake-picker-desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.mistake-question-list {
  display: grid;
  gap: 10px;
}

.mistake-question-option {
  border: 1px solid #d8e4f2;
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.mistake-question-option strong {
  display: block;
  margin-bottom: 4px;
}

.mistake-question-option p {
  margin: 0 0 10px;
  color: #334155;
  white-space: pre-wrap;
}

.mistake-structured-result {
  padding: 0;
  overflow: hidden;
}

.mistake-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff5da 0%, #fffaf0 55%, #eef8ff 100%);
  border-bottom: 1px solid #e8eef5;
}

.mistake-summary-main {
  min-width: 0;
}

.mistake-summary-main h4,
.mistake-summary-main p {
  margin: 0;
}

.mistake-summary-main p {
  margin-top: 6px;
  color: #475569;
  white-space: pre-wrap;
}

.mistake-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mistake-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf6ff;
  color: #24507a;
  font-size: 12px;
}

.mistake-structured-body {
  padding: 16px;
}

.mistake-generated-image-wrap {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
}

.mistake-generated-image-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff8e7 0%, #f3f8ff 100%);
  border-bottom: 1px solid #edf2f7;
}

.mistake-generated-image-head strong {
  color: #6f3d14;
}

.mistake-generated-image-head span {
  color: #64748b;
  font-size: 12px;
}

.mistake-generated-image {
  display: block;
  width: 100%;
  max-height: 640px;
  object-fit: contain;
  background: #fff;
}

.mistake-html-render {
  padding: 18px 16px 20px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 102, 0.38), transparent 30%),
    radial-gradient(circle at top right, rgba(110, 231, 255, 0.28), transparent 28%),
    linear-gradient(180deg, #fffdf4 0%, #fefefe 100%);
  border: 2px solid #f5df9c;
}

.mistake-mermaid-render {
  overflow-x: auto;
}

.mistake-mermaid-render svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.mistake-mermaid-render svg .node rect,
.mistake-mermaid-render svg .node polygon,
.mistake-mermaid-render svg .node path,
.mistake-mermaid-render svg .node circle {
  stroke-width: 2px !important;
  filter: drop-shadow(0 6px 0 rgba(242, 181, 68, 0.24));
}

.mistake-mermaid-render svg .node .label,
.mistake-mermaid-render svg .edgeLabel .label {
  color: #6f3d14 !important;
}

.mistake-mermaid-render svg .cluster rect {
  rx: 18px;
  ry: 18px;
}

.mistake-mermaid-render svg .edgeLabel rect {
  fill: #ffffff !important;
  stroke: #cfe9ff !important;
  stroke-width: 1.5px !important;
}

.mistake-html-render .flow-shell,
.mistake-flow-fallback .flow-shell {
  display: grid;
  gap: 12px;
}

.mistake-html-render .flow-step,
.mistake-flow-fallback .flow-step {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fff8e7 100%);
  border: 2px solid #f6d776;
  box-shadow: 0 12px 0 rgba(245, 215, 118, 0.5);
}

.mistake-html-render .flow-badge,
.mistake-flow-fallback .flow-badge {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-size: 20px;
  background: linear-gradient(135deg, #ff8a5b 0%, #ffb347 100%);
  box-shadow: 0 8px 0 rgba(255, 179, 71, 0.45);
}

.mistake-html-render .flow-content,
.mistake-flow-fallback .flow-content {
  min-width: 0;
  padding-top: 2px;
}

.mistake-html-render .flow-title,
.mistake-flow-fallback .flow-title {
  font-weight: 700;
  color: #6f3d14;
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.35;
  word-break: break-word;
}

.mistake-html-render .flow-body,
.mistake-flow-fallback .flow-body {
  color: #4b5563;
  white-space: pre-wrap;
  line-height: 1.7;
  word-break: break-word;
  font-size: 15px;
}

.mistake-html-render .flow-arrow,
.mistake-flow-fallback .flow-arrow {
  justify-self: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(180deg, #66c7ff 0%, #4fa8ff 100%);
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 8px 0 rgba(79, 168, 255, 0.32);
}

.mistake-html-render .flow-arrow span,
.mistake-flow-fallback .flow-arrow span {
  transform: translateY(-1px);
}

.mistake-html-render .flow-result,
.mistake-flow-fallback .flow-result {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff8db 0%, #ffeaa7 100%);
  border: 2px solid #f0d98a;
  color: #7a4b00;
  box-shadow: 0 12px 0 rgba(240, 217, 138, 0.45);
}

.mistake-html-render .flow-result strong,
.mistake-flow-fallback .flow-result strong {
  flex: 0 0 auto;
}

.mistake-html-render .flow-tip,
.mistake-flow-fallback .flow-tip {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #eefbf6;
  border: 1px solid #cdeede;
  color: #166534;
}

.mistake-cartoon-flow .mistake-flow-fallback {
  display: grid;
  gap: 10px;
}

.question-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.question-list-filters {
  display: grid;
  grid-template-columns: 90px 160px 160px minmax(220px, 1fr) auto auto auto;
  gap: 10px;
  margin-bottom: 14px;
}

.question-list-grid {
  display: grid;
  gap: 14px;
}

.question-list-pagination {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.question-record-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf7 100%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.question-record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px;
  gap: 16px;
  align-items: start;
}

.question-record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.question-record-head h4,
.question-record-card p {
  margin: 0;
}

.question-record-time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.question-record-meta {
  display: grid;
  gap: 10px;
}

.question-record-actions {
  display: grid;
  gap: 10px;
}

.question-record-action-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid #d7e4f7;
  background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
  color: #2453a8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.question-record-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #92b6ed;
  box-shadow: 0 12px 20px rgba(36, 83, 168, 0.14);
}

.question-record-action-btn.ready {
  background: linear-gradient(180deg, #ecfff2 0%, #dff8e8 100%);
  border-color: #b8e0c4;
  color: #1f7a4d;
}

.question-record-action-btn.pending {
  background: linear-gradient(180deg, #fff8e8 0%, #fff0cd 100%);
  border-color: #ead6a0;
  color: #94600d;
}

.question-record-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.question-record-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: start;
}

.question-record-row strong {
  color: #475569;
}

.question-record-value {
  min-width: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.question-record-preview {
  min-height: 116px;
  max-height: 140px;
  overflow: hidden;
  border-radius: 14px;
  padding: 6px;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 102, 0.22), transparent 26%),
    linear-gradient(180deg, #fffef8 0%, #f8fcff 100%);
  border: 1px dashed #f3cf63;
}

.question-record-preview svg {
  width: 100%;
  height: auto;
  max-height: 128px;
}

.question-record-preview-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.question-record-preview-trigger:focus-visible {
  outline: 2px solid #4fa8ff;
  outline-offset: 3px;
}

.question-record-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.question-record-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf6ff;
  color: #24507a;
  text-decoration: none;
  font-size: 12px;
}

.mistake-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.mistake-preview-dialog {
  width: min(980px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 102, 0.28), transparent 28%),
    linear-gradient(180deg, #fffef7 0%, #ffffff 100%);
  border: 2px solid #f3cf63;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
}

.mistake-preview-close {
  margin-left: auto;
  display: flex;
}

.mistake-preview-title {
  margin: 8px 0 14px;
  font-weight: 700;
  color: #6f3d14;
}

.mistake-preview-canvas {
  min-height: 300px;
}

.mistake-preview-canvas .mistake-mermaid-render svg,
.mistake-preview-canvas svg {
  max-height: none;
}

.mistake-animation-dialog {
  width: min(540px, 100%);
}

.mistake-animation-status {
  display: grid;
  gap: 12px;
  padding: 10px 6px 6px;
}

.mistake-animation-status h4 {
  margin: 0;
  font-size: 22px;
  color: #173a71;
}

.mistake-animation-status-extra {
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fbff 0%, #eff5ff 100%);
  border: 1px solid #dfe9f7;
  color: #5c6f8a;
  line-height: 1.7;
}

.feature-section {
  display: none;
}

.feature-section.active-section {
  display: block;
}

.records-panel {
  display: none;
  margin-top: 16px;
}

.records-panel.active {
  display: block;
}

.records-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid #dbe6f7;
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(83, 154, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #fbfdff 0%, #f3f7ff 100%);
}

.records-toolbar-learning {
  align-items: center;
}

.records-toolbar-title h4 {
  margin: 0 0 6px;
  font-size: 20px;
  color: #16345f;
}

.records-toolbar-title p {
  margin: 0;
  color: #607798;
  font-size: 13px;
}

.records-segmented {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #dbe5f4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.records-chip {
  min-width: 88px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5b6f8b;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.records-chip.active {
  background: linear-gradient(135deg, #173a71 0%, #2f6ad2 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 83, 165, 0.24);
}

.records-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.records-tools label {
  display: grid;
  gap: 6px;
  min-width: 140px;
  color: #536b8f;
  font-size: 12px;
  font-weight: 700;
}

.records-search {
  min-width: min(320px, 100%);
}

.records-search input,
.records-tools select {
  min-height: 44px;
}

.records-table-shell {
  border: 1px solid #dbe5f5;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 18px 36px rgba(16, 40, 84, 0.08);
  overflow: hidden;
}

.records-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e6edf8;
  color: #5b6f8b;
  font-size: 13px;
  background: rgba(247, 250, 255, 0.92);
}

.records-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.records-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.records-table th {
  padding: 16px 14px;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7f9f;
  background: #f5f8fd;
  border-bottom: 1px solid #e4ebf7;
}

.records-table td {
  padding: 15px 14px;
  vertical-align: top;
  border-bottom: 1px solid #edf2fa;
  color: #24364f;
  font-size: 14px;
  line-height: 1.6;
}

.records-table tbody tr:hover {
  background: rgba(76, 137, 255, 0.04);
}

.records-table tbody tr:last-child td {
  border-bottom: 0;
}

.records-cell-main {
  font-weight: 700;
  color: #16345f;
}

.records-cell-sub {
  margin-top: 4px;
  color: #6a7c96;
  font-size: 12px;
}

.records-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef4ff;
  color: #325c9a;
}

.records-badge.role-user {
  background: #fff2dc;
  color: #915610;
}

.records-badge.role-assistant {
  background: #e6f8f3;
  color: #0d7b5a;
}

.records-badge.type-scenario {
  background: #e8f0ff;
  color: #2453a8;
}

.records-badge.type-coach {
  background: #fff1df;
  color: #9a5814;
}

.records-badge.type-funqa {
  background: #efe9ff;
  color: #6c42b8;
}

.records-badge.type-mistake_guide {
  background: #ffe9e9;
  color: #b24242;
}

.records-metric {
  font-weight: 700;
  color: #183963;
}

.records-muted {
  color: #7c8ea8;
}

.records-col-play {
  width: 84px;
}

.records-play-btn {
  width: 42px;
  height: 42px;
  border: 1px solid #d4e1f6;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #eef5ff 100%);
  color: #2453a8;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.records-play-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #98b6eb;
  box-shadow: 0 12px 20px rgba(36, 83, 168, 0.14);
}

.records-play-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.records-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid #e6edf8;
  background: rgba(250, 252, 255, 0.95);
}

.records-page-info {
  color: #5b6f8b;
  font-size: 13px;
  font-weight: 700;
}

.records-empty {
  text-align: center;
  color: #7b8ca5;
  padding: 28px 16px;
}

.settings-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.playground-shell {
  margin-top: 14px;
  display: grid;
  gap: 16px;
}

.playground-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 16px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid #d8e5ff;
  background:
    radial-gradient(circle at top left, rgba(70, 130, 255, 0.2), transparent 34%),
    radial-gradient(circle at right center, rgba(17, 181, 159, 0.18), transparent 28%),
    linear-gradient(135deg, #102248 0%, #16356d 45%, #245ea8 100%);
  color: #fff;
}

.playground-kicker {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.playground-hero h4 {
  margin: 14px 0 8px;
  font-size: 30px;
}

.playground-hero p {
  margin: 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

.playground-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-self: end;
}

.play-stat {
  padding: 18px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  text-align: center;
}

.play-stat strong {
  display: block;
  font-size: 26px;
}

.play-stat span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.74);
}

.playground-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 220px)) 1fr;
  gap: 12px;
  align-items: end;
}

.playground-mode-note {
  margin-top: -4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #dbe6fb;
  background: linear-gradient(180deg, #f9fbff 0%, #f1f6ff 100%);
  color: #4b6486;
  font-size: 13px;
  line-height: 1.6;
}

.playground-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.playground-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d4e2ff;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  color: #355178;
  font-size: 13px;
  font-weight: 600;
}

.playground-empty,
.playground-summary-card,
.playground-question-card {
  border: 1px solid #dbe5f5;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  box-shadow: 0 20px 36px rgba(17, 40, 84, 0.08);
}

.playground-empty {
  padding: 28px;
  text-align: center;
}

.playground-empty h4,
.playground-summary-card h4 {
  margin: 0 0 10px;
  font-size: 24px;
}

.playground-empty p,
.playground-summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.playground-board {
  display: grid;
  gap: 16px;
}

.playground-question-card {
  padding: 24px;
}

.playground-question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef4ff;
  color: #315a99;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.difficulty-easy {
  background: #e8fff3;
  color: #1a8b5d;
}

.difficulty-medium {
  background: #fff5de;
  color: #b97200;
}

.difficulty-hard {
  background: #ffe7e0;
  color: #bd4d2f;
}

.playground-feedback {
  font-size: 13px;
  font-weight: 600;
}

.feedback-neutral {
  color: #577089;
}

.feedback-correct {
  color: #1a9b6d;
}

.feedback-wrong {
  color: #d14d46;
}

.playground-question-index {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

.playground-question {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #142847;
}

.playground-answer {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #edf6ff;
  color: #214775;
  font-weight: 600;
}

.playground-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.playground-option {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 16px 18px;
  border: 1px solid #d8e3f4;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: #162942;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.playground-option:hover {
  transform: translateY(-2px);
  border-color: #91b5ff;
  box-shadow: 0 14px 28px rgba(31, 78, 152, 0.14);
}

.playground-option:disabled {
  cursor: default;
  transform: none;
}

.playground-option.correct {
  border-color: #52b788;
  background: linear-gradient(180deg, #f0fff7 0%, #e4fbef 100%);
}

.playground-option.wrong {
  border-color: #ec7d67;
  background: linear-gradient(180deg, #fff4f1 0%, #ffe8e1 100%);
}

.playground-option-index {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e9f1ff;
  color: #2f59a1;
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  font-size: 15px;
}

.playground-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.playground-summary-card {
  padding: 26px;
}

.playground-summary-card .btn {
  margin-top: 16px;
}

.footer-actions {
  margin-top: 14px;
}

.placeholder p {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.original-study-shell {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}

.original-study-main,
.original-study-sidebar {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 14px;
}

.original-study-toolbar {
  display: grid;
  gap: 10px;
}

.original-study-file-row,
.original-study-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.original-study-file-row label {
  min-width: 132px;
  flex: 0 1 150px;
}

.original-study-control-row .btn {
  padding: 10px 12px;
  white-space: nowrap;
}

#original-play-btn.ready-to-play {
  background: linear-gradient(135deg, #1f6feb, #13c2c2);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(19, 103, 219, 0.28);
}

.original-subtitle-size-select {
  flex: 0 0 76px;
  width: 76px;
  min-width: 76px;
  padding: 10px 8px;
}

.original-study-player-card {
  --subtitle-zh-size: 18px;
  --subtitle-en-size: 22px;
  --subtitle-bottom-offset: 28px;
  position: relative;
  margin-top: 12px;
  border-radius: 0;
  overflow: visible;
  background: #06111f;
  border: 1px solid #15324e;
}

.original-study-player-card.subtitle-size-small {
  --subtitle-zh-size: 16px;
  --subtitle-en-size: 19px;
}

.original-study-player-card.subtitle-size-medium {
  --subtitle-zh-size: 18px;
  --subtitle-en-size: 22px;
}

.original-study-player-card.subtitle-size-large {
  --subtitle-zh-size: 22px;
  --subtitle-en-size: 26px;
}

.original-study-player-card.subtitle-size-xlarge {
  --subtitle-zh-size: 26px;
  --subtitle-en-size: 30px;
}

.original-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 420px;
  background: #000;
}

.original-player .art-video-player,
.original-player .artplayer-app {
  height: 100%;
  border-radius: 0 !important;
  overflow: visible !important;
  background: #000;
}

.original-player .art-video,
.original-player video {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0 !important;
  transform: none !important;
  filter: none !important;
  background: #000;
}

.original-subtitle-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--subtitle-bottom-offset);
  z-index: 40;
  display: grid;
  gap: 4px;
  padding: 0 18px;
  pointer-events: none;
  transition: bottom 0.18s ease;
}

.original-study-player-card.controls-visible {
  --subtitle-bottom-offset: 72px;
}

.subtitle-line {
  width: fit-content;
  max-width: min(92%, 900px);
  margin: 0 auto;
  padding: 0;
  border-radius: 14px;
  text-align: center;
  line-height: 1.6;
  color: #fff;
  background: transparent;
  box-shadow: none;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(0, 0, 0, 0.65);
}

.subtitle-line-zh {
  font-size: var(--subtitle-zh-size);
  color: #ffe08a;
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, 0.95),
    1px -1px 0 rgba(0, 0, 0, 0.95),
    -1px 1px 0 rgba(0, 0, 0, 0.95),
    1px 1px 0 rgba(0, 0, 0, 0.95),
    0 2px 8px rgba(0, 0, 0, 0.7);
}

.subtitle-line-en {
  font-size: var(--subtitle-en-size);
  font-weight: 600;
  color: #fff;
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, 0.98),
    1px -1px 0 rgba(0, 0, 0, 0.98),
    -1px 1px 0 rgba(0, 0, 0, 0.98),
    1px 1px 0 rgba(0, 0, 0, 0.98),
    0 2px 10px rgba(0, 0, 0, 0.75);
  pointer-events: auto;
}

.subtitle-word {
  display: inline-block;
  cursor: pointer;
  padding: 0 1px;
  border-bottom: 1px dashed transparent;
}

.subtitle-word:hover {
  color: #9ed0ff;
  border-bottom-color: rgba(158, 208, 255, 0.9);
}

.original-word-popup {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 50;
  width: min(300px, calc(100% - 36px));
  border-radius: 16px;
  padding: 14px;
  color: #fff;
  background: rgba(7, 20, 36, 0.92);
  border: 1px solid rgba(158, 208, 255, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
}

.original-word-popup-title,
.original-study-sidebar-header h4 {
  margin: 0;
  font-size: 14px;
  color: #9db3cf;
}

.original-word-text {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
}

.original-word-context {
  margin: 8px 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #dce8f7;
}

.original-word-meaning {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: #9ed0ff;
}

.original-word-popup-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.original-study-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.original-subtitle-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-height: 640px;
  overflow: auto;
}

.original-subtitle-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.original-subtitle-item:hover {
  border-color: #86b7ff;
  background: #f5faff;
  transform: translateY(-1px);
}

.original-subtitle-item.active {
  border-color: var(--primary);
  background: #edf5ff;
}

.original-subtitle-main {
  min-width: 0;
  cursor: pointer;
}

.original-subtitle-time {
  font-size: 12px;
  color: var(--muted);
}

.original-subtitle-text {
  margin-top: 4px;
  display: grid;
  gap: 4px;
}

.original-subtitle-text strong,
.original-subtitle-text span {
  line-height: 1.5;
}

.original-subtitle-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  touch-action: manipulation;
}

.original-subtitle-action-btn {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid #d5e2f7;
  background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
  color: #2753a6;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  font-size: 18px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.original-subtitle-action-btn:hover {
  transform: translateY(-1px);
  border-color: #90b4ef;
  box-shadow: 0 10px 18px rgba(39, 83, 166, 0.14);
}

.original-subtitle-action-btn.active {
  border-color: #2a63cc;
  background: linear-gradient(180deg, #2e66ce 0%, #1c4c9f 100%);
  color: #fff;
}

.original-dubbing-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 19, 36, 0.5);
  backdrop-filter: blur(6px);
  overflow: auto;
}

.original-dubbing-modal[data-open="true"] {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.original-dubbing-open {
  overflow: hidden;
}

.original-dubbing-card {
  width: min(720px, calc(100vw - 32px));
  border-radius: 24px;
  border: 1px solid #d8e3f4;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  box-shadow: 0 30px 60px rgba(15, 35, 72, 0.24);
  padding: 24px;
}

.original-dubbing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.original-dubbing-header h4 {
  margin: 0;
  font-size: 22px;
  color: #16345f;
}

.original-dubbing-text {
  margin: 8px 0 0;
  color: #536b8f;
  line-height: 1.7;
}

.original-dubbing-controls {
  margin-top: 18px;
}

.original-dubbing-controls label {
  display: inline-grid;
  gap: 6px;
  color: #536b8f;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 980px) {
  .hero-grid,
  .stats-grid,
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }

  .home-dashboard-grid,
  .buddy-hero,
  .buddy-chat-layout,
  .buddy-storyline-list {
    grid-template-columns: 1fr;
  }

  .question-record-layout {
    grid-template-columns: 1fr;
  }

  .question-record-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .control-grid {
    grid-template-columns: 1fr 1fr;
  }

  .item-row {
    grid-template-columns: 1fr;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .funqa-shell {
    padding-right: 0;
  }

  .funqa-live2d-panel {
    position: static;
    width: 100%;
    margin-top: 12px;
  }

  .original-study-shell {
    grid-template-columns: 1fr;
  }

  .original-player {
    min-height: 320px;
  }

  .playground-hero,
  .playground-toolbar,
  .playground-options {
    grid-template-columns: 1fr;
  }

  .playground-pill-row {
    justify-content: flex-start;
  }

  .records-toolbar,
  .records-toolbar-learning {
    flex-direction: column;
    align-items: stretch;
  }

  .records-tools {
    justify-content: flex-start;
  }

  .records-summary,
  .records-pagination {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-grid,
  .stats-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .home-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .buddy-task-actions,
  .buddy-profile-top,
  .buddy-panel-head,
  .buddy-profile-metrics {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-title h2 {
    font-size: 22px;
  }

  .original-study-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .subtitle-line-zh {
    font-size: calc(var(--subtitle-zh-size) - 1px);
  }

  .subtitle-line-en {
    font-size: calc(var(--subtitle-en-size) - 2px);
  }

  .playground-question {
    font-size: 26px;
  }

  .playground-option {
    min-height: 74px;
    font-size: 16px;
  }

  .playground-hero-stats {
    grid-template-columns: 1fr;
  }

  .records-segmented {
    width: 100%;
    justify-content: space-between;
  }

  .records-chip {
    flex: 1;
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
  }

  .records-tools label,
  .records-search {
    min-width: 100%;
  }

  .records-table {
    min-width: 860px;
  }

  .buddy-chat-box {
    min-height: 320px;
  }

  .question-record-actions {
    grid-template-columns: 1fr;
  }

  .original-subtitle-item {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .original-dubbing-card {
    padding: 18px;
  }

.original-dubbing-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* 2026-04 final mobile overrides */
body.app-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 251, 234, 0.9), transparent 24%),
    radial-gradient(circle at top right, rgba(130, 211, 255, 0.22), transparent 20%),
    linear-gradient(180deg, var(--game-bg-1) 0%, var(--game-bg-2) 100%);
}

.app-shell,
.topbar.app-header {
  width: min(100%, var(--mobile-max-width));
  margin: 0 auto;
}

.app-shell {
  overflow-x: clip;
}

.topbar.app-header {
  padding: 16px 14px 12px;
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.96), rgba(255, 244, 219, 0.88));
  backdrop-filter: blur(22px);
}

.app-top-controls {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.brand-copy h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.brand-copy p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8c7358;
}

.app-progress-badge,
.app-select-card {
  border-radius: 18px;
  border: 1px solid var(--game-line);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 24px rgba(181, 122, 37, 0.08);
}

.app-progress-badge {
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
}

.app-progress-badge span {
  font-size: 11px;
  color: #a17c53;
}

.app-progress-badge strong {
  margin-top: 2px;
  font-size: 18px;
  color: #6f4c1c;
}

.app-select-card {
  padding: 8px 10px 10px;
}

.layout.app-main {
  width: 100%;
  max-width: none;
  padding: 10px 12px calc(var(--mobile-safe-bottom) + 16px);
  gap: 14px;
  overflow-x: clip;
}

.layout.app-main > .card,
.stats-grid > div,
.home-dashboard-card,
.records-toolbar,
.records-table-shell,
.playground-hero,
.playground-toolbar,
.playground-mode-note,
.original-study-main,
.original-study-sidebar,
.buddy-profile-card,
.buddy-task-card,
.buddy-panel,
.question-list-toolbar,
.question-list-filters {
  border: 1px solid var(--game-line);
  box-shadow: 0 16px 30px rgba(181, 122, 37, 0.08);
}

.layout.app-main > .card {
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.9), rgba(255, 245, 226, 0.82));
  box-shadow: var(--game-shadow);
}

.home-screen,
.feature-section {
  min-height: calc(100vh - 176px);
}

.home-screen,
.home-hero-panel,
.home-hero-copy,
.home-hero-visual,
.home-title,
.hero-grid,
.feature-card,
.stats-grid,
.home-dashboard-grid,
.home-dashboard-card,
.home-task-list,
.home-memory-profile,
.sub-menu,
.app-top-controls,
.brand,
.brand-copy {
  min-width: 0;
  max-width: 100%;
}

.hero-grid,
.stats-grid,
.home-dashboard-grid,
.home-sub-menu,
.settings-grid,
.playground-hero,
.playground-toolbar,
.buddy-hero,
.buddy-chat-layout,
.original-study-shell,
.funqa-shell,
.control-grid,
.question-list-filters,
.records-grid,
.playground-options,
.hero-quick-actions,
.original-study-file-row,
.original-study-control-row {
  grid-template-columns: 1fr;
}

.home-hero-panel {
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 18px;
  border-radius: 28px;
}

.home-hero-copy h2 {
  margin: 10px 0;
  font-size: 34px;
  line-height: 1.14;
}

.home-hero-copy p,
.home-title p,
.feature-card p {
  color: var(--game-text-soft);
}

.home-hero-visual {
  justify-items: stretch;
  overflow: hidden;
}

.home-hero-avatar {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 5 / 4;
}

.home-hero-avatar img {
  object-position: center top;
}

.hero-bubble {
  flex: 1 1 0;
}

.home-badge-strip {
  width: 100%;
}

.home-badge-strip img,
.home-hero-avatar img,
.feature-card-icon,
.btn-icon,
.app-nav-icon {
  max-width: 100%;
}

.feature-card {
  min-height: 164px;
  padding: 18px;
  overflow: hidden;
}

.feature-card h2 {
  margin-top: 12px;
  font-size: 23px;
}

.section-header h3,
.home-title h2 {
  font-size: 28px;
  overflow-wrap: anywhere;
}

.tab-row {
  width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.tab-row::-webkit-scrollbar {
  display: none;
}

.btn,
.tab-btn,
select,
input,
textarea {
  min-height: 50px;
  border-radius: 18px;
}

.btn,
.tab-btn {
  font-weight: 800;
}

.tab-btn {
  white-space: nowrap;
}

.records-toolbar,
.records-summary,
.records-pagination,
.buddy-profile-top,
.buddy-panel-head,
.buddy-profile-metrics,
.buddy-task-meta,
.buddy-task-actions,
.playground-pill-row,
.question-list-pagination,
.original-study-sidebar-header,
.original-dubbing-header {
  flex-direction: column;
  align-items: flex-start;
}

.records-tools,
.playground-pill-row {
  justify-content: flex-start;
}

.records-search,
.records-tools label {
  min-width: 100%;
}

.funqa-live2d-panel,
.daily-live2d-widget,
.mistake-live2d-widget {
  position: relative;
  inset: auto;
  width: 100%;
  margin: 8px 0 14px;
  border-radius: 22px;
}

.funqa-live2d-stage {
  height: 280px;
}

.daily-live2d-stage,
.mistake-live2d-stage {
  width: 100%;
  height: 208px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.12) 42%),
    linear-gradient(180deg, rgba(216, 238, 255, 0.9), rgba(252, 244, 219, 0.75));
}

.mistake-guide-panel {
  padding-top: 0;
}

.question-list-filters {
  position: sticky;
  top: 96px;
  z-index: 5;
}

.playground-question {
  font-size: 24px;
}

.buddy-chat-box,
.chat-box,
.coach-reply {
  min-height: 220px;
}

.original-player {
  min-height: 240px;
}

.app-bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  width: auto;
  max-width: calc(var(--mobile-max-width) - 24px);
  margin: 0 auto;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border-radius: 28px;
  border: 1px solid rgba(229, 185, 106, 0.4);
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.96), rgba(255, 238, 201, 0.92));
  box-shadow: 0 24px 38px rgba(152, 104, 26, 0.22);
  backdrop-filter: blur(20px);
}

.app-nav-btn {
  min-height: 64px;
  border-radius: 20px;
  min-width: 0;
}

.app-nav-btn span:last-child {
  font-size: 12px;
}

.app-nav-icon {
  width: 34px;
  height: 34px;
}

@media (max-width: 520px) {
  .app-top-controls {
    grid-template-columns: 1fr;
  }

  .home-hero-copy h2 {
    font-size: 28px;
  }
}

@media (max-width: 600px) {
  html,
  body,
  .app-shell,
  .layout.app-main,
  .home-screen {
    overflow-x: clip;
  }

  .hero-bubble,
  .feature-card,
  .home-dashboard-card,
  .sub-menu .btn,
  .app-progress-badge,
  .app-select-card {
    width: 100%;
  }
}

/* 2026-04 compact home tuning */
.app-hidden-controls {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layout.app-main {
  padding: 8px 10px calc(var(--mobile-safe-bottom) + 14px);
  gap: 12px;
}

.layout.app-main > .card {
  border-radius: 24px;
}

.home-hero-panel {
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
}

.home-hero-copy h2 {
  margin: 8px 0 6px;
  font-size: 27px;
  line-height: 1.18;
}

.home-hero-copy p,
.home-title p,
.feature-card p {
  font-size: 14px;
  line-height: 1.5;
}

.hero-quick-actions {
  gap: 8px;
}

.home-hero-avatar {
  aspect-ratio: 16 / 9;
  max-height: 148px;
}

.home-hero-avatar img {
  object-fit: cover;
}

.hero-bubble {
  min-width: 0;
  padding: 10px 12px;
}

.home-badge-strip {
  padding: 6px;
}

.feature-card {
  min-height: 128px;
  padding: 14px;
}

.feature-card h2 {
  margin-top: 8px;
  font-size: 20px;
}

.feature-card-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 8px;
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.hero-action,
.sub-menu-btn {
  min-height: 44px;
}

.home-title {
  margin-top: 12px;
}

.section-header h3,
.home-title h2 {
  font-size: 24px;
}

.section-title-combo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title-combo small {
  font-size: 13px;
  font-weight: 700;
  color: #8c7157;
}

.home-title p {
  margin-top: 4px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.stats-grid > div {
  padding: 10px 8px;
  border-radius: 16px;
  text-align: center;
}

.stats-grid span {
  font-size: 20px;
  line-height: 1.1;
}

.stats-grid small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
}

.home-dashboard-grid {
  margin-top: 12px;
  gap: 10px;
}

.home-dashboard-card {
  padding: 14px;
}

.home-task-list,
.home-memory-profile {
  margin-top: 10px;
  gap: 10px;
}

.sub-menu {
  margin-top: 12px;
  gap: 8px;
}

.sub-menu .btn {
  min-height: 46px;
}

@media (max-width: 520px) {
  .home-hero-copy h2 {
    font-size: 24px;
  }
}

/* 2026-04 final live2d and bottom-nav polish */
.daily-live2d-widget,
.mistake-live2d-widget,
.funqa-live2d-widget {
  position: absolute !important;
  top: 84px !important;
  right: 10px !important;
  left: auto !important;
  width: 132px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  user-select: none;
  touch-action: none;
  cursor: grab;
  z-index: 6;
  pointer-events: auto !important;
}

.daily-live2d-widget:active,
.mistake-live2d-widget:active,
.funqa-live2d-widget:active {
  cursor: grabbing;
}

.daily-live2d-stage,
.mistake-live2d-stage,
.funqa-live2d-stage {
  position: relative !important;
  width: 132px !important;
  height: 168px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  outline: 0 !important;
  overflow: hidden !important;
  pointer-events: auto !important;
}

.daily-live2d-stage::before,
.daily-live2d-stage::after,
.mistake-live2d-stage::before,
.mistake-live2d-stage::after,
.funqa-live2d-stage::before,
.funqa-live2d-stage::after,
.daily-live2d-widget::before,
.daily-live2d-widget::after,
.mistake-live2d-widget::before,
.mistake-live2d-widget::after,
.funqa-live2d-widget::before,
.funqa-live2d-widget::after {
  display: none !important;
  content: none !important;
}

.daily-live2d-frame,
.mistake-live2d-frame,
.funqa-live2d-frame {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.live2d-status {
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.chat-inline-image,
.mistake-generated-image {
  display: block;
  max-width: min(220px, 100%);
  border-radius: 14px;
  cursor: zoom-in;
  transition: box-shadow 0.22s ease;
}

.mistake-generated-image {
  max-width: 100%;
}

.zoomable-image:hover {
  box-shadow: 0 10px 24px rgba(20, 28, 48, 0.18);
}

.image-preview-dialog {
  width: min(96vw, 960px);
  max-height: 92vh;
  padding: 14px;
  background: rgba(12, 18, 29, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.image-preview-stage {
  display: grid;
  place-items: center;
  min-height: 320px;
}

.image-preview-target {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 88px);
  object-fit: contain;
  border-radius: 12px;
}

.app-bottom-nav {
  align-items: stretch;
}

.app-nav-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  text-align: center !important;
  color: #8e630f !important;
  background: linear-gradient(180deg, rgba(255, 229, 163, 0.72), rgba(255, 208, 112, 0.4)) !important;
  box-shadow: inset 0 0 0 1px rgba(233, 180, 76, 0.26) !important;
}

.app-nav-btn.active {
  color: #8a4c00 !important;
  background: linear-gradient(180deg, rgba(255, 216, 124, 0.96), rgba(255, 184, 72, 0.76)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 183, 74, 0.46),
    0 10px 18px rgba(201, 139, 30, 0.18) !important;
}

.app-nav-icon {
  display: block !important;
  width: 34px !important;
  height: 34px !important;
  padding: 5px !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(255, 238, 190, 0.96), rgba(255, 213, 118, 0.88)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(229, 173, 65, 0.34),
    0 6px 12px rgba(205, 145, 35, 0.12) !important;
}

.app-nav-btn.active .app-nav-icon {
  background: linear-gradient(180deg, rgba(255, 244, 210, 1), rgba(255, 208, 103, 0.96)) !important;
}

.app-nav-btn span:last-child {
  display: block !important;
  margin: 0 !important;
  line-height: 1.1 !important;
}

/* 2026-04 mobile section fixes */
.feature-section:not(.active-section) {
  display: none !important;
}

#daily-section,
#mistake-section,
#qa-section {
  position: relative;
}

#mistake-guide-tab .compact-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

#mistake-guide-tab .compact-row > input[type="text"] {
  grid-column: 1 / -1;
}

#mistake-guide-tab .compact-row > input[type="file"],
#mistake-guide-tab .compact-row > .btn {
  width: 100%;
  min-width: 0;
}

#mistake-guide-tab .compact-row > .btn,
#mistake-guide-tab .compact-row > input[type="file"]::file-selector-button {
  min-height: 46px;
  border-radius: 999px;
  font-weight: 800;
}

#mistake-guide-tab .compact-row > input[type="file"] {
  min-height: 46px;
  padding: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 231, 0.96));
  border: 1px solid rgba(223, 188, 127, 0.42);
}

#mistake-guide-tab .compact-row > input[type="file"]::file-selector-button {
  width: 100%;
  margin: 0;
  padding: 0 12px;
  border: 0;
  color: #8a5a13;
  background: linear-gradient(180deg, rgba(255, 229, 170, 0.98), rgba(255, 205, 107, 0.92));
  cursor: pointer;
}

#mistake-list-tab .question-list-filters {
  display: grid;
  grid-template-columns: 84px 1fr 1fr;
  gap: 8px;
  align-items: center;
}

#mistake-list-tab .question-list-filters #mistake-filter-keyword {
  grid-column: 1 / -1;
}

#mistake-list-tab .question-list-filters .btn {
  min-width: 0;
  width: 100%;
}

#learn-tab .control-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#learn-tab .control-grid > label {
  min-width: 0;
}

#learn-tab .control-grid > label:nth-of-type(1),
#learn-tab .control-grid > label:nth-of-type(2),
#learn-tab .control-grid > label:nth-of-type(3),
#learn-tab .control-grid > #learn-generate {
  grid-row: 1;
}

#learn-tab .control-grid > #learn-save,
#learn-tab .control-grid > #learn-reveal-all,
#learn-tab .control-grid > #learn-ai-analyze,
#learn-tab .control-grid > #learn-ask-teacher {
  grid-row: 2;
}

#learn-tab .control-grid .btn,
#learn-tab .control-grid select {
  min-height: 46px;
  border-radius: 999px;
}

#learn-tab .control-grid .btn {
  width: 100%;
  min-width: 0;
  font-weight: 800;
}

#review-tab .control-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

#review-tab .control-grid > label,
#review-tab .control-grid > #review-load {
  min-width: 0;
}

#review-tab .control-grid select,
#review-tab .control-grid .btn {
  min-height: 46px;
  border-radius: 999px;
}

#review-tab .control-grid .btn {
  width: 100%;
  min-width: 0;
  font-weight: 800;
}

#review-tab .coach-box .input-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

#review-tab .coach-box .input-row > #coach-answer {
  grid-column: 1 / -1;
  min-height: 42px;
  border-radius: 14px;
}

#review-tab .coach-box .input-row > #coach-asr,
#review-tab .coach-box .input-row > #coach-asr-flash,
#review-tab .coach-box .input-row > #coach-send {
  min-width: 0;
  min-height: 40px;
  width: 100%;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.learn-loading-dialog {
  width: min(420px, calc(100vw - 32px));
  text-align: center;
}

.learn-loading-body {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 8px 4px 6px;
}

.learn-loading-body p {
  margin: 0;
  color: #5b6f8b;
  line-height: 1.6;
}

.learn-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(255, 187, 79, 0.22);
  border-top-color: #ffad32;
  animation: learnSpin 0.9s linear infinite;
}

@keyframes learnSpin {
  to {
    transform: rotate(360deg);
  }
}

#daily-section .tab-row,
#mistake-section .tab-row,
#records-section .tab-row,
#qa-section .tab-row {
  overflow-x: visible;
  flex-wrap: wrap;
  white-space: normal;
  row-gap: 6px;
}

#daily-section .tab-row .tab-btn,
#daily-section .tab-row .btn,
#mistake-section .tab-row .tab-btn,
#mistake-section .tab-row .btn,
#records-section .tab-row .tab-btn,
#records-section .tab-row .btn,
#qa-section .tab-row .tab-btn,
#qa-section .tab-row .btn {
  flex: 0 1 auto;
  min-width: 0;
}

#daily-section .tab-row,
#mistake-section .tab-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

#daily-section .tab-row .tab-btn,
#daily-section .tab-row .btn,
#mistake-section .tab-row .tab-btn,
#mistake-section .tab-row .btn {
  width: 100%;
  min-height: 40px;
  padding: 8px 6px;
  justify-content: center;
  font-size: 13px;
}

#qa-section.active-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: calc(var(--mobile-safe-bottom) + 22px);
}

/* 2026-04 header/title compact overrides */
.section-title-combo {
  display: none !important;
}

#daily-section .tab-row,
#mistake-section .tab-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
  overflow: hidden !important;
}

#daily-section .tab-row .tab-btn,
#daily-section .tab-row .btn,
#mistake-section .tab-row .tab-btn,
#mistake-section .tab-row .btn {
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 36px !important;
  padding: 6px 4px !important;
  font-size: 12px !important;
}

#qa-section .funqa-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  padding-right: 0;
  overflow: visible;
}

#qa-section .chat-box {
  flex: 1 1 auto;
  min-height: 240px;
  max-height: min(46vh, 420px);
  overflow-y: auto;
}

.funqa-live2d-hidden-controls {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#qa-section .funqa-live2d-widget,
.daily-live2d-widget,
.mistake-live2d-widget {
  position: absolute !important;
  top: 84px !important;
  right: 10px !important;
  left: auto !important;
  width: 132px !important;
  z-index: 40 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

#qa-section .funqa-live2d-widget:active,
.daily-live2d-widget:active,
.mistake-live2d-widget:active {
  cursor: grabbing;
}

#qa-section .funqa-live2d-stage,
.daily-live2d-stage,
.mistake-live2d-stage,
.funqa-live2d-stage {
  position: relative !important;
  width: 132px !important;
  height: 168px !important;
  overflow: hidden !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

.daily-live2d-frame,
.mistake-live2d-frame,
.funqa-live2d-frame {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  background: transparent !important;
  display: block !important;
  pointer-events: none !important;
}

.app-bottom-nav {
  z-index: 1200 !important;
}

#qa-section > .qa-input-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  position: sticky;
  bottom: calc(var(--mobile-safe-bottom) - 8px);
  z-index: 6;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 249, 238, 0.96);
  border: 1px solid var(--game-line);
  box-shadow: 0 12px 28px rgba(181, 122, 37, 0.12);
}

#qa-section > .qa-input-row > #funqa-input {
  min-height: 42px;
  border-radius: 14px;
}

.qa-action-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

#qa-section .qa-action-row > #funqa-image-trigger,
#qa-section .qa-action-row > #funqa-asr,
#qa-section .qa-action-row > #funqa-asr-flash,
#qa-section .qa-action-row > #funqa-send {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
}

#qa-section .qa-action-row > #funqa-image-trigger,
#qa-section .qa-action-row > #funqa-asr,
#qa-section .qa-action-row > #funqa-asr-flash,
#qa-section .qa-action-row > #funqa-send {
  min-height: 40px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
}

#qa-section .qa-action-row > #funqa-image-trigger {
  justify-content: center;
  padding-left: 6px;
  padding-right: 6px;
}
