/* ==========================================================================
   home.css —— 主页（index.html）专用 Bento 视觉层
   --------------------------------------------------------------------------
   ⚠️ 这个文件**只被 index.html 引用**。
      index.css 与 404.html 共用，绝对不要往里加主页样式（会污染 404）。

   引用顺序：index.css → home.css
   所有新增类一律带 hp- 前缀，保证与 index.css 零冲突。
   小图标继续复用 index.css 里的 .icon-*（base64 内嵌，离线可用），
   这里只负责把它们的尺寸压进圆角底托。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌（与 daoban.css 第 9 节同一套）
   -------------------------------------------------------------------------- */
:root {
    --hp-brand: #957EDB;
    --hp-brand-dark: #7252D1;
    --hp-brand-light: #B8A7EC;
    --hp-brand-soft: #F4F2FB;
    --hp-brand-line: #E6E0F7;
    --hp-ink: #18181B;
    --hp-ink-2: #3F3F46;
    --hp-muted: #71717A;
    --hp-muted-2: #A1A1AA;
    --hp-bg: #FAFAFA;
    --hp-surface: #fff;
    --hp-line: #EFEFF1;
    --hp-r-card: 24px;
    --hp-r-inner: 16px;
    --hp-r-chip: 13px;
    --hp-gap: 16px;
    --hp-sh: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
    --hp-sh-hi: 0 2px 6px rgba(0, 0, 0, .05), 0 18px 44px rgba(0, 0, 0, .11);
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--hp-bg) !important;
    font-size: 14px !important;
    color: var(--hp-ink);
    -webkit-font-smoothing: antialiased;
}

/* 覆盖 index.css 里 footer 的绝对定位等历史包袱（本页不再使用 .footer） */
.hp-page a {
    text-decoration: none;
}

.hp-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 20px calc(40px + env(safe-area-inset-bottom));
}

/* --------------------------------------------------------------------------
   2. Bento 网格
   -------------------------------------------------------------------------- */
.hp-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--hp-gap);
}

.hp-grid + .hp-grid {
    margin-top: var(--hp-gap);
}

.hp-c2 {
    grid-column: span 2;
}

.hp-c4 {
    grid-column: span 4;
}

/* 3 列版（R8：「软件入口按三个一行」）
   R9：宝武聊天提到首行后，这里装 8 张软件卡 + 1 张「更多入口」= 9 项 → 3 行(3+3+2)，
   「更多入口」排最后一个，靠 grid-column-end:-1 吃满本行剩下的格子（动态，不用改 CSS）。 */
.hp-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 2 列版（错误页常用入口：删掉「小软件便利店」后剩 2 张卡） */
.hp-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hp-c3 {
    grid-column: span 3;
}

/* --------------------------------------------------------------------------
   3. 首屏 hero：全宽只读品牌横幅（不可点、无按钮）
   -------------------------------------------------------------------------- */
.hp-hero {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 34px;
    padding: 28px 34px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(120deg, var(--hp-brand) 0%, var(--hp-brand-dark) 100%);
    border-radius: var(--hp-r-card);
    box-shadow: 0 10px 30px rgba(114, 82, 209, .22);
}

.hp-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -110px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
    pointer-events: none;
}

.hp-hero__mark {
    display: flex;
    flex: none;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.hp-hero__logo {
    display: grid;
    flex: none;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .28);
}

.hp-hero__logo svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hp-hero__name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .2px;
    white-space: nowrap;
}

.hp-hero__sub {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, .72);
    white-space: nowrap;
}

.hp-hero__txt {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.hp-hero__title {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.8px;
}

.hp-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* 版本 + 稳定运行时间：毛玻璃胶囊（半透明白 + 细描边 + 绿点脉冲） */
.hp-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .96);
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .26);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hp-pill b {
    font-weight: 700;
}

.hp-pill__dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #5BE49B;
    box-shadow: 0 0 0 3px rgba(91, 228, 155, .22);
}

.hp-pill__sep {
    opacity: .6;
}

/* --------------------------------------------------------------------------
   4. 分区标题
   -------------------------------------------------------------------------- */
.hp-sec {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 11px;
    padding: 26px 0 16px;
    text-align: center;
}

.hp-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.3px;
    color: var(--hp-brand-dark);
    background: var(--hp-brand-soft);
    border: 1px solid var(--hp-brand-line);
}

.hp-sec h2 {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.6px;
}

/* --------------------------------------------------------------------------
   5. 应用卡
   -------------------------------------------------------------------------- */
.hp-app {
    display: flex;
    flex-direction: column;
    padding: 20px;
    color: inherit;
    background: var(--hp-surface);
    border: 1px solid var(--hp-line);
    border-radius: var(--hp-r-card);
    box-shadow: var(--hp-sh);
    cursor: pointer;
    transition: transform .28s cubic-bezier(.22, .61, .36, 1), box-shadow .28s, border-color .28s;
}

.hp-app:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: var(--hp-brand-line);
    box-shadow: var(--hp-sh-hi);
}

.hp-app__ic {
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: var(--hp-r-chip);
    background: #F6F6F8;
    border: 1px solid var(--hp-line);
}

.hp-app__ic i {
    display: block;
    width: 26px;
    height: 26px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* R11：用户提供的位图 logo（员工操作支持 / 宝武聊天 / 中国宝武学习系统）
   与内联语义图标（劳保/规程/设备/个税）统一走这套尺寸，放进既有的圆角底托。 */
.hp-app__img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 7px;
}

.hp-app__svg {
    display: block;
    width: 26px;
    height: 26px;
    fill: none;
    stroke: #52525B;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* R12：劳保/规程/设备/门禁 四个语义图标统一用品牌紫，与站点主色协调（见 index.html） */
.hp-app__svg--brand {
    stroke: var(--hp-brand);
}

/* 个税：用官方税务绿，区别于中性灰的其它图标 */
.hp-app__svg--tax {
    stroke: #16A34A;
}

/* featured 大卡的底托更大（52px），里面的图标也跟着放大 */
.hp-app--feat .hp-app__img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

/* featured 卡里图标+标题+说明被包在一个 <span> 里（为了 flex 的 space-between），
   那层包裹是 inline，里面的 span 就必须显式 block，否则标题和说明会挤在一行 */
.hp-app__body {
    display: block;
}

.hp-app__nm {
    display: block;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -.1px;
}

.hp-app__host {
    display: block;
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--hp-muted-2);
}

/* 5.1 featured 大卡 */
.hp-app--feat {
    justify-content: space-between;
    min-height: 168px;
    padding: 24px;
    color: #fff;
    background: var(--hp-ink);
    border-color: var(--hp-ink);
}

.hp-app--feat:hover {
    border-color: var(--hp-ink);
}

.hp-app--feat .hp-app__ic {
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .18);
}

.hp-app--feat .hp-app__ic i {
    width: 32px;
    height: 32px;
}

.hp-app--feat .hp-app__nm {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.5px;
}

.hp-app--feat .hp-app__host {
    margin-top: 6px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .62);
}

.hp-app--feat .hp-app__go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--hp-brand-light);
}

.hp-app--feat .hp-app__go svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 紫色 featured（本站主入口） */
.hp-app--violet {
    background: linear-gradient(140deg, var(--hp-brand) 0%, var(--hp-brand-dark) 100%);
    border-color: transparent;
}

.hp-app--violet:hover {
    border-color: transparent;
}

/* 站点自己的 logo 本身就是紫的，放在半透明底托上会「紫吃紫」，
   这里换成不透明白底托，logo 才看得见 */
.hp-app--violet .hp-app__ic {
    background: rgba(255, 255, 255, .94);
    border-color: transparent;
}

.hp-app--violet .hp-app__host {
    color: rgba(255, 255, 255, .78);
}

.hp-app--violet .hp-app__go {
    color: #fff;
}

/* 宝武蓝（R8）：《宝武视觉识别规范》标准色 宝武蓝 #004B9D（PANTONE 287C / RGB 0,75,157）。
   同一排里唯一的彩色卡，作为「宝武聊天App」的视觉锚点；渐变只做同色相的明暗（#0A61B8 → #004B9D），
   与紫色 featured 卡同一套处理手法，不引入新色相。 */
.hp-app--baowu {
    color: #fff;
    background: linear-gradient(140deg, #0A61B8 0%, #004B9D 100%);
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(0, 75, 157, .14), 0 10px 26px rgba(0, 75, 157, .22);
}

.hp-app--baowu:hover {
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(0, 75, 157, .18), 0 18px 44px rgba(0, 75, 157, .3);
}

/* 图标底托换成近白（同 violet 的处理）：彩色 logo 放半透明蓝底上会「蓝吃蓝」 */
.hp-app--baowu .hp-app__ic {
    background: rgba(255, 255, 255, .95);
    border-color: transparent;
}

.hp-app--baowu .hp-app__nm {
    color: #fff;
}

.hp-app--baowu .hp-app__host {
    color: rgba(255, 255, 255, .74);
}

/* 5.2 敬请期待 / 更多入口
   R8：整行通栏，但要压扁成一条 —— 原本 104px 高的空占位太费地方。
   R9：改成**动态吃满本行剩余格**：grid-column-end:-1 让它从自己自动排到的列一直拉到本行最后一列。
        同排还剩 1 格 → 占 1 格；还剩 2 格 → 占 2 格；自己独占一行 → 通栏 3 格（= R8 的效果）。
       行高由同排的软件卡决定（align-self 默认 stretch），所以不会再「矮得突兀」。 */
.hp-app--soon {
    grid-column-end: -1;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 0;
    padding: 15px 20px;
    text-align: center;
    background: #FCFCFD;
    border-style: dashed;
    border-color: #E4E4E7;
    box-shadow: none;
    cursor: default;
}

.hp-app--soon:hover {
    transform: none;
    border-color: #E4E4E7;
    box-shadow: none;
}

.hp-app--soon .hp-app__ic {
    width: 34px;
    height: 34px;
    margin: 0;
    background: #F4F4F5;
    border-color: transparent;
}

.hp-app--soon .hp-app__ic svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: #C4C4C8;
    stroke-width: 2;
    stroke-linecap: round;
}

.hp-app--soon .hp-app__nm {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--hp-muted-2);
}

/* 5.3 横向排版（个税那种宽卡） */
.hp-app--row {
    justify-content: center;
}

.hp-app--row .hp-app__in {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hp-app--row .hp-app__ic {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   6. 页脚（深色）：小标签 + 发丝分隔线；ICP 居中
   -------------------------------------------------------------------------- */
.hp-foot {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 26px;
    color: #fff;
    background: var(--hp-ink);
    border-radius: var(--hp-r-card);
}

.hp-fsec {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .09);
}

.hp-fsec:first-child {
    padding-top: 0;
    border-top: 0;
}

/* 页脚：ICP 号一行、署名+版权一行，居中且无小标题 */
.hp-fsec--c {
    text-align: center;
}

/* 两行共用同一套字体口径：字号/字重/行高/数字等宽全部一致（「字体统一」） */
.hp-icp,
.hp-credits {
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: .2px;
    font-variant-numeric: tabular-nums;
}

.hp-icp a {
    color: var(--hp-brand-light);
    text-decoration: none;
    transition: color .18s ease;
}

.hp-icp a:hover {
    color: #fff;
}

.hp-credits {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0 9px;
    margin-top: 2px;
    color: rgba(255, 255, 255, .58);
}

/* 分隔符最淡、版权最弱 —— 与倒班页页脚同一套层级 */
.hp-credits .hp-sep {
    color: rgba(255, 255, 255, .2);
}

.hp-cop {
    color: rgba(255, 255, 255, .38);
}

/* --------------------------------------------------------------------------
   7. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .hp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    /* ⚠️ .hp-grid--3 / .hp-c3 必须在这里再写一遍：
       base 里的定义排在媒体查询之前，同权重「后者胜」，不重申就会被 .hp-grid 的 2 列接管。 */
    .hp-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .hp-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .hp-c4,
    .hp-c3 {
        grid-column: span 2;
    }
    /* 首行 3 张主卡在 2 列网格下会剩半行空格（3 = 2 + 1）→
       让第 3 张（宝武聊天）占满整行，不留洞。 */
    .hp-grid--3 > .hp-app--feat:nth-child(3) {
        grid-column: span 2;
    }
    .hp-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 24px;
    }
    .hp-hero__title {
        font-size: 24px;
    }
}

@media (max-width: 560px) {
    .hp-page {
        padding: 16px 14px calc(32px + env(safe-area-inset-bottom));
    }
    .hp-grid {
        gap: 12px;
    }
    .hp-grid + .hp-grid {
        margin-top: 12px;
    }
    .hp-app {
        padding: 17px;
        border-radius: 19px;
    }
    .hp-hero {
        gap: 15px;
        padding: 20px;
        border-radius: 19px;
    }
    .hp-hero__logo {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }
    .hp-hero__logo svg {
        width: 19px;
        height: 19px;
    }
    .hp-hero__name {
        font-size: 14.5px;
    }
    .hp-hero__sub {
        font-size: 11px;
    }
    .hp-hero__title {
        font-size: 21px;
        letter-spacing: -.5px;
    }
    .hp-pill {
        gap: 7px;
        padding: 6px 12px;
        font-size: 11.5px;
    }
    .hp-sec {
        padding: 18px 0 12px;
    }
    .hp-sec h2 {
        font-size: 20px;
    }
    .hp-app--feat {
        min-height: 0;
        padding: 19px;
    }
    .hp-app--feat .hp-app__nm {
        font-size: 18px;
    }
    .hp-app--feat .hp-app__ic {
        width: 46px;
        height: 46px;
        margin-bottom: 13px;
    }
    .hp-app--feat .hp-app__ic i {
        width: 28px;
        height: 28px;
    }
    .hp-foot {
        gap: 14px;
        padding: 19px;
        border-radius: 19px;
    }
}

@media (max-width: 360px) {
    .hp-app__nm {
        font-size: 14px;
    }
    .hp-app__host {
        font-size: 11.5px;
    }
    .hp-hero__title {
        font-size: 19px;
    }
}

