.bento-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.bento-grid {
    display: grid;
    /* 固定两列 */
    grid-template-columns: 1fr 1fr;
    /* 显式声明每一行基础高度为 180px（可根据需要微调），或者用 auto */
    grid-auto-rows: minmax(160px, auto);
    gap: 20px;
    width: min(100%, 1200px);
    margin: 0 auto;
}

.bento-card {
    font-size: 0.9em;
    color: aliceblue;
    border-radius: 16px;
    background: #ffffff27;
    padding: 20px;
}

.bento-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: white;
    font-weight: 400;
}

/* --- 精确对齐位置控制 --- */

/* 1. 左上大：从第 1 行线开始，跨越 2 行，占据第 1 列 */
.bento-card.color-spec {
    grid-column: 1;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
}

/* 2. 左下小：紧接在左侧第 3 行线开始（即左上大的正下方） */
.bento-card.font-spec {
    grid-column: 1;
    grid-row: 3;
}

.bento-card.font-spec p {
    margin: 4px 0;
}

/* 3. 右上小：从第 1 行线开始，只占 1 行，占据第 2 列（确保与左上顶部绝对对齐） */
.bento-card.icon-spec {
    grid-column: 2;
    grid-row: 1;
}

/* 4. 右下大：从第 2 行线开始，向下跨越 2 行，占据第 2 列 */
.bento-card.components {
    grid-column: 2;
    grid-row: 2 / span 2;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 10px;
    flex: 1;
    min-height: 0;
}


.color-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    background: #ffffff27;
    padding: 10px;
    border-radius: 8px;
    transition: transform 0.28s ease, background-color 0.28s ease;
}

.color-card--primary {
    grid-row: span 2;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
}

.color-card:hover {
    transform: translateY(-2px) scale(1.02);
    background: #ffffff33;
}

.color-card p {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.color-chip {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--color-sample);
}

.color-card--primary .color-chip {
    width: 100%;
    height: auto;
    flex: 1;
    min-height: 96px;
}

.color-chip--split {
    background: linear-gradient(90deg, #000000 0 50%, #888888 50% 100%);
}


.font-spec {
    display: flex;
    flex-direction: column;
    justify-content: center;
}


.icon-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.icon-img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 12px;
}

.icon-svg {
    width: 48px;
    height: 48px;
    flex: 0 0 96px;
    object-fit: contain;
}


.components p{
    margin: 5px 0;
}

.component-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px));
    align-items: start;
    gap: 16px;
}

.component-img {
    display: block;
    width: 100%;
    max-width: 100%;
}

.component-img--rounded {
    border-radius: 16px;
    clip-path: inset(0 round 16px);
}

.component-item,
.component-input,
.component-user {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.component-user {
    grid-column: 1 / -1;
    width: min(100%, 220px);
}

.component-user .component-img {
    aspect-ratio: 1080 / 678;
    object-fit: cover;
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .bento-card.color-spec,
    .bento-card.font-spec,
    .bento-card.icon-spec,
    .bento-card.components {
        grid-column: 1;
        grid-row: auto;
    }

    .color-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .color-card--primary {
        grid-row: auto;
    }

    .icon-row {
        flex-wrap: nowrap;
        gap: clamp(4px, 2vw, 10px);
    }

    .icon-img {
        width: clamp(48px, 18vw, 96px);
        height: clamp(48px, 18vw, 96px);
        border-radius: clamp(8px, 2vw, 12px);
    }

    .icon-svg {
        width: clamp(24px, 9vw, 48px);
        height: clamp(24px, 9vw, 48px);
        flex: 0 1 clamp(24px, 9vw, 48px);
    }

    .component-grid {
        grid-template-columns: 220px;
    }
}
