/**
 * 推荐岛屿 - 横向滚动卡片
 * Islands Art - Apple Design Style
 */

/* 网格容器 */
.island-grid-wrapper {
    position: relative;
    margin: 0;
    width: 100%;
    background: transparent;
}

.island-grid-track {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 18px 16px;
    padding: 12px 4px 8px;
    background: transparent;
}

/* 卡片 */
.island-scroll-card {
    min-width: 0;
}

.island-card-link {
    background: transparent;
    border-radius: 16px;
    padding: 12px 8px;
    box-shadow: none;
    border: none;
    color: inherit;
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column; /* 纵向排版 */
    align-items: center;
    text-align: center;
    gap: 12px;
    text-decoration: none;
}

.island-card-link:hover {
    background-color: #f3f4f6;
    transform: none;
    box-shadow: none;
}

/* 图标 */
.island-card-icon {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 20px; /* 类似iOS圆角 */
    overflow: hidden;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #f3f4f6;
}

.island-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.island-card-link:hover .island-card-icon img {
    transform: scale(1.08);
}

/* 信息区 */
.island-card-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.island-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制两行 */
    -webkit-box-orient: vertical;
    white-space: normal;
    height: 2.6em; /* 固定高度确保对齐 */
}

.island-card-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 操作按钮 */
.island-card-actions {
    margin-top: 4px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.island-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 80px;
    height: 28px;
    padding: 0;
    border-radius: 100px;
    border: none;
    background: #ffffff;
    color: #0071e3;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: none;
    border: 1px solid #dbeafe;
}

.island-card-btn:hover {
    background: #ffffff;
    transform: none;
    box-shadow: none;
    border-color: #93c5fd;
}

.island-card-btn.is-joined {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    cursor: default;
    transform: none;
}

.islands-section-clean {
    background: transparent;
}

/* 响应式 */
@media (max-width: 1279px) {
    .island-grid-track {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    .island-grid-track {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px 12px;
    }
}

@media (max-width: 768px) {
    .island-grid-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px 10px;
        padding: 8px 0 4px;
    }
    
    .island-card-link {
        padding: 8px 4px;
        gap: 8px;
    }
    
    .island-card-name {
        font-size: 13px;
        height: 2.6em; /* 确保高度依然是两行 */
    }

    .island-card-meta {
        font-size: 11px;
    }

    .island-card-icon {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }
    
    .island-card-btn {
        height: 26px;
        font-size: 12px;
        max-width: 72px;
    }
}

@media (max-width: 480px) {
    .island-grid-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
