/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.nav-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.nav-item {
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.nav-item:hover {
    background: #f0f0f0;
    color: #667eea;
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 主内容区域 */
#main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 30px auto;
    padding: 0 20px;
}

/* 页脚样式 */
.footer {
    background: rgba(255, 255, 255, 0.95);
    text-align: center;
    padding: 20px;
    margin-top: auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer p {
    color: #666;
    font-size: 14px;
}

/* 页面标题样式 */
.page-title {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.page-title h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.page-title .subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* 主页样式 */
.hero {
    text-align: center;
    color: white;
    padding: 40px 20px;
}

.hero h1 {
    font-size: 3em;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.hero .tagline {
    font-size: 1.5em;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero .formula {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px 40px;
    border-radius: 12px;
    display: inline-block;
    font-size: 1.2em;
    backdrop-filter: blur(10px);
}

.hero .formula strong {
    color: #ffd700;
}

/* 字根图切换器样式 */
.chart-switcher {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.switch-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.switch-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.switch-btn:hover {
    background: #f0f0ff;
}

.switch-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.chart-container {
    text-align: center;
    min-height: 300px;
}

.chart-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* 键盘图样式 */
.keyboard-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    padding: 20px;
    background: #e8e8e8;
    border-radius: 12px;
}

.key-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.key {
    width: 50px;
    height: 50px;
    background: white;
    border: 2px solid #ccc;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 3px 0 #999;
    position: relative;
}

.key.letter {
    background: #f5f5f5;
    color: #333;
}

.key.root {
    background: #e3f2fd;
    border-color: #2196f3;
}

.key.stroke {
    background: #ffebee;
    border-color: #f44336;
}

.key span {
    font-size: 10px;
    color: #666;
}

/* 说明文字样式 */
.info-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
}

.info-box h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.info-box li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #ffd700;
}

/* 当量对比表格样式 */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.compare-table th,
.compare-table td {
    padding: 15px;
    text-align: center;
    border: 1px solid #ddd;
}

.compare-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

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

.compare-table tr.highlight {
    background: #fff3cd;
}

.compare-table .highlight-cell {
    color: #d32f2f;
    font-weight: bold;
}

/* 要点列表样式 */
.key-points {
    display: grid;
    gap: 20px;
}

.key-point {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.key-point h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.key-point p {
    color: #555;
    line-height: 1.8;
}

/* 背诵区样式 */
.memorize-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.memorize-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.memorize-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.memorize-card img {
    width: 100%;
    border-radius: 8px;
}

.memorize-card h3 {
    margin-top: 15px;
    color: #333;
}

/* 下载卡片样式 */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.download-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.download-card:hover {
    transform: translateY(-5px);
}

.download-card h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.download-card p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.download-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.download-btn:hover {
    opacity: 0.9;
}

/* 联系页面样式 */
.contact-methods {
    text-align: center;
    padding: 40px;
}

.contact-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.contact-info {
    font-size: 1.5em;
    color: #333;
}

/* 图片画廊样式 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
    max-width: 100%;
    border-radius: 8px;
}

.gallery-item h4 {
    margin-top: 15px;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-item {
        padding: 10px 12px;
        font-size: 14px;
    }

    .hero h1 {
        font-size: 2em;
    }

    .hero .tagline {
        font-size: 1.1em;
    }

    .page-title h1 {
        font-size: 1.8em;
    }

    .card {
        padding: 20px;
    }

    .key {
        width: 40px;
        height: 40px;
        font-size: 10px;
    }

    .key span {
        font-size: 8px;
    }

    .image-gallery {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 双拼布局样式 */
.shuangpin-layout {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
}

.layout-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.layout-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.layout-key {
    width: 55px;
    height: 55px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    position: relative;
}

.layout-key.u-zone { border-color: #e3f2fd; background: #ffebee; }
.layout-key.o-zone { border-color: #fb8c00; background: #fff3e0; }
.layout-key.a-zone { border-color: #e53935; background: #ffebee; }
.layout-key.e-zone { border-color: #43a047; background: #e8f5e9; }
.layout-key.i-zone { border-color: #1e88e5; background: #e3f2fd; }

.layout-key .letter {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.layout-key .yinmu {
    font-size: 10px;
    color: #666;
}

/* 区域说明 */
.zone-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.zone-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
}

.zone-item.u { background: #e3f2fd ; color: blue; }
.zone-item.o { background: #fff3e0; color: blue; }
.zone-item.a { background: #f5f5f5; color: blue; }
.zone-item.e { background: #ffebee; color: blue; }
.zone-item.i { background: #e8f5e9; color: blue; }

/* 统计信息 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* 表格容器 */
.table-container {
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: #fff;
	
}

/* 美化表格 */
.styled-table {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 14px;
    text-align: center;
}

.styled-table th {
    background-color: #f0f7ff;
    color: #333;
    padding: 12px;
    font-weight: bold;
    border-bottom: 2px solid #e0e0e0;
}

.styled-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    color: #555;
}

.styled-table tr:hover {
    background-color: #f8f9fa;
}

.styled-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}
.styled-table td:first-child strong {
    color: blue;
}

/* 特殊音节容器样式 - 保持不变 */
.special-syllables-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* 关键：水平居中对齐 */
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 特殊音节标题 */
.special-syllables-header {
    text-align: center;
    margin-bottom: 15px;
    color: #333;
}

/* 明确的两行布局容器 */
.special-syllables-rows {
    display: flex;
    flex-direction: column;
    gap: 15px; /* 两行之间的间距 */
}

/* 单行样式 */
.special-syllables-row {
    display: flex;
    justify-content: center;
    gap: 50px;
    width: 100%;
}

/* 单个音节项样式 - 保持不变 */
.syllable-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-align: center;
    min-width: 90px; /* 确保每个项有最小宽度 */
}

/* 音节代码和键位样式 - 保持不变 */
.syllable-code {
    font-weight: bold;
    color: #007bff;
    margin-bottom: 4px;
    font-size: 1.1em;
}

.syllable-key {
    font-family: monospace;
    font-weight: bold;
    color: #28a745;
    font-size: 0.9em;
}

/* 击键频率图表容器 */
.key-frequency-chart {
    margin: 30px 0;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* 图表标题 */
.chart-title {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* 键盘布局容器 */
.keyboard-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    background-color: transparent; /* 移除背景色 */
}

/* 键盘行 */
.keyboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0; /* 键位之间靠在一起 */
}

/* 键盘按键 */
.key {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 60px; /* 增大键位尺寸 */
    height: 60px; /* 增大键位尺寸 */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin: 0; /* 移除外边距 */
}

/* 根据百分比设置颜色 */
.key[data-percent="0"] {
    background-color: transparent;
    color: #666;
}

.key[data-percent="2.14"], .key[data-percent="1.97"],  .key[data-percent="2.25"], .key[data-percent="2.27"], .key[data-percent="2.43"], .key[data-percent="2.45"], .key[data-percent="2.46"], .key[data-percent="2.69"], .key[data-percent="2.77"], .key[data-percent="2.96"], .key[data-percent="3.10"], .key[data-percent="3.13"], .key[data-percent="3.28"], .key[data-percent="3.76"], .key[data-percent="3.96"], .key[data-percent="4.23"], .key[data-percent="4.34"], .key[data-percent="4.35"], .key[data-percent="5.19"], .key[data-percent="5.72"], .key[data-percent="5.74"], .key[data-percent="6.96"], .key[data-percent="8.01"], .key[data-percent="9.76"] {
    background-color: #FFD700; /* 黄色 */
}

.key[data-percent="5.19"], .key[data-percent="5.72"], .key[data-percent="5.74"],.key[data-percent="4.35"] ,.key[data-percent="4.34"] ,.key[data-percent="4.23"]{
    background-color: #FF6347; /* 橙色 */
}

.key[data-percent="6.96"], .key[data-percent="8.01"], .key[data-percent="9.76"] {
    background-color: #DC143C; /* 橙色 */
}

/* 首文双拼颜色 */
.key[data-percent="2.11"], .key[data-percent="2.61"], .key[data-percent="2.1"], .key[data-percent="3.03"], .key[data-percent="2.27"], .key[data-percent="1.32"], .key[data-percent="2.25"], .key[data-percent="2.38"], .key[data-percent="2.81"], .key[data-percent="2.84"], .key[data-percent="2.31"], .key[data-percent="1.82"], .key[data-percent="2.67"], .key[data-percent="3.10"], .key[data-percent="2.88"], .key[data-percent="4.34"], .key[data-percent="4.35"], .key[data-percent="5.19"], .key[data-percent="5.72"], .key[data-percent="5.74"], .key[data-percent="6.96"], .key[data-percent="8.01"], .key[data-percent="9.76"] {
    background-color: #FFD700; /* 黄色 */
}

.key[data-percent="6.45"], .key[data-percent="6.72"], .key[data-percent="4.45"],.key[data-percent="5.39"] ,.key[data-percent="4.58"] ,.key[data-percent="3.72"]{
    background-color: #FF6347; /* 橙色 */
}

.key[data-percent="6.96"], .key[data-percent="8.01"], .key[data-percent="9.76"] {
    background-color: #DC143C; /* 橙色 */
}



/* 百分比文本 */
.percent {
    font-size: 0.7em;
    color: #666;
    margin-top: 2px;
}

/* 鼠标悬停效果 */
.key:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 频率统计容器 - 修改 */
.frequency-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding: 0;
    background-color: white;
    border-radius: 0;
}

/* 统计项 - 修改 */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 统计标签 - 修改 */
.stat-label {
    font-weight: 500;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 统计值 - 修改 */
.stat-value {
    font-weight: bold;
    color: white;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 新增：频率统计分组样式 */
.frequency-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

/* 新增：频率统计卡片样式 */
.frequency-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.frequency-card:hover {
    transform: translateY(-2px);
}

.frequency-card .value {
    font-size: 1.0em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.frequency-card .label {
    font-size: 0.9em;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 键盘布局容器 - 修改 */
.keyboard-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    background-color: transparent;
}

/* 键盘行 - 修改 */
.keyboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0;
}

/* 键盘按键 - 修改 */
.key {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin: 0;
    font-size: 14px; /* 增大字体大小 */
}

/* 百分比文本 - 修改 */
.percent {
    font-size: 0.8em;
    color: #666;
    margin-top: 2px;
    font-weight: normal;
}

/* 新增：键盘字母显示样式 */
.key-letter {
    font-size: 18px; /* 显示更大的字母 */
    font-weight: bold;
    position: absolute;
    top: 5px;
    left: 5px;
    color: #333;
    z-index: 1;
}

/* 新增：键盘数字显示样式 */
.key-number {
    font-size: 12px;
    color: #666;
    position: absolute;
    bottom: 5px;
    right: 5px;
    z-index: 1;
}

.practice-options {
    margin-left: 20px;
}

.new-only-option {
    display: inline-block;
    font-size: 0.9em;
}

.footer a {
    color: inherit;
    text-decoration: none;
}
.footer a:hover {
    text-decoration: underline;
}