/* --- CSS Variables & Reset --- */
:root {
    --primary-color: #3b82f6;      /* 亮蓝 */
    --primary-dark: #1e40af;       /* 深蓝 */
    --secondary-color: #64748b;    /* 灰蓝 */
    --accent-color: #f59e0b;       /* 琥珀色 (用于强调) */
    --bg-body: #f8fafc;            /* 浅灰背景 */
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-light: #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Glass Header --- */
.glass-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-dark);
}

.logo i { font-size: 2rem; }
.logo h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }

.mod-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.mod-nav a, .user-welcome {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mod-nav a:hover { color: var(--primary-color); }

/* Button Styles in Nav */
.login-btn, .activate-btn {
    color: var(--primary-color) !important;
}

.register-btn {
    background: var(--primary-color);
    color: white !important;
    padding: 8px 20px;
    border-radius: 20px;
}
.register-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

.activate-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}
.activate-btn:hover { background: var(--primary-color); color: white !important; }

/* --- Hero & Search Section --- */
.hero-section {
    text-align: center;
    padding: 60px 0 40px;
    background: radial-gradient(circle at center, #e0f2fe 0%, transparent 70%);
}

.hero-content h2 {
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 10px;
}

.hero-content p {
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 1.1rem;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-form {
    display: flex;
    background: white;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    padding: 6px;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.search-form:focus-within {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.search-icon {
    padding: 14px 0 14px 20px;
    color: var(--text-light);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 1rem;
    background: transparent;
}

.search-button {
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 0 28px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-button:hover { background: var(--primary-color); }

/* Suggestions */
.suggestions-box {
    display: none;
    position: absolute;
    top: 110%;
    left: 15px;
    right: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    text-align: left;
    overflow: hidden;
}

.suggestions-box ul li {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}
.suggestions-box ul li:hover { background: #f8fafc; color: var(--primary-color); }

/* Category Pills */
.category-nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.cat-pill {
    display: inline-block;
    padding: 6px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.cat-pill:hover, .cat-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* --- Section Divider --- */
.section-divider {
    display: flex;
    align-items: center;
    margin: 40px 0 20px;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.2rem;
}
.section-divider span { display: flex; align-items: center; gap: 10px; }
.section-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin-left: 20px;
    border-radius: 2px;
}

/* --- Mod Grid & Cards --- */
.mod-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.mod-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f5f9;
}

.mod-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: #e2e8f0;
}

.card-image-wrapper {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mod-card:hover .card-image-wrapper img { transform: scale(1.05); }

.card-category {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text-main);
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content .description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 20px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

.card-meta span { display: flex; align-items: center; gap: 5px; }

/* --- Pagination --- */
.pagination-nav { margin: 20px 0 60px; text-align: center; }
.pagination { display: inline-flex; gap: 8px; }

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: white;
    color: var(--text-main);
    font-weight: 600;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.page-item.active .page-link {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-link:hover:not(.active) {
    background: #f1f5f9;
    transform: translateY(-2px);
}

/* --- Footer --- */
footer {
    background: white;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
    padding: 60px 0 30px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    text-align: center;
}

.donate-container {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.3);
}

.donate-container h3 { font-size: 1.5rem; margin-bottom: 8px; }
.donate-container p { margin-bottom: 24px; opacity: 0.9; }

.donate-btn {
    background: white;
    color: var(--primary-dark);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.donate-btn:hover { transform: scale(1.05); box-shadow: 0 10px 15px rgba(0,0,0,0.1); }

.copyright { color: var(--text-light); font-size: 0.9rem; }
.beian a { color: var(--text-light); }
.beian a:hover { color: var(--primary-color); text-decoration: underline; }

/* --- Modal --- */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 1.25rem; }
.close-modal { font-size: 1.5rem; cursor: pointer; color: var(--text-light); }
.close-modal:hover { color: var(--text-main); }

.activate-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin: 10px 0 20px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}
.activate-input:focus { border-color: var(--primary-color); }

.submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.submit-btn:hover { background: var(--primary-dark); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- Responsive --- */
@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 16px; }
    .mod-nav { gap: 15px; flex-wrap: wrap; justify-content: center; }
    .hero-content h2 { font-size: 1.8rem; }
    .search-form { width: 100%; }
    .search-input { width: 100%; } 
    .mod-list { grid-template-columns: 1fr; }
    .section-divider::after { margin-left: 10px; }
}

/* 消息中心侧边栏 */
.notification-panel {
    position: fixed;
    right: -350px; /* 默认隐藏 */
    top: 0;
    width: 350px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.panel-open {
    right: 0;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.notif-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.notif-item:hover {
    background: #f9f9f9;
}

.notif-item.unread {
    background: #e8f4ff;
}

.notif-item.unread::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 15px;
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
}

.notif-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.notif-content h4 {
    font-size: 14px;
    margin: 0 0 5px 0;
    color: #333;
}

.notif-content p {
    font-size: 12px;
    margin: 0;
    color: #666;
}

.notif-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    display: block;
}

/* 导航栏头像 */
.nav-avatar-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 红点徽标 */
.badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: #ff4757;
    border-radius: 50%;
    border: 2px solid #fff;
    display: none; /* 默认隐藏 */
}

.show-badge {
    display: block;
}

/* 隐藏的文件上传input */
#avatarInput {
    display: none;
}