/* 跨页面待办抽屉 Drawer */
.todo-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(1px);
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.todo-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.todo-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 90vw;
    background: var(--bg-card);
    box-shadow: -4px 0 24px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    z-index: 501;
    transform: translateX(100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.todo-drawer-overlay.is-open .todo-drawer {
    transform: translateX(0);
}

.todo-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-inset);
    flex-shrink: 0;
}

.todo-drawer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: var(--weight-semibold);
    color: var(--text-main);
}

.todo-drawer-title i {
    color: var(--primary);
}

.todo-drawer-badge {
    background: var(--primary);
    color: #ffffff;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: var(--weight-semibold);
    line-height: 1.2;
}

.todo-drawer-close {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-xs);
    display: grid;
    place-items: center;
    transition: all 0.15s ease;
}

.todo-drawer-close:hover {
    background: var(--bg-hover);
    color: var(--text-main);
    border-color: var(--border-color);
}

.todo-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.todo-drawer-composer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.todo-composer-input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-family: inherit;
    line-height: 1.45;
    resize: none;
    min-height: 52px;
    max-height: 120px;
    background: var(--bg-card);
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.todo-composer-input:hover {
    border-color: var(--border-strong);
}

.todo-composer-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-bg);
}

.todo-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.todo-composer-hint {
    color: var(--text-dim);
    user-select: none;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 160px;
    padding: 24px 0;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
}

.todo-item-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.todo-item-row:hover {
    border-color: var(--border-strong);
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.04);
}

.todo-item-row.is-completed {
    background: var(--bg-inset);
    opacity: 0.7;
}

.todo-toggle-input {
    margin-top: 3px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.todo-item-content {
    flex: 1;
    min-width: 0;
}

.todo-item-text {
    color: var(--text-main);
    white-space: pre-wrap;
    line-height: 1.45;
    word-break: break-word;
}

.todo-item-time {
    margin-top: 4px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.todo-text-completed {
    color: var(--text-muted);
    text-decoration: line-through;
}

.todo-delete-btn {
    opacity: 0;
    background: transparent;
    border: none;
    color: var(--tag-red-text);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    display: grid;
    place-items: center;
    transition: opacity 0.15s ease, background-color 0.15s ease;
    flex-shrink: 0;
}

.todo-item-row:hover .todo-delete-btn,
.todo-item-row:focus-within .todo-delete-btn {
    opacity: 1;
}

.todo-delete-btn:hover {
    background: var(--tag-red-bg);
    color: var(--acos-red);
}
