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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --main-bg: white;
    --text-color: #333;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] {
    --primary-color: #4a5568;
    --secondary-color: #2d3748;
    --bg-gradient: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    --sidebar-bg: rgba(45, 55, 72, 0.95);
    --main-bg: #1a202c;
    --text-color: #e2e8f0;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
}

/* 左侧边栏样式 */
.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

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

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
}

.user-info span {
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.sidebar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.add-note-btn {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-note-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.add-category-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-category-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.import-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.import-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.usage-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 10px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.usage-number {
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
    white-space: nowrap;
}

.refresh-usage-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.refresh-usage-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(180deg);
}

.categories-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.category {
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.category:hover .category-header {
    background: #f0f2ff;
}

.category-header {
    background: #f8f9fa;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.category-name {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
    transition: all 0.3s ease;
}

.category-name:hover {
    color: #667eea;
}

.category-toggle {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.category-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 分类操作按钮样式 */
.category-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-edit-btn,
.category-delete-btn {
    background: none;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
    font-size: 12px;
}

.category-edit-btn:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    opacity: 1;
}

.category-delete-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    opacity: 1;
}

.category:hover .category-edit-btn,
.category:hover .category-delete-btn {
    opacity: 0.8;
}

.category.active .category-edit-btn,
.category.active .category-delete-btn {
    color: white;
    opacity: 0.8;
}

.category.active .category-edit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    opacity: 1;
}

.category.active .category-delete-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ff6b6b;
    opacity: 1;
}

.category-name i:first-child {
    color: #667eea;
}

.category.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.category.active .category-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.category.active .category-name {
    color: white;
    font-weight: 700;
}

.category.active .category-name i:first-child {
    color: white;
}

.category.active .category-toggle {
    color: white;
}

.category.active .category-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.category-notes {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: white;
}

.category-notes.expanded {
    max-height: 500px;
}

.note-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.note-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.note-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.note-item h4 {
    font-size: 0.9rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.note-item p {
    font-size: 0.8rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-item .note-actions {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.note-item:hover .note-actions {
    opacity: 1;
}

.note-actions button {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    margin-left: 5px;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.note-actions button:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* 主内容区域样式 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--main-bg);
    margin: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.toolbar {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar-center {
    display: flex;
    align-items: center;
}

.save-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.save-status.saving {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

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

.save-status i {
    font-size: 0.9rem;
}

.save-status.saving i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tool-btn {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
    font-size: 0.9rem;
}

.tool-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.note-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.note-title-input {
    flex: 1;
    border: none;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    background: transparent;
    outline: none;
    min-width: 200px;
}

.note-title-input::placeholder {
    color: #999;
}

/* 自定义分类下拉菜单 */
.category-dropdown {
    position: relative;
    min-width: 120px;
}

.category-dropdown-trigger {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.category-dropdown-trigger:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.category-dropdown-trigger.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.category-dropdown-trigger.selected:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: translateY(-1px);
}

.category-dropdown-trigger i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.category-dropdown:hover .category-dropdown-trigger i {
    transform: rotate(180deg);
}

.category-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.category-dropdown:hover .category-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.category-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    color: #495057;
}

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

.category-dropdown-item:hover {
    background: #f8f9ff;
    color: #667eea;
}

.category-dropdown-item.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.category-dropdown-item.selected:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
}

/* 保持原有的select样式作为备用 */
.category-select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #495057;
    cursor: pointer;
    min-width: 120px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #f8f9ff;
}

.category-select:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.category-select.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.category-select.selected:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: translateY(-1px);
}

/* 同步设置样式 */
.sync-settings {
    max-width: 600px;
    width: 90%;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.sync-settings h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-options {
    margin-bottom: 25px;
}

.sync-option {
    margin-bottom: 15px;
}

.sync-option input[type="radio"] {
    display: none;
}

.sync-option label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.sync-option label:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.sync-option input[type="radio"]:checked + label {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.sync-option label i {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.sync-option label div strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.sync-option label div p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.sync-config {
    margin-bottom: 25px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.sync-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f, #a8e6cf);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #4a9a1f, #8dd6b5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(86, 171, 47, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.sync-status {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.sync-status p {
    margin: 5px 0;
    color: #333;
}

.sync-status strong {
    color: #667eea;
}

/* Gitee 配置样式 */
.gitee-config {
    max-width: 600px;
    width: 90%;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.gitee-config h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gitee-config h3 i {
    color: #c71d23;
}

.config-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #c71d23;
}

.config-info p {
    margin: 0;
    color: #333;
    font-weight: 500;
}

.config-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.config-status {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #c71d23;
}

.config-status p {
    margin: 5px 0;
    color: #333;
}

.config-status strong {
    color: #c71d23;
}

.editor-wrapper {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.editor {
    min-height: 100%;
    outline: none;
    line-height: 1.6;
    font-size: 1rem;
    color: #333;
    background: transparent;
}

.editor:empty:before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #667eea;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: #764ba2;
    transform: scale(1.1);
}

/* 字体选择器样式 */
.font-selector {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.font-selector-content {
    background-color: white;
    margin: 10% auto;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.font-selector-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
    font-size: 1.3rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.font-setting-group {
    margin-bottom: 20px;
}

.font-setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.font-setting-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.font-setting-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.font-setting-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.font-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 80px;
}

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

.font-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.font-btn.secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e0e0e0;
}

.font-btn.secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
}

.close:hover {
    color: #000;
}

/* 二维码显示区域 */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-container canvas {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 10px 0;
}

/* 分享链接样式 */
.share-link {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    margin: 10px 0;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.9rem;
}

.copy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s ease;
}

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


/* 旋转动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1000;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin: 0;
        border-radius: 0;
        height: 100vh;
    }

    .mobile-menu-btn {
        display: block;
    }
    
    /* 移动端侧边栏头部优化 */
    .sidebar-header {
        padding: 12px 16px;
    }
    
    .header-content {
        margin-bottom: 8px;
    }
    
    .sidebar-header h2 {
        font-size: 1.2rem;
    }
    
    .user-info {
        padding: 4px 8px;
        gap: 6px;
    }
    
    .user-info span {
        font-size: 0.8rem;
    }
    
    .logout-btn {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .toolbar {
        padding: 10px;
        flex-direction: column;
        gap: 10px;
    }

    .toolbar-left, .toolbar-right {
        justify-content: center;
        width: 100%;
    }
    
    .toolbar-center {
        order: -1;
        width: 100%;
        justify-content: center;
    }
    
    .sidebar-actions {
        flex-direction: row;
        gap: 6px;
        justify-content: flex-start;
        margin-bottom: 8px;
    }
    
    .add-note-btn, .add-category-btn, .import-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .usage-compact {
        padding: 3px 6px;
        gap: 2px;
    }
    
    .usage-number {
        font-size: 0.65rem;
        min-width: 12px;
    }
    
    .refresh-usage-btn {
        width: 18px;
        height: 18px;
        font-size: 0.7rem;
    }

    .note-header {
        padding: 15px;
        flex-direction: column;
        align-items: stretch;
    }

    .note-title-input {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .editor-wrapper {
        padding: 15px;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 15px;
    }
    
    .font-selector-content {
        margin: 15% auto;
        width: 95%;
        padding: 20px;
    }
    
    .font-setting-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .font-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕进一步优化 */
    .sidebar-header {
        padding: 8px 12px;
    }
    
    .sidebar-header h2 {
        font-size: 1rem;
    }
    
    .user-info {
        padding: 3px 6px;
        gap: 4px;
    }
    
    .user-info span {
        font-size: 0.7rem;
    }
    
    .logout-btn {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
    
    .sidebar-actions {
        gap: 4px;
        margin-bottom: 6px;
    }
    
    .add-note-btn, .add-category-btn, .import-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .usage-compact {
        padding: 2px 4px;
        gap: 1px;
    }
    
    .usage-number {
        font-size: 0.6rem;
        min-width: 10px;
    }
    
    .refresh-usage-btn {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }

    .tool-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .note-title-input {
        font-size: 1.1rem;
    }

    .editor {
        font-size: 0.9rem;
    }
}

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

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

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

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

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
