/* 公共样式 - 头部/尾部/登录弹窗 */
:root {
    --primary-blue: #0080ff;
    --secondary-blue: #0080ff;
    --light-blue: #eff3ff;
    --dark-text: #1d2129;
    --medium-text: #727272;
    --light-text: #86909c;
}

/* 顶部导航 */
header {
    width: 100%;
    height: 70px; /* 增加高度以容纳下拉菜单 */
    background: white;
    display: flex;
    align-items: center;
    padding: 0 40px;
    border-bottom: none;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.03);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

body {
    padding-top: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0080ff, #0080ff);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.logo-icon-img {
    height: 25px;
    object-fit: contain;
}

.logo-text {
    color: var(--dark-text);
    font-size: 20px;
    font-weight: 700;
}

nav {
    display: flex;
    gap: 50px;
    margin-left: 40px;
}

.nav-link {
    padding: 8px 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--medium-text);
    position: relative;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-link:hover {
    color: #000000;
}

.nav-link.active {
    color: #000000;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #000000;
}

.nav-actions {
    margin-left: auto;
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-btn {
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn {
    color: var(--medium-text);
    background: transparent;
    border: none;
}

.login-btn:hover {
    color: var(--primary-blue);
}

.signup-btn {
    padding: 12px 28px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 15px;
    background: linear-gradient(135deg, #000000, #363636);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    letter-spacing: 0.5px;
}

.signup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(74, 108, 247, 0.3);
}

/* 底部样式 */
footer {
    width: 100%;
    background-color: white;
    padding: 40px;
    border-top: 1px solid #eee;
}

.footer-content {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.footer-logo-text {
    font-size: 20px;
    font-weight: 700;
}

.footer-desc {
    max-width: 350px;
    color: var(--medium-text);
    font-size: 15px;
    line-height: 1.8;
}

.footer-column {
    flex: 1;
    min-width: 200px;
}

.footer-title {
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--dark-text);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    text-decoration: none;
    color: var(--medium-text);
    transition: all 0.3s;
}

.footer-links a:hover {
    color: var(--primary-blue);
}

.copyright {
    color: var(--light-text);
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

/* 登录弹窗响应式适配 */
@media (max-width: 768px) {
    header {
        padding: 0 20px;
    }

    nav {
        display: none;
    }

    .nav-actions {
        margin-left: auto;
    }
}

/* ========== 登录弹窗样式 ========== */
.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.login-content {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    text-align: center;
    width: 280px;
    min-height: 380px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.close-modal-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    z-index: 10;
}

.close-modal-btn:hover {
    background-color: #f5f5f5;
    color: #333;
}

.login-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 500;
    position: relative;
}

.login-title img {
    width: 22px;
    height: 22px;
}

.qrcode-box {
    width: 180px;
    height: 180px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.qrcode-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qrcode-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #07c160;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #666;
    font-size: 14px;
}

.qrcode-expired {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(50, 50, 50, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
    border-radius: 8px;
    cursor: pointer;
}

.refresh-icon-container {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.refresh-svg {
    width: 24px;
    height: 24px;
    color: #333;
}

.refresh-text {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin-top: 5px;
}

.expire-text {
    color: #ff4444;
    font-size: 14px;
    margin-top: 5px;
    font-weight: 500;
}

.login-tip {
    color: #999;
    font-size: 13px;
    margin: 10px 0 0;
    line-height: 1.4;
}

.modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
}

/* ========== 用户头像和下拉弹窗样式 ========== */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
}

.avatar-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    padding: 0;
    transition: all 0.2s ease;
}

.avatar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #f5f5f5;
}

.profile-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    z-index: 999;
    display: none;
    animation: fadeInDropdown 0.2s ease-in-out;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.profile-dropdown.show {
    display: block;
}

.dropdown-header {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #f5f5f5;
}

.user-info {
    flex: 1;
}

.user-id {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.dropdown-divider {
    height: 1px;
    background-color: #eee;
    margin: 5px 0;
}

.logout-btn {
    width: 100%;
    padding: 10px 15px;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background-color: #f5f5f5;
    color: #ff4444;
}

body.clicked-outside .profile-dropdown.show {
    display: none;
}

/* ========== 产品下拉菜单样式 ========== */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.product-link {
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-link::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .product-link::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: fixed; /* 改为fixed定位，避免被遮挡 */
    top: 70px; /* 改为70px，与header高度一致 */
    left: 0;
    width: 100vw;
    background-color: #ffffff;
    padding: 30px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 2000; /* 增加z-index确保在最上层 */
    display: none;
    animation: fadeInDropdownMenu 0.3s ease-in-out;
}

@keyframes fadeInDropdownMenu {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu.show {
    display: block;
}

.dropdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.dropdown-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 20px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
}

.dropdown-item:hover {
    background-color: #f5f7ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.dropdown-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    color: white;
}

/* 彩色图标背景 */
.icon-text2speech {
    background: linear-gradient(135deg, #4a6cf7, #6a8cff);
}

.icon-speech2text {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
}

.icon-video-translate {
    background: linear-gradient(135deg, #4ecdc4, #45b7aa);
}

.icon-subtitle {
    background: linear-gradient(135deg, #45b7aa, #4ecdc4);
}

.icon-video-slice {
    background: linear-gradient(135deg, #f9ca24, #feca57);
}

.icon-video-summary {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
}

.icon-watermark {
    background: linear-gradient(135deg, #fd79a8, #fd9644);
}

.icon-video-generate {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.icon-voice-separate {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.dropdown-content {
    flex: 1;
}

.dropdown-content h4 {
    font-size: 15px; /* 调整标题字体大小 */
    font-weight: 600;
    margin: 0 0 4px 0; /* 减少下边距 */
    color: #1a1a2e;
}

.dropdown-content p {
    font-size: 12px; /* 调整描述文字大小（原来13px） */
    color: #666;
    margin: 0;
    line-height: 1.4; /* 调整行高 */
}

/* 响应式适配 */
@media (max-width: 768px) {
    .dropdown-grid {
        grid-template-columns: 1fr;
        padding: 0 20px;
    }
    
    .dropdown-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .dropdown-content {
        max-width: 100%;
    }
}