:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-strong: #eef4f1;
  --ink: #27231d;
  --muted: #746b5e;
  --line: #d7ddda;
  --accent: #277c6a;
  --accent-strong: #146252;
  --danger: #ae3d36;
  --shadow: 0 14px 34px rgba(32, 47, 42, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 2px 16px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.55rem, 2.1rem, 2.35rem);
  line-height: 1.15;
}

.icon-button,
.delete-button,
.check-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.35rem;
}

.composer,
.list-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.composer {
  padding: 14px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label > span {
  color: var(--muted);
  font-size: 0.82rem;
}

textarea,
input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 124, 106, 0.14);
}

textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.5;
}

input,
select {
  height: 42px;
  padding: 0 10px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.primary-button {
  min-width: 86px;
  height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0 10px;
}

.tab {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 650;
}

.tab.is-active {
  border-color: var(--accent);
  background: #e8f2ee;
  color: var(--accent-strong);
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.summary-band div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 10px;
}

.summary-band strong {
  display: block;
  font-size: 1.2rem;
}

.summary-band span {
  color: var(--muted);
  font-size: 0.78rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.list-panel {
  min-height: 180px;
  padding: 12px;
}

.list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.list-title h2 {
  font-size: 1.05rem;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 0.88rem;
}

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

.task-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.task-card.is-done {
  opacity: 0.62;
}

.task-card.is-done .task-text {
  text-decoration: line-through;
}

.check-button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-top: 1px;
}

.check-button::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(-45deg);
}

.task-card.is-done .check-button {
  background: var(--accent);
  border-color: var(--accent);
}

.task-card.is-done .check-button::after {
  border-color: #fff;
}

.task-main {
  min-width: 0;
}

.task-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pill {
  border-radius: 999px;
  background: #eef0ee;
  color: var(--muted);
  padding: 3px 8px;
  font-size: 0.75rem;
}

.pill.category-ERP {
  background: #e7edf7;
  color: #315e8c;
}

.pill.category-futures {
  background: #f7e7e2;
  color: #8d4634;
}

.pill.category-learning {
  background: #e8efe2;
  color: #4e7135;
}

.pill.category-life {
  background: #efe8f3;
  color: #6a5174;
}

.task-actions {
  display: flex;
  gap: 6px;
}

.status-picker {
  width: 94px;
  height: 34px;
  font-size: 0.82rem;
}

.delete-button {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  color: var(--danger);
  font-size: 1.2rem;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 26px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px 10px 22px;
  }

  .control-grid,
  .project-row,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .primary-button {
    width: 100%;
  }

  .view-tabs {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }

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

  .task-card {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .task-actions {
    grid-column: 2;
    width: 100%;
    justify-content: space-between;
  }

  .status-picker {
    width: min(170px, 100%);
  }
}
