@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap");

:root {
  --bg: #f3f5f8;
  --bg-panel: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #dbe1ea;
  --shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
  --accent: #ea580c;
  --accent-2: #0f766e;
  --high: #dc2626;
  --high-bg: #fff5f5;
  --med: #d97706;
  --med-bg: #fff9ee;
  --low: #0f766e;
  --low-bg: #f0fdf8;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 460px at 95% -20%, rgba(234, 88, 12, 0.16) 0%, rgba(234, 88, 12, 0) 65%),
    radial-gradient(900px 420px at 0% -10%, rgba(15, 118, 110, 0.14) 0%, rgba(15, 118, 110, 0) 62%),
    var(--bg);
}

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

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(243, 245, 248, 0.88);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

body.is-auth-view .topbar {
  display: none;
}

.topbar-main,
.tabs,
.quick-stats,
main,
.auth-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 10px;
}

.topbar h1 {
  display: none;
}

.meta {
  display: none;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.user-badge-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.auth-shell {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-panel {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.1);
  padding: 24px;
}

.auth-copy {
  margin-bottom: 18px;
}

.auth-eyebrow {
  display: none;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
}

.auth-copy h2 {
  margin: 14px 0 6px;
  font-size: 28px;
  line-height: 1.15;
}

.auth-copy p {
  display: block;
  margin: 8px 0 0;
  color: #475569;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.auth-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #eef2f7;
  margin-bottom: 12px;
}

.auth-tab {
  min-width: 88px;
  height: 34px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.auth-status {
  min-height: 20px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.auth-status.is-error {
  color: #b91c1c;
}

.auth-status.is-success {
  color: #0f766e;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
}

.auth-form input {
  height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.admin-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 20px;
}

.admin-overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.admin-stat {
  min-height: 88px;
}

.admin-main {
  padding: 16px 0 0;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  padding: 16px;
}

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

.admin-panel-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.admin-filters {
  margin-bottom: 0;
}

.admin-table td,
.admin-table th {
  white-space: nowrap;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.role-pill-admin {
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.role-pill-user {
  color: #155e75;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 0 20px 12px;
}

.tab {
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #4b5563;
  padding: 8px 4px;
  margin-right: 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.tab.active {
  color: #111827;
  border-bottom-color: var(--accent);
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 14px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-value {
  display: block;
  margin-top: 3px;
  font-family: "Barlow", "Noto Sans SC", sans-serif;
  font-size: 24px;
  line-height: 1;
}

main {
  padding: 0 20px 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 220ms ease-out both;
}

.current-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.today-focus-panel {
  position: sticky;
  top: 112px;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  padding: 14px;
}

.today-focus-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 14px;
  border-bottom: 1px dashed #d1d5db;
}

.today-focus-head strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
}

.today-focus-head strong::before {
  content: "★";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  flex: 0 0 auto;
}

.today-focus-date,
.today-focus-weekday {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.today-focus-name {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 2px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.today-focus-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #dbe1ea;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.today-focus-list {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}

.today-focus-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-height: 40px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1f6;
}

.today-focus-row.done {
  color: #94a3b8;
}

.today-focus-row.overdue .today-focus-text,
.today-focus-row.overdue .today-focus-parent,
.today-focus-row.overdue .today-focus-child {
  color: #dc2626;
}

.today-focus-check {
  width: 14px;
  height: 14px;
  margin: 3px 0 0;
  accent-color: #0f766e;
}

.today-focus-text {
  display: block;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #334155;
  text-align: left;
  line-height: 1.45;
  cursor: pointer;
}

.today-focus-text:hover .today-focus-child {
  text-decoration: underline;
}

.today-focus-parent {
  margin-right: 4px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.today-focus-child {
  font-size: 12px;
  font-weight: 700;
}

.today-focus-overdue-tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff1f2;
  color: #dc2626;
  font-size: 11px;
  font-weight: 800;
}

.today-focus-row.done .today-focus-text {
  color: #94a3b8;
  text-decoration: line-through;
}

.today-focus-row.done .today-focus-parent {
  color: #94a3b8;
}

.today-focus-empty {
  padding: 12px 2px;
  color: #94a3b8;
  font-size: 13px;
}

.lane-wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lane {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 360px;
  padding: 10px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.lane:nth-child(1) {
  background: linear-gradient(180deg, var(--high-bg) 0%, rgba(255, 255, 255, 0.94) 24%);
}

.lane:nth-child(2) {
  background: linear-gradient(180deg, var(--med-bg) 0%, rgba(255, 255, 255, 0.94) 24%);
}

.lane:nth-child(3) {
  background: linear-gradient(180deg, var(--low-bg) 0%, rgba(255, 255, 255, 0.94) 24%);
}

.lane h2 {
  margin: 0 0 10px;
  padding: 8px 8px 10px;
  font-size: 14px;
  border-bottom: 1px dashed #d1d5db;
}

.task-list {
  display: grid;
  gap: 8px;
  min-height: 72px;
  padding: 3px;
  border-radius: 10px;
  transition: background-color 0.18s ease, outline-color 0.18s ease;
}

.task-list:empty::before {
  content: "暂无任务";
  color: #9ca3af;
  font-size: 13px;
  padding: 8px 4px;
}

.task-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px;
  background: var(--bg-panel);
  cursor: grab;
  user-select: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: cardIn 260ms ease both;
  animation-delay: var(--stagger, 0ms);
}

#highList .task-card {
  border-left: 4px solid var(--high);
}

#mediumList .task-card {
  border-left: 4px solid var(--med);
}

#lowList .task-card {
  border-left: 4px solid var(--low);
}

.task-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.task-card:active {
  cursor: grabbing;
}

.task-card.dragging {
  opacity: 0.55;
  border-style: dashed;
}

.task-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.task-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.task-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
}

.task-title-text {
  display: inline-block;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  padding: 1px 3px;
  border-radius: 6px;
}

.task-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.card-action-btn,
.attachment-open-btn,
.archive-task-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #334155;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.card-action-btn:hover,
.attachment-open-btn:hover,
.archive-task-btn:hover {
  border-color: #9ca3af;
}

.title-edit-btn {
  opacity: 0;
  transform: translateX(-2px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.task-title-wrap:hover .title-edit-btn,
.task-title-wrap:focus-within .title-edit-btn {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.attachment-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.attachment-open-btn::before {
  content: "📎";
  font-size: 12px;
  line-height: 1;
}

.task-list.drag-over {
  background: rgba(14, 116, 144, 0.08);
  outline: 2px dashed #0ea5e9;
  outline-offset: 2px;
}

.task-summary-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 18px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.task-card.is-collapsed .task-summary-row {
  margin-bottom: 0;
}

.subtask-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.subtask-toggle-btn:hover {
  color: #334155;
}

.subtask-toggle-btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.subtask-toggle-icon {
  width: 12px;
  height: 12px;
  display: block;
  overflow: visible;
}

.subtask-toggle-spacer {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.task-progress,
.task-summary-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.subtask-list {
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.subtask-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 22px;
  gap: 8px;
  align-items: flex-start;
}

.subtask-check {
  margin: 2px 0 0;
  accent-color: #0f766e;
}

.subtask-text {
  display: inline-block;
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
  padding: 1px 4px;
  border-radius: 6px;
}

.subtask-text.done {
  text-decoration: line-through;
  color: #94a3b8;
}

.subtask-focus-btn {
  width: 22px;
  height: 22px;
  margin-top: -2px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.subtask-item:hover .subtask-focus-btn,
.subtask-focus-btn:focus-visible,
.subtask-focus-btn.is-focused {
  opacity: 1;
}

.subtask-focus-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.subtask-focus-btn.is-focused {
  color: #475569;
}

.task-card.is-located {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18), var(--shadow);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.filters label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #475569;
}

.log-keyword-field {
  min-width: 220px;
  flex: 1 1 240px;
}

.filters select,
.filters input {
  height: 34px;
  min-width: 130px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 8px;
  background: #fff;
}

.archive-summary {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.archive-table th,
.archive-table td {
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px;
  font-size: 13px;
}

.archive-table th {
  background: #eef2f7;
}

.archive-table tr:nth-child(even) td {
  background: #f8fafc;
}

.th-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sort-arrows {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.sort-btn {
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  padding: 0;
}

.sort-btn:hover {
  color: #4b5563;
}

.sort-btn.active {
  color: #111827;
}

.primary-btn,
.ghost-btn,
.danger-btn {
  border-radius: 10px;
  height: 36px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.primary-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary-btn:hover {
  filter: brightness(0.95);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ghost-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
}

.danger-btn {
  border: 1px solid #ef4444;
  background: #fff1f2;
  color: #b91c1c;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(17, 24, 39, 0.46);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-mask.hidden,
.viewer-mask.hidden {
  display: none;
}

.modal {
  width: min(560px, 100%);
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 56px rgba(17, 24, 39, 0.34);
  padding: 14px;
  animation: popIn 200ms ease-out both;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.modal-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.modal-form label {
  display: grid;
  gap: 4px;
  color: #334155;
  font-size: 13px;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}

.modal-form textarea {
  resize: vertical;
}

.form-section {
  display: grid;
  gap: 8px;
}

.form-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #334155;
  font-size: 13px;
}

.form-section-meta,
.attachment-hint {
  color: var(--muted);
  font-size: 12px;
}

.attachment-zone {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  padding: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.attachment-zone:hover,
.attachment-zone:focus {
  border-color: #94a3b8;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.attachment-zone.is-active {
  border-color: var(--accent);
  background: #fff7ed;
}

.attachment-zone-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.attachment-zone-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.attachment-list:empty {
  display: none;
}

.attachment-card {
  display: grid;
  gap: 6px;
}

.attachment-thumb {
  position: relative;
  border: 1px solid #dbe1ea;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2f7;
  aspect-ratio: 1 / 1;
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.attachment-file-name {
  color: #334155;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
}

.viewer-mask {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.viewer-shell {
  width: min(1180px, 100%);
  height: min(90vh, 860px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  color: #e2e8f0;
}

.viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.viewer-headline h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
}

.viewer-meta {
  margin-top: 4px;
  color: rgba(226, 232, 240, 0.72);
  font-size: 12px;
}

.viewer-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.viewer-btn {
  min-width: 42px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(226, 232, 240, 0.22);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.42);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.viewer-btn:hover,
.viewer-nav:hover {
  background: rgba(30, 41, 59, 0.72);
}

.viewer-btn-primary {
  background: rgba(234, 88, 12, 0.92);
  border-color: rgba(234, 88, 12, 0.92);
}

.viewer-stage {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 0;
}

.viewer-nav {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(226, 232, 240, 0.22);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.42);
  color: #fff;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.viewer-nav:disabled,
.viewer-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.viewer-canvas {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.12);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.viewer-canvas img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.16s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.viewer-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.viewer-thumb {
  width: 84px;
  height: 84px;
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.viewer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.viewer-thumb.active {
  border-color: rgba(234, 88, 12, 0.96);
  box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.4);
}

.modal-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

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

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

/* Apple-inspired visual refresh: style-only overrides, no behavior changes. */
:root {
  --bg: #f5f6f8;
  --bg-panel: rgba(255, 255, 255, 0.82);
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.14);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.08);
  --accent: #007aff;
  --accent-2: #34c759;
  --high: #ff453a;
  --high-bg: rgba(255, 69, 58, 0.08);
  --med: #ff9f0a;
  --med-bg: rgba(255, 159, 10, 0.09);
  --low: #34c759;
  --low-bg: rgba(52, 199, 89, 0.09);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, #fbfbfd 0%, #f5f6f8 48%, #eef1f5 100%);
}

.topbar {
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  background: rgba(250, 250, 252, 0.78);
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.topbar-main {
  padding: 18px 22px 12px;
}

.topbar h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Noto Sans SC", sans-serif;
  font-size: clamp(25px, 2.3vw, 34px);
  font-weight: 760;
  letter-spacing: 0;
}

.meta {
  color: rgba(60, 60, 67, 0.62);
}

.tabs {
  gap: 4px;
  width: min(1240px, calc(100% - 40px));
  margin-top: 8px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 13px;
  background: rgba(235, 236, 240, 0.78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.tab {
  flex: 1 1 0;
  height: 34px;
  margin: 0;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  color: rgba(60, 60, 67, 0.72);
  font-size: 13px;
  font-weight: 650;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tab.active {
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(255, 255, 255, 0.94) inset;
}

.quick-stats {
  gap: 12px;
}

.stat-item,
.auth-panel,
.admin-panel,
.today-focus-panel,
.lane,
.archive-table,
.modal {
  border-color: rgba(60, 60, 67, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.055), 0 1px 0 rgba(255, 255, 255, 0.92) inset;
  backdrop-filter: saturate(170%) blur(18px);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
}

.stat-item {
  border-radius: 16px;
  padding: 12px 14px;
}

.stat-label,
.task-progress,
.task-summary-meta,
.archive-summary,
.attachment-hint,
.form-section-meta {
  color: rgba(60, 60, 67, 0.62);
}

.stat-value {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Noto Sans SC", sans-serif;
  font-weight: 720;
  color: #1d1d1f;
}

.current-workspace {
  gap: 14px;
}

.today-focus-panel {
  top: 132px;
  border-radius: 18px;
  padding: 15px;
}

.today-focus-head {
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
}

.today-focus-head strong::before {
  background: rgba(0, 122, 255, 0.1);
  color: #007aff;
}

.today-focus-head span,
.today-focus-date,
.today-focus-weekday,
.task-id {
  border-color: rgba(60, 60, 67, 0.1);
  background: rgba(242, 242, 247, 0.86);
  color: rgba(60, 60, 67, 0.72);
}

.lane-wrap {
  gap: 14px;
}

.lane {
  border-radius: 18px;
  padding: 12px;
}

.lane:nth-child(1) {
  background: linear-gradient(180deg, rgba(255, 69, 58, 0.075) 0%, rgba(255, 255, 255, 0.78) 32%);
}

.lane:nth-child(2) {
  background: linear-gradient(180deg, rgba(255, 159, 10, 0.08) 0%, rgba(255, 255, 255, 0.78) 32%);
}

.lane:nth-child(3) {
  background: linear-gradient(180deg, rgba(52, 199, 89, 0.08) 0%, rgba(255, 255, 255, 0.78) 32%);
}

.lane h2 {
  padding: 8px 7px 12px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.1);
  font-size: 13px;
  font-weight: 760;
  color: #1d1d1f;
}

.task-card {
  border-color: rgba(60, 60, 67, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.035);
}

#highList .task-card {
  border-left: 3px solid rgba(255, 69, 58, 0.86);
}

#mediumList .task-card {
  border-left: 3px solid rgba(255, 159, 10, 0.86);
}

#lowList .task-card {
  border-left: 3px solid rgba(52, 199, 89, 0.86);
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 122, 255, 0.24);
}

.task-title-text,
.today-focus-name {
  color: #1d1d1f;
}

.today-focus-row,
.archive-table th,
.archive-table td {
  border-bottom-color: rgba(60, 60, 67, 0.1);
}

.card-action-btn,
.attachment-open-btn,
.archive-task-btn,
.ghost-btn,
.viewer-btn,
.viewer-nav {
  border-color: rgba(60, 60, 67, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: #1d1d1f;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.86) inset;
}

.card-action-btn:hover,
.attachment-open-btn:hover,
.archive-task-btn:hover,
.ghost-btn:hover {
  border-color: rgba(0, 122, 255, 0.34);
  background: rgba(255, 255, 255, 0.96);
}

.primary-btn {
  border-color: #007aff;
  background: #007aff;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 122, 255, 0.22);
}

.primary-btn:hover {
  filter: brightness(0.98);
  box-shadow: 0 10px 22px rgba(0, 122, 255, 0.28);
}

.danger-btn {
  border-color: rgba(255, 69, 58, 0.35);
  background: rgba(255, 69, 58, 0.08);
  color: #d70015;
}

.auth-panel {
  border-radius: 20px;
}

.auth-eyebrow {
  background: rgba(0, 122, 255, 0.1);
  color: #0066cc;
}

.auth-tabs {
  background: rgba(235, 236, 240, 0.82);
}

.auth-tab.active {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.auth-form input,
.filters select,
.filters input,
.modal-form input,
.modal-form select,
.modal-form textarea {
  border-color: rgba(60, 60, 67, 0.16);
  background: rgba(255, 255, 255, 0.88);
  color: #1d1d1f;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.auth-form input:focus,
.filters select:focus,
.filters input:focus,
.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
  border-color: rgba(0, 122, 255, 0.72);
  outline: 3px solid rgba(0, 122, 255, 0.16);
}

.archive-table {
  border-radius: 16px;
  overflow: hidden;
}

.archive-table th {
  background: rgba(242, 242, 247, 0.94);
  color: rgba(60, 60, 67, 0.78);
  font-weight: 720;
}

.archive-table tr:nth-child(even) td {
  background: rgba(247, 247, 250, 0.68);
}

.modal-mask {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal {
  border-radius: 20px;
}

.attachment-zone {
  border-color: rgba(60, 60, 67, 0.18);
  background: rgba(242, 242, 247, 0.62);
}

.attachment-zone:hover,
.attachment-zone:focus {
  border-color: rgba(0, 122, 255, 0.42);
}

.attachment-zone.is-active {
  border-color: rgba(0, 122, 255, 0.72);
  background: rgba(0, 122, 255, 0.08);
}

.viewer-mask {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.viewer-btn-primary {
  background: rgba(0, 122, 255, 0.92);
  border-color: rgba(0, 122, 255, 0.92);
}

.viewer-canvas {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.viewer-thumb.active {
  border-color: rgba(0, 122, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.4);
}

/* Topbar brand block. */
.topbar-main > div:first-child {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 11px;
  align-items: center;
  min-width: 240px;
}

.topbar-main > div:first-child::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: url("./auth-focus-icon.svg") center / contain no-repeat;
  filter: drop-shadow(0 8px 14px rgba(52, 199, 89, 0.16));
}

.topbar h1 {
  display: block;
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-size: clamp(20px, 2vw, 25px);
  line-height: 1.05;
}

.meta {
  display: block;
  grid-column: 2;
  grid-row: 2;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

/* iCloud-like auth welcome page. */
.auth-shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: calc(100svh - 86px);
  padding: 46px 20px 56px;
  overflow: hidden;
}

.auth-shell::before,
.auth-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.9;
}

.auth-shell::before {
  width: min(58vw, 720px);
  height: min(58vw, 720px);
  left: max(-170px, -8vw);
  top: -190px;
  background:
    radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.96) 0 13%, rgba(255, 255, 255, 0) 14%),
    radial-gradient(circle at 68% 62%, rgba(255, 255, 255, 0.88) 0 9%, rgba(255, 255, 255, 0) 10%),
    linear-gradient(135deg, rgba(0, 122, 255, 0.28), rgba(90, 200, 250, 0.18), rgba(255, 255, 255, 0));
}

.auth-shell::after {
  width: min(42vw, 520px);
  height: min(42vw, 520px);
  right: max(-130px, -6vw);
  bottom: -160px;
  background: linear-gradient(145deg, rgba(175, 82, 222, 0.16), rgba(52, 199, 89, 0.13), rgba(255, 255, 255, 0));
}

.auth-panel {
  position: relative;
  z-index: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  grid-template-rows: 1fr auto auto auto 1fr;
  column-gap: 34px;
  row-gap: 14px;
  align-items: center;
  width: min(980px, 100%);
  min-height: 560px;
  padding: 34px;
  overflow: hidden;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.92) inset;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: 29px;
  background:
    radial-gradient(circle at 22% 30%, rgba(0, 122, 255, 0.16), rgba(0, 122, 255, 0) 28%),
    radial-gradient(circle at 78% 16%, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0) 24%);
}

.auth-panel > * {
  position: relative;
  z-index: 1;
}

.auth-copy {
  position: relative;
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: stretch;
  display: grid;
  grid-template-columns: minmax(132px, 210px) minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 28px;
  align-content: center;
  align-items: center;
  min-height: 460px;
  margin: 0;
  padding: 34px 26px 34px 6px;
}

.auth-copy::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / span 3;
  width: min(18vw, 210px);
  aspect-ratio: 1;
  border-radius: 0;
  background: url("./auth-focus-icon.svg") center / contain no-repeat;
  box-shadow: none;
  transform: none;
}

.auth-copy::after {
  content: none;
}

.auth-eyebrow {
  grid-column: 2;
  grid-row: 1;
  width: fit-content;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(0, 102, 204, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.auth-copy h2 {
  grid-column: 2;
  grid-row: 1;
  max-width: 440px;
  margin: 0;
  font-size: clamp(31px, 3.4vw, 46px);
  line-height: 1.02;
  letter-spacing: 0;
  transform: translateY(48px);
}

.auth-copy p {
  grid-column: 2;
  grid-row: 2;
  max-width: 410px;
  margin-top: 12px;
  font-size: 15px;
  color: rgba(60, 60, 67, 0.68);
  transform: translateY(48px);
}

.auth-tabs,
.auth-status,
.auth-form {
  grid-column: 2;
  width: 100%;
}

.auth-tabs {
  grid-row: 2;
  justify-self: stretch;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 4px;
  padding: 4px;
  border: 1px solid rgba(60, 60, 67, 0.1);
  border-radius: 14px;
}

.auth-tab {
  width: 100%;
  height: 38px;
  border-radius: 11px;
}

.auth-status {
  grid-row: 3;
  min-height: 22px;
}

.auth-form {
  grid-row: 4;
  gap: 14px;
}

.auth-form label {
  color: rgba(60, 60, 67, 0.76);
  font-weight: 650;
}

.auth-form input {
  height: 46px;
  border-radius: 13px;
  padding: 0 14px;
  font-size: 14px;
}

.auth-submit {
  height: 44px;
  margin-top: 6px;
  border-radius: 13px;
  font-size: 14px;
}

@media (max-width: 980px) {
  .topbar-main,
  .tabs,
  .quick-stats,
  main,
  .auth-shell {
    width: 100%;
  }

  .topbar-main {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 12px 8px;
  }

  .topbar-main > div:first-child {
    grid-template-columns: 40px minmax(0, 1fr);
    min-width: 0;
  }

  .topbar-main > div:first-child::before {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .meta {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .auth-shell {
    min-height: calc(100svh - 78px);
    padding: 22px 12px 30px;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
    padding: 20px;
    border-radius: 24px;
  }

  .auth-copy,
  .auth-tabs,
  .auth-status,
  .auth-form {
    grid-column: 1;
    grid-row: auto;
  }

  .auth-copy {
    grid-row: auto;
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 0;
    padding: 4px 2px 8px;
    column-gap: 14px;
    align-items: center;
  }

  .auth-copy::before {
    width: 92px;
  }

  .auth-copy::after {
    content: none;
  }

  .auth-copy h2 {
    margin-top: 0;
    font-size: 26px;
    line-height: 1.08;
    transform: none;
  }

  .auth-copy p {
    margin-top: 8px;
    font-size: 14px;
    transform: none;
  }

  .admin-shell {
    width: 100%;
    padding: 12px;
  }

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

  .admin-panel {
    padding: 12px;
  }

  .admin-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-copy h2 {
    font-size: 24px;
  }

  .tabs {
    width: calc(100% - 24px);
    padding: 4px;
    margin-top: 6px;
    margin-bottom: 12px;
  }

  .quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 12px 12px;
  }

  main {
    padding: 0 12px 18px;
  }

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

  .today-focus-panel {
    position: static;
    min-height: 0;
  }

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

  .viewer-shell {
    height: min(92vh, 920px);
  }

  .viewer-topbar,
  .viewer-stage {
    gap: 10px;
  }

  .viewer-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .viewer-actions {
    flex-wrap: wrap;
  }

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

  .viewer-nav {
    width: 100%;
    height: 38px;
    border-radius: 10px;
  }

  .viewer-nav-prev {
    order: 2;
  }

  .viewer-canvas {
    min-height: 320px;
  }

  .viewer-nav-next {
    order: 3;
  }
}
