:root {
  --bg: #f4efe5;
  --paper: rgba(255, 249, 240, 0.9);
  --paper-strong: #fffaf1;
  --ink: #1f2a1f;
  --muted: #667364;
  --line: rgba(42, 57, 40, 0.1);
  --accent: #f28f3b;
  --accent-deep: #d56b1f;
  --accent-soft: #ffe4cd;
  --green: #6b9c59;
  --green-soft: rgba(107, 156, 89, 0.14);
  --danger: #b8531b;
  --danger-soft: #fff1e7;
  --shadow: 0 24px 64px rgba(76, 56, 31, 0.14);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(242, 143, 59, 0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(107, 156, 89, 0.18), transparent 24%),
    linear-gradient(180deg, #f4ecdf 0%, #f3efe8 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.mobile-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px 16px 40px;
}

.mobile-device {
  width: min(100%, 430px);
  min-height: 92vh;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.92), rgba(255, 248, 238, 0.92));
  border: 1px solid rgba(51, 67, 49, 0.08);
  border-radius: 38px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.device-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.app-screen {
  display: grid;
  gap: 14px;
  padding: 12px 14px 22px;
}

.hero-card,
.section-card,
.metric-card,
.parrot-chip,
.alert-card,
.record-card {
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(83, 60, 31, 0.08);
}

.hero-card,
.section-card {
  background: var(--paper);
  border-radius: var(--radius-xl);
}

.hero-card {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-deep);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  font-size: clamp(1.35rem, 4vw, 1.95rem);
  line-height: 1.14;
}

h1 span {
  display: block;
}

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

.hero-text,
.alert-card p,
.install-tip p,
.record-notes,
.photo-actions span,
.inline-note {
  color: var(--muted);
  line-height: 1.55;
}

.hero-badge-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hero-badge,
.metric-card {
  background: var(--paper-strong);
  border-radius: 22px;
  padding: 14px;
}

.hero-badge strong,
.metric-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.08rem;
}

.hero-badge span,
.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.section-card {
  padding: 16px;
}

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

.ghost-button,
.primary-button {
  border: none;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 700;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
}

.ghost-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
}

.parrot-switcher {
  display: grid;
  gap: 10px;
}

.parrot-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
}

.parrot-chip.is-active {
  background: linear-gradient(135deg, #fff4e7, #fffaf2);
  border-color: rgba(242, 143, 59, 0.24);
}

.chip-avatar,
.photo-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(242, 143, 59, 0.18), rgba(107, 156, 89, 0.2));
  color: var(--ink);
  font-weight: 700;
}

.chip-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  flex-shrink: 0;
}

.chip-avatar img,
.photo-preview img,
.record-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.parrot-chip strong,
.record-top strong {
  display: block;
}

.parrot-chip small {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 92px;
}

.alert-list,
.record-list,
.form-stack {
  display: grid;
  gap: 12px;
}

.trend-chart-wrap {
  display: grid;
  gap: 10px;
}

.trend-chart {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 249, 240, 0.7));
}

.trend-grid-line {
  stroke: rgba(42, 57, 40, 0.08);
  stroke-width: 1;
}

.trend-point {
  fill: #fffaf1;
  stroke: #d56b1f;
  stroke-width: 3;
}

.trend-point-label {
  fill: #667364;
  font-size: 10px;
  font-family: inherit;
}

.trend-axis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.alert-card {
  border-radius: 20px;
  padding: 14px;
  background: var(--paper-strong);
}

.save-feedback strong {
  display: block;
  margin-bottom: 6px;
}

.save-feedback p {
  margin-bottom: 0;
}

.alert-card strong {
  display: block;
  margin-bottom: 6px;
}

.tone-alert {
  background: var(--danger-soft);
  border-color: rgba(184, 83, 27, 0.15);
}

.tone-good {
  background: var(--green-soft);
  border-color: rgba(107, 156, 89, 0.16);
}

.tone-soft {
  background: rgba(255, 255, 255, 0.82);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(49, 64, 47, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.inline-note {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
}

.inline-note strong {
  color: var(--ink);
}

.photo-picker {
  display: flex;
  gap: 12px;
  align-items: center;
}

.photo-preview.large {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  flex-shrink: 0;
}

.photo-preview.record {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  flex-shrink: 0;
  font-size: 1.4rem;
}

.photo-actions {
  display: grid;
  gap: 8px;
}

.record-card {
  background: var(--paper-strong);
  border-radius: 24px;
  padding: 14px;
}

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

.record-top span {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.pill-alert {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill-good {
  background: var(--green-soft);
  color: #426638;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #4b7140;
  font-size: 0.84rem;
  font-weight: 700;
}

.record-image {
  border-radius: 18px;
  max-height: 180px;
  margin-bottom: 10px;
}

.empty-state {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
}

.backup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

@media (max-width: 420px) {
  .mobile-shell {
    padding-inline: 10px;
  }

  .mobile-device {
    width: 100%;
    min-height: 100vh;
    border-radius: 30px;
  }

  .field-grid,
  .hero-badge-stack,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}
