/* =====================================================================
   Mings 全站视觉基座（H6，docs/15 §16.6）
   把首页 H3–H5 定稿的组件语言下沉给内页复用：紧凑照片页头、轻量标题条、
   圆角卡片、像素徽章、像素空态。全部走 Bootstrap 5 的 CSS 变量，明暗双主题
   自动跟随；不覆盖任何 Bootstrap 基类，只定义 .page-/.ms-/.empty- 自有类。
   ===================================================================== */

/* ---------- ① 紧凑照片页头（论坛/下载等信息型落地页） ----------
   用法：
   <header class="page-hero" style="--page-hero-img:url('指纹URL')">
     <div class="page-hero-veil" aria-hidden="true"></div>
     <div class="container page-hero-inner"><h1>..</h1><p>..</p></div>
     <svg class="page-hero-wave" ...></svg>
   </header> */
.page-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 2.8rem 0 3.6rem;
    background-image: var(--page-hero-img, none);
    background-size: cover;
    background-position: center;
    background-color: #1c3358; /* 图未就绪时的兜底深色，不发白 */
}
.page-hero-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg,
        rgba(8, 24, 52, .88) 0%, rgba(8, 24, 52, .72) 46%,
        rgba(8, 24, 52, .34) 100%);
}
:root[data-bs-theme='dark'] .page-hero-veil {
    background: linear-gradient(100deg,
        rgba(0, 0, 0, .90) 0%, rgba(0, 0, 0, .68) 48%,
        rgba(0, 0, 0, .36) 100%);
}
.page-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
}
.page-hero h1 {
    font-weight: 900;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    letter-spacing: .02em;
    margin: 0 0 .5rem;
    text-shadow: 0 3px 0 rgba(0, 0, 0, .28), 0 8px 22px rgba(0, 0, 0, .42);
}
.page-hero-sub {
    margin: 0;
    font-size: clamp(.95rem, 1.8vw, 1.08rem);
    color: rgba(255, 255, 255, .86);
    text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
/* 长标题页头（帖子详情：标题可达 200 字，需要更小字号与正常行距） */
.page-hero h1.is-long {
    font-size: clamp(1.3rem, 3.2vw, 1.85rem);
    line-height: 1.32;
    font-weight: 800;
    margin-bottom: 0;
}
.page-hero-wave {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    z-index: 2;
    width: 100%;
    height: 36px;
    display: block;
    fill: var(--bs-tertiary-bg);
}
@media (max-width: 575.98px) {
    .page-hero {
        padding: 2.2rem 0 3rem;
        background-position: center 30%;
    }
    .page-hero-veil {
        background: linear-gradient(to top,
            rgba(7, 20, 46, .94) 0%, rgba(7, 20, 46, .72) 60%,
            rgba(7, 20, 46, .42) 100%);
    }
    :root[data-bs-theme='dark'] .page-hero-veil {
        background: linear-gradient(to top,
            rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .72) 62%,
            rgba(0, 0, 0, .44) 100%);
    }
}

/* ---------- ② 轻量标题条（登录/发帖/个人中心等功能页，不抢内容） ----------
   用法：
   <main class="container page-main">
     <header class="page-head">
       <div><h1>..</h1><p class="page-sub">..</p></div>
       <img class="page-head-deco ms-pixel" src=.. alt="" >
     </header> */
.page-main {
    padding-block: 2.4rem 3rem;
}
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.05rem;
    border-bottom: 1px solid var(--bs-border-color);
}
.page-head h1 {
    font-weight: 800;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    margin: 0 0 .25rem;
}
.page-sub {
    margin: 0;
    color: var(--bs-secondary-color);
    font-size: .92rem;
}
.page-head-deco {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex: 0 0 auto;
    opacity: .92;
}
@media (max-width: 575.98px) {
    .page-head-deco {
        width: 40px;
        height: 40px;
    }
}

/* ---------- ③ 圆角卡片（首页 entry-card 的内页版） ---------- */
.ms-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--bs-body-bg);
}
.ms-card > .card-header,
.ms-card .ms-card-header {
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    padding: .95rem 1.25rem;
    font-weight: 700;
}
.ms-card .card-body,
.ms-card .ms-card-body {
    padding: 1.25rem;
}
/* 整张可点的卡（论坛版块行等）：悬浮上浮 + 焦点可见 */
.ms-card.is-linked {
    transition: transform .2s ease, box-shadow .2s ease;
}
@media (prefers-reduced-motion: no-preference) {
    .ms-card.is-linked:hover {
        transform: translateY(-3px);
        box-shadow: 0 .55rem 1.6rem rgba(0, 0, 0, .12);
    }
}
.ms-card.is-linked:focus-within {
    outline: .15rem solid rgba(var(--bs-warning-rgb), .65);
    outline-offset: 2px;
}

/* ---------- ④ 像素徽章（版块/功能入口的小格子图标） ---------- */
.pixel-badge {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: .6rem;
    background: rgba(var(--bs-secondary-rgb), .10);
    border: 1px solid rgba(var(--bs-secondary-rgb), .25);
}
.pixel-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.pixel-badge.is-sm {
    width: 32px;
    height: 32px;
    padding: 3px;
    border-radius: .5rem;
}

/* ---------- ⑤ 像素空态（不裸露空区，必有出路） ----------
   用法：
   <div class="empty-state">
     <img class="ms-pixel empty-state-icon" src=.. alt="" width=64 height=64>
     <h2 class="h6 fw-bold">暂无主题</h2>
     <p class="text-muted">..</p>
     <a class="btn btn-warning" ..>发第一帖</a>
   </div> */
.empty-state {
    text-align: center;
    padding: 3.2rem 1.25rem;
}
.empty-state-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: .9rem;
    opacity: .9;
}
.empty-state h2 {
    margin: 0 0 .4rem;
}
.empty-state p {
    margin: 0 auto 1.25rem;
    max-width: 34em;
}

/* ---------- ⑥ 内页表格：表头透明跟随主题（替掉发灰的 table-light） ---------- */
.ms-table {
    --bs-table-hover-bg: rgba(var(--bs-secondary-rgb), .08);
    margin: 0;
}
.ms-table thead th {
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}
.ms-table > :not(caption) > * > * {
    padding: .78rem 1rem;
    vertical-align: middle;
}

/* ---------- ⑦ 认证/表单页：居中窄卡 + 头顶像素蘑菇 ---------- */
.auth-wrap {
    max-width: 432px;
    margin: 0 auto;
}
.auth-mascot {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin: 0 auto .9rem;
}
.auth-card {
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-body-bg);
    padding: 1.6rem 1.5rem;
}
.auth-card .form-control:focus,
.auth-card .form-select:focus {
    box-shadow: 0 0 0 .22rem rgba(var(--bs-warning-rgb), .22);
    border-color: rgba(var(--bs-warning-rgb), .6);
}
.auth-foot {
    text-align: center;
    margin-top: 1.1rem;
    font-size: .9rem;
    color: var(--bs-secondary-color);
}

/* ---------- ⑦b 论坛：版块行/主题行 ---------- */
.board-row {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .95rem 1.15rem;
    border-bottom: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    text-decoration: none;
}
.board-row:last-child {
    border-bottom: 0;
}
.board-row:hover {
    background: rgba(var(--bs-secondary-rgb), .07);
    color: var(--bs-body-color);
}
.board-name {
    font-weight: 700;
}
.board-desc {
    font-size: .85rem;
    color: var(--bs-secondary-color);
    margin: .12rem 0 0;
}
.board-counts {
    flex: 0 0 auto;
    text-align: right;
    font-size: .82rem;
    color: var(--bs-secondary-color);
    line-height: 1.5;
    white-space: nowrap;
}
.topic-row:hover {
    background: rgba(var(--bs-secondary-rgb), .06);
}
.topic-stats {
    flex: 0 0 auto;
    font-size: .82rem;
    color: var(--bs-secondary-color);
    white-space: nowrap;
}

/* 照片页头内的版块图标格子（深底版，配色与 hero-pill 一致） */
.page-hero-badge {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    border-radius: .7rem;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .32);
}
.page-hero-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.page-hero-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-hero-head .page-hero-titles {
    flex: 1 1 16rem;
}

/* 照片页头内的面包屑/操作按钮 */
.page-crumb {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin-bottom: .6rem;
    font-size: .85rem;
    color: rgba(255, 255, 255, .85);
    text-decoration: underline rgba(255, 255, 255, .5);
    text-underline-offset: 3px;
}
.page-crumb:hover {
    color: #fff;
}
.page-hero .btn {
    position: relative;
    z-index: 1;
}

/* ---------- ⑧ 区块节奏与标题 ---------- */
.section-gap {
    margin-top: 2.2rem;
}
.section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    font-size: 1.05rem;
    margin: 0 0 1rem;
}

/* 焦点环统一暖色（与首页 card-cta 一致），键盘可达性 */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: .14rem solid rgba(var(--bs-warning-rgb), .7);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .ms-card.is-linked,
    .ms-card.is-linked:hover {
        transition: none;
        transform: none;
    }
}
