/*
 * 时光树 - 自定义样式
 * Time Tree - Notion + Apple 融合风格
 */

/* ========== 基础排版 ========== */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

/* ========== 笔记内容区 ========== */
.note-content h1 { font-size: 2rem; font-weight: 700; margin-top: 2rem; margin-bottom: 1rem; }
.note-content h2 { font-size: 1.5rem; font-weight: 600; margin-top: 1.75rem; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--fallback-b2, #e5e7eb); }
.note-content h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.note-content p { margin-bottom: 1rem; line-height: 1.8; }
.note-content img { max-width: 100%; border-radius: 0.75rem; margin: 1rem 0; }
.note-content a { color: #6C5CE7; text-decoration: underline; text-underline-offset: 2px; }
.note-content a:hover { opacity: 0.8; }
.note-content blockquote { border-left: 4px solid rgba(108,92,231,0.3); padding: 0.75rem 1rem; margin: 1rem 0; background: rgba(108,92,231,0.03); border-radius: 0 0.5rem 0.5rem 0; }
.note-content ul, .note-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.note-content li { margin-bottom: 0.25rem; line-height: 1.7; }
.note-content hr { margin: 2rem 0; border: none; border-top: 1px solid var(--fallback-b2, #e5e7eb); }

/* 代码块 */
.note-content pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 1rem 0;
}
.note-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
}
.note-content :not(pre) > code {
    background: rgba(108,92,231,0.08);
    color: #6C5CE7;
    padding: 0.15em 0.4em;
    border-radius: 0.3em;
}

/* Markdown编辑器图片 */
.note-content .md-image {
    max-width: 100%;
    border-radius: 0.75rem;
    cursor: zoom-in;
    transition: transform 0.2s;
}
.note-content .md-image:hover {
    transform: scale(1.02);
}

/* ========== 卡片悬停效果 ========== */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

/* ========== 毛玻璃效果 ========== */
.glass-card {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.3);
}
[data-theme="dark"] .glass-card {
    background: rgba(30,30,40,0.7);
    border: 1px solid rgba(255,255,255,0.05);
}

/* ========== 柔和阴影层 ========== */
.shadow-soft {
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}
.shadow-soft-lg {
    box-shadow: 0 8px 32px rgba(0,0,0,0.07);
}
.shadow-glow {
    box-shadow: 0 0 20px rgba(108,92,231,0.12);
}

/* ========== 渐变文字 ========== */
.gradient-text {
    background: linear-gradient(135deg, #6C5CE7, #A29BFE);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(108,92,231,0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(108,92,231,0.4);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
}

/* ========== 选中文本 ========== */
::selection {
    background: rgba(108,92,231,0.2);
    color: inherit;
}

/* ========== 动画 ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.animate-pulse-soft {
    animation: pulse-soft 2s ease-in-out infinite;
}

/* ========== 响应式断点补充 ========== */
@media (max-width: 640px) {
    .note-content h1 { font-size: 1.5rem; }
    .note-content h2 { font-size: 1.25rem; }
    .note-content pre { font-size: 0.8rem; padding: 0.75rem 1rem; }
    
    /* 移动端全宽 */
    .mobile-full { width: 100% !important; }
}

/* ========== 图片灯箱 ========== */
.lightbox-img {
    object-fit: contain;
    animation: fadeInUp 0.3s ease-out;
}

/* ========== Toast动画 ========== */
.toast .alert {
    animation: fadeInUp 0.3s ease-out;
}

/* ========== 时间轴 ========== */
@media (max-width: 767px) {
    .timeline-item {
        padding-left: 2rem;
        border-left: 2px solid rgba(108,92,231,0.2);
        margin-left: 1rem;
    }
}

/* ========== 暗色模式优化 ========== */
[data-theme="dark"] .note-content blockquote {
    background: rgba(108,92,231,0.06);
}
[data-theme="dark"] .note-content :not(pre) > code {
    background: rgba(108,92,231,0.15);
}
[data-theme="dark"] .note-content a {
    color: #A29BFE;
}

/* ========== 打印样式 ========== */
@media print {
    header, footer, nav, .toast, button { display: none !important; }
    body { background: white; }
    .note-content { font-size: 14px; }
}
