:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e9f2;
  --border-strong: #d7deea;
  --text: #1e2533;
  --muted: #6b7688;
  --muted-2: #94a0b4;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --success: #047857;
  --success-soft: #ecfdf5;
  --warning: #b45309;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.07);
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --ring: 0 0 0 3px rgba(79, 70, 229, 0.16);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

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

button {
  font: inherit;
}

.app-root {
  min-height: 100vh;
}

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #4f46e5 55%, #7c3aed);
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.32);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

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

.nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  user-select: none;
}

.avatar.avatar-sm {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.avatar.avatar-lg {
  width: 54px;
  height: 54px;
  font-size: 20px;
}

/* ---------------------------------------------------------------- 布局 */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px 72px;
}

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

.page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

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

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar .spacer {
  flex: 1;
}

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  white-space: nowrap;
  background: transparent;
  color: var(--text);
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #5b54f0, #4f46e5);
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
}

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

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

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-soft:hover {
  background: #e3e8ff;
}

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

.btn-danger-soft:hover {
  background: #ffe4e4;
}

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

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

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

/* ---------------------------------------------------------------- 表单 */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field > label {
  font-size: 12.5px;
  font-weight: 600;
  color: #3d4759;
}

.field .hint {
  font-size: 12px;
  color: var(--muted-2);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}

textarea {
  resize: vertical;
  min-height: 90px;
}

select {
  cursor: pointer;
}

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

.form-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin: 4px 0 12px;
  display: none;
}

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

/* ---------------------------------------------------------------- 认证页 */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
}

.auth-art {
  position: relative;
  overflow: hidden;
  padding: 56px;
  display: flex;
  align-items: center;
  background: radial-gradient(circle at 18% 18%, #6d63f5 0, transparent 42%),
    radial-gradient(circle at 88% 78%, #8b5cf6 0, transparent 40%),
    linear-gradient(140deg, #312e81, #4338ca 48%, #5b21b6);
  color: #fff;
}

.auth-art::before,
.auth-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.auth-art::before {
  width: 420px;
  height: 420px;
  right: -140px;
  top: -120px;
}

.auth-art::after {
  width: 280px;
  height: 280px;
  left: -100px;
  bottom: -90px;
}

.auth-art-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.auth-art .brand {
  color: #fff;
  margin-bottom: 46px;
}

.auth-art .brand-mark {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: none;
}

.auth-art h1 {
  font-size: 34px;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.auth-art .lead {
  margin-top: 16px;
  font-size: 14.5px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.78);
}

.auth-points {
  list-style: none;
  padding: 0;
  margin: 34px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.9);
}

.auth-points .dot-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-card .auth-brand-mobile {
  display: none;
}

.auth-card h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.auth-card .auth-sub {
  color: var(--muted);
  margin: 6px 0 26px;
  font-size: 13.5px;
}

.auth-switch {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.auth-note {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: #4338ca;
  font-size: 12.5px;
  line-height: 1.6;
}

.auth-footer {
  margin-top: 34px;
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

/* ---------------------------------------------------------------- 统计 */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

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

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

.stat-tile .value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.stat-tile .value small {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-2);
  margin-left: 2px;
}

.stat-tile.is-danger .value {
  color: var(--danger);
}

/* ---------------------------------------------------------------- 任务 */
.tabs {
  display: inline-flex;
  gap: 2px;
  background: #e9edf5;
  border-radius: 999px;
  padding: 3px;
}

.tabs button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.tabs button:hover {
  color: var(--text);
}

.tabs button.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.filter-select {
  width: auto;
  padding: 7px 30px 7px 11px;
  font-size: 12.5px;
  border-radius: 999px;
  background: var(--surface);
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
  align-items: start;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.18s, border-color 0.18s;
}

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

.task-card.is-overdue {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff7f7, #fff 45%);
  box-shadow: inset 3px 0 0 #ef4444, var(--shadow-sm);
}

.task-card.is-done {
  background: linear-gradient(180deg, #fbfdfb, #fff);
  box-shadow: inset 3px 0 0 #a7f3d0, var(--shadow-sm);
}

.task-card.is-done .task-title,
.task-card.is-done .task-content {
  color: var(--muted-2);
}

.task-card.is-done .task-title {
  text-decoration: line-through;
  text-decoration-color: #cbd5e1;
}

.task-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.task-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
  flex: 1;
}

.task-content {
  color: #4a5568;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-content.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
}

.content-toggle {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  padding: 0;
  cursor: pointer;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.task-meta .deadline {
  font-weight: 600;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.task-meta .deadline.is-overdue {
  color: var(--danger);
}

.due-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}

.due-badge.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.due-badge.is-warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.due-badge.is-done {
  background: var(--success-soft);
  color: var(--success);
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.task-actions .spacer {
  flex: 1;
}

.auto-status-hint {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
}

.subtask-panel {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subtask-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.subtask-summary-label {
  font-weight: 700;
  color: #475569;
}

.subtask-summary-count {
  font-size: 11.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.subtask-progress {
  flex: 1;
  min-width: 70px;
  height: 5px;
  background: #edf1f7;
  border-radius: 999px;
  overflow: hidden;
}

.subtask-progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #818cf8, #6366f1);
  transition: width 0.3s ease;
}

.subtask-add {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  white-space: nowrap;
}

.subtask-add:hover {
  color: var(--primary-dark);
}

.subtask-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-2);
}

.subtask-item.status-doing {
  background: #f5f8ff;
}

.subtask-item.status-done {
  background: #f4fbf7;
}

.subtask-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: #334155;
  overflow-wrap: anywhere;
}

.subtask-item.status-done .subtask-name {
  color: var(--muted-2);
  text-decoration: line-through;
  text-decoration-color: #cbd5e1;
}

.subtask-select {
  width: auto;
  padding: 3px 22px 3px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background-color: #eef2f7;
  cursor: pointer;
  flex-shrink: 0;
}

.subtask-select.status-doing {
  background-color: #e0eaff;
  color: #1d4ed8;
}

.subtask-select.status-done {
  background-color: #dcfce7;
  color: var(--success);
}

.subtask-select:disabled {
  opacity: 0.6;
  cursor: wait;
}

.subtask-remove {
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  flex-shrink: 0;
}

.subtask-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.subtask-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.subtask-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.subtask-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.subtask-input-row input {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
}

.status-readonly {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: #4338ca;
  font-size: 13px;
  font-weight: 600;
}

.status-readonly-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: #6366f1;
  font-weight: 500;
}

.segmented {
  display: inline-flex;
  gap: 2px;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 3px;
}

.segmented button {
  border: 0;
  background: transparent;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.segmented button:hover:not(:disabled) {
  color: var(--text);
}

.segmented button.is-active {
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.segmented button.is-active[data-status="pending"] {
  color: #475569;
}

.segmented button.is-active[data-status="doing"] {
  color: #1d4ed8;
}

.segmented button.is-active[data-status="done"] {
  color: var(--success);
}

.segmented button:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* 状态标签 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

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

.pill-pending {
  background: #f1f5f9;
  color: #475569;
}

.pill-doing {
  background: #eff6ff;
  color: #1d4ed8;
}

.pill-done {
  background: var(--success-soft);
  color: var(--success);
}

/* 时间线 */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline li {
  position: relative;
  padding: 0 0 16px 22px;
  font-size: 12.5px;
  color: #475569;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c7d2fe;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #c7d2fe;
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 17px;
  bottom: 1px;
  width: 2px;
  background: #eef2ff;
}

.timeline li:last-child {
  padding-bottom: 2px;
}

.timeline li:last-child::after {
  display: none;
}

.timeline .tl-time {
  display: block;
  color: var(--muted-2);
  font-size: 11.5px;
  margin-top: 1px;
}

.timeline .tl-note {
  display: block;
  margin-top: 4px;
  padding: 6px 10px;
  background: var(--surface-2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.task-timeline {
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}

.task-timeline .timeline-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.task-events-count {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 2px;
  text-decoration: underline;
  text-decoration-color: #cbd5e1;
  text-underline-offset: 2px;
}

.task-events-count:hover {
  color: var(--primary);
}

/* ---------------------------------------------------------------- 成员 */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
  align-items: start;
}

.member-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.18s, border-color 0.18s;
}

.member-panel:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

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

.member-panel-head .panel-link {
  margin-left: auto;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.member-panel-head .panel-link:hover {
  color: var(--primary-dark);
}

.member-panel-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-names {
  min-width: 0;
  flex: 1;
}

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

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  flex-shrink: 0;
}

.badge.badge-me {
  background: var(--primary-soft);
  color: var(--primary);
}

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

.progress {
  flex: 1;
  height: 8px;
  background: #edf1f7;
  border-radius: 999px;
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.4s ease;
}

.progress.is-low > i {
  background: linear-gradient(90deg, #f59e0b, #f97316);
}

.progress.is-full > i {
  background: linear-gradient(90deg, #10b981, #059669);
}

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

.member-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--muted);
}

.member-stats b {
  color: #334155;
  font-weight: 700;
}

.member-stats .danger {
  color: var(--danger);
}

.task-lists {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}

.task-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.task-section-head h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.2px;
}

.task-section.is-complete .task-section-head h4 {
  color: var(--muted-2);
}

.task-section-count {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.overview-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.overview-task {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--surface-2);
}

.overview-task-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.overview-task.is-overdue {
  background: var(--danger-soft);
}

.overview-task.is-done {
  background: transparent;
  padding: 4px 9px 4px 2px;
}

.overview-task-title {
  flex: 1;
  min-width: 120px;
  font-size: 12.5px;
  color: #334155;
  overflow-wrap: anywhere;
}

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

.overview-task-time {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.overview-task-time.is-overdue {
  color: var(--danger);
  font-weight: 600;
}

.overview-subtasks-label {
  color: var(--muted-2);
  font-size: 10.5px;
  padding-left: 2px;
}

.overview-subtasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
}

.overview-subtasks > li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: #475569;
  min-width: 0;
}

.overview-subtask-title {
  overflow-wrap: anywhere;
}

.mini-status {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.mini-status.is-doing {
  background: #e0eaff;
  color: #1d4ed8;
}

.mini-status.is-done {
  background: #dcfce7;
  color: #047857;
}

.task-section-empty {
  color: var(--muted-2);
  font-size: 12px;
  padding: 2px 2px 0;
}

.task-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
}

.pill.pill-tiny {
  padding: 2px 8px;
  font-size: 10.5px;
  gap: 5px;
}

.pill.pill-tiny::before {
  width: 5px;
  height: 5px;
}

/* 成员详情 */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

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

.member-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.member-hero .member-names {
  flex: 1;
  min-width: 160px;
}

.member-hero .progress-row {
  width: 100%;
}

.member-hero-stats {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.member-hero-stats .stat {
  display: flex;
  flex-direction: column;
}

.member-hero-stats .stat b {
  font-size: 19px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

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

/* ---------------------------------------------------------------- 管理员 */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.panel-sub {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 18px;
}

.invite-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.invite-form .field {
  margin-bottom: 0;
  min-width: 120px;
}

.invite-form .field.note-field {
  flex: 1;
  min-width: 200px;
}

.code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-soft);
  border: 1px dashed #c7d2fe;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #3730a3;
}

.code-chip .copy-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 680px;
}

.data-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-2);
  letter-spacing: 0.4px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.6px;
  font-weight: 700;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
}

.status-tag.is-active {
  background: var(--success-soft);
  color: var(--success);
}

.status-tag.is-used {
  background: #f1f5f9;
  color: #94a3b8;
}

.status-tag.is-revoked {
  background: var(--danger-soft);
  color: var(--danger);
}

.mini-note {
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 12px;
  line-height: 1.7;
}

.mini-note code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11.5px;
}

/* ---------------------------------------------------------------- 空状态 / 加载 */
.empty {
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  padding: 46px 24px;
  text-align: center;
  color: var(--muted);
}

.empty .empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 24px;
}

.empty h3 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}

.empty p {
  font-size: 13px;
}

.skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
}

.skeleton-card {
  height: 190px;
  border-radius: var(--radius-lg);
}

/* ---------------------------------------------------------------- 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 18px 24px;
  overflow-y: auto;
  animation: overlay-in 0.16s ease;
}

.modal {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.28);
  animation: modal-in 0.18s ease;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-head h3 {
  font-size: 18px;
  font-weight: 800;
  flex: 1;
}

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

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

.confirm-text {
  color: #475569;
  font-size: 13.5px;
  line-height: 1.8;
}

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

@keyframes overlay-in {
  from {
    opacity: 0;
  }
}

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

/* ---------------------------------------------------------------- 提示 */
.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 340px;
  padding: 11px 16px;
  border-radius: 12px;
  background: #1e293b;
  color: #f8fafc;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  animation: toast-in 0.2s ease;
  pointer-events: auto;
}

.toast .toast-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  background: #22c55e;
  color: #052e16;
  flex-shrink: 0;
  font-weight: 800;
}

.toast.is-error .toast-icon {
  background: #ef4444;
  color: #fff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 900px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-art {
    display: none;
  }

  .auth-card .auth-brand-mobile {
    display: inline-flex;
    margin-bottom: 28px;
  }

  .auth-form-wrap {
    padding: 48px 24px;
  }

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

@media (max-width: 720px) {
  .topbar-inner {
    padding: 0 16px;
    gap: 14px;
    height: 58px;
  }

  .brand-text {
    display: none;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 13px;
  }

  .user-name {
    display: none;
  }

  .container {
    padding: 22px 16px 60px;
  }

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

  .task-grid,
  .member-grid,
  .loading-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    gap: 10px;
  }

  .tabs {
    overflow-x: auto;
    max-width: 100%;
  }

  .tabs button {
    padding: 6px 11px;
  }

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

  .member-hero {
    padding: 18px;
  }

  .invite-form .field,
  .invite-form .field.note-field {
    width: 100%;
  }

  .toast-root {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 420px) {
  .stat-strip {
    grid-template-columns: 1fr;
  }
}
