/* ==========================================================================
   蝶梦 · 设计令牌（Design Tokens）
   --------------------------------------------------------------------------
   取自设计稿（CoDesign「蝶梦官网」，1440 栅格 / 2x 出图）实测色值。
   所有新页面的视觉变量集中在此，老页面（index.css）不受影响。
   ========================================================================== */

:root {
    /* ---------- 主色 ---------- */
    --bh-primary: #ff5453;          /* 主红：投稿按钮、HOT、选中态、更多按钮 */
    --bh-primary-hover: #ef4444;
    --bh-primary-light: #fff2f5;    /* 浅粉底：hover、侧栏选中 */
    --bh-primary-soft: #ffe8eb;

    --bh-blue: #68a0ed;             /* 辅助蓝：新手指南、更新中标签 */
    --bh-blue-light: #eaf2fe;

    /* ---------- 背景 ---------- */
    --bh-bg: #ffffff;
    --bh-bg-section: #f6f8fc;       /* 分区浅底：排行榜、作者专区 */
    --bh-bg-footer: #ecf0f4;        /* 页脚 */
    --bh-bg-input: #f3f3f4;         /* 搜索框 */
    --bh-bg-hover: #f7f8fa;

    /* ---------- 线条与文字 ---------- */
    --bh-border: #eaeaea;
    --bh-border-light: #f0f1f3;
    --bh-text: #1f2023;             /* 主文字 */
    --bh-text-sub: #696969;         /* 次级文字 */
    --bh-text-muted: #848492;       /* 弱化文字、数字 */
    --bh-text-placeholder: #b4b4bd;

    /* ---------- 状态色 ---------- */
    --bh-success: #52c41a;
    --bh-warning: #fa8c16;
    --bh-gold: #f5a623;             /* 金币、第一名徽章 */

    /* ---------- 圆角 ---------- */
    --bh-radius-xs: 4px;
    --bh-radius-sm: 6px;
    --bh-radius: 8px;
    --bh-radius-lg: 12px;
    --bh-radius-pill: 999px;

    /* ---------- 阴影 ---------- */
    --bh-shadow-sm: 0 1px 4px rgba(31, 32, 35, 0.04);
    --bh-shadow: 0 2px 12px rgba(31, 32, 35, 0.06);
    --bh-shadow-lg: 0 8px 28px rgba(31, 32, 35, 0.1);

    /* ---------- 栅格 ---------- */
    --bh-container: 1180px;         /* 内容区宽度（1440 设计稿实测） */
    --bh-header-h: 64px;
    --bh-gutter: 16px;

    /* ---------- 字体 ---------- */
    --bh-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

    /* ---------- 字号层级 ---------- */
    --bh-fs-xs: 12px;
    --bh-fs-sm: 13px;
    --bh-fs-base: 14px;
    --bh-fs-md: 15px;
    --bh-fs-lg: 16px;
    --bh-fs-xl: 18px;
    --bh-fs-2xl: 22px;

    /* ---------- 过渡 ---------- */
    --bh-transition: all 0.2s ease;
}

/* ---------- 设计语言基础重置（仅作用于 bh- 命名空间） ---------- */
.bh-page {
    /* body 默认有 8px 外边距，会让整站内容缩进一圈、右侧留白，
       并在 320px 等极小屏吃紧成横向滚动，这里一并清掉 */
    margin: 0;
    padding: 0;
    /* 页脚置底：整页至少一屏高，内容区吃掉剩余空间，页脚自然贴底；
       内容超长时整页随滚动增长，页脚跟在内容后面，不会遮挡 */
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--bh-font);
    font-size: var(--bh-fs-base);
    color: var(--bh-text);
    background: var(--bh-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bh-page *,
.bh-page *::before,
.bh-page *::after {
    box-sizing: border-box;
}

/* 内容区（各页面根节点）撑满头部与页脚之间的空间，实现 sticky footer */
.bh-page > main,
.bh-page > .bh-list,
.bh-page > .bh-wb {
    flex: 1 0 auto;
}

.bh-container {
    width: var(--bh-container);
    max-width: calc(100% - 48px);
    margin: 0 auto;
}

/* 通用按钮 */
.bh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 16px;
    border: none;
    border-radius: var(--bh-radius-pill);
    font-size: var(--bh-fs-sm);
    font-family: inherit;
    color: var(--bh-text-sub);
    background: var(--bh-bg-input);
    cursor: pointer;
    text-decoration: none;
    transition: var(--bh-transition);
    white-space: nowrap;
}

.bh-btn:hover {
    background: #ebebee;
    color: var(--bh-text);
}

.bh-btn--primary {
    background: var(--bh-primary);
    color: #fff;
}

.bh-btn--primary:hover {
    background: var(--bh-primary-hover);
    color: #fff;
}

.bh-btn--ghost {
    background: transparent;
    border: 1px solid var(--bh-border);
}

.bh-btn--ghost:hover {
    border-color: var(--bh-primary);
    color: var(--bh-primary);
    background: #fff;
}

/* 通用标签（状态/分类，工作台与后台共用） */
.bh-tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--bh-radius-xs);
    font-size: var(--bh-fs-xs);
    line-height: 1;
    white-space: nowrap;
    background: #f2f3f5;
    color: #7a7f87;
}

.bh-tag--blue {
    background: var(--bh-blue-light);
    color: #4a83d6;
}

.bh-tag--green {
    background: #eaf8ee;
    color: #3fa45b;
}

.bh-tag--red {
    background: var(--bh-primary-light);
    color: var(--bh-primary);
}

.bh-tag--orange {
    background: #fff5e6;
    color: #d98800;
}

/* 经典作品：金色（与红/蓝/绿一起构成四色状态体系） */
.bh-tag--gold {
    background: #fff6e0;
    color: #b8860b;
}
