/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

/* 基础字体和颜色 */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-dark: #1d4ed8;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-dark: #2563eb;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --border-light: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 图标样式 */
.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-lg {
    width: 24px;
    height: 24px;
}

/* 主布局 - 左右结构 */
.app {
    height: 100dvh;
    display: flex;
    overflow: hidden;
}

/* 左侧菜单栏 */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

/* 右侧内容区域 */
.main-content {
    /* flex-grow: 1; */
    display: flex;
    flex-direction: column;
    /* height: 100dvh; */
    overflow-x: hidden; /* 防止子元素溢出导致水平滚动 */
}

/* 顶部标题栏 */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 100px;
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 100px;
    justify-content: flex-end;
}

/* 知识库区域 - 左右布局 */
.knowledge-area {
    flex: 1;
    display: flex;
    overflow: hidden;
    height: calc(100dvh - 64px); /* 减去顶部导航栏高度 */
}

/* 知识库列表 */
.knowledge-list {
    width: 400px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

@media screen and (max-width: 1023px) {
    [data-theme="dark"] .knowledge-list{
        background-color: #1f2937;
    }
}

.list-header {
    padding: 1rem;
    /* border-bottom: 1px solid var(--border-light); */
    background: var(--bg-primary);
    flex-shrink: 0;
}

.list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.knowledge-grid-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 0;
}

.pagination-wrapper {
    flex-shrink: 0;
    background: var(--bg-primary);
}

/* 知识库详情 */
.knowledge-detail {
    flex: 1;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.detail-header {
    padding: 1.5rem 1.5rem 1.5rem 1.1rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
    flex-shrink: 0;
    z-index: 1;
}

.detail-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* 移动端样式和响应式布局 */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.show {
    opacity: 1;
}

/* 汉堡菜单按钮 */
.menu-toggle {
    display: none;
    padding: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
}

.sidebar-icon {
    margin-right: 0.5rem;
}

/* 桌面端布局 - 大于等于1024px保持原有布局 */
@media (min-width: 1024px) {
    /* 确保侧边栏在桌面端显示 */
    #sidebar {
        transform: translateX(0) !important;
        position: fixed;
    }
    
    /* 确保主内容区域有正确的左边距 */
    main {
        margin-left: 306px;
    }
    
    /* 确保菜单按钮在桌面端隐藏 */
    #menuToggle {
        display: none;
    }
    
    /* 确保遮罩层在桌面端隐藏 */
    #sidebarOverlay {
        display: none !important;
    }
    
    /* 确保知识详情面板在桌面端显示 */
    .knowledge-detail {
        display: flex !important;
    }
    
    /* 确保知识列表在桌面端有正确宽度 */
    .knowledge-list {
        width: 400px !important;
    }
}

/* 移动端和平板响应式 - 统一小于1024px的布局 */
@media (max-width: 1023px) {
    .app {
        position: relative;
        height: 100dvh; /* 确保移动端应用容器占满整个视口 */
    }
    
    .main-content {
        height: 100dvh; /* 确保主内容区域占满整个视口 */
    }
    
    /* 隐藏详情面板，使用移动端弹框布局 */
    .knowledge-detail {
        display: none !important;
    }
    
    .knowledge-list {
        width: 100%;
        height: calc(100dvh - 70px); /* 减去头部高度，确保知识库列表充满剩余空间 */
    }
    
    /* 移动端菜单显示控制 */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100dvh;
        transform: translateX(-100%);
        z-index: 1000;
        box-shadow: var(--shadow-lg);
    }

    .sidebar-icon {
        margin-right: 0.2rem !important;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .mobile-overlay {
        display: block;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .header-title {
        font-size: 1.25rem;
    }
    
    .header-left,
    .header-right {
        min-width: 50px;
    }
    
    .list-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .list-controls .search-container {
        min-width: 100%;
    }
    
    /* 移动端知识库区域调整 */
    .knowledge-area {
        flex-direction: column;
        height: calc(100dvh - 70px); /* 确保知识库区域占满剩余视口高度 */
    }
    
    .knowledge-list {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: 100%; /* 确保知识库列表占满知识库区域 */
    }
    
    .knowledge-grid-container {
        padding: 0.75rem;
        padding-bottom: 0;
        flex: 1; /* 确保网格容器能伸缩填满剩余空间 */
    }
    
    /* 移动端隐藏知识库列表中的操作按钮 */
    .knowledge-card-actions {
        display: none !important;
    }
    
    .knowledge-detail {
        display: flex;
        width: 100%;
    }
    
    /* 移动端详情全屏显示 */
    .knowledge-detail.mobile-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 999;
        background: var(--bg-primary);
    }
    
    .list-header,
    .detail-header {
        padding: 0.75rem;
    }
    
    .list-content,
    .detail-content {
        /* padding: 0.75rem; */
    }
}



/* 修复标题栏布局 */
.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* 确保主题图标显示正确 */
.theme-icon-light,
.theme-icon-dark {
    transition: opacity 0.2s ease-in-out;
}

/* 侧边栏布局修复 */
#sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar nav button {
    position: relative;
    overflow: hidden;
}

#sidebar nav button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

#sidebar nav button:hover::before {
    left: 100%;
}

.dark #sidebar nav button::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

/* 确保标签树容器样式 */
#categoryTree {
    font-family: inherit;
}

#topNav {
    padding: 0px 1rem;
}

/* 确保深色模式过渡 */
* {
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

button,
input,
textarea,
select {
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* 禁用标签树相关元素的过渡动画，避免页面刷新时的抖动 */
#categoryTree,
#categoryTree *,
.category-tree-item,
.category-tree-item *,
.category-item,
.category-item *,
.category-children,
.category-children *,
.category-toggle-btn,
.category-action-btn,
.category-actions {
    transition: none !important;
    animation: none !important;
    transform: none !important;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 确保布局不会因为内容变化而跳动 */
#currentPageTitle {
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 布局优化 - 独立滚动区域 */
.knowledge-area {
    height: calc(100dvh - 64px); /* 减去顶部导航栏高度 */
}

/* 确保滚动条样式统一 */
.knowledge-grid-container::-webkit-scrollbar,
.detail-content::-webkit-scrollbar {
    /* width: 8px; */
}

.knowledge-grid-container::-webkit-scrollbar-track,
.detail-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.knowledge-grid-container::-webkit-scrollbar-thumb,
.detail-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.knowledge-grid-container::-webkit-scrollbar-thumb:hover,
.detail-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 夜间模式滚动条 */
[data-theme="dark"] .knowledge-grid-container::-webkit-scrollbar-track,
[data-theme="dark"] .detail-content::-webkit-scrollbar-track {
    background: var(--color-surface);
}

[data-theme="dark"] .knowledge-grid-container::-webkit-scrollbar-thumb,
[data-theme="dark"] .detail-content::-webkit-scrollbar-thumb {
    background: var(--color-border);
}

[data-theme="dark"] .knowledge-grid-container::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .detail-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

[data-theme="dark"] .knowledge-grid-container::-webkit-scrollbar-thumb:hover,
.theme-dark .knowledge-grid-container::-webkit-scrollbar-thumb:hover {
    background-color: #4a5568;
}

/* ===== 移动端详情弹框样式 ===== */
/* 遮罩层 */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.detail-overlay.show {
    display: flex;
    opacity: 1;
}

/* 弹框显示时阻止背景滚动 */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* 详情面板 */
.detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.detail-panel.show {
    transform: translateX(0);
}

/* 详情面板头部 - 与编辑器弹框保持一致 */
.detail-panel-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.detail-panel-header-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 1023px) {
    .detail-panel-header-content {
        justify-content: center;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 88px); /* 减去左右按钮的宽度 */
    }
}

.detail-panel-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

/* 移动端详情弹框的标签样式 - 独立显示在头部下方 */
.detail-panel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    /* background: var(--bg-primary); */
    background: var(--bg-secondary);
    width: 100%;
    justify-content: center; /* 标签组居中对齐 */
}

@media screen and (max-width: 1023px) {
    .detail-panel-tags {
        padding: 0 0.75rem 0.75rem 0.75rem;
        display: flex !important;
        justify-content: center; /* 移动端确保标签组居中 */
    }
}

[data-theme="dark"] .detail-panel-tags {
    border-bottom-color: var(--border-color);
    background: var(--bg-secondary);
}

.detail-panel-tags .tag,
.detail-panel-tags .detail-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    background: white;
    border: 1px solid rgba(229, 231, 235, 0.8);
    color: #374151;
    transition: all 0.2s ease;
    text-decoration: none;
}

.detail-panel-tags .tag:hover,
.detail-panel-tags .detail-tag:hover {
    background: rgba(243, 244, 246, 1);
    border-color: rgba(209, 213, 219, 1);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .detail-panel-tags .tag,
[data-theme="dark"] .detail-panel-tags .detail-tag {
    background: rgba(55, 65, 81, 0.6);
    border-color: rgba(75, 85, 99, 0.8);
    color: #d1d5db;
}

[data-theme="dark"] .detail-panel-tags .tag:hover,
[data-theme="dark"] .detail-panel-tags .detail-tag:hover {
    background: rgba(75, 85, 99, 0.8);
    border-color: rgba(107, 114, 128, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.detail-panel-tags .detail-tag-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.detail-panel-tags .detail-tag-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 返回按钮和关闭按钮 - 与编辑器弹框完全一致 */
.detail-panel-back,
.detail-panel-close {
    padding: 0.5rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    /* display: flex !important; */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-close-btn {
    /* padding: 0.5rem 0.5rem 0.5rem 0; */
    display: flex !important;
}

.detail-panel-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.detail-panel-back i {
    font-size: 1.75rem;
}

/* 详情面板内容 */
.detail-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    /* 确保内容可以滚动 */
    height: 0; /* 配合flex-grow使用 */
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
}

.detail-panel-content-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 移动端详情摘要样式 - 与桌面端保持一致 */
.detail-panel-excerpt {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
    line-height: 1.6;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 移动端详情主体内容 */
.detail-panel-main {
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* 移动端附件样式 - 与桌面端保持一致 */
.detail-panel-attachments {
    margin-bottom: 2rem;
}

.detail-panel-attachments h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0.8;
}

/* 移动端元信息样式 - 与桌面端保持一致 */
.detail-panel-meta {
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-light);
    opacity: 0.85;
    font-size: 0.75rem;
}

.detail-panel-meta .meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.detail-panel-meta .meta-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 70px;
    font-size: 0.875rem;
    line-height: 0.875rem;
}

.detail-panel-meta .meta-icon {
    width: 14px;
    height: 14px;
    color: var(--primary-color);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-panel-meta .meta-value {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 0.875rem;
    font-weight: 500;
}

/* 详情面板底部操作按钮 */
.detail-panel-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    flex-shrink: 0;
}

.detail-panel-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 44px;
}

.detail-panel-action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.detail-panel-action-btn:active {
    transform: translateY(0);
}

.detail-panel-action-btn i {
    font-size: 1rem;
}

/* 收藏状态样式 */
.detail-panel-action-btn.favorited {
    background: #fef3c7;
    color: #d97706;
    border-color: #fbbf24;
}

.detail-panel-action-btn.favorited:hover {
    background: #fde68a;
    border-color: #f59e0b;
}

/* 删除按钮样式 */
.detail-panel-action-btn.delete:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* 深色主题适配 */
[data-theme="dark"] .detail-panel,
[data-theme="dark"] .detail-panel-header,
[data-theme="dark"] .detail-panel-actions {
    /* background: var(--bg-primary); */
    color: var(--text-primary);
}

[data-theme="dark"] .detail-panel-excerpt {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

[data-theme="dark"] .detail-panel-action-btn.favorited {
    background: #451a03;
    color: #fbbf24;
    border-color: #92400e;
}

[data-theme="dark"] .detail-panel-action-btn.favorited:hover {
    background: #78350f;
    border-color: #d97706;
}

[data-theme="dark"] .detail-panel-action-btn.delete:hover {
    background: #450a0a;
    color: #f87171;
    border-color: #991b1b;
}

/* 桌面端隐藏移动端弹框 */
@media (min-width: 1024px) {
    .detail-overlay {
        display: none !important;
    }
}

/* ===== 移动端详情弹框中的附件样式 ===== */
@media (max-width: 1023px) {
    /* 确保移动端弹框中的附件管理器样式与桌面端一致 */
    .detail-panel .attachments-container,
    .detail-panel-attachments .attachments-container {
        width: 100%;
    }

    .detail-panel .attachments-list {
        display: flex;
        flex-direction: column;
        border: 1px solid var(--border-color) !important;
        border-radius: 8px !important;
        background: var(--bg-primary) !important;
        overflow: hidden;
    }

    .detail-panel .attachment-item,
    .detail-panel-attachments .attachment-item {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.75rem;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        transition: all 0.2s ease;
    }
    
    .detail-panel .attachment-item:last-child {
        border-bottom: none;
    }

    .detail-panel .attachment-item:hover,
    .detail-panel-attachments .attachment-item:hover {
        background: var(--bg-hover);
    }

    .detail-panel .attachment-header,
    .detail-panel-attachments .attachment-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex: 1;
        min-width: 0;
    }

    .detail-panel .attachment-type-icon,
    .detail-panel-attachments .attachment-type-icon {
        flex-shrink: 0;
        width: 24px;
        height: 24px;
        object-fit: contain;
    }

    .detail-panel .attachment-title-info,
    .detail-panel-attachments .attachment-title-info {
        flex: 1;
        min-width: 0;
    }

    .detail-panel .attachment-name,
    .detail-panel-attachments .attachment-name {
        font-weight: 500;
        color: var(--text-primary);
        font-size: 0.875rem;
        line-height: 1.25rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .detail-panel .attachment-meta,
    .detail-panel-attachments .attachment-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.05rem;
        margin-top: 0.25rem;
        font-size: 0.75rem;
        color: var(--text-muted);
    }

    .detail-panel .attachment-actions,
    .detail-panel-attachments .attachment-actions {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .detail-panel .attachment-action-btn,
    .detail-panel-attachments .attachment-action-btn {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        border-radius: 6px;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.2s ease;
        position: relative;
    }

    .detail-panel .attachment-action-btn:hover:not(:disabled),
    .detail-panel-attachments .attachment-action-btn:hover:not(:disabled) {
        background: var(--bg-hover);
        color: var(--text-primary);
        transform: translateY(-1px);
    }

    /* 附件为空时的样式 */
    .detail-panel .attachments-empty,
    .detail-panel-attachments .attachments-empty {
        text-align: center;
        padding: 2rem;
        color: var(--text-tertiary);
        font-size: 0.875rem;
    }

    /* 深色主题下的附件样式 */
    [data-theme="dark"] .detail-panel .attachments-list {
        border-color: var(--border-color) !important;
        background: var(--bg-primary) !important;
    }

    [data-theme="dark"] .detail-panel .attachment-item,
    [data-theme="dark"] .detail-panel-attachments .attachment-item {
        background: var(--bg-secondary);
        border-bottom-color: var(--border-color);
    }

    [data-theme="dark"] .detail-panel .attachment-item:hover,
    [data-theme="dark"] .detail-panel-attachments .attachment-item:hover {
        background: var(--bg-hover);
    }

    [data-theme="dark"] .detail-panel .attachment-action-btn,
    [data-theme="dark"] .detail-panel-attachments .attachment-action-btn {
        color: var(--text-secondary);
    }

    [data-theme="dark"] .detail-panel .attachment-action-btn:hover,
    [data-theme="dark"] .detail-panel-attachments .attachment-action-btn:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    /* 移动端弹框附件按钮特定颜色 */
    .detail-panel .attachment-copy-link-btn:hover:not(:disabled),
    .detail-panel-attachments .attachment-copy-link-btn:hover:not(:disabled) {
        background: rgba(168, 85, 247, 0.1);
        color: #a855f7;
    }

    /* 确保移动端弹框所有内容都正确显示 */
    .detail-panel-content {
        padding: 1rem 0.85rem 2rem 1rem; /* 底部留出更多空间 */
    }
    
    /* 调试样式 - 确保元信息区域可见 */
    .detail-panel-meta {
        background: var(--bg-secondary);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .detail-panel-meta .meta-item {
        margin-bottom: 0.75rem;
    }
    
    .detail-panel-meta .meta-item:last-child {
        margin-bottom: 0;
    }
    
    /* 确保弹框高度正确 */
    .detail-panel {
        max-height: 100dvh;
        min-height: 100dvh;
    }
    
    /* 移动端头部样式 - 与编辑器弹框保持一致 */
    .detail-panel-header {
        padding: 0.5rem 0.5rem 0rem 0rem;
        background: var(--bg-secondary);
        border-bottom: none;
        /* 1px solid var(--border-color); */
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
    }

    .detail-panel-title {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: calc(100% - 60px);
    }

    .detail-panel-close {
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    /* 滚动条样式 */
    .detail-panel-content::-webkit-scrollbar {
        width: 6px;
    }
    
    .detail-panel-content::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .detail-panel-content::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }
    
    .detail-panel-content::-webkit-scrollbar-thumb:hover {
        background: var(--text-tertiary);
    }
    
    /* 深色主题下的元信息样式 */
    [data-theme="dark"] .detail-panel-meta {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
} 