/* 应用市场改版 · product.html */

:root {
    --market-blue: #0b73e1;
    --market-blue-deep: #075bb8;
    --market-blue-soft: #e8f2ff;
    --market-bg: #eef4fc;
    --market-card: #ffffff;
    --market-text: #1a2332;
    --market-muted: #6b778c;
    --market-orange: #ff5a1f;
    --market-orange-deep: #e6450f;
    --market-radius: 16px;
    --market-shadow: 0 8px 24px rgba(15, 55, 110, 0.08);
    --market-header-h: 58px;
    --market-sidebar-w: 240px;
}

.market-body {
    background: var(--market-bg);
    min-width: 1200px;
    color: var(--market-text);
}

/* 顶栏占位：固定导航占空间，Banner 从下方开始，不透到导航底下 */
.market-header-spacer {
    height: var(--market-header-h);
    background: var(--market-blue);
}

/* ========== Hero（整块背景图，后台可配） ========== */
.market-hero {
    position: relative;
    overflow: hidden;
    min-height: 250px;
    background-color: #0b73e1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    box-sizing: border-box;
}

.market-hero-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 40px;
    max-width: 1600px;
    min-height: 250px;
    margin: 0 auto;
    padding: 28px 32px;
    box-sizing: border-box;
}

.market-hero-copy {
    flex: 1;
    min-width: 0;
    max-width: 560px;
}

.market-hero-title {
    margin: 0;
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.15;
}

.market-hero-title-dark {
    color: #0a1f44;
}

.market-hero-title-blue {
    background: linear-gradient(180deg, #4aa3ff 0%, #0b73e1 55%, #075bb8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.market-hero-desc {
    margin: 14px 0 0;
    font-size: 16px;
    line-height: 1.6;
    color: #1a2332;
}

.market-hero-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    padding: 6px 6px 6px 18px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(8, 60, 130, 0.22);
}

.market-hero-search-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
}

.market-hero-search-input {
    flex: 1;
    min-width: 0;
    height: 42px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--market-text);
}

.market-hero-search-input::placeholder {
    color: #9aa6b8;
}

.market-hero-search-btn {
    flex-shrink: 0;
    height: 42px;
    padding: 0 26px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #3d8ef0 0%, #0b73e1 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(11, 115, 225, 0.35);
    transition: filter 0.2s ease, transform 0.15s ease;
}

.market-hero-search-btn:hover {
    filter: brightness(1.06);
}

.market-hero-search-btn:active {
    transform: scale(0.98);
}

/* ========== 双栏布局 ========== */
.market-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 32px 64px;
    box-sizing: border-box;
}

.market-sidebar {
    position: sticky;
    top: calc(var(--market-header-h) + 16px);
    width: var(--market-sidebar-w);
    flex-shrink: 0;
    z-index: 5;
}

.market-main {
    flex: 1;
    min-width: 0;
}

/* ========== 分类面板 ========== */
.market-cate-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(11, 115, 225, 0.08);
    border-radius: var(--market-radius);
    padding: 10px;
    box-shadow: var(--market-shadow);
    max-height: calc(100vh - var(--market-header-h) - 180px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(11, 115, 225, 0.35) transparent;
}

.market-cate-panel::-webkit-scrollbar {
    width: 6px;
}

.market-cate-panel::-webkit-scrollbar-thumb {
    background: rgba(11, 115, 225, 0.28);
    border-radius: 999px;
}

.market-cate-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 11px 12px;
    border: none;
    outline: none;
    box-shadow: none;
    border-radius: 12px;
    background: transparent;
    color: var(--market-text);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.market-cate-item:hover {
    background: var(--market-blue-soft);
}

.market-cate-item:focus,
.market-cate-item:focus-visible,
.market-cate-item:active,
.market-cate-item.is-active:focus,
.market-cate-item.is-active:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none;
}

.market-cate-item.is-active {
    background: linear-gradient(135deg, #1a8cff 0%, #0b73e1 100%);
    color: #fff;
    border: none;
    outline: none;
    box-shadow: 0 6px 16px rgba(11, 115, 225, 0.28);
}

.market-cate-item.is-active:focus,
.market-cate-item.is-active:focus-visible,
.market-cate-item.is-active:active {
    box-shadow: 0 6px 16px rgba(11, 115, 225, 0.28);
}

.market-cate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    flex-shrink: 0;
    background: #edf4ff;
    color: var(--market-blue);
}

.market-cate-item.is-active .market-cate-icon {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.market-cate-icon--0 { background: #e8f4ff; color: #1a8cff; }
.market-cate-icon--1 { background: #fff0e8; color: #ff6a2a; }
.market-cate-icon--2 { background: #eef8ef; color: #2f9e4b; }
.market-cate-icon--3 { background: #f3ecff; color: #7a4dff; }
.market-cate-icon--4 { background: #fff6e0; color: #d08900; }
.market-cate-icon--5 { background: #ffe9ef; color: #e23b6a; }

.market-cate-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.market-cate-num {
    flex-shrink: 0;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(11, 115, 225, 0.08);
    color: var(--market-muted);
    font-size: 12px;
    text-align: center;
    line-height: 1.5;
}

.market-cate-item.is-active .market-cate-num {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* 免费试用卡（整块背景图） */
.market-trial-card {
    position: relative;
    display: flex;
    align-items: center;
    margin-top: 16px;
    padding: 18px 16px;
    border-radius: var(--market-radius);
    overflow: hidden;
    background-color: #0b73e1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #000018;
    box-shadow: 0 10px 24px rgba(11, 115, 225, 0.28);
    min-height: 118px;
}

.market-trial-text {
    position: relative;
    z-index: 1;
    max-width: 70%;
}

.market-trial-title {
    font-size: 18px;
    font-weight: 700;
    color: #000018;
}

.market-trial-desc {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: #000018;
}

.market-trial-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    color: #000018;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 40, 100, 0.18);
}

.market-trial-btn:hover {
    color: #000018;
    opacity: 0.85;
}

/* ========== 区块标题 ========== */
.market-section-head {
    margin-bottom: 16px;
}

.market-section-head--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.market-section-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--market-text);
}

.market-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(11, 115, 225, 0.1);
}

.market-sort-item {
    height: 32px;
    padding: 0 14px;
    border: none;
    outline: none;
    box-shadow: none;
    border-radius: 999px;
    background: transparent;
    color: var(--market-muted);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.market-sort-item:hover {
    color: var(--market-blue);
}

.market-sort-item:focus,
.market-sort-item:focus-visible,
.market-sort-item:active,
.market-sort-item.is-active:focus,
.market-sort-item.is-active:focus-visible {
    outline: none !important;
    border: none !important;
    box-shadow: none;
}

.market-sort-item.is-active {
    background: var(--market-blue);
    color: #fff;
    font-weight: 600;
    border: none;
    outline: none;
    box-shadow: none;
}

/* ========== 热门推荐（仅轮播） ========== */
.market-hot {
    margin-bottom: 28px;
}

.market-hot .market-section-head {
    margin-bottom: 16px;
}

.market-banner {
    width: 100%;
    border-radius: var(--market-radius);
    overflow: hidden;
    box-shadow: var(--market-shadow);
    background: #dce9f8;
    min-height: 260px;
}

.market-banner .swiper-slide a,
.market-banner .swiper-slide img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.market-banner-pagination {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.market-banner-pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.55);
    opacity: 1;
}

.market-banner-pagination .swiper-pagination-bullet-active {
    background: #fff;
    width: 18px;
    border-radius: 999px;
}

.market-banner-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 280px;
    background: linear-gradient(135deg, #dcebff 0%, #b7d6ff 100%);
    color: #3d6ea8;
    font-size: 14px;
}

.market-banner-placeholder img {
    width: 40% !important;
    height: auto !important;
    max-height: 160px;
    object-fit: contain !important;
    opacity: 0.9;
}

/* ========== 应用卡片 ========== */
.market-apps {
    margin-bottom: 36px;
    /* 分类/搜索滚到结果区时，避开固定顶栏 */
    scroll-margin-top: calc(var(--market-header-h) + 16px);
}

.market-app-grid,
.market-presale-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 22px;
}

.market-app-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 16px;
    border-radius: var(--market-radius);
    background: var(--market-card);
    border: 1px solid rgba(11, 115, 225, 0.08);
    box-shadow: var(--market-shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    min-height: 220px;
    overflow: hidden;
    box-sizing: border-box;
}

.market-app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 55, 110, 0.12);
}

.market-app-card-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-height: 0;
    padding-top: 10px; /* 给右上角角标留空，避免压住商品名 */
}

.market-app-card-icon {
    flex-shrink: 0;
    width: 108px;
    height: 108px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(145deg, #f3f8ff 0%, #e8f1fc 100%);
    box-shadow: inset 0 0 0 1px rgba(11, 115, 225, 0.06);
}

.market-app-card-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-app-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.market-app-card-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--market-text);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    padding-right: 0;
    box-sizing: border-box;
}

/* 贴卡片右上角的圆弧角标（同原「官方自营」） */
.market-app-card-tag {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    max-width: none;
    height: 22px;
    margin: 0;
    padding: 0 10px 0 8px;
    /* 贴右上角：右上跟随卡片圆角，左下圆弧，右侧贴边 */
    border-radius: 0 var(--market-radius) 0 12px;
    background: linear-gradient(90deg, #ff7a3d 0%, #ff3d2e 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(255, 61, 46, 0.28);
    pointer-events: none;
}

.market-app-card-tag--discount {
    background: linear-gradient(90deg, #ff7a3d 0%, #ff3d2e 100%);
}

.market-app-card-tag-fire {
    width: 12px;
    height: 12px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    /* 原图黑底橙火 → 白色火焰 */
    filter: brightness(0) invert(1);
}

.market-app-card-desc {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--market-muted);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    min-height: 54px;
}

.market-app-card-meta {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff4e8 0%, #ffe8d6 100%);
    font-size: 12px;
    color: #b34700;
}

.market-app-card-meta strong {
    color: var(--market-orange);
}

.market-app-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(11, 115, 225, 0.08);
}

.market-app-card-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.market-app-card-price {
    font-size: 18px;
    font-weight: 800;
    color: #e4221c;
    white-space: nowrap;
    line-height: 1;
}

.market-app-card-price em {
    font-style: normal;
    font-size: 14px;
    margin-right: 1px;
}

.market-app-card-cost {
    font-size: 12px;
    color: #9aa3af;
    text-decoration: line-through;
}

.market-app-card-sale {
    flex-shrink: 0;
    margin-right: 4px;
    font-size: 12px;
    color: #8a94a6;
    line-height: 1;
    white-space: nowrap;
}

.market-app-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #3d8ef0 0%, #0b73e1 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(11, 115, 225, 0.28);
    flex-shrink: 0;
}

.market-app-card-btn--orange {
    background: linear-gradient(135deg, #ff8a3d 0%, #ff5a1f 100%);
    box-shadow: 0 4px 12px rgba(255, 90, 31, 0.3);
}

.market-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--market-muted);
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--market-radius);
    border: 1px dashed rgba(11, 115, 225, 0.2);
}

/* 预售 */
.market-presale {
    margin-bottom: 28px;
}

.presale-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.presale-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 28px;
    padding: 0 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, #ff8a1a 0%, #ff4d00 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(255, 77, 0, 0.35);
}

.presale-sub {
    color: #b34700;
    font-size: 14px;
}

/* API 搜索 */
.market-mini-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 14px;
    background: #fff;
    border: 1px solid rgba(11, 115, 225, 0.14);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(11, 115, 225, 0.05);
}

.market-mini-search-input {
    width: 180px;
    height: 34px;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--market-text);
}

.market-mini-search-btn {
    height: 34px;
    padding: 0 16px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #3d8ef0 0%, #0b73e1 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* 浏览器细节 */
.market-body ::selection {
    background: rgba(11, 115, 225, 0.18);
    color: var(--market-text);
}

.market-hero-search-btn:focus-visible,
.market-mini-search-btn:focus-visible {
    outline: 2px solid rgba(11, 115, 225, 0.45);
    outline-offset: 2px;
}

/* 兼容旧类名残留（若其它脚本引用） */
.search-container,
.section-head-row,
#app.app-card,
.presale-card {
    /* no-op keep file self-contained */
}
