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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.header {
    background-color: #2c3e50;
    color: white;
    padding: 8px 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.5em;
    margin: 0 0 0 20px;
    display: inline-block;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
}

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

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.about-link {
    color: #3498db;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-right: 20px;
}

.about-link:hover {
    color: #2980b9;
    background-color: rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hsk-tabs {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.hsk-tab {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    background: #34495e;
    color: #ecf0f1;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.hsk-tab:hover {
    background: #2c3e50;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hsk-tab.active {
    background: #3498db;
    color: white;
}

.hsk-stories {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hsk-stories.active {
    display: flex;
}

.story-selector {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.story-selector label {
    font-size: 1.1em;
    font-weight: bold;
    color: #ecf0f1;
}

.story-selector select {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #ecf0f1;
    color: #2c3e50;
    font-size: 1em;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.3s ease;
}

.story-selector select:hover {
    background: #bdc3c7;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.story-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3498db;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

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

.main-content {
    background: #f5f0e8;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 600px;
    margin-bottom: 20px;
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
}

.top-navigation {
    margin-top: 0;
    margin-bottom: 15px;
    padding-top: 0;
    padding-bottom: 0;
}

.nav-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.story-content {
    font-size: 18px;
    line-height: 2;
    color: #333;
}

.story-title {
    font-size: 2em;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 15px;
}

.story-paragraph {
    margin-bottom: 20px;
    text-align: justify;
}

.story-image {
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.story-meta {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.story-meta h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.meta-item {
    margin: 5px 0;
    font-size: 14px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
    background: #fdf2f2;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

/* Audio Player Styles */
.audio-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: nowrap;
    width: 100%;
    overflow: hidden;
}

.audio-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    font-weight: 600;
    min-width: 60px;
}

.btn-play {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-play:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-pause {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-pause:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-stop {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-stop:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.audio-progress {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    border: 1px solid #dee2e6;
    min-width: 100px;
}

.audio-progress:hover {
    background: #dee2e6;
}

.audio-progress-fill {
    height: 100%;
    background: #007bff;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
    min-width: 2px;
}

.audio-time {
    font-size: 10px;
    color: #6c757d;
    min-width: 40px;
    max-width: 50px;
    text-align: center;
    font-weight: 500;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-prev-line, .btn-next-line {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    font-size: 12px;
    padding: 6px 8px;
    min-width: 32px;
    width: 32px;
    height: 28px;
}

.btn-prev-line:hover, .btn-next-line:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.story-text {
    position: relative;
    line-height: 2;
    text-align: justify;
    margin-bottom: 20px;
}

.story-paragraph {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 12px;
    line-height: 1.8;
    text-align: justify;
}

.story-paragraph:hover {
    background: #e3f2fd;
}

.story-paragraph.active {
    background: #2196f3;
    color: white;
}

.api-status {
    text-align: center;
    margin: 10px 0;
    font-size: 14px;
    padding: 8px;
    border-radius: 4px;
}

.status-supported {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-unsupported {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .main-content {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.3em;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-left {
        width: 100%;
        justify-content: center;
    }
    
    .header-center {
        width: 100%;
        justify-content: center;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .hsk-tabs {
        justify-content: center;
    }
    
    .story-selector {
        justify-content: center;
    }
} 