﻿/* 词典页面专用样式 */
:root {
    --primary-color: #4e8cbb;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f5f5f5;
    --section-bg: #f9f6ec;
    --orange-color: #ff6b35;
    --orange-light: #ff8c69;
}

.g-bd {
    background-color: var(--bg-color);
}

/* 词典页面布局 - 增加间距 */
.zidian-layout {
    display: flex;
    gap: 5px;
    max-width: 1200px;
    margin: 0 auto;
}

.zidian-main {
    flex: 1;
    min-width: 0;
}

.zidian-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* 常用词语区域 - 调整网格布局 */
.common-chars-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e6d8b6;
}

.common-chars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 5px;
    line-height: 1.5;
}

.char-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 16px;
    transition: all 0.3s ease;
    text-align: center;
    word-break: break-all;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.char-item:hover {
    background: var(--orange-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* 右侧边栏样式 */
.zidian-sidebar section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 1px;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 词性分类网格 */
.radical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 5px;
}

.radical-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.radical-item:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
}

/* 词式分类网格 */
.stroke-count-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 5px;
}

.stroke-count-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stroke-count-item:hover {
    background: #b89b5b;
    color: #fff;
    transform: translateY(-1px);
}

/* 字母导航网格 */
.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 12px;
}

.alphabet-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.alphabet-item:hover {
    background: var(--orange-color);
    color: #fff;
    transform: translateY(-1px);
}

/* 词语查询功能样式 */
.search-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 5px;
    margin: 5px auto;
    max-width: 1200px;
    box-shadow: 0 2px 12px rgba(180,160,100,0.10);
    border: 1px solid #e6d8b6;
}

.search-form {
    display: flex;
    gap: 20px;
    margin-bottom: 5px;
    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: 250px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
}

#searchBtn {
    padding: 12px 25px;
    background: var(--orange-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-family: inherit;
}

#searchBtn:hover {
    background: var(--orange-light);
}

/* 搜索结果样式 */
.search-results {
    display: none;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-results.show {
    display: block;
}

.search-results .result-item {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.search-results .result-item:last-child {
    border-bottom: none;
}

.search-results .result-item:hover {
    background: #f8f8f8;
}

.search-results .result-link {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: inherit;
}

.search-results .result-link:hover {
    text-decoration: none;
    color: inherit;
}

.search-results .result-char {
    font-size: 18px;
    font-weight: bold;
    color: var(--orange-color);
    margin-bottom: 8px;
}

.search-results .result-info {
    font-size: 14px;
    color: var(--text-light);
}

.search-results .result-pinyin {
    margin-bottom: 4px;
}

.search-results .result-details {
    font-size: 13px;
    color: #999;
}

/* 通用区域样式 - 增加间距 */
.section-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--orange-color);
}

.section-header h2 {
    font-size: 22px;
    color: var(--orange-color);
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

.section-header h3 {
    font-size: 18px;
    color: var(--orange-color);
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

/* 拼音查询区域 - 增加间距 */
.pinyin-search-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e6d8b6;
}

.pinyin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 5px;
}

.pinyin-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pinyin-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--orange-color);
}

.pinyin-char {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 5px;
}

.pinyin-text {
    color: var(--text-light);
    font-size: 12px;
}

/* 词性分类查询区域 */
.stroke-search-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e6d8b6;
}

.stroke-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 5px;
}

.stroke-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stroke-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--orange-color);
}

.stroke-char {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 5px;
}

.stroke-count {
    color: var(--text-light);
    font-size: 12px;
}

/* 词式分类查询区域 */
.polyphone-search-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e6d8b6;
}

.polyphone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 5px;
}

.polyphone-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 5px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.polyphone-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--orange-color);
}

.polyphone-char {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 5px;
}

.polyphone-list .pinyin-text {
    color: var(--text-light);
    font-size: 12px;
}

/* 简介区域 */
.intro-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e6d8b6;
}

.intro-content {
    line-height: 1.8;
    color: var(--text-color);
}

.intro-content p {
    margin-bottom: 15px;
    font-size: 15px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .zidian-layout {
        gap: 25px;
        padding: 0 15px;
    }
    
    .zidian-sidebar {
        width: 260px;
    }
    
    .common-chars-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .pinyin-grid,
    .stroke-grid,
    .polyphone-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .g-bd {
        padding: 0;
    }
    
    .container {
        padding: 0;
        margin: 0;
        max-width: none;
    }
    
    .zidian-layout {
        flex-direction: column;
        gap: 0;
        margin: 0;
        padding: 0;
    }
    
    .zidian-sidebar {
        width: 100%;
        order: -1;
    }
    
    /* 所有section区域无边距 */
    .common-chars-section,
    .pinyin-search-section,
    .stroke-search-section,
    .polyphone-search-section,
    .intro-section,
    .radical-section,
    .stroke-count-section,
    .alphabet-section {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .common-chars-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }
    
    .pinyin-grid,
    .stroke-grid,
    .polyphone-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 5px;
    }
    
    .radical-grid,
    .stroke-count-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 2px;
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
        gap: 2px;
    }
}

@media (max-width: 576px) {
    .g-bd {
        padding: 0;
        margin: 0;
    }
    
    .container {
        padding: 0;
        margin: 0;
        max-width: none;
        width: 100%;
    }
    
    .zidian-layout {
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    .zidian-main,
    .zidian-sidebar {
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    /* 所有section区域完全无边距 */
    .common-chars-section,
    .pinyin-search-section,
    .stroke-search-section,
    .polyphone-search-section,
    .intro-section,
    .radical-section,
    .stroke-count-section,
    .alphabet-section {
        margin: 0;
        padding: 1px;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid #e6d8b6;
        width: 100%;
        box-sizing: border-box;
    }
    
    .common-chars-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 6px;
    }
    
    .char-item {
        min-height: 35px;
        font-size: 14px;
        padding: 6px 8px;
    }
    
    .section-header {
        margin: 0;
        padding: 0;
    }
    
    .section-header h2 {
        font-size: 18px;
        margin: 0 0 10px 0;
    }
    
    .section-header h3 {
        font-size: 16px;
        margin: 0 0 2px 0;
    }
    
    /* 搜索区域也无边距 */
    .search-section {
        margin: 0;
        padding: 10px;
        border-radius: 0;
        width: 100%;
        box-sizing: border-box;
        margin-bottom:5px;
    }
    
    .search-container {
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    /* 简介内容区域 */
    .intro-content {
        margin: 0;
        padding: 0;
    }
    
    .intro-content p {
        margin: 0 0 10px 0;
        padding: 0;
    }
} 