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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: #2c3e50;
    color: white;
    padding: 15px 0;
    margin-bottom: 30px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
}

header nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    opacity: 0.9;
}

header nav a:hover,
header nav a.active {
    opacity: 1;
    text-decoration: underline;
}

main {
    padding-bottom: 50px;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-form input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-form button,
button,
.download-btn {
    padding: 12px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.search-form button:hover,
button:hover,
.download-btn:hover {
    background: #2980b9;
}

.categories {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.categories a {
    padding: 8px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.categories a:hover,
.categories a.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.resource-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.resource-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    gap: 15px;
}

.resource-item:last-child {
    border-bottom: none;
}

.resource-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.resource-icon.large {
    font-size: 4rem;
}

.resource-info {
    flex: 1;
}

.resource-info h3,
.resource-info h4 {
    margin-bottom: 8px;
}

.resource-info h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.resource-info h3 a:hover {
    color: #3498db;
}

.resource-meta {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.vip-badge {
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 8px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a {
    padding: 8px 14px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover,
.pagination a.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.empty {
    text-align: center;
    padding: 50px;
    color: #666;
}

.auth-page,
.upload-page,
.detail-page,
.profile-page {
    max-width: 600px;
    margin: 0 auto;
}

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group small {
    color: #666;
    font-size: 0.85rem;
}

.message {
    padding: 15px;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    margin-bottom: 20px;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
}

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

.auth-link a {
    color: #3498db;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.detail-title h2 {
    margin-bottom: 10px;
}

.detail-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    font-weight: 500;
    color: #666;
    margin-right: 10px;
}

.detail-description {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.detail-description h3 {
    margin-bottom: 15px;
}

.detail-actions {
    text-align: center;
}

.download-btn.large {
    padding: 15px 50px;
    font-size: 1.2rem;
}

.vip-notice {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
}

.profile-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.info-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.info-section h3 {
    margin-bottom: 15px;
}

.my-resources h3 {
    margin-bottom: 20px;
}

.delete-btn {
    background: #e74c3c;
}

.delete-btn:hover {
    background: #c0392b;
}

.admin-dashboard h2,
.admin-page h2 {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
}

.section {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.section h3 {
    margin-bottom: 15px;
}

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

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

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

.form-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.form-box h3 {
    margin-bottom: 15px;
}

.btn-small {
    padding: 5px 12px;
    font-size: 0.85rem;
    margin-right: 5px;
}

.btn-small.danger {
    background: #e74c3c;
}

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

.filters {
    margin-bottom: 20px;
}

.info-box {
    background: #e8f4fd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-box h3 {
    margin-bottom: 15px;
}

.settings-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

button.primary {
    background: #27ae60;
}

button.primary:hover {
    background: #219a52;
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    header nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    header nav a {
        margin: 0;
    }
    
    .resource-item {
        flex-direction: column;
        text-align: center;
    }
    
    .resource-meta {
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-info {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: 0.9rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
    }
}
