﻿
: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);

}

/* 容器和基础布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* 字典页面布局 */
.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;
}

/* 页面标题区域 */
.page-header {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 24px;
    color: var(--orange-color);
    font-weight: bold;
    letter-spacing: 1px;
}

.result-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.result-count {
    font-size: 16px;
    color: var(--text-light);
}

.result-count strong {
    color: var(--orange-color);
    font-weight: 600;
}

.filter-links {
    display: flex;
    gap: 5px;
}

.back-link {
    color: var(--orange-color);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--orange-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: var(--orange-color);
    color: white;
}

/* 搜索结果容器 */
.search-results-container {
    margin: 5px 0;
}

/* 笔画分组区域 */
.stroke-group-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.stroke-group-header {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--orange-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stroke-group-header h2 {
    font-size: 20px;
    color: var(--orange-color);
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

.group-count {
    font-size: 14px;
    color: var(--text-light);
    background: rgba(255, 107, 53, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--orange-light);
}

/* 汉字网格布局 - 每行显示8个 */
.chars-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    margin-top: 5px;
}

.char-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 4px;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 60px;
}

.char-result-item:hover {
    background: linear-gradient(135deg, var(--orange-light), var(--orange-color));
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

.char-text {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-color);
    display: block;
    margin-bottom: 4px;
    font-family: "SimSun", "宋体", serif;
    line-height: 1;
}

.char-result-item:hover .char-text {
    color: #fff;
}

.char-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    color: var(--text-light);
    line-height: 1.2;
}

.char-result-item:hover .char-info {
    color: rgba(255, 255, 255, 0.9);
}

.char-pinyin {
    color: var(--orange-color);
    font-weight: 500;
    margin-bottom: 1px;
}

.char-result-item:hover .char-pinyin {
    color: rgba(255, 255, 255, 0.9);
}

.char-stroke {
    color: var(--text-lighter);
    font-weight: 400;
    font-size: 9px;
}

.char-result-item:hover .char-stroke {
    color: rgba(255, 255, 255, 0.8);
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 5px 0;
}

.no-results-content h3 {
    font-size: 24px;
    color: #666;
    margin: 0 0 15px 0;
}

.no-results-content p {
    font-size: 16px;
    color: #888;
    margin: 0;
}

.no-results-content a {
    color: #007bff;
    text-decoration: none;
}

.no-results-content a:hover {
    text-decoration: underline;
}

/* 分页导航 */
.pagination-container {
    margin: 5px 0;
    text-align: center;
}

.pagination {
    display: inline-block;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #007bff;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* 相关推荐区域 */
.related-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.related-section .section-header {
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--orange-color);
}

.related-section h3 {
    font-size: 20px;
    color: var(--orange-color);
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.related-link {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #fff, #f8f8f8);
    color: var(--orange-color);
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.related-link:hover {
    background: linear-gradient(135deg, var(--orange-light), var(--orange-color));
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

/* 右侧边栏样式 */
.zidian-sidebar section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.zidian-sidebar .section-header {
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--orange-color);
}

.zidian-sidebar .section-header h3 {
    font-size: 16px;
    color: var(--orange-color);
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
}

/* 偏旁部首样式 */
.radical-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}

.radical-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: 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.1);
    box-shadow: 0 4px 8px 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;
    height: 32px;
    background: linear-gradient(135deg, #fff, #f8f8f8);
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.stroke-count-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);
}

/* 汉字结构样式 */
.structure-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

.structure-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: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.structure-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);
}

/* 字母导航样式 */
.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}

.alphabet-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: 14px;
    font-weight: 600;
    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 4px 8px rgba(255, 107, 53, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .g-bd {
        padding: 0;
        margin: 0;
        max-width: none;
    }
    
    .container {
        padding: 0;
        margin: 0;
        max-width: none;
    }
    
    .zidian-layout {
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin: 0;
    }
    
    .zidian-main section, .zidian-sidebar section {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .zidian-sidebar {
        width: 100%;
        /* 移除 order: -1，让边栏显示在主内容下方 */
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .result-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .chars-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 5px;
    }
    
    .char-text {
        font-size: 28px;
    }
    
    .stroke-group-header {
        padding: 12px 15px;
    }
    
    .stroke-group-header h2 {
        font-size: 18px;
    }
    
    .related-links {
        justify-content: center;
    }
    
    /* 移动端边栏样式调整 */
    .radical-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .stroke-count-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (max-width: 480px) {
    .g-bd {
        padding: 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .container {
        padding: 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .zidian-layout {
        padding: 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .zidian-main, .zidian-sidebar {
        padding: 0;
        margin: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .zidian-main section, .zidian-sidebar section {
        margin: 0;
        padding: 15px;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid #ddd;
    }
    
    .chars-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .char-result-item {
        padding: 12px;
    }
    
    .char-text {
        font-size: 24px;
    }
    
    .char-info {
        font-size: 12px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stroke-group-section {
    animation: fadeInUp 0.6s ease-out;
}

.char-result-item {
    animation: fadeInUp 0.6s ease-out;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 