:root {
  --bg: #f7f7fb;
  --bg-deep: #f0f1f8;
  --ink: #232733;
  --ink-soft: #6a7283;
  --accent: #ff6fa1;
  --accent-2: #ff9b86;
  --accent-dark: #e45b8e;
  --olive: #9aa5b5;
  --card: #ffffff;
  --shadow: rgba(36, 39, 49, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Avenir", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 173, 198, 0.25), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(202, 220, 255, 0.22), transparent 45%),
    radial-gradient(circle at 70% 80%, rgba(255, 219, 200, 0.25), transparent 50%),
    linear-gradient(180deg, #fafbff 0%, var(--bg) 65%, var(--bg-deep) 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(188, 195, 210, 0.22) 1px, transparent 0);
  background-size: 24px 24px;
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 120px;
}

.top-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow: 0 14px 30px var(--shadow);
  z-index: 20;
}

.brand {
  display: none;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}

.tab {
  border: 1px solid rgba(200, 210, 230, 0.6);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 1.12rem;
  font-weight: 700;
}

.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 0 24px;
  animation: floatIn 0.8s ease-out both;
}

.hero-text h1 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  margin: 8px 0 6px;
  letter-spacing: 0.5px;
  font-family: "Source Han Serif SC", "Songti SC", "STSong", "Georgia", serif;
}

.hero-text h1 span {
  display: block;
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  color: var(--accent-dark);
  margin-top: 6px;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 2px;
  color: var(--accent-dark);
  margin: 0;
}

.sub {
  max-width: 520px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.notice {
  max-width: 520px;
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.hero-tag {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(210, 220, 235, 0.7);
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: 0 12px 30px var(--shadow);
  min-width: 180px;
}

.hero-tag strong {
  display: block;
  font-size: 1.1rem;
}

.pulse {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 111, 161, 0.35);
  animation: pulse 1.6s infinite;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.home-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.page-section.hidden {
  display: none;
}

.panel {
  background: var(--card);
  border: 1px solid rgba(216, 224, 238, 0.8);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 12px 30px var(--shadow);
  position: relative;
  overflow: hidden;
  animation: rise 0.6s ease both;
}

.panel::after {
  content: "";
  position: absolute;
  inset: auto -60px -60px auto;
  width: 160px;
  height: 160px;
  background: rgba(240, 214, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
}

.panel h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

.field {
  margin-bottom: 18px;
}

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

.link {
  border: none;
  background: none;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

input[type="file"],
input[type="password"],
input[type="text"],
textarea {
  width: 100%;
  border: 1px solid rgba(210, 220, 235, 0.8);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  font-family: inherit;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 6px;
}

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

.chips button {
  border: 1px solid #d7c2ad;
  background: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chips button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.checks label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.primary {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 18px 0 12px;
}

.ghost {
  border: 1px solid rgba(210, 220, 235, 0.8);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink);
}

.ghost.wide {
  width: 100%;
}

.ghost.compact {
  width: 60%;
  margin: 0 auto 12px;
  display: block;
}

.input-panel .status {
  margin-top: 6px;
}

.input-panel.subtle {
  opacity: 0.9;
}

.input-panel.subtle .primary {
  margin-top: 8px;
}

.hero-compact {
  padding-bottom: 12px;
}

.today-card {
  padding: 26px 26px 22px;
}

.today-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.sparkle {
  font-size: 1.4rem;
  color: var(--accent);
}

.today-title h2 {
  margin: 0;
  font-size: 1.4rem;
}

.today-highlight {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #f3edff;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 18px;
}

.today-emoji {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #efe5ff;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
}

.today-text {
  display: grid;
  gap: 6px;
}

.today-main {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.today-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.today-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  text-align: center;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.metric-label {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.switch-panel {
  padding: 14px;
}

.switch-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: #fff;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(210, 220, 235, 0.8);
}

.history-switch {
  margin: 10px 0 16px;
}

.switch-tab {
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.switch-tab.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  font-weight: 600;
}

.moments-panel {
  padding: 18px;
}

.moment-list {
  display: grid;
  gap: 12px;
}

.moment-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(210, 220, 235, 0.8);
  box-shadow: 0 10px 20px rgba(36, 39, 49, 0.06);
}

.moment-content {
  display: grid;
}

.moment-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f1f3ff;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.moment-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.moment-title {
  font-weight: 700;
  font-size: 1rem;
}

.moment-time {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.moment-summary {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.moment-bar {
  height: 6px;
  background: #f0f1f6;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.moment-bar span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #c07bff, #8aa7ff);
}

.moment-percent {
  text-align: right;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.action-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  padding: 18px;
}

.action-btn {
  border-radius: 18px;
  padding: 16px 18px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 12px 20px rgba(36, 39, 49, 0.08);
}

.primary-action {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
}

.ghost-action {
  background: #fff;
  color: var(--ink);
  border: 2px solid rgba(210, 220, 235, 0.9);
}

.action-icon {
  font-size: 1.2rem;
}

.soft-status {
  background: rgba(140, 160, 255, 0.12);
  border: 1px solid rgba(210, 220, 235, 0.7);
  margin-bottom: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 33, 0.35);
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(92vw, 360px);
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(36, 39, 49, 0.18);
  text-align: center;
}

.modal-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.modal-body {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.back-bottom {
  width: 260px;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 600;
  justify-self: center;
  box-shadow: 0 10px 20px rgba(36, 39, 49, 0.08);
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.record-hub,
.mic-orbit,
.orbit-ring,
.ring-outer,
.ring-mid {
  display: none;
}

.result-title {
  text-align: center;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--ink-soft);
}

.result-card {
  margin: 12px auto 16px;
  padding: 20px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(210, 220, 235, 0.7);
  text-align: center;
}

.result-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.result-emoji {
  font-size: 3.2rem;
  margin: 8px 0;
}

.result-name {
  font-size: 1.4rem;
  font-weight: 700;
}

.result-summary {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.result-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.chart-card {
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(210, 220, 235, 0.7);
  text-align: center;
}

.chart-title {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.chart-card canvas {
  width: 100%;
  display: block;
}

.chart-meta {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: left;
}

.pie-legend {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.mic-icon {
  font-size: 1.4rem;
}

.mic-label {
  font-size: 1rem;
  font-weight: 700;
}

.mic-sub {
  font-size: 0.75rem;
  color: rgba(35, 39, 51, 0.5);
}

.toggle-pill {
  width: 200px;
  border-radius: 999px;
}

.live-panel {
  display: grid;
  gap: 14px;
}

.live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.live-title {
  font-weight: 700;
}

.live-wave {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  background: #fff;
  border: 1px dashed rgba(210, 220, 235, 0.8);
  border-radius: 16px;
  padding: 16px;
}

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

.stop-btn {
  min-width: 120px;
  border-radius: 999px;
  font-weight: 600;
}

.wave-line {
  width: 12px;
  background: linear-gradient(180deg, rgba(255, 111, 161, 0.9), rgba(130, 160, 255, 0.45));
  border-radius: 999px;
  animation: wave 1.4s ease-in-out infinite;
  transition: height 0.1s ease;
}

.wave-line.wave-live {
  animation: none;
}

.wave-line:nth-child(2) {
  animation-delay: 0.2s;
}
.wave-line:nth-child(3) {
  animation-delay: 0.4s;
}
.wave-line:nth-child(4) {
  animation-delay: 0.6s;
}
.wave-line:nth-child(5) {
  animation-delay: 0.8s;
}

.ghost.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 111, 161, 0.3);
}

.status {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 111, 161, 0.12);
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 111, 161, 0.3);
}

.result-block {
  border-top: 1px dashed rgba(210, 220, 235, 0.8);
  padding-top: 14px;
  margin-top: 14px;
}

.result-block:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.placeholder {
  color: var(--ink-soft);
  font-size: 0.95rem;
}


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

.tag {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d7c2ad;
  font-size: 0.9rem;
}

.image-wrap {
  width: 100%;
  min-height: 180px;
  border-radius: 16px;
  background: #fff7ec;
  border: 1px dashed #e4d2c0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-panel {
  grid-column: span 2;
}

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

.time-chip {
  font-size: 0.85rem;
  background: #f3e4d3;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
}

.card {
  background: linear-gradient(135deg, rgba(247, 242, 255, 0.9) 0%, rgba(255, 245, 240, 0.95) 100%);
  border-radius: 20px;
  padding: 18px;
  min-height: 120px;
  box-shadow: inset 0 0 0 1px rgba(210, 220, 235, 0.8);
}

.card-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.card-body {
  margin: 0;
  line-height: 1.6;
}

.divider {
  height: 1px;
  background: rgba(196, 94, 45, 0.2);
  margin: 14px 0;
}

.advice-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0;
  color: var(--ink-soft);
}

.history-panel {
  grid-column: span 2;
}

.full-row {
  grid-column: 1 / -1;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.history-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ec;
  border: 1px solid #e4d2c0;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.history-item span {
  color: var(--ink-soft);
}

.history-panel.full {
  grid-column: span 3;
}

.history-group {
  display: grid;
  gap: 18px;
}

.detail-card {
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(210, 220, 235, 0.7);
}

.detail-item {
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e4d2c0;
  margin-bottom: 10px;
}

.detail-item:last-child {
  margin-bottom: 0;
}

.detail-meta {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.detail-summary {
  margin-top: 8px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.trend-card {
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(210, 220, 235, 0.7);
  margin-bottom: 18px;
}

.trend-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.trend-head h3 {
  margin: 0;
  font-size: 1rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chart-wrap {
  position: relative;
  overflow-x: auto;
  padding-bottom: 6px;
}

#trendCanvas {
  width: 900px;
  display: block;
  background: #fff;
  border-radius: 12px;
  border: 1px dashed rgba(210, 220, 235, 0.8);
}

.tooltip {
  position: absolute;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e4d2c0;
  box-shadow: 0 8px 18px var(--shadow);
  font-size: 0.85rem;
  color: var(--ink);
  display: none;
  pointer-events: none;
  white-space: nowrap;
}

.history-date {
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 6px;
}

.profile-panel {
  grid-column: span 2;
}

.profile-card {
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(210, 220, 235, 0.7);
  margin-bottom: 18px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 111, 161, 0.35);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 111, 161, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 111, 161, 0);
  }
}

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

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wave {
  0%,
  100% {
    height: 30%;
  }
  50% {
    height: 100%;
  }
}


@media (max-width: 920px) {
  .hero {
    flex-direction: column;
  }

  .card-panel {
    grid-column: span 1;
  }

  .history-panel {
    grid-column: span 1;
  }

  .history-panel.full,
  .profile-panel {
    grid-column: span 1;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  #trendCanvas {
    width: 720px;
  }

  .mic-orbit {
    width: 200px;
    height: 200px;
  }

  .ring-outer {
    width: 200px;
    height: 200px;
  }

  .ring-mid {
    width: 165px;
    height: 165px;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 20px 16px 120px;
  }

  .hero {
    align-items: flex-start;
    gap: 14px;
  }

  .hero-text h1 {
    font-size: 1.9rem;
  }

  .hero-tag {
    width: 100%;
    justify-content: flex-start;
  }

  .panel {
    padding: 18px;
    border-radius: 18px;
  }

  .today-highlight {
    padding: 14px;
    gap: 12px;
  }

  .today-emoji {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .today-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .metric-value {
    font-size: 1.3rem;
  }

  .switch-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .moment-card {
    grid-template-columns: 1fr;
  }

  .moment-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .action-panel {
    grid-template-columns: 1fr;
  }

  .result-charts {
    grid-template-columns: 1fr;
  }

  .back-bottom {
    width: 100%;
  }

  #trendCanvas {
    width: 640px;
  }

  .top-nav {
    bottom: 12px;
    padding: 10px 14px;
  }

  .tab {
    padding: 8px 12px;
    font-size: 1.02rem;
    font-weight: 700;
  }
}
