:root {
  color-scheme: light;
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --text: #18212b;
  --muted: #617182;
  --line: #dbe5ef;
  --green: #24a65b;
  --green-deep: #157743;
  --blue: #2d7ce3;
  --amber: #f1a23f;
  --red: #ea4d3d;
  --shadow: 0 12px 36px rgba(27, 42, 58, 0.08);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px 94px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}

.app-bar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 800;
}

.app-bar h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 900;
}

.bell-btn {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #1b2430;
  background: #f0f5fa;
  box-shadow: inset 0 0 0 1px #e0e8f1;
}

.bell-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.ui-icon,
.nav-icon,
.btn-icon,
.feature-icon,
.voice-icon,
.alert-icon,
.list-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.screen {
  display: none;
  margin-bottom: 14px;
}

.screen.active {
  display: grid;
  gap: 12px;
}

.hero-card,
.feature-card,
.mini-panel,
.section-card,
.voice-card,
.dialogue-panel,
.alert-card,
.relative-card,
.trend-card,
.scan-hero,
.result-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.hero-card img,
.scan-hero img {
  display: block;
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.hero-card img {
  aspect-ratio: 16 / 10;
}

.hero-copy h2 {
  margin: 10px 0 8px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 900;
}

.hero-copy p,
.section-copy,
.alert-copy,
.voice-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.status-pill,
.mini-tag,
.small-tag,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaf7ef;
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.green {
  background: #e8f8ef;
}

.badge {
  background: #eaf7ef;
}

.badge.danger,
.small-tag {
  background: #fce9e6;
  color: var(--red);
}

.badge.amber,
.mini-tag.amber {
  background: #fff1dd;
  color: #bd6f00;
}

.small-tag.green {
  background: #eaf7ef;
  color: var(--green-deep);
}

.hero-actions,
.action-row,
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.action-btn,
.quick-btn,
.scan-btn,
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
}

.primary-btn,
.scan-btn,
.voice-btn {
  color: #fff;
  background: linear-gradient(135deg, #25a95d, #1f8f50);
}

.ghost-btn,
.action-btn.ghost,
.quick-btn {
  background: #eef6fb;
  color: var(--green-deep);
  box-shadow: inset 0 0 0 1px #d7e4ef;
}

.action-btn,
.pill-btn {
  background: #e9f7ef;
  color: var(--green-deep);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.feature-row {
  display: grid;
  gap: 10px;
}

.feature-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px;
  text-align: left;
  background: #fff;
}

.feature-card.active {
  border-color: #cdebd8;
  background: #f3fbf6;
}

.feature-icon {
  width: 42px;
  height: 42px;
  padding: 9px;
  border-radius: 14px;
}

.feature-icon.green {
  background: #e8f8ef;
  color: var(--green);
}

.feature-icon.blue {
  background: #e9f2ff;
  color: var(--blue);
}

.feature-icon.amber {
  background: #fff4df;
  color: var(--amber);
}

.feature-card strong,
.section-head h2,
.voice-copy h3,
.relative-head h3,
.alert-head h3,
.result-head h3 {
  display: block;
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 900;
}

.feature-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.home-grid {
  display: grid;
  gap: 10px;
}

.mini-panel {
  padding: 14px;
}

.mini-head,
.section-head,
.relative-head,
.result-head,
.alert-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.mini-head span:first-child,
.section-head p,
.voice-copy .status-pill,
.relative-head p,
.result-head p,
.alert-head p {
  margin: 0;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 800;
}

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

.mini-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.list-icon {
  width: 18px;
  height: 18px;
  color: var(--green);
}

.quick-btn {
  flex: 1 1 0;
  min-width: 0;
}

.section-card {
  padding: 14px;
}

.accent-green {
  background: linear-gradient(180deg, #ffffff, #f2fbf6);
}

.accent-blue {
  background: linear-gradient(180deg, #ffffff, #f2f7ff);
}

.accent-amber {
  background: linear-gradient(180deg, #ffffff, #fff8ef);
}

.voice-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #f7fbf8, #ffffff);
}

.voice-copy h3 {
  margin-top: 10px;
  font-size: 21px;
}

.voice-btn {
  display: grid;
  place-items: center;
  gap: 6px;
  width: 100%;
  min-height: 132px;
  border-radius: 22px;
  box-shadow: 0 16px 28px rgba(36, 166, 91, 0.22);
}

.voice-icon {
  width: 28px;
  height: 28px;
  color: #fff;
}

.voice-btn strong {
  font-size: 18px;
}

.dialogue-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface-soft);
}

.bubble {
  width: fit-content;
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
}

.bubble.system {
  background: #eaf3ff;
  color: #27435a;
}

.bubble.user {
  justify-self: end;
  background: #24a65b;
  color: #fff;
}

.alert-card,
.relative-card,
.result-card {
  padding: 14px;
}

.input-card,
.scanner-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-card label,
.reminder-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.input-card textarea,
.reminder-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  background: #f9fcff;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.input-card textarea:focus,
.reminder-form input:focus {
  border-color: #8bd3aa;
  box-shadow: 0 0 0 3px rgba(36, 166, 91, 0.12);
}

.action-row.compact {
  flex-wrap: nowrap;
}

.action-row.compact .action-btn {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 10px;
}

.alert-card.active {
  border-color: #ffd0a0;
  background: #fff8ee;
}

.alert-card.hidden,
.result-card.hidden {
  display: none;
}

.alert-head {
  align-items: center;
}

.alert-icon {
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: 12px;
}

.alert-icon.red {
  background: #ffeceb;
  color: var(--red);
}

.alert-icon.amber {
  background: #fff2df;
  color: var(--amber);
}

.alert-copy {
  margin-top: 10px;
}

.alert-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.alert-item {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(235, 218, 199, 0.8);
}

.alert-item strong {
  font-size: 14px;
  line-height: 1.35;
}

.alert-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.reminder-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.relative-card {
  display: grid;
  gap: 12px;
}

.relative-head h3 {
  font-size: 19px;
}

.relative-head button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.trend-card {
  padding: 14px;
}

.bars {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 116px;
  margin-top: 14px;
  padding: 0 4px;
  border-bottom: 2px solid #dbe7f1;
}

.bars span {
  flex: 1;
  border-radius: 9px 9px 0 0;
  background: linear-gradient(180deg, #5aa9ff, #2a74d9);
}

.scan-hero {
  overflow: hidden;
}

.scan-hero img {
  aspect-ratio: 1.1 / 0.8;
}

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

.scan-step {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #4e5e6d;
  font-size: 14px;
  font-weight: 800;
}

.scan-step span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #cad5e2;
  color: #fff;
  font-size: 12px;
}

.scan-step.active {
  border-color: #bfe7c9;
  background: #f2fbf5;
  color: var(--green-deep);
}

.scan-step.active span {
  background: var(--green);
}

.scan-btn {
  width: 100%;
  min-height: 54px;
  box-shadow: 0 16px 28px rgba(36, 166, 91, 0.22);
}

.scan-btn.secondary {
  color: var(--green-deep);
  background: #edf8f2;
  box-shadow: inset 0 0 0 1px #cfead9;
}

.scanner-actions {
  display: grid;
  gap: 10px;
}

.preview-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 190px;
  overflow: hidden;
  border: 1px dashed #b9c9d8;
  border-radius: 14px;
  background: #f7fafc;
}

.preview-wrap img {
  display: none;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #fff;
}

.preview-wrap.has-image img {
  display: block;
}

.preview-wrap.has-image .preview-empty {
  display: none;
}

.preview-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

.scan-status {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f0f7ff;
  color: #2d5b7f;
  font-size: 13px;
  line-height: 1.55;
}

.scan-status.is-busy {
  background: #fff7e8;
  color: #915900;
}

.scan-status.is-done {
  background: #edf9f1;
  color: #1d653d;
}

.scan-status.is-error {
  background: #fff0ee;
  color: #b32b1f;
}

.result-head {
  align-items: center;
}

.result-grid {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.result-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.result-grid dt,
.result-grid dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.result-grid dt {
  color: var(--muted);
  font-weight: 800;
}

.result-grid dd {
  text-align: right;
  font-weight: 800;
}

.summary-box,
.warning-box {
  padding: 12px;
  border-radius: 14px;
}

.summary-box {
  background: #eefaf2;
  color: #1d653d;
}

.warning-box {
  margin-top: 10px;
  background: #fff4e1;
  color: #8a4700;
}

.summary-box h4,
.warning-box strong {
  margin: 0;
  font-size: 14px;
}

.summary-box p,
.warning-box p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

.ocr-box {
  margin-top: 10px;
  border-radius: 14px;
  background: #f5f8fb;
  color: #324150;
}

.ocr-box summary {
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 800;
}

.ocr-box pre {
  max-height: 220px;
  margin: 0;
  padding: 0 12px 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #435466;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 430px);
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 -6px 20px rgba(20, 32, 44, 0.05);
}

.nav-btn {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 10px 6px 12px;
  color: #657485;
  font-size: 12px;
  font-weight: 800;
}

.nav-btn.active {
  color: var(--green-deep);
}

.nav-icon {
  width: 20px;
  height: 20px;
}

@media (min-width: 760px) {
  body {
    display: flex;
    justify-content: center;
  }

  .app {
    box-shadow: 0 0 0 1px rgba(220, 229, 239, 0.9), 0 20px 60px rgba(24, 33, 43, 0.1);
  }
}
