:root {
  --bg1: #fff1f6;
  --bg2: #ffe3ee;
  --card: rgba(255, 255, 255, 0.8);
  --stroke: rgba(255, 255, 255, 0.72);
  --text: #3f2b36;
  --sub: #7d6270;
  --brand: #ff5f8f;
  --brand2: #ff8bb0;
  --shadow: 0 16px 40px rgba(255, 95, 143, 0.18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #ffeef4 0, transparent 36%),
    radial-gradient(circle at top right, #ffd8e7 0, transparent 26%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  overflow-x: hidden;
}

[v-cloak] { display: none; }

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: calc(env(safe-area-inset-top) + 14px) 14px calc(env(safe-area-inset-bottom) + 18px);
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}
.orb-a { width: 150px; height: 150px; background: #ffd2e2; top: 2%; left: -40px; }
.orb-b { width: 110px; height: 110px; background: #fff2b8; top: 24%; right: -20px; animation-delay: -4s; }
.orb-c { width: 180px; height: 180px; background: #ffc0d6; bottom: 10%; left: 18%; animation-delay: -7s; }

.topbar, .main, .toast { position: relative; z-index: 1; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.brand-block {
  flex: 1;
  min-width: 0;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--brand);
  text-transform: uppercase;
  font-weight: 700;
}
.topbar h1 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
  word-break: break-word;
}
.icon-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.main { padding-bottom: 12px; }
.screen { display: grid; gap: 14px; }

.glass {
  background: var(--card);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-card, .result-card {
  border-radius: 28px;
  padding: 18px;
}
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 95, 143, 0.11);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}
.hero-card h2, .result-card h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.15;
}
.hero-card p, .result-card p {
  margin: 0;
  color: var(--sub);
  line-height: 1.7;
}
.hero-metrics, .result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.result-stats--two {
  grid-template-columns: repeat(2, 1fr);
}
.hero-metrics div, .result-stats div {
  text-align: center;
  padding: 12px 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}
.hero-metrics strong, .result-stats strong {
  display: block;
  font-size: 20px;
  color: var(--brand);
  white-space: nowrap;
}
.hero-metrics span, .result-stats span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--sub);
}

.hero-actions, .inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.result-card .hero-actions {
  margin-top: 22px;
}

.nav-grid, .list-grid {
  display: grid;
  gap: 12px;
}
.nav-card {
  border: 0;
  text-align: left;
  padding: 16px;
  border-radius: 22px;
  cursor: pointer;
}
.nav-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}
.nav-card span {
  color: var(--sub);
  line-height: 1.6;
}

.primary-btn, .ghost-btn, .icon-btn, .tab-btn {
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.primary-btn, .ghost-btn, .icon-btn {
  min-height: 48px;
  padding: 0 18px;
  font-size: 15px;
}
.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 12px 22px rgba(255, 95, 143, 0.25);
}
.ghost-btn {
  color: var(--brand);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 95, 143, 0.18);
}
.icon-btn {
  min-width: 52px;
  color: var(--brand);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 95, 143, 0.16);
  white-space: nowrap;
}
.small { min-height: 40px; font-size: 13px; }
.tiny { min-height: 34px; padding: 0 12px; font-size: 12px; }

.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-radius: 22px;
  padding: 14px 16px;
}
.stage-title {
  font-size: 18px;
  font-weight: 800;
}
.stage-subtitle {
  margin-top: 4px;
  color: var(--sub);
  font-size: 13px;
}
.lives {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 95, 143, 0.12);
  color: var(--brand);
  font-weight: 800;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
}
.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7aa8, #ffb3c8);
  transition: width 0.3s ease;
}

.playfield {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.lane {
  border-radius: 24px;
  padding: 12px;
}
.lane-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 10px;
}
.quote-card {
  display: block;
  width: 100%;
  min-height: 66px;
  margin-bottom: 10px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 95, 143, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  text-align: left;
  line-height: 1.45;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(255, 95, 143, 0.08);
}
.quote-card:last-child { margin-bottom: 0; }
.quote-card.selected {
  border-color: rgba(255, 95, 143, 0.7);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(255, 95, 143, 0.2);
}
.quote-card.matched {
  background: linear-gradient(135deg, rgba(255, 95, 143, 0.16), rgba(255, 179, 200, 0.22));
  border-color: rgba(255, 95, 143, 0.35);
  color: #8d3557;
}
.quote-card.mismatch { animation: shake 0.28s linear 1; }

.stage-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-radius: 20px;
  padding: 12px 14px;
  color: var(--sub);
  font-size: 13px;
}

.result-emoji {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 10px;
}
.quote-spot {
  border-radius: 20px;
  padding: 14px;
  margin-top: 12px;
}
.quote-spot.compact {
  margin-top: 10px;
  padding: 12px;
}
.spot-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--brand);
  font-weight: 800;
}
.quote-spot p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
  font-weight: 700;
}

.tab-row {
  display: flex;
  gap: 8px;
}
.tab-btn {
  min-height: 42px;
  padding: 0 16px;
  color: var(--sub);
  background: rgba(255, 255, 255, 0.65);
}
.tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
}

.library-card {
  border-radius: 22px;
  padding: 14px;
}
.library-main {
  display: grid;
  gap: 8px;
}
.favorite-left {
  color: var(--brand);
  font-size: 16px;
  font-weight: 800;
}
.favorite-right {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}
.line-text {
  white-space: pre-line;
  line-height: 1.7;
  font-weight: 700;
}
.library-meta, .history-top {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--sub);
  font-size: 12px;
}
.history-top strong {
  color: var(--text);
}
.history-meta {
  margin-top: 6px;
  color: var(--sub);
  font-size: 13px;
}
.history-items {
  margin-top: 10px;
  border-radius: 18px;
  padding: 12px;
}
.history-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.65;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 95, 143, 0.08);
}
.history-line span {
  flex: 1;
  min-width: 0;
}
.history-line:first-of-type {
  border-top: 0;
  padding-top: 2px;
}

.empty-state {
  padding: 26px 18px;
  text-align: center;
  color: var(--sub);
  border-radius: 22px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: calc(100vw - 28px);
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(63, 43, 54, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.fade-slide-enter-active, .fade-slide-leave-active {
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.fade-slide-enter, .fade-slide-leave-to {
  opacity: 0;
  transform: translateY(8px);
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, 12px, 0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .icon-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }
  .icon-btn {
    width: 100%;
    min-height: 40px;
    padding: 0 8px;
    font-size: 12px;
  }
  .playfield { grid-template-columns: 1fr; }
  .hero-card h2, .result-card h2 { font-size: 24px; }
  .topbar h1 { font-size: 18px; }
  .hero-metrics, .result-stats { grid-template-columns: repeat(3, 1fr); }
  .stage-footer, .library-meta, .history-top { align-items: flex-start; flex-direction: column; }
}
