:root {
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --secondary: #764ba2;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #e0e0e0;
    --success: #52c41a;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding-bottom: 80px;
}

.story-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    z-index: 100;
    box-shadow: var(--shadow);
}

.story-header .back-btn {
    display: inline-flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.story-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.story-content {
    background: var(--surface);
    margin: 16px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.story-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.story-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
    padding: 8px 0;
    max-height: 50vh;
    overflow-y: auto;
}

.tts-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    margin-top: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tts-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tts-btn.playing {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.story-list {
    background: var(--surface);
    margin: 16px;
    margin-top: 0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.story-list h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.story-list ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.story-list li {
    border-radius: 8px;
    overflow: hidden;
}

.story-list li a {
    display: block;
    padding: 10px 12px;
    background: var(--bg);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-list li.active a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 500;
}

.story-list li a:hover:not(.active) {
    background: #e8eaf6;
    color: #667eea;
}

@media (max-width: 480px) {
    .story-content {
        margin: 12px;
    }
    
    .story-list {
        margin: 12px;
    }
    
    .story-list ul {
        grid-template-columns: 1fr;
    }
}