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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    text-align: center;
    margin-bottom: 0;
    padding: 2rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    width: 100%;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* 导航栏样式 */
.main-nav {
    display: flex;
    gap: 1rem;
    margin-top: 0;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.main-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.title-section {
    text-align: left;
    margin-top: 0;
}

/* 自定义语言选择器样式 */
.custom-language-selector {
    position: relative;
    display: inline-block;
    min-width: 200px;
}

.language-current {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-current:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.language-current.selected {
    background: #e3f2fd;
    border-color: #1976d2;
    color: #1976d2;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #333;
}

.language-option:hover {
    background-color: #f8f9fa;
    color: #000;
}

.language-option.active {
    background-color: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.flag-icon {
    width: 60px;
    height: 40px;
    margin-right: 8px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.language-name {
    flex: 1;
    font-size: 14px;
    color: inherit;
}

.language-arrow {
    margin-left: 8px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.custom-language-selector.open .language-arrow {
    transform: rotate(180deg);
}

.language-selector select option[value="ar"] { background-image: url('flags/sa.svg'); }
.language-selector select option[value="sv"] { background-image: url('flags/se.svg'); }
.language-selector select option[value="cs"] { background-image: url('flags/cz.svg'); }
.language-selector select option[value="es"] { background-image: url('flags/es.svg'); }
.language-selector select option[value="de"] { background-image: url('flags/de.svg'); }
.language-selector select option[value="zh"] { background-image: url('flags/cn.svg'); }
.language-selector select option[value="da"] { background-image: url('flags/dk.svg'); }
.language-selector select option[value="hi"] { background-image: url('flags/in.svg'); }
.language-selector select option[value="fi"] { background-image: url('flags/fi.svg'); }
.language-selector select option[value="id"] { background-image: url('flags/id.svg'); }
.language-selector select option[value="fr"] { background-image: url('flags/fr.svg'); }
.language-selector select option[value="ur"] { background-image: url('flags/pk.svg'); }
.language-selector select option[value="hu"] { background-image: url('flags/hu.svg'); }
.language-selector select option[value="bn"] { background-image: url('flags/bd.svg'); }
.language-selector select option[value="it"] { background-image: url('flags/it.svg'); }
.language-selector select option[value="tl"] { background-image: url('flags/ph.svg'); }
.language-selector select option[value="ja"] { background-image: url('flags/jp.svg'); }
.language-selector select option[value="vi"] { background-image: url('flags/vn.svg'); }
.language-selector select option[value="nl"] { background-image: url('flags/nl.svg'); }
.language-selector select option[value="tr"] { background-image: url('flags/tr.svg'); }
.language-selector select option[value="no"] { background-image: url('flags/no.svg'); }
.language-selector select option[value="th"] { background-image: url('flags/th.svg'); }
.language-selector select option[value="pl"] { background-image: url('flags/pl.svg'); }
.language-selector select option[value="ko"] { background-image: url('flags/kr.svg'); }
.language-selector select option[value="pt"] { background-image: url('flags/pt.svg'); }
.language-selector select option[value="zh-tw"] { background-image: url('flags/tw.svg'); }
.language-selector select option[value="ru"] { background-image: url('flags/ru.svg'); }
.language-selector select option[value="en"] { background-image: url('flags/us.svg'); }

/* 动态语言选择器的国旗样式 */
.flag-icon-bg {
    display: inline-block;
    width: 60px;
    height: 40px;
    margin-right: 8px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    vertical-align: middle;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}
}

.flag-icon-bg[data-flag="ar"] { background-image: url('flags/sa.svg'); }
.flag-icon-bg[data-flag="sv"] { background-image: url('flags/se.svg'); }
.flag-icon-bg[data-flag="cs"] { background-image: url('flags/cz.svg'); }
.flag-icon-bg[data-flag="es"] { background-image: url('flags/es.svg'); }
.flag-icon-bg[data-flag="de"] { background-image: url('flags/de.svg'); }
.flag-icon-bg[data-flag="zh"] { background-image: url('flags/cn.svg'); }
.flag-icon-bg[data-flag="da"] { background-image: url('flags/dk.svg'); }
.flag-icon-bg[data-flag="hi"] { background-image: url('flags/in.svg'); }
.flag-icon-bg[data-flag="fi"] { background-image: url('flags/fi.svg'); }
.flag-icon-bg[data-flag="id"] { background-image: url('flags/id.svg'); }
.flag-icon-bg[data-flag="fr"] { background-image: url('flags/fr.svg'); }
.flag-icon-bg[data-flag="ur"] { background-image: url('flags/pk.svg'); }
.flag-icon-bg[data-flag="hu"] { background-image: url('flags/hu.svg'); }
.flag-icon-bg[data-flag="bn"] { background-image: url('flags/bd.svg'); }
.flag-icon-bg[data-flag="it"] { background-image: url('flags/it.svg'); }
.flag-icon-bg[data-flag="tl"] { background-image: url('flags/ph.svg'); }
.flag-icon-bg[data-flag="ja"] { background-image: url('flags/jp.svg'); }
.flag-icon-bg[data-flag="vi"] { background-image: url('flags/vn.svg'); }
.flag-icon-bg[data-flag="nl"] { background-image: url('flags/nl.svg'); }
.flag-icon-bg[data-flag="tr"] { background-image: url('flags/tr.svg'); }
.flag-icon-bg[data-flag="no"] { background-image: url('flags/no.svg'); }
.flag-icon-bg[data-flag="th"] { background-image: url('flags/th.svg'); }
.flag-icon-bg[data-flag="pl"] { background-image: url('flags/pl.svg'); }
.flag-icon-bg[data-flag="ko"] { background-image: url('flags/kr.svg'); }
.flag-icon-bg[data-flag="pt"] { background-image: url('flags/pt.svg'); }
.flag-icon-bg[data-flag="zh-tw"] { background-image: url('flags/tw.svg'); }
.flag-icon-bg[data-flag="ru"] { background-image: url('flags/ru.svg'); }
.flag-icon-bg[data-flag="en"] { background-image: url('flags/us.svg'); }

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.about-section {
    margin-bottom: 30px;
}

.about-section h2 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.about-section p {
    color: #718096;
    margin-bottom: 15px;
    line-height: 1.7;
}

.format-info {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

.format-box {
    text-align: center;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.format-box h3 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1rem;
}

.format-tag {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    background: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #edf2f7;
    transform: translateY(-2px);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #a0aec0;
}

.upload-area h3 {
    color: #4a5568;
    font-size: 1.3rem;
    font-weight: 600;
}

.upload-area p {
    color: #718096;
    font-size: 1rem;
}

.select-files-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-files-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.file-list {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    width: 24px;
    height: 24px;
    color: #667eea;
}

.file-name {
    font-weight: 600;
    color: #4a5568;
}

.file-size {
    color: #718096;
    font-size: 0.9rem;
}

.remove-file {
    background: #fed7d7;
    color: #e53e3e;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: #feb2b2;
}

.size-limit {
    margin-top: 15px;
    text-align: center;
}

.size-limit p {
    color: #718096;
    font-size: 0.9rem;
}

.options-section {
    margin-bottom: 40px;
}

.options-section h3 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.option-group {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 10px;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.option-description {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.6;
}

.action-section {
    text-align: center;
    margin-bottom: 40px;
}

.merge-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.merge-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.merge-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    box-shadow: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    animation: progress-animation 2s ease-in-out;
}

@keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.merge-info {
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.merge-info h4 {
    color: #2c5aa0;
    margin-bottom: 10px;
    font-size: 1rem;
}

.info-content {
    color: #4a5568;
    font-size: 0.9rem;
    line-height: 1.5;
}

.info-item {
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #2d3748;
}

.result-section {
    margin-top: 20px;
}

.success-message {
    color: #38a169;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.download-btn {
    background: #38a169;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #2f855a;
    transform: translateY(-1px);
}

.security-info {
    background: #edf2f7;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.security-info h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.security-info p {
    color: #718096;
    margin-bottom: 12px;
    line-height: 1.6;
}

/* 页脚样式 */
.footer {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: white;
    margin-top: 0;
    border-radius: 0;
    box-shadow: 0 -4px 15px rgba(45, 55, 72, 0.3);
    width: 100%;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2.5rem 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h4 {
    color: #e2e8f0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Safety: hide deprecated footer columns if they still exist */
.footer-section h4[data-i18n="footer.tools_title"],
.footer-section h4[data-i18n="footer.contact_title"] {
    display: none !important;
}
.footer-section h4[data-i18n="footer.tools_title"] ~ .footer-links,
.footer-section h4[data-i18n="footer.contact_title"] ~ .footer-links {
    display: none !important;
}

.footer-section p {
    color: #cbd5e0;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    /* 居中隐私与本地处理的句子 */
    text-align: center;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #667eea;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding: 1.5rem 2rem;
    text-align: center;
    background: rgba(45, 55, 72, 0.5);
}

.footer-bottom p {
    color: #a0aec0;
    font-size: 0.9rem;
}

.footer-bottom a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* Footer导航样式 */
.footer-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-nav-link {
    color: #cbd5e0;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

.footer-nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    text-decoration: none;
}

.footer-nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 25px;
    }
    
    .format-info {
        flex-direction: column;
        align-items: center;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 1rem 1rem;
    }
    
    .footer-bottom {
        padding: 1rem;
    }
}