:root {
  --bg: #fbf8ff;
  --bg-2: #fffef8;
  --panel: rgba(255, 255, 255, 0.92);
  --ink: #1f2346;
  --muted: #66709b;
  --line: rgba(72, 89, 192, 0.12);
  --pink: #ff6c90;
  --orange: #ff9652;
  --blue: #4dbdff;
  --lime: #bfff70;
  --shadow: 0 22px 48px rgba(84, 96, 196, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 0 0, rgba(255, 108, 144, 0.18), transparent 28%),
    radial-gradient(circle at 100% 8%, rgba(77, 189, 255, 0.18), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(191, 255, 112, 0.18), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f7fbff 52%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 680px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 14px 108px;
}

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

.brand-kicker,
.eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.24em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--pink);
}

.brand-block h1,
.hero-copy h2,
.screen h2 {
  margin: 10px 0 0;
  font-size: clamp(28px, 4.5vw, 48px);
  line-height: 1.08;
}

.mode-pill,
.quota-chip,
.clock-pill,
.bottom-link,
.primary-btn,
.secondary-btn,
.ghost-btn,
.selected-chip {
  border: 0;
  border-radius: 999px;
}

.mode-pill {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  pointer-events: none;
  display: none;
}

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

.hero-panel,
.soft-panel,
.score-panel {
  background: var(--panel);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.86);
}

.hero-panel {
  padding: 18px;
  overflow: hidden;
}

.hero-copy p,
.hero-panel p,
.soft-panel p,
.muted {
  color: var(--muted);
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
}

.stat-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(249, 251, 255, 0.92);
  box-shadow: inset 0 0 0 1px var(--line);
}

.stat-card strong {
  display: block;
  font-size: 26px;
  margin-bottom: 6px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  width: 100%;
  min-height: 50px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: #fff;
  box-shadow: 0 16px 30px rgba(255, 108, 144, 0.24);
}

.secondary-btn {
  background: linear-gradient(135deg, var(--blue), #5a78ff);
  color: #fff;
  box-shadow: 0 16px 30px rgba(90, 120, 255, 0.2);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: start;
}

.guide-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffe0eb, #d9f5ff);
  font-weight: 800;
}

.guide-item p {
  margin: 0;
}

.guide-list--feedback .guide-item {
  grid-template-columns: 42px 1fr;
  align-items: start;
}

.soft-panel {
  padding: 16px;
}

.compact-panel {
  padding: 12px 14px;
}

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

.training-header h2,
.thinking-panel h2,
.speaking-panel h2 {
  margin: 6px 0 0;
  font-size: clamp(22px, 3.6vw, 32px);
}

.training-header-copy {
  min-width: 0;
}

.quota-chip,
.clock-pill,
.selected-chip,
.bottom-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quota-chip,
.clock-pill {
  min-height: 38px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

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

.selected-row--center {
  justify-content: center;
}

.selected-chip {
  min-height: 38px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--lime), #73f5b2);
  color: var(--ink);
  font-weight: 800;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.matrix-card {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(145deg, #ffffff, #f4f7ff);
  box-shadow: inset 0 0 0 1px var(--line), 0 14px 26px rgba(83, 94, 191, 0.08);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.matrix-card.hidden {
  background: linear-gradient(145deg, var(--pink), #5c77ff);
  color: #fff;
}

.matrix-card.selected {
  background: linear-gradient(145deg, var(--lime), #70f4c1);
}

.matrix-card.used {
  background: linear-gradient(145deg, #ecf0fb, #dde5f2);
  color: #8a93b3;
}

.thinking-panel,
.speaking-panel,
.feedback-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timer-ring {
  width: 132px;
  height: 132px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(255,255,255,0.98) 0 48%, rgba(255,108,144,0.16) 49% 68%, rgba(77,189,255,0.18) 69% 100%);
  box-shadow: var(--shadow);
}

.timer-ring span {
  font-size: 30px;
  font-weight: 800;
}

.method-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.92);
  box-shadow: inset 0 0 0 1px var(--line);
}

.method-card + .method-card {
  margin-top: 12px;
}

.transcript-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.92);
  box-shadow: inset 0 0 0 1px var(--line);
}

.transcript-card textarea {
  width: 100%;
  min-height: 112px;
  margin-top: 8px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  outline: none;
}

.transcript-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.soft-speech-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.clock-pill--inline {
  min-width: 84px;
  font-size: 18px;
  font-weight: 800;
}

.action-row,
.cta-stack,
.meta-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-row--compact {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 8px;
}

.soft-tip-strip {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 108, 144, 0.09), rgba(77, 189, 255, 0.12));
  box-shadow: inset 0 0 0 1px var(--line);
}

.speaking-panel .panel-title-row {
  align-items: flex-start;
}

.soft-tip-strip strong {
  font-size: 14px;
}

.soft-tip-strip span {
  color: var(--muted);
  line-height: 1.55;
}

.analyzing-panel {
  text-align: center;
}

.analyzing-orbit {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 10px 0;
}

.analyzing-orbit span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), #5a78ff);
  animation: hop 1s infinite ease-in-out;
}

.analyzing-orbit span:nth-child(2) {
  animation-delay: 120ms;
}

.analyzing-orbit span:nth-child(3) {
  animation-delay: 240ms;
}

.score-panel {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: stretch;
}

.score-main,
.meta-stack--right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.meta-stack--right {
  align-items: flex-end;
  text-align: right;
}

.score-number {
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
}

.radar-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: center;
}

.radar-svg {
  width: 100%;
  max-width: 220px;
  height: auto;
}

.radar-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radar-legend-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.radar-legend-item strong {
  font-size: 14px;
}

.radar-note {
  margin-top: 10px;
}

.feedback-detail {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.feedback-detail:first-child {
  border-top: 0;
  padding-top: 0;
}

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

.history-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.92);
  box-shadow: inset 0 0 0 1px var(--line);
}

.soft-code-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: #1f2346;
  color: #fdf4d4;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
}

.field-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.text-input {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: rgba(248, 251, 255, 0.96);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 16px;
  outline: none;
}

.clock-pill.is-urgent {
  background: #f6fbff;
  color: #07567c;
  box-shadow: inset 0 0 0 2px rgba(77, 189, 255, 0.55), 0 10px 24px rgba(77, 189, 255, 0.18);
  transform: scale(1.06);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(10px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(31, 35, 70, 0.92);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 20;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 720px);
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.bottom-link {
  min-height: 48px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.bottom-link.is-active {
  background: linear-gradient(135deg, #ffe1eb, #dff5ff);
  color: var(--ink);
}

@keyframes hop {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 18px 14px 112px;
  }

  .topbar,
  .score-panel,
  .panel-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .training-header {
    align-items: flex-start;
  }

  .matrix-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .matrix-card {
    border-radius: 14px;
    font-size: 14px;
  }

  .action-row--compact {
    grid-template-columns: 1.5fr 1fr;
  }

  .transcript-topbar,
  .radar-wrap {
    grid-template-columns: 1fr;
    display: grid;
  }

  .radar-wrap {
    justify-items: center;
  }

  .clock-pill--inline {
    justify-self: end;
  }
}
