* {
    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;
}

.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4a90e2;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #4a90e2;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-btn {
    padding: 0.5rem 1rem;
    background-color: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #357abd;
}

.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 10px;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-btn {
    padding: 1rem 2rem;
    background-color: #fff;
    color: #667eea;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.featured,
.latest {
    margin-bottom: 3rem;
}

.featured h2,
.latest h2,
.categories h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.content-card {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.content-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.content-card-body {
    padding: 1.5rem;
}

.content-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.content-card p {
    color: #666;
    margin-bottom: 1rem;
}

.content-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #999;
    font-size: 0.9rem;
}

.content-card-footer span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.categories {
    margin-bottom: 3rem;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.category-item {
    padding: 0.8rem 1.5rem;
    background-color: #fff;
    border: 2px solid #4a90e2;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.category-item:hover {
    background-color: #4a90e2;
    color: #fff;
}

.footer {
    background-color: #333;
    color: #fff;
    padding: 3rem 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #4a90e2;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #4a90e2;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #555;
    color: #999;
}

@media (max-width: 768px) {
    .nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .search-box {
        width: 100%;
    }

    .search-box input {
        flex: 1;
    }
}

.posts-header {
    margin-bottom: 2rem;
}

.posts-header h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.filter-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-select:hover {
    border-color: #4a90e2;
}

.filter-select:focus {
    outline: none;
    border-color: #4a90e2;
}

.all-posts {
    margin-bottom: 2rem;
}

.load-more {
    text-align: center;
    margin: 2rem 0;
}

.load-more-btn {
    padding: 1rem 3rem;
    background-color: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.load-more-btn:hover {
    background-color: #357abd;
}

.about-hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 10px;
    margin-bottom: 3rem;
}

.about-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.about-hero p {
    font-size: 1.2rem;
}

.about-content {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.about-section {
    margin-bottom: 3rem;
}

.about-section:last-child {
    margin-bottom: 0;
}

.about-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.about-section p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.value-item {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.value-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.value-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #4a90e2;
}

.value-item p {
    color: #666;
    margin: 0;
}

.contact-info {
    background-color: #f9f9f9;
    padding: 2rem;
    border-radius: 8px;
}

.contact-info p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

.links-hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 10px;
    margin-bottom: 3rem;
}

.links-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.links-hero p {
    font-size: 1.2rem;
}

.links-content {
    background-color: #fff;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.links-section {
    margin-bottom: 3rem;
}

.links-section:last-child {
    margin-bottom: 0;
}

.links-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.link-card {
    display: block;
    background-color: #f9f9f9;
    padding: 2rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

.link-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.link-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #4a90e2;
}

.link-card p {
    color: #666;
    font-size: 0.95rem;
}

.recommended {
    margin-bottom: 3rem;
}

.recommended h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.recommended-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.recommended-card {
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    color: #fff;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.recommended-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.recommended-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.recommended-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.recommended-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

/* 内容卡片底部样式调整 */
.content-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
    color: #999;
    flex-wrap: wrap;
    gap: 10px;
}

/* 收藏按钮 */
.favorite-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.favorite-btn:hover {
    background: #ffc107;
    border-color: #ffc107;
    color: #333;
}

.favorite-btn.favorited {
    background: #ffc107;
    border-color: #ffc107;
    color: #333;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

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

/* 响应式设计补充 */
@media (max-width: 768px) {
    .content-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .favorite-btn {
        align-self: flex-start;
    }
}

/* 深色模式 */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #ffffff;
    --border-color: #e0e0e0;
    --primary-color: #4a90e2;
    --secondary-color: #667eea;
    --hover-bg: #f8f9fa;
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --primary-color: #64b5f6;
    --secondary-color: #9575cd;
    --hover-bg: #3a3a3a;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

/* 深色模式下的元素样式 */
body.dark-mode .content-card {
    background-color: var(--card-bg);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .content-card h3 {
    color: var(--text-color);
}

body.dark-mode .content-card p {
    color: #b0b0b0;
}

body.dark-mode .content-card-footer {
    color: #909090;
}

body.dark-mode .favorite-btn {
    background: var(--hover-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

body.dark-mode .favorite-btn:hover {
    background: #ffd54f;
    border-color: #ffd54f;
    color: #333;
}

body.dark-mode .category-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

body.dark-mode .category-item:hover,
body.dark-mode .category-item.active {
    background-color: var(--primary-color);
    color: white;
}

body.dark-mode .recommended-card {
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

body.dark-mode .footer {
    background-color: #2d2d2d;
    color: var(--text-color);
}

body.dark-mode .footer-section h3 {
    color: var(--text-color);
}

body.dark-mode .footer-section p,
body.dark-mode .footer-section li a {
    color: #b0b0b0;
}

body.dark-mode .nav {
    background-color: #2d2d2d;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .logo {
    color: var(--text-color);
}

body.dark-mode .nav-links a {
    color: var(--text-color);
}

body.dark-mode .nav-links a:hover,
body.dark-mode .nav-links a.active {
    color: var(--primary-color);
}

body.dark-mode .search-box input {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

body.dark-mode .search-btn {
    background-color: var(--primary-color);
}

body.dark-mode .race-event {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .race-title {
    color: var(--text-color);
}

body.dark-mode .race-detail-value {
    color: var(--text-color);
}

body.dark-mode .countdown {
    background-color: var(--hover-bg);
}

body.dark-mode .countdown-title {
    color: #b0b0b0;
}

body.dark-mode .link-card {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .link-card h3 {
    color: var(--primary-color);
}

body.dark-mode .link-card p {
    color: #b0b0b0;
}

body.dark-mode .value-item {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .value-item h3 {
    color: var(--primary-color);
}

body.dark-mode .value-item p {
    color: #b0b0b0;
}

body.dark-mode .contact-info {
    background-color: var(--card-bg);
}

/* 深色模式切换按钮 */
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
    color: var(--text-color);
}

.theme-toggle:hover {
    background-color: var(--hover-bg);
}