.todo-board { --todo-ink: #302523; --todo-muted: #776760; --todo-bg: #fffdfa; --todo-card: #fff; --todo-line: #e8dcd3; --todo-brand: #852f31; --todo-soft: #faf1e9; color: var(--todo-ink); background: var(--todo-bg); font: 14px/1.5 "Microsoft YaHei UI", "Microsoft YaHei", sans-serif; border: 1px solid var(--todo-line); border-radius: 18px; overflow: hidden; }
.todo-board, .todo-board *, .todo-board *::before, .todo-board *::after { box-sizing: border-box; }
.todo-board [hidden], .todo-board[hidden] { display: none !important; }
.todo-board button, .todo-board input, .todo-board textarea { font: inherit; }
.todo-board button { border: 0; cursor: pointer; }
.todo-board button:focus-visible, .todo-board input:focus-visible, .todo-board textarea:focus-visible, .todo-heading:focus-visible { outline: 2px solid var(--todo-brand); outline-offset: 2px; }
.todo-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--todo-line); }
.todo-heading h1 { font-size: 22px; line-height: 1.4; margin: 0 0 3px; color: var(--todo-brand); }
.todo-count { font-size: 12px; color: var(--todo-muted); }
.todo-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.todo-pin { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; color: var(--todo-brand); background: var(--todo-soft); font-weight: 700 !important; }
.todo-pin svg { width: 17px; height: 17px; }
.todo-pin[aria-pressed="true"] { color: #fff; background: #852f31; }
.todo-body { padding: 20px 22px; }
.todo-add, .todo-child-form { display: flex; align-items: center; gap: 8px; }
.todo-add input, .todo-child-form input { min-width: 0; flex: 1; padding: 10px 12px; color: var(--todo-ink); background: var(--todo-card); border: 1px solid var(--todo-line); border-radius: 8px; }
.todo-board input::placeholder { color: var(--todo-muted); opacity: 1; }
.todo-add button, .todo-child-form button { padding: 10px 14px; color: #fff; background: #852f31; border-radius: 8px; white-space: nowrap; }
.todo-list { display: grid; gap: 12px; margin-top: 18px; }
.todo-task { padding: 12px; background: var(--todo-card); border: 1px solid var(--todo-line); border-radius: 12px; }
.todo-row { display: flex; align-items: flex-start; gap: 9px; }
.todo-board .todo-task-grip { width: 28px; height: 32px; flex: 0 0 28px; margin-top: 2px; padding: 5px 2px; border-radius: 6px; background: transparent; color: #687896; cursor: grab; touch-action: none; }
.todo-task-grip svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.todo-task-grip:hover, .todo-task-grip:focus-visible { background: var(--todo-soft); }
.todo-board .todo-task-grip:active { cursor: grabbing; }
.todo-task-collapse { width: 28px; height: 32px; flex: 0 0 28px; padding: 5px; border-radius: 6px; background: transparent; color: var(--todo-muted); }
.todo-task-collapse:hover, .todo-task-collapse:focus-visible { background: var(--todo-soft); color: var(--todo-brand); }
.todo-task-collapse svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.todo-task-collapse.is-collapsed svg { transform: rotate(-90deg); }
.todo-check { width: 18px; height: 18px; flex-shrink: 0; margin: 8px 0 0; accent-color: #852f31; cursor: pointer; }
.todo-title { flex: 1; display: block; width: 100%; min-width: 0; min-height: 34px; padding: 5px 3px; border: 1px solid transparent; border-radius: 5px; background: transparent; resize: none; overflow: hidden; color: var(--todo-ink); line-height: 1.6 !important; font-weight: 700 !important; overflow-wrap: anywhere; }
.todo-title:hover, .todo-title:focus { background: var(--todo-soft); }
.todo-row.is-done .todo-title { color: var(--todo-muted); text-decoration: line-through; }
.todo-remove { width: 28px; height: 32px; flex-shrink: 0; font-size: 21px !important; line-height: 1; background: transparent; color: var(--todo-muted); border-radius: 6px; }
.todo-remove:hover { color: #a3292d; background: var(--todo-soft); }
.todo-children { padding-left: 26px; }
.todo-children .todo-row { margin-top: 4px; }
.todo-children .todo-title { font-weight: 400 !important; }
.todo-task-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 26px; margin-top: 6px; color: var(--todo-muted); font-size: 12px; }
.todo-add-child { padding: 4px 5px; background: transparent; color: var(--todo-brand); border-radius: 4px; }
.todo-add-child:hover { background: var(--todo-soft); }
.todo-child-form { margin: 8px 0 0 26px; }
.todo-child-form input { padding: 7px 8px; }
.todo-child-form button { padding: 8px 10px; }
.todo-empty { margin: 16px 0 28px; padding: 32px 12px; text-align: center; color: var(--todo-muted); border: 1px dashed var(--todo-line); border-radius: 12px; }
.todo-undo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: var(--todo-soft); color: var(--todo-muted); }
.todo-undo button { background: transparent; color: var(--todo-brand); padding: 4px; font-weight: 700; }
.todo-status { color: #a53a31; margin: 10px 0 0; font-size: 12px; }
.todo-floating { position: fixed; z-index: 10000; width: min(370px, calc(100vw - 16px)); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); display: flex; flex-direction: column; box-shadow: 0 16px 44px #30201833; }
.todo-floating .todo-heading { padding: 12px 14px; flex-shrink: 0; cursor: grab; touch-action: none; user-select: none; }
.todo-floating .todo-heading h1 { font-size: 17px; }
.todo-floating .todo-pin span { display: none; }
.todo-floating .todo-body { flex: 1 1 auto; padding: 14px 14px 22px; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.todo-floating .todo-list { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: stretch; }
.todo-floating .todo-task { min-width: 0; display: flex; flex-direction: column; }
.todo-floating .todo-task-foot { margin-top: auto; padding-top: 6px; }
.todo-list.sorting .todo-task { min-height: 0; overflow: hidden; }
.todo-task[data-task-id] { cursor: grab; }
.todo-board.is-ordering .todo-list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.todo-board.is-ordering .todo-add { display: none; }
.todo-board .todo-sort-toggle { padding: 7px 9px; border-radius: 8px; background: var(--todo-soft); color: var(--todo-brand); white-space: nowrap; }
.todo-board .todo-sort-toggle[aria-pressed="true"] { color: white; background: #852f31; }
.todo-task.todo-sort-row, .todo-task.todo-sort-ghost:has(.todo-sort-label) { display: flex; flex-direction: row; align-items: center; gap: 4px; padding: 3px 6px; min-width: 0; }
.todo-board .todo-task-grip.todo-sort-label { flex: 1; min-width: 0; height: 42px; margin: 0; padding: 0 8px; color: var(--todo-ink); font-weight: 700; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-sort-label::before { content: '⠿'; padding-right: 8px; color: var(--todo-muted); }
.todo-board .todo-step { width: 36px; height: 38px; border-radius: 8px; color: var(--todo-brand); background: var(--todo-soft); font-size: 18px; }
.todo-board .todo-step:disabled { opacity: .3; }
.todo-list.sorting .todo-task.sort-picked { background: var(--todo-soft); outline: 2px dashed var(--todo-brand); outline-offset: -2px; }
.todo-task.todo-sort-ghost { position: fixed; z-index: 10001; margin: 0; pointer-events: none; background: var(--todo-card); outline: 1px solid var(--todo-brand); box-shadow: 0 16px 34px #30201833; transition: none; }
.todo-list.sorting .todo-task.sort-picked > * { opacity: .3; }
.todo-task.sort-holding { background: var(--todo-soft); }
.todo-task.sort-picked { outline: 1px dashed var(--todo-brand); outline-offset: -1px; }
.todo-tone-0 .todo-task-grip { color: #687896; }
.todo-tone-1 .todo-task-grip { color: #b46a54; }
.todo-tone-2 .todo-task-grip { color: #4e8f82; }
.todo-tone-3 .todo-task-grip { color: #8a6bb1; }
.todo-tone-4 .todo-task-grip { color: #b17a36; }
.todo-floating .todo-collapse { width: 30px; height: 32px; border-radius: 7px; background: var(--todo-soft); color: var(--todo-brand); font-size: 20px; }
.todo-floating.is-collapsed .todo-body { display: none; }
.todo-floating.is-collapsed .todo-heading { border-bottom: 0; }
.todo-floating.is-dragging .todo-heading { cursor: grabbing; }
.todo-floating .todo-resize { position: absolute; z-index: 2; padding: 0; background: transparent; touch-action: none; color: var(--todo-muted); }
.todo-floating .todo-resize-right { right: 0; top: 18px; bottom: 22px; width: 7px; cursor: ew-resize; }
.todo-floating .todo-resize-left { left: 0; top: 18px; bottom: 22px; width: 7px; cursor: ew-resize; }
.todo-floating .todo-resize-top { top: 0; left: 18px; right: 22px; height: 7px; cursor: ns-resize; }
.todo-floating .todo-resize-bottom { left: 18px; right: 22px; bottom: 0; height: 7px; cursor: ns-resize; }
.todo-floating .todo-resize-bottom-right { right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; }
.todo-floating .todo-resize-bottom-left { left: 0; bottom: 0; width: 22px; height: 22px; cursor: nesw-resize; }
.todo-floating .todo-resize-top-right { right: 0; top: 0; width: 22px; height: 22px; cursor: nesw-resize; }
.todo-floating .todo-resize-top-left { left: 0; top: 0; width: 22px; height: 22px; cursor: nwse-resize; }
.todo-resize-bottom-right::after, .todo-resize-bottom-left::after, .todo-resize-top-right::after, .todo-resize-top-left::after { content: ''; position: absolute; inset: 6px; background: repeating-linear-gradient(135deg, transparent 0 3px, currentColor 3px 4px); clip-path: polygon(100% 0, 100% 100%, 0 100%); opacity: .7; }
.todo-floating .todo-resize:hover, .todo-floating .todo-resize:focus-visible { background-color: var(--todo-soft); outline-offset: -3px; }
.todo-floating.is-collapsed .todo-resize { display: none; }
.todo-floating.is-resizing { user-select: none; }
[data-theme="dark"] .todo-board { --todo-ink: #f2e9dd; --todo-muted: #bcb0a4; --todo-bg: #20242d; --todo-card: #262a33; --todo-line: #4b4242; --todo-brand: #f0b4aa; --todo-soft: #353039; }
[data-theme="dark"] .todo-status { color: #ffb0a4; }
body.todo-page { margin: 0; padding: 24px; background: #f8f5f0; min-height: 100vh; }
.todo-page > main { max-width: 820px; margin: 0 auto; }
[data-theme="dark"] body.todo-page { background: #171a21; }
@media (max-width: 520px) { body.todo-page { padding: 10px; } .todo-heading { padding: 16px; } .todo-body { padding: 14px; } .todo-heading h1 { font-size: 19px; } .todo-pin { padding: 8px; font-size: 12px !important; } }
