:root {
  --indigo: #6366f1;
  --indigo-dark: #4f46e5;
  --indigo-soft: #eef2ff;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e6e8ee;
  --bg: #f6f7fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .09);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .18);
  --font: "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
[hidden] { display: none !important; }

/* ---------- 品牌 ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: 0 6px 16px rgba(79, 70, 229, .35);
}
.brand__name { font-weight: 700; font-size: 17px; letter-spacing: -.2px; }
.brand--light .brand__name { color: #fff; }
.brand--dark .brand__name { color: var(--ink); }
.brand--sidebar { padding: 4px 6px 22px; }
.brand--sidebar .brand__name { color: #fff; font-size: 16px; }

/* ---------- 登录 ---------- */
.auth { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }

.auth__art {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 100% at 10% 0%, #4338ca 0%, #1e1b4b 55%, #131131 100%);
  display: flex; align-items: center;
  padding: 56px 60px;
}
.auth__artInner { position: relative; z-index: 2; max-width: 460px; }
.auth__headline {
  color: #fff; font-size: 38px; line-height: 1.25; letter-spacing: -1px;
  margin: 44px 0 14px; font-weight: 700;
}
.auth__sub { color: #b9b6e8; font-size: 15px; line-height: 1.7; margin: 0 0 40px; }

.auth__glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.auth__glow--1 { width: 340px; height: 340px; background: #6366f1; top: -80px; right: -60px; }
.auth__glow--2 { width: 280px; height: 280px; background: #22d3ee; bottom: -90px; left: -40px; opacity: .28; }

.auth__preview {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding: 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .13);
  backdrop-filter: blur(6px);
}
.miniCol { display: flex; flex-direction: column; gap: 8px; }
.miniCol__title { font-size: 11px; color: #a5a1d6; letter-spacing: .4px; }
.miniCard {
  height: 46px; border-radius: 9px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .13);
}
.miniCard--sm { height: 34px; opacity: .85; }
.miniCard--accent { background: rgba(129, 140, 248, .55); border-color: rgba(165, 180, 252, .6); }
.miniCard--done { background: rgba(52, 211, 153, .22); border-color: rgba(52, 211, 153, .35); }

.auth__panel { position: relative; display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth__formWrap { width: 100%; max-width: 380px; }
.auth__title { font-size: 25px; letter-spacing: -.5px; margin: 34px 0 6px; }
.auth__hint { color: var(--muted); font-size: 14px; margin: 0 0 26px; }

.link {
  background: none; border: 0; padding: 0; color: var(--indigo);
  font-size: 14px; font-weight: 600;
}
.link:hover { color: var(--indigo-dark); text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field__control { position: relative; display: flex; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="date"], textarea, select {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-size: 14px;
  transition: border-color .16s, box-shadow .16s;
  outline: none;
}
.field__control input { padding-right: 42px; }
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
input::placeholder, textarea::placeholder { color: #98a2b3; }
input.is-invalid { border-color: #f04438; }
input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(240, 68, 56, .14); }

.field__error { font-size: 12px; color: #d92d20; min-height: 0; }
.field__error:empty { display: none; }

.ghost-icon {
  border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; border-radius: 9px;
  width: 32px; height: 32px; transition: background .15s, color .15s;
}
.ghost-icon:hover { background: #f2f4f7; color: var(--ink); }
.field__control .ghost-icon { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

.auth__row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--indigo); cursor: pointer; }

.auth__alert {
  background: #fef3f2; border: 1px solid #fecdca; color: #b42318;
  font-size: 13px; padding: 10px 12px; border-radius: 9px; margin: 0 0 14px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; padding: 10px 16px;
  transition: transform .12s, box-shadow .16s, background .16s, border-color .16s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, #6d70f5, #4f46e5);
  color: #fff; box-shadow: 0 6px 18px rgba(79, 70, 229, .28);
}
.btn--primary:hover { box-shadow: 0 8px 22px rgba(79, 70, 229, .36); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { background: #f9fafb; border-color: #d0d5dd; }
.btn--danger-ghost { background: #fff; border-color: #fecdca; color: #d92d20; }
.btn--danger-ghost:hover { background: #fef3f2; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

.auth__divider {
  display: flex; align-items: center; gap: 12px;
  color: #98a2b3; font-size: 12px; margin: 20px 0;
}
.auth__divider::before, .auth__divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.auth__legal { font-size: 12px; color: #98a2b3; line-height: 1.8; margin: 22px 0 0; text-align: center; }
.auth__legal code {
  background: #f2f4f7; padding: 1px 5px; border-radius: 4px;
  font-size: 11.5px; color: var(--ink-2);
}

/* ---------- 应用布局 ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, #1b1b3a 0%, #16162e 100%);
  padding: 22px 16px 18px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 11px; border: 0; border-radius: 9px;
  background: transparent; color: #a9a7c9; font-size: 13.5px; font-weight: 500;
  text-align: left; transition: background .15s, color .15s;
}
.nav__item:hover { background: rgba(255, 255, 255, .06); color: #ede9fe; }
.nav__item.is-active { background: rgba(99, 102, 241, .22); color: #fff; }
.nav__count {
  margin-left: auto; font-size: 11.5px; font-weight: 600;
  background: rgba(255, 255, 255, .1); padding: 1px 7px; border-radius: 20px;
  color: #cdc9ef;
}
.nav__item.is-active .nav__count { background: var(--indigo); color: #fff; }

.sidebar__stats {
  margin-top: auto; padding: 14px 12px;
  border-radius: 12px; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .07);
}
.statRow {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12.5px; color: #a9a7c9; margin-bottom: 9px;
}
.statRow strong { color: #fff; font-size: 16px; }
.progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #818cf8, #34d399); transition: width .4s ease; }
.sidebar__note { font-size: 11.5px; color: #8b88ab; margin: 9px 0 0; line-height: 1.5; }

.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 10px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff; font-weight: 700; font-size: 13.5px;
}
.sidebar__userMeta { display: flex; flex-direction: column; min-width: 0; }
.sidebar__userMeta strong { color: #fff; font-size: 13px; font-weight: 600; }
.sidebar__userMeta span {
  color: #8b88ab; font-size: 11.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__user .ghost-icon { color: #8b88ab; margin-left: auto; flex: none; }
.sidebar__user .ghost-icon:hover { background: rgba(255, 255, 255, .1); color: #fff; }

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

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar__title h1 { font-size: 20px; margin: 0 0 3px; letter-spacing: -.4px; }
.topbar__title p { margin: 0; font-size: 12.5px; color: var(--muted); }
.topbar__actions { display: flex; align-items: center; gap: 12px; }

.search { position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 11px; color: #98a2b3; pointer-events: none; }
.search input { padding-left: 34px; width: 260px; background: #fff; }

/* ---------- 看板 ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(258px, 1fr));
  gap: 16px;
  padding: 20px 28px 32px;
  overflow-x: auto;
  align-items: start;
  flex: 1;
}

.column {
  background: #f0f2f8;
  border-radius: var(--radius);
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 240px;
  transition: background .16s, box-shadow .16s;
}
.column.is-dragover {
  background: var(--indigo-soft);
  box-shadow: inset 0 0 0 2px rgba(99, 102, 241, .45);
}
.column__head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.column__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.column__name { font-size: 13px; font-weight: 650; color: var(--ink-2); letter-spacing: -.1px; }
.column__count {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: #e2e5ee; padding: 1px 7px; border-radius: 20px;
}
.column__add {
  margin-left: auto; border: 0; background: transparent; color: #98a2b3;
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
}
.column__add:hover { background: #e6e9f2; color: var(--ink); }

.cards { display: flex; flex-direction: column; gap: 9px; min-height: 40px; }
.cards__placeholder {
  border: 1.5px dashed #d3d8e6; border-radius: 10px;
  padding: 18px 10px; text-align: center;
  font-size: 12px; color: #9aa1b5;
}

.card {
  background: var(--card);
  border: 1px solid #e9ebf3;
  border-radius: 11px;
  padding: 12px 13px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: box-shadow .16s, transform .16s, border-color .16s;
  position: relative;
}
.card:hover { box-shadow: var(--shadow-md); border-color: #dcdff0; transform: translateY(-1px); }
.card.is-dragging { opacity: .45; cursor: grabbing; }
.card__top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.card__title {
  font-size: 13.5px; font-weight: 600; line-height: 1.45; margin: 0;
  flex: 1; color: var(--ink); word-break: break-word;
}
.card__desc {
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
  margin: 0 0 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.pill {
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 7px; border-radius: 20px; flex: none; text-transform: uppercase;
}
.pill--high { background: #fef3f2; color: #d92d20; }
.pill--medium { background: #fffaeb; color: #b54708; }
.pill--low { background: #ecfdf3; color: #027a48; }

.card__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.tag {
  font-size: 11px; color: #4f46e5; background: var(--indigo-soft);
  padding: 2px 7px; border-radius: 6px; font-weight: 550;
}
.card__meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--muted);
  border-top: 1px solid #f1f3f8; padding-top: 9px;
}
.card__meta > * { display: inline-flex; align-items: center; gap: 4px; }
.card__due--soon { color: #b54708; font-weight: 600; }
.card__due--over { color: #d92d20; font-weight: 600; }
.card__attach { color: var(--muted); font-size: 11.5px; }
.card__assignee { margin-left: auto; }
.miniAvatar {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 9.5px; font-weight: 700;
  background: #e0e7ff; color: #4338ca;
}

.empty { text-align: center; padding: 60px 20px; color: var(--muted); margin: auto; }
.empty__icon {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 16px;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); color: #98a2b3;
  box-shadow: var(--shadow-sm);
}
.empty h3 { margin: 0 0 6px; font-size: 16px; color: var(--ink); }
.empty p { margin: 0 0 18px; font-size: 13.5px; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__backdrop {
  position: absolute; inset: 0; background: rgba(16, 24, 40, .45);
  backdrop-filter: blur(3px); animation: fadeIn .18s ease;
}
.modal__dialog {
  position: relative; width: 100%; max-width: 520px;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: popIn .2s cubic-bezier(.2, .9, .3, 1.2);
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
}
.modal__head h2 { font-size: 17px; margin: 0; letter-spacing: -.3px; }
.modal__body { padding: 18px 20px 20px; overflow-y: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.modal__footRight { display: flex; gap: 10px; margin-left: auto; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 0);
  background: #101828; color: #fff; font-size: 13px; font-weight: 500;
  padding: 10px 18px; border-radius: 99px; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); animation: toastIn .22s ease; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .auth { grid-template-columns: 1fr; }
  .auth__art { display: none; }
  .auth__panel { min-height: 100vh; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; align-items: center;
    gap: 14px; padding: 12px 16px; overflow-x: auto;
  }
  .brand--sidebar { padding: 0; }
  .nav { flex-direction: row; gap: 6px; }
  .nav__item { white-space: nowrap; padding: 7px 10px; }
  .sidebar__stats, .sidebar__note { display: none; }
  .sidebar__user { margin: 0 0 0 auto; border: 0; padding: 0; }
  .sidebar__userMeta { display: none; }
  .board { grid-template-columns: repeat(4, 260px); padding: 16px; }
  .topbar { flex-direction: column; align-items: stretch; padding: 16px; }
  .topbar__actions { flex-wrap: wrap; }
  .search input { width: 100%; }
  .search { flex: 1; min-width: 160px; }
}

@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .auth__panel { padding: 28px 18px; }
  .auth__title { font-size: 22px; }
}

/* ---------- 视图切换 ---------- */
.viewSwitch {
  display: inline-flex; padding: 3px; gap: 2px;
  background: #eef0f6; border-radius: 10px;
}
.viewSwitch__btn {
  border: 0; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px;
  transition: background .16s, color .16s, box-shadow .16s;
}
.viewSwitch__btn:hover { color: var(--ink); }
.viewSwitch__btn.is-active {
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .1);
}

/* ---------- 事件进度表 ---------- */
.timeline {
  padding: 20px 28px 32px;
  display: flex; flex-direction: column; gap: 14px;
  flex: 1; min-width: 0;
}
.timeline__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.timeline__summary { margin: 0; font-size: 13px; color: var(--muted); }
.timeline__tip { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #98a2b3; }
.timeline__scroll {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.ptable { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
.ptable thead th {
  background: #f8f9fc; color: var(--muted);
  font-size: 11.5px; font-weight: 650; letter-spacing: .3px;
  text-align: left; padding: 11px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
  cursor: pointer; user-select: none;
}
.ptable thead th:hover { color: var(--ink); }
.ptable thead th.is-sorted { color: var(--indigo); }
.ptable thead th.is-sorted[data-dir="asc"]::after { content: "↑"; margin-left: 4px; }
.ptable thead th.is-sorted[data-dir="desc"]::after { content: "↓"; margin-left: 4px; }
.ptable thead th:last-child { cursor: default; }

.ptable tbody td { padding: 12px 14px; border-bottom: 1px solid #eef0f6; vertical-align: middle; }
.ptable tbody tr { cursor: pointer; transition: background .14s; }
.ptable tbody tr:hover { background: #f8f9fc; }
.ptable tbody tr:focus-visible { outline: 2px solid var(--indigo); outline-offset: -2px; }
.ptable tbody tr:last-child td { border-bottom: 0; }

.pevent { display: flex; align-items: flex-start; gap: 10px; min-width: 220px; }
.pevent__bar { width: 3px; border-radius: 3px; flex: none; align-self: stretch; min-height: 28px; }
.pevent__title { font-size: 13.5px; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.pevent__desc {
  font-size: 12px; color: var(--muted); margin: 0 0 5px; max-width: 360px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pevent__tags { display: flex; gap: 5px; flex-wrap: wrap; }

.statusChip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px;
  border-radius: 20px; white-space: nowrap;
}
.statusChip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.statusChip--todo { background: #f2f4f7; color: #667085; }
.statusChip--progress { background: #eef2ff; color: #4338ca; }
.statusChip--review { background: #fffaeb; color: #b54708; }
.statusChip--done { background: #ecfdf3; color: #027a48; }

.pcell__due { white-space: nowrap; color: var(--ink-2); min-width: 136px; }
.pcell__date { font-variant-numeric: tabular-nums; letter-spacing: .1px; }
.pcell__due em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-left: 6px; }
.pcell__due em.is-over { color: #d92d20; font-weight: 600; }
.pcell__due em.is-soon { color: #b54708; font-weight: 600; }
.pcell__none { color: #b6bdcc; }
.pcell__created { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }

.pcell__progress { min-width: 132px; }
.pbar { display: flex; align-items: center; gap: 9px; }
.pbar__track { flex: 1; height: 6px; border-radius: 99px; background: #eceef5; overflow: hidden; }
.pbar__track span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #818cf8, #6366f1); }
.pbar__track span.is-full { background: linear-gradient(90deg, #34d399, #10b981); }
.pbar em { font-style: normal; font-size: 11.5px; color: var(--muted); min-width: 32px; text-align: right; }

.pempty { text-align: center; color: var(--muted); font-size: 13px; padding: 44px 12px; }

/* ---------- 文档附件 ---------- */
.attach {
  border: 1px dashed #d3d8e6; border-radius: 10px;
  padding: 10px 12px; background: #fbfcfe;
}
.attachList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.attachList:empty { display: none; }
.attachList:not(:empty) { margin-bottom: 9px; }
.attachEmpty { font-size: 12px; color: #98a2b3; padding: 2px 0 9px; }
.attachItem {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid #e9ebf3; border-radius: 8px; padding: 7px 9px;
}
.attachItem__icon {
  width: 28px; height: 28px; border-radius: 6px; flex: none;
  display: grid; place-items: center;
  background: var(--indigo-soft); color: var(--indigo);
  font-size: 9px; font-weight: 700; letter-spacing: .2px;
}
.attachItem__main { min-width: 0; flex: 1; }
.attachItem__name {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attachItem__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; font-size: 11px; color: var(--muted); }
.attachItem__ver {
  font-size: 10px; font-weight: 700; color: #4338ca;
  background: var(--indigo-soft); padding: 0 5px; border-radius: 5px;
}
.attachItem__actions { display: flex; gap: 2px; flex: none; }
.attachItem__actions button {
  border: 0; background: transparent; color: var(--muted);
  width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center;
}
.attachItem__actions button:hover { background: #f2f4f7; color: var(--ink); }
.attachActions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.attachActions input[type="text"] { flex: 1 1 160px; width: auto; padding: 8px 11px; font-size: 13px; }
.attachActions .btn { flex: none; }
.attachHint { margin: 9px 0 0; font-size: 11px; color: #98a2b3; line-height: 1.6; }

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--muted);
  transition: background .16s, color .16s, border-color .16s;
}
.theme-toggle:hover { background: #f9fafb; color: var(--ink); border-color: #d0d5dd; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.auth__panel > .theme-toggle { position: absolute; top: 20px; right: 22px; }

/* ---------- 暗黑模式 ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eaf2;
  --ink-2: #c2c7d6;
  --muted: #8d93a8;
  --line: #2a2e3d;
  --bg: #0d0f16;
  --card: #171a24;
  --indigo-soft: rgba(99, 102, 241, .18);
}

[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .auth__panel { background: #11131b; }
[data-theme="dark"] .auth__art { background: radial-gradient(120% 100% at 10% 0%, #3730a3 0%, #171537 55%, #0b0a1a 100%); }

[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .btn--ghost,
[data-theme="dark"] .empty__icon { background: #191c27; }
[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .btn--ghost:hover { background: #232636; border-color: #343a4d; }
[data-theme="dark"] .btn--danger-ghost { background: transparent; border-color: #4b2a2a; color: #fda29b; }
[data-theme="dark"] .btn--danger-ghost:hover { background: rgba(240, 68, 56, .12); }

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #171a24; color: var(--ink); border-color: #2a2e3d;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #6b7185; }
[data-theme="dark"] .ghost-icon:hover { background: #232636; color: var(--ink); }

[data-theme="dark"] .auth__alert { background: rgba(240, 68, 56, .12); border-color: rgba(240, 68, 56, .32); color: #fda29b; }
[data-theme="dark"] .auth__legal code { background: #232636; color: var(--ink-2); }
[data-theme="dark"] .field__error { color: #fda29b; }

[data-theme="dark"] .topbar { background: rgba(13, 15, 22, .82); }
[data-theme="dark"] .column { background: #141721; }
[data-theme="dark"] .column__count { background: #242838; }
[data-theme="dark"] .column__add:hover { background: #232636; color: var(--ink); }
[data-theme="dark"] .cards__placeholder { border-color: #2b3040; }

[data-theme="dark"] .card { border-color: #232838; }
[data-theme="dark"] .card:hover { border-color: #323a52; }
[data-theme="dark"] .card__meta { border-top-color: #202430; }
[data-theme="dark"] .tag { color: #a5b4fc; }
[data-theme="dark"] .miniAvatar { background: rgba(99, 102, 241, .22); color: #c7d2fe; }

[data-theme="dark"] .pill--high { background: rgba(240, 68, 56, .16); color: #fda29b; }
[data-theme="dark"] .pill--medium { background: rgba(245, 158, 11, .16); color: #fec84b; }
[data-theme="dark"] .pill--low { background: rgba(16, 185, 129, .16); color: #6ce9a6; }

[data-theme="dark"] .modal__dialog { background: #171a24; }
[data-theme="dark"] .toast { background: #2b3044; }

[data-theme="dark"] .viewSwitch { background: #1b1e2a; }
[data-theme="dark"] .viewSwitch__btn.is-active { background: #272b3c; color: var(--ink); }
[data-theme="dark"] .ptable thead th { background: #1b1e2a; }
[data-theme="dark"] .ptable tbody td { border-bottom-color: #202430; }
[data-theme="dark"] .ptable tbody tr:hover { background: #1b1e2a; }
[data-theme="dark"] .pevent__title { color: var(--ink); }
[data-theme="dark"] .statusChip--todo { background: #232838; color: #98a2b3; }
[data-theme="dark"] .statusChip--progress { background: rgba(99, 102, 241, .18); color: #a5b4fc; }
[data-theme="dark"] .statusChip--review { background: rgba(245, 158, 11, .16); color: #fec84b; }
[data-theme="dark"] .statusChip--done { background: rgba(16, 185, 129, .16); color: #6ce9a6; }
[data-theme="dark"] .pbar__track { background: #262a3a; }
[data-theme="dark"] .pcell__none { color: #4d5366; }

[data-theme="dark"] .attach { background: #141721; border-color: #2b3040; }
[data-theme="dark"] .attachItem { background: #1b1e2a; border-color: #262b3b; }
[data-theme="dark"] .attachItem__actions button:hover { background: #262a3a; color: var(--ink); }
[data-theme="dark"] .attachItem__ver { color: #a5b4fc; }

@media (max-width: 900px) {
  .timeline { padding: 16px; }
}

/* ---------- 管理员 ---------- */
.userRole {
  margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: rgba(99, 102, 241, .28); color: #ddd6fe;
  font-size: 10px; font-weight: 600; letter-spacing: .2px;
}
.nav__item--admin { margin-top: 8px; }
.modal__dialog--wide { max-width: 760px; }
.adminCreate {
  display: grid; grid-template-columns: 1fr 1.3fr 1fr .9fr auto;
  gap: 10px; align-items: end;
  padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line);
}
.adminCreate .field { margin-bottom: 0; }
.adminUsers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adminUser {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
}
.adminUser__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.adminUser__main strong { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.adminUser__email { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.adminUser__meta { color: var(--muted); font-size: 12px; }
.adminUser__actions { display: flex; gap: 8px; flex: none; }
.adminBadge {
  padding: 1px 7px; border-radius: 999px; background: var(--indigo-soft);
  color: var(--indigo-dark); font-size: 11px; font-weight: 600;
}
.adminBadge--off { background: #fef3f2; color: #d92d20; }
.btn--sm { padding: 6px 10px; font-size: 12px; border-radius: 9px; }
.adminEmpty { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 0; }
.card__owner { color: var(--muted); font-size: 11px; }
.tag--owner { background: #eef2ff; color: #4338ca; }

[data-theme="dark"] .adminUser { border-color: #262b3b; }
[data-theme="dark"] .adminCreate { border-bottom-color: #262b3b; }
[data-theme="dark"] .adminBadge { background: rgba(99, 102, 241, .2); color: #c7d2fe; }
[data-theme="dark"] .adminBadge--off { background: rgba(240, 68, 56, .16); color: #fda29b; }
[data-theme="dark"] .tag--owner { background: rgba(99, 102, 241, .18); color: #a5b4fc; }

@media (max-width: 720px) {
  .adminCreate { grid-template-columns: 1fr 1fr; }
  .adminCreate .btn { grid-column: span 2; }
  .adminUser { flex-direction: column; align-items: flex-start; }
  .adminUser__actions { flex-wrap: wrap; }
}

/* ---------- 账号设置 ---------- */
.modal__dialog--narrow { max-width: 420px; }
.accountInfo {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px; border-radius: 12px; background: var(--bg); margin-bottom: 18px;
}
.accountInfo > div { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; }
.accountInfo span { color: var(--muted); }
.accountInfo strong { font-weight: 600; text-align: right; word-break: break-all; }
[data-theme="dark"] .accountInfo { background: #141721; }

/* ---------- 操作日志 ---------- */
.adminTabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.adminTab {
  border: 0; background: none; padding: 8px 12px 10px; font-size: 13px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 8px 8px 0 0;
}
.adminTab:hover { color: var(--ink-2); background: var(--bg); }
.adminTab.is-active { color: var(--indigo-dark); border-bottom-color: var(--indigo); }
.adminLogsBar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--muted); font-size: 12px; margin-bottom: 10px;
}
.adminLogs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.logItem { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.logItem__top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.logItem__top strong { font-weight: 600; }
.logItem__action {
  padding: 1px 7px; border-radius: 999px; background: var(--indigo-soft);
  color: var(--indigo-dark); font-size: 11px; font-weight: 600;
}
.logItem__top time { margin-left: auto; color: var(--muted); font-size: 11px; }
.logItem__detail { margin: 5px 0 3px; font-size: 12px; color: var(--ink-2); word-break: break-all; }
.logItem__meta { font-size: 11px; color: var(--muted); }
[data-theme="dark"] .adminTabs { border-bottom-color: #262b3b; }
[data-theme="dark"] .adminTab:hover { background: #1b1e2a; }
[data-theme="dark"] .adminTab.is-active { color: #a5b4fc; }
[data-theme="dark"] .logItem { border-color: #262b3b; }
[data-theme="dark"] .logItem__action { background: rgba(99, 102, 241, .18); color: #a5b4fc; }
[data-theme="dark"] .logItem__detail { color: var(--ink); }

/* ---------- 附件历史版本 ---------- */
.attachGroup { display: flex; flex-direction: column; gap: 6px; }
.attachItem__actions button.attachHistBtn {
  width: auto; padding: 0 7px; font-size: 11px; font-weight: 600;
  color: var(--indigo-dark); background: var(--indigo-soft);
}
.attachItem__actions button.attachHistBtn.is-open { background: #e0e7ff; }
.attachHistory {
  list-style: none; margin: 0 0 2px; padding: 6px 8px 6px 10px;
  border-left: 2px solid #e4e7f0; display: flex; flex-direction: column; gap: 6px;
}
.attachHistory[hidden] { display: none; }
.attachVersion { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.attachVersion__ver {
  flex: none; font-size: 10px; font-weight: 700; color: #4338ca;
  background: var(--indigo-soft); padding: 0 5px; border-radius: 5px;
}
.attachVersion__meta {
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attachVersion__actions { display: flex; gap: 4px; flex: none; }
.attachVersion__actions button {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 11px; padding: 2px 7px; border-radius: 6px;
}
.attachVersion__actions button:hover { background: var(--bg); color: var(--ink); }
[data-theme="dark"] .attachItem__actions button.attachHistBtn { background: rgba(99, 102, 241, .2); color: #c7d2fe; }
[data-theme="dark"] .attachHistory { border-left-color: #262b3b; }
[data-theme="dark"] .attachVersion__actions button { background: #141721; border-color: #262b3b; color: var(--ink); }

