:root {
  --bg: #f6f7f2;
  --panel: #ffffff;
  --ink: #1c2430;
  --muted: #657184;
  --line: #dce2e8;
  --blue: #2563eb;
  --green: #0f8b6f;
  --orange: #d97706;
  --red: #c2410c;
  --soft-blue: #eaf1ff;
  --soft-green: #e8f7f1;
  --soft-orange: #fff3df;
  --shadow: 0 10px 30px rgba(30, 42, 60, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.screen {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: center;
  padding: 28px;
}

.intro-band {
  min-height: 520px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(15, 139, 111, 0.86)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='620' viewBox='0 0 900 620'%3E%3Crect width='900' height='620' fill='%23f2f7fb'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.48' stroke-width='3'%3E%3Cpath d='M130 128h286v174H130zM486 128h230v310H486zM178 374h242v92H178z'/%3E%3Cpath d='M174 180h188M174 230h128M534 190h136M534 246h102M534 302h142M224 420h144'/%3E%3C/g%3E%3Cg fill='%23ffffff' fill-opacity='.58'%3E%3Ccircle cx='734' cy='96' r='26'/%3E%3Ccircle cx='104' cy='492' r='18'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: white;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.intro-band h1 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  margin: 0;
}

.intro-band p {
  max-width: 620px;
  font-size: 18px;
  line-height: 1.7;
  margin: 18px 0 0;
}

.metrics-row,
.stat-grid,
.cards-grid,
.toolbar,
.task-line,
.reward-line,
.child-pick,
.row {
  display: grid;
  gap: 12px;
}

.metrics-row {
  grid-template-columns: repeat(3, 1fr);
}

.metric {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.metric strong {
  display: block;
  font-size: 28px;
}

.auth-panel,
.panel,
.item-card,
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 22px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px;
  background: #eef2f6;
  border-radius: 8px;
}

.tabs button,
.nav button {
  min-height: 42px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tabs button.active,
.nav button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(30, 42, 60, 0.08);
}

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

.field {
  display: grid;
  gap: 6px;
}

.field span,
.small-label {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.primary,
.secondary,
.danger,
.ghost {
  min-height: 42px;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 700;
}

.primary {
  background: var(--blue);
  color: white;
}

.secondary {
  background: var(--green);
  color: white;
}

.danger {
  background: var(--red);
  color: white;
}

.ghost {
  background: #eef2f6;
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(246, 247, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.brand-title {
  margin: 0;
  font-size: 20px;
}

.subtle {
  color: var(--muted);
  font-size: 13px;
}

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

.nav button {
  padding: 0 12px;
  background: #eef2f6;
}

.hero-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  padding: 16px;
}

.panel h2,
.panel h3,
.item-card h3 {
  margin: 0 0 12px;
}

.stat-grid {
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  min-height: 84px;
  border-radius: 8px;
  padding: 14px;
  background: #f7f9fb;
  border: 1px solid var(--line);
}

.stat strong {
  display: block;
  font-size: 28px;
}

.cards-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.item-card {
  padding: 14px;
}

.item-card.done {
  border-color: rgba(15, 139, 111, 0.32);
  background: var(--soft-green);
}

.task-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: #eef2f6;
  white-space: nowrap;
}

.pill.ok {
  color: #075e4d;
  background: var(--soft-green);
}

.pill.warn {
  color: #914600;
  background: var(--soft-orange);
}

.pill.blue {
  color: #174ea6;
  background: var(--soft-blue);
}

.task-actions,
.toolbar {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-line {
  grid-template-columns: 1fr 110px 90px 120px auto;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.reward-line {
  grid-template-columns: 1fr 110px 120px auto;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.child-pick {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.child-button {
  min-height: 88px;
  text-align: left;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.child-button.active {
  border-color: var(--blue);
  background: var(--soft-blue);
}

.empty {
  border: 1px dashed #b8c2cf;
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfd;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(20, 28, 38, 0.36);
  padding: 18px;
}

.modal {
  width: min(420px, 100%);
  padding: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 30;
  transform: translateX(-50%);
  background: #1c2430;
  color: white;
  padding: 10px 14px;
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .login-layout,
  .hero-row,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .intro-band {
    min-height: 360px;
    padding: 28px;
  }

  .metrics-row,
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar-inner {
    grid-template-columns: 1fr;
  }

  .task-line,
  .reward-line,
  .toolbar,
  .row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .screen,
  .login-layout {
    padding: 12px;
  }

  .metrics-row,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
