:root {
  --bg-top: #6b74e6;
  --bg-bottom: #7357c8;
  --surface: rgba(255, 255, 255, 0.18);
  --surface-strong: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.12);
  --text-main: #1f2557;
  --text-soft: #6b7298;
  --primary: #5b69f3;
  --primary-deep: #3d48c9;
  --accent: #ff6171;
  --accent-deep: #ec455d;
  --border-soft: rgba(255, 255, 255, 0.28);
  --shadow-lg: 0 26px 60px rgba(31, 37, 87, 0.18);
  --shadow-md: 0 18px 35px rgba(31, 37, 87, 0.12);
  --shadow-sm: 0 10px 22px rgba(31, 37, 87, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.14), transparent 30%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

button,
textarea,
audio {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 36px 16px 56px;
  overflow: hidden;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.45;
  pointer-events: none;
}

.ambient-left {
  top: 90px;
  left: -90px;
  width: 220px;
  height: 220px;
  background: rgba(255, 207, 119, 0.22);
}

.ambient-right {
  right: -80px;
  bottom: 120px;
  width: 260px;
  height: 260px;
  background: rgba(112, 245, 221, 0.18);
}

.app-card {
  position: relative;
  z-index: 1;
  width: min(100%, 860px);
  margin: 0 auto;
}

.hero {
  text-align: center;
  margin-bottom: 22px;
}

.hero-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-md);
  font-size: 32px;
  backdrop-filter: blur(12px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hero p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 12px;
  margin-bottom: 18px;
  border-radius: 26px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
}

.mode-tab {
  border: 0;
  min-height: 58px;
  border-radius: 18px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.mode-tab.active {
  background: #fff;
  color: var(--primary);
  transform: translateY(-1px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-item,
.panel {
  border-radius: 28px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
}

.stat-item {
  min-height: 120px;
  padding: 24px 12px;
  display: grid;
  place-items: center;
  color: var(--text-main);
}

.stat-item strong {
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1;
  color: var(--primary);
}

.stat-item span {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-soft);
}

.panel {
  display: none;
  color: var(--text-main);
  padding: 24px;
}

.panel.active {
  display: block;
  animation: fade-in 220ms ease;
}

.panel + .panel {
  margin-top: 0;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 28px;
}

.panel-tip {
  color: var(--text-soft);
  font-size: 14px;
  text-align: right;
}

.environment-warning {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #fff4e8;
  border: 1px solid #ffd5a4;
  color: #9a5410;
  line-height: 1.7;
}

.environment-warning strong {
  display: block;
  margin-bottom: 6px;
}

.reading-input {
  width: 100%;
  min-height: 128px;
  margin-top: 18px;
  border: 2px solid #e6e9ff;
  border-radius: 20px;
  padding: 18px 20px;
  resize: vertical;
  color: var(--text-main);
  background: #fbfbff;
  outline: none;
}

.reading-input:focus {
  border-color: rgba(91, 105, 243, 0.45);
  box-shadow: 0 0 0 4px rgba(91, 105, 243, 0.12);
}

.recorder-card {
  margin-top: 18px;
  padding: 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 97, 113, 0.1), transparent 35%),
    #fff;
  border: 1px solid #f0f2ff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.status-pill.idle {
  background: #eef2ff;
  color: var(--primary);
}

.status-pill.recording {
  background: #ffe7ea;
  color: var(--accent-deep);
}

.status-pill.ready {
  background: #eefbea;
  color: #26754b;
}

.record-button {
  width: 168px;
  height: 168px;
  margin: 28px auto 18px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
  box-shadow: 0 24px 42px rgba(255, 97, 113, 0.28);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.record-button:hover {
  transform: translateY(-2px) scale(1.01);
}

.record-button.recording {
  animation: pulse 1.5s infinite;
}

.record-icon {
  font-size: 56px;
}

.recorder-meta {
  text-align: center;
}

.recorder-meta p {
  margin: 0;
  color: var(--text-soft);
}

.recorder-meta strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.audio-preview {
  width: 100%;
  margin-top: 20px;
}

.action-row {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.ghost-button,
.primary-button {
  min-height: 48px;
  border-radius: 14px;
  padding: 0 18px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.ghost-button {
  background: #f4f6ff;
  color: var(--primary);
}

.primary-button {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 24px rgba(91, 105, 243, 0.22);
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #bbc2f8;
  box-shadow: none;
}

.notice-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  background: #fff8e9;
  border: 1px solid #ffe0a7;
}

.notice-card strong {
  display: block;
  color: #ba6d13;
}

.notice-card p {
  margin: 8px 0 0;
  color: #ac6616;
  line-height: 1.6;
}

.list-wrap {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.empty-state {
  min-height: 180px;
  place-items: center;
  text-align: center;
  color: var(--text-soft);
  border: 2px dashed #e6e9ff;
  border-radius: 22px;
  padding: 20px;
}

.record-item {
  padding: 18px 20px;
  border-radius: 20px;
  background: #f8f9ff;
  border: 1px solid #edf0ff;
}

.record-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.record-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.record-date {
  color: var(--text-soft);
  font-size: 13px;
}

.record-body {
  margin: 10px 0 14px;
  color: var(--text-soft);
  line-height: 1.7;
}

.record-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eaeefe;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.record-player {
  width: 100%;
  margin-top: 12px;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 24px 42px rgba(255, 97, 113, 0.28);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 30px 54px rgba(255, 97, 113, 0.32);
  }
}

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

@media (max-width: 760px) {
  .page-shell {
    padding: 22px 12px 40px;
  }

  .mode-switch,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .recorder-card {
    padding: 18px;
  }

  .panel-header,
  .record-top,
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-tip {
    text-align: left;
  }

  .record-button {
    width: 150px;
    height: 150px;
  }
}
