:root {
  --bg: #f2f5ff;
  --card: #ffffff;
  --text: #1f2a37;
  --muted: #66758a;
  --line: #dde4f3;
  --primary: #1d5de6;
  --primary-weak: #e7eeff;
  --success: #0f9d58;
  --danger: #d93025;
  --warning: #f2a300;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, #eef2ff 0%, var(--bg) 45%, #f9fbff 100%);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
}

.app {
  max-width: 680px;
  margin: 0 auto;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.header {
  background: linear-gradient(120deg, #1d5de6, #4f77ff);
  color: white;
  border-radius: var(--radius);
  padding: 14px;
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.header-content h1 {
  margin: 0;
  font-size: 1.25rem;
}

.header-content p {
  margin: 4px 0 0;
  opacity: 0.9;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 6px 24px rgba(23, 55, 140, 0.08);
}

h2 {
  margin: 0 0 10px;
  font-size: 1.04rem;
  color: #25344a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.row {
  display: grid;
  gap: 8px;
}

.compact {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.row label {
  font-size: 0.95rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn,
button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  background: var(--primary);
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn.secondary {
  background: #0b71e2;
}

.btn.small {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.btn:active,
button:active {
  transform: translateY(1px);
}

.ghost-btn {
  background: var(--primary-weak);
  color: #2b4de8;
}

.btn + .btn,
.ghost-btn + .btn,
.btn + .ghost-btn {
  margin-top: 6px;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  width: 100%;
  background: #fff;
  font-size: 0.95rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}

.stats div {
  background: #f7f9ff;
  border: 1px dashed #d8e0fa;
  border-radius: 12px;
  padding: 10px;
}

.stats .num {
  display: block;
  font-size: 1.5rem;
  color: #1f40bd;
  font-weight: 700;
}

.tip {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.status {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 86px;
  text-align: right;
}

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

.item {
  border: 1px solid #dfe7ff;
  border-radius: 10px;
  padding: 10px;
  background: #fcfdff;
}

.item h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.meta {
  color: var(--muted);
  font-size: 0.82rem;
  display: grid;
  gap: 2px;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}

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

.chip {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  background: #eef3ff;
  color: #2850bd;
}

.danger {
  background: #fde9e7;
  color: #b02820;
}

.done {
  opacity: 0.65;
  background: #f3fbf5;
}

.dialog {
  border: 0;
  border-radius: 12px;
  padding: 0;
}

.dialog-card {
  background: white;
  width: min(92vw, 420px);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 12px;
  display: grid;
  gap: 10px;
}

.dialog-actions {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 768px) {
  .row {
    grid-template-columns: auto 1fr;
  }

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

  .app {
    padding: 18px;
  }
}
