/* ==========================================================================
   博客工作台 · v4 统一视觉层（studio-ui.css）
   只在插件自己的页面里使用，全部选择器以 .studio- 开头，避免污染后台皮肤。
   ========================================================================== */

.studio-scope {
    --st-primary: #2563eb;
    --st-primary-weak: #eff6ff;
    --st-primary-line: #bfdbfe;
    --st-success: #059669;
    --st-success-weak: #ecfdf5;
    --st-warn: #2667d9;
    --st-warn-weak: #fffbeb;
    --st-danger: #dc2626;
    --st-danger-weak: #fef2f2;
    --st-text: #0f172a;
    --st-text-2: #475569;
    --st-text-3: #94a3b8;
    --st-line: #e5e7eb;
    --st-line-soft: #f1f5f9;
    --st-bg: #ffffff;
    --st-radius: 12px;
    --st-radius-sm: 8px;
    --st-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -16px rgba(15, 23, 42, .18);
    --st-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- 页面标题 ---------- */
.studio-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 16px;
}
.studio-page-head__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--st-text);
    letter-spacing: -.01em;
}
.studio-page-head__desc {
    font-size: 12px;
    color: var(--st-text-3);
    margin-top: 4px;
    line-height: 1.6;
}
.studio-page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.studio-card {
    background: var(--st-bg);
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow);
    padding: 18px 20px;
}
.studio-card--flat { box-shadow: none; }
.studio-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.studio-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--st-text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.studio-card__title i { color: var(--st-primary); }
.studio-card__extra { font-size: 12px; color: var(--st-text-3); }

/* ---------- 指标卡 ---------- */
.studio-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.studio-kpi {
    position: relative;
    background: var(--st-bg);
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    padding: 16px 18px 14px;
    box-shadow: var(--st-shadow);
    overflow: hidden;
}
.studio-kpi::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -18px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--st-primary-weak);
    opacity: .7;
}
.studio-kpi__label {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: var(--st-text-3);
    display: flex;
    align-items: center;
    gap: 6px;
}
.studio-kpi__value {
    position: relative;
    z-index: 1;
    margin-top: 8px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--st-text);
    letter-spacing: -.02em;
}
.studio-kpi__sub {
    position: relative;
    z-index: 1;
    margin-top: 6px;
    font-size: 11px;
    color: var(--st-text-3);
    display: flex;
    align-items: center;
    gap: 4px;
}
.studio-kpi--warn .studio-kpi__value { color: var(--st-warn); }
.studio-kpi--ok .studio-kpi__value { color: var(--st-success); }
.studio-kpi--danger .studio-kpi__value { color: var(--st-danger); }
.studio-kpi--warn::after { background: var(--st-warn-weak); }
.studio-kpi--ok::after { background: var(--st-success-weak); }
.studio-kpi--danger::after { background: var(--st-danger-weak); }

/* ---------- 按钮 ---------- */
.studio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: var(--st-radius-sm);
    border: 1px solid var(--st-line);
    background: #fff;
    color: var(--st-text-2);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    font-family: var(--st-font);
    white-space: nowrap;
}
.studio-btn:hover { background: var(--st-line-soft); color: var(--st-text); }
.studio-btn--primary {
    background: var(--st-primary);
    border-color: var(--st-primary);
    color: #fff;
}
.studio-btn--primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.studio-btn--ghost { background: var(--st-primary-weak); border-color: var(--st-primary-line); color: var(--st-primary); }
.studio-btn--ghost:hover { background: #dbeafe; color: #1d4ed8; }
.studio-btn--danger { background: var(--st-danger-weak); border-color: #fecaca; color: var(--st-danger); }
.studio-btn--sm { height: 26px; padding: 0 10px; font-size: 12px; }

/* ---------- 状态胶囊 ---------- */
.studio-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: var(--st-line-soft);
    color: var(--st-text-2);
    white-space: nowrap;
}
.studio-pill::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .8;
}
.studio-pill--ok { background: var(--st-success-weak); color: var(--st-success); }
.studio-pill--warn { background: var(--st-warn-weak); color: var(--st-warn); }
.studio-pill--danger { background: var(--st-danger-weak); color: var(--st-danger); }
.studio-pill--primary { background: var(--st-primary-weak); color: var(--st-primary); }

/* ---------- 迷你表格 ---------- */
.studio-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.studio-table th {
    text-align: left;
    font-weight: 500;
    color: var(--st-text-3);
    padding: 0 10px 8px;
    border-bottom: 1px solid var(--st-line);
    white-space: nowrap;
}
.studio-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--st-line-soft);
    color: var(--st-text-2);
    vertical-align: middle;
}
.studio-table tr:last-child td { border-bottom: 0; }
.studio-table td strong { color: var(--st-text); font-weight: 600; }

/* ---------- 趋势条 ---------- */
.studio-trend {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 132px;
    padding-top: 6px;
}
.studio-trend__item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    height: 100%;
}
.studio-trend__bar {
    width: 100%;
    max-width: 30px;
    background: var(--st-line-soft);
    border-radius: 5px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    height: 100%;
}
.studio-trend__bar i {
    display: block;
    width: 100%;
    border-radius: 5px 5px 0 0;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    transition: height .35s ease;
    min-height: 2px;
}
.studio-trend__num { font-size: 11px; color: var(--st-text-2); line-height: 1; }
.studio-trend__label { font-size: 10px; color: var(--st-text-3); line-height: 1; white-space: nowrap; }

/* ---------- 写作台：草稿状态 / 字数 ---------- */
.studio-editor-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--st-text-3);
}
.studio-editor-state i { font-size: 12px; }
.studio-editor-state.is-saving { color: var(--st-primary); }
.studio-editor-state.is-saved { color: var(--st-success); }
.studio-editor-state.is-fail { color: var(--st-danger); }

/* ---------- 前台文章增强 ---------- */
.studio-read-progress {
    position: fixed;
    left: 0;
    top: 0;
    height: 3px;
    width: 0;
    z-index: 9999;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    transition: width .08s linear;
    pointer-events: none;
}
.studio-toc {
    margin: 0 0 20px;
    padding: 14px 18px;
    border: 1px solid #e5e7eb;
    border-left: 3px solid #2563eb;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 13px;
}
.studio-toc__title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.studio-toc a {
    display: block;
    color: #475569;
    text-decoration: none;
    padding: 3px 0;
    line-height: 1.5;
}
.studio-toc a:hover { color: #2563eb; }
.studio-toc a.is-sub { padding-left: 16px; font-size: 12px; color: #64748b; }
.studio-article-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed #e5e7eb;
}
.studio-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
}
.studio-like-btn:hover { border-color: #bfdbfe; color: #2563eb; }
.studio-like-btn.is-liked { border-color: #bfdbfe; background: #eff6ff; color: #2563eb; }
.studio-like-btn i { font-size: 14px; }

@media (max-width: 1100px) {
    .studio-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .studio-kpis { grid-template-columns: 1fr; }
    .studio-card { padding: 14px; border-radius: 10px; }
    .studio-page-head { align-items: flex-start; }
}

/* ===== 1.0 UI 细节优化（后台写作台 / 审核台 / 看板） ===== */
.studio-page-head {
    padding: 2px 0 14px;
    border-bottom: 1px solid rgba(226, 232, 240, .75);
    margin-bottom: 16px;
}
.studio-page-head__title { letter-spacing: -.4px; }
.studio-card { transition: box-shadow .18s ease, border-color .18s ease; }
.studio-card:hover { border-color: #dbe4f0; box-shadow: 0 12px 30px rgba(15, 23, 42, .07); }
.studio-card__head { padding-bottom: 10px; }
.studio-kpi { transition: transform .16s ease, box-shadow .16s ease; }
.studio-kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 23, 42, .08); }
.studio-kpi__value { letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.studio-btn { transition: all .16s ease; }
.studio-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }
.studio-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: saturate(150%) blur(6px);
}
.studio-table tbody tr { transition: background .14s ease; }
.studio-table tbody tr:hover { background: #f8fbff; }
.studio-pill { font-weight: 500; }
.studio-empty { padding: 46px 16px; text-align: center; color: #94a3b8; }
.studio-empty i { display: block; font-size: 30px; color: #cbd5e1; margin-bottom: 8px; }

.blog-editor-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: linear-gradient(180deg, #fbfdff, #f8fafc);
    box-shadow: inset 0 1px 0 #fff;
}
.blog-editor-bar__stats { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #64748b; }
.blog-editor-bar__stat b { color: #0f172a; font-weight: 600; }
.blog-editor-bar__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.blog-editor-bar__btn {
    height: 28px;
    padding: 0 11px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
    transition: all .16s ease;
}
.blog-editor-bar__btn:hover { border-color: #bfdbfe; color: #2563eb; background: #f8fbff; }
.blog-editor-bar__btn--primary { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.blog-editor-bar__btn--primary:hover { background: #dbeafe; }

@media (max-width: 760px) {
    .blog-editor-bar { gap: 8px; padding: 9px 10px; }
    .blog-editor-bar__actions { margin-left: 0; width: 100%; }
    .blog-editor-bar__btn { flex: 1 1 auto; }
}
