* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.header {
    background: #f5f5f5;
    color: #333;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #333;
}

.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav a {
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav a:hover {
    background: rgba(0,0,0,0.1);
}

.search-section {
    background: #444;
    padding: 1.5rem 0;
    margin-bottom: 0;
    overflow: hidden;
    position: relative;
}

.search-section.with-bg {
    background: none;
}

.search-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background-repeat: repeat-x;
    background-size: auto 100%;
    animation: scrollBg 30s linear infinite;
    z-index: 0;
}

@keyframes scrollBg {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.search-section .container {
    position: relative;
    z-index: 1;
}

.notice-bar {
    background: #2c3e50;
    padding: 4px 0;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.notice-bar .container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notice-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.notice-content {
    flex: 1;
    overflow: hidden;
    height: 20px;
}

#noticeSlider {
    transition: transform 0.5s ease;
}

.notice-item {
    height: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 0.85rem;
}

.notice-user {
    font-weight: bold;
}

.notice-resource {
    background: rgba(255,255,255,0.2);
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-section .container {
    padding: 8px 0 15px 0;
}

.search-box-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 10px;
}

.search-box {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 40px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    padding: 15px 25px;
    border: none;
    font-size: 1.1rem;
    outline: none;
    background: white;
    color: #333;
}

.search-box input::placeholder {
    color: #999;
}

.search-box button {
    padding: 15px 40px;
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.search-box button:hover {
    background: #2563eb;
}

.hot-search-section {
    padding: 8px 0;
    margin-bottom: 1.5rem;
}

.hot-search-bar-wrapper {
    max-width: 550px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    padding: 10px 25px;
}

.hot-search-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: white;
    font-size: 0.95rem;
}

.hot-search-label {
    font-weight: 500;
}

.hot-search-items {
    display: flex;
    gap: 25px;
}

.hot-search-item {
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.hot-search-item:hover {
    opacity: 0.8;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 2rem;
}

.resource-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.resource-thumbnail {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #f0f0f0;
}

.resource-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.resource-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-category {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.resource-price {
    font-size: 1.1rem;
    color: #ff5722;
    font-weight: bold;
}

.resource-link {
    text-decoration: none;
    display: block;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #2c3e50;
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover {
    background: #45a049;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #e68a00;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.auth-container {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.auth-container .btn {
    width: 100%;
}

.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.detail-container {
    max-width: 900px;
    margin: 30px auto;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.detail-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
}

.video-player {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.video-player video {
    width: 100%;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.gallery img {
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s;
    background: #f5f5f5;
    align-self: flex-start;
}

.gallery img:hover {
    transform: scale(1.01);
}

.user-center {
    max-width: 1000px;
    margin: 30px auto;
}

.user-info {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.balance-display {
    font-size: 1.5rem;
    color: #ff5722;
    font-weight: bold;
}

.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
}

tr:hover {
    background: #f8f9fa;
}

.admin-sidebar {
    width: 250px;
    background: #2c3e50;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding-top: 20px;
}

.admin-sidebar a {
    display: block;
    color: #ecf0f1;
    padding: 15px 20px;
    text-decoration: none;
    transition: background 0.3s;
    text-align: center;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: #34495e;
}

.admin-content {
    margin-left: 250px;
    padding: 30px;
}

.admin-header {
    background: white;
    padding: 15px 30px;
    margin: -30px -30px 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .resources-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .resource-thumbnail {
        height: 120px;
    }
    
    .resource-title {
        font-size: 0.95rem;
    }
    
    .resource-price {
        font-size: 1.1rem;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .search-box {
        flex-direction: column;
    }
    
    .search-box button {
        width: 100%;
    }
    
    .detail-title {
        font-size: 1.4rem;
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
