:root {
    --primary-color: #4CAF50;
    --text-primary: #333;
    --text-secondary: #666;
    --background-color: #f5f5f5;
    --card-background: #fff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
}

.player-container {
    max-width: 100%;
    background: var(--card-background);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    position: relative;
}

.selector-container {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(to right, #4CAF50, #45a049);
}

.selector {
    position: relative;
    flex: 1;
}

.selector select {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: none;
    border-radius: 25px;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.selector select:hover {
    overflow: visible;
}

.selector select option {
    padding: 10px;
    white-space: normal;
}

.current-song {
    text-align: center;
    padding: 20px;
    background: var(--card-background);
}

.current-song h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
}

.current-song p {
    color: var(--text-secondary);
    font-size: 14px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--card-background);
}

.controls button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    transition: transform 0.2s ease;
}

.controls button:hover {
    transform: scale(1.1);
}

.controls button:active {
    transform: scale(0.95);
}

#play-pause {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

#speed-btn {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 15px;
    background: rgba(76, 175, 80, 0.1);
    color: var(--primary-color);
    font-weight: 500;
}

.progress-container {
    padding: 0 20px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-container span {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 45px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.playlist {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 70vh;
    background: var(--card-background);
    transition: bottom 0.3s ease-in-out;
    z-index: 1000;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
}

.playlist.show {
    bottom: 0;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.playlist-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.playlist-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

#playlist-items {
    list-style: none;
    overflow-y: auto;
    max-height: calc(70vh - 60px);
    padding: 10px 0;
}

#playlist-items li {
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#playlist-items li:active {
    background: rgba(76, 175, 80, 0.05);
}

#playlist-items li.playing {
    color: var(--primary-color);
    font-weight: 500;
    background: rgba(76, 175, 80, 0.05);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

#playlist-items li.playing::after {
    content: '🎵';
    margin-left: 10px;
    display: inline-block;
    animation: bounce 0.6s infinite;
    font-size: 14px;
}

.tabs {
    background: var(--card-background);
    margin-top: 1px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #eee;
}

.tab-buttons {
    display: flex;
    background: var(--card-background);
}

.tab-btn {
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
    position: relative;
    color: var(--text-secondary);
    min-width: 80px;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 3px;
}

.tab-content {
    padding: 20px;
    background: var(--card-background);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 添加滚动条样式 */
#playlist-items::-webkit-scrollbar {
    width: 5px;
}

#playlist-items::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}

#playlist-items::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
}

/* 添加原文选项卡相关样式 */
.article-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 15px;
    border-bottom: 1px solid #eee;
}

.frequency-indicators {
    display: flex;
    gap: 15px;
}

.freq {
    font-size: 14px;
}

.freq.high {
    color: #ff4444;
}

.freq.medium {
    color: #2196F3;
}

.freq.low {
    color: #4CAF50;
}

/* 开关按钮样式 */
.translation-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* 文章标题样式 */
.article-title {
    color: #ff8c00;
    font-weight: bold;
    padding: 8px 15px 4px;
    margin: 0;
    font-size: 20px;
    text-align: center;
}

/* 文章内容样式 */
.article-content {
    padding: 6px 15px 12px;
    line-height: 1.4;
    font-size: 16px;
    color: #333;
}

.article-content p {
    text-indent: 32px;
    margin-bottom: 0.4em;
}

.article-content p:last-child {
    margin-bottom: 0;
}

/* 修改正文中高频词样式 */
.word-high {
    color: #ff4444;
    border-bottom: 1px dotted #ff4444;
    text-decoration: none;
    padding-bottom: 2px;
}

.word-medium {
    color: #2196F3;
    border-bottom: 1px dotted #2196F3;
    text-decoration: none;
    padding-bottom: 2px;
}

.word-low {
    color: #4CAF50;
    border-bottom: 1px dotted #4CAF50;
    text-decoration: none;
    padding-bottom: 2px;
}

/* 底部翻译遮罩层样式 */
.translation-overlay {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(51, 51, 51, 0.5);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    padding: 15px 20px;
    max-height: 80px;
}

.translation-overlay.show {
    display: block;
}

.translation-content {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
    font-weight: normal;
}

/* 核心单词选项卡样式 */
.core-words {
    padding: 15px;
}

.word-item {
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.word-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.word-index {
    min-width: 25px;
    color: #666;
    font-size: 14px;
}

.word {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.phonetic {
    color: #666;
    font-family: Arial, sans-serif;
}

/* 修改频率标签样式 */
.frequency-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #ffffff; /* 所有频率标签文字都为白色 */
    margin-left: auto;
    font-weight: 500;
}

.frequency-tag.high {
    background-color: #ff4444; /* 红色背景 */
}

.frequency-tag.medium {
    background-color: #2196F3; /* 蓝色背景 */
}

.frequency-tag.low {
    background-color: #4CAF50; /* 绿色背景 */
}

/* 单词项中的单词样式 */
.word-item.high .word {
    color: #ff4444;
}

.word-item.medium .word {
    color: #2196F3;
}

.word-item.low .word {
    color: #4CAF50;
}

/* 正文中的单词样式 */
.word-high {
    color: #ff4444;
    border-bottom: 1px dotted #ff4444;
    text-decoration: none;
    padding-bottom: 2px;
}

.word-medium {
    color: #2196F3;
    border-bottom: 1px dotted #2196F3;
    text-decoration: none;
    padding-bottom: 2px;
}

.word-low {
    color: #4CAF50;
    border-bottom: 1px dotted #4CAF50;
    text-decoration: none;
    padding-bottom: 2px;
}

/* 可以微调一下悬停状态下的显示效果 */
.word-item:hover .frequency-tag.high {
    background-color: #ff5555;
}

.word-item:hover .frequency-tag.medium {
    background-color: #2EA1FF;
}

.word-item:hover .frequency-tag.low {
    background-color: #55B955;
}

.play-icon {
    font-size: 18px;
    color: #666;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    margin-left: 8px;
}

.word-meaning {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    padding-left: 25px;
}

/* 悬停效果 */
.word-item:hover {
    background: #f0f1f2;
}

.play-icon:hover {
    opacity: 1;
}

/* 播放状态 */
.word-item.playing {
    background: #e3f2fd;
}

/* 添加点击效果 */
.word-item:active {
    background: #e9ecef;
}

/* 添加加载状态和错误状态样式 */
.word-item .play-icon {
    transition: transform 0.3s ease;
}

.word-item.loading .play-icon {
    animation: spin 1s infinite linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 添加错误状态样式 */
.word-item.error .play-icon {
    color: #ff4444;
}

/* 添加联动相关样式 */
.word-highlight {
    background-color: rgba(255, 255, 0, 0.3);
    border-radius: 2px;
}

.current-paragraph {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 添加交互状态样式 */
.word-high:hover,
.word-medium:hover,
.word-low:hover {
    cursor: pointer;
    background-color: rgba(255, 255, 0, 0.2);
}

.word-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
