:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #edf3fa;
  --line: #d8e2ed;
  --line-strong: #b7c7d8;
  --text: #17202b;
  --muted: #657487;
  --blue: #1467e8;
  --cyan: #08a7c9;
  --red: #d94040;
  --amber: #b77900;
  --green: #16825b;
  --shadow: 0 18px 48px rgba(23, 32, 43, 0.08);
  --radius: 8px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(20, 103, 232, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(20, 103, 232, 0.045) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
}

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

button,
label.file-label {
  cursor: pointer;
}

code {
  color: var(--blue);
  font-size: 12px;
}

.app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 10px 22px rgba(20, 103, 232, 0.24);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.brand h1 {
  font-size: 19px;
  line-height: 1.2;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.filters {
  display: grid;
  gap: 8px;
}

.filter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.filter.is-active,
.filter:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-soft);
}

.sidebar-note {
  position: absolute;
  right: 18px;
  bottom: 22px;
  left: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sidebar-note h2 {
  margin-bottom: 8px;
  font-size: 13px;
}

.sidebar-note p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.link-button {
  margin-top: 10px;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 26px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h2 {
  margin-top: 6px;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.1;
}

.hero-actions,
.tools {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 100%);
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.primary,
.secondary,
.danger,
.icon-button {
  min-height: 40px;
  border-radius: var(--radius);
  font-weight: 750;
}

.primary {
  padding: 0 16px;
  border: 1px solid var(--blue);
  color: #fff;
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(20, 103, 232, 0.2);
}

.secondary,
.danger,
.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
  font-weight: 750;
}

.danger {
  color: var(--red);
}

.icon-button {
  width: 38px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-size: 22px;
  line-height: 1;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(183, 121, 0, 0.28);
  border-radius: var(--radius);
  color: #6d4d00;
  background: rgba(183, 121, 0, 0.08);
  font-size: 13px;
  line-height: 1.6;
}

.notice[data-type="error"] {
  border-color: rgba(217, 64, 64, 0.3);
  color: var(--red);
  background: rgba(217, 64, 64, 0.08);
}

.notice[data-type="info"] {
  border-color: rgba(20, 103, 232, 0.22);
  color: var(--blue);
  background: rgba(20, 103, 232, 0.08);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metrics article,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.metrics article {
  min-height: 110px;
  padding: 16px;
}

.metrics span,
.metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  margin: 9px 0 5px;
  font-size: 32px;
  line-height: 1;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin-top: 5px;
  font-size: 20px;
}

.panel-head > span {
  color: var(--muted);
  font-size: 13px;
}

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

.focus-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(20, 103, 232, 0.22);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(20, 103, 232, 0.08), rgba(255, 255, 255, 0.96));
}

.focus-card h4 {
  font-size: 16px;
  line-height: 1.35;
}

.focus-card p,
.daily-brief {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.badges,
.task-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.priority-s {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

.priority-a {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.priority-b {
  color: #fff;
  border-color: var(--cyan);
  background: var(--cyan);
}

.soon {
  color: var(--amber);
  border-color: rgba(183, 121, 0, 0.3);
  background: rgba(183, 121, 0, 0.09);
}

.danger {
  color: var(--red);
  border-color: rgba(217, 64, 64, 0.32);
  background: rgba(217, 64, 64, 0.08);
}

.status.done {
  color: var(--green);
  background: rgba(22, 130, 91, 0.08);
}

.status.waiting {
  color: var(--amber);
  background: rgba(183, 121, 0, 0.08);
}

.reminder-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.reminder-line strong {
  color: var(--text);
}

.tasks-panel,
.timeline-panel {
  margin-top: 16px;
}

.tasks-head {
  align-items: center;
}

.tools select {
  height: 40px;
  min-width: 160px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
}

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

.task-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 150px 130px 112px;
  gap: 12px;
  align-items: center;
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.task-main h4 {
  overflow-wrap: anywhere;
  font-size: 16px;
  line-height: 1.35;
}

.task-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.task-field {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.task-field span,
.task-progress span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.task-field strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.task-field em {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 7px;
  border-radius: 6px;
  font-style: normal;
  font-size: 12px;
}

.task-progress i {
  display: block;
  overflow: hidden;
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
}

.task-progress b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.row-actions button {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
  font-weight: 750;
}

.row-actions button:hover {
  color: var(--blue);
  border-color: rgba(20, 103, 232, 0.34);
}

.empty,
.empty-inline {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty strong,
.empty span {
  display: block;
}

.empty strong {
  margin-bottom: 6px;
  color: var(--text);
}

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

.timeline li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
}

.timeline time {
  color: var(--muted);
  font-size: 12px;
}

.timeline strong {
  display: block;
  font-size: 14px;
}

.timeline span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(23, 32, 43, 0.38);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(23, 32, 43, 0.22);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.modal-head h3 {
  font-size: 22px;
}

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface);
}

.form-grid input,
.form-grid select {
  height: 40px;
  padding: 0 10px;
}

.form-grid input[type="range"] {
  padding: 0;
}

.form-grid textarea {
  min-height: 110px;
  padding: 10px;
  resize: vertical;
}

.modal-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 230px minmax(0, 1fr);
  }

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

  .task-row {
    grid-template-columns: minmax(220px, 1fr) 1fr 130px;
  }
}

@media (max-width: 860px) {
  .app {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .sidebar-note {
    position: static;
    margin-top: 18px;
  }

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

  .main {
    padding: 18px;
  }

  .hero {
    display: grid;
  }

  .hero-actions,
  .search,
  .primary {
    width: 100%;
  }

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

  .tasks-head,
  .tools {
    display: grid;
    justify-content: stretch;
  }

  .tools select,
  .tools .secondary,
  .tools .file-label {
    width: 100%;
  }

  .task-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .metrics,
  .filters,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .focus-card,
  .timeline li,
  .modal-actions {
    grid-template-columns: 1fr;
  }

  .modal-actions span {
    display: none;
  }
}
