/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "微软雅黑", sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2c3e50;
    line-height: 1.6;
    min-height: 100vh;
    font-size: 16px;
}

.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 1.8em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    position: relative;
    padding: 0 10px;
}

h1:after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, #3498db, #2ecc71);
    margin: 15px auto 0;
    border-radius: 5px;
}

/* 搜索表单样式 */
.search-form {
    text-align: center;
    margin: 30px auto;
    position: relative;
    width: 95%;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 5px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.search-form form {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.search-form input[type="text"] {
    flex: 1;
    height: 44px;
    padding: 0 20px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    -webkit-appearance: none;
}

input[type="text"]:focus {
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52,152,219,0.3);
    transform: translateY(-2px);
}

button {
    height: 44px;
    padding: 0 25px;
    font-size: 16px;
    cursor: pointer;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(52,152,219,0.2);
    white-space: nowrap;
    -webkit-appearance: none;
}

button:hover {
    background: linear-gradient(135deg, #2980b9, #2c3e50);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(52,152,219,0.3);
}

/* 搜索结果样式 */
.results {
    width: 95%;
    margin: 20px auto;
}

.result-item {
    margin: 12px 0;
    padding: 12px 15px;
    border-radius: 5px;
    background: #f8f9fa;
    border-left: 3px solid #3498db;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.result-item:hover {
    transform: translateX(10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.result-item a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    display: block;
    margin-bottom: 5px;
    padding: 5px 0;
}

.result-item a:hover {
    color: #3498db;
}

/* 歌词显示样式 */
.geci {
    margin: 20px 0;
    padding: 20px 15px;
    font-size: 16px;
    line-height: 1.8;
    background: #f8f9fa;
    border-radius: 5px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

.geci p {
    margin: 12px 0;
    padding: 8px 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.geci p:hover {
    background: rgba(52,152,219,0.1);
    transform: translateX(5px);
}

/* 高亮式 */
.highlight {
    background: linear-gradient(120deg, #ffd700 0%, #ffeb3b 100%);
    padding: 2px 5px;
    border-radius: 5px;
    font-weight: bold;
    color: #000;
}

/* 信息显示样式 */
.info {
    text-align: center;
    margin: 25px 0;
    padding: 15px;
    color: #666;
    font-size: 1.1em;
    background: rgba(52,152,219,0.1);
    border-radius: 5px;
}

.keyword {
    margin: 20px 0;
    padding: 15px;
    background: #e9ecef;
    border-radius: 5px;
    color: #495057;
    text-align: center;
    font-weight: 500;
}

/* 按钮样式 */
.actions {
    margin-top: 40px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.back-btn {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(46,204,113,0.2);
}

.back-btn:hover {
    background: linear-gradient(135deg, #27ae60, #219a52);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46,204,113,0.3);
}

/* 悬浮按钮容器 */
.float-buttons {
    position: fixed;
    right: 15px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

/* 悬浮按钮样式 */
.float-btn {
    display: flex;
    align-items: center;
    padding: 0 20px;
    text-decoration: none;
    background: rgba(46, 204, 113, 0.95);
    color: white;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    height: 40px;
    white-space: nowrap;
    min-width: 100px;
}

.float-btn:hover {
    background: rgba(39, 174, 96, 0.95);
    transform: translateX(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    padding-right: 35px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        background: #fff;
        font-size: 15px;
    }

    .container {
        margin: 0;
        padding: 15px;
        box-shadow: none;
        border-radius: 0;
        background: #fff;
    }

    /* 标题优化 */
    h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }

    h1:after {
        width: 60px;
        height: 3px;
        margin: 10px auto 0;
    }

    /* 搜索表单优化 */
    .search-form {
        padding: 30px 20px;
    }

    .search-form form {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .search-form input[type="text"] {
        height: 50px;
        font-size: 16px;
        padding: 0 15px;
    }

    .search-form button {
        height: 50px;
        font-size: 16px;
        width: 100%;
    }

    /* 移除移动端悬停效果 */
    input[type="text"]:focus,
    button:hover {
        transform: none;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    /* 搜索结果优化 */
    .results {
        width: 95%;
        margin: 15px auto;
    }

    .result-item {
        margin: 8px 0;
        padding: 10px 12px;
        border-radius: 5px;
        border-left: 3px solid #3498db;
        background: #f8f9fa;
    }

    .result-item a {
        display: block;
        font-size: 15px;
        padding: 3px 0;
        margin-bottom: 3px;
    }

    /* 歌词显示优化 */
    .geci {
        margin: 15px 0;
        padding: 15px;
        font-size: 15px;
        line-height: 1.6;
        border-radius: 5px;
    }

    .geci p {
        margin: 8px 0;
        padding: 5px;
    }

    /* 信息显示优化 */
    .info {
        margin: 15px 0;
        padding: 12px;
        font-size: 14px;
        background: #f8f9fa;
        border-radius: 5px;
    }

    .keyword {
        margin: 15px 0;
        padding: 12px;
        font-size: 14px;
        background: #f8f9fa;
        border-radius: 5px;
    }

    /* 悬浮按钮优化 */
    .float-buttons {
        position: fixed;
        right: 10px;
        bottom: 15px;
        gap: 8px;
        z-index: 1000;
    }

    .float-btn {
        height: 40px;
        padding: 0 16px;
        font-size: 14px;
        min-width: 90px;
        border-radius: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(46, 204, 113, 0.95);
        color: white;
        text-decoration: none;
    }

    /* iOS 安全区域适配 */
    @supports (padding: max(0px)) {
        .float-buttons {
            padding-bottom: env(safe-area-inset-bottom);
            bottom: max(15px, env(safe-area-inset-bottom));
        }
    }
}

/* 超小屏幕优化 */
@media (max-width: 320px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.3em;
    }

    input[type="text"],
    button {
        height: 40px;
        font-size: 14px;
    }

    .float-btn {
        height: 36px;
        padding: 0 12px;
        font-size: 13px;
        min-width: 80px;
    }

    .search-form {
        padding: 25px 15px;
    }

    .search-form input[type="text"],
    .search-form button {
        height: 46px;
        font-size: 15px;
    }

    .result-item {
        margin: 6px 0;
        padding: 8px 10px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .container {
        background: #2d2d2d;
    }

    input[type="text"] {
        background: #333;
        border-color: #444;
        color: #e0e0e0;
    }

    .result-item {
        background: #333;
        border-left-color: #3498db;
    }

    .result-item a {
        color: #e0e0e0;
    }

    .geci {
        background: #333;
    }

    .info, .keyword {
        background: rgba(52,152,219,0.2);
        color: #e0e0e0;
    }
}

/* 相关搜索样式 */
.related-searches {
    width: 95%;
    margin: 20px auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.related-searches h3 {
    margin-bottom: 10px;
    color: #666;
    font-size: 1.1em;
}

.search-tag {
    display: inline-block;
    margin: 5px;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-tag:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.search-count {
    color: #666;
    font-size: 12px;
    margin-left: 3px;
}

.search-tag:hover .search-count {
    color: rgba(255,255,255,0.8);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .related-searches {
        width: 95%;
        margin: 15px auto;
        padding: 12px;
    }

    .search-tag {
        margin: 3px;
        padding: 4px 10px;
        font-size: 13px;
    }
}

/* 搜索历史样式 */
.search-history {
    margin: 30px auto;
    width: 95%;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 5px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.search-history h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.4em;
    position: relative;
}

.search-history h2:after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #3498db, #2ecc71);
    margin: 10px auto 0;
    border-radius: 3px;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.history-item {
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.history-item:hover {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(52,152,219,0.2);
    border-color: transparent;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .search-history {
        margin: 20px auto;
        padding: 20px;
    }

    .history-list {
        gap: 8px;
        padding: 0 5px;
    }

    .history-item {
        padding: 6px 12px;
        font-size: 13px;
        flex-grow: 1;
        text-align: center;
    }

    .history-item:hover {
        transform: none;
    }
}

/* 加载更多按钮样式 */
.load-more {
    text-align: center;
    margin: 20px 0;
}

.load-more button {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more button:hover {
    background: #e9ecef;
}

.load-more button:disabled {
    background: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .load-more button {
        width: 100%;
        padding: 12px 20px;
    }
}

/* 页脚样式 */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer p {
    margin: 5px 0;
}

.debug-info {
    color: #999;
    font-size: 12px;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .footer {
        background: #2d2d2d;
        border-top-color: #444;
        color: #999;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .footer {
        margin-top: 30px;
        padding: 15px 0;
    }
}

/* 公众号展示区域样式 */
.wechat-section {
    margin: 30px auto;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    max-width: 500px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    text-align: center;
    border: 1px solid rgba(0,0,0,0.05);
}

.qrcode-container {
    flex-shrink: 0;
    padding: 10px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.qrcode-img {
    width: 130px;
    height: 130px;
    border-radius: 3px;
    display: block;
}

.wechat-info {
    flex-grow: 0;
}

.wechat-info h3 {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.wechat-info p {
    color: #666;
    font-size: 1em;
    line-height: 1.6;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .wechat-section {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        margin: 20px 15px;
        gap: 15px;
    }

    .qrcode-container {
        padding: 8px;
    }

    .qrcode-img {
        width: 160px;
        height: 160px;
    }

    .wechat-info h3 {
        font-size: 1.2em;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .wechat-section {
        background: linear-gradient(135deg, #2d2d2d, #262626);
        border-color: rgba(255,255,255,0.05);
    }

    .qrcode-container {
        background: #333;
    }

    .wechat-info h3 {
        color: #e0e0e0;
    }

    .wechat-info p {
        color: #999;
    }
}

/* 搜索结果面的公众号展示样式 */
.results + .wechat-section {
    margin-top: 40px;
}

/* 歌词页面的公众号展示样式 */
.geci + .wechat-section {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .geci + .wechat-section {
        border-top-color: #444;
    }
}

/* 游戏规则说明样式 */
.game-rules {
    margin: 30px auto;
    width: 95%;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 5px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.game-rules h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.4em;
    position: relative;
}

.game-rules h2:after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #3498db, #2ecc71);
    margin: 10px auto 0;
    border-radius: 3px;
}

.rules-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.rule-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.8);
}

.rule-icon {
    width: 28px;
    height: 28px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.rule-text {
    flex-grow: 1;
}

.rule-text h4 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.rule-text p {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .game-rules {
        margin: 20px 15px;
        padding: 20px;
    }

    .game-rules h2 {
        font-size: 1.3em;
    }

    .rule-item {
        padding: 8px;
    }

    .rule-icon {
        width: 24px;
        height: 24px;
        font-size: 0.9em;
    }

    .rule-text h4 {
        font-size: 1em;
    }

    .rule-text p {
        font-size: 0.9em;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .game-rules {
        background: linear-gradient(135deg, #2d2d2d, #262626);
        border-color: rgba(255,255,255,0.05);
    }

    .game-rules h2 {
        color: #e0e0e0;
    }

    .rule-item {
        background: rgba(255, 255, 255, 0.05);
    }

    .rule-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .rule-text h4 {
        color: #e0e0e0;
    }

    .rule-text p {
        color: #999;
    }
}

/* 调整游戏规则与搜索历史的间距 */
.search-history + .game-rules {
    margin-top: 40px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .search-history + .game-rules {
        margin-top: 30px;
    }
}

/* 统一首页模块宽度和样式 */
.search-form,
.wechat-section,
.game-rules,
.search-history {
    width: 95%;
    margin: 30px auto;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 5px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

/* 搜索表单内部布局 */
.search-form form {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.search-form input[type="text"] {
    flex: 1;
    height: 44px;
    padding: 0 20px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    -webkit-appearance: none;
}

/* 公众号展示区域内部布局 */
.wechat-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    max-width: none;  /* 移除最大宽度限制 */
}

/* 移动端适配 */
@media (max-width: 768px) {
    .search-form,
    .wechat-section,
    .game-rules,
    .search-history {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }

    .search-form form {
        flex-direction: column;
        gap: 10px;
    }

    .search-form input[type="text"],
    .search-form button {
        width: 100%;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .search-form input[type="text"] {
        height: 50px;  /* 增加输入框高度 */
        font-size: 16px;
        padding: 15px 15px;
    }

    .search-form button {
        height: 50px;  /* 增加按钮高度，与输入框保持一致 */
        font-size: 16px;
        width: 100%;
    }
}

/* 超小屏幕优化 */
@media (max-width: 320px) {
    .search-form input[type="text"],
    .search-form button {
        height: 46px;  /* 超小屏幕稍微调小一点 */
        font-size: 15px;
    }
}

/* 页脚链接样式 */
.footer-link {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #3498db;
    text-decoration: none;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .footer-link {
        color: #666;
    }
    
    .footer-link:hover {
        color: #3498db;
    }
}

/* 页脚链接样式 */
.footer-link {
    color: #666;
    text-decoration: none;  /* 移除下划线 */
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #3498db;
    text-decoration: none;  /* 确保悬停时也没有下划线 */
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .footer-link {
        color: #666;  /* 保持深色模式下也是 #666 */
    }
    
    .footer-link:hover {
        color: #3498db;
    }
}