/* ── 整体布局 ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* ── 左侧导航 ── */
.sidebar {
    background: #fff;
    min-height: 100vh;
    border-right: 1px solid #e0e0e0;
    padding: 0;
    position: fixed;
    width: 200px;
    z-index: 100;
}
.sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid #eee;
}
.sidebar .nav-link {
    border-radius: 0;
    padding: 12px 16px;
    color: #333;
    border: none;
    text-align: left;
    font-size: 14px;
}
.sidebar .nav-link.active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 600;
}
.sidebar .nav-link:hover {
    background: #f5f5f5;
}

/* ── 右侧主区域 ── */
.main-content {
    margin-left: 200px;
    padding: 24px 32px;
}
.tab-pane {
    min-height: 400px;
}

/* ── 文件上传区域 ── */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}
.upload-area:hover {
    border-color: #1a73e8;
    background: #e8f0fe;
}
.upload-area.dragover {
    border-color: #1a73e8;
    background: #d2e3fc;
}
.upload-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

/* ── 缩略图 ── */
.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.thumb-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
    position: relative;
}
.thumb-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.thumb-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}
.thumb-item .thumb-info {
    padding: 8px;
    font-size: 12px;
    word-break: break-all;
}
.thumb-item .thumb-url {
    font-size: 11px;
    color: #1a73e8;
    cursor: pointer;
}
.thumb-item .thumb-url:hover {
    text-decoration: underline;
}
.thumb-item .btn-sm {
    font-size: 12px;
    padding: 2px 6px;
}
.file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
}
.file-row .file-url {
    color: #1a73e8;
    cursor: pointer;
    font-size: 13px;
}
.file-row .file-url:hover {
    text-decoration: underline;
}

/* ── 底部操作栏 ── */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 12px 0;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

/* ── 预览框 ── */
.preview-box {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    font-family: "Menlo", "Consolas", monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 70vh;
    overflow-y: auto;
}

/* ── 状态条 ── */
#statusBar {
    font-size: 13px;
    padding: 6px 12px;
}

/* ── 表单样式 ── */
.form-label {
    margin-bottom: 4px;
    font-size: 14px;
}
.form-control, .form-select {
    font-size: 14px;
}
textarea.font-monospace {
    font-size: 13px;
    line-height: 1.5;
}
.card-header {
    font-size: 14px;
    font-weight: 600;
}

/* ── WangEditor ── */
.wangeditor-toolbar {
    border-bottom: 1px solid #e0e0e0;
}
.wangeditor-editor {
    height: 300px;
}
/* WangEditor 内部编辑区域 */
.wangeditor-editor .w-e-text-container,
.wangeditor-editor .w-e-text {
    height: 100% !important;
    min-height: 260px;
}
/* 外部容器 + 拖拽手柄 */
.wangeditor-box {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin-bottom: 4px;
}
.wangeditor-resize-handle {
    height: 6px;
    cursor: ns-resize;
    background: transparent;
    transition: background 0.2s;
    position: relative;
}
.wangeditor-resize-handle:hover,
.wangeditor-resize-handle:active {
    background: #e0e0e0;
}
.wangeditor-resize-handle::after {
    content: "⠿";
    display: block;
    text-align: center;
    font-size: 10px;
    color: #999;
    line-height: 6px;
}

/* ── 响应式 ── */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
}
