/* 谜语查询网 - 主样式表 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    background: #f5f6fa;
}

.wrap { min-height: 100vh; display: flex; flex-direction: column; }

.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 0 15px;
}
.site-header .container { text-align: center; }
.logo {
    font-size: 32px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    display: inline-block;
    letter-spacing: 2px;
}
.tagline { font-size: 14px; opacity: 0.85; margin: 5px 0 15px; }

.search-box {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    border-radius: 24px;
    overflow: hidden;
}
.search-box input {
    flex: 1;
    padding: 10px 20px;
    border: none;
    font-size: 15px;
    outline: none;
    border-radius: 24px 0 0 24px;
}
.search-box button {
    padding: 10px 24px;
    background: #ff6b6b;
    color: #fff;
    border: none;
    font-size: 15px;
    cursor: pointer;
    border-radius: 0 24px 24px 0;
    transition: background 0.2s;
}
.search-box button:hover { background: #ee5a5a; }

/* Nav */
.site-nav {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.site-nav .container { display: flex; }
.site-nav a {
    display: inline-block;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    font-size: 15px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.site-nav a:hover, .site-nav a.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Main */
.main-content { flex: 1; padding-top: 20px; padding-bottom: 40px; }

/* Breadcrumb */
.breadcrumb {
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
    padding: 8px 0;
}
.breadcrumb a { color: #667eea; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Page Title */
.page-title {
    font-size: 22px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* Cards / Lists */
.riddle-list { list-style: none; }
.riddle-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s;
}
.riddle-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.riddle-item .q {
    font-size: 16px;
    color: #333;
    margin-bottom: 6px;
}
.riddle-item .q a {
    color: #333;
    text-decoration: none;
}
.riddle-item .q a:hover { color: #667eea; }
.riddle-item .a {
    font-size: 14px;
    color: #764ba2;
    font-weight: 600;
}
.riddle-item .meta {
    font-size: 12px;
    color: #aaa;
    margin-top: 5px;
}
.riddle-item .meta a {
    color: #999;
    text-decoration: none;
}
.riddle-item .meta a:hover { color: #667eea; }

/* Detail Page */
.detail-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 20px;
}
.detail-card .riddle-question {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}
.detail-card .riddle-answer-box {
    background: linear-gradient(135deg, #667eea10, #764ba210);
    border: 1px dashed #764ba2;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
    text-align: center;
}
.detail-card .riddle-answer-box.revealed { cursor: default; }
.detail-card .riddle-answer-box .hint {
    font-size: 14px;
    color: #999;
}
.detail-card .riddle-answer-box .answer-text {
    font-size: 22px;
    font-weight: 700;
    color: #764ba2;
    display: none;
}
.detail-card .riddle-answer-box.revealed .hint { display: none; }
.detail-card .riddle-answer-box.revealed .answer-text { display: block; }

.detail-meta {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
}
.detail-meta span { margin-right: 15px; }
.detail-meta a { color: #667eea; text-decoration: none; }

/* Adjacent nav */
.adjacent-nav {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
}
.adjacent-nav a {
    flex: 1;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 18px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    transition: all 0.2s;
}
.adjacent-nav a:hover {
    border-color: #667eea;
    color: #667eea;
}
.adjacent-nav .nav-label { font-size: 11px; color: #aaa; display: block; margin-bottom: 3px; }
.adjacent-nav .next-link { text-align: right; }

/* Random section (detail page) */
.random-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}
.section-title {
    font-size: 18px;
    color: #555;
    margin-bottom: 14px;
    font-weight: 600;
}

/* Category Grid */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}
.cat-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px 16px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cat-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 10px rgba(102,126,234,0.12);
    transform: translateY(-1px);
}
.cat-card .cat-name { font-size: 15px; font-weight: 500; }
.cat-card .cat-count {
    font-size: 12px;
    color: #aaa;
    background: #f5f6fa;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Pinyin Index */
.pinyin-index {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    justify-content: center;
}
.pinyin-index a {
    display: inline-block;
    min-width: 36px;
    padding: 6px 10px;
    text-align: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}
.pinyin-index a:hover, .pinyin-index a.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* Pagination */
.pagination { text-align: center; margin: 25px 0 10px; }
.pagination ul { list-style: none; display: inline-flex; gap: 3px; }
.pagination li { display: inline; }
.pagination a, .pagination span {
    display: inline-block;
    padding: 7px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
}
.pagination a:hover { background: #667eea; color: #fff; border-color: #667eea; }
.pagination .active span {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    font-weight: 600;
}

/* No results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: #aaa;
    text-align: center;
    padding: 20px;
    font-size: 13px;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 640px) {
    .logo { font-size: 24px; }
    .detail-card .riddle-question { font-size: 20px; }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .adjacent-nav { flex-direction: column; }
}
