:root {
  color-scheme: light;
  --bg-start: #f6efe6;
  --bg-end: #dce8f2;
  --card-bg: rgba(255, 255, 255, 0.8);
  --card-border: rgba(110, 92, 72, 0.14);
  --text-main: #2e241d;
  --text-muted: #776456;
  --accent: #c96f3b;
  --accent-deep: #a24c23;
  --accent-soft: #f3d5c4;
  --done: #9b9b9b;
  --shadow: 0 18px 60px rgba(78, 51, 30, 0.12);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 28%),
    linear-gradient(135deg, var(--bg-start), var(--bg-end));
  color: var(--text-main);
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card {
  width: min(100%, 720px);
  padding: 32px;
  border: 1px solid var(--card-border);
  border-radius: 28px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 52px);
  line-height: 1;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--text-muted);
}

.todo-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-bottom: 18px;
}

.todo-form input {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid rgba(110, 92, 72, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.todo-form input:focus {
  border-color: rgba(201, 111, 59, 0.7);
  box-shadow: 0 0 0 4px rgba(201, 111, 59, 0.14);
}

.todo-form button,
.clear-btn,
.filter,
.delete-btn {
  border: none;
  cursor: pointer;
}

.todo-form button,
.clear-btn {
  padding: 0 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.todo-form button:hover,
.clear-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.todo-form button:disabled,
.clear-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-muted);
}

.filter.is-active {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(110, 92, 72, 0.1);
}

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

.todo-check {
  position: relative;
  display: inline-grid;
  place-items: center;
}

.toggle {
  position: absolute;
  opacity: 0;
}

.custom-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(201, 111, 59, 0.65);
  transition: background 0.2s ease, transform 0.2s ease;
}

.toggle:checked + .custom-check {
  background: var(--accent);
  transform: scale(0.95);
}

.todo-text {
  word-break: break-word;
}

.delete-btn {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(201, 111, 59, 0.12);
  color: var(--accent-deep);
}

.status-bar {
  margin-top: 20px;
  color: var(--text-muted);
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed rgba(110, 92, 72, 0.2);
  border-radius: 18px;
}

@media (max-width: 640px) {
  .card {
    padding: 22px;
    border-radius: 22px;
  }

  .todo-form {
    grid-template-columns: 1fr;
  }

  .todo-form button,
  .clear-btn {
    min-height: 48px;
  }

  .toolbar {
    align-items: stretch;
  }
}

/* Refined workspace palette and spacing */
:root { --bg-start:#f7f8fc; --bg-end:#eef1f8; --card-bg:#ffffff; --card-border:#e7e9f0; --text-main:#20242d; --text-muted:#89909d; --accent:#5267e8; --accent-deep:#3d50c4; --accent-soft:#eef0ff; --shadow:0 20px 60px rgba(40,48,80,.10); }
body { background:linear-gradient(145deg,#f8f9fd,#eef1f8); }
.card { border-radius:18px; padding:40px; backdrop-filter:none; }
.hero h1 { letter-spacing:-.03em; }
.todo-form input { border-radius:10px; }
.todo-form button,.clear-btn { border-radius:10px; background:var(--text-main); }
.filter { border-radius:8px; }
.todo-item { border-radius:10px; border:1px solid var(--card-border); padding:15px 16px; background:#fff; }
.todo-list { gap:10px; }
.delete-btn { color:#a1a7b2; background:transparent; }
.delete-btn:hover { color:#d65c68; }
@media (max-width:640px) { .card{padding:24px 18px;border-radius:14px} }
