﻿/* ==========================================================================
   工作流管家 · 样式
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #edf1f8;
  --text: #111827;
  --text-2: #48546a;
  --muted: #6b7789;
  --border: #e6eaf2;
  --border-strong: #d6dce8;
  --accent: #2f6fed;
  --accent-2: #1f55cf;
  --accent-soft: #eaf0ff;
  --danger: #e0403f;
  --danger-soft: #fdeceb;
  --warn: #d98510;
  --warn-soft: #fff4e0;
  --ok: #14914f;
  --ok-soft: #e6f7ee;
  --purple: #7c4ddb;
  --purple-soft: #f2ecfd;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 2px 4px rgba(16, 24, 40, 0.04), 0 14px 30px -18px rgba(16, 24, 40, 0.28);
  --shadow-lg: 0 24px 60px -12px rgba(16, 24, 40, 0.35);
  --sidebar-w: 252px;
}

[data-theme='dark'] {
  --bg: #0d1117;
  --surface: #151b24;
  --surface-2: #1a212b;
  --surface-3: #222b38;
  --text: #e9edf4;
  --text-2: #b3bfd0;
  --muted: #8793a5;
  --border: #232c39;
  --border-strong: #33404f;
  --accent: #5f8dff;
  --accent-2: #7ba2ff;
  --accent-soft: #1a2640;
  --danger: #ff7070;
  --danger-soft: #3a1e20;
  --warn: #f0b24a;
  --warn-soft: #392b12;
  --ok: #4ecb87;
  --ok-soft: #142f22;
  --purple: #a98bff;
  --purple-soft: #241d3a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 18px 36px -20px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d1117;
    --surface: #151b24;
    --surface-2: #1a212b;
    --surface-3: #222b38;
    --text: #e9edf4;
    --text-2: #b3bfd0;
    --muted: #8793a5;
    --border: #232c39;
    --border-strong: #33404f;
    --accent: #5f8dff;
    --accent-2: #7ba2ff;
    --accent-soft: #1a2640;
    --danger: #ff7070;
    --danger-soft: #3a1e20;
    --warn: #f0b24a;
    --warn-soft: #392b12;
    --ok: #4ecb87;
    --ok-soft: #142f22;
    --purple: #a98bff;
    --purple-soft: #241d3a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 18px 36px -20px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12.5px;
}

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

.hidden {
  display: none !important;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ 骨架 */

#app {
  display: flex;
  min-height: 100vh;
}

.splash {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.splash-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(140deg, #5b8cff, #2f6fed 60%, #1b3fa8);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --------------------------------------------------------------- 侧边栏 */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, #5b8cff, #2f6fed 60%, #1b3fa8);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px -6px rgba(47, 111, 237, 0.9);
}

.brand-mark .icon {
  width: 19px;
  height: 19px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.brand-text strong {
  font-size: 14.5px;
  letter-spacing: 0.01em;
}

.brand-text span {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--text-2);
  font-weight: 500;
  font-size: 13.5px;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-item .icon {
  width: 17px;
  height: 17px;
}

.side-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.side-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.side-new:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.side-new .icon {
  width: 15px;
  height: 15px;
}

.side-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0 10px 4px;
  text-transform: uppercase;
}

.side-projects {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  padding-bottom: 4px;
}

.side-project {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 13px;
}

.side-project:hover {
  background: var(--surface-2);
  color: var(--text);
}

.side-project.active {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}

.side-project span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-project em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex: 0 0 auto;
}

.side-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 10px;
}

.side-footer {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.user-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.user-card:hover {
  background: var(--surface-2);
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.user-meta b {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta span {
  font-size: 11px;
  color: var(--muted);
}

.user-more {
  color: var(--muted);
  width: 16px;
  height: 16px;
}

/* ----------------------------------------------------------------- 主体 */

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 240px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  color: var(--muted);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-box .icon {
  width: 16px;
  height: 16px;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn.tiny {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}

.icon-btn.tiny .icon {
  width: 15px;
  height: 15px;
}

.icon-btn.danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.bell-badge {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.avatar-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
}

.view {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 26px 90px;
}

/* --------------------------------------------------------------- 页面头 */

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

.page-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.page-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.btn:active {
  transform: translateY(1px);
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(20, 60, 160, 0.25);
}

.btn-primary:hover {
  background: var(--accent-2);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-2);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

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

.btn-danger-solid {
  background: var(--danger);
  color: #fff;
}

.btn-danger-solid:hover {
  filter: brightness(0.94);
}

.confirm-text {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.btn-danger.btn-ghost:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11.5px;
  border-radius: 7px;
}

.btn-block {
  width: 100%;
}

/* --------------------------------------------------------------- 卡片 */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

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

.section-title {
  font-size: 14.5px;
  font-weight: 650;
}

.count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 4px;
}

.link-muted {
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
}

.link-muted:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------ 统计卡片 */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 15px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.stat::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.stat-red::before {
  background: var(--danger);
}

.stat-amber::before {
  background: var(--warn);
}

.stat-green::before {
  background: var(--ok);
}

.stat-blue::before {
  background: var(--accent);
}

.stat-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.stat-value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.stat-hint {
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 工作台 */

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

.dash-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-group + .task-group {
  margin-top: 10px;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 8px 4px;
  letter-spacing: 0.02em;
}

.group-count {
  font-size: 11px;
  background: var(--surface-3);
  border-radius: 999px;
  padding: 0 6px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s;
}

.task-row:hover {
  background: var(--surface-2);
}

.check-btn {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.check-btn:hover {
  border-color: var(--ok);
}

.check-btn.checked {
  background: var(--ok);
  border-color: var(--ok);
}

.check-btn.checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

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

.task-title {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.is-done .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.task-project,
.task-stage {
  font-size: 11.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-project .dot {
  width: 6px;
  height: 6px;
}

.task-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.due {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.due .icon {
  width: 13px;
  height: 13px;
}

.due-overdue {
  color: var(--danger);
  font-weight: 650;
}

.due-today {
  color: var(--warn);
  font-weight: 650;
}

.due-soon {
  color: var(--text-2);
}

.due-muted {
  color: var(--muted);
}

.prio-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

.prio-urgent {
  background: var(--danger-soft);
  color: var(--danger);
}

.prio-high {
  background: var(--warn-soft);
  color: var(--warn);
}

.prio-normal,
.prio-low {
  background: var(--surface-3);
  color: var(--muted);
}

/* ------------------------------------------------------------ 进度条 */

.progress {
  display: block;
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  flex: 1;
  min-width: 40px;
}

.progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #5b8cff);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.progress-lg {
  height: 9px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-num {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

.mini-projects {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-project {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-decoration: none;
  color: inherit;
  padding: 6px;
  margin: -6px;
  border-radius: 9px;
}

.mini-project:hover {
  background: var(--surface-2);
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.mini-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-pct {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.mini-hint {
  font-size: 11.5px;
  color: var(--muted);
}

.feed {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feed-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.feed-body {
  min-width: 0;
}

.feed-text {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
  word-break: break-word;
}

.feed-time {
  font-size: 11px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 清单视图 */

.list-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.list-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.list-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.list-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 650;
}

.list-group-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  min-width: 200px;
}

.list-group-meta .progress {
  max-width: 110px;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
}

.list-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
}

.list-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

.list-table tr:last-child td {
  border-bottom: none;
}

.list-row {
  cursor: pointer;
}

.list-row:hover {
  background: var(--surface-2);
}

.list-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.list-name {
  font-size: 13px;
  word-break: break-word;
}

.list-name.editable {
  cursor: text;
  border-bottom: 1px dashed transparent;
  padding: 1px 0;
}

.list-name.editable:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.inline-title-input {
  flex: 1;
  min-width: 120px;
  padding: 4px 8px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.list-row.is-done .list-name {
  color: var(--muted);
  text-decoration: line-through;
}

.list-table th:nth-child(2),
.list-table td:nth-child(2) {
  width: 150px;
}

.list-table th:nth-child(3),
.list-table td:nth-child(3) {
  width: 96px;
}

.list-table th:nth-child(4),
.list-table td:nth-child(4) {
  width: 108px;
}

.list-add-row td {
  padding: 8px 10px;
}

.list-add-row .add-task-btn {
  width: 100%;
}

@media (max-width: 700px) {
  .list-table th:nth-child(3),
  .list-table td:nth-child(3) {
    display: none;
  }

  .list-table th,
  .list-table td {
    padding: 8px 10px;
  }

  .list-table th:nth-child(2),
  .list-table td:nth-child(2),
  .list-table th:nth-child(4),
  .list-table td:nth-child(4) {
    width: 94px;
  }

  .select-mini {
    max-width: 94px;
  }

  .list-group-meta {
    min-width: 0;
    width: 100%;
  }
}

.blocked-chip {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ------------------------------------------------------------ 项目列表 */

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: var(--border-strong);
}

.filter-chip.active {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.project-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-name {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
}

.project-desc {
  font-size: 12.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.project-count {
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 标签 */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  line-height: 1.6;
}

.status-todo {
  background: var(--surface-3);
  color: var(--text-2);
}

.status-doing {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-review {
  background: var(--purple-soft);
  color: var(--purple);
}

.status-done {
  background: var(--ok-soft);
  color: var(--ok);
}

.p-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.p-paused {
  background: var(--warn-soft);
  color: var(--warn);
}

.p-done {
  background: var(--ok-soft);
  color: var(--ok);
}

.p-archived {
  background: var(--surface-3);
  color: var(--muted);
}

/* ------------------------------------------------------------ 项目详情 */

.project-head-main {
  min-width: 0;
}

.project-head .page-sub {
  max-width: 720px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 6px;
}

.back-link:hover {
  color: var(--accent);
}

.back-link .icon {
  width: 15px;
  height: 15px;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.summary-progress {
  min-width: 0;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.summary-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

.summary-value {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border-radius: 10px;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.board {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  overflow-x: auto;
  padding: 2px 2px 18px;
  scroll-snap-type: x proximity;
}

.board-status .column {
  flex-basis: 280px;
}

.column {
  flex: 0 0 292px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 300px);
  min-height: 160px;
  scroll-snap-align: start;
}

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

.column-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  min-width: 0;
}

.column-title > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.status-todo {
  background: #94a3b8;
}

.status-dot.status-doing {
  background: var(--accent);
}

.status-dot.status-review {
  background: var(--purple);
}

.status-dot.status-done {
  background: var(--ok);
}

.column-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 10px;
}

.column-due {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.column-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  min-height: 60px;
  padding: 2px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 12px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.task-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.task-card:active {
  transform: scale(0.995);
}

.task-card.dragging {
  opacity: 0.45;
}

.task-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}

.task-card-stage {
  font-size: 10.5px;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 5px;
  padding: 1px 5px;
}

.task-card-done {
  margin-left: auto;
  color: var(--ok);
  display: flex;
}

.task-card-done .icon {
  width: 15px;
  height: 15px;
}

.task-card-title {
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.task-card.is-done .task-card-title {
  color: var(--muted);
  text-decoration: line-through;
}

.task-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.add-task-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px;
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.add-task-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.add-task-btn .icon {
  width: 14px;
  height: 14px;
}

.drop-hint {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: var(--accent-soft);
}

/* ------------------------------------------------------------ 任务列表 */

.filters {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px;
  margin-bottom: 14px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 190px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-field .input {
  border: none;
  padding: 9px 0;
  background: transparent;
  box-shadow: none;
}

.search-field .icon {
  width: 16px;
  height: 16px;
}

.filters .select {
  width: auto;
  min-width: 118px;
}

.task-list-card {
  padding: 8px 12px;
}

/* ------------------------------------------------------------ 团队 */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.member-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.member-info {
  min-width: 0;
}

.member-name {
  font-size: 14px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-title {
  font-size: 12px;
  color: var(--muted);
}

.member-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  text-align: center;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 9px 4px;
}

.member-stats div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.member-stats b {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.member-stats span {
  font-size: 10.5px;
  color: var(--muted);
}

.load-bar {
  display: flex;
}

.member-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.member-link:hover {
  color: var(--accent);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  margin-bottom: 16px;
  background: var(--warn-soft);
  border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
}

.notice .icon {
  color: var(--warn);
  margin-top: 1px;
  width: 16px;
  height: 16px;
}

.notice-link {
  text-decoration: none;
  color: var(--text-2);
  transition: background 0.15s;
}

.notice-link:hover {
  background: color-mix(in srgb, var(--warn-soft) 65%, var(--surface));
}

.notice-action {
  margin-left: auto;
  color: var(--accent);
  font-weight: 650;
  white-space: nowrap;
}

.select-mini {
  width: auto;
  max-width: 126px;
  padding: 3px 22px 3px 8px;
  font-size: 11.5px;
  border-radius: 8px;
  background-position: calc(100% - 12px) 52%, calc(100% - 7px) 52%;
}

.report-card {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.rate {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.rate b {
  font-size: 21px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.rate span {
  font-size: 10.5px;
  color: var(--muted);
}

.member-extra {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}

.report-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 650;
  margin-top: 2px;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 6px;
}

.report-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.report-stats b {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.report-stats span {
  font-size: 11px;
  color: var(--muted);
}

.report-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
}

.report-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.report-list li:last-child {
  border-bottom: none;
}

.report-list time {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.report-item-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.report-item-main em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.report-icon.done {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.report-icon.done .icon {
  width: 12px;
  height: 12px;
}

.role-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--muted);
}

.role-tag.admin {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ------------------------------------------------------------ 管理页 */

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.stack-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

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

.inline-field .input {
  flex: 1;
}

.hint {
  font-size: 11.5px;
  color: var(--muted);
}

.template-card {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.template-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.template-card-head b {
  font-size: 13px;
}

.template-card-head span {
  font-size: 11.5px;
  color: var(--muted);
}

.template-preview {
  font-size: 11.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 7px 9px;
  line-height: 1.6;
  margin: 0;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.cell-user {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cell-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cell-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.cell-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}

/* ------------------------------------------------------------ 表单 */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.label {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 49%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 51%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.55;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-static {
  font-size: 12.5px;
  color: var(--text-2);
  padding: 9px 0;
}

.form-error {
  display: none;
  margin: 0;
  font-size: 12.5px;
  color: var(--danger);
}

.form-error.visible {
  display: block;
}

.form-tip {
  font-size: 12.5px;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: 9px;
  padding: 8px 10px;
  margin: 0;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.credential {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-size: 15px;
}

.credential code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.member-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  background: var(--surface-2);
}

.member-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.member-option input {
  display: none;
}

/* ------------------------------------------------------------ 头像 */

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--avatar, #64748b);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
  border: 2px solid var(--surface);
  overflow: hidden;
}

.avatar-xs {
  width: 22px;
  height: 22px;
  font-size: 9.5px;
  border-width: 1.5px;
}

.avatar-sm {
  width: 27px;
  height: 27px;
  font-size: 10px;
  border-width: 1.5px;
}

.avatar-lg {
  width: 46px;
  height: 46px;
  font-size: 15px;
}

.avatar-empty {
  background: var(--surface-3);
  color: var(--muted);
}

.avatar-more {
  background: var(--surface-3);
  color: var(--muted);
  font-size: 9px;
}

.avatar-stack {
  display: inline-flex;
  align-items: center;
}

.avatar-stack .avatar + .avatar {
  margin-left: -7px;
}

/* ------------------------------------------------------------ 空状态 */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 34px 18px;
  text-align: center;
}

.empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.empty-text {
  font-size: 14px;
  font-weight: 600;
}

.empty-hint {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 380px;
}

.empty .btn {
  margin-top: 8px;
}

/* -------------------------------------------------------- 安装到主屏幕 */

.install-banner {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(120deg, var(--accent-soft), transparent 70%);
}

@media (max-width: 900px) {
  .install-banner {
    display: flex;
  }
}

.install-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.install-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.install-text b {
  font-size: 12.5px;
}

.install-text span {
  font-size: 11px;
  color: var(--muted);
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: step;
}

.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-2);
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 1px;
}

.steps .icon {
  width: 15px;
  height: 15px;
  vertical-align: -3px;
}

/* ------------------------------------------------------------ 弹窗 */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  animation: fade 0.14s ease;
}

.modal {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal-md {
  max-width: 600px;
}

.modal-lg {
  max-width: 720px;
}

.modal-sm {
  max-width: 420px;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.modal-head-main {
  flex: 1;
  min-width: 0;
}

.modal-kicker {
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0.03em;
}

.title-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
  padding: 2px 0;
  outline: none;
  border-bottom: 1px dashed transparent;
}

.title-input:hover {
  border-bottom-color: var(--border-strong);
}

.title-input:focus {
  border-bottom-color: var(--accent);
}

.modal-title {
  font-size: 17px;
  font-weight: 650;
}

.modal-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-height: 0;
}

/* 表单直接包住 body + foot 时，让表单自己成为可伸缩的列，否则底部按钮会被挤出弹窗 */
.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal > form > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
}

.modal-head,
.modal-foot {
  flex: 0 0 auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.foot-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

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

/* ------------------------------------------------------------ 评论 */

.comments {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.comment {
  display: flex;
  gap: 8px;
}

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

.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.comment-body {
  font-size: 13px;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 2px;
}

.comment-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 10px;
}

.comment-form .textarea {
  flex: 1;
  min-height: 42px;
}

/* ------------------------------------------------------------ 通知/搜索面板 */

.panel {
  position: fixed;
  top: 60px;
  right: 18px;
  width: 372px;
  max-height: min(560px, 72vh);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  padding: 8px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

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

.panel-head h3 {
  font-size: 13.5px;
  font-weight: 650;
  display: flex;
  align-items: center;
}

.panel-empty {
  padding: 20px 10px;
  text-align: center;
}

.panel-group-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 6px 8px 3px;
  text-transform: uppercase;
}

.notif-item {
  position: relative;
  width: 100%;
  display: flex;
  gap: 8px;
  padding: 9px 8px;
  border: none;
  background: transparent;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.notif-item:hover {
  background: var(--surface-2);
}

.notif-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  margin-top: 6px;
  flex: 0 0 auto;
}

.notif-item.unread .notif-dot {
  background: var(--accent);
}

.notif-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.notif-title {
  font-size: 12.5px;
  font-weight: 600;
}

.notif-body {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-time {
  font-size: 10.5px;
  color: var(--muted);
}

.search-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
}

.search-item:hover {
  background: var(--surface-2);
}

.search-icon {
  color: var(--muted);
  display: flex;
}

.search-icon .icon {
  width: 16px;
  height: 16px;
}

.search-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ------------------------------------------------------------ 登录页 */

.auth {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, var(--purple-soft), transparent 55%);
}

.auth-card {
  width: 100%;
  max-width: 396px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.auth-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.auth-sub {
  font-size: 12px;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-3);
  border-radius: 11px;
  margin: 20px 0 16px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-foot {
  margin-top: 16px;
  text-align: center;
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------ 提示 */

#toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #111827;
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 86vw;
  text-align: center;
}

.toast-in {
  opacity: 1;
  transform: none;
}

.toast-err {
  background: var(--danger);
}

/* ------------------------------------------------------------ 底部导航 */

.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  font-size: 10.5px;
  color: var(--muted);
  text-decoration: none;
}

.tab-item .icon {
  width: 21px;
  height: 21px;
}

.tab-item.active {
  color: var(--accent);
  font-weight: 600;
}

/* ------------------------------------------------------------ 响应式 */

@media (max-width: 1080px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    height: 56px;
    padding: 0 14px;
  }

  .search-box {
    display: none;
  }

  .view {
    padding: 16px 14px 96px;
  }

  .tabbar {
    display: flex;
  }

  .page-title {
    font-size: 20px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat {
    padding: 12px 13px;
  }

  .stat-value {
    font-size: 23px;
  }

  .board {
    margin: 0 -14px;
    padding: 2px 14px 18px;
    scroll-snap-type: x mandatory;
  }

  .column {
    flex: 0 0 84vw;
    max-height: none;
  }

  .column-body {
    overflow-y: visible;
  }

  .panel {
    left: 12px;
    right: 12px;
    width: auto;
    top: 58px;
    max-height: 68vh;
  }

  #toast-root {
    bottom: 82px;
  }

  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    max-width: none;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    animation: sheet 0.2s ease;
  }

  .modal-sm,
  .modal-md,
  .modal-lg {
    max-width: none;
  }

  @keyframes sheet {
    from {
      transform: translateY(30px);
      opacity: 0.6;
    }
  }

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

  .project-summary {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .project-summary .summary-progress {
    grid-column: 1 / -1;
  }

  .team-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .board-toolbar {
    margin-bottom: 10px;
  }

  .filters .select,
  .search-field {
    flex: 1 1 140px;
    width: auto;
  }

  .table th:nth-child(4),
  .table td:nth-child(4),
  .table th:nth-child(5),
  .table td:nth-child(5) {
    display: none;
  }
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .report-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

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

  .project-summary {
    padding: 14px;
  }

  .modal-foot {
    padding: 10px 14px;
  }

  .modal-body,
  .modal-head {
    padding-left: 14px;
    padding-right: 14px;
  }

  .member-picker {
    max-height: 140px;
    overflow-y: auto;
  }
}

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

/* --------------------------------------------------------------------------
   树视图：项目 → 环节 → 任务
   -------------------------------------------------------------------------- */

.tree {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tree-root-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.tree-root-icon {
  display: inline-flex;
  color: var(--accent);
}

.tree-root-name {
  font-size: 14px;
  font-weight: 700;
}

.tree-root-meta {
  font-size: 12px;
  color: var(--muted);
}

.tree-root-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-width: 150px;
}

.tree-root-progress .progress {
  width: 92px;
  flex: none;
}

.tree-children {
  display: flex;
  flex-direction: column;
}

.tree-stage {
  border-top: 1px solid var(--border);
}

.tree-stage:first-child {
  border-top: 0;
}

.tree-stage-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tree-stage-head::-webkit-details-marker {
  display: none;
}

.tree-stage-head:hover {
  background: var(--surface-2);
}

.tree-caret {
  display: inline-flex;
  color: var(--muted);
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
}

.tree-stage[open] > .tree-stage-head .tree-caret {
  transform: rotate(0deg);
}

.tree-stage-name {
  font-size: 13.5px;
  font-weight: 650;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-stage-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 130px;
}

.tree-stage-progress .progress {
  width: 84px;
  flex: none;
}

.tree-stage-due {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}

.tree-tasks {
  position: relative;
  padding: 2px 12px 8px 30px;
}

.tree-tasks::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 2px;
  bottom: 12px;
  width: 1px;
  background: var(--border);
}

.tree-task {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  min-width: 0;
}

.tree-task:hover {
  background: var(--surface-2);
}

.tree-task.is-done .tree-task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.tree-task-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-task .due {
  font-size: 11.5px;
  white-space: nowrap;
}

.tree-empty {
  margin: 6px 4px;
  font-size: 12px;
  color: var(--muted);
}

.tree-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tree-stage-menu {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.tree-stage-menu:hover {
  background: var(--surface-3);
  color: var(--text);
}

@media (max-width: 640px) {
  .tree-root-progress {
    margin-left: 0;
    width: 100%;
  }

  .tree-stage-due {
    display: none;
  }

  .tree-stage-progress {
    min-width: 0;
    margin-left: auto;
  }

  .tree-stage-progress .progress {
    width: 56px;
  }

  .tree-tasks {
    padding-left: 24px;
  }

  .tree-tasks::before {
    left: 12px;
  }

  .tree-task {
    font-size: 12.5px;
    gap: 7px;
  }

  .tree-task .due.due-muted {
    display: none;
  }

  .tree-stage-head .count {
    margin-right: auto;
  }
}

/* --------------------------------------------------------------------------
   子任务（任务树）
   -------------------------------------------------------------------------- */

.tree-subtasks {
  position: relative;
  margin: 2px 0 2px 18px;
  padding-left: 14px;
  border-left: 1px dashed var(--border-strong);
}

.tree-subtasks .tree-task {
  font-size: 12.5px;
}

.tree-subtasks .tree-task-title {
  color: var(--text-2);
}

.tree-add-sub {
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.tree-task:hover .tree-add-sub,
.tree-add-sub:focus {
  opacity: 1;
}

.sub-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.task-parent {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.task-parent svg {
  width: 15px;
  height: 15px;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.subtask-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
}

.subtask-row:hover {
  background: var(--surface-2);
}

.subtask-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .tree-subtasks {
    margin-left: 10px;
    padding-left: 9px;
  }

  .tree-add-sub {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   拓扑视图（节点 + 连线）
   -------------------------------------------------------------------------- */

.graph-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  padding: 2px;
  -webkit-overflow-scrolling: touch;
}

.graph-svg {
  display: block;
  height: auto;
}

@media (max-width: 720px) {
  .graph-svg {
    width: var(--gw) !important;
    max-width: none !important;
    margin: 0 !important;
  }
}

.graph-node {
  cursor: pointer;
}

.graph-node:hover .graph-card {
  fill: #fafcff;
}

.graph-hint {
  display: none;
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .graph-hint {
    display: block;
  }
}

.graph-addsub circle {
  transition: fill 0.15s ease;
}

.graph-addsub:hover circle {
  fill: #dbe8ff;
}

.card-add-sub {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.task-card:hover .card-add-sub,
.card-add-sub:focus {
  opacity: 1;
}

@media (max-width: 640px) {
  .card-add-sub {
    opacity: 0.6;
  }
}

.foot-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-task-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  max-height: 52vh;
  overflow-y: auto;
}

.stage-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.stage-task-row:hover {
  background: var(--surface-2);
}

.stage-task-row.is-done .stage-task-name {
  color: var(--muted);
  text-decoration: line-through;
}

.stage-task-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-task-del {
  opacity: 0;
}

.stage-task-row:hover .stage-task-del {
  opacity: 1;
}

.handoff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.handoff-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  color: var(--text);
  font: inherit;
}

.handoff-btn:hover {
  border-color: var(--accent);
}

.handoff-btn.is-done {
  border-style: solid;
  border-color: var(--ok);
  background: var(--ok-soft);
}

.handoff-k {
  font-size: 12.5px;
  font-weight: 650;
}

.handoff-v {
  font-size: 11.5px;
  color: var(--muted);
}

.handoff-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.stage-chip {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.stage-chip.done {
  background: var(--ok-soft);
  color: var(--ok);
}

.stage-chip.active {
  background: var(--accent-soft);
  color: var(--accent-2);
}

.stage-chip.pending {
  background: var(--surface-3);
  color: var(--muted);
}

.tree-stage-head .stage-chip {
  margin-right: 2px;
}

.handoff-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.handoff-card.is-done {
  border-color: var(--ok);
  background: var(--ok-soft);
}

.handoff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.handoff-ok {
  font-size: 11px;
  color: var(--ok);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.handoff-card .select {
  width: 100%;
}

.subtask-del {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.subtask-row:hover .subtask-del,
.subtask-del:focus {
  opacity: 1;
}

@media (max-width: 640px) {
  .subtask-del {
    opacity: 0.55;
  }
}

.handoff-chip.todo {
  background: var(--warn-soft);
  color: var(--warn);
}

.handoff-chip.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
