/* ============================================================
   MetaLab Studio — 创作中心专用样式
   ============================================================ */

/* ---------- 布局 ---------- */
.studio-wrapper {
    display: flex;
    min-height: calc(100vh - 120px);
}

/* ---------- 左侧导航 ---------- */
.studio-sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 24px 0;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
    padding: 0 24px 20px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    font-size: 15px;
    color: var(--color-text-light);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: #f0f4ff;
    color: var(--color-accent);
}

.sidebar-item.active {
    background: #e8f0fe;
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    font-weight: 600;
}

.sidebar-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* ---------- 主内容区 ---------- */
.studio-main {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
}

.studio-header {
    margin-bottom: 28px;
}

.studio-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 6px;
}

.studio-subtitle {
    font-size: 14px;
    color: var(--color-secondary);
}

.header-counts {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.header-count {
    font-size: 13px;
    padding: 2px 10px;
    border-radius: 12px;
    background: #f0f0f0;
    color: var(--color-text-light);
}

.header-count.approved { background: #e8f5e9; color: #2e7d32; }
.header-count.pending { background: #fff3e0; color: #e65100; }
.header-count.draft { background: #e3f2fd; color: #1565c0; }
.header-count.rejected { background: #ffebee; color: #c62828; }

/* ---------- 统计卡片 ---------- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

.stat-card-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 12px;
}

.stat-card-body {
    display: flex;
    flex-direction: column;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.stat-card-label {
    font-size: 13px;
    color: var(--color-secondary);
    margin-top: 2px;
}

.stat-card-approved .stat-card-icon { background: #e8f5e9; }
.stat-card-approved .stat-card-value { color: #2e7d32; }

.stat-card-pending .stat-card-icon { background: #fff3e0; }
.stat-card-pending .stat-card-value { color: #e65100; }

.stat-card-draft .stat-card-icon { background: #e3f2fd; }
.stat-card-draft .stat-card-value { color: #1565c0; }

.stat-card-rejected .stat-card-icon { background: #ffebee; }
.stat-card-rejected .stat-card-value { color: #c62828; }

/* ---------- 通用区块 ---------- */
.studio-section {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

/* ---------- 状态条 ---------- */
.status-bar {
    display: flex;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    gap: 2px;
    background: #eee;
}

.status-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    min-width: 80px;
}

.status-bar-approved { background: #4caf50; }
.status-bar-draft { background: #42a5f5; }
.status-bar-pending { background: #ff9800; }
.status-bar-rejected { background: #ef5350; }

/* ---------- 快捷操作 ---------- */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    background: #f5f5f5;
    color: var(--color-text);
    font-size: 14px;
    transition: var(--transition);
    border: 1px solid var(--color-border);
}

.quick-action-btn:hover {
    background: #e8f0fe;
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.quick-action-btn.primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.quick-action-btn.primary:hover {
    background: #2980b9;
}

/* ---------- 状态筛选 Tabs ---------- */
.status-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.status-tab {
    padding: 10px 20px;
    font-size: 14px;
    color: var(--color-text-light);
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.status-tab:hover {
    color: var(--color-accent);
    background: #f8f9fa;
}

.status-tab.active {
    color: var(--color-accent);
    font-weight: 600;
    border-bottom-color: var(--color-accent);
    background: #e8f0fe;
}

/* ---------- 帖子列表 ---------- */
.post-list {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background: #f8f9fa;
}

.post-item-main {
    flex: 1;
    min-width: 0;
}

.post-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary);
    display: block;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-item-title:hover {
    color: var(--color-accent);
}

.draft-title {
    color: var(--color-secondary);
}

.post-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--color-secondary);
}

.post-status-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.status-approved { background: #e8f5e9; color: #2e7d32; }
.status-pending { background: #fff3e0; color: #e65100; }
.status-draft { background: #e3f2fd; color: #1565c0; }
.status-rejected { background: #ffebee; color: #c62828; }
.status-locked { background: #f3e5f5; color: #6a1b9a; }

.post-reject-hint {
    color: #c62828;
    font-style: italic;
}

.post-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 16px;
}

.action-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid var(--color-border);
    background: #f5f5f5;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.action-btn:hover {
    background: #e8f0fe;
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.action-btn.primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.action-btn.primary:hover {
    background: #2980b9;
}

.action-btn.danger {
    color: var(--color-danger);
    border-color: #ffcdd2;
}

.action-btn.danger:hover {
    background: #ffebee;
    border-color: var(--color-danger);
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
}

.page-btn {
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 14px;
    transition: var(--transition);
}

.page-btn:hover {
    background: #e8f0fe;
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.page-info {
    font-size: 14px;
    color: var(--color-secondary);
}

/* ---------- 空状态 ---------- */
.studio-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.studio-empty p {
    font-size: 16px;
    color: var(--color-secondary);
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    padding: 10px 24px;
    background: var(--color-accent);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: #2980b9;
    color: #fff;
}

/* ---------- 占位提示 ---------- */
.studio-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--color-secondary);
    font-size: 15px;
}

/* ---------- 错误提示 ---------- */
.studio-error {
    background: #ffebee;
    color: #c62828;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

/* ============================================================
   编辑器样式（复用自 posts/new.html 的编辑器布局）
   ============================================================ */

.editor-layout {
    width: 100%;
}

.editor-form {
    max-width: 100%;
}

.editor-header {
    margin-bottom: 16px;
}

.editor-title-input {
    width: 100%;
    padding: 14px 0;
    border: none;
    border-bottom: 2px solid var(--color-border);
    font-size: 22px;
    font-weight: 600;
    outline: none;
    background: transparent;
    color: var(--color-primary);
    transition: var(--transition);
}

.editor-title-input:focus {
    border-bottom-color: var(--color-accent);
}

.editor-title-input::placeholder {
    color: #ccc;
}

.editor-main {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.editor-pane {
    flex: 1;
    min-width: 0;
}

.editor-sidebar {
    width: 200px;
    flex-shrink: 0;
}

.editor-sidebar-section {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.editor-sidebar-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.tips-list {
    list-style: none;
    font-size: 12px;
    color: var(--color-secondary);
    line-height: 2;
}

.tips-list code {
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
}

.editor-statusbar {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--color-border);
    gap: 16px;
}

.status-item {
    font-size: 13px;
    color: var(--color-secondary);
}

.status-spacer {
    flex: 1;
}

.btn-submit {
    padding: 8px 24px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .studio-wrapper {
        flex-direction: column;
    }

    .studio-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: 12px 0;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 12px;
    }

    .sidebar-item {
        padding: 8px 16px;
        border-left: none;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
    }

    .sidebar-item.active {
        border-left: none;
        border-bottom-color: var(--color-accent);
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .post-item-actions {
        margin-left: 0;
    }

    .editor-main {
        flex-direction: column;
    }

    .editor-sidebar {
        width: 100%;
    }
}
