@charset "UTF-8";

/* 全局样式 */
::selection {
    background: #000;
    color: #fff;
}

*,
*:before,
*:after {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    font-family: Verdana, Tahoma, STHeiti, "Noto Sans CJK SC", "Microsoft YaHei", SimHei, sans-serif;
}

* {
    transition: all .2s ease;
    -moz-transition: all .2s ease;
    -webkit-transition: all .2s ease;
    -o-transition: all .2s ease;
}

html {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    height: 100%;
}

body {
    font-family: Verdana, Tahoma, STHeiti, "Noto Sans CJK SC", "Microsoft YaHei", SimHei, sans-serif;
    font-size: 16px;
    color: #000;
    background-color: #fff;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

a {
    color: #000;
    text-decoration: none;
}

a:hover {
    color: rgba(0, 0, 0, .5);
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    border: 0;
}

button,
input,
optgroup,
select,
textarea {
    color: inherit;
    font: inherit;
    margin: 0;
}

button {
    background: transparent;
    cursor: pointer;
    border: 0;
    outline: none;
}

hr {
    display: block;
    padding: 0;
    border: 0;
    height: 0;
    border-top: 1px solid #000;
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    margin: 20px 0;
}

/* 主要容器样式 */
.main {
    width: 90%;
    max-width: 600px;
    margin: 0 auto;
    text-align: left; /* 修改为左对齐 */
}

.form {
    margin-top: 50px;
}

.form>h1 {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: left; /* 确保标题左对齐 */
}

/* 搜索框样式 */
.search {
    display: flex;
    justify-content: flex-start; /* 修改为左对齐 */
    align-items: center;
    -webkit-animation: fadeIn 1s;
    animation: fadeIn 1s;
}

.search>input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    background: #f1f1f1;
    border-radius: 4px 0 0 4px;
    outline: none;
}

.search>button {
    padding: 12px 20px;
    color: #000;
    border: 1px solid #000;
    border-radius: 0 4px 4px 0;
    background: transparent;
}

.search>button:hover {
    background: #000;
    color: #fff;
}

/* 模态框样式 */
.modal {
    width: 90%;
    max-width: 300px;
    margin-left: -45%;
    padding: 20px;
    z-index: 1000;
    text-align: center;
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    background: #fff;
    border-radius: 4px;
    -webkit-animation: pulse .5s ease-in-out;
    -webkit-animation-play-state: paused;
    animation: pulse .5s ease-in-out;
    animation-play-state: paused;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .12), 0 1px 6px rgba(0, 0, 0, .12);
}

.modal-active {
    -webkit-animation-play-state: running;
    animation-play-state: running;
}

.modal>.close {
    margin-top: 20px;
    padding: 10px 0;
    display: block;
    cursor: pointer;
    border-top: 1px solid #000;
}

/* 搜索状态下的样式 */
.searching .main {
    width: 100%;
    max-width: none;
    box-shadow: 0 0 1px #000;
    padding: 10px 20px;
}

.searching .form {
    margin-top: 0;
}

.searching h1 {
    min-width: 105px;
    float: left;
    margin: 0;
    line-height: 45px;
}

.searching .search {
    width: calc(100% - 105px);
    display: inline-block;
}

/* 结果区域样式 */
#result {
    background-color: #111;
    padding: 20px;
    border-radius: 4px;
    text-align: left; /* 确保整体内容左对齐 */
    white-space: pre-wrap; /* 保留换行符但允许文本换行 */
    max-height: 400px; /* 设置最大高度，防止内容过高 */
    overflow-x: auto; /* 启用水平滚动条 */
    overflow-y: hidden; /* 禁用垂直滚动条 */
    word-break: keep-all; /* 保持单词完整性 */
    line-height: 1.5; /* 增加行高，提高可读性 */
}

/* 如果结果使用<pre>元素 */
#result pre {
    margin: 0; /* 移除默认边距 */
    text-align: left; /* 确保内容左对齐 */
    white-space: pre; /* 保留所有空白字符 */
    word-break: keep-all; /* 保持单词完整性 */
    min-width: 100%; /* 确保内容宽度不小于容器 */
}

/* 自定义滚动条样式 */
#result::-webkit-scrollbar {
    height: 8px; /* 滚动条高度 */
}

#result::-webkit-scrollbar-track {
    background: #111; /* 滚动条轨道背景 */
    border-radius: 4px;
}

#result::-webkit-scrollbar-thumb {
    background: #555; /* 滚动条滑块颜色 */
    border-radius: 4px;
}

#result::-webkit-scrollbar-thumb:hover {
    background: #888; /* 滚动条滑块悬停颜色 */
}

/* 动画关键帧 */
@-webkit-keyframes pulse {
    0% {
        -webkit-transform: scale(0.3);
        opacity: 0;
    }

    100% {
        -webkit-transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@-webkit-keyframes shift-rightwards {
    0% {
        -webkit-transform: translateX(-100%);
    }

    40% {
        -webkit-transform: translateX(0%);
    }

    60% {
        -webkit-transform: translateX(0%);
    }

    100% {
        -webkit-transform: translateX(100%);
    }
}

@keyframes shift-rightwards {
    0% {
        transform: translateX(-100%)
    }

    40% {
        transform: translateX(0%)
    }

    60% {
        transform: translateX(0%)
    }

    100% {
        transform: translateX(100%)
    }
}

/* 媒体查询，适配手机端 */
@media only screen and (max-width: 480px) {
    .searching .search>input {
        width: 70%;
    }

    .searching .search>button {
        width: 30%;
    }

    .search {
        flex-direction: column;
    }

    .search>input {
        width: 100%;
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .search>button {
        width: 100%;
        border-radius: 4px;
    }
    
    #result {
        max-height: 300px; /* 手机端减小最大高度 */
    }
}