/* 修改后的布局 */
body {
    margin: 0;
    background-color: #f0f0f0;
    display: flex;
    min-height: 100vh;
    font-family: Arial, sans-serif;
}

/* ========== 可收缩导航栏样式 ========== */

/* 默认收缩状态的导航栏 */
.sidebar {
    width: 70px; /* 收缩状态宽度 */
    background-color: white;
    color: #1D2129;
    padding-top: 20px;
    position: fixed;
    height: 100%;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

/* 完全隐藏收缩按钮 */
.sidebar-toggle-btn {
    display: none !important;
}

/* 导航栏图标和文字 */
.sidebar .icon {
    margin-right: 10px;
    font-size: 18px;
    width: 24px;
    text-align: center;
    transition: margin 0.3s;
}

.sidebar .nav-text {
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s, width 0.3s;
    width: 0;
}

/* 导航栏链接 */
.sidebar a {
    display: flex;
    align-items: center;
    color: #4b5563;
    padding: 12px 16px;
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 2px 8px;
    white-space: nowrap;
}

.sidebar a:hover {
    background-color: #f3f4f6;
    color: #165DFF;
}

.sidebar a.active {
    background-color: rgba(22, 93, 255, 0.1);
    color: #165DFF;
}

/* 子菜单样式 */
.sidebar .submenu {
    display: none;
    padding-left: 0;
    background-color: #f9fafb;
    border-radius: 8px;
    margin-top: 4px;
}

.sidebar .has-submenu:hover .submenu {
    display: block;
}

.sidebar .submenu a {
    padding: 10px 16px;
    font-size: 14px;
    margin: 1px 8px;
}

.sidebar .submenu a:before {
    content: "";
    width: 4px;
    height: 4px;
    background-color: #9ca3af;
    border-radius: 50%;
    margin-right: 10px;
}

/* 子菜单图标 */
.submenu-icon {
    display: inline-block;
    width: 4px;
    height: 4px;
    background-color: #9ca3af;
    border-radius: 50%;
    margin-right: 10px;
}

/* 主内容区调整 */
.main-content {
    margin-left: 70px; /* 收缩状态导航栏宽度 */
    padding: 0;
    flex: 1;
    width: calc(100% - 70px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 顶部标题卡片调整 */
.header-card {
    position: fixed;
    top: 0;
    left: 70px; /* 收缩状态导航栏宽度 */
    width: calc(100% - 70px);
    z-index: 50;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 更新主内容区顶部内边距 */
.content-container {
    padding-top: 70px; /* 标题卡片高度 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 确保日历和其他内容的位置正确 */
.lg\:col-span-1.bg-white.rounded-xl.shadow-sm.p-5.h-fit.sticky {
    top: 90px; /* 调整粘性定位的顶部距离 */
}

/* 隐藏移动端菜单按钮 */
#mobile-menu-btn {
    display: none !important;
}

/* 导航栏悬停效果（桌面端） */
@media (min-width: 1025px) {
    /* 鼠标悬停时自动展开（收缩状态下） */
    .sidebar:hover {
        width: 220px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar:hover .nav-text {
        opacity: 1;
        width: auto;
        transition-delay: 0.1s;
    }
    
    .sidebar:hover .icon {
        margin-right: 10px;
    }
    
    /* 悬停时显示子菜单 */
    .sidebar:hover .has-submenu:hover .submenu {
        display: block;
    }
    
    /* 调整主内容区在悬停时的宽度 */
    .sidebar:hover ~ .main-content {
        margin-left: 220px;
        width: calc(100% - 220px);
    }
    
    .sidebar:hover ~ .main-content .header-card {
        left: 220px;
        width: calc(100% - 220px);
    }
}

/* 移动端响应式设计 - 完全隐藏导航栏 */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .header-card {
        left: 0 !important;
        width: 100% !important;
    }
}

/* 其他样式保持不变... */
.calendar-day {
    aspect-ratio: 1/1;
}

.calendar-day-active {
    background-color: rgba(22, 93, 255, 0.1);
    border-color: #165DFF;
}

.event-item {
    border-radius: 0.5rem;
    padding: 0.375rem;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1D2129;
}

.view-btn {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.view-btn.active {
    background-color: #165DFF;
    color: white;
}

.view-btn:not(.active) {
    background-color: #F3F4F6;
    color: #4B5563;
}

.view-btn:not(.active):hover {
    background-color: #E5E7EB;
}

.progress-circle {
    transition: stroke-dashoffset 0.5s ease-in-out;
}

.compact-event {
    font-size: 0.75rem;
    padding: 0.375rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.week-day-cell {
    border: 1px solid #F3F4F6;
    border-radius: 0.5rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    background-color: white;
    height: 180px;
}

.month-day-cell {
    border: 1px solid #F3F4F6;
    border-radius: 0.5rem;
    padding: 0.375rem;
    display: flex;
    flex-direction: column;
    background-color: white;
    height: 120px;
}

/* 分类颜色 */
.light-work {
    background-color: rgba(22, 93, 255, 0.3);
}

.light-study {
    background-color: rgba(114, 46, 209, 0.3);
}

.light-life {
    background-color: rgba(0, 180, 42, 0.3);
}

.light-other {
    background-color: rgba(255, 125, 0, 0.3);
}

.text-work {
    color: #165DFF;
}

.text-study {
    color: #722ED1;
}

.text-life {
    color: #00B42A;
}

.text-other {
    color: #FF7D00;
}

/* 导入导出按钮样式 */
.data-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.import-btn {
    background-color: #00B42A;
    color: white;
}

.import-btn:hover {
    background-color: #009922;
}

.export-btn {
    background-color: #165DFF;
    color: white;
}

.export-btn:hover {
    background-color: #0D4BC8;
}

/* 模态框样式调整 */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    margin-top: 1rem;
}

/* 隐藏滚动条 */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;             /* Chrome, Safari and Opera */
}

/* 子任务相关样式 */
.subtask-progress-bar {
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.subtask-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.subtask-edit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.subtask-edit-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
}

.subtask-edit-input:focus {
    outline: none;
    border-color: #165DFF;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
}

.subtask-delete-btn {
    color: #f53f3f;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.subtask-delete-btn:hover {
    background-color: rgba(245, 63, 63, 0.1);
}

/* 滚动条美化 */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ========== 分类汇总卡片样式优化 ========== */
.category-summary-card {
    transition: all 0.3s ease;
    max-height: 300px;
    overflow-y: auto;
}

.category-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 分类汇总任务项样式 - 优化版 */
.summary-task-item {
    font-size: 0.75rem;
    line-height: 1.3;
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.summary-task-item:hover {
    background-color: #f8fafc;
    transform: translateX(2px);
}

/* 任务标题容器 - 左侧 */
.task-title-container {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0; /* 允许文本溢出 */
    margin-right: 8px;
    overflow: hidden;
}

/* 任务标题样式 - 优先级最高 */
.task-title-main {
    font-size: 0.75rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* 子任务计数样式 - 放在标题后面 */
.subtask-count-badge {
    font-size: 0.65rem;
    background-color: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 6px;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 日期标签样式 - 右侧，淡化显示 */
.task-date-badge {
    font-size: 0.65rem;
    color: #888;
    background-color: #f5f5f5;
    border-radius: 3px;
    padding: 1px 6px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
}

/* 今天/明天/后天特殊样式 */
.date-today {
    color: #165DFF;
    background-color: rgba(22, 93, 255, 0.08);
}

.date-tomorrow {
    color: #00B42A;
    background-color: rgba(0, 180, 42, 0.08);
}

.date-this-week {
    color: #722ED1;
    background-color: rgba(114, 46, 209, 0.08);
}

/* 分类汇总卡片滚动条美化 */
.category-summary-card::-webkit-scrollbar {
    width: 4px;
}

.category-summary-card::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.category-summary-card::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.category-summary-card::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 复选框样式优化 */
.summary-checkbox {
    width: 14px;
    height: 14px;
    text-primary focus:ring-primary/50 border-gray-300 rounded;
    margin-right: 8px;
    flex-shrink: 0;
}