/* ═══════════════════════════════════════════
   MIXYUE 移动端 — 统一 UI 布局系统
   基准：曲目详情页音乐 App 结构
   ═══════════════════════════════════════════ */

:root {
    --m-page-gutter: 20px;
}

/* ── 页面容器：统一左右留白 ── */
body.mobile-app .m-main {
    max-width: none;
    padding-left: max(var(--m-page-gutter), env(safe-area-inset-left, 0px));
    padding-right: max(var(--m-page-gutter), env(safe-area-inset-right, 0px));
}

body.mobile-app .m-app-page {
    min-height: 100%;
    padding-bottom: 8px;
}

/* ── Section 区块头 ── */
body.mobile-app .m-section {
    padding: 20px 0 8px;
}

body.mobile-app .m-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 14px;
}

body.mobile-app .m-section-title {
    margin: 0;
    padding: 0 0 14px;
    font-size: clamp(18px, 4.5vw, 22px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.25;
}

body.mobile-app .m-section-head .m-section-title {
    padding: 0;
}

body.mobile-app .m-section-more {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--app-text-secondary, rgba(255, 255, 255, 0.45));
    text-decoration: none;
}

body.mobile-app .m-section-more:active {
    color: var(--app-accent, #1db954);
}

/* ── 曲目列表：音乐 App 行（非表格） ── */
body.mobile-app .m-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
}

body.mobile-app .m-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border: none !important;
    border-radius: 12px;
    background: transparent;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

body.mobile-app .m-list-item:first-child {
    border-top: none !important;
}

body.mobile-app .m-list-item:active {
    background: rgba(255, 255, 255, 0.06);
}

/* 排行榜序号 */
body.mobile-app .m-list-rank {
    width: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.35);
}

body.mobile-app .m-list-item:nth-child(-n+3) .m-list-rank {
    color: var(--app-accent, #1db954);
}

body.mobile-app .m-list-cover {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
}

body.mobile-app .m-list-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.mobile-app .m-list-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

body.mobile-app .m-list-info-flex {
    flex: 1;
    min-width: 0;
}

body.mobile-app .m-list-title-truncate,
body.mobile-app .m-list-subtitle-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.mobile-app .m-list-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.mobile-app .m-list-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.mobile-app .m-list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

body.mobile-app .m-list-item > .fa-chevron-right {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.25);
    font-size: 12px;
}

/* 封面圆形（艺术家/头像） */
body.mobile-app .m-list-item--round .m-list-cover {
    border-radius: 50%;
}

/* ── 横向 Shelf（Spotify 发现区） ── */
body.mobile-app .m-shelf {
    margin-bottom: 8px;
}

body.mobile-app .m-shelf-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 4px;
}

/* 首页等 m-app-page 内：横向滑到边，但首尾卡片保留 gutter */
body.mobile-app .m-app-page .m-shelf-scroll {
    margin-left: calc(-1 * var(--m-page-gutter));
    margin-right: calc(-1 * var(--m-page-gutter));
    padding-left: max(var(--m-page-gutter), env(safe-area-inset-left, 0px));
    padding-right: max(var(--m-page-gutter), env(safe-area-inset-right, 0px));
    scroll-padding-inline: max(var(--m-page-gutter), env(safe-area-inset-left, 0px));
}

body.mobile-app .m-shelf-scroll::-webkit-scrollbar {
    display: none;
}

body.mobile-app .m-shelf-item {
    flex: 0 0 132px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
}

body.mobile-app .m-shelf-cover-link {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    color: inherit;
    text-decoration: none;
}

body.mobile-app .m-shelf-text-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

body.mobile-app .m-shelf-item--wide {
    flex-basis: 160px;
}

body.mobile-app .m-shelf-cover {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body.mobile-app .m-shelf-cover--round {
    border-radius: 50%;
}

body.mobile-app .m-shelf-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Shelf 封面播放钮 — 详见 mobile-play-btn.css */

body.mobile-app .m-shelf-title {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.mobile-app .m-shelf-meta {
    margin-top: 3px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 页面 Hero（专辑/艺人/排行） ── */
body.mobile-app .m-page-hero {
    position: relative;
    padding: calc(56px + env(safe-area-inset-top, 0px) + 20px) 24px 28px;
    text-align: center;
    overflow: hidden;
}

body.mobile-app .m-page-hero-bg {
    position: absolute;
    inset: -20%;
    background-size: cover;
    background-position: center;
    filter: blur(48px) saturate(1.3) brightness(0.5);
    transform: scale(1.1);
    pointer-events: none;
}

body.mobile-app .m-page-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(8, 10, 16, 0.2) 0%,
        rgba(8, 10, 16, 0.7) 70%,
        #080a10 100%);
    pointer-events: none;
}

body.mobile-app .m-page-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

body.mobile-app .m-page-hero-art {
    width: min(56vw, 220px);
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

body.mobile-app .m-page-hero-art--round {
    border-radius: 50%;
}

body.mobile-app .m-page-hero-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.mobile-app .m-page-hero-title {
    margin: 24px 0 0;
    font-size: clamp(22px, 6vw, 28px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.2;
    word-break: break-word;
}

body.mobile-app .m-page-hero-sub {
    margin: 8px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}

body.mobile-app .m-page-hero-desc {
    margin: 12px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.6;
    max-width: 320px;
}

body.mobile-app .m-page-hero-actions {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

body.mobile-app .m-page-hero-play {
    min-width: 140px;
    height: 48px;
    padding: 0 28px;
    border: none;
    border-radius: 999px;
    background: var(--app-accent, #1db954);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(29, 185, 84, 0.35);
    cursor: pointer;
}

body.mobile-app .m-page-hero-play:active {
    transform: scale(0.97);
}

/* ── 搜索页 ── */
body.mobile-app .m-search-page .m-search-sticky {
    position: sticky;
    top: calc(56px + env(safe-area-inset-top, 0px));
    z-index: 100;
    padding: 12px 20px;
    background: rgba(8, 10, 16, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.mobile-app .m-search-bar {
    padding: 0;
}

/* ── 空状态 ── */
body.mobile-app .m-empty-state {
    margin: 16px 20px;
    padding: 32px 20px;
    text-align: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

body.mobile-app .m-empty-icon {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 12px;
}

body.mobile-app .m-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
}

body.mobile-app .m-empty-desc {
    margin-top: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

/* ── 卡片 ── */
body.mobile-app .m-card {
    margin: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

/* ── 分页 ── */
body.mobile-app .m-pagination {
    padding: 16px 0 24px;
}

/* ── 首页专用 ── */
body.mobile-app .m-home-page .m-hero {
    padding: 8px 0 0;
}

body.mobile-app .m-home-page .m-hero-slider {
    margin: 0;
    border-radius: 16px;
    border: none;
}

body.mobile-app .m-home-greeting {
    padding: 16px 0 4px;
}

body.mobile-app .m-home-greeting-title {
    margin: 0;
    font-size: clamp(24px, 6.5vw, 30px);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1.15;
}

body.mobile-app .m-home-greeting-desc {
    margin: 6px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
}

body.mobile-app .m-home-chips {
    display: flex;
    gap: 8px;
    margin-left: calc(-1 * var(--m-page-gutter));
    margin-right: calc(-1 * var(--m-page-gutter));
    padding: 12px max(var(--m-page-gutter), env(safe-area-inset-right, 0px)) 4px max(var(--m-page-gutter), env(safe-area-inset-left, 0px));
    overflow-x: auto;
    scrollbar-width: none;
}

body.mobile-app .m-home-chips::-webkit-scrollbar {
    display: none;
}

body.mobile-app .m-home-chip {
    flex-shrink: 0;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body.mobile-app .m-home-chip:active,
body.mobile-app .m-home-chip.is-active {
    background: var(--app-accent-soft, rgba(29, 185, 84, 0.18));
    border-color: rgba(29, 185, 84, 0.35);
    color: var(--app-accent, #1db954);
}

body.mobile-app .m-home-page .m-genre-filter {
    padding: 8px 0 0;
}

body.mobile-app .m-home-page .m-genre-filter-btn {
    border-radius: 999px;
    height: 40px;
}

body.mobile-app .m-home-page .m-footer-links {
    margin-top: 24px;
    padding: 24px 0 32px;
}

/* 隐藏旧版首页 intro 块（若仍存在） */
body.mobile-app .m-home-intro {
    display: none;
}

/* ── 排行网格 ── */
body.mobile-app .m-chart-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
}

body.mobile-app .m-chart-card {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    color: inherit;
}

body.mobile-app .m-chart-card:active {
    background: rgba(255, 255, 255, 0.06);
}

body.mobile-app .m-chart-cover {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
}

body.mobile-app .m-chart-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.mobile-app .m-chart-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

body.mobile-app .m-chart-desc {
    margin-top: 3px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}

body.mobile-app .m-chart-arrow {
    color: rgba(255, 255, 255, 0.25);
    font-size: 12px;
}

/* ── 信息页 ── */
body.mobile-app .m-info-page .m-info-hero {
    padding: 32px 24px;
    text-align: center;
}

body.mobile-app .m-info-section {
    padding: 0 20px 24px;
}

body.mobile-app .m-contact-card {
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

/* ── 认证页 ── */
body.mobile-app.auth-page .m-main,
body.mobile-app .m-auth-page .m-main {
    padding-left: max(var(--m-page-gutter, 20px), env(safe-area-inset-left, 0px));
    padding-right: max(var(--m-page-gutter, 20px), env(safe-area-inset-right, 0px));
}

body.mobile-app .m-auth-card {
    border-radius: 20px;
    padding: 24px 20px;
}

/* ── 排行/流派旧 hero 转简洁 ── */
body.mobile-app .m-chart-hero,
body.mobile-app .m-genre-hero,
body.mobile-app .m-release-hero {
    margin: 0;
    padding: 20px 20px 16px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body.mobile-app .m-chart-hero-title,
body.mobile-app .m-genre-hero-title,
body.mobile-app .m-release-hero-title {
    font-size: clamp(26px, 7vw, 32px);
    font-weight: 800;
    letter-spacing: -0.03em;
}

body.mobile-app .m-chart-hero-desc,
body.mobile-app .m-genre-hero-desc,
body.mobile-app .m-release-hero-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
}

/* ── 筛选排序条 ── */
body.mobile-app .m-sort-bar {
    display: flex;
    gap: 8px;
    margin-left: calc(-1 * var(--m-page-gutter));
    margin-right: calc(-1 * var(--m-page-gutter));
    padding: 0 max(var(--m-page-gutter), env(safe-area-inset-right, 0px)) 12px max(var(--m-page-gutter), env(safe-area-inset-left, 0px));
    overflow-x: auto;
    scrollbar-width: none;
}

body.mobile-app .m-sort-bar::-webkit-scrollbar {
    display: none;
}

body.mobile-app .m-sort-chip {
    flex-shrink: 0;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

body.mobile-app .m-sort-chip.active {
    background: var(--app-accent-soft, rgba(29, 185, 84, 0.18));
    border-color: rgba(29, 185, 84, 0.35);
    color: var(--app-accent, #1db954);
}

body.mobile-app .m-filter-modal-content {
    background: rgba(13, 17, 23, 0.98);
    border-color: rgba(255, 255, 255, 0.08);
    border-radius: 20px 20px 0 0;
}
