* {
    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;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

.content {
    display: flex;
    height: calc(100vh - 200px);
}

.sidebar {
    width: 300px;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.file-list {
    list-style: none;
}

.file-item {
    padding: 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-item:hover {
    border-color: #667eea;
    transform: translateX(5px);
}

.file-item.active {
    background: #667eea;
    color: white;
}

.file-name {
    flex: 1;
    font-weight: 500;
}

.file-actions {
    display: flex;
    gap: 5px;
}

.btn-delete {
    padding: 4px 8px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-delete:hover {
    background: #e84118;
}

.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

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

.editor-header h3 {
    font-size: 18px;
    color: #333;
}

.btn-group {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #95afc0;
    color: white;
}

.btn-secondary:hover {
    background: #7a93a5;
}

.btn-success {
    background: #10ac84;
    color: white;
}

.btn-success:hover {
    background: #0e9872;
}

textarea {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    resize: none;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

.new-file-section {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
}

.new-file-section input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
}

.new-file-section input:focus {
    outline: none;
    border-color: #667eea;
}

.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
    z-index: 1000;
}

.message.success {
    background: #10ac84;
}

.message.error {
    background: #ff4757;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* 登录页面样式 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 10px;
    color: #333;
    font-size: 28px;
}

.login-box p {
    color: #666;
    margin-bottom: 30px;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.2s;
}

.login-box input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.login-box .btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
}

.login-error {
    color: #ff4757;
    margin-top: 15px;
    font-size: 14px;
}

.hidden {
    display: none !important;
}
