/* =========================================
   移动端 Grid 精细化布局 (Clean & Structured)
   仅在 max-width: 768px 时生效
   ========================================= */

/* 通用：隐藏简介 */
.ranking-intro,
.provider-intro {
    display: none !important;
}

/* ============================
   排行榜卡片 (Grid 布局)
   结构：Grid 4列 x 2行
   Col 1: 序号 | Col 2: Logo | Col 3: 名称/标签 | Col 4: 评分/人数
   ============================ */
.ranking-item {
    display: grid !important;
    grid-template-columns: auto auto 1fr auto !important;
    grid-template-rows: auto auto !important;
    column-gap: 0.75rem !important;
    row-gap: 0.25rem !important;
    padding: 0.75rem 1rem !important;
    align-items: center !important;
    height: auto !important;
    text-align: left !important;
}

/* 序号: 占据左侧两行 (垂直居中) */
.ranking-pos {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: center;
    margin: 0 !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 0.75rem !important;
    flex-shrink: 0 !important;
}

/* Logo: 占据第二列两行 (垂直居中) */
.ranking-logo {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
    margin: 0 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 8px !important;
}

.ranking-logo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* --- 核心技巧：展开 ranking-info --- */
.ranking-info {
    display: contents !important;
    /* 关键：让子元素直接参与 Grid */
}

/* 名称: Row 1, Col 3 (靠下对齐) */
.ranking-name {
    grid-column: 3;
    grid-row: 1;
    align-self: end !important;

    font-size: 0.95rem !important;
    font-weight: 600 !important;
    text-align: left !important;
    color: var(--primary-color) !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-bottom: 1px !important;
    /* 微调间距 */
    line-height: normal !important;
}

/* 标签: Row 2, Col 3 (靠上对齐) */
.ranking-tags {
    grid-column: 3;
    grid-row: 2;
    align-self: start !important;
    padding: 0 !important;
    padding-top: 1px !important;
    /* 微调间距 */

    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.4rem !important;
    margin: 0 !important;
    min-width: 0 !important;
}

/* 评分区域: Row 1, Col 4 (右对齐) */
.ranking-rating {
    grid-column: 4;
    grid-row: 1;
    justify-self: end !important;
    align-self: end !important;

    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    margin-bottom: 2px !important;
}

.ranking-rating .stars {
    font-size: 0.75rem !important;
    /* 星星改小 */
}

.ranking-rating .rating-value {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
}

/* 评分人数: Row 2, Col 4 (右对齐) */
.ranking-count {
    grid-column: 4;
    grid-row: 2;
    justify-self: end !important;
    align-self: start !important;

    font-size: 0.7rem !important;
    color: var(--secondary-color) !important;
    margin-top: 2px !important;
}

/* 微调内部元素 */
.tier-badge {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.4rem !important;
    height: auto !important;
}

.provider-alias-wrapper {
    display: inline-flex !important;
    /* 恢复显示 */
    align-items: center !important;
    gap: 0.2rem !important;
    padding: 0.1rem 0.3rem !important;
    font-size: 0.65rem !important;
    border: 1px solid rgba(52, 152, 219, 0.2) !important;
    background: rgba(52, 152, 219, 0.05) !important;
    border-radius: 4px !important;
    height: auto !important;
    max-width: 100px !important;
    /* 防止太长 */
}

.alias-label {
    font-size: 0.55rem !important;
    line-height: 1 !important;
    padding: 0.1rem 0.2rem !important;
    border-radius: 3px !important;
    margin-right: 0.1rem !important;
    opacity: 1 !important;
    /* 保持清晰 */
}

.alias-text {
    font-size: 0.65rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.1 !important;
}


/* ============================
   服务商列表卡片 (Grid 布局)
   结构类似，但没有序号
   ============================ */
.provider-card {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-template-rows: 1fr 1fr !important;
    /* 强制平分高度 */
    column-gap: 0.75rem !important;
    row-gap: 2px !important;
    padding: 0.75rem 1rem !important;
    align-items: center !important;
}

.provider-logo {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
}

.provider-info {
    display: contents !important;
    /* 展开 */
}

/* 名称 */
.provider-name {
    grid-column: 2;
    grid-row: 1;
    align-self: end !important;
    text-align: left !important;
    justify-self: start !important;
    margin: 0 !important;

    font-size: 1rem !important;
    max-width: 100% !important;
    padding-bottom: 1px !important;
    line-height: normal !important;

    /* 强制单行截断 */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 标签 */
.provider-tags {
    grid-column: 2;
    grid-row: 2;
    align-self: start !important;
    margin: 0 !important;
    padding-top: 1px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.4rem !important;
}

/* 评分统计 (包含星星和人数) */
.provider-stats {
    grid-column: 3;
    grid-row: 1 / -1;
    /* 垂直居中于右侧 */
    align-self: center !important;
    justify-self: end !important;

    display: flex !important;
    flex-direction: column !important;
    /* 垂直排列：分数在上，人数在下 */
    align-items: flex-end !important;
    gap: 0.1rem !important;
    margin: 0 !important;
}

.provider-stats .rating-display {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
}

.provider-stats .stars {
    font-size: 0.75rem !important;
}

.provider-stats .rating-value {
    font-size: 0.9rem !important;
}

.provider-stats .rating-count {
    font-size: 0.7rem !important;
}

/* 首页摘要修正：移除隐藏，保持一致 */
/* .ranking-summary .ranking-tags,
.ranking-summary .ranking-rating {
    display: ... 移除此处的隐藏逻辑
} */