/* ========== 启动动画 ========== */
.splash-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fef9f0 0%, #fff2e6 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.splash-text {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e67e22, #d35400);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: 0.1em;
    opacity: 0;
    transform: scale(0.9);
    animation: fadeInScale 0.6s ease forwards;
}
@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes fadeOutScale {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.9); }
}

/* ========== 主内容 ========== */
.main-content {
    display: none;
    opacity: 0;
    animation: contentFadeIn 0.5s ease forwards;
}
@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== 分类板块（大按钮块） ========== */
.category-block {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    border: 1px solid #ffedd5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}
.category-block:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -12px rgba(230, 126, 34, 0.3);
    border-color: #fed7aa;
}
.category-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    fill: #e67e22;
}
.category-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #3b2a21;
}
.category-count {
    font-size: 0.75rem;
    color: #b97f5a;
    margin-top: 0.25rem;
}

/* ========== 文件小卡片 ========== */
.file-card-sm {
    background: white;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #ffedd5;
    transition: all 0.2s ease;
    cursor: pointer;
}
.file-card-sm:hover {
    transform: translateX(4px);
    border-color: #fed7aa;
    background: #fffaf5;
}

/* ========== 侧边栏 ========== */
.sidebar-file-item {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sidebar-file-item:hover {
    background: #fff2e6;
}
.sidebar-file-item.active {
    background: #fff2e6;
    border-left: 3px solid #e67e22;
}
.sidebar-list {
    max-height: 400px;
    overflow-y: auto;
}

/* ========== Mac 风格模态框 ========== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
}
.modal.flex {
    display: flex;
}
.modal-window {
    background-color: white;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 80rem;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 40px rgba(0, 0, 0, 0.3);
    resize: both;
    min-width: 400px;
    min-height: 300px;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    cursor: move;
    user-select: none;
}
.modal-buttons {
    display: flex;
    gap: 0.5rem;
}
.modal-close,
.modal-minimize,
.modal-maximize {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.modal-close {
    background-color: #ff5f56;
}
.modal-minimize {
    background-color: #ffbd2e;
}
.modal-maximize {
    background-color: #27c93f;
}
.modal-close:hover {
    background-color: #e0443c;
    transform: scale(1.1);
}
.modal-minimize:hover {
    background-color: #e6a020;
    transform: scale(1.1);
}
.modal-maximize:hover {
    background-color: #1ea832;
    transform: scale(1.1);
}
.modal-title {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}
.modal-placeholder {
    width: 4rem;
}
.modal-body {
    padding: 1.5rem;
    overflow: auto;
    max-height: calc(90vh - 48px);
}
.modal-window.maximized {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    max-height: none;
    top: 0 !important;
    left: 0 !important;
    border-radius: 0;
}

/* ========== Markdown 渲染样式 ========== */
#previewContainer {
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.7;
    color: #334155;
    max-width: 1000px;
    margin: 0 auto;
}
#previewContainer h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.3rem;
    color: #e67e22;
}
#previewContainer h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-top: 1.3rem;
    margin-bottom: 0.6rem;
    color: #d35400;
}
#previewContainer h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #e67e22;
}
#previewContainer p {
    margin-bottom: 1rem;
    line-height: 1.7;
}
#previewContainer a {
    color: #e67e22;
    text-decoration: underline;
}
#previewContainer ul,
#previewContainer ol {
    margin: 0.6rem 0 1rem 1.8rem;
}
#previewContainer blockquote {
    border-left: 4px solid #e67e22;
    background: #fef9f0;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0.5rem;
}
#previewContainer code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.375rem;
    font-size: 0.875em;
    color: #d35400;
}
#previewContainer pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.75rem;
    overflow-x: auto;
}
#previewContainer pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
#previewContainer table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    border-radius: 0.5rem;
    overflow: hidden;
}
#previewContainer th,
#previewContainer td {
    border: 1px solid #e2e8f0;
    padding: 0.5rem 0.75rem;
}
#previewContainer th {
    background: #f8fafc;
    font-weight: 600;
}
#previewContainer img {
    max-width: 100%;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========== 导航链接下划线 ========== */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, #e67e22, #f39c12);
    transition: width 0.2s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #e67e22;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #d35400;
}