:root {
  --bg: #f4f6fb; --card: #fff; --text: #1b2333; --muted: #7b8496;
  --line: #e8ecf4; --brand: #3f6bff; --brand-dark: #2f54d6;
  --high: #f04452; --mid: #f08c00; --low: #12a150;
  --shadow: 0 12px 32px rgba(24, 39, 75, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  min-height: 100vh; padding: 40px 20px 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(900px 500px at 12% -10%, #e5ecff 0, transparent 60%),
              radial-gradient(800px 480px at 88% 0, #eef3ff 0, transparent 55%), var(--bg);
}
.wrap { max-width: 760px; margin: 0 auto; }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; padding: 0 4px; }
.hero h1 { font-size: 26px; letter-spacing: .5px; }
.subtitle { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.hero-badge { flex-shrink: 0; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--brand-dark); background: #e9efff; border-radius: 999px; }
.hero-badge.warn { color: #8a5300; background: #fff2df; }

.panel { padding: 18px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.input-row { display: flex; gap: 10px; }
#titleInput { flex: 1; min-width: 0; height: 46px; padding: 0 14px; font-size: 15px; color: var(--text); background: #f8faff; border: 1.5px solid var(--line); border-radius: 12px; outline: none; transition: border-color .18s, background .18s; }
#titleInput::placeholder { color: #a9b2c4; }
#titleInput:focus { background: #fff; border-color: var(--brand); }
#prioritySelect { width: 86px; height: 46px; padding: 0 10px; font-size: 14.5px; font-weight: 600; color: var(--text); background: #f8faff; border: 1.5px solid var(--line); border-radius: 12px; outline: none; cursor: pointer; }
#prioritySelect:focus { border-color: var(--brand); }
.btn-primary { height: 46px; padding: 0 22px; font-size: 15px; font-weight: 600; color: #fff; white-space: nowrap; cursor: pointer; background: linear-gradient(135deg, #4f7bff 0, #3f6bff 55%, #2f54d6 100%); border: none; border-radius: 12px; box-shadow: 0 8px 18px rgba(63, 107, 255, .28); transition: transform .12s, box-shadow .2s, opacity .2s; }
.btn-primary:hover { box-shadow: 0 10px 22px rgba(63, 107, 255, .36); }
.btn-primary:active { transform: translateY(1px) scale(.99); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.hint { margin-top: 10px; padding-left: 2px; font-size: 12.5px; color: var(--muted); }
.hint.smart { color: var(--brand-dark); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 16px; }
.stat { display: flex; align-items: baseline; gap: 8px; padding: 14px 18px; background: var(--card); border-radius: 14px; box-shadow: 0 6px 18px rgba(24, 39, 75, .05); }
.stat-num { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 12.5px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { padding: 7px 15px; font-size: 13.5px; font-weight: 500; color: #48536b; cursor: pointer; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; transition: all .16s; }
.chip:hover { border-color: #c8d4f0; }
.chip.active { font-weight: 600; color: #fff; background: var(--brand); border-color: var(--brand); box-shadow: 0 6px 14px rgba(63, 107, 255, .25); }

.list-card { overflow: hidden; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.task-list { list-style: none; }
.task-item { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); animation: fadeIn .22s ease; }
.task-item:last-child { border-bottom: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

.toggle { flex-shrink: 0; width: 24px; height: 24px; font-size: 13px; line-height: 1; color: #fff; cursor: pointer; background: #fff; border: 2px solid #d5dcea; border-radius: 8px; transition: all .16s; }
.toggle:hover { border-color: var(--brand); }
.toggle.done { background: var(--low); border-color: var(--low); }

.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15px; line-height: 1.45; word-break: break-word; transition: color .16s; }
.task-meta { margin-top: 5px; font-size: 11.5px; color: #a2aaba; }
.task-item.completed .task-title { color: #a8b0c0; text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: #b9c2d3; }

.badge { flex-shrink: 0; padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: 8px; }
.badge-高 { color: var(--high); background: #fdecee; }
.badge-中 { color: var(--mid); background: #fff4e0; }
.badge-低 { color: var(--low); background: #e7f7ee; }

.btn-del { flex-shrink: 0; padding: 6px 12px; font-size: 12.5px; color: #8b94a7; cursor: pointer; background: #f7f9fd; border: 1.5px solid var(--line); border-radius: 9px; transition: all .16s; }
.btn-del:hover { color: var(--high); background: #fdecee; border-color: #f7c4c9; }

.empty { padding: 46px 20px; font-size: 14px; color: var(--muted); text-align: center; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 18px; padding: 0 6px; font-size: 12px; color: var(--muted); }
.foot strong { color: #4c5a75; font-weight: 600; }

@media (max-width: 640px) {
  body { padding: 24px 14px 48px; }
  .hero h1 { font-size: 21px; }
  .hero-badge { display: none; }
  .input-row { flex-wrap: wrap; }
  #titleInput { flex: 1 1 100%; }
  #prioritySelect { flex: 1 1 auto; width: auto; }
  .btn-primary { flex: 1 1 120px; }
  .stats { gap: 8px; }
  .stat { padding: 11px 12px; gap: 6px; }
  .stat-num { font-size: 18px; }
  .task-item { padding: 13px 14px; gap: 9px; }
  .badge { padding: 3px 8px; }
  .btn-del { padding: 5px 9px; }
}
