:root {
  --bg: #fff8f0;
  --glass: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 160, 100, 0.25);
  --text: #2d3436;
  --muted: #636e72;
  --accent: #ff6b6b;
  --accent-2: #4ecdc4;
  --accent-warm: #ffd93d;
  --highlight: rgba(255, 217, 61, 0.45);
  --unknown: rgba(78, 205, 196, 0.35);
  --current: rgba(255, 217, 61, 0.55);
  --danger: #ff7675;
  --radius: 22px;
  --shadow: 0 12px 40px rgba(255, 140, 80, 0.15);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: float 18s ease-in-out infinite;
}

.blob-1 {
  width: 55vw;
  height: 55vw;
  top: -10%;
  left: -10%;
  background: radial-gradient(circle, #ffd93d, transparent 70%);
}

.blob-2 {
  width: 45vw;
  height: 45vw;
  right: -8%;
  top: 20%;
  background: radial-gradient(circle, #ff9ff3, transparent 70%);
  animation-delay: -6s;
}

.blob-3 {
  width: 40vw;
  height: 40vw;
  bottom: -12%;
  left: 25%;
  background: radial-gradient(circle, #4ecdc4, transparent 70%);
  animation-delay: -12s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(4%, 6%) scale(1.05);
  }
  66% {
    transform: translate(-3%, 4%) scale(0.96);
  }
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  max-width: 1520px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  align-items: start;
}

.records-sidebar {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  padding: 16px;
  min-height: 320px;
}

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

.records-head-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.records-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.records-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.records-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 24px 8px;
}

.record-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.record-item:hover,
.record-item.active {
  border-color: var(--accent-2);
  background: rgba(78, 205, 196, 0.12);
  transform: translateY(-1px);
}

.record-phrase,
.record-title {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.record-title {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.record-meaning {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.record-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 6px;
}

.record-time {
  color: var(--muted);
  font-size: 0.72rem;
}

.record-actions {
  display: flex;
  gap: 4px;
}

.record-actions .btn {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.record-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(94, 234, 212, 0.15);
  color: var(--accent-2);
  font-size: 0.7rem;
}

.app {
  position: relative;
  min-width: 0;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  margin-bottom: 20px;
}

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

.brand-icon {
  font-size: 2rem;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
}

h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.subtitle,
.hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.panel {
  padding: 18px 20px;
}

.content-panel {
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.learn-panel {
  grid-column: 1;
}

.panel-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.text-input-zone {
  margin-bottom: 14px;
  min-height: 120px !important;
}

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

textarea {
  width: 100%;
  resize: vertical;
  min-height: 180px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 2px solid var(--glass-border);
  background: #fff;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.2s;
}

textarea:focus {
  border-color: var(--accent-2);
}

.input-actions,
.controls,
.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.controls .btn-primary + .btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
}

.btn {
  border: 2px solid var(--glass-border);
  background: #fff;
  color: var(--text);
  padding: 12px 18px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s, background 0.15s, opacity 0.15s;
}

.btn:hover:not(:disabled) {
  background: #fff5eb;
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #ff6b6b, #ff9f43);
  border-color: transparent;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff5252, #ff8c33);
}

.btn-lg {
  padding: 14px 22px;
  font-size: 1.05rem;
  min-height: 52px;
}

.btn-accent {
  background: linear-gradient(135deg, #ffd93d, #ffb347);
  border-color: transparent;
  color: #2d3436;
  font-weight: 700;
}

.btn-camera {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-icon {
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  -webkit-tap-highlight-color: transparent;
}

.mobile-only {
  display: none;
}

.records-backdrop {
  display: none;
}

.reader {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 2px solid var(--glass-border);
  line-height: 1.9;
  font-size: 1.08rem;
  user-select: none;
  touch-action: pan-y;
}

.reader.empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-msg,
.learn-placeholder {
  color: var(--muted);
  text-align: center;
}

.sentence {
  margin-bottom: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.2s;
}

.sentence.current {
  background: var(--current);
}

.word {
  display: inline;
  padding: 3px 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.word:hover {
  background: rgba(255, 255, 255, 0.08);
}

.word.unknown {
  background: var(--unknown);
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.35);
}

.word.current-word {
  background: var(--highlight);
}

.punct {
  display: inline;
}

.reader-toolbar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.reader-toolbar .hint {
  display: block;
  margin-bottom: 8px;
}

.reader-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.sentence-block {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fffbf5;
  border: 2px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

.sentence-block.current {
  background: var(--current);
  border-color: rgba(255, 180, 50, 0.5);
}

.sentence-en {
  margin: 0 0 8px;
  padding: 0;
  line-height: 1.9;
}

.sentence-controls {
  display: flex;
  gap: 8px;
  margin: 0 0 8px;
  flex-wrap: wrap;
}

.btn-xs {
  padding: 4px 12px;
  font-size: 0.78rem;
  border-radius: 10px;
  line-height: 1.6;
}

.sentence-rate-btn.active {
  background: rgba(255, 217, 61, 0.35);
  border-color: #ffb347;
  color: #e17000;
}

.sentence-zh {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(78, 205, 196, 0.15);
  color: #2d6a6a;
  font-size: 0.98rem;
  line-height: 1.65;
  border-left: 4px solid var(--accent-2);
}

.sentence-zh.loading {
  color: var(--muted);
  font-style: italic;
}

.sentence-zh.muted {
  color: var(--muted);
}

.word-wrap {
  display: inline;
  position: relative;
}

.word.learned {
  border-bottom: 1px dashed rgba(94, 234, 212, 0.5);
}

.word-gloss {
  display: block;
  font-size: 0.72rem;
  color: var(--accent-2);
  line-height: 1.2;
  margin-top: 1px;
  pointer-events: none;
}

.vocab-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-right: 4px;
}

.vocab-cards.hidden {
  display: none;
}

.vocab-card-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--glass-border);
  animation: fadeIn 0.25s ease;
  transition: border-color 0.2s, background 0.2s;
}

.vocab-card-item.active {
  border-color: rgba(94, 234, 212, 0.45);
  background: rgba(94, 234, 212, 0.08);
}

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

.word-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.card-word {
  font-size: 1.6rem;
  font-weight: 700;
}

.card-ipa-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.card-ipa-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.95rem;
}

.ipa-label {
  color: var(--muted);
  font-size: 0.85rem;
  min-width: 1.2em;
}

.card-ipa {
  color: var(--accent-2);
  font-size: 1rem;
}

.card-defs {
  margin-top: 12px;
}

.card-defs-title {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.card-def-line {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
}

.word-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.tag {
  background: rgba(124, 156, 255, 0.2);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.card-meaning {
  font-size: 1rem;
}

.card-context {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.learn-placeholder {
  padding: 28px 12px;
}

.vocab-audio-tag {
  font-size: 0.75rem;
  margin-left: 8px;
  opacity: 0.85;
}

.vocab-audio-tag.muted {
  color: var(--muted);
  opacity: 0.65;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.85rem;
  color: var(--muted);
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.badge.ok {
  color: var(--accent-2);
}

.badge.warn {
  color: #fbbf24;
}

.badge.err {
  color: var(--danger);
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.drawer.open {
  pointer-events: auto;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s;
}

.drawer.open .drawer-backdrop {
  opacity: 1;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  padding: 22px;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow-y: auto;
  border-radius: 0;
}

.drawer.open .drawer-panel {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.settings-form fieldset {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 14px;
}

.settings-form legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.settings-tip {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.settings-tip a {
  color: var(--accent);
}

.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.settings-form input,
.settings-form select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 16px;
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
}

.checkbox-label input {
  width: auto;
}

.loading {
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 16px 14px 28px;
  }
}

@media (max-width: 768px) {
  .mobile-only {
    display: inline-flex;
  }

  .records-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 89;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .records-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .app-shell {
    padding: 10px 10px calc(16px + env(safe-area-inset-bottom));
    gap: 12px;
  }

  .records-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 90;
    width: min(320px, 88vw);
    max-height: none;
    min-height: 0;
    margin: 0;
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.4);
  }

  .records-sidebar.open {
    transform: translateX(0);
  }

  .header {
    padding: 12px 14px;
    margin-bottom: 12px;
    gap: 8px;
  }

  .brand {
    flex: 1;
    min-width: 0;
    gap: 10px;
  }

  .brand-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
  }

  h1 {
    font-size: 1.1rem;
  }

  .subtitle {
    display: none;
  }

  .panel {
    padding: 14px;
  }

  .content-panel {
    min-height: auto;
  }

  .panel-head {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

  .panel-head-actions {
    width: 100%;
  }

  .panel-head-actions .btn {
    flex: 1;
    min-height: 44px;
  }

  textarea,
  .text-input-zone {
    font-size: 16px;
    min-height: 100px !important;
  }

  .reader {
    min-height: 200px;
    max-height: 50vh;
    max-height: 50dvh;
    font-size: 1rem;
    padding: 12px;
  }

  .reader-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .reader-meta .btn {
    flex: 1;
    min-height: 44px;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .controls .btn {
    min-height: 48px;
    padding: 12px 10px;
    font-size: 0.88rem;
  }

  .controls .btn-primary {
    min-height: 50px;
  }

  .vocab-cards {
    max-height: 38vh;
    max-height: 38dvh;
  }

  .card-word {
    font-size: 1.35rem;
  }

  .status-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .drawer-panel {
    width: 100%;
    max-width: 100%;
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  }

  .blob {
    filter: blur(60px);
    opacity: 0.4;
  }

  .btn:hover:not(:disabled) {
    transform: none;
  }
}

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

  h1 {
    font-size: 1rem;
  }
}

.hidden {
  display: none !important;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.quota-badge {
  border: 2px solid var(--accent-2);
  background: rgba(78, 205, 196, 0.15);
  color: #2d6a6a;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.quota-badge.low {
  border-color: var(--danger);
  background: rgba(255, 118, 117, 0.15);
  color: var(--danger);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 248, 240, 0.92);
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  width: min(420px, 100%);
  padding: 32px 28px;
  text-align: center;
}

.auth-mascot {
  font-size: 3.5rem;
  margin-bottom: 8px;
}

.auth-title {
  margin: 0 0 6px;
  font-size: 1.6rem;
  color: var(--accent);
}

.auth-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--glass-border);
  border-radius: 14px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}

.auth-tab.active {
  border-color: var(--accent-2);
  background: rgba(78, 205, 196, 0.15);
  color: var(--text);
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-form input {
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid var(--glass-border);
  background: #fff;
  font-size: 16px;
}

.auth-error {
  color: var(--danger);
  font-size: 0.88rem;
  margin: 0 0 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
}

.modal.open {
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 52, 54, 0.35);
  opacity: 0;
  transition: opacity 0.25s;
}

.modal.open .modal-backdrop {
  opacity: 1;
}

.modal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(440px, calc(100% - 32px));
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}

.modal.open .modal-panel {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-tip {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 16px;
}

.plans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-card {
  padding: 16px;
  border-radius: 16px;
  border: 2px solid var(--glass-border);
  background: #fff;
}

.plan-card h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.plan-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.plan-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 10px;
}

.subscribe-msg {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(78, 205, 196, 0.15);
  color: #2d6a6a;
  font-size: 0.9rem;
}

.vocab-card-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 2px solid var(--glass-border);
}

.word:hover {
  background: rgba(255, 217, 61, 0.25);
}

.settings-form input,
.settings-form select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 2px solid var(--glass-border);
  background: #fff;
  color: var(--text);
  font-size: 16px;
}

.tag {
  background: rgba(255, 107, 107, 0.15);
  color: var(--accent);
}

.controls .btn-primary + .btn-primary {
  background: linear-gradient(135deg, #4ecdc4, #44bd32);
}

.vocab-play-btn {
  border: none;
  background: rgba(78, 205, 196, 0.2);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}

.vocab-play-btn:hover:not(:disabled) {
  background: rgba(78, 205, 196, 0.35);
  transform: scale(1.05);
}

.vocab-play-btn.playing {
  background: rgba(255, 217, 61, 0.45);
  animation: pulse-play 0.8s ease-in-out infinite;
}

.vocab-play-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes pulse-play {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.stats-panel {
  width: min(520px, 100%);
  max-height: min(85vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stats-content {
  overflow-y: auto;
  padding: 4px 2px 8px;
}

.stats-hero {
  text-align: center;
  padding: 20px 16px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.12), rgba(78, 205, 196, 0.18));
}

.stats-hero-label {
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.stats-hero-value {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.stats-hero-sub {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.stats-section {
  margin-bottom: 18px;
}

.stats-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.stats-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(78, 205, 196, 0.15);
  border: 1px solid rgba(78, 205, 196, 0.35);
  font-size: 0.88rem;
  font-weight: 600;
}

.stats-rank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-rank-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--glass-border);
}

.stats-rank-no {
  font-weight: 800;
  color: var(--accent);
  text-align: center;
}

.stats-rank-text {
  font-size: 0.92rem;
  line-height: 1.4;
  word-break: break-word;
}

.stats-rank-count {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.stats-empty-line {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.stats-footer {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--glass-border);
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

/* 留言墙 */
.wall-fab {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 120;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-2), #45b7aa);
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 8px 24px rgba(78, 205, 196, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.wall-fab:hover {
  transform: scale(1.06);
}

.wall-panel {
  position: fixed;
  inset: 0;
  z-index: 130;
  pointer-events: none;
}

.wall-panel.open {
  pointer-events: auto;
}

.wall-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 52, 54, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.wall-panel.open .wall-backdrop {
  opacity: 1;
}

.wall-sheet {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: min(420px, calc(100vw - 32px));
  max-height: min(78vh, 680px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  padding: 16px;
  transform: translateY(110%);
  transition: transform 0.28s ease;
  box-shadow: var(--shadow);
}

.wall-panel.open .wall-sheet {
  transform: translateY(0);
}

.wall-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.wall-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.wall-sub {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.wall-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}

.wall-chip {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 217, 61, 0.35);
  color: var(--text);
}

.wall-form {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.wall-form select,
.wall-form textarea {
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  background: rgba(255, 255, 255, 0.75);
}

.wall-form textarea {
  resize: vertical;
  min-height: 72px;
}

.wall-login-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.wall-admin-bar {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--glass-border);
}

.wall-admin-login {
  display: flex;
  gap: 8px;
}

.wall-admin-login input {
  flex: 1;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 10px;
}

.wall-admin-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--accent-2);
}

.wall-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.wall-empty {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 16px 8px;
}

.wall-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--glass-border);
}

.wall-item.is-mine {
  border-color: rgba(78, 205, 196, 0.45);
}

.wall-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.wall-item-head time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
}

.wall-tag {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.15);
  font-size: 0.7rem;
}

.wall-tag.mine {
  background: rgba(78, 205, 196, 0.2);
}

.wall-tag.hidden-tag {
  background: rgba(99, 110, 114, 0.15);
}

.wall-content {
  margin: 0;
  line-height: 1.5;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.wall-reply {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 217, 61, 0.25);
}

.wall-reply-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.wall-reply p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.wall-reply time {
  display: block;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--muted);
}

.wall-pending {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.wall-comments {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wall-comment {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
}

.wall-comment.is-mine {
  background: rgba(78, 205, 196, 0.12);
}

.wall-comment-author {
  font-weight: 600;
  font-size: 0.78rem;
}

.wall-comment p {
  margin: 4px 0;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.wall-comment time {
  font-size: 0.68rem;
  color: var(--muted);
}

.wall-btn-reply {
  align-self: flex-start;
  margin-top: 2px;
}

.wall-comment-form {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.wall-comment-form textarea {
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 8px;
  font: inherit;
  resize: vertical;
}

.wall-admin-actions {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.wall-reply-input {
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 6px 8px;
  font: inherit;
  resize: vertical;
}

.wall-admin-btns {
  display: flex;
  gap: 6px;
}

.wall-admin-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .wall-fab {
    left: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .wall-sheet {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 10px;
  }
}
