html {
    box-sizing: border-box;
    /* 通用字体 */
    font-family: sans-serif;
}

*,
*::after,
*::before {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

.container {
    height: 100vh;
    background-color: rgb(140, 200, 200);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.dropdown-menu {
    /* 网格布局 */
    display: grid;
    /* 第一行高40 剩下全部填充 */
    grid-template-rows: 40px max-content;
    /* 网格行与列间隙10 */
    gap: 10px;
}

.dropdown-toggle {
    /* all 属性用于重置所有属性，除了 unicode-bidi 和 direction */
    all: unset;
    width: 480px;
    background-color: dodgerblue;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 5px;
}

/* 做下拉箭头v */
.dropdown-toggle::after {
    /* 在toggle前插入内容 */
    content: ' ';
    width: 6px;
    height: 6px;
    border-width: 0 2.3px 2.3px 0;
    border-style: solid;
    /* 移动 */
    transform: rotate(45deg);
    transition: 0.2s;

}

.dropdown-list {
    width: 500px;
    height: 450px;
    background-color: white;
    color: #444;
    list-style: none;
    display: grid;
    /* 重复片段 貌似没有用*/
    /* grid-template-rows: repeat(4, 40px); */
    /* 圆角边框 */
    border-radius: 5px;
    /* 影藏下拉菜单 与动画 */
    overflow-y: scroll;
    height: 0;
    transition: 0.4s;
}

.box h2 {
    background-color: rgba(255, 255, 255, .7);
    /* 添加粘滞定位 */
    position: sticky;
    top: 0;
    color: rgba(120, 120, 250);
}

.box ul {
    list-style: none;
    font-weight: 100;
    font-size: 13px;
}

.box ul li {
    margin: 10px;
}

.dropdown-list_item {
    display: flex;
    align-items: center;
    padding-left: 10px;
    /* 延迟 且内容隐藏左边*/
    transition: 0.4s, transform 0.4s var(--delay);
    transform: translateX(-100%);
    /* 用户不可选取元素 */
    user-select: none;
}

.box ul li:hover {
    background-color: dodgerblue;
    color: white;
    /* 光标形状 */
    cursor: pointer;
}

.dropdown-toggle:focus::after {
    /* 箭头v翻转 */
    transform: rotate(225deg);
}

/* 下拉菜单动画 */
.dropdown-toggle:focus~.dropdown-list {
    height: 450px;
}

.dropdown-toggle:focus~.dropdown-list .dropdown-list_item {
    /* 内容从左往右归位 */
    transform: translateX(0);
}