* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(30deg);
}

header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.add-note-section, .notes-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.add-note-section h2, .notes-section h2 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.input-group input,
.input-group textarea,
#search-notes,
#filter-tags {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group textarea:focus,
#search-notes:focus,
#filter-tags:focus {
    outline: none;
    border-color: #667eea;
}

.input-group textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

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

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

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

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

.filter-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

#search-notes {
    width: 250px;
}

#filter-tags {
    width: 150px;
}

#notes-container {
    min-height: 400px;
}

.note-card {
    background: #f8fafc;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.note-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.note-date {
    color: #718096;
    font-size: 0.9rem;
}

.note-content {
    color: #4a5568;
    margin-bottom: 15px;
    line-height: 1.6;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background: #e2e8f0;
    color: #4a5568;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.note-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.edit-btn {
    background: none;
    border: none;
    color: #4299e1;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.edit-btn:hover {
    color: #3182ce;
}

.delete-btn {
    background: none;
    border: none;
    color: #fc8181;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.delete-btn:hover {
    color: #f56565;
}

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

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

#total-notes {
    font-weight: 600;
    color: #667eea;
    font-size: 1.2rem;
}

footer {
    text-align: center;
    padding: 20px;
    color: #718096;
    font-size: 0.9rem;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    color: #4a5568;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.modal-buttons button {
    min-width: 100px;
}

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

.note-card {
    animation: fadeIn 0.3s ease-out;
}

/* 响应式调整 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    #search-notes, #filter-tags {
        width: 100%;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* 暗色模式 */
body.dark-mode {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: #e2e8f0;
}

body.dark-mode header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

body.dark-mode .add-note-section,
body.dark-mode .notes-section {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .input-group label {
    color: #cbd5e0;
}

body.dark-mode .input-group input,
body.dark-mode .input-group textarea,
body.dark-mode #search-notes,
body.dark-mode #filter-tags {
    background: #4a5568;
    border-color: #718096;
    color: #e2e8f0;
}

body.dark-mode .input-group input:focus,
body.dark-mode .input-group textarea:focus,
body.dark-mode #search-notes:focus,
body.dark-mode #filter-tags:focus {
    border-color: #667eea;
}

body.dark-mode .btn-secondary {
    background: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .btn-secondary:hover {
    background: #718096;
}

body.dark-mode .note-card {
    background: #4a5568;
    border-left-color: #667eea;
}

body.dark-mode .note-title {
    color: #e2e8f0;
}

body.dark-mode .note-content {
    color: #cbd5e0;
}

body.dark-mode .tag {
    background: #718096;
    color: #e2e8f0;
}

body.dark-mode .stats {
    border-top-color: #4a5568;
}

body.dark-mode .action-buttons {
    display: flex;
    gap: 10px;
}

body.dark-mode .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.dark-mode .empty-state {
    color: #a0aec0;
}

body.dark-mode .modal-content {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .modal-content h3 {
    color: #e2e8f0;
}