/* 星空主题颜色变量 */
:root {
    --primary-color: #4a69ff;
    --secondary-color: #9d4edd;
    --accent-color: #ff006e;
    --dark-bg: #0a0e27;
    --card-bg: rgba(15, 23, 42, 0.7);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --border-color: rgba(255, 255, 255, 0.1);
    --success-color: #4ade80;
    --error-color: #f87171;
    --warning-color: #fbbf24;
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 星空背景 */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.stars, .stars2, .stars3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.stars {
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-opacity='0.3'%3E%3Cpolygon fill='%234a69ff' points='50 0 60 40 100 50 60 60 50 100 40 60 0 50 40 40'/%3E%3C/g%3E%3C/svg%3E") repeat;
    background-size: 200px 200px;
    animation: animateStars 100s linear infinite;
}

.stars2 {
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 50 50'%3E%3Cg fill-opacity='0.2'%3E%3Cpolygon fill='%239d4edd' points='25 0 30 20 50 25 30 30 25 50 20 30 0 25 20 20'/%3E%3C/g%3E%3C/svg%3E") repeat;
    background-size: 150px 150px;
    animation: animateStars 150s linear infinite;
    animation-delay: -20s;
}

.stars3 {
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cg fill-opacity='0.4'%3E%3Cpolygon fill='%23ff006e' points='15 0 18 12 30 15 18 18 15 30 12 18 0 15 12 12'/%3E%3C/g%3E%3C/svg%3E") repeat;
    background-size: 100px 100px;
    animation: animateStars 200s linear infinite;
    animation-delay: -40s;
}

@keyframes animateStars {
    from {
        transform: translateY(0px);
    }
    to {
        transform: translateY(-1000px);
    }
}

/* 流星效果 */
.shooting-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.8);
    animation: shooting 3s linear infinite;
    opacity: 0;
}

.shooting-star:nth-child(1) {
    top: 20%;
    right: 10%;
    animation-delay: 0s;
    animation-duration: 3s;
}

.shooting-star:nth-child(2) {
    top: 10%;
    right: 40%;
    animation-delay: 2s;
    animation-duration: 4s;
}

.shooting-star:nth-child(3) {
    top: 30%;
    right: 20%;
    animation-delay: 4s;
    animation-duration: 5s;
}

.shooting-star::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(to left, transparent, rgba(255, 255, 255, 0.8));
    transform: translateX(-100px) rotate(45deg);
}

@keyframes shooting {
    0% {
        transform: translateX(0) translateY(0) rotate(135deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    20% {
        transform: translateX(-400px) translateY(400px) rotate(135deg);
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.logo .tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

.header-nav {
    display: flex;
    gap: 15px;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(74, 105, 255, 0.2), rgba(157, 78, 221, 0.2));
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.nav-btn .icon {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.nav-btn span:not(.icon) {
    font-size: 0.8rem;
}

/* 主内容区域 */
.main-content {
    flex: 1;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 上传区域 */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 30px;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(74, 105, 255, 0.05);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.browse-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(74, 105, 255, 0.3);
}

/* 上传表单 */
.upload-form {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(74, 105, 255, 0.05);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.upload-btn-submit {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.upload-btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(74, 105, 255, 0.3);
}

.upload-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* 上传进度 */
.upload-progress {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
}

/* 上传结果 */
.upload-result {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
}

/* 文件管理区域 */
.files-container {
    max-width: 1200px;
    margin: 0 auto;
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.files-header h3 {
    font-size: 1.5rem;
}

.files-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.view-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn.active {
    background: rgba(74, 105, 255, 0.2);
    color: var(--text-primary);
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-indicator .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

/* 文件列表 */
.files-list {
    display: grid;
    gap: 20px;
}

.files-list.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.files-list.list-view {
    grid-template-columns: 1fr;
}

.file-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.file-card.grid-view {
    display: flex;
    flex-direction: column;
}

.file-card.list-view {
    display: flex;
    align-items: center;
    gap: 20px;
}

.file-icon {
    font-size: 2rem;
    margin-bottom: 15px;
}

.file-card.list-view .file-icon {
    margin-bottom: 0;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.file-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.4;
}

.file-card.list-view .file-description {
    margin-bottom: 0;
    max-width: 300px;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.file-action-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.file-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.file-action-btn.delete:hover {
    background: rgba(248, 113, 113, 0.1);
    color: var(--error-color);
    border-color: var(--error-color);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    min-width: 300px;
    z-index: 1001;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--error-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-icon {
    font-size: 1.2rem;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 20px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .files-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .files-list.grid-view {
        grid-template-columns: 1fr;
    }
    
    .file-card.list-view {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modal-content {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .upload-form {
        padding: 20px;
    }
}