/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主题色 */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --accent-color: #14b8a6;
    
    /* 中性色 */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    
    /* 边框和阴影 */
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* 间距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    overflow-x: hidden;
}

/* 背景装饰 */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    opacity: 0.03;
    z-index: -2;
}

.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    opacity: 0.05;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 500px;
    height: 500px;
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.shape-2 {
    width: 400px;
    height: 400px;
    top: 50%;
    right: -200px;
    animation-delay: -7s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    bottom: -175px;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) 0;
    animation: fadeInDown 0.6s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--primary-color);
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-tags {
    display: flex;
    gap: var(--spacing-xs);
}

.tag {
    padding: 0.375rem 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 播放器卡片 */
.player-section {
    margin: var(--spacing-xl) 0;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.player-card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.player-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.player-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.fullscreen-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.fullscreen-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.fullscreen-btn:hover svg {
    color: white;
}

/* 播放器包装器 */
.player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 比例 */
    background: #000;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.player-placeholder.hidden {
    opacity: 0;
    pointer-events: none;
}

.placeholder-content {
    text-align: center;
    color: white;
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    opacity: 0.9;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.95);
    }
}

.placeholder-text {
    font-size: 1.125rem;
    font-weight: 500;
    opacity: 0.9;
}

/* 加载动画 */
.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10;
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    margin-top: var(--spacing-md);
    color: white;
    font-size: 1rem;
}

/* 输入组 */
.input-group {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.input-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-light);
    pointer-events: none;
}

.url-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.url-input::placeholder {
    color: var(--text-light);
}

.play-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    white-space: nowrap;
}

.play-btn svg {
    width: 20px;
    height: 20px;
}

.play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.play-btn:active {
    transform: translateY(0);
}

/* 快速示例 */
.quick-examples {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.examples-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.examples-list {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.example-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.example-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* 功能特性 */
.features-section {
    margin: var(--spacing-xl) 0;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.feature-card {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-icon-1 {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.feature-icon-2 {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.feature-icon-3 {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.feature-icon-4 {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.feature-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 使用指南 */
.guide-section {
    margin: var(--spacing-xl) 0;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.guide-content {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-lg);
}

.guide-step {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.guide-step:last-child {
    margin-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.step-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.step-content p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.embed-guide {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.embed-guide h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.code-block {
    background: var(--bg-secondary);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.code-block code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* FAQ */
.faq-section {
    margin: var(--spacing-xl) 0;
    animation: fadeInUp 0.6s ease-out 0.8s both;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-question {
    padding: var(--spacing-md);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-item[open] .faq-question::after {
    transform: rotate(45deg);
}

.faq-question:hover {
    background: var(--bg-secondary);
}

.faq-answer {
    padding: 0 var(--spacing-md) var(--spacing-md);
}

.faq-answer p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* 页脚 */
.footer {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.6s ease-out 1s both;
}

.footer-content {
    text-align: center;
}

.footer-quote {
    font-size: 1.125rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.footer-author {
    font-size: 0.9375rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-lg);
}

.footer-copyright,
.footer-disclaimer {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    :root {
        --spacing-xs: 0.375rem;
        --spacing-sm: 0.75rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
    }

    .container {
        padding: var(--spacing-sm);
    }

    .header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    .logo {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .header-tags {
        justify-content: center;
    }

    .player-card {
        padding: var(--spacing-md);
    }

    .player-title {
        font-size: 1.25rem;
    }

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

    .input-wrapper {
        min-width: 100%;
    }

    .play-btn {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .guide-step {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-quote {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    .tag {
        font-size: 0.75rem;
        padding: 0.25rem 0.625rem;
    }

    .placeholder-icon {
        width: 60px;
        height: 60px;
    }

    .placeholder-text {
        font-size: 1rem;
    }
}

/* 全屏模式 */
.player-wrapper:fullscreen {
    padding-top: 0;
}

.player-wrapper:fullscreen .video-player {
    object-fit: contain;
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --bg-card: #1f2937;
        --border-color: #374151;
    }

    .background-gradient {
        opacity: 0.05;
    }

    .url-input {
        background: #111827;
        color: var(--text-primary);
    }

    .url-input:focus {
        background: #1f2937;
    }
}
