/* =========================
   全局初始化
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========================
   页面主体
========================= */

body {
    background:linear-gradient(to right, #acecea, #f3d9e4);
;
    font-family:
        "PingFang SC",
        "Microsoft YaHei",
        sans-serif;

    color: #111827;

    padding: 30px 15px;
}

/* =========================
   主容器
========================= */

.container {
    width: 100%;
    max-width: 800px;

    margin: 0 auto;

    background: #ffffff;

    border-radius: 24px;

    padding: 28px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.06);
}

/* =========================
   标题
========================= */

.page-title {
    text-align: center;

    font-size: 42px;

    font-weight: 700;

    margin-bottom: 40px;

    color: #111827;
}

/* =========================
   表单区域
========================= */

.task-form-section {
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;

    margin-bottom: 10px;

    font-size: 22px;

    font-weight: 600;
}

/* =========================
   输入框
========================= */

input,
textarea {
    width: 100%;

    border: 1.5px solid #d1d5db;

    border-radius: 14px;

    padding: 14px 16px;

    font-size: 16px;

    outline: none;

    background: #ffffff;
}

/* 聚焦效果 */
input:focus,
textarea:focus {
    border-color: #22c55e;

    box-shadow:
        0 0 0 4px rgba(34, 197, 94, 0.15);
}

/* textarea */
textarea {
    min-height: 120px;

    resize: vertical;
}

/* =========================
   添加按钮
========================= */

.add-btn {
    width: 100%;

    border: none;

    border-radius: 14px;

    padding: 16px;

    background: #35a845;

    color: white;

    font-size: 22px;

    font-weight: 700;

    cursor: pointer;

    transition: 0.25s;
}

.add-btn:hover {
    background: #2c933b;

    transform: translateY(-1px);
}

/* =========================
   筛选区域
========================= */

.toolbar-section {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin-top: 30px;

    margin-bottom: 24px;

    padding-top: 22px;

    border-top: 1px solid #e5e7eb;

    flex-wrap: wrap;
}

/* 左侧筛选 */
.filter-group {
    display: flex;

    align-items: center;

    gap: 12px;

    flex-wrap: wrap;
}

/* =========================
   通用按钮
========================= */

.filter-btn,
.more-item,
#searchBtn,
#batchCompleteBtn,
#batchDeleteBtn,
.complete-btn,
.edit-btn,
.delete-btn,
#saveEditBtn,
#cancelEditBtn {
    border: none;

    border-radius: 12px;

    padding: 10px 18px;

    cursor: pointer;

    font-size: 15px;

    font-weight: 600;

    transition: 0.25s;
}

/* 默认按钮 */
.filter-btn,
.more-item,
#searchBtn,
#batchCompleteBtn,
#batchDeleteBtn {
    background: #f3f4f6;
}

.filter-btn:hover,
.more-item:hover,
#searchBtn:hover,
#batchCompleteBtn:hover,
#batchDeleteBtn:hover {
    background: #e5e7eb;
}

/* 激活状态 */
.filter-btn.active {
    background: #35a845;

    color: white;
}

/* =========================
   更多菜单
========================= */

.more-wrapper {
    position: relative;
}

.more-menu {
    position: absolute;

    top: 52px;
    left: 0;

    background: white;

    border-radius: 14px;

    padding: 10px;

    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.08);

    display: none;

    flex-direction: column;

    gap: 10px;

    min-width: 130px;

    z-index: 20;
}


/* =========================
   搜索区域
========================= */

.search-group {
    display: flex;

    align-items: center;

    gap: 10px;
}

.search-group input {
    width: 240px;
}

/* =========================
   批量操作区域
========================= */

.action-section {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin-bottom: 26px;

    flex-wrap: wrap;
}

/* 左侧 */
.batch-actions {
    display: flex;

    align-items: center;

    gap: 12px;

    flex-wrap: wrap;
}

/* 全选 */
.select-all-wrapper {
    display: flex;

    align-items: center;

    gap: 8px;

    font-size: 16px;
}

/* checkbox */
input[type="checkbox"] {
    width: 18px;
    height: 18px;

    cursor: pointer;
}

/* 统计 */
.task-stats {
    display: flex;

    gap: 20px;

    font-size: 15px;

    color: #374151;

    flex-wrap: wrap;
}

/* =========================
   任务列表
========================= */

.task-list-section {
    display: flex;

    flex-direction: column;

    gap: 20px;
}

/* =========================
   任务卡片
========================= */

.task-card {
    background: #ffffff;

    border-radius: 20px;

    padding: 18px;

    border: 1px solid #ececec;

    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.04);

    transition: 0.25s;
}

/* hover */
.task-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.06);
}

/* 顶部 */
.task-card-top {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 14px;

    margin-bottom: 18px;

    flex-wrap: wrap;
}

/* 左侧 */
.task-left {
    display: flex;

    align-items: center;

    gap: 12px;
}

/* 标题 */
.task-title {
    font-size: 24px;

    font-weight: 700;
}

/* 操作按钮 */
.task-actions {
    display: flex;

    gap: 10px;

    flex-wrap: wrap;
}

/* 完成按钮 */
.complete-btn {
    background: #35a845;

    color: white;
}

.complete-btn:hover {
    background: #2f963d;
}

/* 编辑 */
.edit-btn {
    background: #3b82f6;

    color: white;
}

.edit-btn:hover {
    background: #2563eb;
}

/* 删除 */
.delete-btn {
    background: #ff5a5a;

    color: white;
}

.delete-btn:hover {
    background: #ef4444;
}

/* =========================
   内容区
========================= */

.task-content {
    background: #f9fafb;

    border-radius: 16px;

    padding: 18px;

    min-height: 90px;

    margin-bottom: 16px;

    line-height: 1.7;

    color: #374151;

    overflow: hidden;

    word-break: break-word;
}

/* =========================
   底部
========================= */

.task-card-bottom {
    display: flex;

    justify-content: space-between;

    gap: 14px;

    flex-wrap: wrap;

    color: #6b7280;

    font-size: 14px;
}

/* =========================
   已完成状态
========================= */

.task-card.completed {
    opacity: 0.7;
}

.task-card.completed .task-title {
    text-decoration: line-through;

    color: #9ca3af;
}

/* =========================
   骨架屏
========================= */

#skeletonContainer {
    display: flex;

    flex-direction: column;

    gap: 20px;
}

/* 骨架卡片 */
.skeleton-card {
    height: 180px;

    border-radius: 20px;

    background:
        linear-gradient(90deg,
            #f3f4f6 25%,
            #e5e7eb 50%,
            #f3f4f6 75%);

    background-size: 400% 100%;

    animation: skeleton-loading 1.4s infinite;
}

/* 动画 */
@keyframes skeleton-loading {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* =========================
   弹窗
========================= */

.modal {
    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.45);

    display: none;

    justify-content: center;

    align-items: center;

    z-index: 999;
}

/* 内容 */
.modal-content {
    width: 90%;
    max-width: 500px;

    background: white;

    border-radius: 22px;

    padding: 24px;
}

/* 标题 */
.modal-content h2 {
    margin-bottom: 24px;

    text-align: center;
}

/* 底部按钮 */
.modal-actions {
    display: flex;

    justify-content: flex-end;

    gap: 12px;

    margin-top: 20px;
}

/* 保存 */
#saveEditBtn {
    background: #35a845;

    color: white;
}

/* 取消 */
#cancelEditBtn {
    background: #e5e7eb;
}

/* =========================
   Toast
========================= */

#toast {
    position: fixed;

    top: 30px;
    right: 30px;

    background: #111827;

    color: white;

    padding: 14px 20px;

    border-radius: 14px;

    font-size: 14px;

    z-index: 99999;

    opacity: 0;

    transform: translateY(-20px);

    pointer-events: none;

    transition: 0.3s;
}

/* 显示 */
#toast.show {
    opacity: 1;

    transform: translateY(0);
}

/* =========================
   卡片动画
========================= */

.task-card {
    animation: cardShow 0.35s ease;
}

@keyframes cardShow {

    from {
        opacity: 0;

        transform:
            translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;

        transform:
            translateY(0) scale(1);
    }

}

/* =========================
   删除动画
========================= */

.task-card.removing {

    animation:
        removeCard 0.3s forwards;

}

@keyframes removeCard {

    to {

        opacity: 0;

        transform:
            translateX(30px);

        height: 0;

        padding: 0;

        margin: 0;

    }

}

/* =========================
   弹窗动画
========================= */

.modal-content {

    animation:
        modalShow 0.25s ease;

}

@keyframes modalShow {

    from {

        opacity: 0;

        transform:
            scale(0.9);

    }

    to {

        opacity: 1;

        transform:
            scale(1);

    }

}

/* =========================
   空状态优化
========================= */

.empty-box {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 14px;

    min-height: 180px;

    font-size: 18px;
}

.empty-box::before {

    content: "📝";

    font-size: 48px;

}

/* =========================
   按钮点击反馈
========================= */

button:active {

    transform:
        scale(0.97);

}

/* =========================
   输入平滑
========================= */

input,
textarea {

    transition:
        border-color 0.25s,
        box-shadow 0.25s,
        transform 0.2s;

}

input:focus,
textarea:focus {

    transform:
        translateY(-1px);

}

/* =========================
   高级骨架屏
========================= */

.skeleton-card {

    position: relative;

    overflow: hidden;

}

.skeleton-card::after {

    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.45),
            transparent);

    animation:
        skeletonShine 1.4s infinite;

}

@keyframes skeletonShine {

    from {

        transform:
            translateX(-100%);

    }

    to {

        transform:
            translateX(100%);

    }

}

/* =========================
   响应式
========================= */

@media (max-width: 768px) {

    .container {
        padding: 20px;
    }

    .page-title {
        font-size: 34px;
    }

    .toolbar-section,
    .action-section,
    .task-card-top,
    .task-card-bottom {
        flex-direction: column;

        align-items: flex-start;
    }

    .search-group {
        width: 100%;
    }

    .search-group input {
        width: 100%;
    }

    .task-actions {
        width: 100%;
    }

    .task-actions button {
        flex: 1;
    }

    .task-title {
        font-size: 20px;
    }

    .form-group label {
        font-size: 18px;
    }

    .add-btn {
        font-size: 18px;
    }

}

/* =========================
   空状态
========================= */

.empty-box {
    background: #ffffff;

    border-radius: 18px;

    padding: 40px 20px;

    text-align: center;

    color: #9ca3af;

    font-size: 18px;

    border: 1px dashed #d1d5db;
}

/* =========================
   Confirm Modal
========================= */

.confirm-modal {

    position: fixed;

    inset: 0;

    background:
        rgba(0, 0, 0, 0.45);

    display: none;

    justify-content: center;

    align-items: center;

    z-index: 99999;

}

.confirm-box {

    width: 90%;
    max-width: 420px;

    background: white;

    border-radius: 24px;

    padding: 28px;

    animation:
        modalShow 0.25s ease;

}

.confirm-box h3 {

    font-size: 24px;

    margin-bottom: 14px;

}

.confirm-box p {

    color: #6b7280;

    line-height: 1.7;

    margin-bottom: 26px;

}

.confirm-actions {

    display: flex;

    justify-content: flex-end;

    gap: 12px;

}

.confirm-actions button {

    border: none;

    border-radius: 12px;

    padding: 10px 18px;

    cursor: pointer;

    font-weight: 600;

}

#confirmCancelBtn {

    background: #e5e7eb;

}

#confirmOkBtn {

    background: #ef4444;

    color: white;

}

/* =========================
   分页
========================= */

.pagination {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 18px;

    margin-top: 30px;

}

.pagination button {

    border: none;

    border-radius: 12px;

    padding: 10px 16px;

    background: #f3f4f6;

    cursor: pointer;

    font-weight: 600;

    transition: 0.25s;

}

.pagination button:hover {

    background: #e5e7eb;

}

#pageInfo {

    font-weight: 600;

    color: #374151;

}