769 lines
16 KiB
CSS
769 lines
16 KiB
CSS
/* ── Reset & Base ─────────────────────────────────── */
|
|
*,
|
|
*::before,
|
|
*::after {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
:root {
|
|
--color-bg: #f7f8fa;
|
|
--color-surface: #ffffff;
|
|
--color-border: #ebeef2;
|
|
--color-text: #2c3e50;
|
|
--color-text-secondary: #94a3b8;
|
|
--color-text-muted: #c0c8d2;
|
|
--color-accent: #75dac7;
|
|
--color-accent-hover: #5cc4b0;
|
|
--color-accent-light: rgba(117, 218, 199, 0.12);
|
|
--color-completed: #75dac7;
|
|
--color-abandoned: #c4a87a;
|
|
--color-danger: #e07070;
|
|
--color-danger-hover: #c95a5a;
|
|
--radius: 10px;
|
|
--radius-sm: 6px;
|
|
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
|
|
--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
|
|
--transition: 0.18s ease;
|
|
}
|
|
|
|
html {
|
|
font-size: 16px;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
|
|
"Microsoft YaHei", "Helvetica Neue", sans-serif;
|
|
background: var(--color-bg);
|
|
color: var(--color-text);
|
|
line-height: 1.6;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
/* ── App Container ────────────────────────────────── */
|
|
#app {
|
|
max-width: 980px;
|
|
margin: 0 auto;
|
|
padding: 32px 28px 80px;
|
|
}
|
|
|
|
/* ── Header ───────────────────────────────────────── */
|
|
.app-header {
|
|
display: flex;
|
|
align-items: baseline;
|
|
gap: 12px;
|
|
margin-bottom: 28px;
|
|
}
|
|
|
|
.app-title {
|
|
font-size: 1.75rem;
|
|
font-weight: 700;
|
|
color: var(--color-text);
|
|
letter-spacing: -0.02em;
|
|
}
|
|
|
|
.task-count {
|
|
font-size: 0.85rem;
|
|
color: var(--color-text-secondary);
|
|
font-weight: 400;
|
|
}
|
|
|
|
/* ── Auto Save ────────────────────────────────────── */
|
|
.auto-save-group {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.auto-save-label {
|
|
font-size: 0.75rem;
|
|
color: var(--color-text-muted);
|
|
user-select: none;
|
|
}
|
|
|
|
.auto-save-seconds {
|
|
font-size: 0.78rem;
|
|
font-weight: 500;
|
|
color: var(--color-accent);
|
|
cursor: pointer;
|
|
padding: 2px 6px;
|
|
border-radius: 4px;
|
|
transition: background var(--transition);
|
|
user-select: none;
|
|
}
|
|
|
|
.auto-save-seconds:hover {
|
|
background: var(--color-accent-light);
|
|
}
|
|
|
|
.auto-save-toggle {
|
|
display: inline-flex;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.auto-save-toggle input {
|
|
display: none;
|
|
}
|
|
|
|
.toggle-track {
|
|
width: 34px;
|
|
height: 20px;
|
|
background: #cdd3da;
|
|
border-radius: 10px;
|
|
position: relative;
|
|
transition: background var(--transition);
|
|
}
|
|
|
|
.toggle-thumb {
|
|
position: absolute;
|
|
top: 2px;
|
|
left: 2px;
|
|
width: 16px;
|
|
height: 16px;
|
|
background: #fff;
|
|
border-radius: 50%;
|
|
transition: transform var(--transition);
|
|
box-shadow: 0 1px 2px rgba(0,0,0,0.15);
|
|
}
|
|
|
|
.auto-save-toggle input:checked + .toggle-track {
|
|
background: var(--color-accent);
|
|
}
|
|
|
|
.auto-save-toggle input:checked + .toggle-track .toggle-thumb {
|
|
transform: translateX(14px);
|
|
}
|
|
|
|
/* ── Create Bar ───────────────────────────────────── */
|
|
.create-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
background: var(--color-surface);
|
|
border-radius: var(--radius);
|
|
padding: 10px 14px;
|
|
box-shadow: var(--shadow-sm);
|
|
border: 1px solid var(--color-border);
|
|
transition: box-shadow var(--transition);
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.create-bar:focus-within {
|
|
box-shadow: var(--shadow-md);
|
|
border-color: var(--color-accent);
|
|
}
|
|
|
|
.create-input {
|
|
flex: 1;
|
|
border: none;
|
|
outline: none;
|
|
font-size: 0.95rem;
|
|
color: var(--color-text);
|
|
background: transparent;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.create-input::placeholder {
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
/* ── Buttons ──────────────────────────────────────── */
|
|
.btn-icon {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 32px;
|
|
height: 32px;
|
|
border: none;
|
|
background: transparent;
|
|
border-radius: var(--radius-sm);
|
|
cursor: pointer;
|
|
color: var(--color-text-secondary);
|
|
transition: all var(--transition);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.btn-icon:hover {
|
|
background: #f1f3f6;
|
|
color: var(--color-text);
|
|
}
|
|
|
|
.btn-icon:active {
|
|
transform: scale(0.94);
|
|
}
|
|
|
|
.btn-confirm {
|
|
color: var(--color-accent);
|
|
}
|
|
|
|
.btn-confirm:hover {
|
|
background: var(--color-accent-light);
|
|
color: var(--color-accent-hover);
|
|
}
|
|
|
|
.btn-add-sub {
|
|
opacity: 0;
|
|
width: 24px;
|
|
height: 24px;
|
|
color: var(--color-accent);
|
|
}
|
|
|
|
.btn-edit {
|
|
opacity: 0;
|
|
width: 24px;
|
|
height: 24px;
|
|
}
|
|
|
|
.btn-menu {
|
|
opacity: 0;
|
|
width: 26px;
|
|
height: 26px;
|
|
}
|
|
|
|
.todo-row:hover .btn-add-sub,
|
|
.todo-row:hover .btn-edit,
|
|
.todo-row:hover .btn-menu {
|
|
opacity: 1;
|
|
}
|
|
|
|
.btn-add-sub:hover,
|
|
.btn-edit:hover,
|
|
.btn-menu:hover {
|
|
background: #f1f3f6;
|
|
}
|
|
|
|
/* ── Swipe Wrapper ─────────────────────────────────── */
|
|
.todo-row-wrapper {
|
|
position: relative;
|
|
margin-bottom: 1px;
|
|
border-radius: var(--radius-sm);
|
|
}
|
|
|
|
/* 滑动背景层 */
|
|
.swipe-bg {
|
|
position: absolute;
|
|
inset: 0;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: stretch;
|
|
border-radius: var(--radius-sm);
|
|
}
|
|
|
|
.swipe-bg-left {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0 24px;
|
|
background: var(--color-accent);
|
|
color: #fff;
|
|
font-size: 0.85rem;
|
|
font-weight: 600;
|
|
white-space: nowrap;
|
|
border-radius: var(--radius-sm) 0 0 var(--radius-sm);
|
|
}
|
|
|
|
.swipe-bg-right {
|
|
display: flex;
|
|
align-items: stretch;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.swipe-bg-right .swipe-act {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0 16px;
|
|
color: #fff;
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
white-space: nowrap;
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
|
|
.swipe-act-edit { background: var(--color-accent); }
|
|
.swipe-act-abandon { background: #c4a87a; }
|
|
.swipe-act-delete { background: var(--color-danger); }
|
|
.swipe-act-restore { background: var(--color-accent); }
|
|
.swipe-act:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
|
|
|
|
/* 滑动前景层 */
|
|
.todo-row-swipe {
|
|
position: relative;
|
|
z-index: 1;
|
|
overflow: hidden;
|
|
background: var(--color-bg);
|
|
border-radius: var(--radius-sm);
|
|
transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
|
|
will-change: transform;
|
|
}
|
|
|
|
/* ── Todo List ────────────────────────────────────── */
|
|
.todo-list {
|
|
list-style: none;
|
|
}
|
|
|
|
.todo-list-wrap {
|
|
min-height: 100px;
|
|
}
|
|
|
|
/* ── Todo Row ─────────────────────────────────────── */
|
|
.todo-row {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 8px;
|
|
padding: 10px 12px;
|
|
border-radius: var(--radius-sm);
|
|
transition: background var(--transition);
|
|
position: relative;
|
|
min-height: 44px;
|
|
}
|
|
|
|
.todo-row:hover {
|
|
background: #f1f3f6;
|
|
}
|
|
|
|
/* 缩进 */
|
|
.todo-row.level-1 {
|
|
padding-left: 42px;
|
|
}
|
|
|
|
.todo-row.level-2 {
|
|
padding-left: 72px;
|
|
}
|
|
|
|
/* 缩进引导线 */
|
|
.todo-row.level-1::before,
|
|
.todo-row.level-2::before {
|
|
content: "";
|
|
position: absolute;
|
|
left: 20px;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 1px;
|
|
background: #cdd3da;
|
|
}
|
|
|
|
.todo-row.level-2::before {
|
|
left: 50px;
|
|
}
|
|
|
|
/* ── Checkbox ─────────────────────────────────────── */
|
|
.checkbox {
|
|
appearance: none;
|
|
-webkit-appearance: none;
|
|
width: 20px;
|
|
height: 20px;
|
|
border: 2px solid #cdd3da;
|
|
margin-top: 2px;
|
|
border-radius: 50%;
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
transition: all var(--transition);
|
|
position: relative;
|
|
}
|
|
|
|
.checkbox:hover {
|
|
border-color: var(--color-accent);
|
|
}
|
|
|
|
.checkbox:checked {
|
|
background: var(--color-accent);
|
|
border-color: var(--color-accent);
|
|
}
|
|
|
|
.checkbox:checked::after {
|
|
content: "";
|
|
position: absolute;
|
|
left: 5px;
|
|
top: 1px;
|
|
width: 7px;
|
|
height: 11px;
|
|
border: 2px solid #fff;
|
|
border-top: none;
|
|
border-left: none;
|
|
transform: rotate(45deg);
|
|
}
|
|
|
|
/* ── Todo Title ───────────────────────────────────── */
|
|
.todo-title {
|
|
flex: 1;
|
|
font-size: 0.925rem;
|
|
color: var(--color-text);
|
|
word-break: break-word;
|
|
min-height: calc(0.925rem * 1.6);
|
|
transition: color var(--transition);
|
|
}
|
|
|
|
.todo-row.completed .todo-title {
|
|
color: var(--color-text-secondary);
|
|
}
|
|
|
|
.todo-row.abandoned .todo-title {
|
|
color: var(--color-text-secondary);
|
|
text-decoration: line-through;
|
|
text-decoration-thickness: 1px;
|
|
}
|
|
|
|
/* ── Todo Time ────────────────────────────────────── */
|
|
.todo-time {
|
|
font-size: 0.75rem;
|
|
color: var(--color-text-muted);
|
|
flex-shrink: 0;
|
|
margin-left: auto;
|
|
margin-right: 4px;
|
|
}
|
|
|
|
/* ── Status Badge ─────────────────────────────────── */
|
|
.status-badge {
|
|
font-size: 0.72rem;
|
|
padding: 2px 8px;
|
|
border-radius: 10px;
|
|
font-weight: 500;
|
|
flex-shrink: 0;
|
|
opacity: 0;
|
|
transition: opacity var(--transition);
|
|
}
|
|
|
|
.todo-row.completed .status-badge,
|
|
.todo-row.abandoned .status-badge,
|
|
.todo-row:hover .status-badge {
|
|
opacity: 1;
|
|
}
|
|
|
|
.status-badge.completed {
|
|
color: #4da08c;
|
|
background: rgba(117, 218, 199, 0.15);
|
|
}
|
|
|
|
.status-badge.abandoned {
|
|
color: #a08860;
|
|
background: rgba(196, 168, 122, 0.15);
|
|
}
|
|
|
|
/* ── Inline Create (子任务添加) ────────────────────── */
|
|
.inline-create {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding: 6px 12px;
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.inline-create.level-1 {
|
|
padding-left: 42px;
|
|
}
|
|
|
|
.inline-create.level-2 {
|
|
padding-left: 72px;
|
|
}
|
|
|
|
.inline-create-input {
|
|
flex: 1;
|
|
border: none;
|
|
border-bottom: 1.5px solid var(--color-accent);
|
|
outline: none;
|
|
font-size: 0.9rem;
|
|
color: var(--color-text);
|
|
background: transparent;
|
|
padding: 4px 0;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.inline-create-input::placeholder {
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
/* ── Inline Edit (行内编辑) ───────────────────────── */
|
|
.inline-edit-wrap {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 6px;
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.inline-edit-input {
|
|
flex: 1;
|
|
min-width: 0;
|
|
margin: 0;
|
|
border: none;
|
|
box-shadow: 0 1.5px 0 0 var(--color-accent);
|
|
outline: none;
|
|
font-size: 0.925rem;
|
|
color: var(--color-text);
|
|
background: transparent;
|
|
padding: 0;
|
|
line-height: inherit;
|
|
font-family: inherit;
|
|
resize: none;
|
|
overflow: hidden;
|
|
overflow-wrap: break-word;
|
|
word-break: break-word;
|
|
}
|
|
|
|
.btn-edit-confirm {
|
|
flex-shrink: 0;
|
|
width: 22px;
|
|
height: 22px;
|
|
padding-top: 1px;
|
|
}
|
|
|
|
/* ── Empty State ──────────────────────────────────── */
|
|
.empty-state {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
padding: 48px 20px;
|
|
color: var(--color-text-secondary);
|
|
text-align: center;
|
|
}
|
|
|
|
.empty-state svg {
|
|
margin-bottom: 16px;
|
|
opacity: 0.6;
|
|
}
|
|
|
|
.empty-state p {
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.empty-state.hidden {
|
|
display: none;
|
|
}
|
|
|
|
/* ── Footer ───────────────────────────────────────── */
|
|
.app-footer {
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
gap: 0;
|
|
background: var(--color-surface);
|
|
border-top: 1px solid var(--color-border);
|
|
padding: 0;
|
|
z-index: 10;
|
|
}
|
|
|
|
.filter-tab {
|
|
padding: 12px 24px;
|
|
border: none;
|
|
background: transparent;
|
|
font-size: 0.875rem;
|
|
font-weight: 500;
|
|
color: var(--color-text-secondary);
|
|
cursor: pointer;
|
|
transition: all var(--transition);
|
|
position: relative;
|
|
}
|
|
|
|
.filter-tab.active {
|
|
color: var(--color-accent);
|
|
}
|
|
|
|
.filter-tab.active::after {
|
|
content: "";
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
width: 24px;
|
|
height: 2.5px;
|
|
background: var(--color-accent);
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.filter-tab:hover {
|
|
color: var(--color-text);
|
|
}
|
|
|
|
.filter-tab.active:hover {
|
|
color: var(--color-accent);
|
|
}
|
|
|
|
/* ── Popup Menu ───────────────────────────────────── */
|
|
.popup-menu {
|
|
position: absolute;
|
|
right: 12px;
|
|
top: 100%;
|
|
background: var(--color-surface);
|
|
border: 1px solid var(--color-border);
|
|
border-radius: var(--radius);
|
|
box-shadow: var(--shadow-md);
|
|
padding: 6px;
|
|
z-index: 20;
|
|
min-width: 130px;
|
|
display: none;
|
|
}
|
|
|
|
.popup-menu.show {
|
|
display: block;
|
|
animation: fadeIn 0.12s ease;
|
|
}
|
|
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; transform: translateY(-4px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
.popup-menu-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
width: 100%;
|
|
padding: 8px 12px;
|
|
border: none;
|
|
background: transparent;
|
|
font-size: 0.84rem;
|
|
color: var(--color-text);
|
|
cursor: pointer;
|
|
border-radius: var(--radius-sm);
|
|
transition: background var(--transition);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.popup-menu-item:hover {
|
|
background: #f1f3f6;
|
|
}
|
|
|
|
.popup-menu-item.danger {
|
|
color: var(--color-danger);
|
|
}
|
|
|
|
.popup-menu-item.danger:hover {
|
|
background: #fef0f0;
|
|
}
|
|
|
|
.popup-divider {
|
|
height: 1px;
|
|
background: var(--color-border);
|
|
margin: 4px 8px;
|
|
}
|
|
|
|
/* ── Scrollbar ────────────────────────────────────── */
|
|
::-webkit-scrollbar {
|
|
width: 4px;
|
|
}
|
|
|
|
::-webkit-scrollbar-track {
|
|
background: transparent;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
background: #dce0e4;
|
|
border-radius: 2px;
|
|
}
|
|
|
|
/* ── Responsive ───────────────────────────────────── */
|
|
/* 平板以下 */
|
|
@media (max-width: 768px) {
|
|
#app {
|
|
padding: 16px 10px 100px;
|
|
}
|
|
|
|
.app-title {
|
|
font-size: 1.4rem;
|
|
}
|
|
|
|
.create-bar {
|
|
padding: 10px 12px;
|
|
margin-bottom: 14px;
|
|
}
|
|
|
|
/* 移动端:隐藏桌面 hover 按钮,改用滑动 */
|
|
.btn-add-sub,
|
|
.btn-edit {
|
|
display: none;
|
|
}
|
|
|
|
/* 保留菜单按钮,缩小尺寸 */
|
|
.btn-menu {
|
|
opacity: 1;
|
|
width: 28px;
|
|
height: 28px;
|
|
color: var(--color-text-muted);
|
|
}
|
|
|
|
/* 移动端行高适配触摸 */
|
|
.todo-row {
|
|
padding: 12px 10px;
|
|
min-height: 48px;
|
|
gap: 10px;
|
|
}
|
|
|
|
/* 复选框稍大,方便手指点击 */
|
|
.checkbox {
|
|
width: 22px;
|
|
height: 22px;
|
|
margin-top: 1px;
|
|
}
|
|
|
|
/* 缩进 */
|
|
.todo-row.level-1 {
|
|
padding-left: 30px;
|
|
}
|
|
.todo-row.level-2 {
|
|
padding-left: 48px;
|
|
}
|
|
.todo-row.level-1::before { left: 14px; }
|
|
.todo-row.level-2::before { left: 32px; }
|
|
|
|
.inline-create.level-1 { padding-left: 30px; }
|
|
.inline-create.level-2 { padding-left: 48px; }
|
|
|
|
/* 时间文字更小 */
|
|
.todo-time {
|
|
font-size: 0.7rem;
|
|
}
|
|
|
|
/* 状态徽标始终可见 */
|
|
.status-badge {
|
|
opacity: 1;
|
|
font-size: 0.68rem;
|
|
padding: 1px 6px;
|
|
}
|
|
|
|
/* 底部筛选全宽 */
|
|
.filter-tab {
|
|
max-width: none;
|
|
padding: 14px 16px;
|
|
}
|
|
}
|
|
|
|
/* 小屏手机优化 */
|
|
@media (max-width: 480px) {
|
|
#app {
|
|
padding: 12px 6px 90px;
|
|
}
|
|
|
|
.app-title {
|
|
font-size: 1.3rem;
|
|
}
|
|
|
|
.app-header {
|
|
margin-bottom: 18px;
|
|
padding: 0 4px;
|
|
}
|
|
|
|
.todo-row.level-1 { padding-left: 26px; }
|
|
.todo-row.level-2 { padding-left: 42px; }
|
|
.todo-row.level-1::before { left: 11px; }
|
|
.todo-row.level-2::before { left: 27px; }
|
|
|
|
.inline-create.level-1 { padding-left: 26px; }
|
|
.inline-create.level-2 { padding-left: 42px; }
|
|
|
|
.swipe-bg-left {
|
|
padding: 0 16px;
|
|
font-size: 0.75rem;
|
|
}
|
|
.swipe-bg-right .swipe-act {
|
|
padding: 0 12px;
|
|
font-size: 0.72rem;
|
|
}
|
|
}
|