* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    height: 100vh;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.container {
    max-width: 1200px;
    height: 100vh;
    margin: 0 auto;
    background: white;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #60a5fa 100%);
    color: white;
    text-align: center;
    padding: 12px 8px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header h1 {
    font-size: 1.8rem;
    margin-bottom: 4px;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.4);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1rem;
    opacity: 0.95;
    line-height: 1.2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.animation-section {
    margin: 0;
    padding: 0;
    background: #000;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 100;
    height: auto;
    min-height: auto;
}

.animation-container {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12px;
    box-sizing: border-box;
}

.animation-image {
    width: 100%;
    height: auto;
    max-width: 500px;
    margin: 0 auto 0px;
    border-radius: 0;
    overflow: hidden;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    object-fit: contain;
    transition: opacity 0.3s ease;
    opacity: 1;
    min-height: 200px;
    position: relative;
}

.current-symbol {
    font-size: 1.2rem;
    font-weight: bold;
    color: #495057;
    margin-bottom: 4px;
}

.current-description {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.3;
    max-height: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 主标签样式 */
.main-tabs {
    background: white;
    padding: 2px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.main-tab-buttons {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.main-tab-button {
    flex: 1;
    padding: 12px 10px;
    background: #f8f9fa;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1.2rem;
    font-weight: bold;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    line-height: 1.1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.main-tab-button:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.main-tab-button.active {
    background: white;
    color: #1e3a8a;
    border-bottom: 3px solid #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    font-weight: 700;
}

.main-tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-radius: 2px;
}

.main-tab-content {
    padding: 12px 10px;
    flex: 1;
    overflow-y: auto;
    height: calc(100vh - 150px);
    min-height: 200px;
}



/* 元音分类样式 */
.vowel-category {
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background-color: #f8f9fa;
}

.vowel-category h3 {
    margin-top: 2px;
    margin-bottom: 3px;
    color: #495057;
    font-size: 1em;
    font-weight: bold;
}

/* 前元音部分用一行显示，卡片宽度平均分配 */
#frontVowelsGrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 3px 0;
    margin-top: 4px;
}

/* 中元音部分用一行显示，卡片宽度平均分配 */
#centralVowelsGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 3px 0;
    margin-top: 4px;
}

/* 后元音部分用一行显示，卡片宽度平均分配 */
#backVowelsGrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 3px 0;
    margin-top: 4px;
}

/* 开合双元音部分用一行显示，卡片宽度平均分配 */
#closingDiphthongsGrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 3px 0;
    margin-top: 4px;
}

/* 集中双元音部分用一行显示，卡片宽度平均分配 */
#centeringDiphthongsGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 3px 0;
    margin-top: 4px;
}

.phonetic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 4px;
}

/* 摩擦音清辅音网格 - 5个音标，一行显示 */
#fricativesVoicelessGrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 4px;
}

/* 摩擦音浊辅音网格 - 5个音标，一行显示 */
#fricativesVoicedGrid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 4px;
}

/* 爆破音清辅音网格 - 3个音标，一行显示 */
#plosivesVoicelessGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
}

/* 爆破音浊辅音网格 - 3个音标，一行显示 */
#plosivesVoicedGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
}

/* 破擦音清辅音网格 - 3个音标，一行显示 */
#affricatesVoicelessGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
}

/* 破擦音浊辅音网格 - 3个音标，一行显示 */
#affricatesVoicedGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.phonetic-card {
    background: white;
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.phonetic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    border-color: #3b82f6;
}

.phonetic-card.active {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #3b82f620 0%, #1e3a8a20 100%);
}

.phonetic-symbol {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 4px;
    color: #495057;
    line-height: 1;
}

.speaker-icon {
    width: 20px;
    height: 20px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

.speaker-icon:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.speaker-icon::before {
    content: '🔊';
    font-size: 10px;
    color: white;
}

.vowel-section {
    display: none;
}

.consonant-section {
    display: none;
}

.active-tab {
    display: block;
}

@media (max-width: 768px) {
    body {
        padding: 0;
        height: 100vh;
    }
    
    .container {
        border-radius: 0;
        height: 100vh;
    }
    
    .header {
        padding: 25px 15px;
    }
    
    .header h1 {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }
    
    .header p {
        font-size: 0.8rem;
    }
    
    .animation-section {
        padding: 15px;
    }
    
    .main-tab-buttons {
        border-bottom: 2px solid #e9ecef;
    }
    
    .main-tab-button {
        padding: 10px 8px;
        font-size: 1.1rem;
        border-bottom: 2px solid transparent;
    }
    
    .main-tab-button.active {
        border-bottom: 2px solid #3b82f6;
    }
    
    .main-tab-content {
        height: calc(100vh - 220px);
        min-height: 180px;
    }
    
    .current-symbol {
        font-size: 1rem;
    }
    
    .animation-container {
        max-width: 100%;
        padding: 12px;
    }
    
    .animation-image {
        width: 100%;
        height: auto;
        max-width: 300px;
        font-size: 2.5rem;
    }
    
    .current-symbol {
        font-size: 1.6rem;
    }
    
    .phonetic-tabs {
        padding: 0 10px;
    }
    
    .tab-button {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .tab-content {
        padding: 15px 10px;
        min-height: 250px;
    }
    
    .tab-content h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .phonetic-grid {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下前元音网格 - 4个音标，一行显示 */
    #frontVowelsGrid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下中元音网格 - 3个音标，一行显示 */
    #centralVowelsGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下后元音网格 - 5个音标，一行显示 */
    #backVowelsGrid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下开合双元音网格 - 5个音标，一行显示 */
    #closingDiphthongsGrid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下集中双元音网格 - 3个音标，一行显示 */
    #centeringDiphthongsGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下摩擦音清辅音网格 - 5个音标，一行显示 */
    #fricativesVoicelessGrid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下摩擦音浊辅音网格 - 5个音标，一行显示 */
    #fricativesVoicedGrid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下爆破音清辅音网格 - 3个音标，一行显示 */
    #plosivesVoicelessGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下爆破音浊辅音网格 - 3个音标，一行显示 */
    #plosivesVoicedGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下破擦音清辅音网格 - 3个音标，一行显示 */
    #affricatesVoicelessGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    /* 小屏幕下破擦音浊辅音网格 - 3个音标，一行显示 */
    #affricatesVoicedGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 10px;
    }
    
    .phonetic-card {
        padding: 10px 6px;
        border-radius: 8px;
    }
    
    .phonetic-symbol {
        font-size: 1.5rem;
        margin-bottom: 4px;
    }
    
    .phonetic-name {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }
    
    .speaker-icon {
        width: 20px;
        height: 20px;
    }
    
    .speaker-icon::before {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 8px 6px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    }
    
    .header h1 {
        font-size: 1.4rem;
        margin-bottom: 3px;
        line-height: 1.1;
        font-weight: 700;
        letter-spacing: 0.3px;
        text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
    }
    
    .header p {
        font-size: 0.9rem;
        line-height: 1.1;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    }
    
    .main-tab-buttons {
        border-bottom: 1px solid #e9ecef;
    }
    
    .main-tab-button {
        padding: 8px 6px;
        font-size: 1rem;
        border-bottom: 2px solid transparent;
    }
    
    .main-tab-button.active {
        border-bottom: 2px solid #3b82f6;
        font-weight: 700;
    }
    
    .main-tab-content {
        height: calc(100vh - 90px);
        min-height: 150px;
    }
    
    .current-symbol {
        font-size: 0.9rem;
    }
    
    .animation-section {
        padding: 8px;
    }
    
    .animation-container {
        padding: 6px;
    }
    
    .animation-image {
        max-width: 100%;
        font-size: 1.8rem;
    }
    
    .phonetic-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 6px;
    }
    
    /* 超小屏幕下前元音网格 - 4个音标，一行显示 */
    #frontVowelsGrid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    /* 超小屏幕下中元音网格 - 3个音标，一行显示 */
    #centralVowelsGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    /* 超小屏幕下后元音网格 - 5个音标，一行显示 */
    #backVowelsGrid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    /* 超小屏幕下开合双元音网格 - 5个音标，一行显示 */
    #closingDiphthongsGrid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    /* 超小屏幕下集中双元音网格 - 3个音标，一行显示 */
    #centeringDiphthongsGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    /* 超小屏幕下摩擦音清辅音网格 - 5个音标，一行显示 */
    #fricativesVoicelessGrid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    /* 超小屏幕下摩擦音浊辅音网格 - 5个音标，一行显示 */
    #fricativesVoicedGrid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    /* 超小屏幕下爆破音清辅音网格 - 3个音标，一行显示 */
    #plosivesVoicelessGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    /* 超小屏幕下爆破音浊辅音网格 - 3个音标，一行显示 */
    #plosivesVoicedGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    /* 超小屏幕下破擦音清辅音网格 - 3个音标，一行显示 */
    #affricatesVoicelessGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    /* 超小屏幕下破擦音浊辅音网格 - 3个音标，一行显示 */
    #affricatesVoicedGrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin-top: 10px;
    }
    
    .phonetic-symbol {
        font-size: 1.3rem;
    }
    
    .phonetic-name {
        font-size: 0.65rem;
    }
    
    .animation-container {
        max-width: 100%;
    }
    
    .animation-image {
        width: 100%;
        height: auto;
        max-width: 280px;
        font-size: 2rem;
    }
}

/* 针对iPhone XR等中等手机屏幕的优化 */
@media (max-width: 414px) {
    .header {
        padding: 7px 5px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    }
    
    .header h1 {
        font-size: 1.3rem;
        margin-bottom: 2px;
        line-height: 1.1;
        font-weight: 700;
        letter-spacing: 0.2px;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    }
    
    .header p {
        font-size: 0.85rem;
        line-height: 1.1;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    }
    
    .main-tab-buttons {
        border-bottom: 1px solid #e9ecef;
    }
    
    .main-tab-button {
        padding: 7px 5px;
        font-size: 0.95rem;
        border-bottom: 2px solid transparent;
    }
    
    .main-tab-button.active {
        border-bottom: 2px solid #3b82f6;
        font-weight: 700;
    }
    
    .main-tab-content {
        height: calc(100vh - 85px);
        min-height: 140px;
    }
    
    .animation-section {
        padding: 6px;
    }
    
    .animation-container {
        padding: 4px;
    }
    
    .animation-image {
        max-width: 100%;
        font-size: 1.6rem;
    }
    
    .current-symbol {
        font-size: 0.8rem;
    }
}

/* 针对iPhone XR等超小屏幕的优化 */
@media (max-width: 375px) {
    .header {
        padding: 6px 4px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .header h1 {
        font-size: 1.2rem;
        margin-bottom: 1px;
        line-height: 1.1;
        font-weight: 700;
        letter-spacing: 0.1px;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
    }
    
    .header p {
        font-size: 0.8rem;
        line-height: 1.1;
        text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
    }
    
    .main-tab-buttons {
        border-bottom: 1px solid #e9ecef;
    }
    
    .main-tab-button {
        padding: 6px 4px;
        font-size: 0.9rem;
        border-bottom: 2px solid transparent;
    }
    
    .main-tab-button.active {
        border-bottom: 2px solid #3b82f6;
        font-weight: 700;
    }
    
    .main-tab-content {
        height: calc(100vh - 75px);
        min-height: 130px;
    }
    
    .animation-section {
        padding: 4px;
    }
    
    .animation-container {
        padding: 3px;
    }
    
    .animation-image {
        max-width: 100%;
        font-size: 1.5rem;
    }
    
    .current-symbol {
        font-size: 0.75rem;
    }
}