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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
    background: #ffffff;
    color: #37352f;
    line-height: 1.5;
    height: 100vh;
    margin: 0;
    padding: 0;
    font-weight: 400;
    font-style: normal;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding-top: 45px;
}

/* 页面布局 - 撑满一屏 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: #37352f;
    height: 100vh;
}

/* 顶部导航栏固定高度 */
.top-nav {
    height: 45px;
    flex-shrink: 0;
    background: #ffffff;
    border-bottom: 1px solid #e9e9e7;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* 主容器使用剩余高度 */
.main-container {
    height: calc(100vh - 45px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    overflow: hidden;
}

/* 导航容器 */
.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-logo {
    font-size: 18px;
    font-weight: 700;
    color: #37352f;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
}

.nav-logo:hover {
    color: #2eaadc;
}

.main-content {
    text-align: center;
    width: 100%;
    z-index: 10;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* 随机单词显示样式 - Notion风格 */
.random-word-container {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    padding: 0 16px;
}

.random-word {
    font-size: 64px;
    font-weight: 700;
    color: #37352f;
    margin-bottom: 24px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.random-word:hover {
    color: #2eaadc;
    transform: none;
}

.random-word-info {
    margin-bottom: 24px;
    background: #ffffff;
    border-radius: 4px;
    padding: 32px 24px;
    box-shadow: 0 1px 2px rgba(15, 15, 15, 0.1);
    max-width: 100%;
    margin: 0 auto 24px;
    border: 1px solid #e9e9e7;
}

.word-pronunciation {
    font-size: 20px;
    color: #787774;
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.word-definition {
    font-size: 16px;
    color: #37352f;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
}

.word-definition .part-of-speech {
    font-weight: 600;
    color: #787774;
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
    text-transform: lowercase;
}

.refresh-word-btn {
    background: #f7f6f3;
    border: 1px solid #e9e9e7;
    border-radius: 3px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.refresh-word-btn:hover {
    background: #f1f0ed;
    border-color: #d1d1d1;
}

.refresh-word-btn svg {
    stroke: #787774;
    transition: all 0.15s ease;
}

.refresh-word-btn:hover svg {
    stroke: #37352f;
}

.word-loading, .word-error {
    color: #787774;
    font-style: italic;
}

.hidden {
    display: none !important;
}

/* 音素显示样式 - Notion风格 */
.word-with-phonemes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.main-word {
    font-size: 64px;
    font-weight: 700;
    color: #37352f;
    cursor: pointer;
    transition: color 0.15s ease;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.main-word:hover {
    color: #2eaadc;
}

.phoneme-breakdown {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    overflow-x: auto;
    padding: 0 16px;
    max-width: 100%;
}

.phoneme-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 48px;
    flex-shrink: 0;
}

.grapheme {
    font-size: 32px;
    font-weight: 600;
    color: #37352f;
    background: #f7f6f3;
    border: 1px solid #e9e9e7;
    border-radius: 3px;
    padding: 8px 12px;
    min-width: 48px;
    text-align: center;
    transition: all 0.15s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
}

.grapheme:hover {
    background: #f1f0ed;
    border-color: #d1d1d1;
}

.phoneme-symbol {
    font-size: 20px;
    color: #37352f;
    background: #ffffff;
    border: 1px solid #e9e9e7;
    border-radius: 3px;
    padding: 6px 10px;
    min-width: 48px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s ease;
    position: relative;
}

.phoneme-symbol:hover {
    background: #f7f6f3;
    border-color: #d1d1d1;
}

.phoneme-audio-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.phoneme-audio-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.phoneme-audio-btn svg {
    width: 12px;
    height: 12px;
}

.pronunciation-section {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.pronunciation-section .audio-btn {
    background: #f7f6f3;
    border: 1px solid #e9e9e7;
    border-radius: 3px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.pronunciation-section .audio-btn:hover {
    background: #f1f0ed;
    border-color: #d1d1d1;
}

.pronunciation-section .audio-btn svg {
    stroke: #787774;
    width: 14px;
    height: 14px;
    transition: all 0.15s ease;
}

.pronunciation-section .audio-btn:hover svg {
    stroke: #37352f;
}

/* 单词分解显示样式 - Notion风格 */
.word-with-segments {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.segment-breakdown {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    overflow-x: auto;
    padding: 0 16px;
    max-width: 100%;
}

.segment-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 48px;
    flex-shrink: 0;
}

.segment-category {
    font-size: 12px;
    color: #787774;
    text-align: center;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif;
}


/* 搜索结果中的分解信息样式 */
.word-segments-info {
    margin: 1rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* 紧凑版单词分解显示样式（用于搜索结果列表） */
.word-with-segments-compact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
}

.main-word-compact {
    font-size: 1.5rem;
    font-weight: 500;
    color: #1C00CA;
    margin: 0;
    line-height: 1.2;
}

.segment-breakdown-compact {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.segment-group-compact {
    display: flex;
    align-items: center;
}

.grapheme-compact {
    font-size: 0.9rem;
    font-weight: 500;
    border: 1.5px solid;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    min-width: 24px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: help;
}

.grapheme-compact:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 响应式设计 - Notion风格 */
@media (max-width: 768px) {
    .random-word {
        font-size: 48px;
    }
    
    .main-word {
        font-size: 48px;
    }
    
    .random-word-info {
        padding: 24px 16px;
        margin: 0 8px 24px;
    }
    
    .phoneme-breakdown, .segment-breakdown {
        gap: 12px;
        padding: 0 8px;
    }
    
    .grapheme {
        font-size: 24px;
        padding: 6px 8px;
        min-width: 36px;
    }
    
    .phoneme-symbol {
        font-size: 16px;
        padding: 4px 6px;
        min-width: 36px;
    }
    
    .segment-category {
        font-size: 11px;
    }
}
