/* css/editor.css - Modern Dual Theme */

:root {
    /* ================= 默认白昼模式变量 ================= */
    --bg-body: #f8fafc;        /* 页面背景 */
    --bg-sidebar: #ffffff;     /* 侧边栏背景 */
    --bg-card: #ffffff;        /* 卡片背景 */
    --bg-hover: #f1f5f9;       /* 悬停背景 */
    --bg-header: rgba(255, 255, 255, 0.9); /* 顶部导航背景 */
    
    --text-main: #1e293b;      /* 主标题色 */
    --text-sub: #64748b;       /* 副标题色 */
    --text-muted: #94a3b8;     /* 提示文本色 */
    
    --border-color: #e2e8f0;   /* 边框颜色 */
    
    /* 品牌色 (保持一致) */
    --primary: #2563eb;        
    --primary-hover: #1d4ed8;
    --danger: #ef4444;         
    --success: #10b981;        
    --warning: #f59e0b;        
    
    --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);
    
    --radius: 12px;
    --header-h: 64px;
    --sidebar-w: 260px;
    
    /* 滚动条颜色 */
    --scrollbar-thumb: rgba(203, 213, 225, 0.5);
    --scrollbar-thumb-hover: rgba(148, 163, 184, 0.8);
}

/* ================= 月蚀模式变量 (Dark IDE Style) ================= */
[data-theme="dark"] {
    --bg-body: #0f172a;      /* 深蓝黑背景 */
    --bg-sidebar: #1e293b;   /* 侧边栏深色 */
    --bg-card: #1e293b;      /* 卡片深色 */
    --bg-hover: #334155;     /* 悬停背景 */
    --bg-header: rgba(15, 23, 42, 0.9); /* 顶部导航深色 */
    
    --text-main: #f1f5f9;    /* 文字反白 */
    --text-sub: #94a3b8;     /* 副标题浅灰 */
    --text-muted: #64748b;
    
    --border-color: #334155; /* 边框深色 */
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    
    --scrollbar-thumb: rgba(255, 255, 255, 0.2);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.4);
}


* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent; 
}
body {
    font-family: 'Noto Sans SC', -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden; 
}

/* === 布局结构 === */
.app-layout { display: flex; height: 100%; width: 100%; }

/* 1. 侧边栏 */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    z-index: 100; transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand { color: var(--primary); font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.brand i { font-size: 1.3rem; }

.sidebar-menu { flex: 1; padding: 20px 10px; overflow-y: auto; }

.menu-item {
    display: flex; align-items: center;
    padding: 12px 15px;
    color: var(--text-sub); text-decoration: none;
    border-radius: 8px; margin-bottom: 5px;
    transition: all 0.2s; font-weight: 500;
}
.menu-item i { width: 24px; margin-right: 10px; text-align: center; }
.menu-item:hover { background-color: var(--bg-hover); color: var(--primary); }
.menu-item.active { background-color: var(--bg-hover); color: var(--primary); }

.sidebar-footer { padding: 15px; border-top: 1px solid var(--border-color); }
.footer-info-btn {
    width: 100%; border: none; background: transparent; 
    color: var(--text-muted); display: flex; align-items: center; gap: 10px;
    font-size: 0.85rem; cursor: pointer; padding: 5px 10px;
}
.footer-info-btn:hover { color: var(--primary); }

/* 2. 主内容区 */
.main-content {
    flex: 1; display: flex; flex-direction: column;
    background: var(--bg-body);
    position: relative; overflow: hidden;
}

/* 顶部导航 */
.top-bar {
    height: var(--header-h);
    background: var(--bg-header);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 24px; z-index: 10;
}
.top-left { display: flex; align-items: center; gap: 15px; }
.page-title { font-size: 1.2rem; font-weight: 700; color: var(--text-main); margin: 0; }
.top-right { display: flex; align-items: center; gap: 12px; }

/* 搜索框 */
.search-wrapper { position: relative; }
.search-wrapper input {
    padding: 8px 15px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 20px; background: var(--bg-card);
    font-size: 0.9rem; width: 220px; outline: none; transition: all 0.2s;
    color: var(--text-main);
}
.search-wrapper input:focus {
    width: 280px; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.search-wrapper i {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 0.9rem;
}

/* 通用按钮 */
.btn {
    padding: 8px 18px; border-radius: 8px; border: none;
    cursor: pointer; font-size: 0.9rem; font-weight: 500;
    display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--bg-hover); color: var(--text-main); }
.btn-text { background: transparent; color: var(--primary); text-decoration: underline; padding: 5px; }

.icon-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--border-color); background: var(--bg-card);
    color: var(--text-sub); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-hover); }

.avatar-small {
    width: 36px; height: 36px; border-radius: 50%;
    border: 2px solid var(--bg-card); box-shadow: 0 0 0 1px var(--border-color);
    cursor: pointer; object-fit: cover;
}

/* 3. 内容滚动列表 */
.content-body { flex: 1; overflow-y: auto; padding: 30px; }

/* 美化滚动条 (适配变量) */
.content-body {
    scrollbar-width: thin; 
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
.content-body::-webkit-scrollbar {
    width: 6px; height: 6px; background-color: transparent;
}
.content-body::-webkit-scrollbar-track {
    background: transparent; margin: 1px 0;
}
.content-body::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 5px; 
}
.content-body::-webkit-scrollbar-thumb:hover {
    background-color: var(--scrollbar-thumb-hover);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* === 卡片样式 === */
.draft-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column;
    position: relative; height: 320px; 
}

.draft-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--text-muted);
}

.card-img-box {
    height: 160px; background-color: var(--bg-hover);
    position: relative; overflow: hidden;
}
.card-img-box img {
    width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s;
}
.draft-card:hover .card-img-box img { transform: scale(1.05); }

.card-avatar {
    width: 54px; height: 54px; border-radius: 50%;
    border: 3px solid var(--bg-card);
    position: absolute; top: 130px; right: 16px; 
    z-index: 2;
    box-shadow: var(--shadow-sm); background: #ddd;
}
.card-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.card-body {
    padding: 16px; padding-top: 24px; 
    display: flex; flex-direction: column; flex: 1;
    background: var(--bg-card);
}

.card-title {
    font-size: 1.1rem; font-weight: 700; color: var(--text-main);
    margin-bottom: 8px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-desc {
    font-size: 0.85rem; color: var(--text-sub); line-height: 1.5;
    flex: 1; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    margin-bottom: 12px;
}

.card-footer {
    margin-top: auto;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.75rem; color: var(--text-muted);
}

.status-badge {
    padding: 3px 10px; border-radius: 12px;
    font-weight: 600; background: var(--bg-hover); color: var(--text-sub);
}
.status-badge.published { background: #ecfdf5; color: var(--success); border: 1px solid #d1fae5; }
[data-theme="dark"] .status-badge.published { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.3); color: #34d399; }

/* === 弹窗体系 === */
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px);
    z-index: 1000;
    display: none; 
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s ease;
}
.modal-backdrop.active { display: flex; opacity: 1; }

.modal-panel {
    background: var(--bg-card); width: 90%; max-width: 480px;
    border-radius: 16px; box-shadow: var(--shadow-lg);
    overflow: hidden; transform: scale(0.95); transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--text-main);
}
.modal-backdrop.active .modal-panel { transform: scale(1); }
.large-panel { max-width: 800px; height: 80vh; display: flex; flex-direction: column; }

.modal-header {
    padding: 16px 24px; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--bg-card);
}
.modal-title { font-size: 1.1rem; font-weight: 700; margin: 0; color: var(--text-main); }
.close-modal { background: none; border: none; color: var(--text-sub); cursor: pointer; font-size: 1.2rem; }

.modal-body { padding: 24px; overflow-y: auto; max-height: 70vh; background: var(--bg-card); }

.modal-footer {
    padding: 16px 24px; background: var(--bg-hover); border-top: 1px solid var(--border-color);
    display: flex; justify-content: flex-end; gap: 12px;
}

/* 操作弹窗内部 */
.draft-preview-mini {
    display: flex; align-items: center;
    background: var(--bg-hover); padding: 16px; border-radius: 12px;
    border: 1px solid var(--border-color); margin-bottom: 24px;
}
.draft-preview-mini img {
    width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
    margin-right: 16px; border: 2px solid var(--bg-card); box-shadow: var(--shadow-sm);
}
.draft-preview-text h4 { margin-bottom: 4px; color: var(--text-main); font-size: 1.05rem; }
.draft-preview-text div { font-size: 0.85rem; color: var(--text-muted); }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.action-card-btn {
    border: 1px solid var(--border-color); background: var(--bg-card);
    padding: 16px; border-radius: 12px; text-align: left;
    cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 12px;
}
.action-card-btn:hover { border-color: var(--primary); background: var(--bg-hover); transform: translateY(-2px); }

.icon-box {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.icon-box.blue { background: #dbeafe; color: var(--primary); }
.icon-box.green { background: #dcfce7; color: var(--success); }
.icon-box.purple { background: #f3e8ff; color: #9333ea; }
.icon-box.red { background: #fee2e2; color: var(--danger); }

.action-text { display: flex; flex-direction: column; }
.action-text span { font-weight: 600; color: var(--text-main); font-size: 0.95rem; }
.action-text small { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* 警告弹窗 */
.bg-warning-light { background-color: #fffbeb; }
.text-warning-dark { color: #92400e; }
[data-theme="dark"] .bg-warning-light { background-color: rgba(245, 158, 11, 0.2); }
[data-theme="dark"] .text-warning-dark { color: #fbbf24; }

.warning-list { padding-left: 20px; color: var(--text-main); margin-bottom: 15px; line-height: 1.6; }
.warning-list li { margin-bottom: 5px; }
.text-content { color: var(--text-main); font-size: 0.95rem; }
.note { font-size: 0.85rem; color: var(--text-muted); margin-top: 10px; font-style: italic; }

/* 下载弹窗 */
.relative-body { position: relative; min-height: 200px; }
.spinner-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: var(--text-muted); display: none; }
.mini-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.draft-card.mini { height: auto; min-height: 80px; }
.draft-card.mini .download-btn { background: var(--bg-hover); color: var(--primary); }

/* 状态页面 */
.state-container { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-icon { font-size: 3.5rem; margin-bottom: 20px; opacity: 0.3; }
.state-container h3 { font-size: 1.2rem; color: var(--text-main); margin-bottom: 8px; }
.state-container p { margin-bottom: 20px; }

.spinner {
    width: 32px; height: 32px; border: 3px solid var(--border-color);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto 15px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === 状态标签样式 === */
.status-badge.reviewing { background: #fff7ed; color: #d97706; border: 1px solid #ffedd5; }
.status-badge.rejected { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
[data-theme="dark"] .status-badge.reviewing { background: rgba(251, 191, 36, 0.2); color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); }
[data-theme="dark"] .status-badge.rejected { background: rgba(239, 68, 68, 0.2); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }

/* === 审核反馈按钮 === */
.feedback-btn-wrapper { grid-column: span 2; margin-top: 10px; border-top: 1px solid var(--border-color); padding-top: 15px; }
.action-card-btn.feedback-action { width: 100%; background-color: #fef2f2; border-color: #fecaca; }
.action-card-btn.feedback-action:hover { background-color: #fee2e2; }
.action-card-btn.feedback-action .icon-box { color: #dc2626; background: #fff; }
.action-card-btn.feedback-action .action-text span { color: #b91c1c; }

/* Mobile Responsive */
.mobile-only { display: none; }

@media (max-width: 768px) {
    .mobile-only { display: flex; }
    #hamburger-menu { display: none !important; }
    .sidebar { display: none !important; }
    .sidebar-overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 90; display: none;
    }
    .sidebar-overlay.active { display: block; }
    .top-bar { padding: 0 16px; }
    .page-title { font-size: 1.1rem; }
    .top-left { padding-left: 4px; }
    .search-wrapper { display: none; }
    .btn span { display: none; }
    .btn i { margin: 0; }
    .content-body { padding: 16px; }
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); }
}
