/* ===================================================================
   任务台 TaskDesk — 设计系统
   =================================================================== */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  /* 浅色 */
  --bg: #f4f5f8;
  --bg-elev: #ffffff;
  --bg-soft: #eceef3;
  --bg-hover: #e6e9f0;
  --card: #ffffff;
  --card-2: #fbfbfd;
  --text: #1c2030;
  --text-dim: #5b6377;
  --text-mute: #8b93a7;
  --border: #e3e6ee;
  --border-strong: #d2d7e3;
  --accent: #6366f1;
  --accent-soft: #eaeaff;
  --accent-text: #4f46e5;
  --shadow: 0 1px 2px rgba(20,24,40,.06), 0 8px 24px rgba(20,24,40,.06);
  --shadow-lg: 0 12px 40px rgba(20,24,40,.16);
  --ok: #16a34a;  --ok-soft:#dcfce7;
  --warn: #d97706; --warn-soft:#fef3c7;
  --danger: #dc2626; --danger-soft:#fee2e2;
  --info: #0ea5e9;
  --p0:#94a3b8; --p1:#0ea5e9; --p2:#f59e0b; --p3:#ef4444;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
}
[data-theme="dark"] {
  --bg: #0e1016;
  --bg-elev: #171a22;
  --bg-soft: #1c202b;
  --bg-hover: #222634;
  --card: #171a22;
  --card-2: #1b1f29;
  --text: #e8eaf1;
  --text-dim: #a3abbd;
  --text-mute: #6b7488;
  --border: #262b38;
  --border-strong: #333a4b;
  --accent: #7c81ff;
  --accent-soft: #22243a;
  --accent-text: #a9adff;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
  --shadow-lg: 0 16px 50px rgba(0,0,0,.55);
  --ok:#22c55e; --ok-soft:#0f2a1a;
  --warn:#f59e0b; --warn-soft:#2a2110;
  --danger:#f87171; --danger-soft:#2a1414;
  --info:#38bdf8;
  --p0:#64748b; --p1:#38bdf8; --p2:#fbbf24; --p3:#f87171;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow: hidden;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
::selection { background: var(--accent); color: #fff; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); background-clip: padding-box; }

/* ================= 登录 ================= */
.login-wrap {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(99,102,241,.22), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(14,165,233,.18), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(90vw, 360px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 34px 30px 30px;
  text-align: center;
  animation: pop .4s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.login-logo { font-size: 44px; }
.login-card h1 { font-size: 26px; margin-top: 8px; letter-spacing: .5px; }
.login-sub { color: var(--text-mute); font-size: 13px; margin: 4px 0 22px; }
#loginForm { display: flex; flex-direction: column; gap: 12px; }
#loginPw {
  padding: 13px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-soft);
  color: var(--text); outline: none; transition: border .15s, box-shadow .15s;
}
#loginPw:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#loginBtn {
  padding: 13px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
  transition: transform .1s, filter .15s;
}
#loginBtn:hover { filter: brightness(1.08); }
#loginBtn:active { transform: scale(.98); }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 10px; }
.login-foot { color: var(--text-mute); font-size: 12px; }

/* ================= 布局 ================= */
.app { display: flex; height: 100vh; height: 100dvh; }

/* 侧边栏 */
.sidebar {
  width: 258px; flex-shrink: 0;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 14px 12px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; }
.brand-logo { font-size: 22px; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; flex: 1; }
.sidebar .sidebar-close { display: none; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 14.5px; font-weight: 500;
  transition: background .13s, color .13s;
}
.nav-item .nav-ic { font-size: 16px; width: 20px; text-align: center; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-count {
  margin-left: auto; font-size: 12px; color: var(--text-mute);
  background: var(--bg-soft); padding: 1px 8px; border-radius: 20px; min-width: 20px; text-align: center;
}
.nav-item.active .nav-count { background: var(--accent); color: #fff; }

.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 10px 8px; color: var(--text-mute);
  font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
}
.projects { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.proj-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 14px; cursor: pointer;
  transition: background .13s; position: relative;
}
.proj-item:hover { background: var(--bg-hover); color: var(--text); }
.proj-item.active { background: var(--bg-soft); color: var(--text); font-weight: 600; }
.proj-emoji { font-size: 15px; }
.proj-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.proj-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-cnt { font-size: 12px; color: var(--text-mute); }
.proj-item .proj-menu { opacity: 0; font-size: 16px; padding: 0 2px; color: var(--text-mute); }
.proj-item:hover .proj-menu { opacity: 1; }

.side-foot { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 8px; }
.ghost-btn {
  flex: 1; padding: 9px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 13px; background: var(--bg-soft);
  transition: background .13s, color .13s;
}
.ghost-btn:hover { background: var(--bg-hover); color: var(--text); }

.icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 16px; transition: background .13s, color .13s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

.scrim { display: none; }

/* 主区 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; border-bottom: 1px solid var(--border);
  background: var(--bg-elev); flex-shrink: 0;
}
.menu-btn { display: none; }
.view-title { font-size: 19px; font-weight: 700; white-space: nowrap; }
.search-box {
  flex: 1; max-width: 420px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid transparent;
  border-radius: 20px; padding: 7px 14px; transition: border .15s, background .15s;
}
.search-box:focus-within { border-color: var(--accent); background: var(--bg-elev); }
.search-ic { font-size: 13px; opacity: .6; }
#searchInput { flex: 1; border: none; background: none; outline: none; color: var(--text); }
.focus-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 20px;
  background: var(--bg-soft); color: var(--text-dim); font-size: 13px; font-weight: 600;
  transition: background .13s, color .13s;
}
.focus-chip:hover { background: var(--bg-hover); color: var(--text); }
.focus-chip.running { background: var(--ok-soft); color: var(--ok); }
.focus-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .5; }
.focus-chip.running .focus-dot { opacity: 1; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* 快速添加 */
.quickadd {
  display: flex; gap: 10px; padding: 14px 22px 4px;
}
#quickInput {
  flex: 1; padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  outline: none; transition: border .15s, box-shadow .15s;
}
#quickInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick-proj {
  padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-dim);
  outline: none; max-width: 160px;
}

.views { flex: 1; overflow-y: auto; padding: 10px 22px 40px; }
.view { animation: fade .25s; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ================= 任务卡片 ================= */
.section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text-dim);
  margin: 20px 2px 10px; letter-spacing: .3px;
}
.section-label .cnt { color: var(--text-mute); font-weight: 500; }
.section-label.overdue { color: var(--danger); }

.task {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px 15px; margin-bottom: 9px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s, box-shadow .15s, border-color .15s, opacity .2s;
  position: relative;
}
.task:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.task.done { opacity: .58; }
.task.done .task-title { text-decoration: line-through; color: var(--text-mute); }
.task-check {
  width: 21px; height: 21px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  border: 2px solid var(--border-strong); position: relative;
  transition: background .15s, border-color .15s;
}
.task-check:hover { border-color: var(--accent); }
.task.done .task-check { background: var(--ok); border-color: var(--ok); }
.task.done .task-check::after {
  content: "✓"; position: absolute; inset: 0; color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14.5px; font-weight: 500; word-break: break-word; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px;
  background: var(--bg-soft); color: var(--text-dim);
}
.chip.proj { gap: 6px; }
.chip .cdot { width: 7px; height: 7px; border-radius: 50%; }
.chip.due { background: var(--bg-soft); }
.chip.due.today { background: var(--warn-soft); color: var(--warn); }
.chip.due.over { background: var(--danger-soft); color: var(--danger); }
.chip.tag { background: var(--accent-soft); color: var(--accent-text); }
.chip.sub { background: var(--bg-soft); }
.prio-bar {
  position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px;
}
.prio-flag { font-size: 11.5px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.prio-1 { color: var(--p1); background: color-mix(in srgb, var(--p1) 15%, transparent); }
.prio-2 { color: var(--p2); background: color-mix(in srgb, var(--p2) 16%, transparent); }
.prio-3 { color: var(--p3); background: color-mix(in srgb, var(--p3) 16%, transparent); }
.task-play {
  opacity: 0; align-self: center; font-size: 15px; padding: 4px 8px; border-radius: 8px;
  color: var(--text-mute); transition: opacity .13s, background .13s, color .13s;
}
.task:hover .task-play { opacity: 1; }
.task-play:hover { background: var(--ok-soft); color: var(--ok); }

.empty {
  text-align: center; color: var(--text-mute); padding: 60px 20px;
}
.empty .emoji { font-size: 46px; display: block; margin-bottom: 12px; }
.empty .big { font-size: 16px; color: var(--text-dim); margin-bottom: 4px; }

/* ================= 看板 ================= */
.board { display: flex; gap: 16px; align-items: flex-start; min-height: 100%; padding-bottom: 10px; }
.board-col {
  flex: 1; min-width: 260px; max-width: 380px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px; display: flex; flex-direction: column;
  transition: background .15s, outline .15s;
}
.board-col.drop { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--accent-soft); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; font-weight: 700; font-size: 14px; }
.col-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.col-head .col-cnt { margin-left: auto; font-size: 12px; color: var(--text-mute); background: var(--bg-elev); padding: 1px 9px; border-radius: 20px; }
.col-body { display: flex; flex-direction: column; gap: 9px; min-height: 30px; flex: 1; }
.board .task { cursor: grab; margin-bottom: 0; }
.board .task.dragging { opacity: .4; }
.col-add {
  margin-top: 8px; padding: 9px; border-radius: var(--radius-sm);
  color: var(--text-mute); font-size: 13px; text-align: center;
  border: 1px dashed var(--border-strong); transition: background .13s, color .13s;
}
.col-add:hover { background: var(--bg-hover); color: var(--text); }
.todo-dot { background: var(--p1); } .doing-dot { background: var(--p2); } .done-dot { background: var(--ok); }

/* ================= 列表 ================= */
.list-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.seg { display: flex; background: var(--bg-soft); border-radius: 20px; padding: 3px; }
.seg button { padding: 5px 14px; border-radius: 18px; font-size: 13px; color: var(--text-dim); font-weight: 500; }
.seg button.on { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow); }
.list-toolbar select {
  padding: 7px 12px; border-radius: 18px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text-dim); outline: none;
}

/* ================= 日历 ================= */
.cal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cal-head h3 { font-size: 17px; min-width: 130px; text-align: center; }
.cal-nav { display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--text-mute); font-weight: 600; padding-bottom: 4px; }
.cal-cell {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-height: 96px; padding: 7px 8px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .13s; overflow: hidden;
}
.cal-cell:hover { border-color: var(--border-strong); }
.cal-cell.other { opacity: .4; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-daynum { font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.cal-cell.today .cal-daynum { color: var(--accent-text); }
.cal-task {
  font-size: 11.5px; padding: 3px 7px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #fff; opacity: .95;
}
.cal-task.done { text-decoration: line-through; opacity: .55; }
.cal-more { font-size: 11px; color: var(--text-mute); }

/* ================= 统计 ================= */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.stat-card .num { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.stat-card .lbl { color: var(--text-mute); font-size: 13px; margin-top: 2px; }
.stat-card .ic { font-size: 20px; float: right; opacity: .8; }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.panel h3 { font-size: 15px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.bar {
  width: 100%; max-width: 30px; border-radius: 6px 6px 0 0;
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 60%, transparent));
  min-height: 3px; transition: height .5s cubic-bezier(.2,.8,.2,1); position: relative;
}
.bar.focus { background: linear-gradient(var(--info), color-mix(in srgb, var(--info) 55%, transparent)); }
.bar-val { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.bar-lbl { font-size: 10.5px; color: var(--text-mute); }
.distrib { display: flex; flex-direction: column; gap: 12px; }
.distrib-row { display: flex; align-items: center; gap: 12px; }
.distrib-row .dr-name { width: 120px; font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 7px; }
.distrib-row .dr-track { flex: 1; height: 10px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; }
.distrib-row .dr-fill { height: 100%; border-radius: 6px; transition: width .5s; }
.distrib-row .dr-num { width: 34px; text-align: right; font-size: 13px; color: var(--text-dim); font-weight: 600; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 780px) { .two-col { grid-template-columns: 1fr; } }

/* ================= 抽屉(任务详情) ================= */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.drawer-scrim.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(92vw, 440px);
  background: var(--bg-elev); border-left: 1px solid var(--border); z-index: 61;
  transform: translateX(100%); transition: transform .26s cubic-bezier(.3,.8,.3,1);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.on { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drawer-head .dh-title { flex: 1; font-size: 13px; color: var(--text-mute); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 20px 40px; }
.d-check-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.d-title-input {
  flex: 1; font-size: 19px; font-weight: 600; border: none; background: none;
  color: var(--text); outline: none; resize: none; line-height: 1.4; overflow: hidden;
}
.field { margin-bottom: 18px; }
.field-label { font-size: 12px; color: var(--text-mute); font-weight: 600; margin-bottom: 7px; letter-spacing: .4px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.d-select, .d-input {
  padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); outline: none; width: 100%;
  transition: border .15s;
}
.d-select:focus, .d-input:focus { border-color: var(--accent); }
.d-notes { min-height: 90px; resize: vertical; line-height: 1.6; }
.prio-picker { display: flex; gap: 8px; }
.prio-opt {
  flex: 1; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-soft); font-size: 13px; color: var(--text-dim); text-align: center; font-weight: 600;
  transition: all .13s;
}
.prio-opt.on { color: #fff; border-color: transparent; }
.prio-opt[data-p="0"].on { background: var(--p0); }
.prio-opt[data-p="1"].on { background: var(--p1); }
.prio-opt[data-p="2"].on { background: var(--p2); }
.prio-opt[data-p="3"].on { background: var(--p3); }

.subs { display: flex; flex-direction: column; gap: 6px; }
.sub-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px; }
.sub-check {
  width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border-strong);
  flex-shrink: 0; position: relative; cursor: pointer; transition: all .13s;
}
.sub-check.on { background: var(--ok); border-color: var(--ok); }
.sub-check.on::after { content:"✓"; position:absolute; inset:0; color:#fff; font-size:11px; display:flex; align-items:center; justify-content:center; }
.sub-row .sub-t { flex: 1; font-size: 14px; }
.sub-row.done .sub-t { text-decoration: line-through; color: var(--text-mute); }
.sub-row .sub-del { opacity: 0; color: var(--text-mute); font-size: 14px; }
.sub-row:hover .sub-del { opacity: 1; }
.sub-add { display: flex; gap: 8px; margin-top: 6px; }
.sub-add input { flex: 1; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); outline: none; }
.tag-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-edit .chip.tag { cursor: default; }
.tag-edit .chip .x { cursor: pointer; opacity: .6; }
.tag-edit input { border: none; background: none; outline: none; color: var(--text); min-width: 80px; flex: 1; }
.drawer-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.btn-primary { padding: 10px 18px; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-weight: 600; transition: filter .13s, transform .1s; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(.98); }
.btn-ghost { padding: 10px 18px; border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--text-dim); font-weight: 600; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger { color: var(--danger); }
.d-focus-btn { width: 100%; padding: 11px; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ================= 专注面板 ================= */
.focus-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 70;
  width: 280px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 18px;
  transform: translateY(140%); opacity: 0; transition: transform .3s cubic-bezier(.2,.9,.3,1.1), opacity .3s;
}
.focus-panel.on { transform: translateY(0); opacity: 1; }
.focus-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.focus-ring-wrap { position: relative; width: 180px; height: 180px; margin: 4px auto 10px; }
.focus-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg-soft); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear, stroke .3s; }
.focus-panel.running .ring-fg { stroke: var(--ok); }
.focus-time { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.focus-task { text-align: center; color: var(--text-dim); font-size: 13px; margin-bottom: 12px; min-height: 18px; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-presets { display: flex; gap: 6px; margin-bottom: 14px; }
.focus-presets button { flex: 1; padding: 7px; border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--text-dim); font-weight: 600; font-size: 13px; transition: all .13s; }
.focus-presets button.on { background: var(--accent); color: #fff; }
.focus-actions { display: flex; gap: 8px; }
.focus-actions .btn-primary { flex: 1; }
.focus-today { text-align: center; color: var(--text-mute); font-size: 12px; margin-top: 12px; }

/* ================= 弹窗 ================= */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 80;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.modal-scrim.on { opacity: 1; pointer-events: auto; }
.modal {
  width: min(92vw, 400px); background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 24px;
  transform: scale(.94); transition: transform .2s;
}
.modal-scrim.on .modal { transform: scale(1); }
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal .m-row { margin-bottom: 14px; }
.modal label { display: block; font-size: 12px; color: var(--text-mute); margin-bottom: 6px; font-weight: 600; }
.modal input, .modal select { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); outline: none; }
.modal input:focus { border-color: var(--accent); }
.emoji-row, .color-row { display: flex; gap: 6px; flex-wrap: wrap; }
.emoji-pick, .color-pick { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 17px; border: 2px solid transparent; transition: transform .1s; }
.emoji-pick { background: var(--bg-soft); }
.emoji-pick.on { border-color: var(--accent); }
.color-pick.on { border-color: var(--text); transform: scale(1.12); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ================= 提示条 ================= */
.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 22px;
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .3s cubic-bezier(.2,.9,.3,1.2); display: flex; align-items: center; gap: 8px;
}
.toast.ok { background: var(--ok); color: #fff; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } }

/* ================= 响应式 ================= */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100%;
    transform: translateX(-100%); transition: transform .26s cubic-bezier(.3,.8,.3,1);
    box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .sidebar .sidebar-close { display: inline-flex; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }
  .views { padding: 10px 14px 40px; }
  .quickadd { padding: 12px 14px 4px; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .search-box { max-width: none; }
  .board { overflow-x: auto; }
  .focus-panel { right: 12px; left: 12px; bottom: 12px; width: auto; }
}
@media (max-width: 560px) {
  .view-title { display: none; }
  .quick-proj { display: none; }
  .search-box { padding: 7px 12px; }
  .stat-card .num { font-size: 26px; }
}
