/* ========================================
   歌词打轴器 - 主页面专用样式 (BEM 规范)
   ======================================== */

/* App Header */
.app-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.app-header__title {
    font-size: 1.8rem;
    font-weight: 600;
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* App Card */
.app-card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* App Section Title */
.app-section-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.app-section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 20px;
    background-color: var(--primary-color);
    margin-right: 0.5rem;
    border-radius: 2px;
}

/* Controls Grid */
.app-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .app-controls-grid {
        grid-template-columns: 1fr;
    }
}

/* File Upload */
.app-file-upload {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.app-file-input-hidden {
    display: none;
}

.app-file-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    text-align: center;
    transition: background-color 0.2s;
}

.app-file-label:hover {
    background-color: #357abd;
}

/* Audio Player */
.app-audio-player {
    width: 100%;
}

/* Time Display */
.app-time-display {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Textarea */
.app-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    resize: vertical;
    font-size: 0.9rem;
}

.app-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Parse Button */
.app-parse-btn {
    margin-top: 0.5rem;
}

/* Timing Controls */
.app-timing-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Status Bar */
.app-status-bar {
    padding: 0.5rem;
    background-color: var(--highlight-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-grow: 1;
}

/* Progress Container */
.app-progress-container {
    margin-bottom: 1rem;
}

.app-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.app-progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background-color: var(--primary-color);
    width: var(--progress-width, 0%);
    transition: width 0.3s ease;
}

.app-progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Lyrics List */
.app-lyrics-list {
    list-style-type: none;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.app-lyrics-list li {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    position: relative;
}

.app-lyrics-list li:last-child {
    border-bottom: none;
}

/* Current Line Highlight - Enhanced! */
.app-lyrics-list li.current-line {
    background-color: var(--highlight-color);
    border-left: 4px solid var(--primary-color);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
}

.app-lyrics-list li.current-line::before {
    content: '▶';
    position: absolute;
    left: -1.5rem;
    color: var(--primary-color);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Lyric Text & Timestamp */
.app-lyric-text {
    flex-grow: 1;
    word-break: break-word;
}

.app-timestamp {
    font-family: monospace;
    margin-left: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 60px;
}

/* Dynamic Preview */
.app-dynamic-preview {
    font-size: 1.25rem;
    text-align: center;
    min-height: 5rem;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 0.75rem;
    border: 2px solid #e2e8f0;
}

.app-dynamic-preview .progress-indicator {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.app-dynamic-preview .highlighted {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.4rem;
    animation: fadeInUp 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-dynamic-preview .highlighted .lyric-time {
    font-size: 0.9rem;
    font-family: monospace;
    background: rgba(74, 144, 226, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    color: var(--primary-color);
    font-weight: 400;
}

.app-dynamic-preview .next-line {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    opacity: 0.8;
    animation: fadeIn 0.3s ease 0.1s both;
}

.app-dynamic-preview .next-line-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.8;
    }
}

/* Result LRC */
.app-result-lrc {
    margin-top: 0.5rem;
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    resize: vertical;
    font-size: 0.9rem;
}

/* Ad Container */
.app-ad-container {
    text-align: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.app-ad-container.hidden {
    display: none;
}

.app-ad-frame {
    width: 100%;
    height: auto;
    border: none;
}

/* Manage Link */
.app-manage-link {
    display: block;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-decoration: none;
    margin-top: 0.5rem;
    cursor: pointer;
}

.app-manage-link:hover {
    color: var(--primary-color);
}

/* Password Modal */
.app-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.app-password-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
}

.app-password-title {
    margin-bottom: 1rem;
    text-align: center;
}

.app-password-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.app-password-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.app-password-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.app-warning {
    color: var(--warning-color);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

.app-password-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.app-footer__text {
    margin: 1rem 0 0 0;
}

.app-footer__manage-link {
    color: var(--primary-color);
    cursor: pointer;
    text-decoration: underline;
}

.app-footer__manage-link:hover {
    color: #357abd;
}

/* Friend Links */
.app-friend-links {
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
}

.app-friend-links__title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.app-friend-links__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
}

.app-friend-links__list a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.app-friend-links__list a:hover {
    color: #357abd;
    text-decoration: underline;
}

/* Toast Container */
.app-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* SR Only */
.app-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
