﻿: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;
    --table-header-bg: #f0f0f0;
    --table-border: #ddd;
}

.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;
}

/* 汉字标题区域 */
.char-header {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.char-header h1 {
    font-size: 28px;
    color: var(--orange-color);
    margin: 0 0 10px 0;
    font-weight: bold;
    letter-spacing: 1px;
}

.char-subtitle {
    display: flex;
    gap: 20px;
    font-size: 16px;
    color: var(--text-light);
}

.char-subtitle span {
    color: var(--text-light);
}

/* 汉字基本信息 */
.char-basic-info {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.char-description {
    line-height: 1.8;
    font-size: 16px;
    color: var(--text-color);
    margin: 0;
}

/* 汉字详细信息表格 */
.char-detail-table {
    background: var(--section-bg);
    border-radius: 12px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    gap: 5px;
}

.char-display-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.char-large-display {
    width: 120px;
    height: 120px;
    background: #fff;
    border: 2px solid var(--table-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    font-weight: bold;
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 朗读按钮区域样式 */
.char-speech-section {
    display: flex;
    justify-content: center;
    width: 100%;
}

.speech-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--orange-color), var(--orange-light));
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    min-width: 80px;
}

.speech-btn:hover {
    background: linear-gradient(135deg, var(--orange-light), #ff4500);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.speech-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.speech-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.speech-icon {
    font-size: 16px;
    line-height: 1;
}

.speech-btn span {
    font-family: 'Microsoft YaHei', sans-serif;
    letter-spacing: 0.5px;
}

.char-info-table {
    flex: 1;
}

.char-info-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.char-info-table td {
    padding: 12px 15px;
    border: 1px solid var(--table-border);
    vertical-align: middle;
}

.table-header td {
    background: var(--table-header-bg);
    font-weight: bold;
    text-align: center;
    color: var(--text-color);
}

.header-traditional {
    background: var(--table-header-bg) !important;
    font-weight: bold;
    text-align: center;
    width: 80px;
}

.header-char {
    background: var(--table-header-bg) !important;
    font-weight: bold;
    text-align: center;
    font-size: 24px;
    width: 60px;
}

.label {
    background: #f8f9fa;
    font-weight: 500;
    color: var(--text-color);
    width: 80px;
    text-align: center;
}

.value {
    color: var(--text-color);
    font-weight: 500;
}

.stroke-order {
    font-family: monospace;
    letter-spacing: 2px;
}

/* 导航链接 */
.char-navigation {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-label {
    font-size: 14px;
    color: var(--text-light);
}

.nav-link {
    color: var(--orange-color);
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: var(--orange-color);
    color: white;
    text-decoration: none;
}

/* 汉字含义区域 */
.char-meaning-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    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;
}

.section-action {
    font-size: 12px;
    color: var(--text-lighter);
    cursor: pointer;
}

.meaning-content {
    margin-top: 15px;
}

.meaning-item h3 {
    font-size: 18px;
    color: var(--text-color);
    margin: 0 0 10px 0;
    font-weight: bold;
}

.meaning-details p {
    line-height: 1.6;
    color: var(--text-color);
    margin: 0 0 10px 0;
}

/* 汉字含义和详解内容的特殊样式 */
.meaning-details {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--orange-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 10px;
}

.meaning-details,
.detailed-details {
    line-height: 1.8;
    color: var(--text-color);
    font-size: 15px;
}

/* 处理BR标签的样式 - 让换行看起来更自然 */
.meaning-details br,
.detailed-details br {
    display: block;
    margin: 8px 0;
    content: "";
}

/* 为含义和详解区域的文本段落添加样式 */
.meaning-details > *:first-child {
    margin-top: 0;
}

.meaning-details > *:last-child {
    margin-bottom: 0;
}

/* 详解区域的特殊样式 */
.char-detailed-section .meaning-details {
    border-left-color: #2c7fb8;
    background: linear-gradient(135deg, #f8fcff, #fff);
}

.detailed-content {
    margin-top: 15px;
}

.detailed-item {
    position: relative;
}

.detailed-details {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #2c7fb8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-top: 10px;
}

/* 文本内容的通用样式优化 */
.meaning-details,
.detailed-details {
    text-align: justify;
    word-break: break-word;
    hyphens: auto;
}

/* 当内容为空时的提示样式 */
.meaning-details:empty::before,
.detailed-details:empty::before {
    content: "暂无相关信息";
    color: var(--text-lighter);
    font-style: italic;
}

/* 为长文本添加滚动条样式 */
.meaning-details,
.detailed-details {
    max-height: 400px;
    overflow-y: auto;
}

.meaning-details::-webkit-scrollbar,
.detailed-details::-webkit-scrollbar {
    width: 6px;
}

.meaning-details::-webkit-scrollbar-track,
.detailed-details::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.meaning-details::-webkit-scrollbar-thumb,
.detailed-details::-webkit-scrollbar-thumb {
    background: var(--orange-color);
    border-radius: 3px;
}

.meaning-details::-webkit-scrollbar-thumb:hover,
.detailed-details::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.meaning-meta {
    font-size: 14px;
    color: var(--text-light);
}

.meaning-meta span {
    margin-right: 15px;
}

/* 字组词区域 */
.char-words-section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.words-content {
    margin-top: 15px;
}

.words-group {
    margin-bottom: 25px;
}

.words-group:last-child {
    margin-bottom: 0;
}

.words-group h3 {
    font-size: 16px;
    color: var(--text-color);
    margin: 0 0 12px 0;
    font-weight: bold;
}

.words-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.word-link {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--table-border);
    border-radius: 4px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.word-link:hover {
    background: var(--orange-color);
    color: white;
    border-color: var(--orange-color);
    text-decoration: none;
    transform: translateY(-1px);
}

/* 右侧边栏样式 - 与ZiDian.aspx完全相同 */
.zidian-sidebar section {
    background: var(--section-bg);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 5px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.zidian-sidebar .section-header {
    margin-bottom: 5px;
    padding-bottom: 8px;
    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: 600;
    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%;
    }
    
    .char-header h1 {
        font-size: 24px;
    }
    
    .char-subtitle {
        flex-direction: column;
        gap: 10px;
    }
    
    .char-detail-table {
        flex-direction: column;
 
    }
    
    .char-large-display {
        width: 100px;
        height: 100px;
        font-size: 60px;
    }
    
    .char-display-section {
        gap: 5px;
    }
    
    .speech-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .char-navigation {
        flex-direction: column;
        gap: 5px;
        align-items: stretch;
    }
    
    .nav-item {
        justify-content: center;
    }
    
    .words-list {
        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;
        }
    
    /* 所有区域完全无边距 */
    .char-header,
    .char-basic-info,
    .char-detail-table,
    .char-navigation,
    .char-meaning-section,
    .char-words-section,
    .zidian-sidebar section {
        margin: 0;
        padding: 15px;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid #ddd;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 汉字信息表格区域也无边距 */
    .char-info-table {
        padding: 0;
        margin: 0;
    }
    
    .char-display-section {
        padding: 15px;
        margin: 0;
    }
    
    .char-header {
        padding: 15px;
    }
    
    .char-header h1 {
        font-size: 20px;
    }
    
    .char-large-display {
        width: 80px;
        height: 80px;
        font-size: 48px;
    }
    
    .char-display-section {
        gap: 5px;
    }
    
    .speech-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 60px;
        gap: 5px;
    }
    
    .speech-icon {
        font-size: 14px;
    }
    
    .char-info-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .header-char {
        font-size: 18px !important;
    }
    
    .words-list {
        gap: 5px;
    }
    
    .word-link {
        padding: 4px 8px;
        font-size: 13px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.char-header,
.char-basic-info,
.char-detail-table,
.char-meaning-section,
.char-words-section {
    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 var(--orange-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 