/* 影视解析 - 样式 */

:root {
    --bg: #0f0f12;
    --surface: #1a1a20;
    --border: #2a2a32;
    --text: #e8e8ed;
    --muted: #8a8a96;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --success: #22c55e;
    --success-hover: #4ade80;
    --warning: #eab308;
    --error: #ef4444;
    --radius: 10px;
    --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

.player-wrap {
    max-width: 960px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header.compact {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subtitle {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
}

.back-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Main */
.main {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.input-section,
.line-section,
.filter-section {
    margin-bottom: 1.25rem;
}

.input-section label,
.line-section label,
.filter-section label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.filter-options {
    display: flex;
}

.platform-filter {
    flex: 1;
    min-width: 200px;
}

.hint {
    font-weight: 400;
    color: var(--muted);
}

.input-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.input-row input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.input-row input::placeholder {
    color: var(--muted);
}

.input-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Message */
.message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.message.info {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-hover);
}

.message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Result */
.result {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.result-platform {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.platform-icon {
    font-size: 1.25rem;
}

.platform-name {
    font-weight: 500;
}

.result-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Switch tip (yellow) */
.switch-tip {
    padding: 0.75rem 1rem;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: var(--warning);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.switch-tip.visible {
    display: block;
}

/* Success tip (green) */
.success-tip {
    padding: 0.75rem 1rem;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: var(--success);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Error tip */
.error-tip {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.open-new-wrap,
.action-wrap {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Player */
.player-page {
    padding-bottom: 2rem;
}

.player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}

.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Search Results */
.search-results {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.search-results .search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-results h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.filter-status {
    font-size: 0.85rem;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-weight: 500;
}

.platform-category {
    margin-bottom: 1.5rem;
}

.platform-category h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.video-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.video-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
}

.video-details {
    flex: 1;
}

.video-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
}

.video-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.video-source-tag {
    display: inline-block;
    font-size: 0.75rem;
    color: #fff;
    background-color: var(--primary);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Footer */
.footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

.footer p {
    margin: 0;
}

/* Pagination */
.pagination {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--muted);
}

.pagination-buttons {
    display: flex;
    gap: 0.75rem;
}

/* Responsive */
@media (max-width: 600px) {
    .video-info {
        flex-direction: column;
    }
    
    .video-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    
    
    
    .pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .pagination-buttons {
        justify-content: center;
    }
    
    .wrap {
        padding: 1.25rem 1rem;
    }

    .input-row {
        flex-direction: column;
    }

    .input-row input {
        min-width: 100%;
    }

    .btn {
        width: 100%;
    }

    .header.compact {
        flex-wrap: wrap;
    }
    
    .filter-options {
        flex-direction: column;
    }
    
    .platform-filter {
        min-width: unset;
        width: 100%;
    }
    
    .search-results .search-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .filter-status {
        width: 100%;
        text-align: center;
    }
}

/* Video Actions */
.video-actions {
    margin-top: 0.75rem;
}

.official-search-btn {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    background: var(--primary);
    color: #fff;
    transition: all 0.2s ease;
}

.official-search-btn:hover {
    background: var(--primary-hover);
}

.official-search-btn:active {
    background: var(--primary);
    transform: translateY(1px);
}
