:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #818cf8;
  --danger: #ef4444;
  --line: rgba(148, 163, 184, 0.15);
  --radius: 14px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f1f5f9;
    --panel: #ffffff;
    --panel-2: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --line: rgba(15, 23, 42, 0.08);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(1200px 600px at 20% -10%, rgba(99, 102, 241, 0.18), transparent 60%),
              var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  justify-content: center;
  padding: 40px 16px;
  -webkit-font-smoothing: antialiased;
}

.app {
  width: 100%;
  max-width: 560px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
}

.app__header { margin-bottom: 20px; }

.app__header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.app__subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.add {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.add__input {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.add__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.add__btn {
  padding: 0 18px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
}

.add__btn:hover { opacity: 0.92; }
.add__btn:active { transform: scale(0.97); }

.filters {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.filters__btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.filters__btn:hover { color: var(--text); }

.filters__btn.is-active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.item:hover { border-color: var(--line); }

.item__main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
}

.item__check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.item__text {
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.item.is-done .item__text {
  color: var(--muted);
  text-decoration: line-through;
}

.item__del {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.item:hover .item__del { opacity: 1; }

.item__del:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
}

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 30px 0;
}

.app__footer {
  margin-top: 14px;
  text-align: right;
}

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.link-btn:hover { color: var(--danger); }
