* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f0f;
    --bg-card: #1e1e1e;
    --bg-player: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #6b7280;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, 0.1);
    --border: #333;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.3);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 120px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga', 'kern';
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeIn var(--transition-slow);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    text-align: center;
    margin-bottom: 50px;
    animation: slideDown var(--transition-slow);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header h1 {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6, #fbbf24);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
    letter-spacing: -0.03em;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

header p {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

header p {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
}

.filter-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 50px;
    animation: fadeIn var(--transition-slow) 200ms;
}

.filter-tab {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.filter-tab:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.filter-tab:active {
    transform: translateY(0);
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* Load More Button */
.load-more-btn {
    grid-column: 1 / -1;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-top: 1rem;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, #2a2a2a 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 160px;
    padding: 24px;
}

.skeleton-text {
    height: 20px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.long {
    width: 90%;
}

.episode-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    /* GPU acceleration for smoother animations */
    will-change: transform, opacity;
    transform: translateZ(0);
}

.episode-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
}

.episode-card:active {
    transform: translateY(-2px);
}

.episode-card .episode-number {
    font-size: 14px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.9;
}

.episode-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.4;
    transition: color var(--transition-fast);
}

.episode-card:hover h3 {
    color: var(--accent);
}

.episode-card .level-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all var(--transition-fast);
}

.episode-card:hover .level-badge {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Full dialogue container */
.full-dialogue .dialogue-line {
    margin-bottom: 12px;
}

.full-dialogue .speaker-badge {
    display: inline-block;
}

.full-dialogue .dialogue-text {
    margin-top: 8px;
    font-size: 15px;
}

.episode-detail {
    max-width: 900px;
    margin: 0 auto 40px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 32px;
    position: relative;
    animation: scaleIn var(--transition-base);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition-base);
    font-weight: 500;
}

.close-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.close-btn:active {
    transform: scale(0.98);
}

.detail-header {
    margin-bottom: 30px;
}

.detail-level {
    display: inline-block;
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.detail-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.tabs-section {
    margin-bottom: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tabs {
    display: flex;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    border-bottom: 2px solid transparent;
    position: relative;
    z-index: 1;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--accent-light);
}

.tab-btn.active {
    color: var(--accent);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.tab-btn.active::after {
    transform: scaleX(1);
    box-shadow: 0 0 10px var(--accent);
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition-base);
}

.show-btn {
    padding: 10px 20px;
    background: var(--accent);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-base);
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.show-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.show-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.content-area {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    max-height: 600px;
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar */
.content-area::-webkit-scrollbar {
    width: 8px;
}

.content-area::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.content-area::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

.transcript-content h2 {
    font-size: 20px;
    margin: 24px 0 16px;
    color: var(--text-primary);
}

.dialogue-line {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 12px;
    transition: all var(--transition-base);
    animation: slideInLeft var(--transition-base);
    animation-fill-mode: both;
    border: 1px solid transparent;
}

.dialogue-line:nth-child(odd) {
    animation-delay: 50ms;
}

.dialogue-line:nth-child(even) {
    animation-delay: 100ms;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.speaker-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-fast);
    letter-spacing: 0.5px;
}

.dialogue-line:hover .speaker-badge {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.speaker-badge.speaker-a {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4), 0 0 20px rgba(251, 191, 36, 0.2);
}

.speaker-badge.speaker-b {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4), 0 0 20px rgba(16, 185, 129, 0.2);
}

.dialogue-text {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 15px;
}

.dialogue-line:hover {
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Speaker A - Yellow/Amber theme */
.speaker-a .dialogue-line,
.dialogue-line:has(.speaker-badge.speaker-a) {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08), rgba(245, 158, 11, 0.05));
    border-color: rgba(251, 191, 36, 0.2);
}

.dialogue-line:has(.speaker-badge.speaker-a):hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(245, 158, 11, 0.08));
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.15);
}

/* Speaker B - Green/Cyan theme */
.speaker-b .dialogue-line,
.dialogue-line:has(.speaker-badge.speaker-b) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 182, 212, 0.05));
    border-color: rgba(16, 185, 129, 0.2);
}

.dialogue-line:has(.speaker-badge.speaker-b):hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.08));
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.15);
}

.vocab-section {
    margin-bottom: 40px;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vocab-section:first-child {
    margin-top: 0;
}

.vocab-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

.vocab-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.vocab-table tr {
    border-bottom: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.vocab-table tr:last-child {
    border-bottom: none;
}

.vocab-table tr:hover {
    background: var(--accent-light);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.vocab-table td {
    padding: 16px 12px;
    vertical-align: top;
    transition: color var(--transition-fast);
}

.vocab-word {
    color: #10b981;
    font-weight: 700;
    font-size: 16px;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.speak-btn {
    background: transparent;
    border: none;
    color: #10b981;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.speak-btn:hover {
    opacity: 1;
    background: rgba(16, 185, 129, 0.1);
    transform: scale(1.1);
}

.speak-btn:active {
    transform: scale(0.95);
}

.practice-vocab-btn {
    background: transparent;
    border: none;
    color: #6366f1;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.practice-vocab-btn:hover {
    opacity: 1;
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.1);
}

.practice-vocab-btn:active {
    transform: scale(0.95);
}

.vocab-table tr:hover .practice-vocab-btn {
    opacity: 0.8;
    color: #818cf8;
}

.vocab-table tr:hover .speak-btn {
    opacity: 0.8;
}

.vocab-table tr:hover .vocab-word {
    color: #34d399;
}

.vocab-table tr:hover .speak-btn {
    color: #34d399;
}

.vocab-type {
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 14px;
    min-width: 100px;
}

.vocab-def {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.7;
}

.audio-section {
    margin-top: 20px;
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.custom-player {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: #333;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-filled {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.time-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 90px;
}

.time-display .separator {
    color: var(--text-tertiary);
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    position: relative;
}

.control-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0);
    transition: transform var(--transition-base);
}

.control-btn:hover::before {
    transform: scale(1);
}

.control-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.play-btn {
    background: var(--accent);
    width: 48px;
    height: 48px;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    position: relative;
}

.control-btn.play-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.control-btn.play-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

.control-btn.play-btn:active {
    transform: scale(1.05);
}

.loading-spinner {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.control-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.control-btn#speedBtn {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
}

.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-player);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.player-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.player-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.player-info .level-badge {
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

audio {
    width: 100%;
    height: 40px;
    outline: none;
}

audio::-webkit-media-controls-panel {
    background-color: var(--bg-card);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Responsive Design */

/* Tablet landscape (1024px - 1400px) */
@media (max-width: 1400px) {
    .container {
        max-width: 100%;
        padding: 30px 20px;
    }
    
    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

/* Tablet portrait (768px - 1024px) */
@media (max-width: 1024px) {
    header h1 {
        font-size: 48px;
    }
    
    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .episode-detail {
        padding: 24px;
    }
    
    .filter-tabs {
        gap: 10px;
    }
    
    .filter-tab {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Mobile landscape & small tablets (600px - 768px) */
@media (max-width: 768px) {
    header h1 {
        font-size: 36px;
    }
    
    header p {
        font-size: 16px;
    }
    
    .container {
        padding: 20px 16px;
    }
    
    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
    
    .episode-card {
        padding: 16px;
    }
    
    .episode-card h3 {
        font-size: 16px;
    }
    
    .filter-tabs {
        gap: 8px;
        margin-bottom: 30px;
    }
    
    .filter-tab {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .episode-detail {
        padding: 20px;
    }
    
    .detail-header h2 {
        font-size: 24px;
    }
    
    .tabs {
        flex-direction: row;
    }
    
    .tab-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .controls {
        gap: 12px;
    }
    
    .control-btn.play-btn {
        width: 56px;
        height: 56px;
    }
}

/* Mobile portrait (< 600px) */
@media (max-width: 600px) {
    header h1 {
        font-size: 28px;
    }
    
    header p {
        font-size: 14px;
    }
    
    body {
        padding-bottom: 80px;
    }
    
    .container {
        padding: 16px 12px;
    }
    
    .episodes-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .episode-card {
        padding: 16px;
    }
    
    .filter-tabs {
        gap: 6px;
        margin-bottom: 20px;
    }
    
    .filter-tab {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .episode-detail {
        padding: 16px;
        border-radius: 8px;
    }
    
    .close-btn {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .detail-header h2 {
        font-size: 20px;
        margin-top: 8px;
    }
    
    .tabs {
        border-radius: 6px 6px 0 0;
    }
    
    .tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .tab-content {
        padding: 12px;
    }
    
    .show-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .dialogue-line {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .speaker-badge {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .dialogue-text {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .vocab-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .vocab-word {
        font-size: 14px;
        min-width: 80px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .speak-btn {
        padding: 3px;
    }
    
    .speak-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .vocab-type {
        font-size: 12px;
        min-width: 120px;
    }
    
    .vocab-def {
        font-size: 13px;
    }
    
    .audio-section {
        padding: 12px;
    }
    
    .controls {
        gap: 8px;
    }
    
    .control-btn {
        padding: 6px;
    }
    
    .control-btn.play-btn {
        width: 48px;
        height: 48px;
    }
    
    .control-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .control-btn.play-btn svg {
        width: 28px;
        height: 28px;
    }
    
    .time-display {
        font-size: 12px;
        min-width: 80px;
    }
}

/* Very small devices (< 380px) */
@media (max-width: 380px) {
    header h1 {
        font-size: 24px;
    }
    
    .filter-tab {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .control-btn#speedBtn,
    .control-btn#volumeBtn {
        order: 3;
    }
}

/* Repeat Button States */
.repeatBtn.setting {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

.repeatBtn.active {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
}

/* Repeat Markers on Progress Bar */
.repeat-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 3;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.repeat-start {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
}

.repeat-end {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.repeat-region {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(81, 207, 102, 0.2);
    z-index: 2;
    pointer-events: none;
}

/* Notification Toast */
.notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 30, 46, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Pronunciation Practice Styles */
.practice-container {
    padding: 20px;
}

.practice-header {
    text-align: center;
    margin-bottom: 20px;
}

.practice-header h3 {
    font-size: 22px;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.practice-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.practice-mode-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.mode-btn {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 2px solid var(--border);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: white;
    border-color: var(--accent);
}

.role-selector {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

.role-selector p {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.role-btn {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 2px solid var(--border);
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.role-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    transform: scale(1.05);
}

.role-btn.active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #10b981;
}

.roleplay-context {
    padding: 10px;
}

.your-turn {
    color: #10b981;
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0 10px 0;
}

.practice-text {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    min-height: 80px;
    border: 2px solid var(--border);
    max-height: 400px;
    overflow-y: auto;
}

.full-dialogue p {
    margin: 12px 0;
    line-height: 1.6;
}

.practice-quote {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    font-style: italic;
}

.practice-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.practice-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.practice-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.practice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.practice-btn.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

.recording-status {
    text-align: center;
    min-height: 24px;
    font-size: 14px;
    margin-bottom: 20px;
}

.pronunciation-score {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--accent);
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.score-value {
    font-size: 48px;
    font-weight: 700;
    color: white;
}

.score-label {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
}

.score-feedback {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

.dialogue-line {
    cursor: pointer;
    transition: all 0.2s ease;
}

.dialogue-line:hover {
    transform: translateX(4px);
    opacity: 0.8;
}

@media (max-width: 600px) {
    .notification {
        bottom: 80px;
        font-size: 13px;
        padding: 10px 20px;
    }
    
    .practice-mode-selector {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .role-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .role-btn {
        width: 100%;
    }
    
    .practice-controls {
        flex-direction: column;
    }
    
    .practice-btn {
        width: 100%;
        justify-content: center;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-value {
        font-size: 40px;
    }
    
    .vocab-word {
        gap: 6px;
    }
    
    .practice-vocab-btn {
        padding: 3px;
    }
}

.full-dialogue {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    min-height: 80px;
    border: 2px solid var(--border);
    max-height: 400px;
    overflow-y: auto;
}

.full-dialogue p {
    margin: 12px 0;
    line-height: 1.6;
}

.practice-quote {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    font-style: italic;
}

.practice-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.practice-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.practice-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.practice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.practice-btn.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse 1.5s ease-in-out infinite;
}

.recording-status {
    text-align: center;
    min-height: 24px;
    font-size: 14px;
    margin-bottom: 20px;
}

.pronunciation-score {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--accent);
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.score-value {
    font-size: 48px;
    font-weight: 700;
    color: white;
}

.score-label {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
}

.score-feedback {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

.dialogue-line {
    cursor: pointer;
    transition: all 0.2s ease;
}

.dialogue-line:hover {
    transform: translateX(4px);
    opacity: 0.8;
}

@media (max-width: 600px) {
    .notification {
        bottom: 80px;
        font-size: 13px;
        padding: 10px 20px;
    }
    
    .practice-mode-selector {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .role-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .role-btn {
        width: 100%;
    }
    
    .practice-controls {
        flex-direction: column;
    }
    
    .practice-btn {
        width: 100%;
        justify-content: center;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-value {
        font-size: 40px;
    }
    
    .vocab-word {
        gap: 6px;
    }
    
    .practice-vocab-btn {
        padding: 3px;
    }
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.score-value {
    font-size: 48px;
    font-weight: 700;
    color: white;
}

.score-label {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
}

.score-feedback {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

.dialogue-line {
    cursor: pointer;
    transition: all 0.2s ease;
}

.dialogue-line:hover {
    transform: translateX(4px);
    opacity: 0.8;
}

@media (max-width: 600px) {
    .notification {
        bottom: 80px;
        font-size: 13px;
        padding: 10px 20px;
    }
    
    .practice-mode-selector {
        flex-direction: column;
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .role-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .role-btn {
        width: 100%;
    }
    
    .practice-controls {
        flex-direction: column;
    }
    
    .practice-btn {
        width: 100%;
        justify-content: center;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-value {
        font-size: 40px;
    }
    
    .vocab-word {
        gap: 6px;
    }
    
    .practice-vocab-btn {
        padding: 3px;
    }
}


