/**
 * douyin.css - 抖音视频解析页面样式
 */
.douyin-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}
.douyin-box {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #eef2f6;
    padding: 30px 32px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}
.douyin-header {
    text-align: center;
    margin-bottom: 24px;
}
.douyin-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.douyin-header h1 i {
    color: #4a6cf7;
    background: rgba(74, 108, 247, 0.10);
    padding: 8px 12px;
    border-radius: 12px;
}
.douyin-header p {
    font-size: 15px;
    color: #718096;
    margin-top: 6px;
}
.douyin-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.douyin-input-group input {
    flex: 1;
    min-width: 200px;
    padding: 12px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    background: #f7fafc;
    color: #2d3748;
}
.douyin-input-group input:focus {
    border-color: #4a6cf7;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.08);
}
.douyin-input-group input::placeholder {
    color: #a0aec0;
}
.douyin-btn {
    padding: 12px 30px;
    background: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.douyin-btn:hover {
    background: #3a5cd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.25);
}
.douyin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.douyin-features {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 12px 0 6px 0;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    border-radius: 12px;
    border: 1px solid #d4e2f7;
    box-shadow: 0 2px 8px rgba(74, 108, 247, 0.04);
    transition: all 0.25s ease;
}
.douyin-features:hover {
    border-color: #4a6cf7;
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.08);
}
.douyin-features .features-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}
.douyin-features .features-content {
    flex: 1;
    font-size: 14px;
    color: #2d3748;
    line-height: 1.6;
}
.douyin-features .features-tag {
    display: inline-block;
    background: #4a6cf7;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 0 10px;
    border-radius: 20px;
    line-height: 20px;
    margin-right: 6px;
    vertical-align: middle;
}
.douyin-features .features-text {
    vertical-align: middle;
}
.douyin-features .features-text strong {
    color: #4a6cf7;
}

.douyin-result {
    margin-top: 24px;
    display: none;
    animation: fadeIn 0.3s ease;
}
.douyin-result.active {
    display: block;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.douyin-result .video-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 16px auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}
.douyin-result .video-wrapper video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    outline: none;
    object-fit: contain;
}
.douyin-result .video-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 10px;
    border: 1px solid #edf2f7;
    max-width: 640px;
    margin: 0 auto;
}
.douyin-result .video-info .title {
    font-size: 15px;
    font-weight: 500;
    color: #1a202c;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}
.douyin-result .video-info .download-section {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.douyin-result .video-info .download-section a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: 0.2s;
}
.douyin-result .video-info .download-section .btn-download {
    background: #4a6cf7;
    color: #fff;
}
.douyin-result .video-info .download-section .btn-download:hover {
    background: #3a5cd9;
    transform: translateY(-2px);
}
.douyin-result .video-info .download-section .btn-cover {
    background: #38a169;
    color: #fff;
}
.douyin-result .video-info .download-section .btn-cover:hover {
    background: #2f855a;
    transform: translateY(-2px);
}

.douyin-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 10px;
    color: #c53030;
    display: none;
}
.douyin-error.active {
    display: block;
}
.douyin-loading {
    display: none;
    text-align: center;
    padding: 30px 0;
}
.douyin-loading.active {
    display: block;
}
.douyin-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #4a6cf7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.douyin-loading .spinner-text {
    color: #a0aec0;
    font-size: 14px;
}

.debug-box {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: none;
}
.debug-box.active {
    display: block;
}
.debug-box pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 12px;
    max-height: 300px;
    overflow: auto;
}
.video-url-box {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff3cd;
    border-radius: 6px;
    font-size: 13px;
    word-break: break-all;
    display: none;
}
.video-url-box.active {
    display: block;
}
.video-url-box .copy-btn {
    margin-left: 8px;
    padding: 2px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}
.video-url-box .copy-btn:hover {
    background: #f0f0f0;
}

.douyin-tips {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fffbeb;
    border-left: 4px solid #f6ad55;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
}
.douyin-tips i {
    font-size: 18px;
    color: #f6ad55;
}
.api-status {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 8px;
    text-align: center;
}

/* 深色模式适配 */
body.dark-mode .douyin-box {
    background: #16213e;
    border-color: #2a3a5a;
}
body.dark-mode .douyin-header h1 {
    color: #e2e8f0;
}
body.dark-mode .douyin-header p {
    color: #a0aec0;
}
body.dark-mode .douyin-input-group input {
    background: #2a3a5a;
    border-color: #3a4a6a;
    color: #cbd5e0;
}
body.dark-mode .douyin-input-group input:focus {
    border-color: #4a6cf7;
    background: #1a2a4a;
}
body.dark-mode .douyin-features {
    background: linear-gradient(135deg, #1a2a4a, #1e2a4a);
    border-color: #2a3a5a;
}
body.dark-mode .douyin-features .features-text {
    color: #cbd5e0;
}
body.dark-mode .douyin-features .features-text strong {
    color: #6a8cff;
}
body.dark-mode .douyin-result .video-info {
    background: #1a2a4a;
    border-color: #2a3a5a;
}
body.dark-mode .douyin-result .video-info .title {
    color: #e2e8f0;
}
body.dark-mode .douyin-tips {
    background: #2a2a2a;
    border-left-color: #d69e2e;
    color: #d69e2e;
}
body.dark-mode .douyin-error {
    background: #3a1a1a;
    border-color: #5a2a2a;
    color: #fc8181;
}
body.dark-mode .debug-box {
    background: #1a2a4a;
    border-color: #2a3a5a;
    color: #cbd5e0;
}
body.dark-mode .video-url-box {
    background: #2a2a3a;
    color: #d69e2e;
}

/* 响应式 */
@media (max-width: 768px) {
    .douyin-box {
        padding: 20px 16px;
    }
    .douyin-input-group {
        flex-direction: column;
    }
    .douyin-input-group input {
        width: 100%;
    }
    .douyin-btn {
        width: 100%;
        justify-content: center;
    }
    .douyin-result .video-info {
        flex-direction: column;
        align-items: stretch;
    }
    .douyin-result .video-info .download-section {
        justify-content: center;
    }
    .douyin-header h1 {
        font-size: 22px;
    }
    .douyin-features {
        flex-wrap: wrap;
        padding: 10px 14px;
    }
    .douyin-features .features-icon {
        font-size: 20px;
    }
    .douyin-features .features-text {
        font-size: 13px;
    }
    .douyin-result .video-wrapper {
        max-width: 100%;
        max-height: none;
    }
}
/* ============================================================
   功能特点和使用说明样式（新版）
   ============================================================ */

.douyin-features-grid {
    margin-top: 20px;
}

/* ===== 四个优势卡片 ===== */
.features-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.feature-advantage-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eef2f6;
    padding: 18px 20px 16px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}
.feature-advantage-card:hover {
    border-color: #4a6cf7;
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.06);
    transform: translateY(-3px);
}

.feature-advantage-card .advantage-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 6px;
}
.feature-advantage-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 4px 0;
}
.feature-advantage-card p {
    font-size: 12px;
    color: #718096;
    margin: 0;
    line-height: 1.5;
}

/* ===== 底部两栏布局 ===== */
.features-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ===== 如何下载卡片 ===== */
.how-to-card,
.support-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eef2f6;
    padding: 20px 24px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}
.how-to-card:hover,
.support-card:hover {
    border-color: #4a6cf7;
    box-shadow: 0 4px 16px rgba(74, 108, 247, 0.06);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title i {
    color: #4a6cf7;
    font-size: 18px;
}

/* ===== 步骤列表 ===== */
.how-to-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
}

.how-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.how-step .step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #4a6cf7;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.how-step .step-info strong {
    display: block;
    font-size: 13px;
    color: #1a202c;
}
.how-step .step-info p {
    font-size: 12px;
    color: #718096;
    margin: 1px 0 0 0;
    line-height: 1.4;
}

/* ===== 支持内容列表 ===== */
.support-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.support-item:hover {
    border-color: #4a6cf7;
    background: #f0f5ff;
}

.support-item i {
    font-size: 22px;
    color: #4a6cf7;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.support-item strong {
    display: block;
    font-size: 13px;
    color: #1a202c;
}
.support-item p {
    font-size: 12px;
    color: #718096;
    margin: 0;
    line-height: 1.4;
}

/* ============================================================
   深色模式适配
   ============================================================ */
body.dark-mode .feature-advantage-card {
    background: #16213e;
    border-color: #2a3a5a;
}
body.dark-mode .feature-advantage-card:hover {
    border-color: #4a6cf7;
}
body.dark-mode .feature-advantage-card h4 {
    color: #e2e8f0;
}
body.dark-mode .feature-advantage-card p {
    color: #a0aec0;
}

body.dark-mode .how-to-card,
body.dark-mode .support-card {
    background: #16213e;
    border-color: #2a3a5a;
}
body.dark-mode .how-to-card:hover,
body.dark-mode .support-card:hover {
    border-color: #4a6cf7;
}
body.dark-mode .section-title {
    color: #e2e8f0;
}

body.dark-mode .how-step .step-info strong {
    color: #e2e8f0;
}
body.dark-mode .how-step .step-info p {
    color: #a0aec0;
}

body.dark-mode .support-item {
    background: #1a2a4a;
}
body.dark-mode .support-item:hover {
    background: #1e2a4a;
    border-color: #4a6cf7;
}
body.dark-mode .support-item strong {
    color: #e2e8f0;
}
body.dark-mode .support-item p {
    color: #a0aec0;
}

/* ============================================================
   响应式适配
   ============================================================ */
@media (max-width: 992px) {
    .features-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .features-bottom-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .features-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .feature-advantage-card {
        padding: 14px 14px 12px;
    }
    .feature-advantage-card .advantage-icon {
        font-size: 26px;
    }
    .feature-advantage-card h4 {
        font-size: 14px;
    }
    .how-to-card,
    .support-card {
        padding: 16px 18px 18px;
    }
    .how-to-steps {
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
    }
}

@media (max-width: 480px) {
    .features-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .feature-advantage-card {
        padding: 10px 8px;
        border-radius: 10px;
    }
    .feature-advantage-card .advantage-icon {
        font-size: 22px;
    }
    .feature-advantage-card h4 {
        font-size: 12px;
    }
    .feature-advantage-card p {
        font-size: 11px;
    }
    .how-to-card,
    .support-card {
        padding: 14px 14px 16px;
    }
    .how-to-steps {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .how-step .step-icon {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    .how-step .step-info strong {
        font-size: 12px;
    }
    .how-step .step-info p {
        font-size: 11px;
    }
    .support-item {
        padding: 6px 10px;
    }
    .support-item i {
        font-size: 18px;
        width: 26px;
    }
    .support-item strong {
        font-size: 12px;
    }
}
/* ===== 图集网格样式（缩略图尺寸，完整显示） ===== */
#galleryContainer {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* 缩小列宽 */
    gap: 10px;
    margin-top: 12px;
}
.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #edf2f7;
    background: #f7fafc;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;           /* 保持正方形，让所有图片统一大小 */
}
.gallery-item:hover {
    transform: scale(1.03);
    border-color: #4a6cf7;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;           /* 完整显示图片，不裁剪 */
    max-height: 160px;             /* 限制高度，防止溢出 */
    display: block;
}

/* 下载按钮样式（保持不变） */
.gallery-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #4a6cf7;
    background: #f0f5ff;
    border: 1px solid #e0e8f5;
    text-decoration: none;
    transition: 0.2s;
    margin: 2px;
}
.gallery-download-btn:hover {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
}

/* 暗色模式 */
body.dark-mode .gallery-item {
    border-color: #2a3a5a;
    background: #1a2a4a;
}
body.dark-mode .gallery-download-btn {
    background: #2a3a5a;
    border-color: #3a4a6a;
    color: #6a8cff;
}
body.dark-mode .gallery-download-btn:hover {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
}

@media (max-width: 768px) {
    #galleryContainer {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 6px;
    }
    .gallery-item img {
        max-height: 120px;
    }
}