  :root {
    --paper: #f5f0e8;
    --card: #fffdf9;
    --ink: #3a342e;
    --ink-soft: #8a8178;
    --line: #e7dfd2;
    --plum: #6b5b95;
    --deep: #6b5b95;
    --daily: #cf9a4b;
    --diary: #d18299;
    --project: #6fa287;
    --study: #5b84c4;
    --reading: #4ba39b;
    --danger: #c76b5a;
    --happy: #7fb77e;
    --sad: #7a9cc6;
    --calm: #b0aaa0;
    --radius: 16px;
    --shadow: 0 2px 14px rgba(90, 78, 60, 0.08);
  }

  * { box-sizing: border-box; }
  [hidden] { display: none !important; }

  html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
      "Microsoft YaHei", "Segoe UI", "Nunito", sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  .wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 18px 80px;
  }

  .os-header { margin-bottom: 18px; }
  .os-header h1 { margin: 0; }
  .view-tabs {
    display: flex; gap: 8px; margin: 18px 0; padding: 5px;
    border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.45);
  }
  .view-tab {
    flex: 1; border: 0; border-radius: 10px; padding: 10px 16px;
    background: transparent; color: var(--ink-soft); font: inherit; font-weight: 700; cursor: pointer;
  }
  .view-tab.active { background: var(--plum); color: #fff; box-shadow: var(--shadow); }
  .app-view { min-height: 280px; }
  .section-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px;
  }
  .section-head h2 { margin: 0 0 8px; font-size: 19px; }
  .section-head-actions { display: flex; gap: 8px; flex-shrink: 0; }
  .section-head .statsbar { margin-bottom: 0; }
  .summary-line { color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
  .governance-export { text-decoration: none; }
  .governance-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
  }
  .governance-title { display: flex; justify-content: space-between; gap: 12px; }
  .governance-card p { white-space: pre-wrap; overflow-wrap: anywhere; }
  .governance-meta, .governance-timeline {
    color: var(--ink-soft); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere;
  }
  .governance-detail { margin-top: 10px; }

  header.top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
  }

  h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0;
  }
  h1 .dot { color: var(--diary); }
  .subtitle {
    color: var(--ink-soft);
    font-size: 13px;
    margin: 2px 0 16px;
  }

  /* 顶部总统计 */
  .statsbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
  }
  .stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px;
  }
  .stat .swatch { width: 8px; height: 8px; border-radius: 50%; }
  .stat[data-k="deep"] .swatch { background: var(--deep); }
  .stat[data-k="daily"] .swatch { background: var(--daily); }
  .stat[data-k="diary"] .swatch { background: var(--diary); }
  .stat[data-k="project"] .swatch { background: var(--project); }
  .stat[data-k="study"] .swatch { background: var(--study); }
  .stat[data-k="reading"] .swatch { background: var(--reading); }
  .stat.total { background: var(--ink); color: #fff; border-color: transparent; }

  /* 日历 */
  .calendar {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 14px;
    margin-bottom: 14px;
  }
  .cal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
  }
  .cal-arrow {
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--ink);
    width: 30px; height: 30px;
    border-radius: 9px;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s;
  }
  .cal-arrow:hover { background: #ece4d6; }
  .cal-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    min-width: 118px;
    text-align: center;
    border: 0;
    background: transparent;
    color: var(--ink);
    padding: 4px 6px;
    font-family: inherit;
  }
  .cal-title:hover { color: var(--plum); }

  .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
  .cal-head {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-soft);
    padding: 4px 0 8px;
  }
  .cal-cell {
    position: relative;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    border-radius: 10px;
    transition: background 0.12s;
  }
  .cal-cell.cal-empty { visibility: hidden; }
  .cal-cell.has { cursor: pointer; }
  .cal-cell.has:hover { background: #f2ece2; }
  .cal-cell.today {
    background: rgba(107, 91, 149, 0.12);
    color: var(--plum);
    font-weight: 800;
    box-shadow: inset 0 0 0 1.5px var(--plum);
  }
  .cal-cell.selected,
  .cal-cell.selected:hover,
  .cal-cell.today.selected {
    background: var(--plum);
    color: #fff;
    font-weight: 800;
    box-shadow: none;
  }

  .cal-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 1px;
  }
  .cal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--plum); }
  .cal-badge.happy .cal-dot { background: var(--happy); }
  .cal-badge.sad .cal-dot { background: var(--sad); }
  .cal-badge.calm .cal-dot { background: var(--calm); }
  .cal-num { font-size: 9px; font-weight: 700; color: var(--ink-soft); }
  .cal-cell.selected .cal-num { color: #fff; }
  .cal-cell.selected .cal-dot { box-shadow: 0 0 0 1px rgba(255,255,255,0.6); }

  .cal-task-badge {
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    min-width: 25px;
    height: 15px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }
  .cal-task-badge.pending { color: #91601f; background: rgba(207, 154, 75, 0.18); }
  .cal-task-badge.overdue { color: var(--danger); background: rgba(199, 107, 90, 0.16); }
  .cal-task-badge.done { color: #47785f; background: rgba(111, 162, 135, 0.18); }
  .cal-cell.selected .cal-task-badge {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
  }

  .cal-monthstats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--ink-soft);
  }
  .cal-monthstats .ms-total { font-weight: 700; color: var(--ink); }
  .cal-monthstats .ms {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .cal-monthstats .ms .d { width: 8px; height: 8px; border-radius: 50%; }
  .ms.happy .d { background: var(--happy); }
  .ms.sad .d { background: var(--sad); }
  .ms.calm .d { background: var(--calm); }
  .cal-monthstats .monthstat-divider { width: 1px; height: 14px; background: var(--line); }
  .cal-monthstats .ms.task { font-weight: 600; }
  .cal-monthstats .ms.task.pending { color: #91601f; }
  .cal-monthstats .ms.task.overdue { color: var(--danger); }
  .cal-monthstats .ms.task.done { color: #47785f; }

  /* 当日详情 */
  .day-detail { margin-bottom: 20px; scroll-margin-top: 12px; }
  .day-detail-head {
    font-size: 13px;
    font-weight: 700;
    color: var(--plum);
    margin: 0 2px 10px;
  }
  .day-detail-section { margin-bottom: 18px; }
  .day-detail-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 2px 9px;
  }
  .day-detail-section-head h3,
  .day-detail-section-title { margin: 0 2px 9px; font-size: 14px; color: var(--ink); }
  .day-detail-section-head h3 { margin: 0; }
  .day-detail-link {
    border: 0;
    background: transparent;
    color: var(--plum);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 0;
  }
  .day-detail-link:hover { text-decoration: underline; }
  .day-task-list {
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 13px;
    box-shadow: var(--shadow);
  }
  .day-task-row {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }
  .day-task-row:last-child { border-bottom: 0; }
  .day-task-row.completed { opacity: 0.68; }
  .day-task-row.completed strong { text-decoration: line-through; }
  .day-task-row.overdue .day-task-state,
  .day-task-row.overdue .day-task-main > span { color: var(--danger); }
  .day-task-state {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #91601f;
    background: rgba(207, 154, 75, 0.14);
    font-size: 12px;
    font-weight: 900;
  }
  .day-task-row.completed .day-task-state { color: #47785f; background: rgba(111, 162, 135, 0.16); }
  .day-task-row.overdue .day-task-state { background: rgba(199, 107, 90, 0.14); }
  .day-task-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
  .day-task-main strong { font-size: 14px; overflow-wrap: anywhere; }
  .day-task-main > span, .day-task-done, .day-task-summary { color: var(--ink-soft); font-size: 11px; }
  .day-task-done { white-space: nowrap; }
  .day-task-summary { margin: 7px 3px 0; }

  /* 搜索 + 分类 */
  .toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }
  .searchrow { display: flex; gap: 10px; }
  input[type="text"], input[type="datetime-local"], textarea, select {
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  input[type="text"]:focus, input[type="datetime-local"]:focus, textarea:focus, select:focus {
    border-color: var(--plum);
    box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.12);
  }
  .searchrow input { flex: 1; }

  .btn {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    padding: 11px 18px;
    cursor: pointer;
    transition: transform 0.08s, opacity 0.15s;
    white-space: nowrap;
  }
  .btn:active { transform: scale(0.97); }
  .btn-primary { background: var(--plum); color: #fff; }
  .btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }

  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip {
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.15s;
  }
  .chip.active { color: #fff; border-color: transparent; }
  .chip.active[data-cat="all"] { background: var(--ink); }
  .chip.active[data-cat="deep"] { background: var(--deep); }
  .chip.active[data-cat="daily"] { background: var(--daily); }
  .chip.active[data-cat="diary"] { background: var(--diary); }
  .chip.active[data-cat="project"] { background: var(--project); }
  .chip.active[data-cat="study"] { background: var(--study); }
  .chip.active[data-cat="reading"] { background: var(--reading); }
  .status-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
  .status-tab {
    border: 1px solid var(--line); background: var(--card); color: var(--ink-soft);
    border-radius: 10px; padding: 7px 12px; cursor: pointer; font-size: 13px;
  }
  .status-tab.active { background: var(--plum); color: #fff; border-color: var(--plum); }
  .stars { color: #c58a2a; letter-spacing: 1px; white-space: nowrap; }
  .status-mark { color: var(--ink-soft); font-size: 12px; }

  .count { color: var(--ink-soft); font-size: 13px; margin: 0 2px 12px; }

  /* 记忆卡片 */
  .card {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 18px 14px 20px;
    margin-bottom: 14px;
    overflow: hidden;
  }
  .card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
  }
  .card[data-cat="deep"]::before { background: var(--deep); }
  .card[data-cat="daily"]::before { background: var(--daily); }
  .card[data-cat="diary"]::before { background: var(--diary); }
  .card[data-cat="project"]::before { background: var(--project); }
  .card[data-cat="study"]::before { background: var(--study); }
  .card[data-cat="reading"]::before { background: var(--reading); }
  .card.selected {
    box-shadow: 0 0 0 2px var(--plum), var(--shadow);
  }
  .card-select {
    width: 18px;
    height: 18px;
    margin: 0 2px 0 0;
    accent-color: var(--plum);
    cursor: pointer;
  }

  /* 批量操作栏 */
  .batchbar {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: calc(100% - 36px);
    max-width: 684px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(90, 78, 60, 0.18);
    padding: 10px 14px;
  }
  .batch-selectall {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    white-space: nowrap;
  }
  .batch-selectall input { width: 16px; height: 16px; accent-color: var(--plum); }
  .batch-count { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
  .batch-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }

  .card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
  }
  .catlabel {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    color: #fff;
  }
  .card[data-cat="deep"] .catlabel { background: var(--deep); }
  .card[data-cat="daily"] .catlabel { background: var(--daily); }
  .card[data-cat="diary"] .catlabel { background: var(--diary); }
  .card[data-cat="project"] .catlabel { background: var(--project); }
  .card[data-cat="study"] .catlabel { background: var(--study); }
  .card[data-cat="reading"] .catlabel { background: var(--reading); }

  .mood {
    font-size: 12px;
    color: var(--ink-soft);
    background: #f2ece2;
    padding: 3px 9px;
    border-radius: 999px;
  }
  .idtag {
    font-size: 11px;
    color: #c3bab0;
    font-family: ui-monospace, monospace;
    margin-left: auto;
  }
  .content {
    font-size: 15px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
  }
  .memory-content.collapsed {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
  }
  .memory-content.expanded { display: block; }
  .content-toggle {
    display: block;
    margin: 7px 0 0;
    padding: 3px 0;
    border: 0;
    background: transparent;
    color: var(--plum);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }
  .content-toggle:hover { text-decoration: underline; }
  .content-toggle[hidden] { display: none; }
  .card-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
  }
  .tags { display: flex; flex-wrap: wrap; gap: 6px; }
  .tag {
    font-size: 12px;
    color: var(--plum);
    background: rgba(107, 91, 149, 0.09);
    padding: 2px 9px;
    border-radius: 6px;
  }
  .time { font-size: 12px; color: var(--ink-soft); }
  .actions { margin-left: auto; display: flex; gap: 6px; }
  .iconbtn {
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
  }
  .iconbtn:hover { background: #f2ece2; color: var(--ink); }
  .iconbtn.del:hover { color: var(--danger); }
  .iconbtn.complete { color: var(--project); }

  .task-card {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 12px;
  }
  .task-card[data-status="completed"] { opacity: 0.72; }
  .task-card[data-status="completed"] h3 { text-decoration: line-through; }
  .task-main { min-width: 0; flex: 1; }
  .task-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .task-title-row h3 { margin: 0; font-size: 16px; }
  .task-priority { color: #c58a2a; font-size: 13px; letter-spacing: 1px; }
  /* 闹钟标记：只有提醒没有截止的任务，划掉标题时也别把图标划掉 */
  .task-alarm-mark { font-size: 14px; text-decoration: none; display: inline-block; }
  .task-card[data-status="completed"] .task-alarm-mark { opacity: 0.5; }
  .task-description { margin: 8px 0; color: var(--ink); white-space: pre-wrap; line-height: 1.55; }
  .task-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; color: var(--ink-soft); font-size: 12px; }
  .task-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
  .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

  .empty {
    text-align: center;
    color: var(--ink-soft);
    padding: 60px 20px;
    font-size: 15px;
    line-height: 1.8;
  }

  /* modal */
  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(58, 52, 46, 0.32);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 50;
  }
  .overlay.show { display: flex; }
  .modal {
    background: var(--card);
    width: 100%;
    max-width: 560px;
    border-radius: 20px 20px 0 0;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
  }
  @media (min-width: 640px) {
    .overlay { align-items: center; }
    .modal { border-radius: 20px; }
  }
  @media (max-width: 560px) {
    .section-head, .task-card { flex-direction: column; }
    .section-head .btn { width: 100%; }
    .task-actions { width: 100%; justify-content: flex-start; }
    .field-grid { grid-template-columns: 1fr; gap: 0; }
  }
  .modal h2 { margin: 0 0 18px; font-size: 19px; }
  .field { margin-bottom: 14px; }
  .field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
  }
  .field input, .field textarea, .field select { width: 100%; }
  .field.checkline { display: flex; align-items: center; gap: 9px; }
  .field.checkline input { width: auto; }
  .field.checkline label { margin: 0; color: var(--ink); }
  .field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
  .modal-actions { display: flex; gap: 10px; margin-top: 20px; }
  .modal-actions .btn { flex: 1; }

  .toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink);
    color: #fff;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s;
    z-index: 60;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ---------- 闹钟响铃 ---------- */
  .task-card.ringing { border: 1.5px solid var(--danger); box-shadow: 0 2px 14px rgba(199, 107, 90, 0.22); }
  .ringing-banner {
    color: var(--danger);
    font-weight: 700;
    font-size: 13px;
    margin: 4px 0;
    animation: zuki-ring-pulse 1.2s ease-in-out infinite;
  }
  .task-repeat { color: var(--plum); }
  @keyframes zuki-ring-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
  }

  /* ---------- 仪表盘 ---------- */
  .dash-section-title { margin: 18px 0 10px; font-size: 15px; color: var(--ink); }
  .dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  .dash-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    text-align: center;
  }
  .dash-card .dash-value { font-size: 24px; font-weight: 700; color: var(--ink); }
  .dash-card .dash-label { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
  .dash-card.warn .dash-value { color: var(--daily); }
  .dash-card.alert .dash-value { color: var(--danger); }
  .dash-pills { display: flex; flex-wrap: wrap; gap: 8px; }
  .dash-pill {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--ink);
  }
  .dash-pill.ringing { border-color: var(--danger); color: var(--danger); }

  /* ---------- 仪表盘卡片可点击 ---------- */
  button.dash-card, button.dash-pill {
    font: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  }
  button.dash-card:hover, button.dash-pill:hover {
    transform: translateY(-2px);
    border-color: var(--plum);
    box-shadow: 0 4px 18px rgba(90, 78, 60, 0.14);
  }
  button.dash-card:active, button.dash-pill:active { transform: translateY(0); }

  /* ---------- 筛选标签 ---------- */
  .filter-chips { margin: 10px 0 0; }
  .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--plum);
    color: #fff;
    border-radius: 999px;
    padding: 6px 8px 6px 14px;
    font-size: 13px;
    box-shadow: var(--shadow);
  }
  .filter-chip-clear {
    border: none;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
  }
  .filter-chip-clear:hover { background: rgba(255, 255, 255, 0.4); }

/* ===== Stage 1 Slice 4 — Dashboard v2 ===== */
:root {
  --v2-accent: #6b5b95;
  --v2-accent-soft: #efeaf8;
  --v2-good: #4a8f6d;
  --v2-warn: #b98a2e;
  --v2-danger: #c05b50;
  --v2-card: #ffffff;
}

.v2-mit {
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--v2-card);
  box-shadow: var(--shadow);
}
.v2-mit-confirmed { border-left: 5px solid var(--v2-good); }
.v2-mit-proposed { border-left: 5px solid var(--v2-warn); }
.v2-mit-empty { border-left: 5px solid var(--line); background: transparent; box-shadow: none; }
.v2-mit-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 6px; }
.v2-mit-body { font-size: 17px; font-weight: 600; color: var(--ink); }
.v2-mit-meta { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.v2-mit-actions { display: flex; gap: 8px; margin-top: 10px; }

.v2-current {
  display: flex; align-items: center; gap: 12px;
  border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 12px;
  background: var(--v2-accent-soft);
  border: 1px solid #ddd5ee;
}
.v2-current-now { background: linear-gradient(135deg, #f3eefc, #e9e1fa); }
.v2-current-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--v2-accent); flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(107, 91, 149, 0.18);
  animation: v2-pulse 1.8s ease-in-out infinite;
}
.v2-current-dot.next { background: var(--v2-good); box-shadow: 0 0 0 4px rgba(74, 143, 109, 0.15); animation: none; }
@keyframes v2-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.v2-current-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-soft); }
.v2-current-title { font-size: 16px; font-weight: 600; }
.v2-current-meta { font-size: 12px; color: var(--ink-soft); }

.v2-risks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.v2-risk {
  border-radius: 10px; padding: 8px 12px; font-size: 13px;
  border: 1px solid var(--line);
}
.v2-risk-high { background: #fdf0ee; border-color: #efc9c2; color: var(--v2-danger); }
.v2-risk-medium { background: #fdf6e8; border-color: #ecd9ac; color: var(--v2-warn); }
.v2-risk-low { background: #f2f6f3; border-color: #d2e3d8; color: var(--v2-good); }

.v2-timeline { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.v2-timeline-empty, .v2-tl-empty { color: var(--ink-soft); font-size: 13px; padding: 10px 2px; }
.v2-tl-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--v2-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px;
}
.v2-tl-item.v2-tl-event { border-left: 4px solid var(--v2-accent); }
.v2-tl-item.v2-tl-block { border-left: 4px solid var(--v2-good); }
.v2-tl-time { font-size: 12px; color: var(--ink-soft); min-width: 92px; font-variant-numeric: tabular-nums; }
.v2-tl-title { font-size: 14px; font-weight: 500; flex: 1; }
.v2-tl-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--v2-accent-soft); color: var(--v2-accent);
}

.v2-task-group { margin-bottom: 10px; }
.v2-task-group-title { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.v2-task-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--v2-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px; margin-bottom: 6px;
}
.v2-task-row.overdue { border-left: 4px solid var(--v2-danger); }
.v2-task-main { flex: 1; min-width: 0; }
.v2-task-title { font-size: 14px; }
.v2-task-meta { font-size: 12px; color: var(--ink-soft); }

.v2-goals, .v2-projects { margin-bottom: 4px; }

.btn { border: 1px solid var(--line); background: var(--v2-card); color: var(--ink); border-radius: 10px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.btn:hover { border-color: var(--ink-soft); }
.btn-primary { background: var(--v2-accent); border-color: var(--v2-accent); color: #fff; }
.btn-primary:hover { background: #5a4c82; }
.btn-small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

@media (max-width: 520px) {
  .wrap { padding: 16px 12px 90px; }
  .v2-tl-item { flex-wrap: wrap; row-gap: 4px; }
  .v2-tl-time { min-width: 100%; font-size: 11px; }
  .v2-mit-body { font-size: 16px; }
  .v2-current-title { font-size: 15px; }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Stage 1 Slice 5 — 规划视图 ===== */
.v2-card-block {
  background: var(--v2-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.v2-card-block h4 { margin: 0 0 10px; font-size: 14px; }
.v2-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}
.v2-plan-col { min-width: 0; }
.v2-goal-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--v2-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 6px;
}
.v2-goal-row.pinned { border-left: 4px solid var(--v2-accent); }
.v2-goal-main { flex: 1; min-width: 0; }
.v2-goal-title { font-size: 14px; font-weight: 500; }
.v2-goal-meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.v2-row-actions { display: flex; gap: 6px; }
.v2-status-select {
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--v2-card); color: var(--ink); font-size: 12px; padding: 4px 6px;
}
@media (max-width: 520px) {
  .v2-plan-grid { grid-template-columns: 1fr; }
}

/* ===== Stage 1 UI 重构 — 左侧导航（2026-08-17） ===== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  background: #fffdf9;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.18s ease, flex-basis 0.18s ease;
  z-index: 40;
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 14px;
}
.sidebar-brand { font-size: 18px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.sidebar-brand .dot { color: var(--v2-accent); }
.sidebar-collapse {
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer; font-size: 13px; line-height: 1;
}
.sidebar-collapse:hover { color: var(--ink); border-color: var(--ink-soft); }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; overflow-y: auto; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  border: none; background: transparent; cursor: pointer;
  padding: 9px 10px; border-radius: 10px;
  color: var(--ink); font-size: 14px; text-align: left; white-space: nowrap;
}
.sidebar-item:hover { background: #f3eee6; }
.sidebar-item.active { background: var(--v2-accent-soft); color: var(--v2-accent); font-weight: 600; }
.sidebar-icon { font-size: 16px; width: 22px; text-align: center; flex: 0 0 22px; }
.sidebar-foot { padding: 10px 16px 14px; font-size: 11px; color: var(--ink-soft); white-space: nowrap; }

/* 收起态：只剩图标，但保留展开按钮（可点开） */
.sidebar.collapsed { width: 60px; flex-basis: 60px; }
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .sidebar-foot { display: none; }
.sidebar.collapsed .sidebar-head { justify-content: center; padding: 16px 8px 10px; }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .sidebar-item[title]:hover::after {
  content: attr(title);
  position: absolute; left: 66px; z-index: 50;
  background: var(--ink); color: #fff; font-size: 12px;
  padding: 4px 10px; border-radius: 8px; white-space: nowrap;
}
.sidebar-item { position: relative; }

.main { flex: 1; min-width: 0; }

/* 手机：侧边栏隐藏，三条杠弹出 */
.hamburger {
  position: fixed; top: 14px; left: 14px; z-index: 45;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--v2-card);
  font-size: 18px; cursor: pointer; box-shadow: var(--shadow);
}
.sidebar-scrim {
  position: fixed; inset: 0; background: rgba(40, 34, 26, 0.4); z-index: 39;
}

@media (max-width: 767px) {
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh;
    width: 250px; flex-basis: 250px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 30px rgba(0,0,0,0.12);
  }
  .sidebar.open { transform: translateX(0); }
  .main { padding-top: 54px; }
  /* 窄屏/手机：强制显示三条杠按钮（否则侧边栏永远打不开） */
  .hamburger { display: block !important; }
}

/* ===== 新首页：今日时间规划表 + 周视图 ===== */
.today-timeline { margin-top: 18px; }
.week-view { margin-top: 18px; }
.v2-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.v2-week-day {
  border: 1px solid var(--line); border-radius: 12px; padding: 8px;
  background: var(--v2-card); min-height: 76px;
}
.v2-week-day.today { border-color: var(--v2-accent); box-shadow: 0 0 0 2px var(--v2-accent-soft); }
.v2-week-day-head { font-size: 11px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.v2-week-day.today .v2-week-day-head { color: var(--v2-accent); }
.v2-week-item { font-size: 11px; padding: 2px 4px; border-radius: 6px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-week-item.event { background: var(--v2-accent-soft); color: var(--v2-accent); }
.v2-week-item.block { background: #e8f3ec; color: var(--v2-good); }
.v2-week-item.task { background: #fdf3e0; color: var(--v2-warn); }
.v2-week-empty { color: var(--ink-soft); }

@media (max-width: 900px) {
  .v2-week-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .v2-week-grid { grid-template-columns: 1fr; }
}

/* ===== 第二轮 UI：今日行程 + 周视图表格 + 勾选 ===== */
.today-schedule { margin-top: 18px; }
.v2-day-table, .v2-week-table {
  width: 100%; border-collapse: collapse; background: var(--v2-card);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  font-size: 12px;
}
.v2-day-table td, .v2-week-table td, .v2-week-table th {
  border: 1px solid var(--line); padding: 3px 6px; vertical-align: top;
}
.v2-week-table-scroll { overflow-x: auto; }
.v2-week-table { min-width: 720px; }
.v2-wt-time {
  white-space: nowrap; color: var(--ink-soft); font-size: 11px;
  font-variant-numeric: tabular-nums; text-align: right; width: 46px;
}
.v2-week-table th { background: #faf6ef; font-weight: 600; color: var(--ink); text-align: center; }
.v2-week-table th.today { background: var(--v2-accent-soft); color: var(--v2-accent); }
.v2-wt-date { font-size: 10px; color: var(--ink-soft); font-weight: 400; }
.v2-wt-cell.event { background: var(--v2-accent-soft); color: var(--v2-accent); }
.v2-wt-cell.block { background: #e8f3ec; color: var(--v2-good); }
.v2-wt-title { font-weight: 600; line-height: 1.3; }
.v2-wt-loc { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.v2-wt-range { font-size: 10px; opacity: 0.7; margin-top: 2px; }
.v2-week-table .v2-wt-cell { min-width: 88px; }

/* 勾选框（今日待办） */
.v2-check { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.v2-check input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.v2-checkmark {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--line); display: inline-block; background: var(--v2-card);
  transition: all 0.15s;
}
.v2-check input:checked + .v2-checkmark { background: var(--v2-good); border-color: var(--v2-good); }
.v2-check input:checked + .v2-checkmark::after {
  content: "✓"; color: #fff; font-size: 13px; line-height: 1;
  position: absolute; left: 5px; top: 3px;
}
.v2-task-row .v2-check { flex: 0 0 auto; }
.v2-task-row.overdue .v2-task-title { color: var(--v2-danger); }

/* ===== 第二轮 UI：折叠卡片 + 复盘弹窗 + 目标关联 ===== */
.v2-collapsible { padding: 0; overflow: hidden; }
.v2-collapse-head {
  width: 100%; border: none; background: transparent; cursor: pointer;
  padding: 14px 16px; font-size: 14px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; text-align: left;
}
.v2-collapse-head:hover { background: #f8f4ec; }
.v2-collapse-arrow { color: var(--ink-soft); }
.v2-collapse-body { padding: 0 16px 16px; border-top: 1px dashed var(--line); }

.v2-goal-link-slot { margin-bottom: 6px; }
.v2-goal-links {
  background: var(--v2-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.v2-link-option { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.v2-link-option input { accent-color: var(--v2-accent); }

.review-modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(40, 34, 26, 0.4);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.review-modal-card {
  background: var(--v2-card); border-radius: var(--radius);
  width: 100%; max-width: 420px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  max-height: 86vh; overflow-y: auto;
}

/* ===== AI 助手浮窗 ===== */
.assist-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 70;
  width: 52px; height: 52px; border-radius: 50%;
  border: none; background: var(--v2-accent); color: #fff;
  font-size: 24px; cursor: pointer; box-shadow: 0 6px 20px rgba(107,91,149,0.35);
}
.assist-fab:hover { transform: scale(1.06); }
.assist-panel {
  position: fixed; right: 18px; bottom: 80px; z-index: 70;
  width: 360px; max-width: calc(100vw - 24px);
  height: 480px; max-height: calc(100vh - 110px);
  background: var(--v2-card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  display: flex; flex-direction: column; overflow: hidden;
}
.assist-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 14px;
}
.assist-head .assist-clear, .assist-head .assist-close {
  margin-left: auto; border: 1px solid var(--line); background: transparent;
  border-radius: 8px; width: 26px; height: 26px; cursor: pointer; font-size: 12px;
}
.assist-head .assist-clear { margin-left: auto; }
.assist-messages {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.assist-msg {
  max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 13px;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.assist-msg.user { align-self: flex-end; background: var(--v2-accent); color: #fff; }
.assist-msg.assistant { align-self: flex-start; background: #f4f0ea; color: var(--ink); }
.assist-msg.typing { opacity: 0.6; }
.assist-confirm { display: flex; flex-direction: column; gap: 8px; }
.assist-input-row { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.assist-input {
  flex: 1; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px; font-size: 13px; background: var(--v2-card); color: var(--ink);
}
.assist-mic, .assist-send {
  border: 1px solid var(--line); background: var(--v2-card); border-radius: 12px;
  padding: 8px 10px; cursor: pointer; font-size: 14px;
}
.assist-send { background: var(--v2-accent); border-color: var(--v2-accent); color: #fff; }
.assist-mic.listening { background: #fdece9; border-color: var(--v2-danger); }
@media (max-width: 520px) {
  .assist-panel { right: 12px; left: 12px; width: auto; }
}

/* ===== AI 助手 v2：会话侧栏 + 设置页 + 洛字头像 ===== */
.assist-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 70;
  width: 52px; height: 52px; border-radius: 50%;
  border: none; background: var(--v2-accent); color: #fff;
  font-size: 20px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 20px rgba(107,91,149,0.35);
  font-family: "Songti SC", "STSong", serif;
}
.assist-fab:hover { transform: scale(1.06); }
.assist-panel {
  position: fixed; right: 18px; bottom: 80px; z-index: 70;
  width: 560px; max-width: calc(100vw - 24px);
  height: 520px; max-height: calc(100vh - 110px);
  background: var(--v2-card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  display: flex; flex-direction: column; overflow: hidden;
}
.assist-sidebar {
  width: 130px; flex: 0 0 130px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  background: #faf6ef;
}
.assist-new {
  margin: 10px; border: 1px dashed var(--line); background: transparent;
  border-radius: 10px; padding: 8px; cursor: pointer; font-size: 12px; color: var(--v2-accent);
}
.assist-conv-list {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: 4px 8px; display: flex; flex-direction: column; gap: 4px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.assist-conv {
  border: none; background: transparent; cursor: pointer; text-align: left;
  padding: 8px 10px; border-radius: 10px; font-size: 12px; color: var(--ink);
}
.assist-conv:hover { background: #f0ebe2; }
.assist-conv.active { background: var(--v2-accent-soft); color: var(--v2-accent); font-weight: 600; }
.assist-conv-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assist-conv-empty { font-size: 11px; color: var(--ink-soft); padding: 8px; }
.assist-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.assist-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 14px;
}
.assist-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assist-icon {
  border: 1px solid var(--line); background: transparent; border-radius: 8px;
  width: 28px; height: 28px; cursor: pointer; font-size: 14px;
}
.assist-msg {
  max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 13px;
  line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.assist-msg.user { align-self: flex-end; background: var(--v2-accent); color: #fff; }
.assist-msg.assistant { align-self: flex-start; background: #f4f0ea; color: var(--ink); }
.assist-msg.typing { opacity: 0.6; }
.assist-confirm { display: flex; flex-direction: column; gap: 8px; }
.assist-input-row { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.assist-input {
  flex: 1; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 12px; font-size: 13px; background: var(--v2-card); color: var(--ink);
}
.assist-mic, .assist-send {
  border: 1px solid var(--line); background: var(--v2-card); border-radius: 12px;
  padding: 8px 10px; cursor: pointer; font-size: 14px;
}
.assist-send { background: var(--v2-accent); border-color: var(--v2-accent); color: #fff; }
.assist-mic.listening { background: #fdece9; border-color: var(--v2-danger); }
.assist-settings { padding: 14px 16px; border-bottom: 1px solid var(--line); overflow-y: auto; }
.assist-settings h4 { margin: 0 0 10px; }
.assist-settings h5 { margin: 0; font-size: 13px; }
.assist-model-row { display: flex; gap: 6px; }
.assist-model-row select { flex: 1; }
.assist-settings-actions { display: flex; gap: 8px; margin-top: 10px; }
.assist-settings-status { margin-top: 8px; font-size: 12px; color: var(--ink-soft); min-height: 16px; }
.assist-voice-settings { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.assist-voice-picker { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.assist-voice-picker select {
  flex: 1 1 220px; min-width: 0; max-width: 100%; padding: 7px 9px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--v2-card); color: var(--ink);
}
.assist-voice-toggle { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 12px; cursor: pointer; }
.assist-voice-hint { margin-top: 6px; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.assist-voice-actions { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.assist-voice-actions audio { width: min(100%, 250px); height: 32px; }
.assist-voice-library-link { color: var(--v2-accent); font-size: 11px; text-decoration: none; }
.assist-voice-library-link:hover { text-decoration: underline; }
@media (max-width: 620px) {
  .assist-panel { right: 12px; left: 12px; width: auto; }
  .assist-sidebar { width: 100px; flex-basis: 100px; }
  .assist-settings-actions { flex-wrap: wrap; }
}

/* ===== 长按拖动排序 ===== */
.v2-goal-row.dragging {
  opacity: 0.55; position: relative; z-index: 5;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  touch-action: none;
}

/* ===== AI 助手：侧栏收起（固定位置，不拖动不缩放） ===== */
.assist-sidebar.collapsed { width: 0; flex-basis: 0; overflow: hidden; border-right: none; }
.assist-sidebar.collapsed .assist-new,
.assist-sidebar.collapsed .assist-conv-list { display: none; }

/* 治理页已处理历史折叠区 */
.governance-history {
  margin: 10px 0; border: 1px solid var(--line); border-radius: 12px;
  background: var(--v2-card); padding: 10px 12px;
}
.governance-history summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-soft);
}
.governance-history summary:hover { color: var(--ink); }

/* 设置页提示 */
.assist-base-hint { font-size: 11px; color: var(--ink-soft); margin-top: 4px; line-height: 1.5; }

/* 设为 MIT 状态 */
.v2-task-row.is-mit { border-left: 4px solid var(--v2-accent); background: var(--v2-accent-soft); }
.btn.mit-on { background: var(--v2-accent); border-color: var(--v2-accent); color: #fff; }

/* ===== AI 助手 v4：历史对话横排 + 删除 + 输入框固定 ===== */
.assist-history {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  overflow-x: auto; overflow-y: hidden; flex: 0 0 auto;
  min-height: 42px; scrollbar-width: thin;
}
.assist-new {
  flex: 0 0 auto; border: 1px dashed var(--line); background: transparent;
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 12px; color: var(--v2-accent);
  white-space: nowrap;
}
.assist-conv-row { display: flex; align-items: center; gap: 6px; }
.assist-conv-chip {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); background: var(--v2-card);
  border-radius: 999px; padding: 5px 8px 5px 12px; cursor: pointer;
  font-size: 12px; color: var(--ink); white-space: nowrap; max-width: 160px;
}
.assist-conv-chip.active { background: var(--v2-accent-soft); border-color: var(--v2-accent); color: var(--v2-accent); font-weight: 600; }
.assist-conv-title { overflow: hidden; text-overflow: ellipsis; }
.assist-conv-del {
  border: none; background: transparent; cursor: pointer; color: var(--ink-soft);
  font-size: 14px; line-height: 1; padding: 0 2px; border-radius: 50%;
}
.assist-conv-del:hover { color: var(--v2-danger); background: #fdece9; }
.assist-conv-empty { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }

.assist-input-row { flex: 0 0 auto; display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.assist-messages { padding-bottom: 16px; }

.assist-audio-controls {
  flex: 0 0 auto; display: flex; justify-content: flex-end;
  padding: 6px 10px 0; border-top: 1px solid var(--line); background: var(--v2-card);
}
.assist-audio-controls[hidden] { display: none; }
.assist-audio-stop {
  border: 1px solid var(--v2-danger); background: #fff; color: var(--v2-danger);
  border-radius: 999px; padding: 6px 11px; cursor: pointer; font-size: 12px;
  white-space: nowrap;
}
.assist-audio-stop:hover { background: #fdece9; }

/* 合并删除确认框 */
.assist-confirm-title { font-weight: 600; margin-bottom: 4px; }
.assist-confirm-list { margin: 4px 0 8px; padding-left: 18px; font-size: 12px; }
.assist-confirm-note { font-size: 11px; color: var(--ink-soft); margin-bottom: 8px; }

/* 工具状态行（独立于对话文字，淡色提示） */
.assist-msg.tool-status { align-self: flex-start; background: #f2f6f3; color: var(--v2-good); font-size: 12px; }

/* 停止按钮 */
.assist-stop {
  border: 1px solid var(--v2-danger); background: #fff; color: var(--v2-danger);
  border-radius: 12px; padding: 8px 10px; cursor: pointer; font-size: 13px;
}
/* 当日待办里已排块的任务 */
.v2-task-row.blocked { border-left: 4px solid var(--v2-good); }
.task-meta.block-time { color: var(--v2-good); }
/* 行程同格多块 */
.v2-wt-sub { padding: 2px 0; }
.v2-wt-sub.event { color: var(--v2-accent); }
.v2-wt-sub.block { color: var(--v2-good); }

/* ===== 行程/周视图：日历式网格（互不遮挡，有背景色） ===== */
.dsg { display: flex; gap: 0; background: var(--v2-card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dsg-time { flex: 0 0 48px; border-right: 1px solid var(--line); background: #faf6ef; }
.dsg-time-cell { display: flex; align-items: flex-start; justify-content: flex-end; padding-right: 6px; font-size: 10px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.dsg-body { flex: 1; position: relative; background: #fff; }
.dsg-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: 13px; }
.dsg-item {
  position: absolute; border-radius: 8px; padding: 4px 6px; overflow: hidden;
  font-size: 12px; box-sizing: border-box;
  border-left: 3px solid;
}
.dsg-item.event { background: var(--v2-accent-soft); border-left-color: var(--v2-accent); color: var(--v2-accent); }
.dsg-item.block { background: #e3f2e8; border-left-color: var(--v2-good); color: var(--v2-good); }
.dsg-title { font-weight: 600; line-height: 1.25; }
.dsg-loc { font-size: 11px; opacity: 0.85; margin-top: 1px; }
.dsg-range { font-size: 10px; opacity: 0.7; margin-top: 1px; }

/* 周视图网格 */
.wsg { background: var(--v2-card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wsg-scroll { overflow-x: auto; }
.wsg-head { display: flex; background: #faf6ef; border-bottom: 1px solid var(--line); }
.wsg-time-head { flex: 0 0 48px; }
.wsg-day-head { flex: 1; min-width: 84px; text-align: center; font-size: 12px; font-weight: 600; padding: 6px 2px; border-left: 1px solid var(--line); }
.wsg-day-head.today { background: var(--v2-accent-soft); color: var(--v2-accent); }
.wsg-day-date { font-size: 10px; font-weight: 400; color: var(--ink-soft); display: block; }
.wsg-body { display: flex; }
.wsg-time { flex: 0 0 48px; border-right: 1px solid var(--line); background: #faf6ef; }
.wsg-day { flex: 1; min-width: 84px; position: relative; border-left: 1px solid var(--line); }

/* 保留"格子"视觉：每半小时一行横分隔线 */
.dsg-body, .wsg-day {
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% 24px;
}

/* 灵感状态区分 */
.idea-parked { border-left: 4px solid var(--v2-warn); }
.idea-open { border-left: 4px solid var(--v2-accent); }

/* 编辑面板与委托按钮 */
.v2-goal-links .field { margin-bottom: 6px; }
.btn-primary .btn-small { }

/* 灵感卡片按钮竖排，不挤压文字 */
.v2-row-actions.vertical { flex-direction: column; align-items: stretch; gap: 5px; flex: 0 0 auto; }
.v2-row-actions.vertical .btn { width: 100%; white-space: nowrap; }
.idea-open .v2-goal-main, .idea-parked .v2-goal-main { min-width: 0; }

/* ---- 今日建议卡片（Slice 8 前端）---- */
.today-plan { margin-top: 4px; }
.plan-capacity { font-size: 12px; color: var(--ink-soft); margin-bottom: 2px; }
.plan-note { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; font-style: italic; }
.plan-subtitle { margin: 14px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.plan-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--v2-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px; margin-bottom: 6px;
}
.plan-row.is-skipped { opacity: 0.45; }
.plan-row.is-editing { align-items: flex-start; }
.plan-main { flex: 1; min-width: 0; }
.plan-title { font-size: 14px; }
.plan-meta { font-size: 12px; color: var(--ink-soft); }
.plan-tag { font-size: 11px; color: var(--v2-good); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.plan-edit { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.plan-edit input[type="time"] {
  font: inherit; font-size: 13px; padding: 3px 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink);
}
.plan-actions { margin: 10px 0 4px; }
.plan-fold { border-top: 1px solid var(--line); margin-top: 10px; }
.plan-fold-summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 2px; font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.plan-fold-summary::-webkit-details-marker { display: none; }
.plan-fold-summary::before {
  content: "›"; display: inline-block; font-size: 15px; line-height: 1;
  transition: transform 0.15s ease; color: var(--ink-soft);
}
.plan-fold[open] > .plan-fold-summary::before { transform: rotate(90deg); }
.plan-fold-count {
  font-size: 11px; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; line-height: 17px;
}
.plan-fold-body { padding-bottom: 8px; }
@media (prefers-reduced-motion: reduce) {
  .plan-fold-summary::before { transition: none; }
}
.plan-tradeoff, .plan-risk { padding: 4px 2px; }
.plan-risk.risk-high { color: var(--v2-danger); }

/* ---- AI 深思今日建议 ---- */
.plan-badge {
  font-size: 11px; font-weight: 600; vertical-align: middle;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 1px 8px; margin-left: 8px; color: var(--ink-soft);
}
.plan-badge.load-light { color: var(--v2-good); }
.plan-badge.load-heavy { color: var(--v2-danger); }
.plan-summary {
  font-size: 13px; line-height: 1.55; color: var(--ink);
  background: var(--v2-card); border: 1px solid var(--line);
  border-left: 3px solid var(--v2-accent, var(--ink-soft));
  border-radius: 10px; padding: 8px 12px; margin: 8px 0;
}
.plan-reason { font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.5; }
.plan-thinking {
  font-size: 12px; color: var(--ink-soft); margin: 6px 0 2px;
  display: flex; align-items: center; gap: 8px;
}
.plan-thinking::before {
  content: ""; width: 12px; height: 12px; flex: none;
  border: 2px solid var(--line); border-top-color: var(--ink-soft);
  border-radius: 50%; animation: plan-spin 0.8s linear infinite;
}
@keyframes plan-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .plan-thinking::before { animation: none; }
}

/* 雅思课淡蓝（与学校课紫色区分） */
.dsg-item.ielts { background: #e3f0fa; border-left-color: #5b9bd5; color: #2f6fa8; }

/* 日历页日期标题 + 查看全部待办 */
.day-header-bar { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.day-header-bar .dash-section-title { margin: 0; }

/* 可点击风险卡 */
.v2-risk.clickable { cursor: pointer; }
.v2-risk.clickable:hover { transform: translateX(2px); box-shadow: var(--shadow); }
.plan-row.is-done .plan-title { text-decoration: line-through; opacity: 0.6; }
.plan-row.is-done .plan-meta { opacity: 0.6; }
