/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-gray: #f5f7fa;
    --mid-gray: #dcdde1;
    --dark-gray: #7f8c8d;
    --text-color: #2d3436;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    color: var(--text-color);
    background-color: var(--light-gray);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-search {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 10px 15px;
}

.full-width {
    width: 100%;
}

/* 导航栏样式 */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    color: var(--secondary-color);
}

.user-actions {
    display: flex;
    gap: 10px;
}

/* 英雄区域样式 */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.search-box button {
    border-radius: 0 4px 4px 0;
}

/* 分类和网站样式 */
section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.category-card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-color);
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.category-icon {
    width: 80px;
    height: 80px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.category-icon i {
    font-size: 2.5rem;
    color: var(--secondary-color);
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.category-count {
    display: inline-block;
    margin-top: 15px;
    padding: 5px 15px;
    background-color: var(--light-gray);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.websites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.website-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.website-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.website-logo {
    width: 60px;
    height: 60px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.website-logo i {
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.website-info {
    flex: 1;
}

.website-info h3 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.website-info p {
    color: var(--dark-gray);
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.website-meta {
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-badge {
    display: inline-block;
    padding: 3px 10px;
    background-color: var(--light-gray);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--dark-gray);
}

.rating {
    color: #f39c12;
    font-size: 0.9rem;
}

.visit-btn {
    padding: 8px 15px;
    background-color: var(--secondary-color);
    color: var(--white);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: nowrap;
}

.visit-btn:hover {
    background-color: #2980b9;
}

/* 页脚样式 */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-section.about p {
    opacity: 0.8;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--mid-gray);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.footer-section.contact ul li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white);
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-gray);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--accent-color);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--mid-gray);
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background-color: var(--mid-gray);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.social-btn.wechat {
    background-color: #07C160;
    color: var(--white);
}

.social-btn.qq {
    background-color: #12B7F5;
    color: var(--white);
}

.social-btn.google {
    background-color: #EA4335;
    color: var(--white);
}

.social-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.auth-redirect {
    text-align: center;
}

.auth-redirect a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-redirect a:hover {
    text-decoration: underline;
}

/* 关于页面样式 */
.about-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}

.about-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.about-content {
    padding: 60px 0;
    background-color: var(--white);
}

.content-section {
    margin-bottom: 60px;
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--primary-color);
}

.content-section p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.media-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.media-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.media-item img,
.media-item video {
    width: 100%;
    height: auto;
    display: block;
}

.media-caption {
    padding: 15px;
    text-align: center;
    background-color: var(--light-gray);
}

/* 404页面样式 */
.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.error-illustration {
    max-width: 400px;
    margin-bottom: 40px;
}

.error-illustration img {
    width: 100%;
    height: auto;
}

.error-page h1 {
    font-size: 5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.error-page p {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 30px;
    color: var(--dark-gray);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 20px;
    }

    .main-nav ul {
        margin-top: 15px;
        width: 100%;
    }

    .main-nav ul li {
        margin: 0 10px 0 0;
    }

    .user-actions {
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .websites-grid {
        grid-template-columns: 1fr;
    }

    .website-card {
        flex-direction: column;
        text-align: center;
    }

    .website-meta {
        justify-content: center;
    }

    .error-page h1 {
        font-size: 3rem;
    }
}
