.dashboard-main {
  padding: 42px 0 80px;
}

.todo-page-title {
  display: grid;
  justify-items: center;
  text-align: center;
}

.page-eyebrow,
.section-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-eyebrow {
  color: #64748b;
}

.todo-page-title h1 {
  max-width: 760px;
  margin-top: 7px;
  text-wrap: balance;
}

.todo-page-title p {
  max-width: 620px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.todo-form,
.todo-workspace {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 34px rgba(40, 55, 82, 0.07);
}

.todo-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, 0.34fr) minmax(0, 1fr);
  gap: 34px;
  margin-bottom: 28px;
  padding: 28px;
  overflow: hidden;
}

.todo-form::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
  background: linear-gradient(180deg, var(--primary), #14b8a6);
}

.todo-form-heading {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.todo-form-heading h2,
.workspace-heading h2 {
  margin: 4px 0 5px;
  font-size: 24px;
  line-height: 1.25;
}

.todo-form-heading p,
.workspace-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.todo-trend-card {
  width: 100%;
  max-width: 240px;
  padding: 11px 12px 8px;
  background: linear-gradient(145deg, #f8fbff, #f6f8fc);
  border: 1px solid #e5edf8;
  border-radius: 13px;
}

.trend-heading,
.trend-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trend-heading {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.trend-heading strong {
  color: var(--ink);
  font-weight: 600;
}

.trend-heading b {
  color: var(--primary);
  font-size: 16px;
}

.trend-chart {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 3px;
  overflow: visible;
}

.trend-grid-line {
  fill: none;
  stroke: #dbe5f1;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.trend-area {
  fill: url(#trendAreaGradient);
}

.trend-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.trend-point {
  fill: #fff;
  stroke: var(--primary);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.trend-axis {
  margin-top: -2px;
  color: #94a3b8;
  font-size: 9px;
}

.todo-create-card {
  position: relative;
  display: grid;
  min-height: 260px;
  padding: 30px;
  overflow: hidden;
  align-content: center;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px 20px;
  background:
    radial-gradient(circle at 92% 4%, rgba(37, 99, 235, 0.16), transparent 34%),
    linear-gradient(145deg, #f7faff, #eef5ff);
  border: 1px solid #dce8f8;
  border-radius: 19px;
}

.todo-create-card::after {
  position: absolute;
  right: -42px;
  bottom: -68px;
  width: 180px;
  height: 180px;
  content: "";
  border: 28px solid rgba(37, 99, 235, 0.06);
  border-radius: 50%;
}

.todo-create-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
  font-size: 27px;
  font-weight: 400;
}

.todo-create-copy span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.todo-create-copy h3 {
  margin: 2px 0 5px;
  font-size: 20px;
}

.todo-create-copy p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.todo-create-features {
  display: flex;
  grid-column: 2;
  gap: 16px;
  margin: 0;
  padding: 0;
  color: #52637a;
  list-style: none;
  font-size: 12px;
}

.todo-create-features li::before {
  margin-right: 5px;
  color: #14a38b;
  content: "✓";
  font-weight: 900;
}

.todo-create-card .todo-submit {
  z-index: 1;
  width: fit-content;
  grid-column: 2;
}

.todo-editor-form .todo-editor-content {
  min-height: 160px;
}

.todo-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.todo-content-field {
  grid-column: 1 / -1;
}

.todo-content-field .textarea {
  min-height: 94px;
}

.optional-label {
  margin-left: 5px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
}

.todo-form-footer {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.todo-form-footer .form-error {
  flex: 1;
}

.todo-submit {
  gap: 7px;
  min-width: 132px;
}

.todo-workspace {
  padding: 28px;
}

.workspace-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 6px;
  background: #f5f7fb;
  border: 1px solid #e9eef5;
  border-radius: 16px;
}

.filter-group {
  display: flex;
  gap: 4px;
}

.toolbar .search-group {
  position: relative;
  display: flex;
  width: min(460px, 48%);
  min-width: 310px;
  gap: 6px;
}

.search-group .input {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  padding-left: 39px;
  background: #fff;
  border-color: transparent;
}

.toolbar [data-search-button] {
  min-width: 68px;
  flex: 0 0 auto;
  padding-inline: 15px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 2px solid #94a3b8;
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-58%);
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 2px;
  content: "";
  background: #94a3b8;
  border-radius: 2px;
  transform: rotate(45deg);
}

.filter-button {
  min-height: 40px;
  padding: 0 16px;
  color: #475569;
  background: transparent;
  border: 0;
  border-radius: 11px;
  font-weight: 700;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.filter-button:hover {
  color: var(--primary);
}

.filter-button.active,
.filter-button[aria-pressed="true"] {
  color: var(--primary);
  background: #fff;
  box-shadow: 0 3px 12px rgba(40, 55, 82, 0.1);
}

.list-panel {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 18px;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  flex-wrap: wrap;
}

.batch-actions,
.summary-counts {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-weight: 700;
}

.selection-count {
  color: #94a3b8;
  font-size: 13px;
}

.batch-buttons {
  display: flex;
  gap: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.inline-button {
  padding: 0;
  color: #475569;
  background: transparent;
  border: 0;
}

.inline-button:hover { color: var(--primary); }
.inline-button.danger:hover { color: var(--danger); }
.inline-button:disabled { cursor: not-allowed; opacity: 0.38; }

.summary-counts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.summary-counts strong {
  color: var(--ink);
  font-size: 15px;
}

.count-dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
}

.count-dot.active { background: #f59e0b; }
.count-dot.completed { background: #22c55e; }

.todo-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.todo-item {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5eaf1;
  border-radius: 15px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.todo-item::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: #f59e0b;
}

.todo-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 24px rgba(40, 55, 82, 0.08);
  transform: translateY(-1px);
}

.todo-item.completed {
  color: #64748b;
  background: #fbfcfd;
}

.todo-item.completed::before {
  background: #22c55e;
}

.todo-item.is-completing {
  border-color: #86efac;
  background: #f0fdf4;
  box-shadow: 0 14px 32px rgba(21, 128, 61, 0.14);
  animation: todo-complete-card 0.82s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.todo-item.is-completing::before {
  width: 100%;
  background: #22c55e;
  opacity: 0.07;
  animation: todo-complete-sweep 0.65s ease-out both;
}

.todo-item.is-completing .todo-status {
  color: var(--success);
}

.completion-feedback {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #166534;
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
  animation: todo-complete-feedback 0.82s ease both;
}

.completion-feedback i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.13);
  font-size: 19px;
  font-style: normal;
  animation: todo-complete-check 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes todo-complete-card {
  0% { transform: scale(1); }
  35% { transform: scale(0.992); }
  65% { transform: scale(1.004); }
  100% { transform: scale(1); }
}

@keyframes todo-complete-sweep {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes todo-complete-check {
  from { opacity: 0; transform: scale(0.3) rotate(-20deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes todo-complete-feedback {
  0%, 12% { opacity: 0; }
  30%, 72% { opacity: 1; }
  100% { opacity: 0; }
}

.todo-item.completed .todo-title {
  text-decoration: line-through;
}

.todo-top,
.todo-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.todo-title-group,
.todo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.todo-title-group {
  min-width: 0;
}

.todo-title-copy {
  min-width: 0;
}

.todo-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
}

.todo-status::before {
  width: 6px;
  height: 6px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.todo-item.completed .todo-status {
  color: var(--success);
}

.todo-checkbox {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

.todo-title { margin: 0; overflow-wrap: anywhere; font-size: 18px; line-height: 1.35; }
.todo-content { margin: 0; padding: 14px 16px; overflow-wrap: anywhere; color: #475569; background: #f8fafc; border-radius: 11px; white-space: pre-wrap; }
.todo-note { min-width: 0; overflow-wrap: anywhere; color: #64748b; font-size: 14px; }
.todo-note::before { margin-right: 5px; content: "备注"; color: #94a3b8; font-size: 12px; }
.todo-time { flex: 0 0 auto; color: #94a3b8; font-size: 12px; }

.todo-actions .button {
  min-height: 32px;
  padding-inline: 11px;
  background: #fff;
}

.todo-actions .complete-button {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.todo-actions .complete-button:hover,
.todo-actions .complete-button:focus-visible {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
  box-shadow: 0 6px 16px rgba(21, 128, 61, 0.18);
}

.todo-actions .button-danger {
  color: var(--danger);
  border-color: #fecaca;
}

.todo-actions .button-danger:hover,
.todo-actions .button-danger:focus-visible {
  color: #fff;
  background: var(--danger);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.empty-state::before {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 7px;
  place-items: center;
  color: var(--primary);
  background: #eff6ff;
  border-radius: 17px;
  content: "✓";
  font-size: 23px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.empty-state p { margin: 0; }

.loading-state::before { display: none; }

.loading-spinner {
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: todo-spin 0.8s linear infinite;
}

@keyframes todo-spin { to { transform: rotate(360deg); } }

.pagination {
  margin: 0;
  padding: 14px 18px 18px;
  border-top: 1px solid #eef2f7;
}

.pagination-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 13px;
  color: #475569;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 700;
}

.pagination-button:hover:not(:disabled) {
  color: var(--primary);
  border-color: #93c5fd;
}

.page-info {
  min-width: 92px;
  color: #64748b;
  text-align: center;
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .todo-item,
  .loading-spinner { animation: none; transition: none; }
}

@media (max-width: 900px) {
  .todo-form { grid-template-columns: 1fr; gap: 22px; }
  .todo-form-heading { align-items: center; flex-direction: row; }
  .todo-trend-card { width: 230px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar .search-group { width: 100%; min-width: 0; }
  .list-summary { align-items: flex-start; flex-direction: column-reverse; }
}

@media (max-width: 620px) {
  .dashboard-main { width: min(100% - 24px, 1300px); padding-top: 24px; }
  .todo-form,
  .todo-workspace { padding: 20px 16px; border-radius: 19px; }
  .todo-form-heading { align-items: stretch; flex-direction: column; gap: 16px; }
  .todo-trend-card { width: 100%; max-width: none; }
  .todo-create-card { min-height: 0; padding: 22px 18px; grid-template-columns: auto 1fr; }
  .todo-create-features { display: grid; grid-column: 1 / -1; gap: 5px; }
  .todo-create-card .todo-submit { width: 100%; grid-column: 1 / -1; }
  .todo-form-grid { grid-template-columns: 1fr; }
  .todo-content-field,
  .todo-form-footer { grid-column: auto; }
  .todo-form-footer { align-items: stretch; flex-direction: column; }
  .todo-submit { width: 100%; }
  .workspace-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .toolbar { margin-inline: -2px; }
  .filter-group { display: grid; grid-template-columns: repeat(3, 1fr); }
  .filter-button { padding-inline: 9px; font-size: 13px; }
  .search-group .button { padding-inline: 14px; }
  .list-summary { padding: 14px; }
  .batch-actions { width: 100%; gap: 9px; }
  .selection-count { margin-left: auto; }
  .batch-buttons { width: 100%; padding: 9px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .summary-counts { width: 100%; justify-content: space-between; gap: 7px; }
  .summary-counts span { gap: 4px; font-size: 12px; }
  .todo-list { padding: 10px; }
  .todo-item { padding: 16px 14px; }
  .todo-top,
  .todo-bottom { align-items: flex-start; flex-direction: column; }
  .todo-title-group { width: 100%; align-items: flex-start; }
  .todo-actions { display: grid; width: 100%; grid-template-columns: 1fr 1fr 1fr; }
  .todo-actions .button { padding-inline: 6px; }
  .todo-time { flex: auto; }
  .pagination { padding-inline: 10px; }
}

@media (max-width: 390px) {
  .todo-form-heading p,
  .workspace-heading p { display: none; }
  .summary-counts .count-dot { display: none; }
  .todo-actions { grid-template-columns: 1fr 1fr; }
  .todo-actions .complete-button { grid-column: 1 / -1; }
  .pagination-button span { display: none; }
}
