/* ============================================================
   MusicHub - mh-home.css
   P1 方形封面网格卡 + P2 首页五段式 + 每日精选轮播（dsding 规格）
   依赖 theme.css 的设计令牌（--mh-gold-, --mh-night-, --mh-site-width 这类变量）
   加载顺序在 theme.css 之后，因此本文件内的同权重规则生效
   ============================================================ */

/* ------------------------------------------------------------
   P1 · 方形封面网格卡（对齐 dsding AlbumCard）
   ------------------------------------------------------------ */
.mh-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}
.mh-sec-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--mh-text);
}
.mh-sec-bar { display: inline-block; width: 4px; height: 20px; flex: none; }
.mh-sec-bar-gold { background: var(--mh-gold-500, #f0c040); }
.mh-sec-bar-brand { background: #6d5df0; }
.mh-sec-more { font-size: 14px; color: var(--mh-text-secondary); }
.mh-sec-more:hover { color: var(--mh-gold-600, #d4a017); }
[data-theme='dark'] .mh-sec-more:hover { color: var(--mh-gold-400, #f2c94c); }

.mh-album-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}
.mh-album-card { display: block; text-decoration: none; }
.mh-album-cover {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--mh-border-light, #f3f4f6);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
[data-theme='dark'] .mh-album-cover { background: var(--mh-night-800, #1e293b); }
.mh-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.mh-album-card:hover .mh-album-cover img { transform: scale(1.05); }
.mh-album-format {
    position: absolute;
    left: 8px;
    top: 8px;
    background: rgba(0, 0, 0, 0.60);
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--mh-gold-400, #f2c94c);
}
.mh-album-caption { margin-top: 8px; padding: 0 2px; }
.mh-album-title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--mh-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mh-album-card:hover .mh-album-title { color: var(--mh-gold-600, #d4a017); }
[data-theme='dark'] .mh-album-card:hover .mh-album-title { color: var(--mh-gold-400, #f2c94c); }
.mh-album-artist {
    margin: 0 0 2px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--mh-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mh-album-meta {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--mh-text-muted);
    /* 对齐 dsding AlbumCard 第三行：flex + gap 6px，规格文本自己省略号截断，HR 角标 shrink-0 不被裁。
       原来用 -webkit-line-clamp:1 把整行（含角标）一起裁，规格补全后长取值会把角标挤没，故改结构。 */
    display: flex;
    align-items: center;
    gap: 6px;
}
.mh-album-meta-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mh-album-hr {
    flex: none;
    display: inline-block;
    background: var(--mh-gold-500, #f0c040);
    padding: 1px 4px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

@media (max-width: 1023px) { .mh-album-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767px)  { .mh-album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px)  { .mh-album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ------------------------------------------------------------
   P2 · 首页五段式：主体单列（无侧栏）+ 段间 40px
   ------------------------------------------------------------ */
body.mh-front-page .main-container {
    display: block;
    width: 100%;
    max-width: var(--mh-site-width, 1150px);
    margin: 0 auto;
}
body.mh-front-page .content-area { width: 100%; max-width: none; }
.mh-home-stack > .mh-sec + .mh-sec { margin-top: 40px; }

/* 精选厂牌：带边框白底区块，桌面 6 个一行 */
.mh-sec-boxed {
    border: 1px solid var(--mh-border);
    background: var(--mh-surface);
    padding: 20px;
}
.mh-labelcard-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}
.mh-labelcard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    padding: 12px;
    border: 1px solid transparent;
    text-align: center;
    text-decoration: none;
}
.mh-labelcard:hover { border-color: rgba(240, 192, 64, 0.40); background: var(--mh-surface-hover); }
.mh-labelcard-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    width: 100%;
    flex: none;
    overflow: hidden;
}
.mh-labelcard-logo img {
    height: 64px;
    width: auto;
    max-width: 140px;
    min-width: 0;
    object-fit: contain;
    display: block;
    border: none;
    border-radius: 0;
    background: transparent;
}
.mh-labelcard-ph { font-size: 24px; color: var(--mh-text-muted); }
.mh-labelcard-text { min-width: 0; display: block; }
.mh-labelcard-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--mh-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mh-labelcard:hover .mh-labelcard-name { color: var(--mh-gold-600, #d4a017); }
[data-theme='dark'] .mh-labelcard:hover .mh-labelcard-name { color: var(--mh-gold-400, #f2c94c); }
.mh-labelcard-intro {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--mh-text-secondary);
    white-space: normal;
    max-width: none;
}
@media (max-width: 1023px) { .mh-labelcard-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px)  { .mh-labelcard-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 独家 Hi-Res 专辑库通栏：满铺整行，底边与页脚上边框相接
   （页脚 margin-top 为 48px，这里用 -48px 抵消，实测与 dsding 一致＝零间隙）
   2026-10-16：对齐 iplayhifi —— sticky 悬浮在视口底部（类似顶部固定导航），
   首页往下滑动时始终贴在屏幕下缘，滑到页面真正底部时自然落位、让出页脚。 */
.mh-hires-band {
    position: sticky;
    bottom: 0;
    z-index: 99;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 40px;
    margin-bottom: -48px;
    border-top: 1px solid var(--mh-border);
    background: var(--mh-surface);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}
.mh-hires-inner {
    max-width: var(--mh-site-width, 1150px);
    margin: 0 auto;
    padding: 16px var(--mh-site-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    /* 对齐 iplayhifi：任何视口都保持「左图标 | 中两行文字 | 右按钮」一行不换行 */
    flex-wrap: nowrap;
}
.mh-hires-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 auto; }
.mh-hires-icon { width: 40px; height: 40px; flex: none; display: block; }
.mh-hires-copy { min-width: 0; }
.mh-hires-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--mh-text); }
.mh-hires-desc { margin: 2px 0 0; font-size: 14px; color: var(--mh-text-secondary); }
.mh-hires-desc-m { display: none; }
.mh-hires-btn {
    flex: none;
    border: 1px solid var(--mh-border);
    padding: 10px 24px;
    font-size: 14px;
    color: var(--mh-text-secondary);
    text-decoration: none;
}
.mh-hires-btn:hover { border-color: var(--mh-gold-500, #f0c040); color: var(--mh-gold-600, #d4a017); }
[data-theme='dark'] .mh-hires-btn:hover { color: var(--mh-gold-400, #f2c94c); }

/* ------------------------------------------------------------
   P2 · 每日精选轮播：改为 dsding 首页轮播规格（通栏、桌面定高 530px）
   沿用主题既有类名与 theme.js 分页逻辑，仅重画外观
   ------------------------------------------------------------ */
.daily-featured {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    height: 530px;
    min-height: 530px;
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 24px;
    isolation: isolate;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.daily-featured-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(10, 10, 18, 0.35);
}
.daily-featured-inner {
    position: relative;
    z-index: 2;
    max-width: 1118px;
    margin: 0 auto;
    height: 100%;
    padding: 74px 0 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.daily-featured-header {
    position: absolute;
    top: 30px;
    left: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 6;
}
.daily-featured-title {
    position: static;
    display: flex;
    align-items: center;       /* ::before 黄线 + 文字 垂直居中：文字水平中线与竖线中点绝对统一 */
    gap: 10px;
    padding: 0;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}
.daily-featured-title::before {
    content: "";
    /* theme.css 这条原本是 position:absolute + transform:translateY(-50%)。
       上一轮只把 position 改成 static 让 gap 生效，那句 transform 却还在生效——
       黄线被整体抬走半根高度（12px），实测中心线比文字高 13px。
       这里必须显式清掉 transform；position 用 relative 只是为了能对黄线做 1px 光学微调。 */
    position: relative;
    transform: none;
    top: 1px;                  /* 光学对齐：CJK 字面（墨迹）中心天生比行盒中心低约 1px */
    display: block;
    flex-shrink: 0;            /* 防止黄线被压缩 */
    width: 5px;
    height: 24px;
    border-radius: 3px;
    background: var(--mh-gold-500, #f0c040);
    box-shadow: 0 0 10px rgba(240, 192, 64, 0.5);
}
.daily-featured-track { position: relative; width: 100%; }
.daily-featured-grid {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-content: start;
}
/* 首屏预隐藏（修复打开首页瞬间所有精选卡挤成一屏的闪烁）：
   theme.js 在页脚执行前，浏览器已把 PHP 输出的全部卡片绘制一次。这里在与 theme.js
   完全相同的断点上，先按「每屏张数」只放行第一屏的卡，杜绝闪烁；
   JS 初始化后会给每张卡写显式行内 display(flex/none)，优先级高于本规则，翻页不受影响。 */
@media (min-width: 1280px) {
    .daily-featured-card:nth-child(n+5) { display: none; }
}
@media (min-width: 821px) and (max-width: 1279px) {
    .daily-featured-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .daily-featured-card:nth-child(n+4) { display: none; }
}
@media (max-width: 820px) {
    .daily-featured-grid { grid-template-columns: 1fr; }
    .daily-featured-card:nth-child(n+2) { display: none; }
}
.daily-featured-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    padding: 12px 10px 10px;
    border-radius: 0;
    background: rgba(15, 15, 25, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.daily-featured-card:hover {
    transform: translateY(-3px);
    border-color: rgba(201, 168, 76, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color: #fff;
}
.daily-featured-card-glass { padding: 0; background: transparent; }
.daily-featured-meta { margin: 0; }
.daily-featured-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--mh-gold-400, #f2c94c);
    letter-spacing: 0.5px;
}
.daily-featured-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.daily-featured-excerpt {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.daily-featured-cover {
    position: relative;
    width: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin: 0 -10px -10px;
}
.daily-featured-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.daily-featured-arrow {
    position: absolute;
    top: 50%;
    /* 圆本身严格居中（原来手补的 -2px 是把圆整体挪走，治不了字面偏移，已去掉） */
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.30);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 46px;
    line-height: 1;
    /* 字面居中：flex 居中的是「行盒」，而 ‹ › 的墨迹（看得见的那部分）
       天生比行盒中心低约 0.11em，于是箭头看着偏下。
       用下内边距把内容盒上提一半（0.22em ÷ 2 = 0.11em）抵消掉；
       用 em 而不是 px，≤820 断点把字号降到 40px 时同样自动对准。 */
    padding: 0 0 0.22em;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
    transition: background 0.2s ease, border-color 0.2s ease;
}
.daily-featured-arrow:hover {
    background: rgba(201, 168, 76, 0.7);
    border-color: rgba(201, 168, 76, 0.7);
}
.daily-featured-prev { left: calc(50% - 615px); right: auto; }
.daily-featured-next { right: calc(50% - 615px); left: auto; }
.daily-featured-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 30px;
    margin-top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 6;
}
.daily-featured-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    padding: 0;
    box-shadow: none;
    transition: background 0.25s ease, width 0.25s ease, border-radius 0.25s ease;
}
.daily-featured-dot:hover { background: rgba(255, 255, 255, 0.7); }
.daily-featured-dot.active {
    width: 42px;
    height: 14px;
    border-radius: 999px;
    background: #c9a84c;
    box-shadow: none;
}

/* 窄视口：箭头收进轮播图内侧，避免超出屏幕被裁切 */
@media (max-width: 1280px) {
    .daily-featured-prev { left: 12px; }
    .daily-featured-next { right: 12px; }
    .daily-featured-arrow { width: 48px; height: 48px; font-size: 40px; }
}

/* 平板/手机：高度自适应，标题与分页点回到文档流（避免定高留白）
   每屏张数（4/3/1）由 theme.js 按视口写入行内 grid-template-columns，此处不再覆盖列数
   断点 1279px：对齐 iplayhifi（821~1279 每屏 3 张，卡片仍为竖排） */
@media (max-width: 1279px) {
    .daily-featured { height: auto; min-height: 0; }
    .daily-featured-inner { height: auto; padding: 24px 14px; }
    .daily-featured-header { position: static; align-self: flex-start; margin-bottom: 14px; }
    .daily-featured-dots { position: static; margin-top: 18px; }
    .daily-featured-card { min-width: 0; }
    /* 卡片被网格拉高时封面不再跟着拉伸：保持正方形（iplayhifi 同款） */
    .daily-featured-cover { flex: 0 0 auto; }
    /* theme.css 旧规则在 ≤1024 隐藏了箭头；iplayhifi 在 821~1024 仍显示箭头，这里恢复 */
    .daily-featured-arrow { display: flex; }
}

/* ============================================================
   2026-10-16 对齐 iplayhifi.com：每日精选 + Hi-Res 专辑库
   手机端 / 平板端响应式改版（仅影响这两个模块）
   ============================================================ */

/* ---------- 独家 Hi-Res 专辑库 ----------
   全断点保持一行：最左图标 → 紧贴右侧上下两行文字（上=加粗标题，下=正文）→ 最右侧方框按钮。
   ≤540（手机）：按 iplayhifi 收紧图标/字号/按钮，正文切换为短版（可在后台单独编辑）。 */
@media (max-width: 540px) {
    .mh-hires-inner { padding: 12px var(--mh-site-padding); gap: 4px; }
    .mh-hires-left { gap: 4px; }
    .mh-hires-icon { width: 36px; height: 36px; }
    .mh-hires-title { font-size: 17px; line-height: 17px; }
    .mh-hires-desc  { font-size: 12px; line-height: 1.5; }
    .mh-hires-desc-pc { display: none; }
    .mh-hires-desc-m  { display: block; }
    .mh-hires-btn {
        padding: 8px 14px;
        font-size: 14px;
        font-weight: 700;
        border-radius: 3px;
        text-align: center;
    }
}

/* ---------- 每日精选 ≤820（手机 / 小平板）：每屏 1 张主卡 + 右侧露出下一张一条边 ----------
   对齐 iplayhifi ≤820：左侧方形封面，紧贴右侧为日期 + 加粗标题 + 正文（上下排布）；
   箭头隐藏（靠左右滑动/自动轮播），卡片下方保留胶囊分页点（活动项为长胶囊，样式同桌面端，尺寸收紧）。 */
@media (max-width: 820px) {
    .daily-featured { padding: 5vw 0; height: auto; min-height: 0; }
    .daily-featured-inner { height: auto; padding: 0 4vw; }
    .daily-featured-header { margin-bottom: 3vw; }
    .daily-featured-title { font-size: 18px; }
    .daily-featured-arrow { display: none; }
    .daily-featured-dots { position: static; display: flex; margin-top: 4vw; }
    /* 胶囊点收紧：普通 8px 圆点、活动 24px 胶囊，20 页也不会挤爆一行 */
    .daily-featured-dot { width: 8px; height: 8px; }
    .daily-featured-dot.active { width: 24px; height: 8px; }
    .daily-featured-dots { gap: 6px; }
    /* 主卡 + 露头的下一张：轨道裁掉屏幕外部分，两卡之间留 12px 缝（iplayhifi spaceBetween 同款） */
    .daily-featured-track { overflow: hidden; }
    .daily-featured-grid { gap: 12px; }
    .daily-featured-card {
        flex-direction: row;
        align-items: flex-start;
        gap: 3vw;
        min-height: 0;
        padding: 3vw;
        border-radius: 6px;
        background: rgba(0, 0, 0, 0.35);
        border-color: transparent;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.58);
    }
    .daily-featured-card:hover { transform: none; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.58); }
    /* 封面移到最左：DOM 里 glass(文字) 在前、cover 在后，用 order 交换 */
    .daily-featured-cover {
        order: -1;
        flex: 0 0 22%;
        width: 22%;
        margin: 0;
        aspect-ratio: 1 / 1;
        border-radius: 4px;
    }
    .daily-featured-cover img { object-fit: cover; }
    .daily-featured-card-glass { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
    .daily-featured-meta { margin: 0; }
    .daily-featured-date { font-size: 14px; }
    .daily-featured-card-title { font-size: 22px; line-height: 1.4em; -webkit-line-clamp: 1; }
    .daily-featured-excerpt { font-size: 14px; line-height: 1.5em; -webkit-line-clamp: 3; }
}

/* ≤640：标题 18px，正文 2 行（iplayhifi 同断点） */
@media (max-width: 640px) {
    .daily-featured-card-title { font-size: 18px; }
    .daily-featured-excerpt { -webkit-line-clamp: 2; }
}

/* ≤540：封面列加宽到 23%，卡片内距 24px，正文 13px（iplayhifi 同断点） */
@media (max-width: 540px) {
    .daily-featured-card { padding: 24px; }
    .daily-featured-cover { flex-basis: 23%; width: 23%; }
    .daily-featured-card-title { font-size: 18px; }
    .daily-featured-excerpt { font-size: 13px; line-height: 1.4em; }
}

/* ≤480：封面列 1:2，内距 4vw，标题 16px、正文 12px 2 行、日期 12px（iplayhifi 同断点） */
@media (max-width: 480px) {
    .daily-featured-card { padding: 4vw; }
    .daily-featured-cover { flex-basis: 33.3%; width: 33.3%; }
    .daily-featured-card-title { font-size: 16px; }
    .daily-featured-excerpt { font-size: 12px; -webkit-line-clamp: 2; }
    .daily-featured-date { font-size: 12px; }
}
