﻿/* 字典页面样式 */
:root {
    --primary-color: #4e8cbb;
    --primary-dark: #3a7cb2;
    --text-color: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-color: #f5f5f5;
    --border-color: #e6d8b6;
    --hover-color: #b89b5b;
    --section-bg: #f9f6ec;
    --card-shadow: 0 2px 12px rgba(180,160,100,0.10);
    --orange-color: #ff6b35;
    --orange-light: #ff8c69;
}

.g-bd {
    background-color: var(--bg-color);
}

/* 汉字查询功能样式 */
.search-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom:5px;
    max-width: 1200px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.search-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.search-label {
    font-size: 18px;
    color: var(--orange-color);
    font-weight: bold;
    white-space: nowrap;
}

#searchInput {
    flex: 1;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

#searchBtn {
    padding: 10px 20px;
    background: var(--orange-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-family: inherit;
}

#searchBtn:hover {
    background: var(--orange-light);
}

.search-results {
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.search-results.show {
    display: block;
}

.search-results .result-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s ease;
}

.search-results .result-item:hover {
    background: #f8f8f8;
}

.search-results .result-link {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.search-results .result-link:hover {
    text-decoration: none;
    color: inherit;
}

.search-results .result-char {
    font-size: 20px;
    font-weight: bold;
    margin-right: 15px;
    color: var(--orange-color);
}

.search-results .result-info {
    flex: 1;
}

.search-results .result-pinyin {
    color: var(--text-light);
    font-size: 12px;
}

.search-results .result-details {
    color: var(--text-lighter);
    font-size: 11px;
    margin-top: 2px;
}

/* 字典页面布局 */
.zidian-layout {
    display: flex;
    gap: 5px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Courier New', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

.zidian-main {
    flex: 1;
    min-width: 0;
}

.zidian-sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* 通用区域样式 */
.section-header {
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--orange-color);
}

.section-header h2 {
    font-size: 20px;
    color: var(--orange-color);
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

.section-header h3 {
    font-size: 16px;
    color: var(--orange-color);
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

/* 常用汉字区域 */
.common-chars-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.common-chars-grid {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 5px;
}

.char-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.char-item:hover {
    background: linear-gradient(135deg, var(--orange-light), var(--orange-color));
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

/* 拼音查询区域 */
.pinyin-search-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.pinyin-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.pinyin-item {
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.pinyin-item:hover {
    background: linear-gradient(135deg, #fff5f0, #ffe8d6);
    border-color: var(--orange-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.2);
}

.pinyin-char {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 4px;
}

.pinyin-text {
    font-size: 12px;
    color: var(--orange-color);
    font-weight: 500;
}

/* 笔顺查询区域 */
.stroke-search-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.stroke-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.stroke-item {
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.stroke-item:hover {
    background: linear-gradient(135deg, #fff5f0, #ffe8d6);
    border-color: var(--orange-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.2);
}

.stroke-char {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 4px;
}

.stroke-count {
    font-size: 12px;
    color: var(--orange-color);
    font-weight: 500;
}

/* 多音字查询区域 */
.polyphone-search-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.polyphone-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}

.polyphone-item {
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.polyphone-item:hover {
    background: linear-gradient(135deg, #fff5f0, #ffe8d6);
    border-color: var(--orange-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.2);
}

.polyphone-char {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 6px;
}

.polyphone-list .pinyin-text {
    font-size: 12px;
    color: var(--orange-color);
    font-weight: 500;
}

/* 汉字简介区域 */
.intro-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.intro-content {
    line-height: 1.8;
    color: var(--text-light);
}

.intro-content p {
    margin-bottom: 12px;
    text-indent: 2em;
}

/* 右侧边栏样式 */
.zidian-sidebar section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

/* 偏旁部首区域 */
.radical-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.radical-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.radical-item:hover {
    background: linear-gradient(135deg, var(--orange-light), var(--orange-color));
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

/* 笔画查字区域 */
.stroke-count-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.stroke-count-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 28px;
}

.stroke-count-item:hover {
    background: linear-gradient(135deg, var(--orange-light), var(--orange-color));
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

/* 汉字结构区域 */
.structure-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

.structure-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 32px;
}

.structure-item:hover {
    background: linear-gradient(135deg, var(--orange-light), var(--orange-color));
    color: #fff;
    transform: scale(1.02);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

/* 字母导航区域 */
.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}

.alphabet-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.alphabet-item:hover {
    background: linear-gradient(135deg, var(--orange-light), var(--orange-color));
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .zidian-layout {
        flex-direction: column;
    }
    
    .zidian-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .common-chars-grid {
        grid-template-columns: repeat(15, 1fr);
    }
    
    .pinyin-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .stroke-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .polyphone-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .g-bd {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    .zidian-layout {
        gap: 0;
        padding: 0 !important;
        margin: 0 !important;
        width: 100%;
        max-width: none !important;
        box-sizing: border-box;
    }
    
    .zidian-layout section {
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    .search-section {
   
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        width: 100%;
        max-width: none !important;
        box-sizing: border-box;
        margin-bottom:5px;
    }
    

    
    .zidian-sidebar {
        grid-template-columns: 1fr;
    }
    
    .common-chars-grid {
        grid-template-columns: repeat(10, 1fr);
        gap: 5px;
    }
    
    .pinyin-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stroke-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .polyphone-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .radical-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .stroke-count-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 480px) {
    /* 强制重置所有可能影响宽度的元素 */
    html, body {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }
    
    .g-bd {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
    }
    
    .container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
    }
    
    .zidian-layout {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
        gap: 0;
        flex-direction: column;
    }
    
    .zidian-main, .zidian-sidebar {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .zidian-layout section {
        margin: 0 !important;
        padding: 2px !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid #ddd;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .search-section {
        margin: 0 !important;
        padding: 10px !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid #ddd;
        width: 100% !important;
        max-width: none !important;
        box-sizing: border-box;
    }
    

    

    
    .search-form {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .search-label {
        text-align: center;
        margin-bottom: 5px;
    }
    
    #searchInput, #searchBtn {
        width: 100%;
    }
    
    .common-chars-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 2px;
    }
    
    .pinyin-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stroke-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .polyphone-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .char-item,
    .alphabet-item {
        width:60px;
        height: 28px;
        font-size: 14px;
    }
    
    .radical-item {
        width: 60px;
        height: 32px;
        font-size: 12px;
    }

    .section-header h2 {
        font-size: 18px;
        background: #fff;
    }
    
    .section-header h3 {
        font-size: 14px;
    }
} 