﻿body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
}

.index-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    /*height: 100vh;*/
}

.stack-area {
    /* **关键修改：宽度占页面宽度的50%** */
    width: 50vw; /* **50vw 表示视口宽度的 50%** */
    /* **可选：设置一个最大宽度，防止在超宽屏幕上区域过大** */
    /*max-width: 600px;*/ /* 例如，堆叠区域最大为600px，根据需要调整 */
    min-width: 400px; /* 可选：设置一个最小宽度，防止在窄屏幕上区域过窄 */
    height: 50vh; /* 高度依然固定，或者也可以设为百分比vh */
    border: 2px dashed #ccc;
    position: relative;
    overflow: hidden;
}

.box {
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid rgba(0,0,0,0.2);
    box-shadow: 3px 3px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    position: absolute;
    margin: 0;
}

    .box:hover {
        transform: scale(1.05);
        box-shadow: 5px 5px 15px rgba(0,0,0,0.4);
    }

.box-red {
    background-color: #e74c3c;
    width: 300px;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

    .box-red h1 {
        font-size: 2em;
    }

    .box-red span {
        font-size: 1.5em;
    }

.box-blue {
    background-color: #3498db;
    width: 190px;
    height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

    .box-blue h1 {
        font-size: 1.1em;
    }

    .box-blue span {
        font-size: 1em;
    }


.box-green {
    background-color: #2ecc71;
    width: 110px;
    height: 110px;
}

.box-yellow {
    background-color: #f1c40f;
    width: 90px;
    height: 80px;
}

.box-purple {
    background-color: #9b59b6;
    width: 120px;
    height: 120px;
}

.box-orange {
    background-color: #e67e22;
    width: 70px;
    height: 100px;
}


.back-button {
    display: inline-flex; /* 允许图标和文本并排显示 */
    align-items: center; /* 垂直居中对齐 */
    padding: 10px 18px;
    margin: 20px; /* 示例外边距 */
    font-size: 16px;
    font-weight: 600;
    color: #333; /* 字体颜色 */
    background-color: #f0f0f0; /* 背景色 */
    border: 1px solid #ccc; /* 边框 */
    border-radius: 8px; /* 圆角 */
    cursor: pointer; /* 鼠标悬停变手型 */
    text-decoration: none; /* 移除下划线，如果用的是a标签 */
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease; /* 过渡效果 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 轻微阴影 */
}

    /* 按钮悬停效果 */
    .back-button:hover {
        background-color: #e0e0e0; /* 悬停背景色 */
        border-color: #bbb; /* 悬停边框色 */
        color: #000;
    }

    /* 按钮激活（点击）效果 */
    .back-button:active {
        background-color: #d0d0d0;
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); /* 内阴影 */
    }

/* 返回图标样式 */
.back-icon {
    width: 20px; /* 图标宽度 */
    height: 20px; /* 图标高度 */
    margin-right: 8px; /* 图标与文本的间距 */
    color: #666; /* 图标颜色 */
}

/* 悬停时图标颜色变化 */
.back-button:hover .back-icon {
    color: #333;
}


@media screen and (max-width: 768px) {
    .box-red {
        background-color: #e74c3c;
        width: 250px;
        height: 250px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

        .box-red h1 {
            font-size: 1.5em;
        }

        .box-red span {
            font-size: 1em;
        }

    .box-blue {
        background-color: #3498db;
        width: 150px;
        height: 150px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

        .box-blue h1 {
            font-size: 1em;
        }

        .box-blue span {
            font-size: 0.8em;
        }
}

@media screen and (max-width: 480px) {
    .box-red {
        background-color: #e74c3c;
        width: 150px;
        height: 150px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

        .box-red h1 {
            font-size: 1em;
        }

        .box-red span {
            font-size: 0.5em;
        }

    .box-blue {
        background-color: #3498db;
        width: 110px;
        height: 110px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

        .box-blue h1 {
            font-size: 0.8em;
        }

        .box-blue span {
            font-size: 0.6em;
        }
}
