{{template "layout/header.html" .}}
<body>

{{template "layout/nav.html" .}}

<div class="studio-wrapper">
    {{template "studio/sidebar.html" .}}

    <main class="studio-main">
        <div class="studio-header">
            <h1>创作中心</h1>
            <span class="studio-subtitle">数据概览</span>
        </div>

        {{if .Error}}
        <div class="studio-error">{{.Error}}</div>
        {{else}}
        <!-- 统计卡片 -->
        <div class="stat-cards">
            <div class="stat-card">
                <div class="stat-card-icon">📝</div>
                <div class="stat-card-body">
                    <span class="stat-card-value">{{.Overview.TotalPosts}}</span>
                    <span class="stat-card-label">文章总数</span>
                </div>
            </div>
            <div class="stat-card stat-card-approved">
                <div class="stat-card-icon">✅</div>
                <div class="stat-card-body">
                    <span class="stat-card-value">{{.Overview.ApprovedCount}}</span>
                    <span class="stat-card-label">已发布</span>
                </div>
            </div>
            <div class="stat-card stat-card-pending">
                <div class="stat-card-icon">⏳</div>
                <div class="stat-card-body">
                    <span class="stat-card-value">{{.Overview.PendingCount}}</span>
                    <span class="stat-card-label">审核中</span>
                </div>
            </div>
            <div class="stat-card stat-card-draft">
                <div class="stat-card-icon">📄</div>
                <div class="stat-card-body">
                    <span class="stat-card-value">{{.Overview.DraftCount}}</span>
                    <span class="stat-card-label">草稿</span>
                </div>
            </div>
            <div class="stat-card stat-card-rejected">
                <div class="stat-card-icon">↩️</div>
                <div class="stat-card-body">
                    <span class="stat-card-value">{{.Overview.RejectedCount}}</span>
                    <span class="stat-card-label">已退回</span>
                </div>
            </div>
        </div>

        <!-- 状态分布 -->
        {{if gt .Overview.TotalPosts 0}}
        <div class="studio-section">
            <h2 class="section-title">内容分布</h2>
            <div class="status-bar">
                {{if gt .Overview.ApprovedCount 0}}
                <div class="status-bar-segment status-bar-approved" style="flex:{{.Overview.ApprovedCount}}">已发布 {{.Overview.ApprovedCount}}</div>
                {{end}}
                {{if gt .Overview.DraftCount 0}}
                <div class="status-bar-segment status-bar-draft" style="flex:{{.Overview.DraftCount}}">草稿 {{.Overview.DraftCount}}</div>
                {{end}}
                {{if gt .Overview.PendingCount 0}}
                <div class="status-bar-segment status-bar-pending" style="flex:{{.Overview.PendingCount}}">审核中 {{.Overview.PendingCount}}</div>
                {{end}}
                {{if gt .Overview.RejectedCount 0}}
                <div class="status-bar-segment status-bar-rejected" style="flex:{{.Overview.RejectedCount}}">已退回 {{.Overview.RejectedCount}}</div>
                {{end}}
            </div>
        </div>
        {{end}}

        <!-- 快捷入口 -->
        <div class="studio-section">
            <h2 class="section-title">快捷操作</h2>
            <div class="quick-actions">
                <a href="/studio/write" class="quick-action-btn primary">✏️ 写新文章</a>
                <a href="/studio/drafts" class="quick-action-btn">📄 草稿箱{{if gt .Overview.DraftCount 0}}（{{.Overview.DraftCount}}）{{end}}</a>
                <a href="/studio/posts" class="quick-action-btn">📋 管理内容</a>
                <a href="/studio/analytics" class="quick-action-btn">📈 数据分析</a>
            </div>
        </div>
        {{end}}
    </main>
</div>

{{template "layout/footer.html" .}}

</body>
</html>
