/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sync-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.sync-btn:hover {
    background: rgba(255,255,255,0.3);
}

.sync-btn.syncing {
    animation: pulse 1.5s infinite;
}

.auto-save-indicator {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 认证信息样式 */
.auth-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* 标签页样式 */
.tabs-container {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0 2rem;
}

.tabs-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tabs-list {
    display: flex;
    gap: 0.25rem;
    flex: 1;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.tab {
    background: white;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    position: relative;
}

.tab:hover {
    background: #f8f9fa;
}

.tab.active {
    background: white;
    border-color: #4CAF50;
    color: #4CAF50;
    font-weight: 500;
}

.tab-name {
    flex: 1;
    min-width: 0;
}

.tab-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tab-close:hover {
    background: #e9ecef;
    color: #dc3545;
}

.add-tab-btn {
    background: #4CAF50;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.add-tab-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

/* 工具栏样式 */
.toolbar {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toolbar-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

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

.save-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #218838;
}

.save-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.last-saved {
    font-size: 0.875rem;
    color: #6c757d;
}

/* 编辑器样式 */
.editor-container {
    flex: 1;
    padding: 2rem;
    background: #fff;
}

.editor {
    min-height: 500px;
    height: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
}

/* Quill编辑器自定义样式 */
.ql-toolbar {
    border-radius: 8px 8px 0 0;
    border-color: #e9ecef;
}

.ql-container {
    border-radius: 0 0 8px 8px;
    border-color: #e9ecef;
    min-height: 450px;
}

.ql-editor {
    min-height: 450px;
    font-size: 16px;
    line-height: 1.6;
    padding: 1.5rem;
}

/* 文件面板样式 */
.files-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.files-panel.open {
    right: 0;
}

.files-header {
    background: #4CAF50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.files-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.files-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* 文件面板标签样式 */
.files-tabs {
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.files-tabs-list {
    display: flex;
    padding: 0 1rem;
    overflow-x: auto;
    gap: 0.25rem;
}

.files-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    color: #6c757d;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.files-tab:hover {
    background: rgba(255,255,255,0.8);
    color: #495057;
}

.files-tab.active {
    background: white;
    color: #4CAF50;
    font-weight: 600;
    border-bottom: 2px solid #4CAF50;
}

.files-list {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.file-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #e9ecef;
}

.file-icon {
    font-size: 1.5rem;
    color: #6c757d;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.file-meta {
    font-size: 0.875rem;
    color: #6c757d;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-action-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.file-action-btn:hover {
    background: #dee2e6;
    color: #495057;
}

/* 待办事项面板样式 */
.todos-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.todos-panel.open {
    right: 0;
}

.todos-header {
    background: #4CAF50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.todos-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.todos-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.todos-toolbar {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.todos-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.search-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: #45a049;
}

.todos-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-select {
    flex: 1;
    padding: 0.4rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
}

.todos-stats {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
}

.stat-value {
    font-weight: bold;
    color: #4CAF50;
    font-size: 1.1em;
}

.todos-list {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.todo-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.todo-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #4CAF50;
}

.todo-item.completed {
    opacity: 0.7;
    background: #f8f9fa;
}

.todo-item.priority {
    border-left: 4px solid #ff6b6b;
}

.todo-item.urgent {
    border-left: 4px solid #dc3545;
}

.todo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.todo-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.todo-title.completed {
    text-decoration: line-through;
    color: #6c757d;
}

.todo-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-completed { background: #d4edda; color: #155724; }
.status-priority { background: #f8d7da; color: #721c24; }
.status-delayed { background: #ffeaa7; color: #6c5ce7; }
.status-sleeping { background: #e2e3e5; color: #383d41; }
.status-cancelled { background: #f5c6cb; color: #721c24; }

.priority-badge {
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.priority-urgent { background: #dc3545; color: white; }
.priority-high { background: #fd7e14; color: white; }
.priority-normal { background: #6c757d; color: white; }
.priority-low { background: #28a745; color: white; }

.todo-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.todo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f3f4;
}

.todo-dates {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.todo-actions {
    display: flex;
    gap: 0.5rem;
}

.todo-action-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.todo-action-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.todo-action-btn.complete {
    color: #28a745;
}

.todo-action-btn.complete:hover {
    background: #d4edda;
}

.todo-empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.todo-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 加载和消息样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    color: #495057;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #4CAF50;
}

.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.message {
    background: white;
    border-left: 4px solid;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

.message.success {
    border-color: #28a745;
    color: #155724;
    background-color: #d4edda;
}

.message.error {
    border-color: #dc3545;
    color: #721c24;
    background-color: #f8d7da;
}

.message.info {
    border-color: #007bff;
    color: #004085;
    background-color: #d1ecf1;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .tabs-container {
        padding: 0 1rem;
    }
    
    .toolbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .toolbar-left, .toolbar-right {
        width: 100%;
        justify-content: center;
    }
    
    .editor-container {
        padding: 1rem;
    }      .editor {
        min-height: 300px;
    }
      .ql-container {
        min-height: 250px;
    }
      .ql-editor {
        min-height: 250px;
        padding: 1rem;
    }
    
    .files-panel {
        width: 100%;
        right: -100%;
    }
    
    .message {
        max-width: calc(100vw - 40px);
    }
}

/* 图片样式 */
.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0.5rem 0;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 管理员菜单 */
.admin-menu {
    position: relative;
    display: inline-block;
}

.admin-btn {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-right: 0.5rem;
}

.admin-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.admin-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 160px;
    display: none;
}

.admin-dropdown.show {
    display: block;
}

.admin-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
    border-bottom: 1px solid #eee;
}

.admin-dropdown a:last-child {
    border-bottom: none;
}

.admin-dropdown a:hover {
    background: #f5f5f5;
}

.admin-dropdown a i {
    margin-right: 0.5rem;
    width: 1rem;
}
