/* 全局样式 */
:root {
    --primary-color: #1a73e8;
    --secondary-color: #5f6368;
    --background-color: #f8f9fa;
    --border-color: #e9ecef;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-hint: #80868b;
    --shadow-light: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-medium: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-heavy: 0 4px 8px rgba(0,0,0,0.1);
    --scrollbar-width: 12px; /* 新增：统一滚动条宽度 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
}

body {
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden; /* 禁止整体页面滚动 */
}

/* 导航栏样式 */
.top-nav {
    background-color: var(--primary-color);
    color: white;
    height: 64px;
    box-shadow: var(--shadow-medium);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

#logout-btn {
    color: white;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    transition: background-color 0.2s;
    cursor: pointer;
}

#logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#logout-btn i {
    font-size: 20px;
}

@media screen and (max-width: 768px) {
    #logout-btn {
        width: 32px;
        height: 32px;
    }

    #logout-btn i {
        font-size: 18px;
    }
}

/* 主内容区样式 */
.main-content {
    display: flex;
    height: calc(100vh - 64px);
    max-width: 1200px;
    margin: 64px auto 0;
    padding-top: 0;
    margin-bottom: 0 !important;
    overflow: hidden;
    position: relative;
}

/* 侧边栏样式 */
.sidebar {
    width: 240px;
    background: white;
    padding: 16px;
    border-right: 1px solid var(--border-color);
    display: block; /* 默认显示侧边栏 */
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nav-btn:hover {
    background-color: rgba(26, 115, 232, 0.1);
}

.nav-btn.active {
    background-color: rgba(26, 115, 232, 0.1);
    color: var(--primary-color);
}

/* 内容面板样式 */
.content-panels {
    flex: 1;
    padding: 24px;
    background: white;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.panel {
    display: none;
    height: 100%;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    flex-direction: column;
}

.panel.active {
    display: flex;
}

/* 设置面板特殊处理 */
#settings-panel {
    overflow-y: auto;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
}

/* 任务列表和用户列表容器统一样式 */
.task-list,
.user-list-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 16px;
    overflow-y: auto;
}

/* 顶部操作栏 */
.operations-bar {
    display: flex;
    flex-direction: column;
    gap: 8px; /* 进一步从12px减少到8px，让PC端更紧凑 */
    padding: 16px 24px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    position: relative; /* 添加相对定位 */
    z-index: 1000; /* 设置z-index低于角标 */
    overflow: hidden; /* 防止内容超出圆角面板 */
    align-items: stretch; /* 改为拉伸，让子项自然对齐 */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* 添加轻微阴影 */
    border-radius: 8px; /* 添加圆角 */
    margin: 0 0 16px 0; /* 占满容器宽度，不再居中收窄 */
    width: 100%;
    max-width: 100%; /* 与 task-list 一致 */
    box-sizing: border-box;
}

/* 操作栏上部 */
.operations-top {
    display: flex;
    align-items: center;
    gap: 12px; /* 减少间距，节省空间 */
    justify-content: space-between;
    margin-bottom: 0; /* 进一步从6px减少到0，让PC端更紧凑 */
    flex-wrap: wrap; /* 允许换行，防止溢出 */
    row-gap: 8px; /* 换行时的行间距 */
}

/* 搜索框和排序控制容器 */
.search-sort-container {
    display: flex;
    align-items: center;
    gap: 12px; /* 略减间距 */
    flex: 1 1 auto; /* 允许收缩，避免撑爆 */
}

/* 搜索框 */
.search-box {
    position: relative;
    min-width: 240px; /* 原 280px，下调以便在窄屏时可收缩 */
    flex: 1 1 360px;  /* 允许压缩与扩展，默认占 ~360px */
}

.search-box input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: var(--background-color);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* 排序控制样式 */
.sort-control {
    margin-right: 16px;
}

.sort-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.sort-toggle:hover {
    background-color: var(--background-color);
}

.sort-checkbox {
    display: none;
}

.sort-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.sort-label i {
    font-size: 18px;
    transition: transform 0.2s;
}

.sort-checkbox:checked + .sort-label {
    color: var(--primary-color);
}

.sort-checkbox:checked + .sort-label i {
    transform: rotate(180deg);
}

/* 操作按钮组 */
.action-group {
    display: flex;
    align-items: center;
    gap: 8px; /* 略减按钮间距，节省空间 */
    flex-wrap: nowrap; /* 桌面端保持同一行，不再在组内换行 */
}

.action-group .btn {
    height: 36px;
    min-width: 88px; /* 从 100px 调到 88px，更紧凑 */
    padding: 0 10px; /* 适当减小左右内边距，保持可读性 */
    flex: 0 0 auto; /* 禁止按钮自身缩到下一行 */
    white-space: nowrap; /* 文本不换行，避免多行按钮 */
}

/* 状态筛选 */

.status-filter {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible; /* 确保垂直方向内容不被裁剪 */
    padding: 5px 0; /* 使用padding替代margin */
    min-height: 50px; /* 确保有足够的高度显示角标 */
    justify-content: flex-start; /* 改为靠左对齐 */
    flex-wrap: wrap; /* 允许按钮换行 */
}

.status-btn {
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: var(--background-color);
    color: var(--text-secondary);
    position: relative; /* 添加相对定位以支持徽标定位 */
    margin: 5px 2px; /* 添加外边距，确保角标有足够空间 */
}

.status-btn:hover {
    background: rgba(26, 115, 232, 0.1);
}

.status-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(26, 115, 232, 0.3); /* 添加阴影提升层次感 */
    transform: translateY(-1px); /* 轻微上移效果 */
}

/* 异常按钮徽标 */
.status-btn[data-status="error"].has-error::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    background-color: var(--error-color);
    border-radius: 50%;
    box-shadow: 0 0 0 2px white;
    z-index: 1001; /* 增加z-index确保角标在最上层 */
}

.status-btn[data-status="error"].has-error.active::after {
    background-color: white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sidebar {
        display: none; /* 在移动端隐藏侧边栏 */
    }

    .bottom-nav {
        display: flex; /* 在移动端显示底部导航 */
    }

    .main-content {
        margin-top: 56px; /* 调整为更小的顶部导航高度 */
        margin-bottom: 56px;
        height: calc(100vh - 112px); /* 调整高度适应更小的导航 */
        padding: 0;
    }

    /* 移动端顶部导航优化 */
    .top-nav {
        height: 56px;
    }

    .nav-content {
        padding: 0 12px;
        height: 56px;
    }

    .nav-left {
        gap: 8px;
    }

    .nav-left i {
        font-size: 20px;
    }

    .nav-title {
        font-size: 16px;
        font-weight: 500;
    }

    .version {
        font-size: 10px;
        padding: 1px 4px;
    }

    .nav-right {
        gap: 6px;
    }

    #current-user {
        font-size: 12px;
        padding: 4px 6px;
    }

    .content-panels {
        padding: 12px;
        height: 100%;
    }

    .panel {
        height: 100%;
        overflow: hidden;
        padding: 0;
    }

    /* 确保面板头部固定 - 极简高度 */
    .panel-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        justify-content: flex-start; /* 改为左对齐，确保内部操作栏左对齐 */
        padding: 2px 0; /* 进一步减少内边距 */
        margin-bottom: 2px; /* 减少底部外边距 */
    }

    /* 操作栏适配 - 极简设计 */
    .operations-bar {
        padding: 4px 6px; /* 稍微增加内边距，为更大的按钮留空间 */
        max-width: 100%;
        gap: 8px; /* 增加上下区块间距，让布局更舒适 */
    }

    /* 顶部操作布局 - 垂直紧凑布局 */
    .operations-top {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 6px; /* 增加搜索行与操作按钮行之间的间距 */
        align-items: stretch; /* 让子项占满宽度，避免整体被居中 */
        margin-bottom: 0; /* 由父容器的 gap 控制，不再叠加 margin */
    }

    /* 搜索和排序行 */
    .search-sort-container {
        display: flex;
        gap: 8px;
        width: 100%;
        align-items: center;
    }

    /* 底部筛选区域 - 紧凑间距 */
    .operations-bottom {
        display: flex;
        align-items: center;
        justify-content: flex-start; /* 改为左对齐，确保筛选区域贴左显示 */
        flex-wrap: wrap;
        gap: 3px;
        padding: 0 6px;
        margin-top: 0; /* 由父容器的 gap 控制，不再叠加 margin */
    }

    /* 筛选按钮组 - 移动端紧凑布局（与上方区块间距保持一致） */
    .filter-group {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 6px; /* 增加状态筛选和分类筛选行之间的间距 */
        justify-content: flex-start; /* 顶部开始堆叠 */
        align-items: stretch; /* 子项拉伸至整行，以便左对齐可见 */
    }

    .status-filter,
    .category-filter {
        display: flex;
        justify-content: flex-start; /* 改为左对齐，从容器左侧开始排列 */
        flex-wrap: wrap;
        gap: 6px; /* 增加按钮之间的水平与换行间距 */
    }

    /* 状态筛选行 - 移动端去除上下 padding，保持紧凑 */
    .status-filter {
        padding: 0 !important; /* 强制覆盖全局的 padding: 5px 0; */
        margin: 0; /* 防止外边距撑开 */
        min-height: 0; /* 覆盖全局的 min-height:50px，消除多余垂直空间 */
    }

    /* 分类筛选行 - 同样去除多余留白 */
    .category-filter {
        padding: 0; /* 防止继承到 padding-bottom 等规则 */
        margin: 0;
    }

    /* 搜索框在移动端的样式 - 更紧凑 */
    .search-box {
        flex: 1;
        margin-right: 0;
        margin-bottom: 0;
        min-width: 0;
    }

    .search-box input {
        padding: 8px 10px 8px 32px;
        font-size: 14px;
        height: 44px; /* 与操作按钮高度保持一致 */
        box-sizing: border-box;
    }

    .search-box i {
        left: 10px;
        font-size: 18px;
    }

    /* 排序控制 - 与操作按钮高度一致 */
    .sort-control {
        margin-right: 0;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .sort-toggle {
        padding: 8px 10px;
        background-color: transparent;
        border: 1px solid var(--border-color);
        border-radius: 6px;
        white-space: nowrap;
        height: 44px; /* 与操作按钮高度保持一致 */
        box-sizing: border-box;
        display: flex;
        align-items: center;
    }

    .sort-label {
        font-size: 11px;
        gap: 3px;
    }

    .sort-label i {
        font-size: 14px;
    }

    /* 操作按钮组 - 等宽填充 100% 布局 */
    .action-group {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* 四个按钮等宽 */
        gap: 6px; /* 均匀间距 */
        width: 100%;
    }

    .action-group .btn {
        width: 100%; /* 占满各自网格单元 */
        margin: 0;
        padding: 8px 6px;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 44px; /* 触摸友好最小高度 */
        box-sizing: border-box;
        border-radius: 6px;
    }

    .action-group .btn i {
        font-size: 18px; /* 适配更紧凑的等宽按钮 */
    }
    /* 取消移动端激活状态的上移效果，避免“上下两行间距”与外部间距不一致的错觉 */
    @media (max-width: 768px) { .status-btn.active, .category-btn.active { transform: none; } }


    /* 保留按钮文字（等宽布局下文字有空间显示） */
    .action-group .btn span {
        display: inline;
    }



    .status-btn,
    .category-btn {
        padding: 6px 12px; /* 增加内边距，让按钮更大更易点击 */
        font-size: 12px; /* 增大字体 */
        border-radius: 8px;
        min-width: auto;
        flex-shrink: 0;
        margin: 0; /* 移动端：去掉外边距，间距由父容器的 gap 控制 */
        line-height: 1.2;
        height: 32px; /* 增加高度，提升可点击性和视觉效果 */
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center; /* 确保文字居中 */
    }

    /* 确保task-list能滚动且占据剩余空间 */
    .task-list {
        padding: 6px;
        flex: 1;
        margin-top: 0;
    }

    /* 任务项在小屏幕上的布局 */
    .task-item {
        grid-template-columns: auto 1fr auto;
        padding: 8px;
        margin-bottom: 6px;
    }

/* 统一窄屏环境下按钮垂直间距（防止 hover 能力设备不命中 pointer:coarse 或 hover:none） */
@media (max-width: 768px) {
  .status-btn, .category-btn {
    margin-block: 0; /* 上下 0 */
  }
}

}

/* 批量操作区 */
.batch-operations {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.batch-operations .left-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-operations .right-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-operations .selected-count {
    color: var(--text-secondary);
    font-size: 14px;
    margin-left: 8px;
}

/* 添加任务按钮 */
.add-task-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-light);
    white-space: nowrap; /* 防止文字换行 */
}

.add-task-btn:hover {
    background-color: #1557b0;
    box-shadow: var(--shadow-medium);
}

.add-task-btn i {
    font-size: 20px;
}

@media (min-width: 769px) {
    /* 操作栏下部（桌面端） */
    .operations-bottom {
        display: flex;
        align-items: center;
        gap: 8px;
        overflow: visible; /* 确保内容不被裁剪 */
        padding-top: 0; /* 从3px减少到0，让PC端更紧凑 */
        justify-content: flex-start; /* 左对齐，统一与移动端一致 */
        width: 100%; /* 确保宽度占满 */
    }
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* 防止文字换行 */
    min-width: 90px; /* 设置最小宽度 */
    justify-content: center; /* 确保内容居中 */
}

.btn.primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-light);
}

.btn.primary:hover {
    background-color: #1557b0;
    box-shadow: var(--shadow-medium);
}

.btn.secondary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn.secondary:hover {
    background-color: rgba(26, 115, 232, 0.1);
}

.btn.danger {
    background-color: var(--error-color);
    color: white;
}

.btn.danger:hover {
    background-color: #c82333;
}

.btn.text {
    background: none;
    color: var(--primary-color);
    padding: 4px 8px;
}

.btn.text:hover {
    background-color: rgba(26, 115, 232, 0.1);
}

.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* 图标按钮 */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.btn-icon.primary {
    color: var(--primary-color);
}

.btn-icon.danger {
    color: var(--error-color);
}

/* 自定义复选框样式 */
.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-secondary);
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox-input:checked + .checkbox-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-input:checked + .checkbox-custom::after {
    content: "";
    display: block;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* 拖拽时的样式 */
.task-item.dragging {
    opacity: 0.5;
    background-color: var(--background-color);
}

.task-item.drag-over {
    border: 2px dashed var(--primary-color);
    margin: -1px;
}

/* 批量操作工具栏 */
.batch-toolbar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 16px 24px;
    box-shadow: var(--shadow-heavy);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

.batch-toolbar.active {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.batch-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.batch-toolbar-right {
    display: flex;
    gap: 8px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.2s ease-in-out;
}

/* 加载状态样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1500;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-message {
    margin-top: 16px;
    color: var(--secondary-color);
    font-size: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 通知样式 */
.notification-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.notification {
    padding: 12px 24px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease-out;
    width: 100%;
}

.notification.info {
    background-color: var(--info-color);
}

.notification.success {
    background-color: var(--success-color);
}

.notification.warning {
    background-color: var(--warning-color);
}

.notification.error {
    background-color: var(--error-color);
}

.notification.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

/* 更新通知样式 */
.update-notification {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-medium);
    color: var(--text-primary);
    width: 100%;
}

.update-notification strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.update-notification p {
    margin: 4px 0;
    font-size: 14px;
}

.update-notification a.btn {
    margin-top: 12px;
    display: inline-block;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--background-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

/* 任务状态样式 */
.task-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    background: var(--background-color);
}

.task-status.normal {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.task-status.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.task-status.running {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

.task-status.error,
.task-status.failed {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--error-color);
}

.task-status.pending {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.task-status.skipped {
    background-color: rgba(95, 99, 104, 0.1);
    color: var(--text-secondary);
}

/* 按钮禁用状态 */
.btn-icon[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 触摸反馈 */
@media (hover: none) {
    .btn:active,
    .btn-icon:active {
        opacity: 0.7;
    }
}

/* 选中状态样式 */
.task-item.selected {
    background-color: rgba(26, 115, 232, 0.05);
    border-color: var(--primary-color);
    border-left-color: var(--primary-color); /* 确保左侧边框显示 */
}

/* 拖拽状态样式 */
.task-ghost {
    opacity: 0.5;
    background: var(--background-color);
}

.task-chosen {
    background: #e8f0fe;
}

.task-drag {
    background: white;
    box-shadow: var(--shadow-heavy);
}

@media (min-width: 769px) {
    /* 筛选组样式（桌面端） */
    .filter-group {
        display: flex;
        flex-direction: column;
        gap: 4px; /* 进一步从8px减少到4px，让PC端筛选区域更紧凑 */
        justify-content: flex-start; /* 左对齐，统一两端 */
        width: 100%;
        overflow: visible; /* 确保溢出内容可见 */
        padding: 2px; /* 添加内边距 */
    }
}

@media (min-width: 769px) {
    .category-filter {
        display: flex;
        gap: 8px;
        justify-content: flex-start; /* 左对齐，统一两端 */
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.category-btn {
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: var(--background-color);
    color: var(--text-secondary);
    white-space: nowrap;
}

.category-btn:hover {
    background: rgba(26, 115, 232, 0.1);
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(26, 115, 232, 0.3); /* 添加阴影提升层次感 */
    transform: translateY(-1px); /* 轻微上移效果 */
}

/* 任务分类标签 */
.task-category {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    background: var(--background-color);
    color: var(--text-secondary);
}



/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10001; /* 确保高于底部导航栏(9999) */
    padding: 24px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-heavy);
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    padding: 8px;
    margin: -8px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: var(--background-color);
    color: var(--text-primary);
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

/* 复选框容器样式 */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.form-actions {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 用户登录状态样式 */
#current-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    transition: all 0.2s;
    cursor: default;
    user-select: none;
    min-width: 80px;
}

#current-user.logged-in {
    background: rgba(40, 167, 69, 0.2);
    color: white;
    padding-right: 4px;
}

#current-user .user-name {
    padding: 4px 8px 4px 16px;
    position: relative;
}

#current-user .user-name::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
}

#current-user .logout-btn {
    color: white;
    opacity: 0.8;
    transition: all 0.2s;
}

#current-user .logout-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

#current-user .logout-btn i {
    font-size: 18px;
}

@media screen and (max-width: 768px) {
    #current-user {
        font-size: 12px;
        padding: 4px 8px;
    }

    #current-user .logout-btn i {
        font-size: 16px;
    }
}

/* Datalist 样式 */
input[list] {
    position: relative;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

input[list]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* 修复浏览器默认行为，确保datalist下拉列表正常显示 */
input[list]::-webkit-calendar-picker-indicator {
    opacity: 1;
    width: 20px;
    height: 20px;
    color: var(--text-hint);
}

datalist {
    max-height: 200px;
    overflow-y: auto;
}

/* 确保input的placeholder不会挡住datalist选项 */
input[list]::placeholder {
    opacity: 0.5;
}

/* 修复某些浏览器中datalist的显示问题 */
@-moz-document url-prefix() {
    input[list] {
        padding-right: 30px; /* 为Firefox中的下拉图标留出空间 */
    }
}

/* 进度日志窗口样式 */
.progress-modal-content {
    width: 800px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    z-index: 2100;
}

.progress-log-container {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #1e1e1e;
    margin: 16px;
    border-radius: 4px;
}

.progress-log {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #e0e0e0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.progress-log .info {
    color: #4fc3f7;
}

.progress-log .success {
    color: #81c784;
}

.progress-log .warning {
    color: #ffb74d;
}

.progress-log .error {
    color: #e57373;
}

.progress-log .timestamp {
    color: #9e9e9e;
    margin-right: 8px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 用户管理面板样式 */
.user-list-container {
    padding: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.user-item:hover {
    box-shadow: var(--shadow-medium);
}

.user-item.active {
    border-color: var(--primary-color);
    background-color: rgba(26, 115, 232, 0.05);
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.user-item.active .user-name::before {
    background: var(--success-color);
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-actions .btn-icon {
    color: var(--text-secondary);
}

.user-actions .btn-icon:hover {
    color: var(--text-primary);
}

.user-actions .btn-icon.danger:hover {
    color: var(--error-color);
}

/* 表单帮助文本样式 */
.form-help {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

/* 表单警告/错误帮助文本（红色） */
.form-help.error {
    color: var(--error-color);
}

/* 面板头部样式（桌面端） */
@media (min-width: 769px) {
    .panel-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 16px; /* 与 .task-list 的左右 16px 一致，确保容器宽度对齐 */
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
    }

    .panel-header h2 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 500;
        color: var(--text-primary);
    }
}

/* 文本域样式 */
textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: monospace;
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* 系统设置面板样式 */
.settings-form {
    width: 100%;
}

.settings-form .form-group {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.settings-form .form-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-form h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
}

.settings-form .checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
}

.settings-form .checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin: 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.settings-form .checkbox-wrapper input[type="checkbox"]:checked {
    background-color: #1a73e8;
    border-color: #1a73e8;
}

.settings-form .checkbox-wrapper input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.settings-form .checkbox-wrapper input[type="checkbox"]:hover {
    border-color: #1a73e8;
}

.settings-form .checkbox-wrapper input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.settings-form .checkbox-wrapper label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
    padding: 2px 0;
}

.settings-form .input-group {
    margin-bottom: 16px;
}

.settings-form .input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.settings-form input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.settings-form input[type="text"]:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.1);
    outline: none;
}

.settings-form .help-text {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.settings-form .btn-group {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.settings-form button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.settings-form button.primary {
    background-color: #1a73e8;
    color: white;
}

.settings-form button.primary:hover {
    background-color: #1557b0;
}

.settings-form button.secondary {
    background-color: #f1f3f4;
    color: #333;
}

.settings-form button.secondary:hover {
    background-color: #e8eaed;
}

/* 输入框占位符颜色 */
.settings-form input[type="text"]::placeholder {
    color: #999;
}

/* 禁用状态样式 */
.settings-form input[type="text"]:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

/* 错误状态样式 */
.settings-form input[type="text"].error {
    border-color: #dc3545;
}

.settings-form .error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

/* 任务编辑弹窗样式 */
.modal form {
    padding: 20px;
}

.modal .form-group {
    margin-bottom: 20px;
    position: relative;
}

.modal .form-group:last-child {
    margin-bottom: 0;
}

.modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.modal .form-group label.required::after {
    content: "*";
    color: #f56c6c;
    margin-left: 4px;
}

.modal .form-group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s;
}

.modal .form-group input[type="text"]:focus {
    border-color: #409eff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(64,158,255,0.2);
}

.modal .form-group input[type="text"]::placeholder {
    color: #909399;
}

.modal .form-group .help-text {
    margin-top: 4px;
    font-size: 12px;
    color: #909399;
    line-height: 1.4;
}

.modal .form-group.has-error input[type="text"] {
    border-color: #f56c6c;
}

.modal .form-group.has-error .help-text {
    color: #f56c6c;
}

.modal .form-actions {
    margin-top: 24px;
    text-align: right;
}

.modal .form-actions .btn {
    margin-left: 12px;
}

@media screen and (max-width: 768px) {
    .modal form {
        padding: 16px;
    }

    .modal .form-group {
        margin-bottom: 16px;
    }

    .modal .form-group input[type="text"] {
        font-size: 16px; /* 移动端输入框字体放大，避免iOS自动缩放 */
    }
}

/* 版本号样式 */
.version-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    margin-right: 12px;
}

.version {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.update-indicator {
    position: absolute;
    top: -2px;
    right: -5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--error-color);
    display: none;
}

.update-indicator.active {
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 5px rgba(255, 59, 48, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
    }
}

/* GitHub图标样式 */
.github-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin-left: 12px;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.github-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.github-icon {
    width: 20px;
    height: 20px;
    color: currentColor;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .nav-left {
        flex-grow: 1;
    }

    .nav-title {
        max-width: 150px;
    }

    .version-container {
        margin-left: 4px;
        margin-right: 8px;
    }

    .version {
        font-size: 10px;
        padding: 1px 4px;
    }

    .update-indicator {
        width: 6px;
        height: 6px;
        top: -1px;
        right: -3px;
    }

    .github-link {
        margin-left: auto;
    }

    .github-icon {
        width: 18px;
        height: 18px;
    }
}

/* 底部导航栏样式 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding-bottom: env(safe-area-inset-bottom);
    background: white;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.1);
    display: none; /* 默认隐藏 */
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    animation: fadeInUp 0.5s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.login-form .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: var(--background-color);
}

.login-form .form-group input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.1);
}

.login-form .form-group input::placeholder {
    color: #9aa0a6;
}

.login-form .submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.login-form .submit-btn:hover {
    background: #1557b0;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
}

.login-form .submit-btn:active {
    transform: translateY(1px);
}

.login-form .input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.login-form .input-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.login-form .input-icon input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: var(--background-color);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media screen and (max-width: 480px) {
    .login-box {
        padding: 20px;
        margin: 16px;
        width: calc(100% - 32px);
    }

    .login-header h1 {
        font-size: 20px;
    }

    .login-form .form-group {
        margin-bottom: 16px;
    }

    .login-form .input-icon input {
        font-size: 14px;
        padding: 10px 14px 10px 40px;
        height: 40px;
    }

    .login-form .input-icon i {
        font-size: 18px;
        left: 12px;
    }

    .login-form .submit-btn {
        padding: 10px;
        font-size: 14px;
        height: 40px;
    }
}

/* 错误提示样式 */
.login-error {
    background: #fce8e8;
    color: #d93025;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.5s ease-in-out;
}

.login-error i {
    font-size: 20px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 品牌标志样式 */
.brand-logo {
    text-align: center;
    margin-bottom: 24px;
}

.brand-logo i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
}

/* 输入框带下拉按钮的样式 */
.input-with-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-dropdown input {
    flex: 1;
    padding-right: 40px;  /* 为下拉按钮留出空间 */
}

.dropdown-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.dropdown-btn:hover {
    color: var(--primary-color);
}

.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.custom-dropdown.active {
    display: block;
}

.custom-dropdown .dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.custom-dropdown .dropdown-item:hover {
    background-color: var(--hover-color);
}

/* 美化滚动条 */
.custom-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.custom-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.custom-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 添加安全区域适配 */
@supports (padding: max(0px)) {
    .bottom-nav {
        padding-bottom: max(4px, env(safe-area-inset-bottom));
        height: calc(56px + env(safe-area-inset-bottom));
    }
}

/* 在移动端显示底部导航 */
@media screen and (max-width: 768px) {
    .bottom-nav {
        display: flex !important;
    }
}

/* 优化触摸目标尺寸 */
@media (pointer: coarse) {
    .btn,
    .btn-icon,
    .nav-btn,
    .checkbox-wrapper,
    .drag-handle {
        min-height: 44px; /* 确保最小触摸区域 */
        min-width: 44px;
    }

    .action-group .btn {
        margin: 1px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        min-width: 44px;
    }

    .status-btn, .category-btn {
        margin: 0; /* 移除外边距，使用父容器的gap控制间距 */
        padding: 6px 12px; /* 与移动端样式保持一致 */
    }
}

/* 添加触摸反馈效果 */
@media (hover: none) {
    .btn,
    .btn-icon,
    .nav-btn,
    .status-btn,
    .category-btn {
        transition: opacity 0.2s;
    }

    .btn:active,
    .btn-icon:active,
    .nav-btn:active,
    .status-btn:active,
    .category-btn:active {
        opacity: 0.7;
    }
}

/* 优化安全区域适配 */
@supports (padding: max(0px)) {
    .bottom-nav {
        padding-bottom: max(4px, env(safe-area-inset-bottom));
        height: calc(56px + env(safe-area-inset-bottom));
    }

    .task-list {
        margin-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    .modal-content {
        max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px);
    }
}

/* 增加触摸反馈 */
@media (pointer: coarse) {
    .btn-icon {
        min-width: 40px;
        min-height: 40px;
        padding: 12px !important;
    }

    .task-item {
        touch-action: pan-y;
    }
}

/* 增加触摸滚动支持 */
.operations-bar {
    scrollbar-width: none; /* Firefox */
}

.operations-bar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* 增加移动端专用样式 */
@media (pointer: coarse) {
    .operations-bar {
        touch-action: pan-y; /* 限制滚动方向 */
    }

    .action-group .btn {
        margin: 2px; /* 增加按钮间距 */
        box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 提升按钮可视性 */
    }

    .status-btn, .category-btn {
        margin: 0; /* 移除外边距，使用父容器的gap控制间距 */
        padding: 6px 12px; /* 与移动端样式保持一致 */
    }
}

/* 增强移动端触摸体验 */
@media (pointer: coarse) {
    .task-actions .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    .action-group .btn {
        min-height: 48px;
    }
}

/* 增强底部导航的显示性能 */
.bottom-nav {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 任务列表基础样式 */
.task-list {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    -ms-overflow-style: thin;
}

.task-list::-webkit-scrollbar {
    width: 8px;
    display: block;
}

.task-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.task-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.task-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* 任务项基础样式 */
.task-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 8px;
    padding: 12px;
    align-items: center;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    margin-bottom: 12px; /* 增加任务项之间的间距 */
    border-left: 3px solid transparent; /* 添加左侧边框 */
}

.task-item:hover {
    box-shadow: var(--shadow-medium);
    border-left-color: var(--primary-color); /* 悬停时显示边框颜色 */
}

/* 任务项左侧布局 */
.task-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 拖拽手柄样式 */
.drag-handle {
    cursor: move;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.drag-handle:hover {
    background: var(--background-color);
}

/* 任务内容样式 */
.task-content {
    flex: 1;
    min-width: 0;
}

.task-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.task-name {
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.save-dir {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 任务操作按钮样式 */
.task-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 120px; /* PC端固定宽度 */
    justify-content: flex-end; /* 保持右对齐 */
    transition: none !important; /* 禁用过渡效果 */
}

.task-actions .btn-icon {
    width: 36px !important;
    height: 36px !important;
    padding: 8px;
}

.task-actions .btn-icon i {
    font-size: 20px;
}

/* 任务详情样式 */
.task-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #666;
}

.task-details .save-dir,
.task-details .cron-rule {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 任务消息样式 */
.task-message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.task-message.error {
    color: #ff4d4f;
}

/* 复制按钮样式 */
.copy-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.copy-btn:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn i {
    font-size: 16px;
}

/* 移动端任务列表样式调整 */
@media screen and (max-width: 768px) {
    .task-list {
        margin: 0;
        margin-bottom: calc(60px + env(safe-area-inset-bottom));
        padding: 4px;
        gap: 8px;
    }



    /* 任务项优化 - 统一移动端布局 */
    .task-item {
        padding: 14px;
        gap: 10px;
        align-items: flex-start;
        border-radius: 12px;
        margin-bottom: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border-left: 3px solid transparent;
        transition: all 0.2s ease;
    }

    .task-item:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        border-left-color: var(--primary-color);
    }

    .task-item-left {
        gap: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 2px;
        min-width: 32px;
    }

    .drag-handle {
        order: 2;
        color: #ccc;
        cursor: move;
    }

    .checkbox-wrapper {
        order: 1;
    }

    .task-content {
        flex: 1;
        min-width: 0;
        width: 100%;
    }

    .task-header {
        margin-bottom: 8px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .task-name {
        font-size: 16px;
        font-weight: 600;
        line-height: 1.3;
        color: var(--primary-color);
        text-decoration: none;
        display: block;
        width: 100%;
        margin-bottom: 6px;
        word-break: break-word;
    }

    .task-name:hover {
        color: #1557b0;
    }

    .task-status {
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 12px;
        font-weight: 500;
        white-space: nowrap;
    }

    .task-category {
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 12px;
        background-color: rgba(108, 117, 125, 0.1);
        color: #6c757d;
        font-weight: 500;
        white-space: nowrap;
    }

    .task-details {
        font-size: 12px;
        line-height: 1.5;
        gap: 6px;
        color: #666;
    }

    .task-details > * {
        margin-bottom: 4px;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .task-details .save-dir,
    .task-details .cron-rule {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block;
    }

    .last-execute-time {
        font-size: 11px;
        color: #999;
        font-weight: normal;
    }

    /* 移动端任务消息样式 - 统一样式，无背景色 */
    .task-message {
        font-size: 12px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        color: #666;
        display: block;
        margin-top: 4px;
        font-weight: normal;
        line-height: 1.4;
        word-break: break-word;
    }

    .task-message.error {
        background: transparent;
        color: #dc2626;
        font-weight: normal;
    }

    .task-message.success {
        background: transparent;
        color: #666;
        font-weight: normal;
    }

    /* 移动端任务操作按钮 - 统一样式 */
    .task-actions {
        display: flex;
        flex-direction: column;
        gap: 6px;
        align-items: center;
        justify-content: flex-start;
        padding-top: 2px;
        min-width: 44px;
        width: 44px;
    }

    .task-actions .btn-icon {
        width: 36px;
        height: 36px;
        padding: 8px;
        border-radius: 8px;
        font-size: 16px;
        transition: all 0.2s ease;
        touch-action: manipulation;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--background-color);
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        margin: 0;
    }

    .task-actions .btn-icon:hover,
    .task-actions .btn-icon:active {
        transform: scale(0.95);
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }

    .task-actions .btn-icon.danger {
        color: #ff4d4f;
        border-color: rgba(255, 77, 79, 0.3);
    }

    .task-actions .btn-icon.danger:hover,
    .task-actions .btn-icon.danger:active {
        background: #ff4d4f;
        border-color: #ff4d4f;
        color: white;
    }

    .task-actions .btn-icon i {
        font-size: 16px;
    }

    /* 移动端分享链接样式优化 - 左对齐，无背景，内联布局 */
    .task-message.share-link {
        background: transparent !important;
        color: #666 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 4px !important;
        font-size: 12px !important;
        font-weight: normal !important;
        margin-top: 4px !important;
        margin-bottom: 0 !important;
        width: auto !important;
        box-sizing: border-box !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        text-align: left !important;
    }

    .task-message.share-link .share-text {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-weight: normal !important;
        color: #666 !important;
        display: inline !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .task-message.share-link .share-url {
        display: none !important; /* 移动端隐藏完整链接文本 */
    }

    .task-message.share-link .share-actions {
        display: inline-flex !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-direction: row !important;
    }

    .task-message.share-link .share-btn {
        background: var(--background-color) !important;
        border: 1px solid var(--border-color) !important;
        padding: 2px !important;
        cursor: pointer !important;
        color: #666 !important;
        border-radius: 3px !important;
        transition: all 0.2s ease !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 20px !important;
        width: 20px !important;
        height: 20px !important;
        font-size: 10px !important;
        touch-action: manipulation !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
        vertical-align: middle !important;
    }

    .task-message.share-link .share-btn:hover,
    .task-message.share-link .share-btn:active {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
        transform: scale(0.95);
    }

    .task-message.share-link .share-btn i {
        font-size: 12px;
        line-height: 1;
    }
}

/* PC端分享链接样式 - 可点击链接 + 复制按钮 */
@media (min-width: 769px) {
    .task-message.share-link {
        background: transparent !important;
        color: #666 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        font-size: 13px !important;
        font-weight: normal !important;
        margin-top: 4px !important;
        margin-bottom: 0 !important;
        width: auto !important;
        box-sizing: border-box !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        text-align: left !important;
    }

    .task-message.share-link .share-text {
        display: inline !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-weight: normal !important;
        color: #666 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .task-message.share-link .share-url {
        display: inline !important; /* PC端显示完整链接文本 */
        color: var(--primary-color) !important;
        text-decoration: none !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        margin: 0 !important;
        padding: 0 !important;
        word-break: break-all !important;
        max-width: 400px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .task-message.share-link .share-url:hover {
        text-decoration: underline !important;
        color: #1557b0 !important;
    }

    .task-message.share-link .share-actions {
        display: inline-flex !important; /* PC端显示复制按钮 */
        gap: 4px !important;
        flex-shrink: 0 !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-direction: row !important;
    }

    .task-message.share-link .share-btn {
        background: var(--background-color) !important;
        border: 1px solid var(--border-color) !important;
        padding: 3px !important;
        cursor: pointer !important;
        color: #666 !important;
        border-radius: 4px !important;
        transition: all 0.2s ease !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 22px !important;
        width: 22px !important;
        height: 22px !important;
        font-size: 11px !important;
        touch-action: manipulation !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
        vertical-align: middle !important;
    }

    .task-message.share-link .share-btn:hover,
    .task-message.share-link .share-btn:active {
        background-color: var(--primary-color) !important;
        border-color: var(--primary-color) !important;
        color: white !important;
        transform: scale(0.95) !important;
    }

    .task-message.share-link .share-btn i {
        font-size: 13px !important;
        line-height: 1 !important;
    }

    /* 只显示复制按钮，隐藏跳转按钮（因为链接本身就可以点击） */
    .task-message.share-link .share-btn:nth-child(2) {
        display: none !important;
    }
}

/* 通知字段样式 */
.input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.notify-field {
    display: flex;
    gap: 8px;
    align-items: center;
    background-color: var(--background-light);
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.notify-field input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
}

.notify-field .field-name {
    min-width: 180px;
    font-weight: 500;
}

.notify-field .field-value {
    flex: 1;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: var(--hover-color);
}

.icon-btn.delete {
    color: var(--error-color);
}

.icon-btn.add {
    color: var(--success-color);
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--background-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.quick-notify-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.small-btn {
    font-size: 12px;
    padding: 6px 12px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: var(--shadow-medium);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu .dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #f1f3f4;
}

.input-with-dropdown {
    position: relative;
}

/* 用户信息样式 */
#current-user {
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: #fff;
    font-size: 14px;
    cursor: default;
}

#current-user.logged-in {
    font-weight: 500;
}

/* 配额信息样式 */
.quota-info {
    margin-left: 10px;
    padding: 2px 6px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .quota-info {
        display: none;
    }
}

/* 分享相关样式 */
.task-share-info {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    font-size: 0.9em;
}

.share-link:not(.task-message) {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.share-link a {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
}

.share-password {
    background-color: #e8f0fe;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

.share-time {
    display: flex;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 0.85em;
}

@media (max-width: 768px) {
    .share-link:not(.task-message) {
        flex-direction: column;
        gap: 4px;
    }

    .share-time {
        flex-direction: column;
        gap: 4px;
    }
}

/* 超小屏幕优化 (320px-480px) */
@media screen and (max-width: 480px) {
    .task-item {
        padding: 12px;
        gap: 8px;
        margin-bottom: 8px;
    }

    .task-name {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .task-details {
        font-size: 11px;
        gap: 4px;
    }

    .task-message.share-link {
        padding: 0 !important;
        gap: 3px !important;
        font-size: 11px !important;
    }

    .task-message.share-link .share-btn {
        min-width: 18px !important;
        width: 18px !important;
        height: 18px !important;
        padding: 1px !important;
    }

    .task-message.share-link .share-btn i {
        font-size: 10px !important;
    }

    .task-actions .btn-icon {
        width: 32px;
        height: 32px;
        padding: 6px;
    }

    .task-actions .btn-icon i {
        font-size: 14px;
    }
}

/* 被筛选隐藏的任务 */
.task-item.filtered-hidden {
    display: none !important;
}