* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    width: 60px;
    height: 60px;
    stroke: #667eea;
    margin: 0 auto 20px;
}

.login-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.tab-buttons {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.auth-form {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

/* 主页面 */
.header {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    color: #333;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome-msg {
    color: #666;
}

.logout-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #e0e0e0;
}

.main-content {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

.sidebar {
    width: 240px;
    background: white;
    padding: 20px 0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    min-height: calc(100vh - 64px);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background: #f5f5f5;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    color: #667eea;
    border-left: 3px solid #667eea;
}

.content {
    flex: 1;
    padding: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    color: #333;
}

.back-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #f5f5f5;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.cat-tab {
    padding: 10px 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.cat-tab:hover {
    border-color: #667eea;
}

.cat-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* 文件列表 */
.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.file-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.file-preview {
    height: 160px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview svg {
    width: 64px;
    height: 64px;
    opacity: 0.5;
}

.file-info {
    padding: 16px;
}

.file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
}

.file-date {
    font-size: 12px;
    color: #bbb;
}

.file-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.action-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.download-btn {
    background: #e8f0fe;
    color: #1a73e8;
}

.download-btn:hover {
    background: #d2e3fc;
}

.delete-btn {
    background: #fce8e6;
    color: #d93025;
}

.delete-btn:hover {
    background: #fad2cf;
}

/* 上传区域 */
.upload-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-icon {
    width: 64px;
    height: 64px;
    stroke: #667eea;
    margin: 0 auto 20px;
}

.upload-area p {
    color: #666;
    margin-bottom: 20px;
    font-size: 16px;
}

.upload-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.upload-btn:hover {
    transform: translateY(-2px);
}

.upload-progress {
    margin-top: 30px;
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    border-radius: 4px;
}

#progressText {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.file-types-info {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.file-types-info h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.type-grid > div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.tag {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.tag.video {
    background: #e8f0fe;
    color: #1a73e8;
}

.tag.image {
    background: #e6f4ea;
    color: #137333;
}

.tag.document {
    background: #fef7e0;
    color: #b06000;
}

.tag.other {
    background: #f3e8fd;
    color: #7b1fa2;
}

/* 提示框 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: #333;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: #137333;
}

.toast.error {
    background: #d93025;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .content {
        padding: 16px;
    }

    .file-list {
        grid-template-columns: 1fr;
    }

    .type-grid {
        grid-template-columns: 1fr;
    }
}
