* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-thumb {
    border-radius: 3.5px;
    background-color: rgba(50, 50, 50, 0.3);
}

::-webkit-scrollbar-track {
    border-radius: 3.5px;
    background-color: rgba(50, 50, 50, 0.1);
}

html {
    height: 100%;
}

@-webkit-keyframes Gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes Gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 60% 40%, rgba(117, 113, 251, 0.7) 0%, rgba(62, 144, 238, 0.7) 40%, rgba(68, 155, 255, 0.7) 70%, rgba(9, 69, 138, 0.2) 100%);
    background-size: 300% 300%;
    background-attachment: fixed;
    -webkit-animation: Gradient 30s ease infinite;
    animation: Gradient 30s ease infinite;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    font-size: 14px;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    display: grid;
    gap: 30px;
    grid-template-columns: 320px 580px;
    grid-template-rows: auto;
    max-width: 90%;
    margin-top: 20px;
    margin-bottom: 60px;
}

.upload,
.filelist {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.upload .title,
.filelist .title {
    min-height: 60px;
    border-bottom: 1px solid #f0f4f9;
    color: #333;
    font-weight: 600;
    padding: 0 24px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* 网关选择器样式 */
.gateway-selector {
    padding: 14px 24px;
    border-bottom: 1px solid #f0f4f9;
    background-color: rgba(249, 250, 252, 0.7);
    text-align: center;
}

.title-text {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload {
    -webkit-animation: slideRight 1.5s;
    animation: slideRight 1.5s;
    transition: all 0.4s ease;
    height: 520px;
}

.upload:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

.upload .title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.button-group button {
    width: 80px;
    height: 36px;
    border-radius: 18px;
    background-color: #fff;
    border: 1px solid #dcdfe6;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    font-weight: 500;
    color: #444;
}

.button-group button:hover {
    background-color: #f5f7fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.button-group button:active {
    transform: translateY(0);
}

.gateway-button {
    background-color: #e6f0ff !important;
    color: #409eff !important;
}

.upload .title select {
    height: 32px;
    padding: 0 8px;
    border-radius: 16px;
    border: 1px solid #dcdfe6;
    outline: none;
}

#show {
    width: 475px;
    height: 32px;
    outline: none;
    border: 1px solid #dcdfe6;
    padding: 0 15px;
    color: #444;
    border-radius: 16px;
    font-size: 13px;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

.upload .title input:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.upload .content {
    cursor: pointer;
    height: calc(100% - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: all 0.4s ease;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.upload .content:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(64, 158, 255, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
}

.upload .content:hover:before {
    opacity: 1;
}

.upload .content:hover {
    background-color: #f9fafc;
}

.upload .content:active {
    transform: scale(0.98);
}

.upload .content .icon {
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    fill: #777;
    z-index: 1;
}

.upload .content:hover .icon {
    transform: translateY(-8px);
    fill: #409eff;
}

.upload .content .desc {
    color: #444;
    font-size: 16px;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    z-index: 1;
}

.upload .content:hover .desc {
    color: #333;
}

.upload.dragenter {
    box-shadow: 0 15px 50px rgba(64, 158, 255, 0.3);
    background-color: #f0f8ff;
    transform: scale(1.02);
}

.upload.dragenter .content>* {
    pointer-events: none;
}

.filelist {
    -webkit-animation: slideLeft 1.5s;
    animation: slideLeft 1.5s;
    display: flex;
    flex-direction: column;
    height: 520px;
}

.filelist .title {
    flex-shrink: 0;
}

.filelist .list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 20px;
    padding-bottom: 30px;
    margin-bottom: 10px;
    scroll-behavior: smooth;
}

.filelist .list .item {
    margin-bottom: 20px;
    background-color: #f9fafc;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.filelist .list .item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
    background-color: #f5f9ff;
}

.filelist .list .item .file {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.filelist .list .item .file .icon {
    width: 52px;
    height: 52px;
    margin-right: 15px;
    fill: #777;
    background-color: rgba(144, 147, 153, 0.08);
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.filelist .list .item:hover .file .icon {
    background-color: rgba(64, 158, 255, 0.1);
    fill: #409eff;
}

.filelist .list .item .file .desc {
    flex: 1;
    min-width: 0;
}

.filelist .list .item .file .desc__name {
    font-size: 16px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.filelist .list .item .file .desc__size {
    font-size: 13px;
    color: #909399;
}

.filelist .list .item .file .link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    margin-left: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    background-color: rgba(240, 240, 240, 0.5);
    width: 40px;
    height: 40px;
}

.filelist .list .item .file .link svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.filelist .list .item .file .link:hover {
    background: rgba(64, 158, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.filelist .list .item .file .link:active {
    transform: translateY(0);
}

.icon-open:hover {
    fill: #409eff !important;
}

.icon-delete:hover {
    fill: #f56c6c !important;
}

.filelist .list .item .progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 10px;
}

.filelist .list .item .progress .progress-bar {
    flex: 1;
    min-width: 0;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.filelist .list .item .progress .progress-bar .progress-inner {
    width: 0%;
    height: 100%;
    background: #409eff;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.filelist .list .item .progress .progress-bar .progress-inner.success {
    background: #67c23a;
}

.filelist .list .item .progress .progress-bar .progress-inner.error {
    background: #f56c6c;
}

.filelist .list .item .progress .progress-status {
    margin-left: 8px;
}

.filelist .list .item .progress .progress-status .icon {
    display: none;
    width: 14px;
    height: 14px;
}

@-webkit-keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@-webkit-keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 900px) {
    body {
        justify-content: flex-start;
        padding-top: 40px;
        padding-bottom: 60px;
        min-height: 100vh;
    }
    
    .container {
        grid-template-columns: minmax(300px, 90%);
        grid-template-rows: auto auto;
        width: 100%;
        margin-bottom: 40px;
    }
    
    .upload {
        height: auto;
        min-height: 200px;
        transition: all 0.4s ease;
    }
    
    .filelist {
        height: auto;
        min-height: 300px;
        transition: all 0.4s ease;
    }
    
    .upload .content {
        padding: 30px 15px;
    }
    
    .upload .content .icon {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }
    
    #show {
        width: 100%;
        max-width: 350px;
    }
    
    .filelist .title {
        height: auto;
        min-height: 50px;
        padding: 10px 15px;
        gap: 8px;
    }
    
    .filelist .list {
        max-height: 400px;
        padding-bottom: 40px; /* 确保底部内容不被footer遮挡 */
    }
}

/* Medium-sized mobile devices in landscape mode */
@media (min-width: 481px) and (max-width: 900px) {
    .filelist .title {
        grid-template-areas: 
            "title copyall"
            "select select";
        align-items: center;
    }
    
    .select-group {
        width: 100%;
        margin-top: 8px;
    }
    
    .select-group select {
        max-width: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        padding-bottom: 50px;
    }
    
    .container {
        gap: 15px;
        max-width: 95%;
    }
    
    .upload .content .icon {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }
    
    .button-group button {
        width: 60px;
        height: 28px;
        font-size: 12px;
    }
    
    .filelist .list {
        padding: 10px;
    }
    
    .filelist .list .item {
        padding: 10px;
    }
    
    .upload .title,
    .filelist .title {
        font-size: 15px;
        padding: 10px 15px;
        min-height: 50px;
    }
    
    .gateway-selector {
        padding: 8px 15px;
        padding: 10px 15px;
        min-height: 60px;
        text-align: center; /* 确保在移动端也居中 */
    }
    
    .upload .title small {
        display: block;
        margin-top: 2px;
    }
    .filelist .title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        flex-wrap: nowrap; /* 防止换行 */
    }
    
    .select-group {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        width: 100%;
        justify-content: center; /* 确保在移动端也居中 */
    }
    
    .select-group label {
        font-size: 13px;
        font-weight: 400;
        white-space: nowrap;
        width: auto;
    }
    
    .select-group select {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
      .copyall {
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 12px;
        font-size: 13px;
        font-weight: 500;
        min-width: 70px;
        margin-left: auto;
        white-space: nowrap;
        flex-shrink: 0; /* 防止按钮缩小 */
    }
    
    .upload .content .desc {
        font-size: 14px;
    }
    
    .filelist .list .item .file {
        flex-wrap: wrap;
    }
    
    .filelist .list .item .file .icon {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
    
    .filelist .list .item .file .link {
        width: 32px;
        height: 32px;
    }
    
    .copy-buttons-group {
        gap: 6px;
    }
    
    .copy-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
}

/* Mobile optimized filelist title layout */
@media (max-width: 480px) {
    .filelist .title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
        flex-wrap: nowrap; /* 防止换行 */
    }
    
    .gateway-selector {
        padding: 10px 15px;
        min-height: 60px;
        border-bottom: 1px solid #f2f6fc;
        background-color: #f9fafc;
        text-align: center; /* 确保在移动端也居中 */
    }
    
    .select-group {
        width: 100%;
        justify-content: center; /* 确保在移动端也居中 */
    }
    
    .select-group label {
        font-size: 13px;
        white-space: nowrap; /* 防止标签换行 */
    }
    
    .select-group select {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
    
    .copyall {
        white-space: nowrap;
        margin-left: 8px; /* 确保与标题有一定间距 */
    }
    
    .title-text {
        white-space: nowrap; /* 防止标题文字换行 */
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.select-group {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    flex-wrap: nowrap;
    justify-content: center;
}

.select-group label {
    color: #444;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.select-group select {
    padding: 8px 15px;
    border-radius: 10px;
    border: 1px solid #e4e7ed;
    color: #444;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #fff;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23444%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 10px auto;
    padding-right: 28px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.select-group select:focus {
    border-color: #409eff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.2);
}

/* Copy buttons styling */
.copy-buttons-group {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.copy-btn {
    padding: 8px 16px;
    border-radius: 20px;
    background-color: #f5f7fa;
    color: #555;
    border: 1px solid #e4e7ed;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.copy-btn:hover {
    background-color: #ecf5ff;
    color: #409eff;
    border-color: #c6e2ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

.copy-btn:active {
    transform: translateY(0);
}

/* Style for copy all button */
.copyall {
    cursor: pointer;
    font-size: 13px;
    color: #409eff;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.25s ease;
    background-color: rgba(64, 158, 255, 0.1);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    height: 32px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.copyall:hover {
    color: #fff;
    background-color: #409eff;
    box-shadow: 0 6px 12px rgba(64, 158, 255, 0.3);
    transform: translateY(-2px);
}

/* Toast notification styling */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    max-width: 320px;
}

@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
    
    .toast {
        width: 100%;
    }
}

.toast {
    background-color: rgba(51, 51, 51, 0.9);
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: toast-in-right 0.7s;
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toast.success {
    background-color: rgba(40, 167, 69, 0.9);
    border-left: 5px solid #1e7e34;
}

.toast.error {
    background-color: rgba(220, 53, 69, 0.9);
    border-left: 5px solid #bd2130;
}

.toast.info {
    background-color: rgba(23, 162, 184, 0.9);
    border-left: 5px solid #117a8b;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

.toast-close {
    cursor: pointer;
    margin-left: 10px;
    font-size: 16px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toast-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-out-right {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hide {
    animation: toast-out-right 0.7s forwards;
}

/* Add footer styling */
#footer {
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    text-align: center;
    padding: 15px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px 12px 0 0;
    z-index: 100;
}

#footer a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    transition: color 0.2s;
    margin: 0 5px;
}

#footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Add loading animations */
@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

.filelist .list .item.uploading {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Add touch specific enhancements for mobile */
@media (hover: none) and (pointer: coarse) {
    /* 增加触摸目标尺寸，更容易点击 */
    .select-group select,
    .copyall,
    .copy-btn,
    .filelist .list .item .file .link {
        min-height: 40px;
        min-width: 40px;
    }
    
    /* 增大下拉菜单选项的可点击区域 */
    .select-group select {
        font-size: 16px; /* 避免iOS自动缩放 */
        padding: 10px 12px;
        padding-right: 30px;
        background-size: 12px auto;
        background-position: right 12px top 50%;
    }
    
    /* 增加触摸反馈 */
    .select-group select:active,
    .copyall:active,
    .copy-btn:active {
        transform: scale(0.96);
        transition: transform 0.1s;
    }
    .upload .content:active {
        background-color: #f0f8ff;
        transform: scale(0.98);
    }
    
    .upload .content:active .icon {
        transform: translateY(-5px);
        fill: #409eff;
    }
    
    .filelist .list .item .file .link {
        padding: 10px;
        width: 40px;
        height: 40px;
    }
    
    .filelist .list .item .file .link svg {
        width: 20px;
        height: 20px;
    }
    
    .copy-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    /* Add active state feedback for mobile taps */
    .copy-btn:active,
    .select-group select:active,
    .copyall:active,
    .filelist .list .item .file .link:active {
        transform: scale(0.95);
        opacity: 0.9;
    }
    
    /* Improved scrolling for touch devices */
    .filelist .list {
        -webkit-overflow-scrolling: touch;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .filelist .title {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .gateway-selector .select-group {
        flex-direction: column;
        align-items: center; /* 修改为居中对齐 */
        gap: 5px;
    }
    
    .gateway-selector .select-group label {
        margin-bottom: 3px;
    }
    
    .select-group select {
        width: 100%;
        max-width: none;
    }
    
    .copyall {
        padding: 0 10px;
        min-width: 60px;
    }
}

/* Language selector styling */
.lang-selector {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

#langSelect {
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid #dcdfe6;
    background-color: #fff;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

#langSelect:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* Make sure the title has position relative to contain the absolute positioned language selector */
.upload .title {
    position: relative;
    display: flex;
    align-items: center;
}
