:root {
  --bg: #f3f5fb;
  --card: #ffffff;
  --primary: #4f46e5;
  --primary-strong: #7c3aed;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --surface: #f9fafb;
  --surface-alt: #f3f4f6;
  --subtitle: #9ca3af;
  --btn-disabled-bg: #e5e7eb;
  --btn-disabled-text: #9ca3af;
  --tag-success-bg: #ecfdf5;
  --tag-success-text: #059669;
  --ipa-accent: #4338ca;
  --ring: 0 0 0 3px rgba(79, 70, 229, 0.2);
  --radius-lg: 20px;
  --radius-md: 14px;
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-blur: 16px;
  --glass-glow: rgba(99, 102, 241, 0.26);
}

[data-theme="dark"] {
  --bg: #0b1020;
  --card: #131a2b;
  --primary: #818cf8;
  --primary-strong: #a78bfa;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #24324a;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  --surface: #162136;
  --surface-alt: #1b2942;
  --subtitle: #9ca3af;
  --btn-disabled-bg: #2a3652;
  --btn-disabled-text: #7a859c;
  --tag-success-bg: #17322a;
  --tag-success-text: #6ee7b7;
  --ipa-accent: #93c5fd;
  --ring: 0 0 0 3px rgba(129, 140, 248, 0.24);
  --glass-bg: rgba(19, 26, 43, 0.58);
  --glass-bg-strong: rgba(22, 33, 54, 0.7);
  --glass-border: rgba(148, 163, 184, 0.24);
  --glass-glow: rgba(129, 140, 248, 0.2);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(79, 70, 229, 0.12), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(124, 58, 237, 0.08), transparent 40%),
    var(--bg);
  color: var(--text);
  letter-spacing: 0.01em;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  filter: blur(48px);
  opacity: 0.45;
}

body::before {
  top: -120px;
  right: -140px;
  background: radial-gradient(circle, var(--glass-glow), transparent 62%);
}

body::after {
  bottom: -160px;
  left: -150px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.18), transparent 64%);
}

.app {
  min-height: 100vh;
  padding: 12px 0 88px;
  position: relative;
  z-index: 1;
  width: 100%;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeUpIn 260ms ease-out;
}

.card {
  background:
    linear-gradient(145deg, var(--glass-bg-strong), var(--glass-bg)),
    var(--card);
  padding: 24px 22px;
  margin: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.32), transparent 34%, transparent 62%, rgba(255, 255, 255, 0.08));
  opacity: 0.45;
}

.header {
  text-align: center;
  margin-bottom: 24px;
}

.title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 13px;
  color: var(--subtitle);
  margin-top: 8px;
}


.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 0;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 56%;
  height: 100%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transition: left 0.45s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.32);
  filter: saturate(1.05);
}

.btn-primary:hover::after {
  left: 130%;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.btn-disabled,
.btn-primary:disabled {
  background-color: var(--btn-disabled-bg);
  color: var(--btn-disabled-text);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-primary.btn-disabled::after,
.btn-primary:disabled::after {
  display: none;
}

.mt-20 {
  margin-top: 16px;
}

.mt-10 {
  margin-top: 10px;
}

.chinese-variant-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chinese-variant-row .variant-label {
  font-size: 13px;
  color: var(--muted);
  margin-right: 4px;
}

.btn-variant {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.15));
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-variant:hover {
  background: var(--surface-alt);
}

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

.stats-container {
  display: flex;
  justify-content: space-around;
  margin-bottom: 24px;
}

.stats-item {
  text-align: center;
}

.stats-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
}

.stats-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.month-selector {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.22));
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.month-title {
  font-size: 16px;
  font-weight: 700;
}

.weekday-header {
  display: flex;
  margin-bottom: 10px;
}

.weekday {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.calendar-days {
  display: flex;
  flex-wrap: wrap;
}

.calendar-day {
  width: 14.28%;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 14px;
}

.calendar-day.today {
  color: var(--primary);
  font-weight: 700;
}

.calendar-day.signed::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 6px;
  height: 6px;
  background-color: var(--primary);
  border-radius: 50%;
}

.input-container {
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.22)),
    var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.content-input {
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 16px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.content-input:focus,
.chat-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

.language-type {
  padding: 8px 12px;
  background-color: var(--tag-success-bg);
  border-radius: 8px;
  font-size: 13px;
  color: var(--tag-success-text);
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.simplified-mode-tag {
  background-color: #e6a23c;
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  padding: 2px 8px;
}

.section {
  margin-top: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-left: 12px;
  border-left: 3px solid var(--primary-strong);
}

.phonetics {
  font-size: 18px;
  color: var(--text);
  padding: 12px;
}

.phonetics-source {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  padding-left: 12px;
  background-color: var(--surface);
  border-radius: 8px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.ipa {
  font-family: "Times New Roman", serif;
  color: var(--ipa-accent);
}

.tone-distribution {
  padding: 12px;
  background-color: var(--surface-alt);
  border-radius: 8px;
}

.tone-bar-container {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.tone-bar {
  height: 18px;
  border-radius: 6px;
  min-width: 24px;
  display: flex;
  align-items: center;
  padding-left: 6px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  transition: width 0.5s;
}

.tone-1 { background-color: #409eff; }
.tone-2 { background-color: #67c23a; }
.tone-3 { background-color: #e6a23c; }
.tone-4 { background-color: #f56c6c; }
.tone-5 { background-color: #909399; }
.tone-6 { background-color: #9c27b0; }
.tone-7 { background-color: #00bcd4; }
.tone-8 { background-color: #8d6e63; }
.tone-9 { background-color: #795548; }

.tone-value {
  margin-left: 10px;
  font-size: 12px;
  color: var(--muted);
}

.tone-tip {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

.lip-sync-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

.lip-sync-gif {
  max-width: 100%;
  max-height: 240px;
  border-radius: 12px;
  background-color: var(--surface-alt);
}

.lip-sync-status {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.lip-sync-btn {
  max-width: 280px;
}

.pronunciation-tips {
  font-size: 14px;
  color: var(--muted);
  padding: 12px;
  line-height: 1.6;
}

.tip-item {
  margin-bottom: 10px;
}

.chat-section {
  margin-top: 16px;
}

.chat-container {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.18));
  min-height: 120px;
  max-height: 280px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.22));
  color: var(--text);
  border: 1px solid var(--glass-border);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--card);
  color: var(--text);
}

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

.chat-input-row .chat-send-btn {
  flex-shrink: 0;
  width: auto;
  min-width: 0;
  padding: 12px 20px;
}

.suggested-words-section .section-title {
  margin-bottom: 8px;
}

.suggested-words-loading {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 0;
}

.suggested-words-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.2));
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.suggestion-chip:hover {
  background: var(--card);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.record-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.4), rgba(2, 6, 23, 0.78));
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.record-overlay.active {
  display: flex;
}

.record-container {
  width: 90%;
  background: linear-gradient(145deg, var(--glass-bg-strong), var(--glass-bg));
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.record-title {
  padding: 16px;
  background-color: var(--surface);
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}

.record-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.record-text {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 12px;
  text-align: center;
}

.record-phonetics {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 12px;
  text-align: center;
  padding: 10px;
  background-color: var(--surface-alt);
  border-radius: 8px;
  width: 90%;
}

.record-practice-aid {
  width: 100%;
  max-height: 140px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.record-overlay-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.record-overlay-tips-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.record-overlay-tip-item {
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
}

.record-overlay-lipsync {
  margin-top: 10px;
}

.record-overlay-lipsync-gif {
  max-width: 120px;
  max-height: 90px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.record-overlay-lipsync-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 6px 0;
}

.record-timer {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
}

.record-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.record-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background-color: var(--surface);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.record-btn-inner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e74c3c;
}

.record-btn.recording .record-btn-inner {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.record-label {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
}

.record-actions {
  padding: 14px;
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--border);
}

.cancel-btn {
  background-color: var(--surface);
  color: var(--muted);
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 14px;
  cursor: pointer;
}

.practice-inline-section {
  padding: 16px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.practice-inline-text {
  font-size: 18px;
  color: var(--text);
  margin: 12px 0 8px;
  text-align: center;
}

.practice-inline-phonetics {
  font-size: 15px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 12px;
  padding: 8px;
  background: var(--surface);
  border-radius: 8px;
}

.practice-inline-timer {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
}

.practice-inline-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.practice-inline-record-btn {
  width: 56px;
  height: 56px;
}

.practice-inline-record-label {
  font-size: 14px;
  color: var(--muted);
}

.evaluation-inline-section .evaluation-inline-content-text {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 12px;
}

.evaluation-redirect-message {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.content-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.24));
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.content-text {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
}

.audio-control {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.play-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--surface);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow);
  border: none;
  cursor: pointer;
}

.play-inner {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent var(--primary-strong);
  margin-left: 4px;
}

.play-icon.playing .play-inner {
  width: 18px;
  height: 18px;
  border: none;
  background-color: var(--primary-strong);
  margin-left: 0;
}

.play-text {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.recording-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.recording-indicator {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  color: #f00;
}

.recording-dot {
  width: 10px;
  height: 10px;
  background-color: #f00;
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.2; }
  100% { opacity: 1; }
}

.recording-btn {
  background-color: #ff4d4f;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

.result-container {
  margin-bottom: 20px;
}

.score-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.22));
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  box-shadow: 0 14px 28px rgba(79, 70, 229, 0.3);
}

.score-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.score-text {
  font-size: 14px;
  margin-top: 6px;
}

.score-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: center;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.score-breakdown-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
}

.score-breakdown-label {
  color: var(--muted);
}

.score-breakdown-value {
  font-weight: 600;
  color: var(--text);
}

.ipa-card,
.pronunciation-card,
.feedback-card {
  margin-top: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.22));
  border: 1px solid var(--glass-border);
  padding: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.azure-not-ready-message {
  margin-top: 14px;
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  white-space: pre-line;
}

.ipa-text {
  font-size: 15px;
  padding: 10px;
  background-color: var(--surface-alt);
  border-radius: 8px;
  text-align: center;
}

.feedback-list {
  padding: 6px 0;
}

.feedback-item {
  display: flex;
  margin-bottom: 10px;
}

.feedback-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary-strong);
  margin-top: 6px;
  margin-right: 10px;
}

.feedback-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.action-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.action-btn {
  flex: 1;
  height: 44px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
}

.action-btn.secondary {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}


.form-container {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.22));
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  padding: 16px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.form-item {
  margin-bottom: 16px;
}

.form-label {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 10px;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.language-toggle {
  display: flex;
  align-items: center;
}

.ml-10 {
  margin-left: 10px;
}

.btn-primary.theme-active {
  outline: 2px solid var(--primary-strong);
  outline-offset: 2px;
}

.avatar-section {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.22));
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  padding: 16px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.avatar-description {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.avatar-container {
  width: 140px;
  height: 140px;
  position: relative;
  margin: 16px auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.avatar-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--surface);
}

.avatar-icon {
  font-size: 36px;
  color: var(--muted);
  margin-bottom: 6px;
}

.avatar-text {
  font-size: 13px;
  color: var(--muted);
}

.avatar-uploaded {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-uploaded .avatar-text {
  color: #fff;
  font-size: 12px;
}

.avatar-tip {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
}

.tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 66px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 90;
  overflow: hidden;
}

.tabbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.34), transparent 36%, transparent 68%, rgba(255, 255, 255, 0.08));
  opacity: 0.72;
}

.tab-item {
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center top 8px;
  background-size: 24px 24px;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 32px 16px 8px;
  min-width: 64px;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.tab-item.active {
  background-color: color-mix(in srgb, var(--primary) 15%, transparent);
  border-radius: 12px;
  color: var(--primary);
  font-weight: 700;
}

.tab-item:hover {
  transform: translateY(-1px);
}

#tabHome {
  background-image: url('assets/nav-home.svg');
}
#tabHome.active {
  background-image: url('assets/nav-home-active.svg');
}
#tabLearning {
  background-image: url('assets/nav-learning.svg');
}
#tabLearning.active {
  background-image: url('assets/nav-learning-active.svg');
}
#tabSettings {
  background-image: url('assets/nav-settings.svg');
}
#tabSettings.active {
  background-image: url('assets/nav-settings-active.svg');
}

@media (min-width: 768px) {
  .app {
    padding: 20px 28px 24px 132px;
  }

  .card {
    max-width: 920px;
    margin: 18px auto;
  }

  .tabbar {
    left: 18px;
    right: auto;
    top: 18px;
    bottom: 18px;
    width: 94px;
    height: auto;
    border-radius: 26px;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 8px;
  }

  .tab-item {
    width: 100%;
    min-width: 0;
    min-height: 84px;
    border-radius: 16px;
    background-position: center 14px;
    background-size: 26px 26px;
    padding: 46px 6px 10px;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
  }

  .tab-item.active {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, var(--glass-border));
    transform: none;
  }

  .stats-container {
    justify-content: space-between;
    gap: 12px;
  }

  .stats-item {
    flex: 1;
    padding: 14px 8px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18));
    border: 1px solid var(--glass-border);
  }

  .content-card,
  .score-card,
  .form-container,
  .avatar-section {
    padding: 18px;
  }
}

@media (min-width: 1024px) {
  .app {
    padding-left: 148px;
    padding-right: 36px;
  }

  .card {
    max-width: 1080px;
    margin-top: 22px;
  }

  .header {
    margin-bottom: 28px;
  }

  .title {
    font-size: 27px;
  }

  .tabbar {
    width: 102px;
  }

  .tab-item {
    min-height: 88px;
  }
}

@media (hover: hover) {
  .card:hover {
    border-color: color-mix(in srgb, var(--glass-border) 55%, var(--primary));
    box-shadow: 0 16px 38px rgba(17, 24, 39, 0.14);
  }
}

@media (max-width: 420px) {
  .card {
    margin: 12px;
    padding: 20px 16px;
  }

  .tabbar {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }
}

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
