/* 基础样式保持不变 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: white;
    margin: 0 100px;
    font-family: Arial, sans-serif;
    position: relative;
    min-height: 100vh;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo-container {
    margin-top: 50px;
    margin-bottom: 50px;
}

.logo-container img {
    width: 220px;
    height: auto;
}

/* 搜索框核心样式 - 保持原有结构 */
.search-wrapper {
    position: relative;
    display: flex;
    border: 2px solid #ceef00;
    border-radius: 5px;
}

.search-input, .search-button {
    height: 50px;
    outline: none;
    font-size: 16px;
    color: #000;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    margin: 0;
}

.custom-select {
    width: 120px;
    height: 50px;
    cursor: pointer;
    background-color: white;
    border-right: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    position: relative;
}

.selected-option {
    padding: 0 10px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #555;
    transition: transform 0.3s ease;
    position: absolute;
    right: 5px;
}

.custom-select.active .arrow {
    transform: rotate(180deg);
}

.custom-options {
    position: absolute;
    top: calc(100% + 5px);
    width: 120px;
    border-top: none;
    border-radius: 5px;
    max-height: 0;
    overflow: hidden;
    z-index: 1002;
}

.custom-select.active .custom-options {
    max-height: none;
    overflow-y: auto;
    border: 1.5px solid #ceef00;
}

/* 引擎图标样式 */
.engine-logo {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 6px;
}

.custom-option {
    padding: 8px 10px;
    color: #555;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    font-size: 16px;
}

.custom-option:hover {
    color: #000;
    background-color: #f8ffcc;
}

/* 核心搜索输入框 */
.search-input {
    width: 600px;
    padding: 0 15px;
    border: none;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.search-input::placeholder {
    color: #999;
    opacity: 1;
}

.search-button {
    background: linear-gradient(-90deg, #ceef00, #ffff00);
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: linear-gradient(150deg, #ceef00, #ffff00);
}

/* 搜索建议样式 */
.suggestions-container {
    position: absolute;
    left: 120px;
    top: calc(100% + 5px);
    width: calc(100% - 120px);
    border: 1.5px solid #ceef00;
    border-radius: 5px;
    overflow: hidden;
    z-index: 1001;
    display: none;
    background-color: white;
}

.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestions-list li {
    padding: 6px 12px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.5em;
    background: #fff;
    font-size: 16px;
}

.suggestions-list li:hover {
    background-color: #f8ffcc;
    color: #000;
}

.suggestions-list li span {
    font-weight: bold;
    min-width: 20px;
    display: flex;
    align-items: center;
}

/* 联想词编号颜色 */
.suggestions-list li:nth-child(1) span:first-child { color: #cc0000; }
.suggestions-list li:nth-child(2) span:first-child { color: #ff0000; }
.suggestions-list li:nth-child(3) span:first-child { color: #ff6666; }
.suggestions-list li:nth-child(4) span:first-child { color: #ff6600; }
.suggestions-list li:nth-child(5) span:first-child { color: #ff8500; }
.suggestions-list li:nth-child(6) span:first-child { color: #ffb380; }
.suggestions-list li:nth-child(7) span:first-child { color: #0099ff; }
.suggestions-list li:nth-child(8) span:first-child { color: #33adff; }
.suggestions-list li:nth-child(9) span:first-child { color: #99d6ff; }
.suggestions-list li:nth-child(10) span:first-child { color: #999999; }

/* 开关样式 */
.toggle-container {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-switch {
    width: 40px;
    height: 20px;
    background-color: #ddd;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-switch.active {
    background-color: #ceef00;
}

.slider {
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    left: 2px;
    top: 2px;
    transition: transform 0.3s;
}

.toggle-switch.active .slider {
    transform: translateX(20px);
}

/* 开关提示 */
.toggle-container:hover::after {
    content: '搜索建议开关';
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    z-index: 1001;
}

.toggle-container:hover::before {
    content: '';
    position: absolute;
    right: 50px;
    transform: translateY(-50%);
    top: 50%;
    border: 6px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
}

.toggle-container:hover::after,
.toggle-container:hover::before {
    transition: opacity 0.2s ease;
    opacity: 1;
}

.footer-class {
    position: absolute;
    bottom: 0;
    width: 100%;
    left: 0;
    padding: 15px 0;
    color: #999;
    text-align: center;
    font-size: 14px;
}

.footer-class a {
    text-decoration: none;
    color: #999;
}

/* 移动端自适应 - 完全等比例缩放 */

/* 1200px以下的屏幕 */
@media (max-width: 1200px) {
    body {
        margin: 0 20px;
    }
}

/* 768px以下的屏幕 */
@media (max-width: 768px) {
    body {
        margin: 0 5px;
    }
    
    /* 调整搜索框整体容器 */
    .search-wrapper {
        width: 100%;
        max-width: 748px;
    }
    
    /* 等比例调整各元素宽度 */
    .custom-select {
        width: 120px;
        min-width: 120px;
    }
    
    /* 确保搜索引擎下拉框与选项框长度一致 */
    .custom-options {
        width: 120px;
    }
    
    .search-input {
        width: auto !important;
        flex: 1;
        min-width: 0;
        font-size: 16px;
    }
    
    /* 保持联想词窗口与搜索输入框对齐 */
    .suggestions-container {
        left: 120px;
        width: calc(100% - 120px);
    }
    
    /* 确保联想词窗口文字等比例一致 */
    .suggestions-list li {
        font-size: 16px;
    }
    
    /* 确保引擎图标和文字等比例一致 */
    .engine-logo {
        width: 18px;
        height: 18px;
    }
    
    .custom-option {
        font-size: 16px;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .logo-container img {
        width: 154px;
    }
    
    .logo-container {
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    /* 横屏模式下保持等比例缩放 */
    .custom-select {
        width: 105px;
        min-width: 105px;
        font-size: 14px;
    }
    
    .custom-options {
        width: 105px;
    }
    
    .engine-logo {
        width: 16px;
        height: 16px;
    }
    
    .custom-option {
        font-size: 14px;
    }
    
    .search-input {
        font-size: 14px;
    }
    
    .suggestions-list li {
        font-size: 14px;
    }
    
    .suggestions-container {
        left: 105px;
        width: calc(100% - 105px);
    }
}

/* 480px以下的屏幕 */
@media (max-width: 480px) {
    /* 进一步调整 */
    .logo-container img {
        width: 176px;
    }
    
    .logo-container {
        margin-top: 30px;
        margin-bottom: 30px;
    }
    
    /* 小屏幕上的搜索框调整 */
    .search-wrapper {
        width: 100%;
    }
    
    /* 等比例缩小搜索引擎选择框 */
    .custom-select {
        width: 100px;
        min-width: 100px;
        font-size: 14px;
    }
    
    /* 确保下拉框与选择框长度一致 */
    .custom-options {
        width: 100px;
    }
    
    /* 等比例缩小搜索输入框 */
    .search-input {
        width: auto !important;
        flex: 1;
        font-size: 14px;
    }
    
    /* 调整联想词窗口位置和大小 */
    .suggestions-container {
        left: 100px;
        width: calc(100% - 100px);
    }
    
    /* 等比例缩小联想词文字 */
    .suggestions-list li {
        font-size: 14px;
    }
    
    /* 等比例缩小引擎图标和文字 */
    .engine-logo {
        width: 15px;
        height: 15px;
    }
    
    .custom-option {
        font-size: 14px;
        padding: 6px 8px;
    }
}