/* 基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #050914;
    --panel: rgba(14, 20, 39, 0.92);
    --card: rgba(20, 27, 54, 0.85);
    --accent: #ff5c8d;
    --accent-soft: rgba(255, 92, 141, 0.16);
    --text: #f5f7ff;
    --muted: #9aa4c2;
    --border: rgba(255, 255, 255, 0.08);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

body {
    background: radial-gradient(circle at top, rgba(79, 115, 255, 0.25), transparent 60%), var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: min(1080px, 92%);
    margin: 0 auto;
}

/* 头部 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(180deg, rgba(5, 9, 18, 0.95), rgba(5, 9, 18, 0));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.3rem 0;
    backdrop-filter: blur(16px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ff6a3d, #ff256c);
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: 0 18px 38px rgba(255, 82, 130, 0.35);
}

.brand-text strong {
    font-size: 1.2rem;
    font-weight: 700;
}

.brand-text span {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-label {
    font-size: 0.95rem;
    color: var(--muted);
}

/* 主体 */
.main-content {
    flex: 1;
    padding: 2.6rem 0 3.4rem;
}

.hero-banner {
    padding-bottom: 2.8rem;
}

.hero-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
}

.hero-card {
    width: min(820px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 28px 68px rgba(5, 9, 21, 0.48);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

.hero-card h2 {
    font-size: clamp(1.6rem, 3vw, 2rem);
}

.hero-card p {
    font-size: 1rem;
    color: rgba(240, 243, 255, 0.72);
}

.hero-input {
    display: flex;
    gap: 0.8rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(19, 26, 48, 0.9);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    padding: 0.3rem 0.4rem;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.search-input:focus {
    outline: none;
}

.search-btn {
    border: none;
    background: linear-gradient(135deg, #ff6a3d, #ff256c);
    color: #fff;
    padding: 0.6rem 1.6rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.search-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.search-status {
    font-size: 0.82rem;
    color: var(--muted);
    min-height: 1.1rem;
}

.hero-results {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-top: 0.8rem;
}

.hero-results-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.hero-results-header h3 {
    font-size: 1.05rem;
}

.hero-results-note {
    font-size: 0.78rem;
    color: var(--muted);
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-card {
    display: flex;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    background: var(--card);
    border: 1px solid var(--border);
    transition: border 0.2s ease, transform 0.2s ease;
}

.result-card:hover {
    border-color: rgba(255, 143, 180, 0.3);
    transform: translateY(-2px);
}

.result-cover {
    width: 110px;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
}

.result-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}

.result-title {
    font-weight: 600;
    font-size: 1rem;
}

.result-meta {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    font-size: 0.76rem;
    color: var(--muted);
}

.result-meta span {
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.result-description {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.62);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-footer {
    margin-top: auto;
    font-size: 0.78rem;
    color: var(--muted);
}

.result-empty {
    text-align: center;
    color: var(--muted);
    padding: 1.2rem 0;
    font-size: 0.85rem;
}

/* 历史记录 */
.history-section {
    padding-top: 0.6rem;
}

.panel-history {
    width: min(820px, 100%);
    margin: 0 auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 26px 68px rgba(5, 9, 21, 0.48);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.clear-history-btn {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: var(--muted);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    transition: border 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.clear-history-btn:hover {
    border-color: rgba(255, 255, 255, 0.45);
    color: var(--text);
    transform: translateY(-1px);
}

.history-list {
    list-style: none;
    display: grid;
    gap: 1rem;
}

.history-item {
    display: flex;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    background: var(--card);
    border: 1px solid var(--border);
    transition: border 0.2s ease, transform 0.2s ease;
}

.history-item:hover {
    border-color: rgba(255, 143, 180, 0.3);
    transform: translateX(4px);
}

.history-thumb {
    width: 64px;
    height: 46px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.history-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.history-title {
    font-size: 0.96rem;
    font-weight: 600;
}

.history-meta {
    font-size: 0.72rem;
    color: var(--muted);
}

.history-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.58);
}

.history-empty {
    font-size: 0.86rem;
    color: var(--muted);
    display: none;
}

.history-empty.visible {
    display: block;
}

/* 播放器页面 */
.player-stage {
    padding: 3rem 0 3.5rem;
}

.player-layout {
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
}

.player-screen-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
}

.player-screen {
    position: relative;
    width: 100%;
    max-width: 960px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
    box-shadow: 0 34px 82px rgba(5, 9, 21, 0.5);
}

.player-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.player-message {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.8rem;
    text-align: center;
    background: rgba(5, 9, 21, 0.72);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    line-height: 1.6;
}

.player-message.visible {
    display: flex;
}

.player-message.non-blocking {
    pointer-events: none;
    background: rgba(5, 9, 21, 0.45);
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.player-header {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.player-header .eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.player-title {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.player-summary {
    font-size: 0.9rem;
    color: rgba(226, 230, 255, 0.78);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.player-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.player-meta-item {
    font-size: 0.75rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.control-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.speed-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.control-btn {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.15s ease, border 0.15s ease, background 0.15s ease;
}

.control-btn:hover,
.control-btn:focus-visible {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    transform: translateY(-1px);
}

.speed-btn.active {
    background: rgba(255, 92, 141, 0.2);
    border-color: rgba(255, 92, 141, 0.45);
    color: #fff;
    box-shadow: 0 12px 28px rgba(255, 92, 141, 0.2);
}

.line-panel {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background: rgba(20, 26, 48, 0.9);
    padding: 1.6rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 24px 50px rgba(5, 9, 21, 0.45);
}

.line-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.line-status {
    font-size: 0.76rem;
    color: var(--muted);
}

.line-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.6rem;
}

.line-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(25, 32, 56, 0.9);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.line-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 143, 180, 0.4);
    box-shadow: 0 14px 28px rgba(5, 9, 21, 0.4);
}

.line-item.active {
    border-color: rgba(255, 108, 160, 0.6);
    box-shadow: 0 16px 32px rgba(5, 9, 21, 0.45);
    background: rgba(255, 92, 141, 0.16);
}

.line-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.line-page-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: var(--text);
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    transition: border 0.2s ease, background 0.2s ease;
}

.line-page-btn:hover {
    border-color: rgba(255, 143, 180, 0.4);
}

.line-page-btn.active {
    background: rgba(255, 92, 141, 0.2);
    border-color: rgba(255, 92, 141, 0.45);
}

.line-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 底部 */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(5, 9, 21, 0.92);
    padding: 1.4rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
}

/* 响应式 */
@media (max-width: 1024px) {
    .hero-card,
    .panel-history {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-input {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }

    .history-item {
        flex-direction: column;
    }

    .history-thumb {
        width: 100%;
        height: 180px;
    }

    .player-controls {
        align-items: flex-start;
    }

    .line-panel {
        padding: 1.4rem;
    }
}

@media (max-width: 560px) {
    .hero-card {
        padding: 1.5rem 1.2rem;
    }

    .hero-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .control-btn {
        flex: 1 1 auto;
    }

    .speed-buttons {
        flex-wrap: wrap;
    }

    .line-panel {
        padding: 1.2rem;
    }
}
