/* 谜语页面样式 */
:root {
    --primary-color: #6a5acd;
    --secondary-color: #e6e6fa;
    --accent-color: #483d8b;
    --light-bg: #f8f9fa;
    --dark-bg: #2c3e50;
    --text-color: #333;
    --light-text: #f8f9fa;
    --border-color: #d1d9e6;
    --shadow-color: rgba(106, 90, 205, 0.2);
    --success-color: #28a745;
    --info-color: #17a2b8;
}

/* 整体页面样式 */
body {
    background-color: var(--light-bg);
    color: var(--text-color);
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    line-height: 1.6;
}

/* 头部样式增强 */
.search-container {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    padding: 30px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.search-box {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.search-box h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.search-form {
    display: flex;
    margin-bottom: 10px;
}

.search-form input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(106, 90, 205, 0.2);
}

.search-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-form button:hover {
    background-color: var(--accent-color);
}

.search-tips {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.search-tips a {
    display: inline-block;
    margin: 0 8px;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.search-tips a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* 主内容区域样式 */
.main-content {
    padding: 20px 0 40px;
}

.content-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.main-column {
    flex: 1;
    min-width: 300px;
}

.sidebar {
    width: 300px;
}

/* 分类部分样式 */
.category-section {
    margin-bottom: 40px;
}

.category-section h3 {
    color: var(--primary-color);
    font-size: 22px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.category-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 3px 10px var(--shadow-color);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.category-item h4 {
    color: var(--primary-color);
    margin: 0 0 8px 0;
    font-size: 18px;
}

.category-item p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* 热门谜语样式 */
.popular-section {
    margin-bottom: 40px;
}

.popular-section h3 {
    color: var(--primary-color);
    font-size: 22px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.popular-items {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.popular-items a {
    background-color: white;
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.popular-items a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 难度分类样式 */
.difficulty-section {
    margin-bottom: 40px;
}

.difficulty-section h3 {
    color: var(--primary-color);
    font-size: 22px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.difficulty-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.difficulty-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 3px 10px var(--shadow-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.difficulty-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.difficulty-item:nth-child(1)::before {
    background-color: #28a745; /* 简单 - 绿色 */
}

.difficulty-item:nth-child(2)::before {
    background-color: #ffc107; /* 中等 - 黄色 */
}

.difficulty-item:nth-child(3)::before {
    background-color: #fd7e14; /* 困难 - 橙色 */
}

.difficulty-item:nth-child(4)::before {
    background-color: #dc3545; /* 专家 - 红色 */
}

.difficulty-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.difficulty-item h4 {
    color: var(--primary-color);
    margin: 0 0 8px 0;
    font-size: 18px;
}

.difficulty-item p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* 介绍部分样式 */
.intro-section {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 0 3px 10px var(--shadow-color);
    border-top: 4px solid var(--primary-color);
}

.intro-section h2 {
    color: var(--primary-color);
    margin-top: 0;
    font-size: 24px;
    margin-bottom: 15px;
}

.intro-section p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.intro-section p:last-child {
    margin-bottom: 0;
}

/* 侧边栏样式 */
.featured-content {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px var(--shadow-color);
}

.featured-content h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.featured-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.featured-item {
    text-decoration: none;
    color: var(--text-color);
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background-color: var(--light-bg);
}

.featured-item:hover {
    background-color: var(--secondary-color);
    transform: translateX(5px);
}

.featured-item h4 {
    color: var(--primary-color);
    margin: 0 0 5px 0;
    font-size: 16px;
}

.featured-item p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.learning-tools {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 3px 10px var(--shadow-color);
    margin-bottom: 30px;
}

.learning-tools h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.learning-tools ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.learning-tools li {
    margin-bottom: 10px;
}

.learning-tools li:last-child {
    margin-bottom: 0;
}

.learning-tools a {
    display: block;
    text-decoration: none;
    color: var(--text-color);
    padding: 8px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.learning-tools a:hover {
    background-color: var(--light-bg);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

/* 每日一谜 */
.riddle-game {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 3px 10px var(--shadow-color);
}

.riddle-game h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.daily-riddle {
    background-color: var(--secondary-color);
    padding: 15px;
    border-radius: 6px;
    position: relative;
}

.daily-riddle::before {
    content: """;
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 60px;
    opacity: 0.2;
    font-family: serif;
    color: var(--primary-color);
}

.riddle-text {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.6;
}

.show-answer-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.show-answer-btn:hover {
    background-color: var(--accent-color);
}

.hidden-answer {
    display: none;
    margin-top: 15px;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    color: var(--primary-color);
}

/* 谜语详情页样式 */
.riddle-detail {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px var(--shadow-color);
}

.riddle-detail h2 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.riddle-content {
    margin-bottom: 20px;
}

.riddle-question {
    font-size: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--secondary-color);
    border-radius: 6px;
    position: relative;
}

.riddle-question::before {
    content: "谜面";
    position: absolute;
    top: -10px;
    left: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.riddle-answer {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    position: relative;
}

.riddle-answer::before {
    content: "谜底";
    position: absolute;
    top: -10px;
    left: 10px;
    background-color: var(--success-color);
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.answer-text {
    font-weight: bold;
    font-size: 18px;
    color: var(--primary-color);
    display: block;
    margin-bottom: 10px;
}

.answer-analysis {
    color: #666;
    line-height: 1.6;
}

.riddle-meta {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.riddle-meta span {
    background-color: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--accent-color);
}

.riddle-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.action-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    background-color: var(--accent-color);
}

.action-btn i {
    font-size: 16px;
}

.related-riddles {
    margin-top: 40px;
}

.related-riddles h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.related-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 3px 10px var(--shadow-color);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.related-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.related-item h4 {
    color: var(--primary-color);
    margin: 0 0 8px 0;
    font-size: 16px;
}

.related-item p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .difficulty-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .related-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated {
    animation: fadeIn 0.8s ease-out forwards;
}

/* 装饰元素 */
.decorative-element {
    position: relative;
}

.decorative-element::before {
    content: "?";
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    opacity: 0.2;
}
