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

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

.container {
    width: 100%;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    min-width: 1200px;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.status-bar {
    display: flex;
    gap: 20px;
    align-items: center;
}

.status-bar span {
    font-size: 14px;
    font-weight: 500;
}

.status-online {
    color: #27ae60;
}

.status-offline {
    color: #e74c3c;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 80% 20%;
    gap: 20px;
    height: calc(100vh - 140px);
}

/* 文档面板头部 */
.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.documents-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

/* 编辑器容器 */
.editor-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.editor-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
}

.editor-header h2 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #3498db;
    color: white;
    white-space: nowrap;
    min-width: 100px;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.editor-wrapper {
    flex: 1;
    padding: 0;
}

#editor {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 16px;
    line-height: 1.8;
    color: #2c3e50;
    background: transparent;
    padding: 20px;
}

#editor::placeholder {
    color: #bdc3c7;
    font-style: italic;
}

#editor:focus {
    background: rgba(255, 255, 255, 0.98);
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    min-width: 250px;
}

.users-panel,
.activity-panel,
.documents-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.documents-panel h3,
.users-panel h3,
.activity-panel h3 {
    padding: 15px 15px 10px;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #e1e8ed;
}

.documents-list {
    padding: 15px 15px;
    max-height: 180px;
    overflow-y: auto;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 45px;
}

.document-item:hover {
    background: #f8f9fa;
    transform: translateX(2px);
    transition: all 0.2s ease;
}

.document-item:last-child {
    border-bottom: none;
}

.document-item.active {
    background: #e3f2fd;
    border-left: 3px solid #3498db;
    padding-left: 17px;
    border-radius: 0 8px 8px 0;
}

.document-title {
    font-size: 14px;
    color: #2c3e50;
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

.document-time {
    font-size: 11px;
    color: #95a5a6;
    margin-top: 4px;
}

.document-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.document-icon {
    font-size: 14px;
    margin-right: 8px;
    opacity: 0.7;
}

.document-content {
    display: flex;
    align-items: center;
    flex: 1;
    cursor: pointer;
}

.document-delete-btn {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.document-delete-btn:hover {
    opacity: 1;
    background: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.no-documents {
    color: #95a5a6;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

.users-panel h3,
.activity-panel h3 {
    padding: 20px 20px 15px;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #e1e8ed;
}

.users-list,
.activity-log {
    padding: 15px 15px;
    max-height: 100px;
    overflow-y: auto;
}

.no-users,
.no-activity {
    color: #95a5a6;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

/* 用户列表项 */
.user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.user-item:last-child {
    border-bottom: none;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.user-name {
    font-size: 14px;
    color: #2c3e50;
    flex: 1;
}

.user-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
}

/* 活动日志项 */
.activity-item {
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
    font-size: 13px;
    color: #7f8c8d;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    color: #95a5a6;
    font-size: 11px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 75% 25%;
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .sidebar {
        flex-direction: row;
    }
    
    .users-panel,
    .activity-panel,
    .documents-panel {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .status-bar {
        justify-content: center;
    }
    
    .sidebar {
        flex-direction: column;
    }
    
    .editor-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

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

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-item,
.activity-item {
    animation: fadeIn 0.3s ease;
}

/* 编辑状态指示 */
.editing-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #f39c12;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

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