/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F9FAFB;
    color: #333;
    line-height: 1.6;
}

/* 顶部导航 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo h1 {
    color: #6990F2;
    font-size: 24px;
    font-weight: 600;
}

.logo h1 a {
    transition: color 0.3s ease;
}

.logo h1 a:hover {
    color: #5a7fd8;
}

.search-box {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-box:focus-within {
    border-color: #6990F2;
    box-shadow: 0 4px 12px rgba(105, 144, 242, 0.15);
}

.search-box input {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    background: transparent;
    outline: none;
    color: #333;
    transition: all 0.3s ease;
}

.search-box input::placeholder {
    color: #999;
    transition: opacity 0.3s ease;
}

.search-box input:focus::placeholder {
    opacity: 0.5;
}

.search-box button {
    padding: 8px 16px;
    background: linear-gradient(135deg, #6990F2 0%, #5a7fd8 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
    box-shadow: 0 2px 6px rgba(105, 144, 242, 0.3);
}

.search-box button:hover {
    background: linear-gradient(135deg, #5a7fd8 0%, #4a6fc8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(105, 144, 242, 0.4);
}

.search-box button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(105, 144, 242, 0.3);
}

.search-box button i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.search-box button:hover i {
    transform: scale(1.1);
}

.header-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    font-size: 14px;
    color: #666;
}

.menu-dropdown {
    position: relative;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 8px;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 1001;
}

.menu-dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}

.dropdown-content a:hover {
    background-color: #F9FAFB;
}

/* 广告区域 */
.ad-banner {
    background: #6990F2;
    color: white;
    padding: 12px 0;
    text-align: center;
}

.ad-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 主要内容区域 */
.main-content {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.content-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    min-height: calc(100vh - 200px);
    align-items: start;
}

/* 项目区域 */
.projects-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.projects-list {
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #6990F2 #f1f1f1;
    padding-top: 10px;
}

.projects-list::-webkit-scrollbar {
    width: 8px;
}

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

.projects-list::-webkit-scrollbar-thumb {
    background: #6990F2;
    border-radius: 4px;
}

.projects-list::-webkit-scrollbar-thumb:hover {
    background: #5a7fd8;
}

.project-item {
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-item:hover {
    border-color: #6990F2;
    background-color: #F9FAFB;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-width: 1px;
    border-style: solid;
}

.project-item.active {
    border-color: #6990F2;
    background-color: #6990F2;
    color: white;
}

.project-item .project-actions {
    display: none;
}

.project-item:hover .project-actions {
    display: block;
}

/* 任务区域 */
.tasks-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    min-height: 500px;
}

.task-actions {
    display: flex;
    gap: 10px;
}

.tasks-list {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    min-height: 200px;
    scrollbar-width: thin;
    scrollbar-color: #6990F2 #f1f1f1;
    padding-top: 10px;
}

.tasks-list::-webkit-scrollbar {
    width: 8px;
}

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

.tasks-list::-webkit-scrollbar-thumb {
    background: #6990F2;
    border-radius: 4px;
}

.tasks-list::-webkit-scrollbar-thumb:hover {
    background: #5a7fd8;
}

.task-item {
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.task-item:hover {
    border-color: #6990F2;
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-width: 1px;
    border-style: solid;
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: #999;
}

.task-item:not(.completed) .task-title {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.task-title {
    flex: 1;
    cursor: pointer;
    font-weight: 500;
}

.task-title:hover {
    color: #6990F2;
}

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

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-primary {
    background: #6990F2;
    color: white;
}

.btn-primary:hover {
    background: #5a7fd8;
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-danger {
    background: transparent;
    color: #dc3545;
    border: none;
}

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

/* 删除按钮特殊样式 */
.btn-danger.btn-sm {
    background: transparent;
    color: #6990F2;
    border: none;
    padding: 4px 6px;
    box-shadow: none;
}

.btn-danger.btn-sm:hover {
    background: transparent;
    color: #5a7fd8;
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 3px 6px;
    font-size: 11px;
    min-width: auto;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* 模态框样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 2001;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-large {
    max-width: 1200px;
    width: 90vw;
    max-height: 90vh;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6990F2;
    box-shadow: 0 0 0 2px rgba(105, 144, 242, 0.2);
}

.form-help {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.form-help a {
    color: #6990F2;
    text-decoration: none;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 统计表格样式 */
.statistics-table {
    margin-top: 20px;
    overflow-x: auto;
}

.statistics-table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.statistics-table th,
.statistics-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.statistics-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.statistics-table tr:hover {
    background: #f8f9fa;
}

.filter-section {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.filter-section .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.filter-section .form-group label {
    margin-bottom: 5px;
    font-size: 14px;
}

.filter-section .form-group input {
    padding: 8px 10px;
    font-size: 14px;
}

/* 富文本编辑器 */
.rich-text-editor {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.toolbar {
    padding: 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 4px;
}

.toolbar-btn {
    padding: 6px 8px;
    background: none;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    color: #666;
}

.toolbar-btn:hover {
    background: #e9ecef;
}

.rich-text-content {
    min-height: 200px;
    max-height: 400px;
    padding: 12px;
    outline: none;
    font-family: inherit;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

/* 统计表格 */
.filter-section {
    display: flex;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.statistics-table {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.data-table tr:hover {
    background: #F9FAFB;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.pagination button:hover {
    background: #F9FAFB;
}

.pagination button.active {
    background: #6990F2;
    color: white;
    border-color: #6990F2;
}

/* 徽章 */
.badge {
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.badge-admin {
    background: #6990F2;
    color: white;
}

.badge-used {
    background: #28a745;
    color: white;
}

.badge-unused {
    background: #ffc107;
    color: #333;
}

/* 统计卡片 */
.stats-section {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: #6990F2;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.stat-content p {
    color: #666;
    font-size: 14px;
}

/* 管理员区域 */
.admin-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.table-container {
    overflow-x: auto;
}

/* 认证页面 */
.auth-page {
    background: linear-gradient(135deg, #6990F2 0%, #5a7fd8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: #6990F2;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-header p {
    color: #666;
    font-size: 16px;
}

.auth-form {
    margin-bottom: 20px;
}

.auth-footer {
    text-align: center;
    color: #666;
}

.auth-footer a {
    color: #6990F2;
    text-decoration: none;
}

/* 提示框 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 网站底部 */
.footer {
    background: #fff;
    border-top: 1px solid #e1e5e9;
    margin-top: 40px;
    padding: 20px 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #6990F2;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #5a7fd8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
        gap: 15px;
    }
    
    .search-box {
        max-width: 100%;
        margin: 0;
        border-radius: 20px;
    }
    
    .search-box input {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .search-box button {
        padding: 8px 12px;
        min-width: 36px;
        height: 32px;
    }
    
    .content-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .projects-section {
        order: 2;
    }
    
    .tasks-section {
        order: 1;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-section .form-group {
        margin-bottom: 10px;
    }
    
    .modal {
        width: 95%;
        max-width: none;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0 15px;
    }
    
    .projects-section,
    .tasks-section {
        padding: 15px;
    }
    
    .task-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-links {
        justify-content: center;
    }
}
