* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

/* Auth Forms */
.auth-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

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

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

/* Alerts */
.alert {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-badge {
    background-color: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.progress-bar {
    background-color: #ecf0f1;
    border-radius: 10px;
    height: 10px;
    margin-top: 10px;
    overflow: hidden;
}

.progress {
    background-color: #3498db;
    height: 100%;
    transition: width 0.3s;
}

/* Upload Section */
.upload-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.upload-form .form-group {
    margin-bottom: 15px;
}

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

.upload-form input[type="text"],
.upload-form input[type="file"],
.upload-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.upload-form small {
    color: #666;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* File List */
.file-list {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.file-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.file-preview {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.file-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-icon {
    font-size: 48px;
}

.file-info {
    padding: 15px;
}

.file-info h4 {
    margin-bottom: 10px;
    color: #2c3e50;
    word-break: break-word;
}

.file-info p {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.file-actions .btn {
    flex: 1;
    min-width: 60px;
    text-align: center;
}

.no-files {
    text-align: center;
    color: #666;
    padding: 40px;
}

/* Admin Styles */
.admin-section {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.admin-table tr:hover {
    background-color: #f8f9fa;
}

.status-active {
    color: #27ae60;
    font-weight: 500;
}

.status-banned {
    color: #e74c3c;
    font-weight: 500;
}

.actions {
    display: flex;
    gap: 5px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 40px;
}

.hero h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.feature {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.feature h3 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #2c3e50;
}

.admin-link {
    text-align: center;
    margin-top: 30px;
}

/* 消息提示样式 */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

.message-toast.error {
    background: #f44336;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 文件操作按钮样式 */
.file-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.file-actions .btn {
    flex: 1;
    min-width: 60px;
    text-align: center;
}

/* 响应式改进 */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
    
    .file-actions {
        flex-direction: column;
    }
    
    .file-actions .btn {
        flex: none;
    }
    
    .hero .actions {
        flex-direction: column;
        align-items: center;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .upload-section,
    .file-list,
    .admin-section {
        padding: 20px;
    }
    
    .auth-form {
        margin: 20px auto;
        padding: 20px;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .hero h2 {
        font-size: 1.8em;
    }
    
    .feature {
        padding: 20px;
    }
    
    .file-info {
        padding: 10px;
    }
    
    .file-preview {
        height: 150px;
    }
}

/* 表单元素焦点状态改进 */
input:focus, 
select:focus, 
button:focus, 
textarea:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 加载状态 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}