/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff; /* Changed to white background */
    color: #161823;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #f1f1f2;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    display: flex;
    align-items: center;
    gap: 10px; /* 控制Logo和文字之间的间距 */
    font-size: 22px;
    font-weight: 700;
    color: #010101;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-item {
    color: #161823;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 15px;
    font-weight: 500;
}

.nav-item:hover {
    background-color: #f1f1f2;
}
.nav-item.active {
    color: #fe2c55;
    background-color: #f1f1f2;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.hamburger-bar {
    width: 25px;
    height: 3px;
    background-color: #010101;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Language Switcher */
.lang-switcher .dropdown-toggle {
    background-color: transparent;
    color: #161823;
    padding: 8px 12px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}
/* Other dropdown styles remain the same */
.lang-switcher .dropdown { position: relative; }
.lang-switcher .dropdown-menu { display: none; position: absolute; background-color: #ffffff; min-width: 160px; box-shadow: 0px 8px 25px rgba(0,0,0,0.1); z-index: 1; border-radius: 8px; padding: 5px 0; right: 0; max-height: 300px; overflow-y: auto; border: 1px solid #f1f1f2; }
.lang-switcher .dropdown-menu a { color: #333; padding: 10px 15px; text-decoration: none; display: block; font-size: 14px; transition: background-color 0.2s ease; }
.lang-switcher .dropdown-menu a:hover { background-color: #f1f1f1; }
.lang-switcher .dropdown:hover .dropdown-menu { display: block; }


/* Hero Section with TikTok style background */
.hero {
    background-color: #010101;
    color: #fff;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before, .hero::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: #25f4ee;
    border-radius: 50%;
    filter: blur(90px);
}
.hero::before {
    top: -50px;
    left: -50px;
}
.hero::after {
    bottom: -50px;
    right: -50px;
    background: #fe2c55;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
    font-weight: 400;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

#download-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
    flex-grow: 1;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
}

#download-form input[type="text"] {
    padding: 15px 110px 15px 20px;
    font-size: 16px;
    width: 100%;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #333;
    box-sizing: border-box;
    outline: none;
}

.paste-btn {
    position: absolute;
    right: 55px;
    background: none;
    border: none;
    cursor: pointer;
    color: #fe2c55;
    font-size: 14px;
    font-weight: 600;
}

.clear-btn {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 22px;
    opacity: 0;
    visibility: hidden;
}
.clear-btn.show { opacity: 1; visibility: visible; }

.download-btn {
    padding: 15px 30px;
    font-size: 16px;
    background: #fe2c55;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.download-btn:hover { background: #e4284d; }

/* Content Sections */
.features, .download-section, .how-to, .faq, #results {
    margin-top: 60px;
    margin-bottom: 60px;
    padding: 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

#results {
    background: #fafafa;
    border-radius: 12px;
    padding-top: 30px;
    padding-bottom: 30px;
    border: 1px solid #eee;
    display: none;
}

#results.loading, #results.visible {
    display: block; /* 当JS添加class后，显示该区域 */
}


/* --- 优化 Loading Spinner 样式 --- */
.loader-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px; /* 为加载动画提供一些内部空间 */
    text-align: center;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #fe2c55; /* 使用主题色 */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-container p {
    font-size: 16px;
    color: #555;
    font-weight: 500;
}


h2 {
    font-size: 32px;
    margin-bottom: 40px;
    color: #161823;
    font-weight: 700;
    text-align: center;
}

/* Features Section */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.feature-item { text-align: center; }
.feature-icon { width: 60px; height: 60px; margin: 0 auto 15px; background: #f1f1f2; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fe2c55; font-size: 24px; }
.feature-item h3 { font-size: 20px; margin-bottom: 10px; }
.feature-item p { color: #555; font-size: 15px; }

/* How-To Section */
.how-to { background-color: #fafafa; padding: 60px 0; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.step-item { text-align: center; }
.step-number { width: 50px; height: 50px; margin: 0 auto 20px; background: #fe2c55; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: bold; }
.step-item h3 { font-size: 20px; margin-bottom: 10px; }
.step-item p { color: #555; font-size: 15px; }

/* --- NEW: FAQ Accordion Styles --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}
.faq-item {
    border-bottom: 1px solid #e5e5e5;
}
.faq-question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 20px 0;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #161823;
}
.faq-question h3 {
    margin: 0;
    padding-right: 15px;
    font-size: 18px;
    font-weight: 500;
    color: inherit;
    line-height: 1.4;
}
.faq-question i {
    font-size: 16px;
    transition: transform 0.3s ease;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.faq-answer p {
    padding: 0 10px 20px 0;
    color: #555;
    margin: 0;
    font-size: 16px;
}
.faq-item.active .faq-question i {
    transform: rotate(45deg);
    color: #fe2c55;
}
.faq-item.active .faq-answer {
    max-height: 300px; /* Adjust if answers are very long */
}

/* Footer */
.site-footer {
    background: #f8f8f8;
    color: #555;
    padding: 60px 0 20px;
    margin-top: 60px;
    border-top: 1px solid #eee;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-column h4 { color: #000; font-size: 16px; margin-bottom: 15px; font-weight: 600; }
.footer-column a { color: #555; text-decoration: none; display: block; margin-bottom: 10px; transition: color 0.3s ease; }
.footer-column a:hover { color: #fe2c55; }
.social-links a { display: inline-block; margin-right: 15px; font-size: 18px; }
.footer-bottom { text-align: center; border-top: 1px solid #eee; padding-top: 20px; font-size: 14px; }
.footer-bottom p { margin: 5px 0; }
.disclaimer { opacity: 0.7; }

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 69px; /* Header height - 1px border */
        left: 0;
        width: 100%;
        /* --- UPDATED: Opaque background for mobile menu --- */
        background: #1c1c22;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        box-sizing: border-box;
    }
    .nav-links.active { display: flex; }
    .nav-links .nav-item { color: #fff; width: 100%; padding: 12px 15px; box-sizing: border-box;}
    .nav-links .nav-item:hover, .nav-links .nav-item.active { background-color: #333; color: #fe2c55; }
    .nav-links .lang-switcher { width: 100%; margin-top: 10px; }
    .nav-links .lang-switcher .dropdown-toggle { color: #fff; border-color: #555; text-align: left; width: 100%; box-sizing: border-box;}

    .nav-links .lang-switcher .dropdown-menu {
        right: auto; 
        left: 0;
        width: 100%;
        box-sizing: border-box;
    }    
    header .logo {
        font-size: 20px; /* 可以让文字稍微小一点 */
        gap: 8px;        /* 减小图标和文字的间距 */
    }

    header .logo svg {
        width: 24px;     /* 也可以让图标稍微小一点 */
        height: 24px;
    }
    .hamburger { display: flex; }
    .hamburger.active .hamburger-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .hamburger-bar:nth-child(2) { opacity: 0; }
    .hamburger.active .hamburger-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .hero h1 { font-size: 32px; }
    #download-form { flex-direction: column; }
    .input-container { width: 100%; }
    .download-btn { width: 100%; }
}

/* --- 新增：隐藏页脚中的特定列 --- */
.footer-grid .footer-column:nth-child(2), /* 隐藏 "Company" 列 */
.footer-grid .footer-column:nth-child(4) { /* 隐藏 "Follow Us" 列 */
    display: none;
}
/* =============================================== */
/* === NEW: Redesigned Results Section Styles === */
/* =============================================== */

/* General container for results */
#results {
    background: #fff; /* Changed from #fafafa for a cleaner look */
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    padding: 20px; /* Uniform padding */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Header part with thumbnail and title */
.video-info-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f1f2;
}

.video-thumbnail-wrapper {
    flex-shrink: 0;
    width: 120px;
    height: 160px; /* Aspect ratio similar to TikTok videos */
    border-radius: 8px;
    overflow: hidden;
    background-color: #f1f1f2;
}

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

.video-details {
    flex-grow: 1;
    padding-top: 5px;
}

.video-title {
    font-size: 18px;
    font-weight: 600;
    color: #161823;
    margin: 0 0 10px 0;
    line-height: 1.4;
    /* For long titles */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #555;
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-meta i {
    font-size: 12px;
    color: #888;
}

/* List of download options */
.download-options-list {
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-option-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background-color: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.download-option-item:hover {
    background-color: #f1f1f2;
}

/* Highlight preferred formats */
.download-option-item.preferred {
    background-color: #fff1f4; /* Light pinkish background */
    border-color: #ffe0e6;
}
.download-option-item.preferred:hover {
    background-color: #ffe8ec;
}


.format-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 50%;
    border: 1px solid #eee;
    font-size: 16px;
    color: #fe2c55;
}

.format-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.format-label {
    font-size: 15px;
    font-weight: 500;
    color: #161823;
}

.format-size {
    font-size: 13px;
    color: #555;
}

.download-format-button {
    flex-shrink: 0;
    background: #fe2c55;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.download-format-button:hover {
    background: #e4284d;
}

.download-format-button[disabled] {
    background-color: #ccc;
    cursor: not-allowed;
}

.download-format-button.success {
    background-color: #28a745; /* Green for success */
}

/* Responsive adjustments for the results section */
@media (max-width: 576px) {
    .video-info-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .video-thumbnail-wrapper {
        width: 150px; /* Larger thumbnail on mobile */
        height: 200px;
    }

    .video-meta {
        justify-content: center;
    }

    .download-option-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 15px;
    }

    .format-icon {
        margin: 0 auto 10px auto;
    }

    .download-format-button {
        margin-top: 10px;
        justify-content: center;
        padding: 12px;
    }
}
