/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    /* 改为更朴素的深蓝灰色背景 */
    background: #2c3e50;
    min-height: 100vh;
}

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

/* 头部样式 */
header {
    background: #fff;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    /* 改为单一深色，不用渐变 */
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 2rem;
}

section {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    /* 改为橙色强调线 */
    border-bottom: 3px solid #e67e22;
    padding-bottom: 0.0rem;
}

/* 介绍区域 */
.intro-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: center;
}

.feature-list {
    margin: 0.5rem 0;
    list-style: none;
}

.feature-list li {
    padding: 0.5rem 0;
    /* 改为橙色强调 */
    border-left: 4px solid #e67e22;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
}

.tutorial-link {
    margin-top: 1.5rem;
}

.btn-primary {
    display: inline-block;
    /* 改为实色深蓝 */
    background: #2980b9;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.btn-primary:hover {
    background: #1a5276;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    display: inline-block;
    background: #fff;
    /* 改为深蓝色边框 */
    color: #2980b9;
    border: 2px solid #2980b9;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #2980b9;
    color: white;
}

/* 最新谜题区域 */
.update-info {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 1rem;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.level-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.level-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.level-code {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.difficulty {
    display: block;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.difficulty.easy { background: #d4edda; color: #155724; }
.difficulty.normal { background: #cce5ff; color: #004085; }
.difficulty.medium { background: #fff3cd; color: #856404; }
.difficulty.hard { background: #f8d7da; color: #721c24; }
.difficulty.expert { background: #f5c6cb; color: #721c24; }
.difficulty.evil { background: #f5c6cb; color: #721c24; }
.difficulty.unknown { background: #e2e3e5; color: #383d41; }

.note {
    background: #fef9e7;
    border: 1px solid #f9e79f;
    border-radius: 6px;
    padding: 1rem;
    color: #7d6608;
}

/* 按难度分类区域 */
.legend {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #666;
    text-align: center;
}

.difficulty-section {
    margin-bottom: 2rem;
}

.difficulty-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: inline-block;
}

.difficulty-title.easy { background: #d4edda; color: #155724; }
.difficulty-title.normal { background: #cce5ff; color: #004085; }
.difficulty-title.medium { background: #fff3cd; color: #856404; }
.difficulty-title.hard { background: #f8d7da; color: #721c24; }
.difficulty-title.expert { background: #f5c6cb; color: #721c24; }
.difficulty-title.evil { background: #f5c6cb; color: #721c24; }
.difficulty-title.unknown { background: #e2e3e5; color: #383d41; }

.level-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.level-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.level-item:hover {
    /* 改为深蓝色 */
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* 社区区域 */
.community-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.qrcode {
    text-align: center;
}

.qrcode-image {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* 图片响应式 */
.responsive-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* 底部样式 */
footer {
    background: #fff;
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-content p {
    margin-bottom: 0.5rem;
    color: #7f8c8d;
}

/* 手机端优化 */
@media (max-width: 768px) {
    /* 减小容器边距 */
    .container {
        padding: 0 12px;
    }
    
    main {
        padding: 0 12px 1rem;
    }
    
    /* 减小头部大小和间距 */
    header {
        padding: 1rem 0;
        margin-bottom: 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 0.3rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    /* 减小卡片和区块的内边距 */
    section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        padding-bottom: 0.3rem;
    }
    
    /* 减小谜题卡片大小 */
    .level-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .level-card {
        padding: 0.7rem 0.5rem;
    }
    
    .level-code {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }
    
    .difficulty {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
    
    /* 减小历史谜题列表项 */
    .level-list {
        gap: 0.5rem;
    }
    
    .level-item {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    /* 减小按钮大小 */
    .btn-primary, .btn-secondary {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    /* 减小说明文字 */
    .note, .legend {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    /* 减小间距 */
    .difficulty-section {
        margin-bottom: 1.2rem;
    }
    
    .difficulty-title {
        font-size: 1.1rem;
        margin-bottom: 0.7rem;
        padding: 0.3rem 0.7rem;
    }
    
    /* 介绍区域优化 */
    .intro-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-list li {
        padding: 0.3rem 0;
        padding-left: 0.8rem;
        margin-bottom: 0.3rem;
        font-size: 0.9rem;
    }
    
    .tutorial-link {
        margin-top: 1rem;
    }
    
    /* 社区区域优化 */
    .community-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* 更小屏幕进一步优化 */
@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }
    
    main {
        padding: 0 8px 0.8rem;
    }
    
    header {
        padding: 0.8rem 0;
        margin-bottom: 0.8rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    section {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    .level-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
    
    .level-card {
        padding: 0.5rem;
    }
    
    .level-code {
        font-size: 0.85rem;
    }
    
    .difficulty {
        font-size: 0.7rem;
        padding: 1px 4px;
    }
    
    .level-list {
        gap: 0.4rem;
        justify-content: center;
    }
    
    .level-item {
        padding: 4px 8px;
        font-size: 0.85rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .note, .legend {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .difficulty-section {
        margin-bottom: 0.8rem;
    }
    
    .difficulty-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        padding: 0.2rem 0.5rem;
    }
    
    .feature-list li {
        font-size: 0.85rem;
    }
}

/* 有分数记录的谜题样式 */
.has-score {
    border-color: #27ae60 !important;
}

.has-score:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2) !important;
}

/* 有进度的谜题样式 */
.has-progress {
    position: relative;
}

/* Grid图标样式 */
.result-grid {
    display: inline-grid;
    grid-template-columns: repeat(4, 4px);
    gap: 0;
    flex-shrink: 0;
    vertical-align: middle;
    margin-right: 0px;
}

.grid-square {
    width: 4px;
    height: 4px;
    border-radius: 0;
}

.grid-green {
    background: #4ade80;
}

.grid-yellow {
    background: #fbbf24;
}

.grid-red {
    background: #f87171;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.4s ease-out;
}

/* 分数徽章动画 */
@keyframes scorePop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    /* 改为深灰色 */
    background: #95a5a6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7f8c8d;
}