:root {
  --sky: #86c7e8;
  --sky-soft: #e7f6fc;
  --brown: #6b442c;
  --brown-2: #8f684c;
  --brown-soft: #efe2d5;
  --cream: #fffaf3;
  --paper: #ffffff;
  --ink: #2f2924;
  --muted: #7f7167;
  --line: #e8dcd0;
  --green: #3a9b5f;
  --yellow: #f0c34e;
  --warn: #9a6a38;
  --red: #d74b42;
  --shadow: 0 20px 60px rgba(107, 68, 44, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(134, 199, 232, 0.22), rgba(255, 250, 243, 0.8) 240px),
    var(--cream);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 420px);
  align-items: center;
  gap: 28px;
  width: min(1480px, calc(100% - 32px));
  margin: 20px auto 14px;
  padding: 22px 28px;
  border: 1px solid rgba(107, 68, 44, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brown-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  color: var(--brown);
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  color: var(--brown);
  font-size: 22px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.subcopy {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.hero-dogs {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.urgent-strip {
  display: none;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 12px 16px;
  border: 1px solid rgba(215, 75, 66, 0.26);
  border-radius: 8px;
  color: #8e201a;
  background: #fff0ee;
  font-weight: 700;
  line-height: 1.6;
}

.urgent-strip.active {
  display: block;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 4.1fr) minmax(230px, 0.9fr);
  gap: 18px;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto 32px;
}

.left-stack,
.right-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel,
.right-stack {
  border: 1px solid rgba(107, 68, 44, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.right-stack {
  padding: 16px;
}

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

.compact-heading {
  margin-bottom: 12px;
}

.legend,
.date-field {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.normal {
  background: var(--green);
}

.warning {
  background: var(--warn);
}

.caution {
  background: var(--yellow);
}

.vet {
  background: var(--red);
}

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

.status-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 170px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, var(--sky-soft));
}

.score-ring {
  --ring-color: var(--green);
  --ring-value: 90%;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) var(--ring-value), #eaded2 0);
}

.score-ring::before {
  content: "";
  position: absolute;
}

.score-inner {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fff;
  color: var(--brown);
  font-size: 26px;
  font-weight: 900;
}

.status-text {
  min-width: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.status-card h3 {
  margin: 8px 0 6px;
  color: var(--brown);
  font-size: 24px;
}

.status-card p,
.rule-card p,
.profile-card p {
  color: var(--muted);
  line-height: 1.6;
}

.status-card ul,
.rule-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ink);
  line-height: 1.6;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.cloud-actions {
  margin: 14px 0 0;
}

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

.cloud-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--brown);
  background: var(--sky-soft);
  font-size: 12px;
  font-weight: 900;
}

.ghost-button,
.save-button {
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.ghost-button {
  min-height: 40px;
  padding: 9px 12px;
  color: var(--brown);
  background: var(--brown-soft);
}

.save-button {
  width: 100%;
  min-height: 50px;
  margin-top: 16px;
  color: #fff;
  background: var(--brown);
  box-shadow: 0 12px 28px rgba(107, 68, 44, 0.22);
}

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

.quick-card,
.profile-card,
.rule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quick-card,
.profile-card {
  padding: 14px;
}

.quick-card h3 {
  color: var(--brown);
}

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

.right-stack .field-grid {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #dfd0c2;
  border-radius: 8px;
  background: #fffdf9;
  color: var(--ink);
  outline: 0;
}

input,
select {
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  min-height: 66px;
  resize: vertical;
  padding: 9px 10px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(134, 199, 232, 0.25);
}

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

.rule-card {
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #f6fbfe);
}

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

.metric {
  padding: 10px;
  border-radius: 8px;
  background: var(--sky-soft);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--brown);
  font-size: 18px;
}

.trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.trend-tile {
  min-height: 82px;
  padding: 14px;
  border-radius: 8px;
  background: var(--sky-soft);
}

.trend-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.trend-tile strong {
  display: block;
  margin-top: 6px;
  color: var(--brown);
  font-size: 26px;
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 170px;
  padding-top: 12px;
}

.bar-item {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bar {
  width: 100%;
  min-height: 12px;
  border-radius: 8px 8px 3px 3px;
  background: var(--sky);
}

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

.profile-card h3 {
  color: var(--brown);
}

.fine-print {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.source-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.source-note a {
  color: var(--brown);
  font-weight: 900;
  text-decoration: none;
  border-bottom: 1px solid rgba(107, 68, 44, 0.38);
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--brown);
  box-shadow: var(--shadow);
  font-weight: 800;
}

@media (max-width: 1120px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .right-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-header {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .hero-dogs {
    max-height: 180px;
  }

  .section-heading,
  .status-card {
    display: grid;
  }

  .status-grid,
  .quick-grid,
  .rules-grid,
  .field-grid,
  .trend-summary {
    grid-template-columns: 1fr;
  }

  .status-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .score-ring {
    width: 88px;
    height: 88px;
  }

  .score-inner {
    width: 64px;
    height: 64px;
    font-size: 22px;
  }

  .panel,
  .right-stack {
    padding: 14px;
  }

  .trend-bars {
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .app-header,
  .app-layout,
  .urgent-strip {
    width: min(100% - 20px, 1480px);
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 20px;
  }

  .quick-actions {
    display: grid;
  }
}
