/* M3U8播放器样式 */

/* 输入区域 */
.input-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.url-input {
    flex: 1;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.input-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.example-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.example-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.example-btn {
    padding: 6px 12px;
    background: var(--bg-primary);
    border: 1px dashed var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--color-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.example-btn:hover {
    background: rgba(26, 115, 232, 0.1);
}

/* 播放器区域 */
.player-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.player-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.player-actions {
    display: flex;
    gap: 8px;
}

.player-action-btn {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.player-action-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* 视频容器 */
.video-container {
    position: relative;
    background: #000;
    min-height: 400px;
    aspect-ratio: 16 / 9;
}

.video-player {
    width: 100%;
    height: 100%;
    display: none;
}

.video-player.active {
    display: block;
}

.video-info-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.video-badge {
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: #fff;
}

.live-badge {
    background: #e53935;
    animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
}

.video-placeholder.hidden {
    display: none;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.placeholder-text {
    font-size: 16px;
}

/* 控制栏 */
.player-controls {
    padding: 16px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.progress-container {
    margin-bottom: 16px;
}

.progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #bdbdbd;
    border-radius: 3px;
    width: 0;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    width: 0;
}

.progress-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: var(--color-primary);
    border-radius: 50%;
    left: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-marker {
    opacity: 1;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-btn {
    font-size: 20px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 4px;
    transition: transform 0.1s;
}

.control-btn:hover {
    transform: scale(1.1);
}

.time-display {
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
}

.speed-select,
.quality-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-primary);
    cursor: pointer;
}

/* 信息面板 */
.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.info-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.info-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 13px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

/* 设置项 */
.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-label {
    font-size: 13px;
}

/* 开关样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* 工具说明 */
.tool-desc-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.desc-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.desc-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.desc-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.usage-list {
    font-size: 14px;
    padding-left: 20px;
    margin: 0;
}

.usage-list li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* 响应式 */
@media (max-width: 600px) {
    .input-row {
        flex-direction: column;
    }

    .url-input {
        width: 100%;
    }

    .controls-row {
        flex-direction: column;
        gap: 12px;
    }

    .controls-left,
    .controls-right {
        width: 100%;
        justify-content: center;
    }

    .player-header {
        flex-direction: column;
        gap: 12px;
    }
}
