﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    margin-right: 30px;
}

.logo i {
    margin-right: 8px;
    color: #ffd700;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

/* 语言切换 */
.language-switcher {
    display: flex;
    align-items: center;
    margin-right: 20px;
    gap: 10px;
}

.language-btn {
    background: linear-gradient(to bottom, #5a7fbb, #3a5f9e);
    border: none;
    color: white;
    padding: 6px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 0 #2c3e50, 0 3px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    top: 0;
    width: 60px;
    height: 32px;
    flex-direction: column;
}

.language-btn:hover {
    background: linear-gradient(to bottom, #6a8fcb, #4a6fae);
}

.language-btn:active {
    box-shadow: 0 1px 0 #2c3e50, 0 2px 3px rgba(0, 0, 0, 0.2);
    top: 2px;
}

.language-btn.active {
    background: linear-gradient(to bottom, #ffd700, #e5bf00);
    color: #2c3e50;
    box-shadow: 0 2px 0 #ccaa00, 0 3px 5px rgba(0, 0, 0, 0.2);
}

.language-btn.active:active {
    box-shadow: 0 1px 0 #ccaa00, 0 2px 3px rgba(0, 0, 0, 0.2);
}

.language-btn i {
    font-size: 0.7rem;
    margin-bottom: 2px;
}

.language-btn span {
    line-height: 1;
    font-size: 0.7rem;
    display: block;
}

/* 导航样式 */
nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 8px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

nav ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffd700;
}

nav ul li a.active {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

nav ul li a i {
    margin-right: 4px;
    font-size: 0.8rem;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
}

/* 主内容区样式 */
.hero {
    padding: 40px 0 30px;
    text-align: center;
    background: linear-gradient(rgba(255,255,255,0.9), rgba(255,255,255,0.9)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect fill="%234a6491" opacity="0.1" width="50" height="50"/><rect fill="%234a6491" opacity="0.1" x="50" y="50" width="50" height="50"/></svg>');
    background-size: 300px;
    width: 100%;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

/* 内容区样式 */
.content {
    padding: 30px 0 50px;
    flex-grow: 1;
    width: 100%;
}

.section-title {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 1.8rem;
}

.content-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.content-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4a6491;
}

.content-section h3 {
    color: #4a6491;
    margin: 20px 0 10px;
}

.content-section p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.content-section ul, .content-section ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
}

.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #ddd;
}

table th {
    background-color: #4a6491;
    color: white;
}

table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* 特殊样式 - 修复对齐问题 */
.small-subscript {
    font-size: 0.8em;
    color: #888;
    vertical-align: middle;
    position: relative;
    top: -0.2em;
}

/* 新的对齐样式 */
.gr-initial {
    display: inline-block;
    position: relative;
}

.gr-initial .main-text {
    display: inline-block;
}

.gr-initial .subscript {
    font-size: 0.8em;
    color: #888;
    position: relative;
    display: inline-block;
    vertical-align: middle;
    top: -0.2em;
}

/* 声母表横向排列样式 */
.initials-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.initials-table th, 
.initials-table td {
    text-align: center;
    padding: 10px 8px;
    border: 1px solid #ddd;
}

.initials-table th {
    background-color: #4a6491;
    color: white;
    font-weight: bold;
}

.initials-table .header-cell {
    background-color: #3a5f9e;
    font-weight: bold;
    color: white;
}

.initials-table .pinyin-row {
    background-color: #f0f7ff;
}

.initials-table .gr-row {
    background-color: #f8f9fa;
}

/* 响应式表格样式 */
.responsive-table-container {
    overflow-x: auto;
    margin: 20px 0;
}

.responsive-table {
    width: 100%;
    border-collapse: collapse;
}

.responsive-table th, 
.responsive-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

.responsive-table th {
    background-color: #4a6491;
    color: white;
}

.responsive-table .header-cell {
    background-color: #3a5f9e;
    color: white;
}

/* 韵母表格样式 */
.finals-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.finals-table th, 
.finals-table td {
    text-align: center;
    padding: 10px 8px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

.finals-table th {
    background-color: #4a6491;
    color: white;
    font-weight: bold;
}

.finals-table .header-cell {
    background-color: #3a5f9e;
    font-weight: bold;
    color: white;
}

.finals-table .pinyin-row {
    background-color: #f0f7ff;
}

.finals-table .tone-row {
    background-color: #f8f9fa;
}

.finals-table .tone-label {
    font-weight: bold;
    background-color: #e9ecef;
}

/* 新的基本韵母表格样式 */
.basic-finals-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.basic-finals-table th, 
.basic-finals-table td {
    text-align: center;
    padding: 10px 8px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

.basic-finals-table th {
    background-color: #4a6491;
    color: white;
    font-weight: bold;
}

.basic-finals-table .header-cell {
    background-color: #3a5f9e;
    font-weight: bold;
    color: white;
}

.basic-finals-table .gr-cell {
    background-color: #f0f7ff;
    font-weight: bold;
}

.basic-finals-table .tone-cell {
    background-color: #f8f9fa;
}

.basic-finals-table .tone-label {
    font-weight: bold;
    background-color: #e9ecef;
}

/* 空韵表格样式 */
.syllabic-finals-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.syllabic-finals-table th, 
.syllabic-finals-table td {
    text-align: center;
    padding: 10px 8px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

.syllabic-finals-table th {
    background-color: #4a6491;
    color: white;
    font-weight: bold;
}

.syllabic-finals-table .header-cell {
    background-color: #3a5f9e;
    font-weight: bold;
    color: white;
}

.syllabic-finals-table .gr-cell {
    background-color: #f0f7ff;
    font-weight: bold;
}

.syllabic-finals-table .tone-cell {
    background-color: #f8f9fa;
}

.syllabic-finals-table .tone-label {
    font-weight: bold;
    background-color: #e9ecef;
}

/* 蓝色首字母样式 */
.blue-initial {
    color: #1a73e8;
    font-weight: bold;
}

.photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.photo-item {
    flex: 1 1 300px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.photo-caption {
    padding: 10px;
    background: #f8f9fa;
    text-align: center;
    font-size: 0.9rem;
}

.note-box {
    background: #e8f4fc;
    border-left: 4px solid #4a6491;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.example-box {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #ffd700;
}

.example-box h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

/* 页脚样式 */
footer {
    background: #2c3e50;
    color: white;
    padding: 15px 0 10px;
    text-align: center;
    margin-top: auto;
    width: 100%;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-section {
    text-align: center;
    margin-bottom: 5px;
    width: 100%;
}

.footer-section h3 {
    margin-bottom: 8px;
    color: #ffd700;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.footer-section ul li {
    margin-bottom: 5px;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.footer-section a:hover {
    color: #ffd700;
    background: rgba(255, 255, 255, 0.15);
}

.footer-section a i {
    margin-right: 6px;
}

.copyright {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

/* 提示框样式 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* 语言存储提示 */
.language-storage-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #4a6491;
}

.language-storage-info h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.language-storage-info p {
    color: #666;
    margin-bottom: 10px;
    line-height: 1.5;
}

.language-storage-info code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    nav ul li {
        margin-left: 6px;
    }
    
    nav ul li a {
        font-size: 0.8rem;
        padding: 5px 8px;
    }
}

@media (max-width: 992px) {
    nav ul li {
        margin-left: 5px;
    }
    
    nav ul li a {
        font-size: 0.75rem;
        padding: 4px 6px;
    }
    
    .language-btn {
        width: 55px;
        height: 30px;
        font-size: 0.65rem;
    }
}

@media (max-width: 900px) {
    nav ul li a span.nav-text {
        display: none;
    }
    
    nav ul li a i {
        margin-right: 0;
    }
    
    nav ul li {
        margin-left: 4px;
    }
    
    nav ul li a {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    nav {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #2c3e50;
        display: none;
        padding: 15px;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }
    
    nav.active {
        display: block;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin: 8px 0;
    }
    
    nav ul li a {
        justify-content: center;
        padding: 8px;
        font-size: 0.9rem;
    }
    
    nav ul li a span.nav-text {
        display: inline;
    }
    
    nav ul li a i {
        margin-right: 8px;
    }
    
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .hero {
        padding: 30px 0 20px;
    }
    
    .content {
        padding: 20px 0 40px;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .content-section {
        padding: 20px;
    }
    
    .language-btn {
        font-size: 0.6rem;
        width: 50px;
        height: 28px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-left {
        order: 1;
        width: 100%;
        justify-content: space-between;
        margin-bottom: 10px;
    }
    
    nav {
        order: 3;
        width: 100%;
    }
    
    .menu-toggle {
        order: 2;
    }
    
    .footer-section ul {
        flex-direction: row;
        gap: 15px;
    }
    
    .footer-section a {
        font-size: 0.85rem;
    }
    
    /* 响应式表格 */
    .responsive-table-container {
        overflow-x: auto;
    }
    
    .responsive-table {
        min-width: 600px;
    }
    
    .finals-table {
        min-width: 800px;
    }
    
    .basic-finals-table {
        min-width: 800px;
    }
    
    .syllabic-finals-table {
        min-width: 700px;
    }
    
    /* iu介音韵母表在小屏幕上宽度变小 */
    .v-finals-table {
        min-width: 500px;
    }
}

@media (max-width: 600px) {
    .header-content {
        flex-direction: row;
        align-items: center;
    }
    
    .header-left {
        order: 1;
        width: auto;
        justify-content: flex-start;
        margin-bottom: 0;
        flex-wrap: nowrap;
    }
    
    .logo {
        margin-right: 15px;
        margin-bottom: 0;
        font-size: 1.2rem;
        display: flex;
        align-items: center;
    }
    
    .language-switcher {
        order: 2;
        flex-direction: row;
        justify-content: flex-start;
        margin-right: 0;
        margin-bottom: 0;
        width: auto;
        gap: 8px;
        margin-left: 10px;
    }
    
    .menu-toggle {
        order: 3;
        align-self: center;
        margin-top: 0;
        margin-left: 15px;
        display: flex;
        align-items: center;
        padding: 6px 10px;
    }
    
    .language-btn {
        width: 45px;
        height: 26px;
        font-size: 0.55rem;
    }
    
    .footer-section ul {
        flex-direction: row;
        gap: 15px;
    }
    
    .syllabic-finals-table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.4rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .hero {
        padding: 25px 0 15px;
    }
    
    .content {
        padding: 15px 0 30px;
    }
    
    .language-btn {
        width: 40px;
        height: 24px;
        font-size: 0.5rem;
        padding: 2px 0;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .footer-section ul {
        flex-direction: row;
        gap: 10px;
    }
    
    .footer-section ul li {
        margin-bottom: 3px;
    }
    
    .footer-section a {
        font-size: 0.8rem;
    }
    
    .footer-section h3 {
        margin-bottom: 8px;
        font-size: 1.1rem;
    }
    
    .copyright {
        margin-top: 10px;
        padding-top: 10px;
        font-size: 0.8rem;
    }
    
    .syllabic-finals-table {
        min-width: 500px;
    }
    
    /* iu介音韵母表在超小屏幕上宽度进一步变小 */
    .v-finals-table {
        min-width: 400px;
    }
}

@media (max-width: 360px) {
    .header-left {
        flex-wrap: nowrap;
    }
    
    .logo {
        margin-bottom: 0;
        font-size: 1rem;
    }
    
    .language-switcher {
        width: auto;
        justify-content: flex-start;
        gap: 6px;
        margin-left: 8px;
    }
    
    .menu-toggle {
        margin-left: 12px;
    }
    
    .language-btn {
        width: 38px;
        height: 22px;
        font-size: 0.45rem;
    }
    
    .menu-toggle {
        padding: 5px 8px;
        font-size: 1.3rem;
    }
    
    .footer-section ul {
        flex-direction: row;
        gap: 8px;
    }
    
    .syllabic-finals-table {
        min-width: 450px;
    }
    
    /* iu介音韵母表在最小屏幕上宽度最小化 */
    .v-finals-table {
        min-width: 350px;
    }
}

/* 修复右侧白色块问题 */
html, body {
    overflow-x: hidden;
    width: 100%;
}

main {
    width: 100%;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}