/* ═══════════════════════════════════════════════
   提醒清单 · 样式
   ═══════════════════════════════════════════════ */

:root {
  --brand:        #5B5BD6;
  --brand-dark:   #4A4AC4;
  --brand-soft:   #EEEEFB;
  --brand-line:   #D8D8F4;

  --ink:          #1C1C1E;
  --ink-2:        #52525B;
  --ink-3:        #8A8A93;
  --ink-4:        #B4B4BC;

  --bg:           #F4F4F7;
  --surface:      #FFFFFF;
  --surface-2:    #FAFAFC;
  --line:         #E8E8EE;
  --line-soft:    #F0F0F4;

  --p1:           #8A8A93;
  --p2:           #E8912F;
  --p3:           #E5484D;
  --danger:       #E5484D;

  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-xl: 24px;

  --sh-1: 0 1px 2px rgba(22,22,40,.05);
  --sh-2: 0 2px 8px rgba(22,22,40,.07);
  --sh-3: 0 10px 34px rgba(22,22,40,.12);
  --sh-4: 0 22px 60px rgba(22,22,40,.20);

  --sidebar-w: 268px;
  --ease: cubic-bezier(.32,.72,.28,1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

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

input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
svg { display: block; }
.is-hidden { display: none !important; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D3D3DC; border-radius: 9px; border: 2.5px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #B9B9C6; background-clip: content-box; }

/* ══════════ 登录页 ══════════ */
.auth-view {
  position: fixed; inset: 0;
  padding: 8vh 24px 40px;
  overflow-y: auto;
  overflow-x: hidden;
  text-align: center;
  background:
    radial-gradient(1100px 620px at 12% -10%, #E6E5FF 0%, transparent 58%),
    radial-gradient(900px 560px at 100% 106%, #FFE9E4 0%, transparent 55%),
    var(--bg);
}

.auth-card {
  width: 100%; max-width: 396px;
  margin: 0 auto;
  text-align: left;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-4);
  padding: 34px 30px 28px;
  animation: rise .5s var(--ease) both;
}

@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.985); } }

.auth-brand { text-align: center; margin-bottom: 24px; }
.brand-mark {
  width: 58px; height: 58px; margin: 0 auto 15px;
  display: grid; place-items: center;
  border-radius: 17px;
  background: linear-gradient(145deg, #6E6EE8, #4B4BC8);
  box-shadow: 0 10px 26px rgba(91,91,214,.36), inset 0 1px 0 rgba(255,255,255,.4);
  color: #fff;
}
.brand-mark svg { width: 30px; height: 30px; }
.auth-brand h1 { margin: 0; font-size: 23px; font-weight: 650; letter-spacing: -.3px; }
.auth-sub { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.65; }

.auth-tabs {
  display: flex; gap: 3px; padding: 3px;
  background: #EFEFF4; border-radius: 11px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 9px 4px;
  font-size: 13.5px; font-weight: 520; color: var(--ink-2);
  border-radius: 8px;
  transition: all .18s var(--ease);
}
.auth-tab.is-active { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--sh-1); }

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

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--ink-2); letter-spacing: .1px; }
.field input, .row-field textarea, .row-field select, .row-field input {
  width: 100%; padding: 11px 13px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
  font-size: 14.5px;
}
.field input:focus, .row-field textarea:focus, .row-field select:focus, .row-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px var(--brand-soft);
}
.field input::placeholder, .row-field textarea::placeholder { color: var(--ink-4); }

.row-inline { display: flex; gap: 8px; }
.row-inline input { flex: 1; min-width: 0; }

.btn-primary {
  margin-top: 2px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #6565DE, var(--brand));
  color: #fff;
  font-size: 15px; font-weight: 600; letter-spacing: 1.5px;
  border-radius: var(--r-md);
  box-shadow: 0 5px 16px rgba(91,91,214,.30);
  transition: transform .13s var(--ease), box-shadow .18s, opacity .18s;
}
.btn-primary:hover  { box-shadow: 0 7px 22px rgba(91,91,214,.40); }
.btn-primary:active { transform: scale(.977); }
.btn-primary:disabled { opacity: .55; box-shadow: none; cursor: default; transform: none; }

.btn-ghost {
  flex-shrink: 0;
  padding: 0 14px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px; font-weight: 600;
  border-radius: var(--r-md);
  white-space: nowrap;
  transition: background .16s, opacity .16s;
}
.btn-ghost:hover { background: #E3E3F8; }
.btn-ghost:disabled { opacity: .5; cursor: default; }

.btn-link {
  background: none; color: var(--ink-3);
  font-size: 13px; text-align: center; padding: 5px;
  transition: color .16s;
}
.btn-link:hover { color: var(--brand); }

.form-hint { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.6; text-align: center; }

.auth-msg {
  margin: 14px 0 0; padding: 10px 13px;
  font-size: 13px; border-radius: var(--r-sm); line-height: 1.55;
}
.auth-msg.is-error { background: #FEF1F2; color: #C0393D; border: 1px solid #FBD9DB; }
.auth-msg.is-info  { background: #EDF7F0; color: #2E7D4F; border: 1px solid #CDE9D8; }

.auth-foot { margin: 22px auto 0; max-width: 396px; font-size: 12px; color: var(--ink-4); text-align: center; }

/* ══════════ 主布局 ══════════ */
.app-view { position: fixed; inset: 0; display: flex; }

.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(20,20,32,.34);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity .26s var(--ease);
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

/* ── 侧栏 ── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  padding: 14px 10px 10px;
  overflow: hidden;
}

.sidebar-head {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 14px;
}
.avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #6E6EE8, #4B4BC8);
  color: #fff; font-size: 15px; font-weight: 650;
  text-transform: uppercase;
}
.user-meta { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.user-name {
  font-size: 12.5px; font-weight: 560; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 158px;
}
.btn-link-sm { font-size: 11.5px; color: var(--ink-4); text-align: left; transition: color .16s; }
.btn-link-sm:hover { color: var(--danger); }

.nav-block { display: flex; flex-direction: column; gap: 1px; }
.nav-scroll { overflow-y: auto; flex: 1; min-height: 0; padding-bottom: 6px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  text-align: left;
  transition: background .14s;
}
.nav-item:hover { background: #EFEFF4; }
.nav-item.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-item .nav-icon {
  width: 19px; height: 19px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--brand);
}
.nav-item.is-active .nav-icon { color: var(--brand); }
.nav-icon svg { width: 19px; height: 19px; }
.nav-icon.dot { width: 19px; height: 19px; }
.nav-icon.dot::before {
  content: ''; width: 11px; height: 11px; border-radius: 50%;
  background: var(--dot, var(--brand));
  box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--dot, var(--brand)) 20%, transparent);
}
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  font-size: 12px; font-weight: 600; color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.nav-item.is-active .nav-badge { color: var(--brand); }

.nav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 10px 7px;
  font-size: 11.5px; font-weight: 640; color: var(--ink-4);
  letter-spacing: .5px; text-transform: uppercase;
}

.sidebar-foot { padding: 9px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.chip-btn {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 8px 10px;
  font-size: 12.5px; font-weight: 520; color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: background .14s, color .14s;
}
.chip-btn:hover { background: #EFEFF4; }
.chip-btn.is-on { color: #2E7D4F; }
.chip-btn svg { width: 16px; height: 16px; }

/* ── 主区 ── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

.main-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 20px 13px;
  background: rgba(244,244,247,.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 5;
}
.menu-btn.icon-btn { display: none; }
.head-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.main-head h2 {
  margin: 0; font-size: 21px; font-weight: 680; letter-spacing: -.35px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.head-count { font-size: 13px; color: var(--ink-4); font-weight: 500; flex-shrink: 0; }
.head-actions { display: flex; gap: 3px; flex-shrink: 0; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: background .14s, color .14s, transform .14s;
}
.icon-btn:hover { background: #E9E9EF; color: var(--ink); }
.icon-btn:active { transform: scale(.93); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn-sm { width: 26px; height: 26px; }
.icon-btn-sm svg { width: 15px; height: 15px; }

.search-bar {
  display: flex; align-items: center; gap: 9px;
  margin: 0 20px; padding: 9px 13px;
  background: var(--surface);
  border: 1.5px solid var(--brand-line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  animation: rise .24s var(--ease) both;
}
.search-bar > svg { width: 17px; height: 17px; color: var(--ink-3); flex-shrink: 0; }
.search-bar input { flex: 1; min-width: 0; border: none; outline: none; background: none; font-size: 14.5px; }

/* ── 任务滚动区 ── */
.task-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 14px 20px 20px;
  scroll-behavior: smooth;
}

.task-group-label {
  margin: 6px 2px 8px;
  font-size: 12px; font-weight: 640; color: var(--ink-4);
  letter-spacing: .55px; text-transform: uppercase;
}

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

.task-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 13px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  border: 1px solid transparent;
  transition: box-shadow .18s, transform .18s var(--ease), border-color .18s, opacity .3s;
  animation: taskIn .28s var(--ease) both;
}
@keyframes taskIn { from { opacity: 0; transform: translateY(-7px) scale(.99); } }
.task-item:hover { box-shadow: var(--sh-2); border-color: var(--line); }
.task-item.is-done { background: var(--surface-2); box-shadow: none; }
.task-item.is-done .task-title { color: var(--ink-4); text-decoration: line-through; text-decoration-thickness: 1px; }
.task-item.is-removing { opacity: 0; transform: translateX(28px) scale(.96); }

.task-checkbox {
  width: 21px; height: 21px; flex-shrink: 0;
  margin-top: 1px;
  border: 1.9px solid var(--ink-4);
  border-radius: 50%;
  display: grid; place-items: center;
  color: transparent;
  background: transparent;
  transition: all .18s var(--ease);
  cursor: pointer;
}
.task-checkbox svg { width: 13px; height: 13px; }
.task-checkbox:hover { border-color: var(--brand); background: var(--brand-soft); }
.task-checkbox.is-checked {
  background: var(--brand); border-color: var(--brand); color: #fff;
  animation: pop .3s var(--ease);
}
@keyframes pop { 40% { transform: scale(1.22); } }

.task-checkbox-lg {
  width: 24px; height: 24px; flex-shrink: 0;
  appearance: none; -webkit-appearance: none;
  border: 2px solid var(--ink-4); border-radius: 50%;
  cursor: pointer; position: relative;
  transition: all .18s var(--ease);
}
.task-checkbox-lg:checked { background: var(--brand); border-color: var(--brand); }
.task-checkbox-lg:checked::after {
  content: ''; position: absolute; left: 7px; top: 3px;
  width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.3px 2.3px 0;
  transform: rotate(43deg);
}

.task-body { flex: 1; min-width: 0; cursor: pointer; }
.task-title {
  font-size: 14.5px; font-weight: 500; color: var(--ink);
  word-break: break-word; line-height: 1.45;
}
.task-item[data-prio="3"] .task-title { font-weight: 580; }

.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; margin-top: 5px; }
.task-meta:empty { display: none; }

.meta-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 520; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.meta-chip svg { width: 13.5px; height: 13.5px; }
.meta-chip.is-overdue { color: var(--danger); font-weight: 600; }
.meta-chip.is-today   { color: var(--brand); font-weight: 600; }
.meta-chip.is-p2 { color: var(--p2); }
.meta-chip.is-p3 { color: var(--p3); font-weight: 600; }
.meta-chip .dot-sep { opacity: .45; }

.task-note-preview {
  margin-top: 4px;
  font-size: 12.5px; color: var(--ink-4);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.completed-toggle {
  display: flex; align-items: center; gap: 7px;
  margin: 20px 2px 10px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  transition: color .16s;
}
.completed-toggle:hover { color: var(--brand); }
.completed-toggle svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.completed-toggle.is-open svg { transform: rotate(90deg); }
.completed-list { max-height: 0; overflow: hidden; transition: max-height .34s var(--ease); }
.completed-list.is-open { max-height: 4000px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 13px;
  padding: 68px 20px; text-align: center;
  animation: rise .4s var(--ease) both;
}
.empty-state svg {
  width: 44px; height: 44px; padding: 9px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 50%;
  box-sizing: content-box;
}
.empty-state p { margin: 0; font-size: 14px; color: var(--ink-3); }

/* ── 快速添加 ── */
.quick-add {
  display: flex; align-items: center; gap: 10px;
  margin: 0 20px 16px;
  padding: 5px 6px 5px 15px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  transition: border-color .18s, box-shadow .18s;
}
.quick-add:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-soft), var(--sh-2); }
.qa-icon { width: 19px; height: 19px; color: var(--brand); flex-shrink: 0; }
.quick-add input { flex: 1; min-width: 0; border: none; outline: none; background: none; padding: 9px 0; font-size: 14.5px; }
.quick-add input::placeholder { color: var(--ink-4); }
.qa-submit {
  flex-shrink: 0; padding: 8px 15px;
  background: var(--brand); color: #fff;
  font-size: 13.5px; font-weight: 600;
  border-radius: var(--r-md);
  transition: background .16s, transform .13s;
}
.qa-submit:hover { background: var(--brand-dark); }
.qa-submit:active { transform: scale(.95); }

/* ══════════ 抽屉 / 弹层 ══════════ */
.backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20,20,32,.38);
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .26s var(--ease);
}
.backdrop.is-open { opacity: 1; }

.sheet {
  position: fixed; z-index: 70;
  left: 50%; bottom: 0;
  width: min(560px, 100%);
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-4);
  transform: translate(-50%, 100%);
  transition: transform .34s var(--ease);
  overflow: hidden;
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet-sm { max-height: 74vh; }

.sheet-grip {
  width: 38px; height: 4.5px; flex-shrink: 0;
  margin: 9px auto 0;
  background: #DCDCDF; border-radius: 3px;
}

.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px 11px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.sheet-head h3 { flex: 1; margin: 0; font-size: 16px; font-weight: 650; }

.sheet-title-input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: none;
  font-size: 16.5px; font-weight: 560; color: var(--ink);
  padding: 2px 0;
}
.sheet-title-input::placeholder { color: var(--ink-4); font-weight: 500; }

.sheet-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 6px 18px 14px;
  display: flex; flex-direction: column;
}

.row-field {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.row-field:last-child { border-bottom: none; }
.row-label {
  display: flex; align-items: center; gap: 8px;
  width: 96px; flex-shrink: 0;
  font-size: 13.5px; font-weight: 540; color: var(--ink-2);
}
.row-label svg { width: 16px; height: 16px; color: var(--ink-3); }
.row-field > input, .row-field > select, .row-field > textarea { flex: 1; min-width: 0; }
.row-field textarea { resize: vertical; min-height: 62px; line-height: 1.55; }
.row-field select { cursor: pointer; appearance: none; background-image: none; padding-right: 30px; }
.row-field > .row-label + textarea { margin-top: 0; }
label.row-field { align-items: flex-start; }
label.row-field > .row-label { padding-top: 11px; }

.prio-group { display: flex; gap: 4px; flex: 1; padding: 3px; background: #F1F1F5; border-radius: 10px; }
.prio-group button {
  flex: 1; padding: 7px 4px;
  font-size: 13px; font-weight: 550; color: var(--ink-2);
  border-radius: 7.5px;
  transition: all .16s var(--ease);
}
.prio-group button.is-active { background: var(--surface); font-weight: 650; box-shadow: var(--sh-1); }
.prio-group button[data-p="1"].is-active { color: var(--p1); }
.prio-group button[data-p="2"].is-active { color: var(--p2); }
.prio-group button[data-p="3"].is-active { color: var(--p3); }

.color-group { display: flex; gap: 9px; flex: 1; }
.color-group button {
  width: 29px; height: 29px; border-radius: 50%;
  background: var(--c);
  border: 2.5px solid transparent;
  transition: transform .16s var(--ease), box-shadow .16s;
}
.color-group button:hover { transform: scale(1.1); }
.color-group button.is-active {
  box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 5px var(--c);
}

.sheet-foot {
  display: flex; gap: 10px; align-items: center;
  padding: 13px 18px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
  flex-shrink: 0;
}
.sheet-foot .btn-primary { flex: 1; margin: 0; letter-spacing: 0; }
.btn-danger {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 15px;
  color: var(--danger);
  font-size: 14px; font-weight: 560;
  border-radius: var(--r-md);
  transition: background .16s;
}
.btn-danger:hover { background: #FEF1F2; }
.btn-danger svg { width: 16px; height: 16px; }

/* ══════════ 提示 ══════════ */
.toast {
  position: fixed; z-index: 200;
  left: 50%; bottom: 34px;
  transform: translate(-50%, 22px);
  max-width: min(440px, calc(100vw - 40px));
  padding: 11px 19px;
  background: rgba(28,28,32,.94);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 13.5px; font-weight: 500;
  border-radius: 999px;
  box-shadow: var(--sh-3);
  opacity: 0; pointer-events: none;
  transition: opacity .26s var(--ease), transform .3s var(--ease);
  text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: rgba(190,50,55,.95); }

.loading-mask {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  background: rgba(244,244,247,.72);
  backdrop-filter: blur(3px);
}
.spinner {
  width: 30px; height: 30px;
  border: 2.8px solid var(--brand-line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .72s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════ 桌面悬浮窗模式 ══════════ */
.drag-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 30px; z-index: 500;
  display: flex; align-items: center; gap: 6px;
  padding: 0 7px 0 12px;
  background: rgba(246,246,249,.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  user-select: none; -webkit-user-select: none;
}
.drag-grip { flex: 1; align-self: stretch; position: relative; cursor: default; }
.drag-grip::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 34px; height: 4px; margin: -2px 0 0 -17px;
  background: #D2D2DC; border-radius: 2px;
}
.drag-actions { display: flex; gap: 3px; align-self: stretch; align-items: center; }
.drag-btn {
  width: 26px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px; color: var(--ink-2);
  transition: background .14s, color .14s, opacity .14s;
}
.drag-btn svg { width: 14px; height: 14px; }
.drag-btn:hover { background: #E4E4EA; color: var(--ink); }
.drag-btn.is-off { opacity: .45; }
.drag-btn-close:hover { background: #FDE8E8; color: var(--danger); }

body.is-desktop .app-view  { top: 30px; }
body.is-desktop .auth-view { top: 30px; }
body.is-desktop .toast     { bottom: 46px; }

/* ══════════ 响应式 ══════════ */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
    width: min(288px, 84vw);
    transform: translateX(-102%);
    transition: transform .3s var(--ease);
    box-shadow: var(--sh-4);
    background: var(--surface);
  }
  .sidebar.is-open { transform: translateX(0); }
  .menu-btn.icon-btn { display: grid; }
  .main-head { padding: 12px 14px 11px; }
  .main-head h2 { font-size: 19px; }
  .task-scroll { padding: 12px 13px 16px; }
  .quick-add { margin: 0 13px calc(13px + env(safe-area-inset-bottom)); }
  .search-bar { margin: 0 13px; }
  .sheet { width: 100%; max-height: 92vh; }
  .row-label { width: 84px; }
  .auth-card { padding: 28px 22px 24px; }
}

@media (max-width: 380px) {
  .head-count { display: none; }
  .auth-brand h1 { font-size: 21px; }
  .row-label { width: 74px; font-size: 13px; }
}

@media (min-width: 861px) {
  .sheet {
    left: 50%; bottom: auto; top: 50%;
    transform: translate(-50%, -46%) scale(.97);
    opacity: 0;
    border-radius: var(--r-xl);
    max-height: 84vh;
  }
  .sheet.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 18px; }
}

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

/* 大屏下限制正文宽度，避免长行难读 */
@media (min-width: 1000px) {
  .task-scroll { max-width: 900px; margin-left: auto; margin-right: auto; width: 100%; }
  .search-bar  { max-width: 860px; margin-left: auto; margin-right: auto; }
  .quick-add   { max-width: 860px; margin-left: auto; margin-right: auto; }
}
