/* 红河州信息学联赛 - 通用样式 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: #1a5276;
}

a:hover {
    color: #154360;
}

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

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #1a5276 0%, #2980b9 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header .subtitle {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 导航栏 */
.navbar {
    background: #154360;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    margin-bottom: 20px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar-brand {
    padding: 0;
}

.navbar-brand a {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: white;
    padding: 15px 20px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar-brand a:hover {
    color: #3498db;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1px;
    background: rgba(0,0,0,0.1);
    border-radius: 6px;
    padding: 2px;
}

.nav-link {
    color: white;
    font-weight: 500;
    padding: 12px 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
}

.nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: #3498db;
}

.nav-link.active {
    background: rgba(255,255,255,0.2);
    color: #3498db;
    font-weight: 600;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropbtn {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropbtn::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropbtn::after {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 1001;
    margin-top: 2px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.year-section {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.year-section:last-child {
    border-bottom: none;
}

.year-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #154360;
    margin: 0 20px 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.dropdown-content a {
    display: block;
    color: #333;
    padding: 8px 20px;
    text-decoration: none;
    transition: background 0.3s ease;
    font-size: 14px;
}

.dropdown-content a:hover {
    background: #f8f9fa;
    color: #154360;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card h2 {
    color: #1a5276;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.card h3 {
    color: #2980b9;
    margin: 20px 0 10px 0;
}

/* 标题卡片样式 */
.card:first-child {
    text-align: center;
    padding: 30px;
}

.card:first-child h2 {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 10px;
    border-bottom: none;
}

.card:first-child h3 {
    font-size: 1.4em;
    color: #3498db;
    margin-bottom: 0;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #1a5276;
    color: white;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn:hover {
    background: #154360;
}

.btn-secondary {
    background: #7f8c8d;
}

.btn-secondary:hover {
    background: #616a6b;
}

/* 统计卡片 */
.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 150px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.stats-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.stats-grid {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.stat-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    flex: 1;
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    border: 1px solid #dee2e6;
}

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

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #1a5276;
    margin: 15px 0;
}

.stat-label {
    color: #666;
    font-size: 1em;
    font-weight: 500;
}

/* 分析页面样式 */
.section {
    margin-bottom: 30px;
}

.section h2 {
    color: #3498db;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

.section h3 {
    color: #9b59b6;
    margin: 20px 0 10px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.group-stats {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.group-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #1a5276;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 280px;
}

.group-card h3 {
    color: #1a5276;
    margin-bottom: 15px;
}

.group-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.error-analysis {
    background: #f8f9fa;
    border-left: 5px solid #3498db;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    color: #333333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.error-analysis h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

.error-analysis p {
    color: #555555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.error-analysis ul {
    color: #555555;
    padding-left: 25px;
    margin: 15px 0;
}

.error-analysis li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.error-example {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.error-example h4 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 600;
}

.error-example p {
    color: #555555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.error-example ul {
    color: #555555;
    padding-left: 20px;
    margin: 15px 0;
}

.error-example li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* 代码块 */
.code-block {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 18px;
    margin: 15px 0;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-family: 'Courier New', Courier, monospace;
}

.code-block pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
    line-height: 1.5;
}

.code-block code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
    line-height: 1.5;
    color: #333333;
}

/* C++语法高亮 */
.code-block code.cpp .keyword {
    color: #0000ff;
}

.code-block code.cpp .string {
    color: #a31515;
}

.code-block code.cpp .comment {
    color: #008000;
}

.code-block code.cpp .preprocessor {
    color: #800080;
}

.code-block code.cpp .function {
    color: #795e26;
}

.code-block code.cpp .number {
    color: #098658;
}

.recommendations {
    background: #f8f9fa;
    border-left: 5px solid #3498db;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    color: #333333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recommendations h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

.recommendations ol {
    color: #555555;
    padding-left: 20px;
}

.recommendations li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.conclusion {
    background: #f8f9fa;
    border-left: 5px solid #27ae60;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    color: #333333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.conclusion h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
}

.conclusion p {
    color: #555555;
    margin-bottom: 10px;
    line-height: 1.5;
}

.conclusion ul {
    color: #555555;
    padding-left: 20px;
}

.conclusion li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.score-distribution {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.score-level {
    background: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.score-level h4 {
    color: #495057;
    margin-bottom: 5px;
}

.score-level .count {
    font-size: 1.5em;
    font-weight: bold;
    color: #1a5276;
}

.highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
    font-weight: 600;
}

tr:hover {
    background-color: #f5f5f5;
}

/* 代码样式 */
.code-block {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto;
}

pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

/* C++语法高亮 */
code.cpp {
    color: #333;
}

code.cpp .keyword {
    color: #0000ff;
}

code.cpp .string {
    color: #a31515;
}

code.cpp .comment {
    color: #008000;
}

code.cpp .preprocessor {
    color: #800080;
}

code.cpp .function {
    color: #795e26;
}

code.cpp .number {
    color: #098658;
}

/* 标签页 */
.group-tabs {
    display: flex;
    margin: 20px 0;
    border-bottom: 2px solid #1a5276;
}

.group-tab {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    cursor: pointer;
    margin-right: 5px;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s;
}

.group-tab:hover {
    background: #e8f4fd;
}

.group-tab.active {
    background: #1a5276;
    color: white;
}

.group-content {
    display: none;
}

.group-content.active {
    display: block;
}

/* 筛选器 */
.filter-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-select, .search-box {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 150px;
}

.search-box {
    width: 250px;
}

/* 高亮框 */
.highlight-box {
    background: #e8f4fd;
    padding: 15px;
    border-left: 4px solid #1a5276;
    margin: 20px 0;
}

/* 隐藏 */
.hidden {
    display: none !important;
}

/* 页脚 */
.footer {
    background: #154360;
    color: white;
    padding: 40px 0 0;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
}

.footer-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #ffffff;
    position: relative;
    padding-bottom: 8px;
}

.footer-tagline {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
    font-style: italic;
}

.link-columns {
    display: flex;
    gap: 30px;
}

.link-columns .link-list {
    flex: 1;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: #3498db;
}

.footer-section p {
    opacity: 0.8;
    font-size: 14px;
    line-height: 1.6;
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    opacity: 0.8;
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.link-list li {
    margin-bottom: 10px;
}

.link-list a {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    transition: color 0.3s ease;
}

.link-list a:hover {
    color: #3498db;
    text-decoration: underline;
}

/* 页脚底部 */
.footer-bottom {
    background: #0f3443;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-bottom .footer-info {
    text-align: center;
}

.footer-bottom p {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    text-align: center;
    margin: 0;
    line-height: 1.5;
}

.footer-bottom .site-stats {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    margin-top: 8px;
}

.footer-bottom a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* 响应式 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .navbar .container {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }
    
    .navbar-brand {
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .navbar-menu {
        flex-direction: column;
        gap: 0;
        background: none;
        border-radius: 0;
        padding: 0;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        border-radius: 0;
    }
    
    .dropdown-content {
        position: static;
        box-shadow: none;
        border: 1px solid rgba(0,0,0,0.1);
        border-radius: 0;
        margin-top: 0;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        width: 100%;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom p {
        font-size: 10px;
        line-height: 1.4;
    }
}

/* 列表页面样式 */
/* 展开/收起按钮 */
.toggle-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    font-size: 0.9em;
    padding: 0;
    margin-top: 5px;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.toggle-btn:hover {
    color: #2980b9;
}

/* 加载更多按钮 */
.load-more-btn {
    display: block;
    margin: 30px auto;
    padding: 12px 24px;
    background: #1a5276;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.load-more-btn:hover {
    background: #154360;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.load-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 列表项美化 */
.news-item, .video-item, .score-item, .analysis-item {
    position: relative;
    overflow: hidden;
    border-left: 4px solid #1a5276;
}
