/* 基础样式 */
.a{
 text-decoration: none;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    padding: 0;
    min-height: 100vh;
    background: #f5f5f5;
}

.search-container {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 700px;
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #f5f5f5;
    z-index: 100;
    border-radius: 4px 4px 0 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}

.clear-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: none;
    color: #999;
    font-size: 14px;
    border: none;
    background: transparent;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-button:hover {
    color: #666;
}

.search-input:not(:placeholder-shown) + .clear-button {
    display: block;
}

.search-input {
    width: 100%;
    padding: 8px 30px 8px 35px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #666;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

.main-container {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-top: 65px;
    min-height: calc(100vh - 65px);
}

.content-area {
    background: #fff;
    border-radius: 0 0 4px 4px;
    position: relative;
    width: 100%;
    padding-right: 20px;
    min-height: calc(100vh - 65px);
}

.hot-countries {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.section-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 15px;
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.country-btn {
    padding: 8px 0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
    color: #333;
    background: #fff;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.country-btn:hover {
    background-color: #f5f5f5;
}

.alphabet-nav {
    position: fixed;
    right: calc(50% - 350px);
    top: 65px;
    bottom: 0;
    width: 20px;
    background: #f0f0f0;
    border-radius: 0 4px 4px 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 10;
    touch-action: none;
}

.alphabet-item {
    font-size: 12px;
    color: #999;
    width: 20px;
    height: calc((100vh - 65px) / 26);
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.alphabet-item:hover,
.alphabet-item.active {
    color: #fff;
    background: #666;
    font-weight: 500;
}

.section-letter {
    font-size: 14px;
    color: #333;
    padding: 10px 15px;
    background: #f7f7f7;
    margin-bottom: 1px;
    font-weight: 500;
    border-left: 3px solid #e0e0e0;
    scroll-margin-top: 70px;
}

.country-list {
    background: #fff;
}

.country-item {
    padding: 12px 15px;
    font-size: 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    background: #fff;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: block;
}

.country-item:hover {
    background-color: #f9f9f9;
    text-decoration: none;
    color: #333;
}

.country-item:active {
    background-color: #e8e8e8;
    transform: scale(0.995);
}

/* 响应式布局 */
@media screen and (max-width: 800px) {
    .search-container {
        width: 100%;
    }
    .alphabet-nav {
        right: 0;
    }
}

/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: none;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 动画效果 */
@keyframes highlight {
    0% {
        background: #f7f7f7;
        transform: translateX(0);
    }
    50% {
        background: #e0e0e0;
        transform: translateX(-5px);
    }
    100% {
        background: #f7f7f7;
        transform: translateX(0);
    }
}

.section-letter.highlight {
    animation: highlight 0.8s ease;
}

/* 搜索结果高亮 */
.highlight {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 500;
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
    .search-container {
        padding: 10px;
    }

    .search-input {
        font-size: 12px;
        padding: 8px 35px;
    }

    .search-input::placeholder {
        font-size: 12px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    .search-icon {
        font-size: 14px;
    }
}

/* 二维码样式 */
.qr-code-container {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 140px;
    background: #fff;
    text-align: center;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    z-index: 100;
}

.qr-code {
    margin-bottom: 8px;
}

.qr-code img {
    width: 102px;
    height: 102px;
    display: block;
    margin: 0 auto 8px;
}

.qr-text {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* 在移动端隐藏二维码 */
@media screen and (max-width: 768px) {
    .qr-code-container {
        display: none;
    }
}
