/* ============================================================
   进度工作台 · 全局样式
   设计基调：深邃海军蓝侧边栏 + 轻盈明亮的内容区，
   渐变主色（蓝 → 靛紫），柔和分层阴影，细腻微动效。
   ============================================================ */

:root {
  --bg: #f2f5fb;
  --surface: #ffffff;
  --border: #e6ebf4;
  --text: #152039;
  --text-2: #556480;
  --text-3: #8e9bb3;
  --primary: #2e6bf0;
  --primary-2: #6a54ec;
  --primary-grad: linear-gradient(135deg, #2e6bf0 0%, #6a54ec 100%);
  --success: #12a873;
  --danger: #d94f4f;
  --sidebar-bg: linear-gradient(180deg, #0d1b36 0%, #132449 55%, #172b58 100%);
  --shadow-sm: 0 1px 2px rgba(18, 32, 64, .05), 0 6px 18px -10px rgba(18, 32, 64, .10);
  --shadow-md: 0 2px 4px rgba(18, 32, 64, .05), 0 16px 36px -14px rgba(18, 32, 64, .18);
  --radius: 14px;
  --ease: cubic-bezier(.22, .68, .32, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(46, 107, 240, .08), transparent 62%),
    radial-gradient(860px 460px at 40% 110%, rgba(106, 84, 236, .05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  isolation: isolate;
}

/* 背景漂浮光晕，让页面有呼吸感 */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(6px);
  z-index: -1;
  pointer-events: none;
}
body::before {
  top: -160px;
  right: -120px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(46, 107, 240, .14), transparent 65%);
  animation: orbFloat 16s ease-in-out infinite alternate;
}
body::after {
  bottom: -180px;
  left: 14%;
  width: 430px;
  height: 430px;
  background: radial-gradient(circle, rgba(106, 84, 236, .11), transparent 65%);
  animation: orbFloat 21s ease-in-out infinite alternate-reverse;
}

::selection { background: #c9dcff; }

/* 细滚动条，融入整体风格 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d3dcea; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b7c5dd; border: 2px solid transparent; background-clip: content-box; }

button, input { font: inherit; }
button, a, input { touch-action: manipulation; }
button { cursor: pointer; transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s, border-color .18s, color .18s, filter .18s; }
button:disabled { opacity: .55; cursor: wait; }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(46, 107, 240, .35);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  from { background-position: 180% 0; }
  to { background-position: -80% 0; }
}
@keyframes heroDrift {
  from { background-position: 0% 30%; }
  to { background-position: 100% 70%; }
}
@keyframes orbFloat {
  from { transform: translate(0, 0); }
  to { transform: translate(16px, 12px); }
}

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  width: 222px;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 30px 16px;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  color: #dce6f8;
  box-shadow: 1px 0 0 rgba(255, 255, 255, .03), 12px 0 40px -18px rgba(10, 22, 48, .45);
  z-index: 5;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 0 8px;
  color: #fff;
  font-weight: 700;
  font-size: 17.5px;
  letter-spacing: .2px;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--primary-grad);
  color: #fff;
  font-size: 22px;
  box-shadow: 0 6px 16px -4px rgba(64, 96, 240, .65), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.nav-label {
  color: rgba(190, 206, 238, .45);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  margin: 44px 16px 12px;
}
.nav {
  padding: 12px 14px;
  margin-bottom: 4px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  font-size: 16px;
  color: rgba(206, 218, 242, .72);
  transition: background .18s, color .18s, box-shadow .18s;
}
.nav span { font-size: 13.5px; }
.nav:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav:not(.active):hover { transform: translateX(3px); }
.nav.active {
  background: var(--primary-grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 18px -6px rgba(72, 96, 235, .55), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 20px 8px 0;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #e6edf9;
}
.sidebar-foot small { display: block; color: rgba(190, 206, 238, .5); margin-top: 5px; font-size: 10.5px; }
.avatar {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 12px;
}

/* ---------------- 主区域骨架 ---------------- */
main { margin-left: 222px; padding: 30px 42px 36px; max-width: 1900px; }
.breadcrumb { color: var(--text-3); font-size: 12px; margin-bottom: 30px; }
.breadcrumb span { margin: 0 10px; color: #c2cbe0; }
header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 10.5px;
  letter-spacing: 2.4px;
  color: #7c90b6;
  font-weight: 700;
}
.eyebrow::before {
  content: '';
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary-grad);
}
h1 {
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -.6px;
  margin: 10px 0 10px;
  color: #131e35;
}
header p { color: var(--text-3); margin: 0; font-size: 13.5px; }
.actions { display: flex; gap: 10px; }

/* ---------------- 按钮 ---------------- */
.primary, .secondary {
  border-radius: 10px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.primary {
  background: var(--primary-grad);
  color: #fff;
  border: 0;
  box-shadow: 0 6px 16px -6px rgba(58, 94, 235, .55), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(58, 94, 235, .6), inset 0 1px 0 rgba(255, 255, 255, .22); filter: brightness(1.04); }
.secondary {
  background: var(--surface);
  color: #4d5d7a;
  border: 1px solid #dde4f0;
  box-shadow: 0 1px 2px rgba(18, 32, 64, .04);
}
.secondary:hover:not(:disabled) { border-color: #c2d1ea; background: #f7faff; color: var(--primary); }
.link { background: none; border: 0; color: var(--primary); font-size: 11px; padding: 4px 6px; border-radius: 6px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- 数据来源行 ---------------- */
.source-row { display: flex; align-items: center; gap: 12px; margin: 24px 0 18px; color: var(--text-3); font-size: 11px; }
.source {
  background: #e9f0fd;
  border: 1px solid #d9e5fb;
  border-radius: 999px;
  color: #4a6b9f;
  font-weight: 600;
  padding: 5px 12px;
}

/* ---------------- 概览卡片 ---------------- */
.cards { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.card {
  position: relative;
  padding: 24px 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  animation: fadeUp .5s var(--ease) backwards;
}
.cards .card:nth-child(2) { animation-delay: .05s; }
.cards .card:nth-child(3) { animation-delay: .1s; }
.cards .card:nth-child(4) { animation-delay: .15s; }
.cards .card:nth-child(5) { animation-delay: .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card span { color: var(--text-2); font-size: 12px; font-weight: 500; }
.card strong {
  display: block;
  font-size: 33px;
  font-weight: 750;
  letter-spacing: -.8px;
  line-height: 1.25;
  margin: 8px 0;
  color: #16233f;
  font-variant-numeric: tabular-nums;
}
.card small { font-size: 10.5px; color: #a4aec3; white-space: nowrap; }
.card .card-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 21px;
  flex-shrink: 0;
  transition: transform .3s var(--ease);
}
.card:hover .card-icon { transform: scale(1.1) rotate(-5deg); }
.blue { color: #2e6bf0 !important; background: #e9f1ff; }
.green { color: #0da271 !important; background: #e4f8ef; }
.gray { color: #7d8ba3 !important; background: #eef1f7; }

/* 主视觉卡片：渐变 hero，缓慢流动 */
.overall {
  border: 0;
  overflow: hidden;
  background: linear-gradient(118deg, #1d49c8 0%, #2e63e8 46%, #6a54ec 100%);
  background-size: 180% 180%;
  animation: fadeUp .5s var(--ease) backwards, heroDrift 13s ease-in-out .6s infinite alternate;
  box-shadow: 0 14px 34px -12px rgba(47, 84, 216, .55);
}
.overall::before {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  top: -90px;
  right: -60px;
  background: radial-gradient(circle, rgba(255, 255, 255, .2), transparent 68%);
  animation: orbFloat 9s ease-in-out infinite alternate;
}
.overall::after {
  content: '';
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .16);
  bottom: -80px;
  left: 6%;
  animation: orbFloat 12s ease-in-out infinite alternate-reverse;
}
.overall > * { position: relative; z-index: 1; }
.overall span { color: rgba(255, 255, 255, .82); }
.overall strong { color: #fff; text-shadow: 0 2px 12px rgba(13, 30, 80, .3); }
.overall small { color: rgba(255, 255, 255, .6); }

/* 完成度圆环（弧形颜色由 JS 内联设置） */
.ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: conic-gradient(#ffffff 0%, rgba(255, 255, 255, .28) 0);
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(13, 30, 80, .25);
}
.ring::before { content: ''; position: absolute; inset: 8px; background: #fff; border-radius: 50%; }
.ring span { position: relative; font-size: 10px; font-weight: 600; color: #4a64a8; }

/* ---------------- 面板与表格 ---------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeUp .55s .12s var(--ease) backwards;
}
.panel-head { padding: 26px 28px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
h2 { font-size: 17.5px; font-weight: 700; letter-spacing: -.2px; margin: 0 0 8px; }
.count {
  color: var(--primary);
  background: #ecf2ff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: 8px;
  vertical-align: 2px;
}
.panel-head p { margin: 0; color: var(--text-3); font-size: 12px; }
.toolbar { padding: 0 28px 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }

.tabs { display: flex; gap: 4px; background: #f0f3fa; padding: 4px; border-radius: 11px; }
.tabs button {
  background: transparent;
  border: 0;
  color: #6d7c99;
  padding: 8px 15px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.tabs button:hover { color: var(--primary); }
.tabs button.selected {
  background: #fff;
  color: var(--primary);
  font-weight: 650;
  box-shadow: 0 2px 8px rgba(19, 37, 63, .1);
}

.search {
  display: flex;
  align-items: center;
  border: 1px solid #e2e8f2;
  border-radius: 10px;
  padding: 0 13px;
  gap: 9px;
  width: 270px;
  min-width: 180px;
  background: #fbfcfe;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(46, 107, 240, .12);
}
.search span { font-size: 20px; color: #97a3b6; }
.search input { width: 100%; border: 0; background: transparent; padding: 10px 0; font-size: 12.5px; outline: none; color: var(--text); }
.search input::placeholder { color: #a6b0c4; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafd;
  color: #8593aa;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .8px;
  height: 46px;
  padding: 0 20px;
  border-top: 1px solid #eef1f7;
  border-bottom: 1px solid #eef1f7;
}
td { height: 74px; padding: 14px 20px; border-bottom: 1px solid #f1f4f9; font-size: 12.5px; color: #5d6c86; transition: height .38s var(--ease), padding .38s var(--ease), border-color .3s; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #f7faff; }
tbody tr:last-child td { border-bottom: 0; }
.task-name { width: 19%; padding-left: 28px; }
.progress-col { width: 27%; }
.due-col { width: 12%; }
.task-cell { font-weight: 650; color: #2b3a58; padding-left: 28px; }
.task-cell small { display: block; color: #a8b2c6; font-weight: 500; margin-top: 6px; font-size: 10px; letter-spacing: .4px; }

.progress-cell { display: flex; align-items: center; gap: 14px; min-width: 170px; }
.track { height: 9px; background: #edf1f8; border-radius: 999px; flex: 1; overflow: hidden; }
.bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #6ea8ff);
  box-shadow: 0 1px 4px rgba(59, 130, 246, .4);
  transition: width .6s var(--ease);
}
.bar.done { background: linear-gradient(90deg, #0ea76f, #3ed598); box-shadow: 0 1px 4px rgba(14, 167, 111, .35); }
.progress-num { width: 40px; color: #3c4d6e; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; font-size: 11.5px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
}
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.done { color: #0c9e6c; background: #e6f8f0; }
.status.active { color: #2e6bf0; background: #eaf1ff; }
.status.todo { color: #8593a9; background: #f0f3f8; }

.owner { display: flex; align-items: center; gap: 8px; }
.owner .avatar {
  width: 28px;
  height: 28px;
  font-size: 10.5px;
  font-weight: 650;
  background: linear-gradient(135deg, #e4ecff, #f0eaff);
  color: #4a5fd0;
}

/* 截止日期列 */
.due-cell { min-width: 118px; font-variant-numeric: tabular-nums; }
.due-date { color: #4c5b76; font-weight: 550; }
.due-date.due-future { color: #0da271; font-weight: 650; }
.due-date.due-past-done { color: #9aa5b8; font-weight: 500; }
.due-none { color: #a6b0c4; }
.due-tag {
  display: block;
  width: max-content;
  margin-top: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
}
.due-tag.overdue { color: #d24a4a; background: #fdeeee; }
.due-tag.today { color: #b48331; background: #fff4dd; }

/* 已过截止日期且未完成：整行标红 */
tbody tr.row-overdue { background: #fdf1f1; }
tbody tr.row-overdue:hover { background: #fce9e9; }
tr.row-overdue td:first-child { box-shadow: inset 3px 0 0 #e05555; }
tr.row-overdue .due-date { color: #c94f4f; font-weight: 650; }
tr.row-overdue .due-tag.overdue { background: #d24a4a; color: #fff; }
tr.row-overdue .due-tag.today { background: #d18a2b; color: #fff; }
.operation { width: 100px; }
.row-action { background: none; border: 0; color: var(--primary); font-size: 11.5px; font-weight: 550; padding: 5px 8px; border-radius: 7px; }
.row-action:hover { background: #edf3ff; }
.row-action.delete { color: #a3acba; }
.row-action.delete:hover { color: var(--danger); background: #fdefef; }

.panel-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #eef1f7;
  padding: 16px 28px;
  color: #9aa5b7;
  font-size: 10.5px;
}
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin: 0 6px 1px 14px; }
.green-dot { background: #21ba7d; }
.blue-dot { background: #4388ff; }
.gray-dot { background: #b7c1d0; }

footer { display: flex; justify-content: space-between; gap: 20px; font-size: 10.5px; color: #a4afc2; margin-top: 24px; }

/* ---------------- 空状态与错误 ---------------- */
.empty { text-align: center; padding: 58px 20px; color: #98a5ba; }
.empty > span {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: #f0f4fb;
  font-size: 30px;
  color: #b4c2d9;
  margin-bottom: 18px;
}
.empty h3 { font-size: 15px; font-weight: 650; color: #5f6e89; margin: 0 0 8px; }
.empty p { font-size: 12px; margin: 0; }
.error {
  background: #fdf1f0;
  border: 1px solid #f4d6d2;
  color: #b24a41;
  border-radius: 10px;
  padding: 13px 16px;
  margin-bottom: 18px;
  line-height: 1.7;
  font-size: 12.5px;
}
.error::before { content: '⚠ '; }

/* ---------------- 弹窗 ---------------- */
dialog {
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 470px;
  max-width: calc(100vw - 32px);
  padding: 30px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 30px 90px -18px rgba(13, 28, 66, .45);
}
dialog[open] { animation: dialogIn .28s var(--ease); }
dialog::backdrop { background: rgba(13, 24, 52, .5); backdrop-filter: blur(6px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; }
.dialog-head h2 { margin-top: 8px; font-size: 21px; font-weight: 750; letter-spacing: -.3px; }
.close {
  border: 0;
  background: #f2f5fa;
  font-size: 20px;
  line-height: 1;
  color: #7e8ba2;
  border-radius: 9px;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.close:hover { background: #e6ecf5; color: #4d5d7a; }
form label { display: block; font-size: 12.5px; font-weight: 550; color: #57667f; margin-bottom: 18px; }
form input {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 11px 13px;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  background: #fbfcfe;
  color: #263955;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
form input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(46, 107, 240, .12);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint {
  font-size: 12px;
  line-height: 1.8;
  color: #8593ac;
  background: #f6f9fe;
  border: 1px solid #e7eefa;
  border-radius: 9px;
  padding: 10px 13px;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }
.form-error { color: #d04f4f; font-size: 12px; min-height: 16px; margin: 4px 0 0; }
.full { width: 100%; }

/* 登录弹窗居中聚焦 */
#login { text-align: center; width: 400px; }
#login h2 { font-size: 22px; font-weight: 750; margin: 12px 0 6px; }
#login .eyebrow { justify-content: center; }
#login .hint { background: none; border: 0; padding: 0 0 6px; }
#login label { text-align: left; }
#login .primary { margin-top: 8px; padding: 12px; }

/* ---------------- 列表动效 ---------------- */
/* 加载/刷新数据时行交错入场 */
tr.row-enter { animation: rowIn .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
/* 便签卡片入场（仅首次加载） */
.note-card.note-enter { animation: fadeUp .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 60ms); }

/* 首次加载骨架屏 shimmer */
.skeleton { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, #edf1f8 25%, #f7f9fd 50%, #edf1f8 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton-row td:nth-child(1) .skeleton { width: 58%; }
.skeleton-row td:nth-child(2) .skeleton { width: 82%; height: 9px; border-radius: 999px; }
.skeleton-row td:nth-child(3) .skeleton { width: 52px; }
.skeleton-row td:nth-child(4) .skeleton { width: 60px; height: 24px; border-radius: 999px; }
.skeleton-row td:nth-child(5) .skeleton { width: 46%; }
.skeleton-row td:nth-child(6) .skeleton { width: 78px; }
.skeleton-row td:nth-child(7) .skeleton { width: 56px; }

/* 刷新按钮加载时图标旋转 */
.btn-icon { display: inline-block; transition: transform .3s var(--ease); }
button.loading .btn-icon { animation: spin .9s linear infinite; }

/* 状态标签页按下反馈 */
.tabs button:active:not(:disabled) { transform: scale(.95); }

/* ---------------- 任务行删除动画 ---------------- */
.cell-anim {
  overflow: hidden;
  transition: height .38s var(--ease), opacity .26s ease, transform .38s var(--ease);
}
tbody tr.row-leaving, tbody tr.row-leaving:hover { background: #fdf1f0; }
tr.row-leaving td { height: 0; padding-top: 0; padding-bottom: 0; border-bottom-color: transparent; }
tr.row-leaving .cell-anim { opacity: 0; transform: translateX(26px); }
/* 系统开启“减少动态效果”时：保留快速淡出 + 折叠，去掉横向滑动 */
tr.row-leaving.reduced td, tr.row-leaving.reduced .cell-anim { transition-duration: .24s; }
tr.row-leaving.reduced .cell-anim { transform: none; }

/* 系统开启“减少动态效果”时：停止无限循环装饰，其余动效降级为快速淡入 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before, body::after, .overall, .overall::before, .overall::after, .skeleton { animation: none; }
  .card, .panel, .notes-intro, .note-card.note-enter, tr.row-enter { animation-name: fadeIn; animation-duration: .25s; }
  .cards .card, .overall { animation-delay: 0s; }
  dialog[open], .toast, .confirm-dialog[open] .confirm-icon { animation-name: fadeIn; animation-duration: .2s; }
  .card strong.pulse { animation: none; }
  .card:hover, .nav:not(.active):hover { transform: none; }
  .card:hover .card-icon { transform: none; }
}

/* 统计数字变化脉冲 */
@keyframes statPulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.card strong { transform-origin: left center; }
.card strong.pulse { animation: statPulse .5s var(--ease); }

/* ---------------- 删除确认弹窗 ---------------- */
.confirm-dialog { width: 380px; text-align: center; padding: 34px 30px 28px; }
.confirm-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #fdeeee;
  color: var(--danger);
  font-size: 25px;
  box-shadow: 0 0 0 8px #fdf6f6;
}
.confirm-dialog[open] .confirm-icon { animation: iconPop .45s var(--ease); }
@keyframes iconPop {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.confirm-dialog h2 { font-size: 19px; font-weight: 700; margin: 0 0 10px; }
.confirm-dialog p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.confirm-dialog .dialog-actions { justify-content: center; }
.danger {
  border-radius: 10px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  background: linear-gradient(135deg, #e15555, #d13b3b);
  color: #fff;
  border: 0;
  box-shadow: 0 6px 16px -6px rgba(214, 69, 69, .5), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.danger:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 10px 22px -8px rgba(214, 69, 69, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 11px;
  background: rgba(19, 30, 56, .94);
  color: #fff;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: .2px;
  box-shadow: 0 14px 40px -8px rgba(13, 28, 66, .5);
  backdrop-filter: blur(8px);
  z-index: 10;
  animation: toastIn .3s var(--ease);
}

/* 触屏设备没有悬浮态，禁用位移类悬浮效果，避免“粘住”的悬浮态 */
@media (hover: none) {
  .card:hover, .note-card:hover, .nav:not(.active):hover, .primary:hover:not(:disabled), .danger:hover:not(:disabled) { transform: none; }
}

/* ---------------- 响应式 ---------------- */
@media (min-width: 1600px) {
  main { padding: 38px 56px; }
  .card { padding: 28px; }
  td { height: 82px; }
}
@media (max-width: 1200px) {
  .sidebar { width: 186px; padding: 24px 12px; }
  .brand { font-size: 15.5px; }
  main { margin-left: 186px; padding: 26px 24px; }
  .cards { grid-template-columns: repeat(4, 1fr); }
  .overall { grid-column: span 4; }
  .overall > div:first-child { display: flex; align-items: center; gap: 20px; }
  .overall strong { margin: 0; }
  .card { padding: 18px; }
  .card small { font-size: 9.5px; }
  td, th { padding-left: 14px; padding-right: 14px; }
  .task-cell, .task-name { padding-left: 14px; }
  .toolbar { flex-wrap: wrap; }
  .search { flex: 1; }
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 16px 20px;
    box-shadow: 0 2px 12px rgba(10, 22, 48, .25);
  }
  .sidebar .nav-label, .sidebar .nav, .sidebar-foot { display: none; }
  main { margin: 0; padding: 20px 16px; }
  .breadcrumb { margin-bottom: 20px; }
  header { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 25px; }
  .actions { width: 100%; }
  .actions button { flex: 1; padding-top: 12px; padding-bottom: 12px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card { padding: 18px 16px; border-radius: 14px; }
  .card .card-icon { width: 36px; height: 36px; font-size: 18px; border-radius: 11px; }
  .overall { grid-column: span 2; }
  .overall > div:first-child { display: block; }
  .overall strong { margin: 6px 0; }
  .card strong { font-size: 27px; }
  .panel { border-radius: 15px; }
  .panel-head { padding: 20px 16px; }
  .panel-head .secondary { padding: 9px 13px; font-size: 12px; }
  .toolbar { padding: 0 14px 16px; gap: 12px; }
  .tabs { width: 100%; justify-content: space-between; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { padding: 9px 11px; }
  .search { width: 100%; }

  /* ---- 任务表卡片化：每条任务一张卡片 ---- */
  .table-wrap table { min-width: 0; }
  .table-wrap thead { display: none; }
  tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 12px;
    row-gap: 5px;
    padding: 16px 18px;
    border-bottom: 1px solid #f1f4f9;
    transition: background .15s, padding .38s var(--ease);
  }
  tbody tr:last-child { border-bottom: 0; }
  tbody td { display: block; height: auto; padding: 0; border: 0; white-space: normal; }
  .task-name, .task-cell { padding-left: 0; }
  td:first-child { width: 100%; }
  .task-cell { font-size: 13.5px; }
  .task-cell small { margin-top: 4px; }
  td:has(.progress-cell) { width: 100%; margin: 5px 0 7px; }
  td:has(.progress-cell) .cell-anim { min-width: 0; }
  .progress-cell { min-width: 0; }
  td:nth-child(3) { font-size: 11.5px; color: #93a0b6; font-variant-numeric: tabular-nums; }
  .due-cell { min-width: 0; font-size: 11.5px; }
  .due-tag { display: inline-block; margin: 0 0 0 6px; vertical-align: 1px; }
  .owner { gap: 6px; }
  td:last-child { margin-left: auto; }
  .row-action { padding: 6px 9px; font-size: 12px; }
  /* 删除动画在卡片布局下同步收起卡片内边距 */
  tbody tr.row-leaving { padding-top: 0; padding-bottom: 0; border-bottom-color: transparent; }
  /* 逾期红行的左侧强调条：卡片布局下移到整卡 */
  tr.row-overdue td:first-child { box-shadow: none; }
  tbody tr.row-overdue { box-shadow: inset 3px 0 0 #e05555; }

  .panel-foot { padding: 14px 16px; flex-wrap: wrap; }
  footer { flex-direction: column; gap: 8px; }
  .source-row { flex-wrap: wrap; }
  .empty { padding: 46px 16px; }

  /* 弹窗适配小屏：可滚动、紧凑内边距 */
  dialog { padding: 24px 22px; max-height: calc(100dvh - 40px); overflow: auto; }
  .dialog-head { margin-bottom: 20px; }
  .dialog-head h2 { font-size: 19px; }
  .dialog-actions .primary, .dialog-actions .secondary { flex: 1; padding-top: 12px; padding-bottom: 12px; }
  .confirm-dialog .dialog-actions { display: flex; }
  .toast { max-width: calc(100vw - 40px); text-align: center; }
}
