/* --- 全局变量与基础设置 --- */
:root {
    --main-color: #2d3436;
    --accent-color: #6c5ce7;
    --text-light: #636e72;
    --bg-color: #f9f9fb;
    --rainbow: linear-gradient(90deg, #ff5f6d, #ffc371, #ffee58, #66bb6a, #26c6da, #5c6bc0, #ab47bc);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--main-color);
    line-height: 1.6;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}

.top-btns{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 6px;
    box-sizing: border-box;
}   
.top-btns>a{
    text-decoration: none;
    color: #444;
}
.top-btns>.suspar-btn{
    font-weight: bold;
}

.lang-toggle{
    text-decoration:  none;
    color: #666;
    padding: 6px;
    border-bottom: 1px solid goldenrod;
}

/* --- 头部布局 --- */
header {
    background: white;
    padding: 80px 20px 60px;
    text-align: center;
    border-bottom: 5px solid;
    border-image: var(--rainbow) 1;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}
header h1>a{
    text-decoration: none;
    color: inherit;
    border-bottom: 2px solid saddlebrown;
}
header h1>a:hover{
    border-bottom: 2px solid rosybrown;
}

header p {
    color: var(--text-light);
    margin-top: 10px;
}





/* --- 容器与卡片网格 --- */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    /* 桌面端自动填充，最小宽度 280px */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.card-img {
    height: 200px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat; 
    width: 100%;
    background-color: #eee;
}

.card-body {
    padding: 24px;
    flex-grow: 1;
}

.card-body h3 {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    color: var(--main-color);
}

.card-body p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- 详情页内容 --- */
.detail-page {
    max-width: 850px;
    margin: 60px auto;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.back-link {
    display: inline-block;
    margin-bottom: 25px;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
}

.back-link:hover {
    color: var(--accent-color);
}

.hero-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 30px;
}

blockquote {
    border-left: 5px solid var(--accent-color);
    padding: 10px 20px;
    font-style: italic;
    font-size: 1.2rem;
    margin: 30px 0;
    background: #f8f7ff;
    color: #444;
}

.content {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* --- 分页控制 --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 50px 0;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    text-decoration: none;
    color: var(--main-color);
    font-weight: 500;
    transition: 0.2s;
}

.page-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.page-btn:hover:not(.active) {
    background: #f0f0f0;
}

/* --- 移动端适配 (小于 768px) --- */
@media (max-width: 768px) {
    header {
        padding: 60px 15px 40px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .container {
        grid-template-columns: 1fr; /* 手机端单列显示 */
        padding: 0 20px;
        gap: 20px;
    }

    .detail-page {
        margin: 20px 15px;
        padding: 25px 20px;
    }

    .hero-img {
        max-height: 300px;
    }
}




/* random btn */
.random-btn, .random-btn-zh,.random-btn-out, .random-btn-out-zh {
    position: fixed;
    bottom: 6em;
    left: 50%;              /* 水平参考点在屏幕中间 */
    transform: translateX(-50%); /* 水平居中 */
    padding: 8px 16px;
    border-radius: 30px;
    background: var(--rainbow);
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    color: #333;
    border: 1px solid #eee;
    transition: all 0.3s ease;
    z-index: 1000;
}
.random-btn:hover, .random-btn-zh:hover,
.random-btn-out:hover, .random-btn-out-zh:hover {
    background: var(--rainbow);
    color: white;
    border-color: transparent;
} 

