/* 移动端基础样式 - 核心文件 */
/* 版本: v1.0 */
/* 说明: 此文件包含移动端所有基础样式，从 base.html 提取 */

/* CSS变量定义 */
:root {
    --app-bg-primary: #0a0e17;
    --app-bg-secondary: #0f1419;
    --app-surface: #151b26;
    --app-surface-hover: #1a2130;
    --app-border: rgba(255,255,255,.06);
    --app-text-primary: #f1f5f9;
    --app-text-secondary: #94a3b8;
    --app-text-tertiary: #64748b;
    --app-accent: #ff3b30;
    --app-accent-hover: #ff5f57;
    --app-success: #10b981;
    --app-warning: #f59e0b;
}

/* 全局基础样式 - 仅移动端 */
* { 
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* 移动端Body样式 */
body.mobile-app {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--app-text-primary);
    background: var(--app-bg-primary);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.1px;
    -webkit-text-size-adjust: 100%;
    padding-bottom: 0;
    width: 100%;
    overflow-x: hidden;
}

/* 主容器 */
.m-main {
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    padding-top: calc(56px + env(safe-area-inset-top));
    padding-bottom: calc(66px + var(--mx-safe-bottom, env(safe-area-inset-bottom)));
    min-height: 100vh;
    overflow-x: hidden;
}

/* 头部导航 */
.m-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: 56px;
    padding: env(safe-area-inset-top) 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10,14,23,.95);
    border-bottom: 1px solid var(--app-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1300;
    box-sizing: border-box;
}

.m-header-left, .m-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.m-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--app-text-primary);
    font-weight: 800;
}

.m-logo-image {
    height: 30px;
}

.m-logo-mark {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.m-logo-svg {
    width: 28px;
    height: 28px;
    display: block;
}

.m-logo-text {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.m-icon-btn, .m-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.08);
    color: var(--app-text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all .2s;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.m-icon-btn:active, .m-back-btn:active {
    background: rgba(255,255,255,.12);
    transform: scale(.95);
}

.m-user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255,255,255,.35);
    box-shadow: 0 2px 8px rgba(2,6,23,.35);
}

.m-cart-btn {
    position: relative;
    overflow: visible;
}

.m-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.25);
    background: linear-gradient(135deg,#ff6b64,#ff3b30);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 10px rgba(255,59,48,.35);
    z-index: 2;
}

/* 区块和标题 */
.m-section {
    padding: 20px 16px 16px;
    max-width: 100%;
    box-sizing: border-box;
}

.m-section-title {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--app-text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.is-hidden {
    display: none !important;
}

/* 通知提示 */
.notification {
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(env(safe-area-inset-top) + 74px);
    z-index: 2000;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,.28);
    background: rgba(15,23,42,.95);
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 10px 26px rgba(2,6,23,.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transform: translateY(-10px);
    opacity: 0;
    transition: opacity .22s ease, transform .22s ease;
    pointer-events: none;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.notification-success {
    border-color: rgba(52,211,153,.35);
    background: linear-gradient(135deg, rgba(6,78,59,.94), rgba(17,24,39,.96));
    color: #d1fae5;
}

.notification.notification-warning {
    border-color: rgba(251,191,36,.38);
    background: linear-gradient(135deg, rgba(120,53,15,.94), rgba(17,24,39,.96));
    color: #fef3c7;
}

.notification.notification-error {
    border-color: rgba(248,113,113,.38);
    background: linear-gradient(135deg, rgba(127,29,29,.94), rgba(17,24,39,.96));
    color: #fee2e2;
}

.notification.notification-info {
    border-color: rgba(96,165,250,.38);
    background: linear-gradient(135deg, rgba(30,64,175,.92), rgba(17,24,39,.96));
    color: #dbeafe;
}

/* 卡片和列表 */
.m-card {
    border-radius: 12px;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    padding: 16px;
    box-shadow: 0 18px 44px rgba(2, 6, 23, 0.44), inset 0 1px 0 rgba(255,255,255,0.08);
}

.m-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.m-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--app-border);
    text-decoration: none;
    transition: background .2s;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.m-list-item:first-child {
    border-top: 1px solid var(--app-border);
}

.m-list-item:active {
    background: rgba(255,255,255,.03);
}

.m-list-cover {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--app-bg-secondary);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    border: 1px solid rgba(148,163,184,.25);
}

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

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

.m-list-title {
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--app-text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.m-list-subtitle {
    font-size: 13px;
    line-height: 1.2;
    color: var(--app-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.m-list-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* 徽章和按钮 */
.m-badge {
    height: 20px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    background: rgba(255,255,255,.08);
    color: var(--app-text-secondary);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.m-badge.purchased {
    background: rgba(16,185,129,.12);
    color: #6ee7b7;
}

.m-badge.in-cart {
    background: rgba(245,158,11,.12);
    color: #fbbf24;
}

.m-button {
    height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg,var(--app-accent),var(--app-accent-hover));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .2s;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.m-button:active {
    transform: scale(.97);
}

.m-button.secondary {
    background: rgba(255,255,255,.08);
    color: var(--app-text-primary);
}

.m-button.mini {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 10px;
}

.m-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--app-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

.m-play-btn:active {
    transform: scale(.9);
    color: var(--app-accent);
}

.m-play-btn i {
    font-size: 16px;
}

.m-play-btn.playing {
    color: var(--app-accent);
}

/* 小屏幕适配 */
@media (max-width: 360px) {
    .m-list-cover {
        width: 48px;
        height: 48px;
    }
    .m-section {
        padding: 16px 12px 12px;
    }
    .m-track-actions {
        grid-template-columns: 1fr;
    }
    .m-hero {
        padding: 12px;
    }
    .m-hero-slide {
        min-height: 160px;
        padding: 16px;
    }
    .m-hero-title {
        font-size: 20px;
    }
    .m-list-item {
        padding: 10px 12px;
    }
    .m-list-title {
        font-size: 14px;
    }
    .m-list-subtitle {
        font-size: 12px;
    }
    .m-badge {
        font-size: 10px;
        padding: 0 6px;
    }
    .m-play-btn {
        width: 28px;
        height: 28px;
    }
    .m-play-btn i {
        font-size: 14px;
    }
    .m-chart-grid {
        padding: 0 12px;
        gap: 10px;
    }
    .m-chart-card {
        padding: 12px;
        gap: 12px;
    }
    .m-chart-cover {
        width: 64px;
        height: 64px;
    }
    .m-chart-name {
        font-size: 15px;
    }
    .m-chart-desc {
        font-size: 12px;
    }
}

