/* ============================================================
   MP4Web — 视觉语言借鉴 freeconvert.com
   核心特征：蓝紫主色 / Inter 字体 / 浅灰背景白卡片 /
   14px 轻圆角 / 扁平无阴影 / 药丸按钮 / 充足留白
   ============================================================ */

:root {
    /* 配色系统（取自 freeconvert.com 真实 HEX 值） */
    --primary: #727CF5;          /* 主强调色：柔和蓝紫 */
    --primary-hover: #656EE0;    /* 主色 hover */
    --primary-light: #EEF0FE;    /* 主色 10% 背景（徽章/选中底） */
    --failure: #F45F6D;          /* 错误/警示红 */
    --success: #2EBF6E;          /* 成功绿（调暗一档，浅底上更稳） */
    --info: #368FFF;             /* 信息蓝 */

    --black: #212121;            /* 正文/标题黑 */
    --text: #2D3748;             /* 主文字 */
    --text-secondary: #7987A1;   /* 次要文字（副标题/说明/placeholder） */
    --white: #FFFFFF;

    --bg: #F5F4F3;               /* 页面浅灰背景 */
    --surface: #FFFFFF;          /* 卡片白底 */
    --border: #E3E5E8;           /* 边框/描边灰 */
    --footer-bg: #282F3A;        /* 页脚深色 */

    /* 圆角阶梯 */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-card: 14px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(33, 33, 33, 0.04);
    --shadow: 0 4px 16px rgba(33, 33, 33, 0.06);
    --shadow-lg: 0 12px 32px rgba(114, 124, 245, 0.14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* background-blobs 不再使用（纯色克制风），保留元素避免改 HTML */
.background-blobs { display: none; }

/* glass-effect 工具类改为实色白卡片 + 边框 */
.glass-effect {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* Typography & Utilities */
.text-center { text-align: center; }
.hidden { display: none !important; }

/* 关键词高亮：用主色实色，不用渐变文字（更克制专业） */
.gradient-text {
    color: var(--primary);
}

/* ============ Navbar ============ */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 0;
    z-index: 100;
    background: var(--surface);
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.nav-content {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--black);
    letter-spacing: -0.01em;
}

.logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* ============ Buttons ============ */
button,
.btn-primary,
.btn-primary-outline,
.btn-secondary {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
    border-radius: var(--radius-pill);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    box-shadow: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: none;
    box-shadow: none;
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.btn-primary-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: 1px solid var(--border);
}

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

.btn-primary.large {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
}

/* ============ Hero Section ============ */
.hero-section {
    padding: 5rem 1.5rem 4rem;
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    max-width: 720px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 徽章：主色浅底药丸 */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid rgba(114, 124, 245, 0.2);
    margin-bottom: 1.75rem;
    box-shadow: none;
    backdrop-filter: none;
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(114, 124, 245, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(114, 124, 245, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(114, 124, 245, 0); }
    100% { box-shadow: 0 0 0 0 rgba(114, 124, 245, 0); }
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
    color: var(--black);
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 560px;
}

/* ============ Search Container（核心链接输入区） ============ */
.search-container {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    border-radius: var(--radius-card);
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(114, 124, 245, 0.12);
    transform: none;
}

.search-icon {
    font-size: 1.35rem;
    color: var(--text-secondary);
    padding-right: 0.75rem;
}

.search-container input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1.05rem;
    font-family: inherit;
    padding: 1rem 0;
}

.search-container input::placeholder {
    color: var(--text-secondary);
}

/* 输入框内的解析按钮：贴合高度 */
.search-container .btn-primary {
    padding: 0.85rem 1.75rem;
    flex-shrink: 0;
}

/* ============ Status / Error Messages ============ */
.status-message,
.error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.status-message {
    color: var(--primary);
}

.error-message {
    color: var(--failure);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(114, 124, 245, 0.25);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

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

/* ============ Result Card ============ */
.result-card {
    width: 100%;
    margin-top: 2rem;
    border-radius: var(--radius-card);
    padding: 1.75rem;
    text-align: left;
}

.result-layout {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.thumbnail-wrapper {
    position: relative;
    width: 220px;
    height: 124px;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg);
    box-shadow: none;
}

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

/* play-overlay 保留但弱化（作为视觉点缀，非播放功能） */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.4rem;
    backdrop-filter: none;
    opacity: 0.95;
    pointer-events: none;
}

.result-details {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--black);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    color: var(--success);
    font-weight: 500;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ============ FAQ Section ============ */
.margin-section {
    max-width: 1140px;
    margin: 0 auto 4rem;
    padding: 3rem;
    border-radius: var(--radius-card);
}

.faq-section h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: var(--black);
    letter-spacing: -0.02em;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
}

.faq-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.75rem;
    background: var(--surface);
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.faq-item:hover {
    transform: none;
    box-shadow: var(--shadow);
    border-color: rgba(114, 124, 245, 0.3);
}

.faq-item i {
    font-size: 1.75rem;
    color: var(--primary);
}

.faq-text h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--black);
}

.faq-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============ Footer ============ */
footer {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    background: var(--footer-bg);
    border-top: none;
}

footer p {
    max-width: 600px;
    margin: 0 auto;
}

/* ============ Animations ============ */
.fade-in-up {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeInUp 0.7s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }

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

/* ============ Responsive ============ */
@media (max-width: 768px) {
    h1 { font-size: 2.25rem; }
    .hero-section { padding: 3rem 1.25rem; }
    .subtitle { font-size: 1.05rem; }

    .nav-links { display: none; }

    /* 输入区在移动端纵向堆叠 */
    .search-container {
        flex-direction: column;
        align-items: stretch;
        border-radius: var(--radius-card);
        padding: 1rem;
        gap: 0.75rem;
    }
    .search-icon { display: none; }
    .search-container input {
        width: 100%;
        text-align: center;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }
    .search-container .btn-primary { width: 100%; }

    .result-card { padding: 1.25rem; }
    .result-layout {
        flex-direction: column;
        text-align: center;
    }
    .thumbnail-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    .action-buttons .btn-primary,
    .action-buttons .btn-secondary { width: 100%; }

    .faq-grid { grid-template-columns: 1fr; }
    .margin-section {
        padding: 1.75rem;
        margin: 0 1rem 3rem;
    }
    .faq-section h2 { font-size: 1.6rem; }
}
