:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.28);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-2: #7c3aed;
  --danger: #dc2626;
  --success: #16a34a;
  --discarded: #b45309;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: float 16s ease-in-out infinite;
}

.ambient-blob-a {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -60px;
  background: rgba(37, 99, 235, 0.22);
}

.ambient-blob-b {
  width: 280px;
  height: 280px;
  right: -40px;
  top: 180px;
  background: rgba(124, 58, 237, 0.16);
  animation-delay: -6s;
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, 18px, 0) scale(1.04);
  }
}

.app {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 88px;
}

.reveal {
  animation: revealUp 0.7s var(--ease) both;
}

.reveal-delay-1 {
  animation-delay: 0.08s;
}

.reveal-delay-2 {
  animation-delay: 0.16s;
}

.reveal-delay-3 {
  animation-delay: 0.24s;
}

.reveal-delay-4 {
  animation-delay: 0.32s;
}

.reveal-delay-5 {
  animation-delay: 0.4s;
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 24px;
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.header-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-display {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.date-main {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}

.date-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.date-dot {
  opacity: 0.45;
}

.page-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.page-tab {
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.22s var(--ease),
    color 0.22s var(--ease),
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

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

.page-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
}

.page-view {
  display: none;
}

.page-view.is-active {
  display: block;
  animation: revealUp 0.45s var(--ease) both;
}

.page-stats {
  margin-bottom: 20px;
}

.brand {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.stats {
  display: flex;
  gap: 12px;
}

.stat-card {
  min-width: 92px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.1);
}

.stat-card strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform 0.35s var(--ease);
}

.stat-card strong.bump {
  animation: statBump 0.45s var(--ease);
}

.stat-open strong {
  color: var(--accent);
}

.stat-done strong {
  color: var(--success);
}

.stat-discarded strong {
  color: var(--discarded);
}

.stat-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.75rem;
}

@keyframes statBump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.panel {
  backdrop-filter: blur(16px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.composer-wrap {
  margin-bottom: 28px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.composer input,
.toolbar input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 14px;
  color: var(--text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s var(--ease);
}

.composer input:focus,
.toolbar input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform: translateY(-1px);
}

.composer input[type="date"] {
  min-width: 148px;
  color: var(--muted);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.32);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.toolbar {
  padding: 12px 14px;
}

.lists {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 20px;
  align-items: start;
  margin-bottom: 28px;
}

.list-panel {
  padding: 18px;
  min-height: 280px;
  min-width: 0;
}

.list-panel--wide {
  grid-column: 1 / -1;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.list-head h2 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: transform 0.3s var(--ease);
}

.count.bump {
  animation: statBump 0.45s var(--ease);
}

.task-list {
  display: grid;
  gap: 10px;
}

.list-panel--wide .task-list {
  display: block;
  columns: 280px 3;
  column-gap: 12px;
}

.list-panel--wide .task {
  width: 100%;
  margin-bottom: 12px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.list-panel--wide .empty-state {
  margin-bottom: 0;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pagination-summary {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pagination-btn {
  min-width: 34px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 10px;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition:
    transform 0.18s var(--ease),
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.pagination-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--accent-soft);
}

.pagination-btn.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--accent);
}

.pagination-btn:disabled {
  cursor: default;
  opacity: 0.58;
}

.empty-state {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.45);
  animation: fadeIn 0.4s var(--ease);
}

.task {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  display: grid;
  gap: 12px;
  animation: taskIn 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition:
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    border-color 0.22s ease,
    opacity 0.22s ease;
}

.task--draggable {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding-left: 8px;
}

.task-drag-handle {
  flex: 0 0 auto;
  align-self: center;
  width: 28px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: rgba(100, 116, 139, 0.55);
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: -0.12em;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.task-drag-handle:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
}

.task-drag-handle:active {
  cursor: grabbing;
}

.task--draggable .task-body {
  flex: 1;
  min-width: 0;
}

.task--dragging {
  opacity: 0.72;
  transform: scale(0.985);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
  border-color: rgba(37, 99, 235, 0.35);
}

.task--drag-over {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.task:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.task.removing {
  animation: taskOut 0.28s var(--ease) forwards;
}

.task--done {
  opacity: 0.78;
  background: rgba(248, 250, 252, 0.92);
}

.task--done .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(100, 116, 139, 0.45);
}

.task--discarded {
  opacity: 0.72;
  background: rgba(255, 251, 235, 0.78);
}

.task--discarded .task-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-style: wavy;
  text-decoration-color: rgba(180, 83, 9, 0.42);
}

@keyframes taskIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes taskOut {
  to {
    opacity: 0;
    transform: translateX(12px) scale(0.96);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.task-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}

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

.task-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task-editable {
  border-radius: 6px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.task-editable:focus {
  outline: none;
  background: rgba(37, 99, 235, 0.06);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.task-editable:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-weight: 400;
}

.task-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
  min-height: 1.25em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task--done .task-editable:focus {
  text-decoration: none;
  color: var(--text);
}

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

.meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.meta-tag--created {
  background: var(--accent-soft);
  color: var(--accent);
}

.meta-tag--done {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.meta-tag--discarded {
  background: rgba(180, 83, 9, 0.1);
  color: var(--discarded);
}

.meta-tag--days {
  background: rgba(22, 163, 74, 0.08);
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-self: end;
  padding-top: 2px;
}

.timeline-section {
  padding: 16px 18px 18px;
  margin-bottom: 28px;
}

.count-timeline {
  background: var(--accent-soft);
  color: var(--accent);
}

.timeline {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.timeline-track {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0;
  min-width: min-content;
  padding-top: 10px;
}

.timeline-track::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(37, 99, 235, 0.28) 0%,
    rgba(22, 163, 74, 0.22) 100%
  );
  pointer-events: none;
}

.timeline-item {
  position: relative;
  flex: 0 0 auto;
  width: 140px;
  padding: 0 10px;
  animation: taskIn 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.timeline-item--open .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.timeline-item--open .timeline-card {
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.04);
}

.timeline-item--done .timeline-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.timeline-item--done .timeline-card {
  border-color: rgba(22, 163, 74, 0.2);
  background: rgba(22, 163, 74, 0.05);
}

.timeline-item--done .timeline-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(100, 116, 139, 0.4);
}

.timeline-item--discarded .timeline-dot {
  background: var(--discarded);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.12);
}

.timeline-item--discarded .timeline-card {
  border-color: rgba(180, 83, 9, 0.18);
  background: rgba(180, 83, 9, 0.05);
}

.timeline-item--discarded .timeline-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-style: wavy;
  text-decoration-color: rgba(180, 83, 9, 0.4);
}

.timeline-dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 auto 8px;
  border-radius: 50%;
}

.timeline-card {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.timeline-item:hover .timeline-card {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.timeline-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-times {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.timeline-tag {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.58rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.timeline-tag--created {
  background: var(--accent-soft);
  color: var(--accent);
}

.timeline-tag--done {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.timeline-tag--discarded {
  background: rgba(180, 83, 9, 0.1);
  color: var(--discarded);
}

.empty-state--compact {
  padding: 18px 12px;
  font-size: 0.78rem;
}

.section-hint {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.transfer-section {
  padding: 18px;
}

.count-transfer {
  background: rgba(124, 58, 237, 0.12);
  color: var(--accent-2);
}

.progress-section {
  padding: 18px;
}

.count-progress {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
}

.progress-form {
  display: grid;
  grid-template-columns: 1fr 88px 96px auto;
  gap: 12px;
  margin-bottom: 16px;
}

.progress-form input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px 12px;
  color: var(--text);
  font-size: 1rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.progress-form input:focus {
  outline: none;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.04);
}

.progress-ep-input {
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.progress-ep-input::-webkit-outer-spin-button,
.progress-ep-input::-webkit-inner-spin-button,
.progress-ep::-webkit-outer-spin-button,
.progress-ep::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.progress-list-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.progress-list {
  display: grid;
  gap: 12px;
}

.progress-item {
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  animation: taskIn 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition: border-color 0.22s ease;
}

.progress-item:hover {
  border-color: rgba(15, 23, 42, 0.14);
}

.progress-item--complete {
  border-color: rgba(22, 163, 74, 0.22);
  background: rgba(22, 163, 74, 0.04);
}

.progress-bar-wrap {
  height: 3px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--text);
  opacity: 0.28;
  transition: width 0.35s var(--ease);
}

.progress-item--complete .progress-bar {
  background: var(--success);
  opacity: 0.55;
}

.progress-item.removing {
  animation: taskOut 0.28s var(--ease) forwards;
}

.progress-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.progress-time {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.progress-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.progress-name {
  flex: 1;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 8px 10px;
  color: var(--text);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}

.progress-name:focus {
  outline: none;
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.04);
}

.progress-fraction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.progress-ep {
  width: 64px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 8px;
  color: var(--text);
  font-size: 1rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.progress-ep:focus {
  outline: none;
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.16);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.04);
}

.progress-slash {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
}

.progress-item--complete .progress-fraction,
.progress-item--complete .progress-ep,
.progress-item--complete .progress-slash {
  color: var(--success);
}

.progress-item--complete .progress-ep {
  border-color: transparent;
}

.progress-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.progress-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 600;
}

.transfer-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.transfer-editor textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 14px;
  color: var(--text);
  resize: vertical;
  min-height: 132px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s var(--ease);
}

.transfer-editor textarea:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.35);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
  transform: translateY(-1px);
}

.transfer-md-preview {
  display: none;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(124, 58, 237, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.transfer-md-preview.is-visible {
  display: block;
}

.markdown-body {
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.65;
  word-break: break-word;
}

.markdown-body :first-child {
  margin-top: 0;
}

.markdown-body :last-child {
  margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 0.8em 0 0.45em;
  line-height: 1.35;
  font-weight: 700;
}

.markdown-body h1 {
  font-size: 1.15rem;
}

.markdown-body h2 {
  font-size: 1.05rem;
}

.markdown-body h3 {
  font-size: 0.95rem;
}

.markdown-body p {
  margin: 0.45em 0;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.45em 0;
  padding-left: 1.35em;
}

.markdown-body li + li {
  margin-top: 0.2em;
}

.markdown-body blockquote {
  margin: 0.55em 0;
  padding: 0.35em 0.8em;
  border-left: 3px solid rgba(124, 58, 237, 0.35);
  color: var(--muted);
  background: rgba(124, 58, 237, 0.04);
  border-radius: 0 8px 8px 0;
}

.markdown-body code {
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.06);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
}

.markdown-body pre {
  margin: 0.65em 0;
  padding: 10px 12px;
  overflow: auto;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.78rem;
  line-height: 1.55;
}

.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.markdown-body strong {
  font-weight: 700;
}

.transfer-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(124, 58, 237, 0.28);
  background: rgba(124, 58, 237, 0.04);
}

.panel-inner {
  backdrop-filter: none;
  box-shadow: none;
}

.action-upload {
  color: var(--accent-2);
  border-color: rgba(124, 58, 237, 0.24);
  background: rgba(255, 255, 255, 0.92);
}

.action-upload:hover {
  color: var(--accent-2);
  border-color: rgba(124, 58, 237, 0.35);
  background: rgba(124, 58, 237, 0.08);
}

.transfer-upload-hint {
  color: var(--muted);
  font-size: 0.72rem;
}

.transfer-list {
  display: grid;
  gap: 10px;
}

.transfer-item {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  animation: taskIn 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition:
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    border-color 0.22s ease;
}

.transfer-item:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.22);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.transfer-item.removing {
  animation: taskOut 0.28s var(--ease) forwards;
}

.transfer-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.transfer-item-main {
  flex: 1;
  min-width: 0;
}

.transfer-kind {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  margin-bottom: 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.transfer-kind--text {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

.transfer-kind--file {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-2);
}

.transfer-item-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.transfer-item-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.transfer-item-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.transfer-preview {
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  max-height: none;
  overflow: visible;
  word-break: break-word;
}

.transfer-preview--collapsed {
  max-height: 6.2em;
  overflow: hidden;
  position: relative;
}

.transfer-preview--collapsed::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.8em;
  background: linear-gradient(transparent, rgba(244, 246, 249, 0.95));
  pointer-events: none;
}

.transfer-preview--loading,
.transfer-preview--empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.transfer-item--text .transfer-item-meta {
  margin-top: 8px;
}

.transfer-expand {
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.transfer-expand:hover {
  text-decoration: underline;
}

.action.copy:hover {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--accent-soft);
}

.action.download:hover {
  color: var(--accent-2);
  border-color: rgba(124, 58, 237, 0.28);
  background: rgba(124, 58, 237, 0.08);
}

.action.preview:hover {
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.18);
  background: rgba(15, 23, 42, 0.04);
}

.action {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 12px;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition:
    transform 0.18s var(--ease),
    color 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.action:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.18);
}

.action.complete:hover {
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.08);
}

.action.reopen:hover {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--accent-soft);
}

.action.discard:hover {
  color: var(--discarded);
  border-color: rgba(180, 83, 9, 0.28);
  background: rgba(180, 83, 9, 0.08);
}

.action.delete:hover {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.06);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px) scale(0.96);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.8125rem;
  opacity: 0;
  backdrop-filter: blur(8px);
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease);
  pointer-events: none;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

@media (max-width: 1180px) {
  .app {
    max-width: 100%;
  }

  .lists {
    gap: 14px;
  }

  .list-panel {
    padding: 14px;
  }

  .task {
    padding: 12px;
  }
}

@media (max-width: 980px) {
  .lists {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .app {
    padding: 28px 16px 72px;
  }

  .header-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-tabs {
    width: 100%;
  }

  .page-tab {
    flex: 1;
    text-align: center;
  }

  .stats {
    width: 100%;
  }

  .stat-card {
    flex: 1;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .composer input[type="date"] {
    min-width: 0;
  }

  .lists {
    grid-template-columns: 1fr;
  }

  .list-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-summary {
    white-space: normal;
  }

  .pagination-controls {
    justify-content: flex-start;
  }

  .task-actions {
    justify-content: flex-start;
  }

  .transfer-item-top {
    flex-direction: column;
  }

  .transfer-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

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

  .progress-form .btn-primary {
    grid-column: 1 / -1;
  }

  .progress-item-top {
    flex-direction: column;
    align-items: stretch;
  }

  .progress-title-row {
    flex-wrap: wrap;
  }

  .progress-fraction {
    width: 100%;
    justify-content: flex-end;
  }

  .progress-ep {
    width: 72px;
  }

  .progress-item-actions {
    justify-content: flex-end;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
