/*
  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;500;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;
    --email-color: #ff4d4f;
    --discord-color: #5865f2;
    --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;
}

/* =========================================
   新版：高颜值果冻风登录遮罩层
   ========================================= */
.login-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.7), rgba(219, 234, 254, 0.7));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-container {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 48px 40px;
    border-radius: 32px;
    box-shadow: 0 30px 60px rgba(30, 42, 68, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    text-align: center;
    width: 100%;
    max-width: 380px;
    animation: scaleUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes scaleUp {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.login-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
    position: relative;
}

.login-avatar::after {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: pulseRing 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes pulseRing {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.login-container h2 {
    font-size: 1.8rem;
    color: var(--text);
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-container p {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.input-group {
    width: 100%;
    position: relative;
    margin-bottom: 12px;
}

.input-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1.1rem;
    transition: color 0.3s;
}

.input-group input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    border-radius: 16px;
    border: 2px solid rgba(203, 213, 225, 0.6);
    background: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
    outline: none;
    transition: all 0.3s ease;
    color: var(--text);
    font-family: inherit;
    font-weight: 500;
}

.input-group input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-group:focus-within i {
    color: var(--primary);
}

.login-error {
    color: var(--danger);
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 20px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.login-error.show {
    opacity: 1;
    transform: translateY(0);
}

.login-btn {
    width: 100%;
    background: var(--text);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 16px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.login-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

/* ========================================= */

.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; 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, .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; }

.api-selector { margin-bottom: 24px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.api-selector label { font-weight: 600; color: var(--muted); font-size: 0.95rem; }
.endpoint-controls { display: flex; align-items: center; gap: 8px; }
.custom-select {
    padding: 10px 36px 10px 16px; border-radius: 12px; border: 2px solid rgba(203, 213, 225, 0.6);
    background: rgba(248, 250, 252, 0.9); color: var(--text); font-family: inherit; font-size: 0.95rem; font-weight: 500;
    outline: none; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); max-width: 220px;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.custom-select:hover, .custom-select:focus { border-color: var(--primary); box-shadow: 0 4px 15px rgba(79, 70, 229, 0.15); background-color: #ffffff; }

.icon-btn {
    background: rgba(248, 250, 252, 0.9); border: 2px solid rgba(203, 213, 225, 0.6);
    border-radius: 10px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--primary); font-size: 1rem; transition: all 0.3s ease;
}
.icon-btn:hover { border-color: var(--primary); background: var(--primary); color: white; transform: scale(1.05); }
.icon-btn.danger-icon { color: var(--danger); }
.icon-btn.danger-icon:hover { border-color: var(--danger); background: var(--danger); }

.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; transition: all 0.4s ease;
    display: flex; align-items: center; justify-content: center; width: 36px; 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); } }
.contact-link:nth-child(1):hover { 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(2):hover { 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(3):hover { 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(4):hover { color: #ffffff; background: linear-gradient(45deg, var(--muted), var(--website-color)); box-shadow: 0 6px 15px rgba(16, 185, 129, 0.5); }
.contact-link:hover::after {
    content: attr(title); position: absolute; top: -40px; background: var(--primary);
    color: #ffffff; padding: 4px 8px; 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;
}
.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; }
    .api-selector { justify-content: flex-start; margin-bottom: 20px; }
}
