/* Marathon Hub - 马拉松赛事服务与跑者社区 */
/* 动感极速风：赛道红 #E53935 + 柏油灰 #212121 + 亮白 #FFFFFF */

:root {
    --primary: #E53935;
    --primary-dark: #C62828;
    --dark: #212121;
    --dark-light: #424242;
    --gray: #757575;
    --gray-light: #BDBDBD;
    --white: #FFFFFF;
    --bg-light: #F5F5F5;
    --shadow: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--dark);
    background: var(--white);
    line-height: 1.7;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

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

/* Header & Navigation */
.site-header {
    background: var(--dark);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    height: 64px;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-logo span {
    color: var(--primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--white);
    margin: 5px 0;
    transition: var(--transition);
    border-radius: 2px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 4px;
}

.main-nav a {
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--primary);
    color: var(--white);
}

/* Hero Section */
.hero {
    position: relative;
    height: 520px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 20px;
}

.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 24px;
    opacity: 0.95;
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background: var(--white);
    color: var(--primary);
}

/* Section Styles */
.section {
    padding: 60px 0;
}

.section-alt {
    background: var(--bg-light);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
}

.section-title p {
    color: var(--gray);
    font-size: 1.05rem;
}

.section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

.card-body {
    padding: 20px;
}

.card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--dark);
}

.card-body p {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.6;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    color: var(--gray);
}

.card-tag {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Event Table */
.event-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.event-table thead {
    background: var(--dark);
    color: var(--white);
}

.event-table th,
.event-table td {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.95rem;
}

.event-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.event-table tbody tr:hover {
    background: #FFF3F3;
}

.event-table .status-open {
    color: #2E7D32;
    font-weight: 600;
}

.event-table .status-closed {
    color: var(--gray);
}

/* Video Section */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Training Plan */
.training-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.training-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.training-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.training-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--dark);
}

.training-card .duration {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.training-card p {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Community */
.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.community-post {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.community-post:hover {
    box-shadow: var(--shadow-lg);
}

.community-post .author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.community-post .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 1rem;
}

.community-post .author-name {
    font-weight: 600;
    color: var(--dark);
}

.community-post .post-time {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Countdown */
.countdown-bar {
    background: var(--primary);
    color: var(--white);
    padding: 12px 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
}

.countdown-bar .countdown-num {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 4px;
}

/* Footer */
.site-footer {
    background: var(--dark);
    color: var(--gray-light);
    padding: 48px 0 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-col p,
.footer-col li {
    font-size: 0.9rem;
    line-height: 2;
    color: var(--gray-light);
}

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

.footer-col a {
    color: var(--gray-light);
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--dark-light);
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229,57,53,0.1);
}

/* Results Table */
.results-search {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.results-search input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 1rem;
}

/* Lazy Load */
.lazy {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy.loaded {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--dark);
        padding: 16px;
        display: none;
        box-shadow: var(--shadow-lg);
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 4px;
    }

    .main-nav a {
        display: block;
        padding: 12px 16px;
    }

    .hero {
        height: 380px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

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

    .section {
        padding: 40px 0;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

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

    .event-table {
        font-size: 0.85rem;
    }

    .event-table th,
    .event-table td {
        padding: 10px 12px;
    }

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

    .results-search {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0 12px;
    }

    .site-logo {
        font-size: 1.2rem;
    }

    .container {
        padding: 0 12px;
    }

    .hero {
        height: 300px;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }
}
