/* ========================================
   小元记事本 - 沉稳质感主题 v6.0
   深靛蓝主色 + 暖米色背景 + 纸质纹理
   ======================================== */

/* ========================================
   白天模式（默认）— 沉稳书卷气
   ======================================== */
:root {
    /* 主色调 - 深靛蓝，沉稳有书卷气 */
    --primary-color: #4338ca;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    --primary-gradient-hover: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    
    /* 辅助色 */
    --success-color: #059669;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-color: #d97706;
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-color: #dc2626;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --info-color: #4338ca;
    --info-gradient: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    
    /* 背景色 - 暖调米灰，层次分明 */
    --bg-color: #f5f5f0;
    --bg-secondary: #eeeee8;
    --bg-gradient: linear-gradient(180deg, #f5f5f0 0%, #eeeee8 100%);
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 8px 24px rgba(67, 56, 202, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    
    /* 顶部栏/底部栏 - 略深于底色，有存在感 */
    --header-bg: rgba(238, 238, 240, 0.92);
    --header-bg-solid: #eeeef0;
    --tabbar-bg: rgba(238, 238, 240, 0.92);
    --tabbar-bg-solid: #eeeef0;
    
    /* 文字颜色 - 层次分明 */
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #9898b0;
    --text-disabled: #c8c8d8;
    --text-on-primary: #ffffff;
    
    /* 边框 */
    --border-color: #dddde4;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 14px;
    --border-radius-xl: 16px;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-bounce: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* 底部导航高度 */
    --tab-bar-height: 72px;
    --header-height: 64px;
    
    /* 笔记详情纹理背景 */
    --note-bg: #faf8f3;
    --note-bg-lines: repeating-linear-gradient(
        transparent,
        transparent 31px,
        rgba(67, 56, 202, 0.04) 31px,
        rgba(67, 56, 202, 0.04) 32px
    );
}

/* ========================================
   夜间模式 — 深沉护眼
   ======================================== */
[data-theme="dark"] {
    /* 主色调 - 明亮靛蓝 */
    --primary-color: #818cf8;
    --primary-light: #a5b4fc;
    --primary-dark: #6366f1;
    --primary-gradient: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    --primary-gradient-hover: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    
    /* 辅助色 */
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --info-color: #818cf8;
    
    /* 背景色 - 深色暖调 */
    --bg-color: #13131a;
    --bg-secondary: #1c1c25;
    --bg-gradient: linear-gradient(180deg, #13131a 0%, #1c1c25 100%);
    --card-bg: #1e1e28;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    
    /* 顶部栏/底部栏 */
    --header-bg: rgba(28, 28, 37, 0.95);
    --header-bg-solid: #1c1c25;
    --tabbar-bg: rgba(28, 28, 37, 0.95);
    --tabbar-bg-solid: #1c1c25;
    
    /* 文字颜色 */
    --text-primary: #eeeef5;
    --text-secondary: #b0b0c8;
    --text-muted: #6a6a88;
    --text-disabled: #44445a;
    --text-on-primary: #13131a;
    
    /* 边框 */
    --border-color: #2a2a3a;
    
    /* 笔记详情纹理背景 - 夜间 */
    --note-bg: #1a1a24;
    --note-bg-lines: repeating-linear-gradient(
        transparent,
        transparent 31px,
        rgba(129, 140, 248, 0.04) 31px,
        rgba(129, 140, 248, 0.04) 32px
    );
}

/* ========================================
   绿色主题 — 翡翠深林
   ======================================== */
[data-color-theme="green"] {
    --primary-color: #059669;
    --primary-light: #10b981;
    --primary-dark: #047857;
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --primary-gradient-hover: linear-gradient(135deg, #059669 0%, #047857 100%);
    --info-color: #059669;
    --info-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --header-bg: rgba(236, 253, 245, 0.92);
    --header-bg-solid: #ecfdf5;
    --tabbar-bg: rgba(236, 253, 245, 0.92);
    --tabbar-bg-solid: #ecfdf5;
}

[data-color-theme="green"][data-theme="dark"] {
    --primary-color: #34d399;
    --primary-light: #6ee7b7;
    --primary-dark: #10b981;
    --primary-gradient: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
    --primary-gradient-hover: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --info-color: #34d399;
    --header-bg: rgba(6, 78, 59, 0.95);
    --header-bg-solid: #064e3b;
    --tabbar-bg: rgba(6, 78, 59, 0.95);
    --tabbar-bg-solid: #064e3b;
}

/* ========================================
   紫色主题 — 暮光优雅
   ======================================== */
[data-color-theme="purple"] {
    --primary-color: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #6d28d9;
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --primary-gradient-hover: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    --info-color: #7c3aed;
    --info-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --header-bg: rgba(245, 243, 255, 0.92);
    --header-bg-solid: #f5f3ff;
    --tabbar-bg: rgba(245, 243, 255, 0.92);
    --tabbar-bg-solid: #f5f3ff;
}

[data-color-theme="purple"][data-theme="dark"] {
    --primary-color: #a78bfa;
    --primary-light: #c4b5fd;
    --primary-dark: #8b5cf6;
    --primary-gradient: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%);
    --primary-gradient-hover: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    --info-color: #a78bfa;
    --header-bg: rgba(59, 7, 100, 0.95);
    --header-bg-solid: #3b0764;
    --tabbar-bg: rgba(59, 7, 100, 0.95);
    --tabbar-bg-solid: #3b0764;
}

/* ========================================
   橙色主题 — 琥珀暖光
   ======================================== */
[data-color-theme="orange"] {
    --primary-color: #d97706;
    --primary-light: #f59e0b;
    --primary-dark: #b45309;
    --primary-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --primary-gradient-hover: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    --info-color: #d97706;
    --info-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --header-bg: rgba(255, 247, 237, 0.92);
    --header-bg-solid: #fff7ed;
    --tabbar-bg: rgba(255, 247, 237, 0.92);
    --tabbar-bg-solid: #fff7ed;
}

[data-color-theme="orange"][data-theme="dark"] {
    --primary-color: #fbbf24;
    --primary-light: #fcd34d;
    --primary-dark: #f59e0b;
    --primary-gradient: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
    --primary-gradient-hover: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --info-color: #fbbf24;
    --header-bg: rgba(124, 45, 18, 0.95);
    --header-bg-solid: #7c2d12;
    --tabbar-bg: rgba(124, 45, 18, 0.95);
    --tabbar-bg-solid: #7c2d12;
}

/* ========================================
   粉色主题 — 玫瑰沉静
   ======================================== */
[data-color-theme="pink"] {
    --primary-color: #be185d;
    --primary-light: #ec4899;
    --primary-dark: #9d174d;
    --primary-gradient: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    --primary-gradient-hover: linear-gradient(135deg, #be185d 0%, #9d174d 100%);
    --info-color: #be185d;
    --info-gradient: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
    --header-bg: rgba(253, 242, 248, 0.92);
    --header-bg-solid: #fdf2f8;
    --tabbar-bg: rgba(253, 242, 248, 0.92);
    --tabbar-bg-solid: #fdf2f8;
}

[data-color-theme="pink"][data-theme="dark"] {
    --primary-color: #f472b6;
    --primary-light: #f9a8d4;
    --primary-dark: #ec4899;
    --primary-gradient: linear-gradient(135deg, #f9a8d4 0%, #f472b6 100%);
    --primary-gradient-hover: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
    --info-color: #f472b6;
    --header-bg: rgba(131, 24, 67, 0.95);
    --header-bg-solid: #831843;
    --tabbar-bg: rgba(131, 24, 67, 0.95);
    --tabbar-bg-solid: #831843;
}

/* ========================================
   青色主题 — 深潭静水
   ======================================== */
[data-color-theme="cyan"] {
    --primary-color: #0891b2;
    --primary-light: #06b6d4;
    --primary-dark: #0e7490;
    --primary-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --primary-gradient-hover: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    --info-color: #0891b2;
    --info-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --header-bg: rgba(236, 254, 255, 0.92);
    --header-bg-solid: #ecfeff;
    --tabbar-bg: rgba(236, 254, 255, 0.92);
    --tabbar-bg-solid: #ecfeff;
}

[data-color-theme="cyan"][data-theme="dark"] {
    --primary-color: #22d3ee;
    --primary-light: #67e8f9;
    --primary-dark: #06b6d4;
    --primary-gradient: linear-gradient(135deg, #67e8f9 0%, #22d3ee 100%);
    --primary-gradient-hover: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
    --info-color: #22d3ee;
    --header-bg: rgba(12, 74, 110, 0.95);
    --header-bg-solid: #0c4a6e;
    --tabbar-bg: rgba(12, 74, 110, 0.95);
    --tabbar-bg-solid: #0c4a6e;
}

/* ========================================
   基础重置
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.5s ease, color 0.5s ease;
}

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: var(--tab-bar-height);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.5s ease, background-image 0.5s ease;
    zoom: 0.85;
}

/* 页面背景装饰 — 柔和暖光 */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(67, 56, 202, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* 笔记卡片进入动画 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.note-card {
    animation: slideInUp 0.4s ease-out forwards;
}

.note-card:nth-child(1) { animation-delay: 0.05s; }
.note-card:nth-child(2) { animation-delay: 0.1s; }
.note-card:nth-child(3) { animation-delay: 0.15s; }
.note-card:nth-child(4) { animation-delay: 0.2s; }
.note-card:nth-child(5) { animation-delay: 0.25s; }
.note-card:nth-child(6) { animation-delay: 0.3s; }
.note-card:nth-child(7) { animation-delay: 0.35s; }
.note-card:nth-child(8) { animation-delay: 0.4s; }
.note-card:nth-child(n+9) { animation-delay: 0.45s; }

/* ========================================
   顶部导航栏
   ======================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    height: var(--header-height);
    padding: env(safe-area-inset-top, 0) var(--spacing-md) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-left .bi-journal-text {
    color: var(--primary-color);
    font-size: 24px;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.header-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.header-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.header-btn:active {
    transform: scale(0.95);
    background: var(--primary-gradient);
    color: white;
}

.header-btn:active::before {
    width: 200%;
    height: 200%;
}

/* ========================================
   底部Tab导航栏
   ======================================== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-bar-height);
    background: var(--tabbar-bg);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 0;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.tab-item i {
    font-size: 24px;
    transition: all var(--transition-bounce);
}

.tab-item span {
    font-size: 11px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

/* 激活状态 */
.tab-item.active {
    color: var(--primary-color);
}

.tab-item.active i {
    color: var(--primary-color);
    transform: scale(1.15);
}

.tab-item.active span {
    color: var(--primary-color);
    font-weight: 700;
}

/* 激活指示器 - 小圆点 */
.tab-item.active::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: tabDotPop 0.3s ease-out;
    box-shadow: 0 0 8px var(--primary-color);
}

@keyframes tabDotPop {
    0% {
        transform: translateX(-50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateX(-50%) scale(1.5);
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

.tab-item:active {
    transform: scale(0.95);
}

/* ========================================
   主内容区域
   ======================================== */
.main-content {
    padding: var(--spacing-md);
    min-height: calc(100vh - var(--header-height) - var(--tab-bar-height));
}

/* ========================================
   搜索栏
   ======================================== */
.search-bar {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 var(--spacing-md) 0 48px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 15px;
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 4px 20px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.search-input:focus + .search-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    transition: all var(--transition-fast);
}

/* ========================================
   分类标签栏 - 精致版
   ======================================== */
.category-tabs {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.category-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.category-tab i {
    font-size: 14px;
    transition: transform var(--transition-fast);
}

.category-tab:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.category-tab:hover::before {
    transform: scaleX(1);
}

.category-tab:hover i {
    transform: scale(1.1);
}

.category-tab.active {
    background: var(--primary-color);
    color: var(--text-on-primary);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.category-tab.active::before {
    display: none;
}

.category-tab:active {
    transform: scale(0.96);
}

/* ========================================
   笔记卡片列表 - 精致版
   ======================================== */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.note-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.note-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(67, 56, 202, 0.2);
}

.note-card:active {
    transform: scale(0.97);
}

/* 置顶标记 */
.note-card.pinned::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 24px 24px 0;
    border-color: transparent var(--warning-color) transparent transparent;
}

.note-card.pinned::after {
    content: '📌';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
}

.note-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.note-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.note-pin {
    color: var(--warning-color);
    font-size: 18px;
    margin-left: var(--spacing-sm);
}

.note-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    margin-bottom: var(--spacing-sm);
}

.note-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 12px;
    color: var(--text-muted);
}

.note-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

.note-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.note-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.note-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.note-action-btn:hover {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.note-action-btn:hover::before {
    left: 100%;
}

.note-action-btn:active {
    transform: scale(0.95);
}

.note-action-btn.danger:hover {
    background: var(--danger-gradient);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* ========================================
   浮动添加按钮 - 精致版
   ======================================== */
.fab {
    position: fixed;
    right: 20px;
    bottom: calc(var(--tab-bar-height) + 20px);
    width: 56px;
    height: 56px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    z-index: 99;
    animation: fabPulse 3s ease-in-out infinite;
    transition: all var(--transition-normal);
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 30px rgba(59, 130, 246, 0.6), 0 0 20px rgba(59, 130, 246, 0.3);
}

.fab:active {
    transform: scale(0.95);
}

@keyframes fabPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 8px 30px rgba(59, 130, 246, 0.6), 0 0 30px rgba(59, 130, 246, 0.2);
    }
}

/* ========================================
   账号密码卡片 - 美化版
   ======================================== */
.account-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--card-shadow);
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--border-color);
}

.account-card:active {
    transform: scale(0.99);
}

.account-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.account-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.account-name i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 22px;
}

.account-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.account-field:last-child {
    border-bottom: none;
}

.field-label {
    font-size: 13px;
    color: var(--text-muted);
}

.field-value {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 14px;
    color: var(--text-primary);
}

.field-value.password {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}
    width: 32px;
    height: 32px;
    border: none;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.9);
}

/* ========================================
   空状态 - 美化版
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: var(--spacing-md);
}

.empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-desc {
    font-size: 14px;
    color: var(--text-muted);
}

/* ========================================
   表单样式 - 美化版
   ======================================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.form-input {
    width: 100%;
    height: 50px;
    padding: 0 var(--spacing-md);
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 15px;
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--card-shadow-hover), 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.form-textarea {
    width: 100%;
    min-height: 150px;
    padding: var(--spacing-md);
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    font-size: 15px;
    color: var(--text-primary);
    resize: vertical;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-fast);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--card-shadow-hover), 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* ========================================
   按钮样式 - 美化版
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 14px 28px;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: var(--primary-color);
    box-shadow: var(--card-shadow);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    height: 56px;
    font-size: 16px;
    border-radius: var(--border-radius-lg);
}

/* ========================================
   模态框 - 美化版
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-height: 90vh;
    background: var(--card-bg);
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    padding: var(--spacing-lg);
    transform: translateY(100%);
    transition: transform var(--transition-bounce);
    overflow-y: auto;
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.2);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-gradient);
    color: white;
}

.modal-footer {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--border-color);
}

.modal-footer .btn {
    flex: 1;
}

/* ========================================
   密码生成器 - 美化版
   ======================================== */
.password-generator {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
}

.generated-password {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.password-display {
    flex: 1;
    padding: var(--spacing-md);
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--primary-color);
    word-break: break-all;
    box-shadow: var(--card-shadow);
}

.password-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.password-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.option-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.password-length {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.length-value {
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    min-width: 28px;
    text-align: center;
}

input[type="range"] {
    width: 120px;
    height: 6px;
    -webkit-appearance: none;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    transition: all var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* 开关样式 - 美化版 */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    transition: var(--transition-fast);
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-fast);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

input:checked + .toggle-slider {
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* ========================================
   设置页面 - 美化版
   ======================================== */
.settings-section {
    margin-bottom: var(--spacing-lg);
}

.settings-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
    padding: 0 var(--spacing-md);
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--card-bg);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid rgba(16, 185, 129, 0.05);
}

.settings-item:first-child {
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.settings-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.settings-item:only-child {
    border-radius: var(--border-radius-lg);
}

.settings-item:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(5, 150, 105, 0.05) 100%);
}

.settings-item:active {
    transform: scale(0.99);
}

.settings-item-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.settings-item-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-fast);
}

.settings-item:hover .settings-item-icon {
    transform: scale(1.1);
}

.settings-item-icon.blue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(79, 172, 254, 0.15) 100%);
    color: var(--info-color);
}

.settings-item-icon.green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(56, 239, 125, 0.15) 100%);
    color: var(--success-color);
}

.settings-item-icon.orange {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(251, 191, 36, 0.15) 100%);
    color: var(--warning-color);
}

.settings-item-icon.purple {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(167, 139, 250, 0.15) 100%);
    color: #a855f7;
}

.settings-item-icon.red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(252, 165, 165, 0.15) 100%);
    color: var(--danger-color);
}

.settings-item-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.settings-item-arrow {
    color: var(--text-muted);
    font-size: 18px;
    transition: all var(--transition-fast);
}

.settings-item:hover .settings-item-arrow {
    color: var(--primary-color);
    transform: translateX(4px);
}

/* ========================================
   Toast提示 - 美化版
   ======================================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--primary-gradient);
    color: white;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--border-radius-xl);
    font-size: 15px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-bounce);
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.5);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* ========================================
   用户信息卡片 - 美化版
   ======================================== */
.user-card {
    background: var(--primary-gradient);
    border-radius: var(--border-radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.3);
}

.user-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.user-avatar {
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.user-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.user-id {
    font-size: 14px;
    opacity: 0.9;
}

/* ========================================
   统计卡片 - 美化版
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-fast);
    border: 1px solid rgba(16, 185, 129, 0.05);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* ========================================
   工具栏（排序等）- 美化版
   ======================================== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.sort-dropdown {
    position: relative;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 16px;
    background: var(--card-bg);
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-fast);
}

.sort-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.sort-options {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: var(--spacing-xs);
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    box-shadow: var(--card-shadow-hover);
    overflow: hidden;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 50;
}

.sort-options.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sort-option:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: var(--primary-color);
}

.sort-option.active {
    background: var(--primary-gradient);
    color: white;
}

.view-toggle {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--card-bg);
    border-radius: var(--border-radius-md);
    padding: 4px;
    box-shadow: var(--card-shadow);
}

.view-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.view-btn:active {
    transform: scale(0.95);
}

/* ========================================
   加载动画
   ======================================== */
.loading {
    display: flex;
    justify-content: center;
    padding: var(--spacing-xl);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================
   颜色选择器
   ======================================== */
.color-picker {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
}

.color-option {
    width: 32px;
    height: 32px;
    border: 3px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.color-option:hover {
    transform: scale(1.15);
}

.color-option.active {
    border-color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ========================================
   网格视图
   ======================================== */
.notes-list.grid-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.notes-list.grid-view .note-card {
    padding: var(--spacing-sm);
}

.notes-list.grid-view .note-content {
    -webkit-line-clamp: 2;
}

/* ========================================
   编辑器工具栏
   ======================================== */
.editor-toolbar {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-md);
    overflow-x: auto;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toolbar-btn:hover {
    background: var(--primary-gradient);
    color: white;
}

.toolbar-btn.active {
    background: var(--primary-gradient);
    color: white;
}

/* ========================================
   Markdown渲染样式
   ======================================== */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.markdown-content h1 { font-size: 24px; }
.markdown-content h2 { font-size: 20px; }
.markdown-content h3 { font-size: 18px; }

.markdown-content p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-lg);
}

.markdown-content li {
    margin-bottom: var(--spacing-xs);
}

.markdown-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.markdown-content pre {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: var(--spacing-md);
    margin: var(--spacing-md) 0;
    color: var(--text-secondary);
}

.markdown-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

/* ========================================
   文字颜色类
   ======================================== */
.text-color-default { color: var(--text-primary); }
.text-color-gray { color: #6b7280; }
.text-color-red { color: #ef4444; }
.text-color-orange { color: #f97316; }
.text-color-green { color: #10b981; }
.text-color-cyan { color: #06b6d4; }
.text-color-blue { color: #3b82f6; }
.text-color-purple { color: #8b5cf6; }

/* ========================================
   夜间模式特殊处理
   ======================================== */
/* 顶栏和底栏 */
[data-theme="dark"] .app-header {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .tab-bar {
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .tab-item.active::before {
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.6) !important;
}

/* 输入框 */
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted) !important;
}

/* 搜索框聚焦 */
[data-theme="dark"] .search-input:focus {
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2) !important;
}

/* 遮罩层 */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.6) !important;
}

/* Toast */
[data-theme="dark"] .toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

/* 卡片hover效果 */
[data-theme="dark"] .note-card:hover,
[data-theme="dark"] .account-card:hover,
[data-theme="dark"] .settings-item:hover,
[data-theme="dark"] .category-tab:hover {
    background: var(--bg-secondary) !important;
}

/* 选中状态 */
[data-theme="dark"] .note-card.selected,
[data-theme="dark"] .account-card.selected {
    background: rgba(56, 189, 248, 0.1) !important;
    border-color: var(--primary-color) !important;
}

/* 按钮 */
[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .note-action-btn:hover,
[data-theme="dark"] .account-action-btn:hover,
[data-theme="dark"] .toolbar-btn:hover {
    background: var(--primary-color) !important;
    color: var(--text-on-primary) !important;
}

/* 图标背景 */
[data-theme="dark"] .settings-item-icon.blue,
[data-theme="dark"] .settings-item-icon.green,
[data-theme="dark"] .settings-item-icon.orange,
[data-theme="dark"] .settings-item-icon.purple,
[data-theme="dark"] .settings-item-icon.red {
    background: rgba(56, 189, 248, 0.1) !important;
    color: var(--primary-color) !important;
}

/* 开关按钮 */
[data-theme="dark"] .toggle-slider:before {
    background-color: #f1f5f9 !important;
}

/* 弹窗按钮 */
[data-theme="dark"] .modal-close:hover {
    background: var(--danger-color) !important;
    color: #ffffff !important;
}

/* 加载状态 */
[data-theme="dark"] .loading-spinner {
    border-top-color: var(--primary-color) !important;
}

/* 批量操作栏 */
[data-theme="dark"] .batch-toolbar {
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* 类型选择按钮 */
[data-theme="dark"] .type-btn.active.income {
    background: rgba(52, 211, 153, 0.15) !important;
    border-color: var(--success-color) !important;
    color: var(--success-color) !important;
}

[data-theme="dark"] .type-btn.active.expense {
    background: rgba(248, 113, 113, 0.15) !important;
    border-color: var(--danger-color) !important;
    color: var(--danger-color) !important;
}

/* 分类网格 */
[data-theme="dark"] .category-grid-item.active {
    background: rgba(56, 189, 248, 0.1) !important;
    border-color: var(--primary-color) !important;
}

/* 分类选择器 */
[data-theme="dark"] .category-option.active {
    background: var(--primary-color) !important;
    color: var(--text-on-primary) !important;
}
