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

:root {
    --color-primary: #2a73d9;
    --color-secondary: #D44D3B;
    --color-dark: #38404B;
    --color-white: #fff;
    --color-black: #000;
    --color-hover-bg: #eaf1fb;
    --color-border-light: rgba(42, 115, 217, 0.2);
    --page-max-width: 970px;
    --button-border-radius: 4px;
    --button-border-width: 2px;
    --color-text-muted: #4a5568;
    --color-text-subtle: #2d3748;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    color: var(--color-dark);
    background: var(--color-white);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page {
    max-width: var(--page-max-width);
    margin: 0 auto;
    padding: 0 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.topbar__logo-link {
    display: block;
    flex-shrink: 0;
}

.topbar__logo {
    height: 50px;
    width: auto;
}

.header {
    padding: 10px 0 20px;
}

.header__desc {
    font-size: 16px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.header__features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.header__features li {
    font-size: 15px;
    color: var(--color-text-muted);
    padding: 2px 0;
    position: relative;
    padding-left: 18px;
}

.header__features li::before {
    content: '\2713' !important;
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
    font-family: Arial, "Microsoft YaHei", sans-serif;
}

.lang-selector {
    position: relative;
    z-index: 100;
}

.lang-selector__current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: var(--button-border-radius);
    background: var(--color-white);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-dark);
    white-space: nowrap;
}

.lang-selector__current:hover {
    border-color: var(--color-primary);
}

.lang-selector__icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.lang-selector__arrow {
    width: 10px;
    height: 10px;
    fill: currentColor;
    transition: transform 0.2s;
}

.lang-selector_open .lang-selector__arrow {
    transform: rotate(180deg);
}

.lang-selector__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--color-white);
    border: 1px solid #ddd;
    border-radius: var(--button-border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    max-height: 300px;
    overflow-y: auto;
}

.lang-selector_open .lang-selector__dropdown {
    display: block;
}

.lang-selector__option {
    display: block;
    padding: 4px 6px;
    font-size: 16px;
    color: var(--color-dark);
    text-decoration: none;
    white-space: nowrap;
}

.lang-selector__option:hover {
    background: var(--color-hover-bg);
    text-decoration: none;
}

.lang-selector__option_active {
    color: var(--color-primary);
    font-weight: 600;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: var(--button-border-width) solid var(--color-primary);
    border-radius: var(--button-border-radius);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    white-space: nowrap;
}

.button:hover {
    background: #1e5bb8;
    border-color: #1e5bb8;
}

.button__icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

.button_secondary {
    background: transparent;
    color: var(--color-primary);
}

.button_secondary:hover {
    background: var(--color-hover-bg);
}

.button_combine {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    font-size: 16px;
    padding: 12px 32px;
}

.button_combine:hover {
    background: #b8392a;
    border-color: #b8392a;
}

.button_disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.files {
    padding: 20px 0;
    flex: 1;
}

.files__actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.files__upload-input {
    display: none;
}

.drop-zone {
    border: 2px dashed var(--color-border-light);
    border-radius: 8px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: border-color 0.2s, background-color 0.2s;
    padding: 20px;
}

.drop-zone_active {
    border-color: var(--color-primary);
    background: var(--color-hover-bg);
}

.drop-zone_has-files {
    min-height: auto;
    padding: 15px;
    justify-content: flex-start;
    align-items: stretch;
}

.drop-zone ::marker,
.drop-zone *::marker,
.drop-zone_has-files ::marker,
.drop-zone_has-files *::marker {
    content: none !important;
    display: none !important;
}

.drop-zone ul,
.drop-zone ol,
.drop-zone_has-files ul,
.drop-zone_has-files ol {
    list-style: none !important;
    list-style-type: none !important;
    padding-left: 0 !important;
}

.drop-zone li,
.drop-zone_has-files li {
    list-style: none !important;
    list-style-type: none !important;
    position: relative;
}

.drop-caption {
    text-align: center;
    padding: 30px 0;
}

.drop-caption__icon {
    width: 48px;
    height: 48px;
    fill: var(--color-border-light);
    margin-bottom: 12px;
}

.drop-caption__text {
    font-size: 16px;
    color: var(--color-text-subtle);
}

.drop-caption_hidden {
    display: none;
}

.file-cards {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 5px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.file-cards::-webkit-scrollbar {
    height: 6px;
}

.file-cards::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.file-cards::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.file-cards::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
}

.scroll-btn:hover {
    border-color: var(--color-primary);
}

.scroll-btn__icon {
    width: 14px;
    height: 14px;
    fill: var(--color-dark);
}

.scroll-btn_left {
    left: -16px;
}

.scroll-btn_right {
    right: -16px;
}

.drop-zone:hover .scroll-btn {
    opacity: 1;
}

.scroll-btn_hidden {
    display: none;
}

.file {
    flex-shrink: 0;
    width: 160px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background: var(--color-white);
    overflow: hidden;
    position: relative;
    cursor: grab;
    transition: box-shadow 0.2s, transform 0.2s;
}

.file:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file_dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.file_drag-over {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-border-light);
}

.file__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #e8e8e8;
}

.file__name {
    font-size: 11px;
    color: var(--color-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 4px;
}

.file__remove {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    padding: 0;
}

.file__remove:hover {
    background: #fee;
}

.file__remove-icon {
    width: 12px;
    height: 12px;
    fill: #999;
}

.file__remove:hover .file__remove-icon {
    fill: var(--color-secondary);
}

.file__content {
    position: relative;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
}

.file__thumb {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file__state {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.9);
}

.file__state_visible {
    display: flex;
}

.file__state-text {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

.file__state-icon {
    width: 32px;
    height: 32px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e8e8e8;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.file__progress {
    width: 80%;
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.file__progress-bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.file__converting {
    width: 80%;
    height: 4px;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
    background: repeating-linear-gradient(
        -45deg,
        var(--color-primary),
        var(--color-primary) 8px,
        #5a9ae6 8px,
        #5a9ae6 16px
    );
    background-size: 32px 4px;
    animation: stripes 0.6s linear infinite;
}

@keyframes stripes {
    from { background-position: 0 0; }
    to { background-position: 32px 0; }
}

.file__error-icon {
    width: 32px;
    height: 32px;
    fill: var(--color-secondary);
}

.file__state_error .file__state-text {
    color: var(--color-secondary);
}

.file__done-icon {
    width: 32px;
    height: 32px;
    fill: #4caf50;
}

.file__size-info {
    font-size: 11px;
    color: var(--color-text-subtle);
    margin-top: 4px;
}

.file__footer {
    padding: 6px 8px;
    border-top: 1px solid #e8e8e8;
}

.file__download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 6px 0;
    border: 1px solid var(--color-primary);
    border-radius: var(--button-border-radius);
    background: transparent;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.file__download:hover {
    background: var(--color-hover-bg);
    text-decoration: none;
}

.file__download_disabled {
    opacity: 0.4;
    pointer-events: none;
}

.file__download-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.files__combine {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.files__combine_hidden {
    display: none;
}

.ha {
    text-align: center;
    padding: 10px 0;
    min-height: 10px;
}

.article {
    padding: 30px 0;
}

.article h2 {
    font-size: 20px;
    color: var(--color-dark);
    margin-bottom: 12px;
    margin-top: 24px;
}

.article h2:first-child {
    margin-top: 0;
}

.article p {
    font-size: 15px;
    color: #555;
    margin-bottom: 12px;
    line-height: 1.7;
}

.footer {
    padding: 20px 0;
    border-top: 1px solid #eee;
    margin-top: auto;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-subtle);
}

.footer__notice {
    margin-bottom: 8px;
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.footer__link {
    color: var(--color-primary);
    font-size: 13px;
}

.footer__separator {
    color: #ddd;
}

.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.popup_visible {
    display: flex;
}

.popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.popup__content {
    position: relative;
    background: var(--color-white);
    border-radius: 8px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.popup__close:hover {
    background: #f0f0f0;
}

.popup__close-icon {
    width: 16px;
    height: 16px;
    fill: #666;
}

.popup__body h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--color-dark);
}

.popup__body p {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 12px;
}

@media (max-width: 970px) {
    .page {
        padding: 0 15px;
    }

    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header__features li {
        text-align: left;
    }

    .file {
        width: 145px;
    }

    .file__content {
        height: 120px;
    }
}

@media (max-width: 555px) {
    .header__title {
        font-size: 20px;
    }

    .header__logo {
        height: 45px;
    }

    .button {
        padding: 8px 16px;
        font-size: 13px;
    }

    .button_combine {
        padding: 10px 24px;
        font-size: 14px;
    }

    .file {
        width: 130px;
    }

    .file__content {
        height: 110px;
    }

    .drop-zone {
        min-height: 150px;
    }

    .drop-caption__text {
        font-size: 14px;
    }

    .article h2 {
        font-size: 18px;
    }

    .scroll-btn {
        display: none;
    }
}