* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

h1 {
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    opacity: 0.9;
    font-size: 16px;
    margin-bottom: 15px;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.3);
    font-weight: bold;
}

/* 编辑器样式 */
.editor-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.toolbar {
    background: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.toolbar button, .toolbar select, .toolbar input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar button:hover, .toolbar select:hover {
    background: #e9ecef;
}

.toolbar button.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.toolbar .separator {
    width: 1px;
    height: 25px;
    background: #dee2e6;
    margin: 0 5px;
}

.editor-content {
    min-height: 500px;
    padding: 25px;
    outline: none;
    line-height: 1.8;
    font-size: 16px;
}

.editor-content:focus {
    background: #fefefe;
}

.editor-content img {
    max-width: 100%;
    cursor: move;
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.editor-content img:hover {
    transform: scale(1.01);
}

.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #3498db;
    border: 2px solid white;
    border-radius: 50%;
    bottom: -6px;
    right: -6px;
    cursor: nw-resize;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.action-buttons {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    margin: 0 10px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

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

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
}

.image-upload-container {
    position: relative;
    display: inline-block;
}

.image-upload-container input {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.status-message {
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 5px;
    text-align: center;
    display: none;
}

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

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

.word-count {
    margin-left: auto;
    color: #6c757d;
    font-size: 14px;
}

/* 管理页面样式 */
.notes-list {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state h2 {
    margin-bottom: 15px;
}

.empty-state a {
    color: #3498db;
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

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

.search-box {
    display: flex;
}

.search-box input {
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    width: 250px;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.note-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background: white;
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.note-card-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.note-title {
    font-size: 18px;
    margin-bottom: 5px;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-date {
    font-size: 12px;
    color: #6c757d;
}

.note-card-content {
    padding: 15px;
    min-height: 80px;
}

.note-preview {
    color: #6c757d;
    font-style: italic;
}

.note-card-actions {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: modalopen 0.4s;
}

@keyframes modalopen {
    from {opacity: 0; transform: translateY(-50px);}
    to {opacity: 1; transform: translateY(0);}
}

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

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.note-content {
    line-height: 1.8;
}

.note-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .toolbar {
        padding: 8px 10px;
    }
    
    .toolbar button, .toolbar select {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .editor-content {
        padding: 15px;
        min-height: 400px;
    }
    
    .btn {
        padding: 10px 20px;
        margin: 5px;
    }
    
    .notes-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

/* 管理页面增强样式 */
.notes-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.note-checkbox {
    margin-right: 10px;
}

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

.note-card-header {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.note-card-actions {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-success {
    background: #28a745;
    color: white;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

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

.confirm-modal {
    max-width: 500px;
}

.batch-actions {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-count {
    color: #6c757d;
    font-size: 14px;
}

/* 重命名模态框样式 */
.rename-modal {
    max-width: 500px;
}

.form-group {
    margin-bottom: 15px;
}

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

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    padding: 8px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

/* 笔记标题编辑状态 */
.note-title-editable {
    cursor: text;
    border: 1px dashed #3498db;
    padding: 2px 5px;
    border-radius: 3px;
    background: #f8f9fa;
}

.note-title-input {
    width: 100%;
    padding: 5px;
    border: 1px solid #3498db;
    border-radius: 3px;
    font-size: 18px;
    font-weight: bold;
}