/* 导航栏 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #4CAF50;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: white;
    padding: 40px 0;
    text-align: center;
    margin-top: 40px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    margin-bottom: 10px;
}

.footer-links {
    margin-top: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #4CAF50;
}

/* 响应式导航 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    height: calc(100vh - 120px);
}

/* 折叠容器样式 */
.collapsible-container {
    position: relative;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.collapsible-header h2,
.collapsible-header h3 {
    margin: 0;
}

.collapse-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.collapsible-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* 移动设备默认折叠 */
@media (max-width: 992px) {
    .mobile-collapse .collapsible-content {
        max-height: 0;
    }
    
    .mobile-collapse .collapse-icon {
        transform: rotate(-90deg);
    }
}

/* 左侧总目录 */
.left-column {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.left-column h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.left-column ul {
    list-style: none;
}

.left-column li {
    margin-bottom: 10px;
}

.left-column a {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.left-column a:hover {
    background-color: #f0f0f0;
}

/* 中间正文 */
.middle-column {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.page-toc {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.page-toc h3 {
    margin-bottom: 15px;
    color: #333;
}

.page-toc ul {
    list-style: none;
    padding-left: 20px;
}

.page-toc li {
    margin-bottom: 8px;
}

.page-toc a {
    text-decoration: none;
    color: #666;
    transition: color 0.3s;
}

.page-toc a:hover {
    color: #333;
}

.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.content-section p {
    margin-bottom: 15px;
    text-align: justify;
}

/* 例句样式 */
.example {
    background-color: #f5f5f5;
    border-left: 4px solid #4CAF50;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.example .romazi {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 2em;
}

.example .hanzi {
    margin-bottom: 5px;
}

.example .translation {
    color: #666;
    margin-bottom: 5px;
}

.example .notes {
    font-style: italic;
    color: #888;
    font-size: 0.9em;
}

/* 表格样式 */
.language-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.language-table th {
    background-color: #4CAF50;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: bold;
}

.language-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

.language-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.language-table tr:hover {
    background-color: #f5f5f5;
}

.language-table .romanized {
    font-weight: bold;
    color: #333;
}

.language-table .phonetic {
    color: #666;
    font-style: italic;
    font-size: 0.9em;
}

.language-table .kanji {
    font-size: 1.1em;
}

.language-table .translation {
    color: #333;
}

.language-table .notes {
    font-style: italic;
    color: #888;
    font-size: 0.9em;
}

/* 右侧词汇表 */
.right-column {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.right-column h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.vocabulary-item {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.vocabulary-item .romazi {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.vocabulary-item .pronunciation {
    color: #666;
    font-style: italic;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.vocabulary-item .hanzi {
    margin-bottom: 5px;
    font-size: 1em;
}

.vocabulary-item .part-of-speech {
    display: inline-block;
    background-color: #e3f2fd;
    color: #1976D2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-right: 5px;
    margin-bottom: 5px;
}

.vocabulary-item .category {
    display: inline-block;
    background-color: #e8f5e8;
    color: #388E3C;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-bottom: 5px;
}

.vocabulary-item .meaning {
    margin: 10px 0;
    color: #333;
}

.vocabulary-item .notes {
    font-style: italic;
    color: #888;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 200px 1fr 250px;
    }
}

@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
        gap: 15px;
        height: auto;
        min-height: 100vh;
    }
    
    .left-column,
    .middle-column,
    .right-column {
        position: static;
        height: auto;
        overflow-y: visible;
    }
    
    /* 确保移动设备上的点击事件正常工作 */
    .collapsible-header {
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }
}

/* 默认折叠移动设备上的内容 */
@media (max-width: 992px) {
    .mobile-collapse .collapsible-content {
        max-height: 0;
    }
    
    .mobile-collapse .collapse-icon {
        transform: rotate(-90deg);
    }
}