/* 基本樣式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    /* 淺色模式變量 */
    --bg-primary: #f8f9fa;
    --bg-secondary: rgba(255, 255, 255, 0.8);
    --bg-tertiary: rgba(255, 255, 255, 0.6);
    --text-primary: #333;
    --text-secondary: #666;
    --text-tertiary: #999;
    --accent-color: #4a6fa5;
    --accent-hover: #3a5a8c;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.05);
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --editor-bg: rgba(255, 255, 255, 0.7);
    --toolbar-bg: rgba(255, 255, 255, 0.9);
    --modal-bg: rgba(255, 255, 255, 0.95);
    --notification-bg: rgba(255, 255, 255, 0.95);
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --info-color: #17a2b8;
    --danger-color: #ff4d4f;
    --hover-color: rgba(0, 0, 0, 0.05);
    --active-color: rgba(0, 0, 0, 0.1);
    --bg-color: rgba(255, 255, 255, 0.95);
}

/* 深色模式變量 */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: rgba(40, 40, 40, 0.8);
    --bg-tertiary: rgba(50, 50, 50, 0.6);
    --text-primary: #f0f0f0;
    --text-secondary: #aaa;
    --text-tertiary: #777;
    --accent-color: #5b8bd0;
    --accent-hover: #6e9be6;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --sidebar-bg: rgba(30, 30, 30, 0.85);
    --editor-bg: rgba(35, 35, 35, 0.7);
    --toolbar-bg: rgba(40, 40, 40, 0.9);
    --modal-bg: rgba(30, 30, 30, 0.95);
    --notification-bg: rgba(30, 30, 30, 0.95);
    --danger-color: #ff7875;
    --hover-color: rgba(255, 255, 255, 0.05);
    --active-color: rgba(255, 255, 255, 0.1);
    --bg-color: rgba(30, 30, 30, 0.95);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 自定義背景 */
body[data-bg="default"] {
    background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
}

body[data-bg="gradient1"] {
    background-image: linear-gradient(to right, #ff758c 0%, #ff7eb3 100%);
}

body[data-bg="gradient2"] {
    background-image: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
}

body[data-bg="pattern1"] {
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z" fill="rgba(0,0,0,.03)" fill-rule="evenodd"/></svg>');
    background-color: #f8f9fa;
}

body[data-bg="pattern2"] {
    background-image: url('data:image/svg+xml;utf8,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="rgba(0,0,0,.03)"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>');
    background-color: #f8f9fa;
}

body[data-bg="custom"] {
    background-size: cover;
    background-position: center;
}

/* 應用容器 */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 側邊欄 */
.sidebar {
    width: 280px;
    height: 100%;
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--shadow-color);
    z-index: 10;
}

.logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
}

.logo i {
    font-size: 1.5rem;
}

.sidebar-buttons {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--accent-color);
    transform: translateY(-2px);
}

.notes-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.notes-list-container h3 {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 筆記列表項目 */
.note-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.note-item:hover {
    background-color: var(--hover-color);
}

.note-item.active {
    background-color: var(--active-color);
    border-left: 3px solid var(--accent-color);
}

.note-item-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-item-preview {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-item-date {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* 主要內容區域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.toolbar {
    padding: 10px 20px;
    background-color: var(--toolbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.editing-tools {
    display: flex;
    align-items: center;
    gap: 5px;
}

.editing-tools button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.editing-tools button:hover {
    background-color: var(--bg-tertiary);
    color: var(--accent-color);
}

.editing-tools button.active {
    background-color: var(--accent-color);
    color: white;
}

.separator {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
    margin: 0 5px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-secondary);
    min-width: 120px;
    box-shadow: 0 8px 16px var(--shadow-color);
    z-index: 1;
    border-radius: 6px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dropdown-content button {
    width: 100%;
    text-align: left;
    padding: 10px;
    border-radius: 0;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease;
}

.editor-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: var(--editor-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.note-title-container {
    margin-bottom: 20px;
}

#note-title {
    width: 100%;
    padding: 10px 0;
    font-size: 1.8rem;
    font-weight: bold;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

#note-title:focus {
    border-bottom-color: var(--accent-color);
}

#editor {
    min-height: calc(100% - 60px);
    padding: 10px 0;
    outline: none;
    line-height: 1.6;
    color: var(--text-primary);
}

#editor[placeholder]:empty:before {
    content: attr(placeholder);
    color: var(--text-secondary);
    pointer-events: none;
}

/* 靈動島風格通知 */
.notification {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--notification-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90%;
    width: 400px;
}

.notification.show {
    top: 20px;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--success-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.notification-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

.notification-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.notification-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.notification-btn.danger {
    background-color: var(--danger-color);
    color: white;
}

.notification-btn.danger:hover {
    background-color: var(--danger-color);
    opacity: 0.9;
}

.notification-btn.cancel {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

.notification-btn.cancel:hover {
    background-color: var(--hover-color);
}

/* 模態彈窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--modal-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--error-color);
}

.modal-body {
    padding: 20px;
}

/* 搜索模態框 */
.search-input-container {
    position: relative;
    margin-bottom: 20px;
}

.search-input-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

#search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#search-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

#search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 50vh;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background-color: var(--bg-secondary);
    transform: translateX(5px);
}

.search-result-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.search-result-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: -webkit-box;
    /* 使用標準和webkit前綴的line-clamp屬性 */
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-highlight {
    background-color: rgba(255, 217, 0, 0.3);
    padding: 0 2px;
    border-radius: 2px;
}

/* 背景設置模態框 */
.bg-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bg-option-group h4 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.preset-backgrounds {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bg-option {
    width: 80px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    overflow: hidden;
}

.bg-option:hover {
    transform: scale(1.05);
}

.bg-option.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

.bg-option[data-bg="default"] {
    background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
}

.bg-option[data-bg="gradient1"] {
    background-image: linear-gradient(to right, #ff758c 0%, #ff7eb3 100%);
}

.bg-option[data-bg="gradient2"] {
    background-image: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
}

.bg-option[data-bg="pattern1"] {
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z" fill="rgba(0,0,0,.03)" fill-rule="evenodd"/></svg>');
    background-color: #f8f9fa;
}

.bg-option[data-bg="pattern2"] {
    background-image: url('data:image/svg+xml;utf8,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="rgba(0,0,0,.03)"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>');
    background-color: #f8f9fa;
}

.custom-bg-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.upload-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

#bg-upload {
    display: none;
}

/* 教學彈窗 */
.tutorial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tutorial.show {
    opacity: 1;
    visibility: visible;
}

.tutorial-content {
    background-color: var(--modal-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tutorial.show .tutorial-content {
    transform: scale(1);
}

.tutorial-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tutorial-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.skip-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.skip-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--accent-color);
}

.tutorial-body {
    padding: 30px;
    text-align: center;
}

.tutorial-step {
    display: none;
}

.tutorial-step.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.tutorial-image {
    margin-bottom: 20px;
    color: var(--accent-color);
}

.tutorial-step h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.tutorial-step p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.tutorial-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tutorial-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: bold;
}

.tutorial-btn:hover:not(:disabled) {
    background-color: var(--bg-tertiary);
}

.tutorial-btn:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
}

.tutorial-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dot.active {
    background-color: var(--accent-color);
    transform: scale(1.2);
}

/* 動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-buttons {
        padding: 10px;
    }

    .notes-list-container {
        max-height: 200px;
    }

    .main-content {
        height: calc(100vh - 200px);
    }

    .notification {
        width: 90%;
    }
}

/* 滾動條樣式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

/* 選擇文本樣式 */
::selection {
    background-color: rgba(74, 111, 165, 0.2);
    color: var(--accent-color);
}

/* 刪除筆記按鈕 */
.delete-note-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
    padding: 5px;
    border-radius: 4px;
}

.note-item:hover .delete-note-btn {
    opacity: 1;
}

.delete-note-btn:hover {
    color: var(--danger-color);
    background-color: rgba(255, 0, 0, 0.1);
}

/* 右鍵菜單 */
.context-menu {
    position: fixed;
    background: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    z-index: 1000;
    overflow: hidden;
    min-width: 150px;
    animation: fadeIn 0.2s ease-out;
}

.context-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
}

.context-menu-item:hover {
    background-color: var(--hover-color);
}

.context-menu-item[data-action="delete"] {
    color: var(--danger-color);
}

.context-menu-item[data-action="delete"]:hover {
    background-color: rgba(255, 0, 0, 0.1);
}
