/*
  Copyright (c) 2025 [Your Name or Organization]
  This file is part of the IPFS File Sharing project.
  Licensed under the MIT License (or specify your license).
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* 根变量 */
:root {
    --primary: #4f46e5;
    --primary-dark: #7c3aed;
    --danger: #f43f5e;
    --danger-dark: #e11d48;
    --text: #1e2a44;
    --muted: #64748b;
    --success: #10b981;
    --bg-light: rgba(255, 255, 255, 0.9);
    --shadow: 0 20px 80px rgba(0, 0, 0, 0.1);
    --wechat-color: #07c160; /* 微信品牌色 */
    --telegram-color: #0088cc; /* Telegram 品牌色 */
    --email-color: #ff4d4f; /* 邮箱通用色 */
    --discord-color: #5865f2; /* Discord 品牌色 */
    --website-color: #10b981; /* 网站通用色 */
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全局样式 */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #eef2ff, #dbeafe, #e0e7ff, #f3e8ff);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    color: var(--text);
    overflow-x: hidden;
}

/* 容器样式 */
.container {
    max-width: 1300px;
    width: 100%;
    background: var(--bg-light);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    box-shadow: var(--shadow);
    padding: 48px;
    display: flex;
    gap: 56px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.left-section, .right-section {
    flex: 1;
}

.left-section {
    border-right: 1px solid rgba(229, 231, 235, 0.5);
    padding-right: 48px;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

p {
    color: var(--muted);
    text-align: center;
    font-size: 1.15rem;
    margin-bottom: 36px;
}

/* 文件列表样式 */
.file-list {
    list-style: none;
    max-height: 520px;
    overflow-y: auto;
    padding: 12px;
    border-radius: 20px;
    background: rgba(248, 250, 252, 0.8);
}

.file-list::-webkit-scrollbar {
    width: 8px;
}

.file-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-track {
    background: rgba(241, 245, 249, 0.5);
}

.file-list li {
    background: var(--bg-light);
    border: 1px solid rgba(229, 231, 235, 0.7);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.file-list li:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
    background: rgba(255, 255, 255, 1);
}

.file-icon {
    width: 24px;
    height: 24px;
    fill: var(--primary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.file-list li:hover .file-icon {
    transform: scale(1.15);
}

.file-info {
    flex: 1;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}

.file-size {
    color: var(--muted);
    font-size: 0.9rem;
}

.file-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.preview-btn, .download-btn, .copy-url-btn {
    background: rgba(241, 245, 249, 0.9);
    border: none;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 优化预览和下载按钮的渐变色 */
.preview-btn:hover, .download-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.copy-url-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.copy-url-btn {
    font-size: 0.9rem;
    padding: 8px 16px;
    font-weight: 500;
}

/* 上传区域样式 */
.upload-area {
    background: rgba(248, 250, 252, 0.9);
    border: 2px dashed rgba(203, 213, 225, 0.8);
    border-radius: 24px;
    padding: 56px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(5px);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.005); }
}

.upload-area:hover, .upload-area.drag-over {
    background: rgba(238, 242, 255, 0.95);
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(79, 70, 229, 0.15);
    transform: scale(1.01);
    animation: none;
}

.upload-area h2 {
    color: var(--muted);
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

.upload-area:hover h2, .upload-area.drag-over h2 {
    color: var(--primary);
}

.upload-icon-wrapper {
    display: flex;
    justify-content: center;
}

.upload-icon {
    width: 56px;
    height: 56px;
    transition: all 0.4s ease;
}

.upload-area:hover .upload-icon, .upload-area.drag-over .upload-icon {
    transform: scale(1.1) rotate(360deg);
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 0 0 24px 24px;
    width: 0;
    transition: width 0.5s ease-in-out;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.4);
}

/* 上传状态样式 */
.upload-status {
    margin-top: 28px;
    font-size: 1.05rem;
    font-weight: 500;
    text-align: center;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.upload-status.success {
    color: var(--success);
    background: rgba(240, 253, 244, 0.8);
}

.upload-status.error {
    color: var(--danger);
    background: rgba(254, 242, 242, 0.8);
}

/* 文件预览样式 */
.file-preview {
    margin-top: 20px;
    background: rgba(241, 245, 249, 0.9);
    padding: 14px 18px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 1rem;
    word-break: break-all;
    max-width: 100%;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* 清除历史按钮样式 */
.clear-history-btn {
    background: linear-gradient(90deg, var(--danger), var(--danger-dark));
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    display: block;
    margin: 0 auto 28px;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    background: linear-gradient(90deg, var(--danger-dark), var(--danger));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(244, 63, 94, 0.3);
}

/* 版权信息样式 */
.footer {
    margin-top: 60px;
    padding: 24px; /* 缩小内边距以适应更小的图标 */
    text-align: center;
    color: var(--text);
    font-size: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(220, 225, 255, 0.9));
    border-radius: 24px;
    backdrop-filter: blur(15px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.footer p {
    margin: 16px 0 0 0; /* 调整间距 */
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text);
}

/* 分隔线 */
.footer p::before {
    content: '';
    display: block;
    width: 100px;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 0 auto 16px auto;
}

/* 联系方式样式 */
.contact-links {
    display: flex;
    justify-content: center;
    gap: 24px; /* 缩小间距以适应更小的图标 */
    flex-wrap: wrap;
}

.contact-link {
    position: relative;
    color: var(--muted);
    font-size: 1.3rem; /* 原尺寸 2.5rem 的一半左右 */
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; /* 原尺寸 70px 的一半左右 */
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* 缩小阴影 */
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

/* 弹跳动画 */
.contact-link:hover {
    animation: bounce 0.6s ease forwards;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-10px) scale(1.2); } /* 调整幅度 */
    60% { transform: translateY(-5px) scale(1.1); }
}

/* 平台特定的渐变 Hover 效果 */
.contact-link:nth-child(1):hover { /* WeChat */
    color: #ffffff;
    background: linear-gradient(45deg, var(--muted), var(--wechat-color));
    box-shadow: 0 6px 15px rgba(7, 193, 96, 0.5);
}

.contact-link:nth-child(2):hover { /* Telegram */
    color: #ffffff;
    background: linear-gradient(45deg, var(--muted), var(--telegram-color));
    box-shadow: 0 6px 15px rgba(0, 136, 204, 0.5);
}

.contact-link:nth-child(3):hover { /* Email */
    color: #ffffff;
    background: linear-gradient(45deg, var(--muted), var(--email-color));
    box-shadow: 0 6px 15px rgba(255, 77, 79, 0.5);
}

.contact-link:nth-child(4):hover { /* Discord */
    color: #ffffff;
    background: linear-gradient(45deg, var(--muted), var(--discord-color));
    box-shadow: 0 6px 15px rgba(88, 101, 242, 0.5);
}

.contact-link:nth-child(5):hover { /* Website */
    color: #ffffff;
    background: linear-gradient(45deg, var(--muted), var(--website-color));
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.5);
}

/* 自定义 Tooltip */
.contact-link:hover::after {
    content: attr(title);
    position: absolute;
    top: -40px; /* 调整 tooltip 位置以适应更小的图标 */
    background: var(--primary);
    color: #ffffff;
    padding: 4px 8px; /* 缩小 tooltip 大小 */
    border-radius: 4px;
    font-size: 0.75rem; /* 缩小字体 */
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
    animation: fadeInTooltip 0.3s ease;
}

/* Tooltip 小箭头 */
.contact-link:hover::before {
    content: '';
    position: absolute;
    top: -12px; /* 调整箭头位置 */
    border: 6px solid transparent; /* 缩小箭头 */
    border-top-color: var(--primary);
    z-index: 10;
}

@keyframes fadeInTooltip {
    0% { opacity: 0; transform: translateY(5px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 响应式设计 */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        padding: 28px;
    }

    .left-section {
        border-right: none;
        border-bottom: 1px solid rgba(229, 231, 235, 0.5);
        padding-right: 0;
        padding-bottom: 28px;
        margin-bottom: 28px;
    }

    .right-section {
        padding-left: 0;
    }

    .file-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .upload-area {
        padding: 40px;
    }

    h1 {
        font-size: 1.4rem;
    }

    .upload-area h2 {
        font-size: 1.2rem;
    }

    .footer {
        font-size: 0.9rem;
        padding: 18px; /* 缩小内边距 */
        margin-top: 36px;
    }

    .footer p {
        margin-top: 12px;
    }

    .footer p::before {
        width: 70px;
        margin: 10px auto 0 auto;
    }

    .contact-links {
        gap: 20px; /* 缩小间距 */
    }

    .contact-link {
        font-size: 1.2rem; /* 小屏幕上略缩小 */
        width: 32px;
        height: 32px;
    }

    .contact-link:hover::after {
        top: -35px;
        font-size: 0.65rem;
    }

    .contact-link:hover::before {
        top: -10px;
        border: 5px solid transparent;
        border-top-color: var<|control242|>част

---

### 优化效果说明
1. **图标尺寸调整**：
   - 图标尺寸从 `2.5rem` 减小到 `1.3rem`（约一半），容器从 `70px x 70px` 减小到 `36px x 36px`。
   - 小屏幕上图标尺寸为 `1.2rem`，容器为 `32px x 32px`，保持比例。
   - 图标间距（`gap`）从 `40px` 减小到 `24px`（小屏幕为 `20px`），适应更小的图标。

2. **其他效果保持不变**：
   - 渐变特效：hover 时的渐变（从灰色到品牌色，例如微信从灰色到绿色）保持不变。
   - 弹跳动画：hover 时的弹跳效果（`@keyframes bounce`）保持不变，调整了弹跳幅度以适应更小的图标。
   - 动态渐变方向：渐变方向从 `135deg` 到 `45deg` 的变化保持不变。
   - 自定义 tooltip：tooltip 的样式和动画保持不变，调整了位置（`top: -40px`）和字体大小（`0.75rem`），以适应更小的图标。
   - 预览和下载按钮的渐变色：保持蓝色渐变（`--primary` 到 `--primary-dark`）。

3. **布局调整**：
   - 缩小 `footer` 的内边距（`padding: 24px`）和外边距（`margin-top: 60px`），以适应更小的图标。
   - 调整 tooltip 和箭头的大小及位置，确保与更小的图标协调。

---

### 效果预览
- **图标尺寸**：图标尺寸缩小到原来的一半左右（`1.3rem`，`36px x 36px`），视觉上更紧凑。
- **其他效果**：渐变特效、弹跳动画、动态渐变方向和 tooltip 保持不变，效果依然流畅。
- **布局**：图标间距更小，`footer` 区域更紧凑，整体仍然美观。

---

### 测试建议
1. **检查图标尺寸**：
   - 打开 `index.html`，观察 `footer` 区域的联系方式图标，确认尺寸是否缩小到原来的一半左右。
   - 测试小屏幕上的图标尺寸，是否仍然清晰。

2. **验证其他效果**：
   - hover 每个图标，确认渐变特效、弹跳动画和 tooltip 是否正常。
   - 检查 tooltip 的位置和字体大小是否与更小的图标协调。

3. **响应式测试**：
   - 在小屏幕设备上测试，确保图标排列、tooltip 和动画效果仍然美观。

---

### 扩展建议
1. **图标加载动画**：
   - 为图标添加逐个加载的动画，保持动态感：
     ```css
     .contact-link {
         animation: fadeIn 0.5s ease-out forwards;
         animation-delay: calc(var(--delay) * 0.1s);
     }
     .contact-link:nth-child(1) { --delay: 1; }
     .contact-link:nth-child(2) { --delay: 2; }
     .contact-link:nth-child(3) { --delay: 3; }
     .contact-link:nth-child(4) { --delay: 4; }
     .contact-link:nth-child(5) { --delay: 5; }
     @keyframes fadeIn {
         0% { opacity: 0; transform: scale(0.8); }
         100% { opacity: 1; transform: scale(1); }
     }
     ```

2. **背景动态效果**：
   - 为 `footer` 添加流动的渐变背景：
     ```css
     .footer {
         background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(220, 225, 255, 0.9));
         background-size: 200% 200%;
         animation: gradientFlow 8s ease-in-out infinite;
     }
     @keyframes gradientFlow {
         0% { background-position: 0% 50%; }
         50% { background-position: 100% 50%; }
         100% { background-position: 0% 50%; }
     }
     ```

3. **图标边框动画**：
   - 在 hover 时为图标添加边框动画：
     ```css
     .contact-link:hover {
         border: 2px solid transparent;
         animation: borderGlow 1s alternate infinite;
     }
     @keyframes borderGlow {
         0% { border-color: transparent; }
         100% { border-color: var(--primary); }
     }
     ```