* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局样式优化 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2d3748;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.header h1 {
    margin: 0;
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

/* 主内容区域 - 左右布局 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
    align-items: start;
}

/* 左侧：待办事项列表 */
.tasks-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.tasks-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* 标签切换样式 */
.task-tabs {
    display: flex;
    background-color: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 18px 24px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.tab-btn:hover {
    background-color: rgba(102, 126, 234, 0.05);
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    background-color: white;
}

.tab-btn.active::after {
    width: 100%;
}

/* 标签内容容器 */
.task-tabs-content {
    background-color: white;
    overflow: hidden;
}

/* 已完成事项容器 */
.completed-container {
    display: flex;
    flex-direction: column;
    background-color: white;
}

/* 已完成事项头部 - 包含清除按钮 */
.completed-header {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px;
    background-color: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}

/* 任务列表 */
.task-list {
    display: flex;
    flex-direction: column;
    max-height: 600px;
    overflow-y: auto;
}

/* 标签内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 滚动条样式优化 */
.task-list::-webkit-scrollbar {
    width: 6px;
}

.task-list::-webkit-scrollbar-track {
    background-color: #f7fafc;
}

.task-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e0;
    border-radius: 3px;
}

.task-list::-webkit-scrollbar-thumb:hover {
    background-color: #a0aec0;
}

/* 单条任务样式 - 一行显示 */
.task-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    border-bottom: 1px solid #f0f7fa;
    transition: all 0.3s ease;
    background-color: white;
    position: relative;
    overflow: hidden;
}

.task-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.task-item:hover {
    background-color: #f8fafc;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.task-item:hover::before {
    transform: scaleY(1);
}

.task-item:last-child {
    border-bottom: none;
}

/* 自定义复选框 */
.task-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #667eea;
    transition: all 0.3s ease;
}

.task-item input[type="checkbox"]:hover {
    transform: scale(1.1);
}

/* 任务信息区域 */
.task-info {
    flex: 1;
    display: flex;
    gap: 20px;
    align-items: center;
    min-width: 0;
}

/* 日期显示 - 固定宽度 */
.task-date {
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
    min-width: 110px;
    flex-shrink: 0;
    background-color: rgba(102, 126, 234, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    text-align: center;
}

/* 任务内容 - 自动换行 */
.task-content {
    font-size: 16px;
    color: #2d3748;
    white-space: normal;
    word-wrap: break-word;
    overflow: hidden;
    flex: 1;
    font-weight: 500;
}

.task-item.completed .task-content {
    text-decoration: line-through;
    color: #a0aec0;
    font-weight: 400;
}

.task-item.completed .task-date {
    background-color: rgba(160, 174, 192, 0.1);
    color: #a0aec0;
}

/* 当天日期样式 */
.task-date.today {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    font-weight: 600;
}

/* 清除已完成事项按钮 */
.clear-completed-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

.clear-completed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.clear-completed-btn:active {
    transform: translateY(0);
}

/* 右侧：添加事项表单 */
.add-task-section {
    background-color: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 24px;
    transition: all 0.3s ease;
}

.add-task-section:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.add-task-section h2 {
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
    letter-spacing: -0.5px;
}

/* 添加事项表单样式 */
.add-task {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 0;
    background: none;
    padding: 0;
    box-shadow: none;
}

/* 表单组样式 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 表单输入框样式 */
.add-task input {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    color: #2d3748;
    background-color: #f7fafc;
    transition: all 0.3s ease;
    outline: none;
}

.add-task input:focus {
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-task input::placeholder {
    color: #a0aec0;
}

/* 添加事项按钮样式 */
#add-btn {
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

#add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

#add-btn:active {
    transform: translateY(0);
}

/* 退出登录按钮样式 */
.logout-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.logout-btn:active {
    transform: translateY(0);
}

/* 认证容器样式 - 渐变背景 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 认证表单样式 - 现代化卡片设计 */
.auth-form {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

/* 认证Logo样式 */
.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 60px;
    margin-bottom: 16px;
    animation: bounce 1s ease-in-out;
}

.logo-text {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

/* 认证标题样式 */
.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2d3748;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

/* 简单的Logo动画 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* 表单组样式 */
.auth-form .form-group {
    margin-bottom: 24px;
}

/* 表单标签样式 */
.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 表单输入框样式 */
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    color: #2d3748;
    background-color: #f7fafc;
    transition: all 0.3s ease;
    outline: none;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="email"]:focus,
.auth-form input[type="password"]:focus {
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.auth-form input[type="text"]::placeholder,
.auth-form input[type="email"]::placeholder,
.auth-form input[type="password"]::placeholder {
    color: #a0aec0;
}

/* 认证错误提示 */
.auth-error {
    color: #e53e3e;
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    background-color: #fed7d7;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
}

/* 认证按钮样式 - 现代化设计 */
.auth-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 16px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.auth-btn:active {
    transform: translateY(0);
}

/* 认证切换链接 */
.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 15px;
    color: #718096;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.auth-switch a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #667eea;
    transition: width 0.3s ease;
}

.auth-switch a:hover {
    color: #764ba2;
}

.auth-switch a:hover::after {
    width: 100%;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* 退出登录按钮 */
.logout-btn {
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #c0392b;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .add-task-section {
        position: static;
    }
    
    .task-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .task-date {
        min-width: auto;
    }
    
    .task-content {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}