/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, "Noto Sans CJK SC", sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 容器 */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

/* 头部 */
.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 3rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    text-align: center;
}

.site-title {
    font-size: 3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    font-weight: 400;
}

/* 主内容 */
.app-main {
    flex: 1;
    padding: 2rem 0;
}

/* 控制区域 */
.controls-section {
    margin-bottom: 2rem;
}

.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-select {
    padding: 0.6rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, "Noto Sans CJK SC", sans-serif;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.6rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, "Noto Sans CJK SC", sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-btn:hover {
    border-color: #667eea;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.sort-icon {
    font-size: 0.7rem;
}

.primary-btn {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Noto Sans SC', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 文章列表 */
.articles-section {
    margin-bottom: 3rem;
}

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

.article-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid #667eea;
}

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

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.article-category {
    background: #667eea;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.article-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-family: 'Noto Serif SC', serif;
}

.article-excerpt {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-read-more {
    color: #667eea;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.article-read-more:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.modal-content.large {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    font-size: 1.8rem;
    color: #7f8c8d;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: #2c3e50;
}

/* 表单样式 */
.article-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Noto Sans SC', sans-serif;
    transition: all 0.3s ease;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    min-height: 200px;
    line-height: 1.7;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.cancel-btn,
.submit-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Noto Sans SC', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #e0e0e0;
    color: #555;
}

.cancel-btn:hover {
    background: #bdbdbd;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 文章详情 */
.article-detail {
    padding: 2rem;
    font-family: 'Noto Serif SC', serif;
}

.article-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.article-detail-category {
    background: #667eea;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.article-detail-content {
    font-size: 1.05rem;
    line-height: 2;
    color: #333;
    white-space: pre-wrap;
}

.article-detail-content p {
    margin-bottom: 1.5rem;
}

.article-detail-content h1,
.article-detail-content h2,
.article-detail-content h3 {
    margin: 2rem 0 1rem;
    color: #2c3e50;
}

/* 页脚 */
.app-footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 赛事记录相关样式 */
.events-section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
}

.events-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border-left: 4px solid #f39c12;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.event-card:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.event-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: #7f8c8d;
    flex: 0 0 auto;
}

.event-date {
    font-weight: 500;
    color: #34495e;
}

.event-category {
    background: #f39c12;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.event-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
    font-family: 'Noto Serif SC', serif;
    flex: 1;
    min-width: 200px;
    margin: 0;
}

.event-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #555;
    flex: 1;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
}

.event-distance,
.event-location,
.event-time {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.event-notes {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.5;
    flex: 1 1 100%;
    margin: 0.5rem 0 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}

/* 赛事详情样式 */
.event-detail {
    padding: 2rem;
    font-family: 'Noto Serif SC', serif;
}

.event-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.event-detail-category {
    background: #f39c12;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.event-detail-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 15px;
    font-size: 1.05rem;
}

.event-detail-distance,
.event-detail-location,
.event-detail-time {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #2c3e50;
}

.event-detail-notes {
    font-size: 1.05rem;
    line-height: 2;
    color: #333;
    white-space: pre-wrap;
}

/* 赛事操作按钮 */
.event-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.edit-btn,
.delete-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Noto Sans SC', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .site-title {
        font-size: 2.2rem;
    }
    
    .site-subtitle {
        font-size: 1rem;
    }
    
    .controls-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-select,
    .sort-btn {
        flex: 1;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .events-grid {
        gap: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .article-detail,
    .event-detail {
        padding: 1.5rem;
    }
    
    .article-detail-meta,
    .event-detail-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.8rem;
    }
    
    .app-main {
        padding: 1rem 0;
    }
    
    .controls-bar {
        padding: 0.8rem;
    }
    
    .filter-group {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .filter-select,
    .sort-btn {
        width: 100%;
    }
    
    .article-card {
        padding: 1.2rem;
    }
    
    .article-title {
        font-size: 1.1rem;
    }
}
