/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&display=swap');

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 全局字体和颜色设置 */
:root {
    --primary-color: #3498db; /* 蓝色主色调 */
    --primary-dark: #2980b9;
    --danger-color: #dc3545;
    --danger-dark: #c82333;
    --success-color: #4CAF50;
    --background-color: #000; /* 背景颜色 */
    --text-color: #333; /* 文字颜色 */
    --border-color: #e0e0e0; /* 边框颜色 */
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* 盒子阴影 */
}

/* 设置背景图片并控制其透明度 */
body {
    position: relative; /* 为伪元素定位 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    isolation: isolate;
}

/* 伪元素设置背景图片并控制透明度 */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://api.rls.icu/adaptive');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 1; /* 背景图片透明度设为1，不透明 */
    z-index: -1; /* 确保背景图片在最底层 */
}

/* 联系按钮样式 */
.contact-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.contact-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

/* 容器设置半透明背景，不影响子元素 */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.5); /* 半透明白色背景 */
    border-radius: 12px;
    box-shadow: var(--box-shadow);
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-family: 'Fredoka One', cursive;
    font-size: 2.8em;
    font-weight: 600;
    letter-spacing: 2px;
    background: linear-gradient(45deg, 
        #ABC8E2,  /* 柔和的淡蓝色 */
        #C5DCF1,  /* 更淡的蓝色 */
        #F1D4E5,  /* 淡淡的粉色 */
        #F8E1E7   /* 更淡的粉色 */
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
    animation: softTitleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        filter: drop-shadow(0 0 2px rgba(33, 150, 243, 0.2));
    }
    to {
        filter: drop-shadow(0 0 5px rgba(255, 105, 180, 0.3));
    }
}


/* size-notice 样式修改 */
.size-notice {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
    margin-left: 20px;
}

.size-notice p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #ffffff;
    font-weight: 500;  /* 增加字体粗细 */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.size-notice p strong {
    color: #ffffff;
    font-weight: 500;  /* 增加字体粗细 */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
/* 上传区域样式 */
.upload-container {
    background-color: rgba(255, 255, 255, 0.5); /* 半透明白色背景 */
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.upload-area {
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-dark);
    background-color: rgba(247, 249, 252, 0.8);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
    color: var(--primary-color);
}

.upload-placeholder p {
    color: #2c3e50;
    margin: 5px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.upload-tip {
    font-size: 0.95em;
    color: #95a5a6;
    margin-top: 10px;
}
/* 多文件进度条容器样式 */
.progress-container {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.progress-list {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.progress-list::-webkit-scrollbar {
    width: 6px;
}

.progress-list::-webkit-scrollbar-track {
    background: transparent;
}

.progress-list::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 3px;
}

/* 进度项样式 */
.progress-item {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.progress-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.file-name {
    flex: 1;
    margin-right: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-color);
}

.file-size {
    color: #666;
    font-size: 12px;
}

.progress-bar {
    height: 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress {
    height: 100%;
    background-color: var(--success-color);
    width: 0;
    transition: width 0.3s ease;
}

.progress-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.progress-text {
    color: #666;
}

.status-text {
    font-weight: 500;
}

/* 状态样式 */
.status-text.waiting {
    color: #6c757d;
}

.status-text.validating {
    color: #17a2b8;
}

.status-text.uploading {
    color: #007bff;
}

.status-text.completed {
    color: var(--success-color);
}

.status-text.error {
    color: var(--danger-color);
}

/* 上传总结 */
.upload-summary {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
    color: #666;
}

/* 历史记录区域样式 */
.history-container {
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.history-header h3 {
    color: var(--primary-color); /* 使用配套的蓝色 */
    margin: 0;
    font-size: 1.5em;
    opacity: 1;
    background-color: transparent;
}


.clear-btn {
    padding: 8px 16px;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clear-btn:hover {
    background-color: var(--danger-dark);
}

.image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 10px;
}

/* 图片项样式 */
.image-item {
    background: rgba(255, 255, 255, 1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeIn 0.5s ease;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.image-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.image-info {
    padding: 15px;
}

.image-info input {
    width: 100%;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
}

.image-info button {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 8px;
}

.copy-btn {
    background-color: var(--primary-color);
    color: white;
}

.copy-btn:hover {
    background-color: var(--primary-dark);
}

.delete-btn {
    background-color: var(--danger-color);
    color: white;
}

.delete-btn:hover {
    background-color: var(--danger-dark);
}

.file-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin: 8px 0;
}

/* 文件大小提示 */
.size-tip {
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    color: #666;
    border-top: 1px solid var(--border-color);
}

/* JavaScript 禁用警告 */
.noscript-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--danger-color);
    color: white;
    text-align: center;
    padding: 10px;
    z-index: 9999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
        margin: 10px;
        background-color: rgba(255, 255, 255, 0.5);
    }

    .image-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .upload-area {
        padding: 20px;
    }

    .upload-icon {
        font-size: 36px;
        display: block;
    }

    .image-item img {
        height: 150px;
    }

    .contact-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    h1 {
        font-size: 2em;
    }

    .progress-item {
        padding: 8px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #000;
    }

    .container {
        background-color: rgba(30, 30, 30, 0.5);
    }

    .upload-container,
    .history-container,
    .progress-container {
        background-color: rgba(40, 40, 40, 0.5);
    }

    .progress-item {
        background-color: rgba(50, 50, 50, 1);
        border-color: rgba(60, 60, 60, 1);
    }

    .image-item {
        background-color: rgba(50, 50, 50, 1);
        border-color: rgba(60, 60, 60, 1);
    }

    .image-info input {
        background-color: rgba(60, 60, 60, 1);
        color: #fff;
    }

    h1 {
        background: linear-gradient(45deg, 
            #ABC8E2,
            #C5DCF1,
            #F1D4E5,
            #F8E1E7
        );
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.08);
    }

    .file-name {
        color: #fff;
    }

    .progress-text,
    .file-size {
        color: #aaa;
    }

    .history-header {
        border-bottom-color: #444;
    }

    .upload-summary {
        border-top-color: #444;
        color: #aaa;
    }

    .size-notice p,
    .size-notice p strong {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
        color: rgba(255, 255, 255, 0.95);  /* 略微增加不透明度 */
        font-weight: 500;  /* 确保暗色模式下也保持字体粗细 */
    }

    .history-header h3 {
        color: var(--primary-color); /* 暗色模式下依然保持蓝色 */
        opacity: 1;
}

/* 可访问性增强 */
:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5);
}