/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fcf5f0; /* 暖红基调背景 */
    color: #5a3e2b; /* 深棕色文字，增加温馨感 */
    line-height: 1.6;
    min-height: 100vh;
}
.home-link {
    text-decoration: none;
    color: #d44c2f; /* 喜庆红色 */
    font-size:14px;
    padding: 50px 3px 5px 10px
}

.home-link:hover {
    color: #b33c22; /* 深红 hover */
}  

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #fffcf5; /* 米白背景，温暖柔和 */
    border-radius: 8px;
    padding: 0 16px;
    padding-bottom:2rem;
}

/* 页眉 */
.header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-top: 2rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #d44c2f; /* 喜庆红色 */
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(255, 215, 0, 0.2); /* 金色微光 */
}

.subtitle {
    color: #b35f3a; /* 暖橙色 */
    font-size: 1rem;
}

/* ========== 搜索框优化 ========== */
.search-container {
    padding-bottom: 1rem;
    padding-top: 1rem;
}

.search-box {
    display: flex;
    gap: 0;
    max-width: 650px;
    margin: 0 auto;
    border: 1px solid #f5d0b5; /* 暖橙色边框 */
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(212, 76, 47, 0.15);
}

#search-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: none;
    font-size: 1rem;
    color: #5a3e2b;
    outline: none;
    background: #fffcf5;
}

#search-input:focus {
    outline: none;
    border-color: #d44c2f;
    box-shadow: inset 0 0 0 2px #fbe9e7;
}

#search-input::placeholder {
    color: #c49a8c;
}

#search-btn {
    padding: 0 1.5rem;
    border: none;
    border-radius: 0;
    background: #d44c2f; /* 主喜庆红 */
    color: white;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
    box-shadow: 0 2px 4px rgba(212, 76, 47, 0.3);
}

#search-btn:hover {
    background: #b33c22; /* 深红 */
}

#search-btn:active {
    background: #9e321d;
}

.results-count {
    text-align: center;
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color:#d44c2f;
}

/* ========== 时间轴样式 ========== */
.timeline-container {
    border-radius: 12px;
    padding: 10px 16px;
    margin-bottom: 2rem;
}

/* 年份显示 */
.year-display {
    text-align: center;
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.year-label {
    font-size: 14px;
    color: #b35f3a;
    font-weight: 500;
}

.current-year {
    font-size: 24px;
    font-weight: 700;
    color: #d44c2f; /* 红色年份 */
    font-family: 'Inter', monospace;
    position: relative;
    padding: 4px 16px;
    border-radius: 30px;
}

.year-era {
    font-size: 14px;
    color: #b35f3a;
    background: #ffeadd;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 朝代标记 */
.period-markers {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    padding-bottom: 20px;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
    width:100%;
}

.period-markers::-webkit-scrollbar {
    display: none;
}

.marker {
    padding: 6px 12px;
    background: #fffcf5;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #b35f3a;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(212, 76, 47, 0.1);
    transition: all 0.2s ease;
    border: 1px solid #ffd7c2;
}

.marker.active {
    background: #d44c2f; /* 红色激活 */
    color: #ffffff;
    transform: scale(1.05);
    border-color: #b33c22;
    box-shadow: 0 2px 8px rgba(212, 76, 47, 0.3);
}

.marker:hover, .marker:active {
    background: #ffeadd;
    color: #d44c2f;
    border-color: #d44c2f;
}

/* 滑块容器 */
.slider-container {
    position: relative;
    width: 100%;
    margin: 8px 0 0;
    display: flex;
    justify-content: center;
}

.year-btn:active {
    transform: scale(0.95);
    background: #b33c22;
}

.slider-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 85%;
    margin: 0 auto;
}

/* 年份控制按钮 */
.year-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #d44c2f;
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(212, 76, 47, 0.4);
    transition: all 0.2s ease;
    touch-action: manipulation;
    flex-shrink: 0;
    border: 1px solid #ffba9c;
}

.year-btn:hover {
    background: #b33c22;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(212, 76, 47, 0.5);
}

/* 滑块 */
.year-slider {
    flex: 1;
    position: relative;
    height: 44px;
    -webkit-appearance: none;
    background: transparent;
    z-index: 2;
    margin: 0;
    padding: 0;
}

/* 滑块拇指 */
.year-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 32px;
    height: 32px;
    background: #ffffff;
    border-radius: 50%;
    border: 4px solid #d44c2f; /* 红色边框 */
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(212, 76, 47, 0.5);
    transition: all 0.2s ease;
    margin-top: -12px;
}

.year-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
    background: #fff0e0;
    border-color: #b33c22;
}

/* 滑块轨道 */
.year-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: #ffd7c2; /* 暖橙色轨道 */
    border-radius: 4px;
    border: none;
}

/* Firefox 兼容 */
.year-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    background: #ffd7c2;
    border-radius: 4px;
    border: none;
}

.year-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    background: #ffffff;
    border-radius: 50%;
    border: 4px solid #d44c2f;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(212, 76, 47, 0.4);
}

/* 事件卡片 */
.events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.event-card {
    background: #fffcf5;
    border-radius: 8px;
    padding: 0.8rem;
    box-shadow: 0 2px 8px rgba(212, 76, 47, 0.1);
}

.china-card {
    border-left-color: #d44c2f;
}

.world-card {
    border-left-color: #f4a261; /* 暖橙色 */
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.3rem;
}

.region-icon {
    font-size: 1.5rem;
    margin-right: 0.8rem;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #b35f3a;
}

.event-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #5a3e2b;
}

/* 搜索结果区域 */
.search-results {
    background: #fffcf5;
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #E8E8E8;
    box-shadow: 0 2px 8px rgba(212, 76, 47, 0.1);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #ffd7c2;
}

.search-header h3 {
    font-size: 1.1rem;
    color: #d44c2f;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #c49a8c;
    padding: 0 0.5rem;
}

.close-btn:hover {
    color: #d44c2f;
}

.search-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.search-item {
    background: #fff9f2;
    border-radius: 4px;
    padding: 0.5rem;
}

.search-year {
    font-weight: 600;
    color: #d44c2f;
    font-size: 0.9rem;
    /*background: #ffeadd;*/
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    display: inline-block;
    margin-right: 0.5rem;
}

.search-china, .search-world {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    color: #5a3e2b;
}

.search-china span, .search-world span {
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

/*
.search-china span {
    background: #ffefeb;
    color: #d44c2f;
}

.search-world span {
    background: #fdeede;
    color:#8B3626;
}
 */

/* 时间轴事件列表 */
.timeline-events {
    background: #fffcf5;
    border-radius: 4px;
    padding: 0.5rem;
}

.section-header {
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #ffd7c2;
}

.section-header h3 {
    font-size: 1.1rem;
    color: #d44c2f;
    font-weight: 600;
}

.events-table {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.event-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 1rem;
    padding: 0.4rem;
    border-bottom: 1px solid #ffebe0;
}

.event-row-year {
    font-weight: 600;
    color: #5a3e2b;
    font-size: 0.9rem;
    border-radius: 3px;
    padding: 0.2rem;

    display: flex;
    align-items: center;
    text-align: center;
}

.event-row-china, .event-row-world {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #5a3e2b;
}

/* 页脚 */
.footer {
    margin-top: 0.5rem;
    padding: 1rem 0 0.5rem;
    text-align: center;
    color: #b35f3a;
    font-size: 0.9rem;
}

.footer p {
    margin: 0.5rem 0;
}

.footer-links a {
    color: #d44c2f;
    text-decoration: none;
    margin: 0 0.3rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #b33c22;
}

/* 加载更多按钮 */
.load-more-row {
  text-align: center;
  padding: 10px 0;
}
.load-more-btn {
  padding: 6px 12px;
  border:0;
  border-radius: 4px;
  background: #fffcf5;
  color: #5a3e2b;
  cursor: pointer;
  transition: all 0.2s;
}
.load-more-btn:hover {
  background: #d44c2f;
  color: #fff;
  border-color: #b33c22;
}
.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 热点关键词容器 */
.hot-key-container {
    margin-bottom: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 8px;
}

.hot-key-title {
    font-size: 1rem;
    font-weight: 600;
    color: #d44c2f;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-block;
}

/*
.hot-key-title::before,
.hot-key-title::after {
    content: "🎉";
    font-size: 0.9rem;
    margin: 0 5px;
    color: #f4a261;
}
*/

.hot-key {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-weight: 500;
    align-items: center;
    text-align:center;
}

.hot-key-item {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    color: #5a3e2b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hot-key-item:hover {
    background: #d44c2f;
    color: #fff;
    transform: translateY(-2px);
}

.hot-key-item:active {
    transform: translateY(0);
}
.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 0px;
    background: #fffcf5;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.pagination-btn:hover:not(:disabled) {
    background: #d44c2f;
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

.page-info {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}
/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .hot-key-container {
        padding: 0.5rem;
    }
    .event-row-year {
        color: #d44c2f;
	background: #ffeadd;
    }
    .hot-key-item {
        padding: 0.2rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .container {
        border-radius: 0;
        padding: 0 12px;
        padding-bottom:1.5rem;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .slider-controls {
        gap: 8px;
    }
    
    .year-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .event-row {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .current-year {
        font-size: 20px;
    }

    .timeline-container {
        display: block;
        padding: 16px 12px;
    }
    
    .year-display {
        display: flex;
    }
    
    .slider-track {
        display: block;
        margin: 16px 0;
    }
    
    .period-markers {
        display: flex;
        padding-bottom: 16px;
    }

    .search-box {
        width: 100%;
    }
    
    #search-input {
        width: auto;
        min-width: 80px;
    }
    
    #search-btn {
        padding: 0 1rem;
        white-space: nowrap;
    }

    .marker {
        font-size: 12px;
        padding: 4px 8px;
    }
    .footer {
        margin-top: 1rem;
        padding: 1.5rem 0 1rem;
        font-size: 0.8rem;
    }

    .footer-links a {
        margin: 0 0.2rem;
    }

    .slider-controls {
    width: 100%;
	}


}

@media (max-width: 480px) {
    .slider-controls {
        flex-direction: row;
        align-items: center;
    }

    .pagination-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .hot-key {
        gap: 0.4rem;
    }

    .hot-key-item {
        padding: 0.2rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .year-btn {
        width: 36px;
        height: 36px;
    }
    
    .slider-track {
        width: 100%;
        margin: 12px 0;
    }

    .period-markers {
        gap: 6px;
    }

    .marker {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    #search-btn {
        font-size: 0;
        padding: 0 0.8rem;
    }
    
    #search-btn::before {
        content: "🔍";
        font-size: 1.2rem;
    }
}

/* 工具类 */
.text-center {
    text-align: center;
}

.loading {
    color: #c49a8c;
    text-align: center;
    padding: 1rem;
}
