/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-hover: #252535;
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b0;
    --accent-gold: #d4af37;
    --accent-red: #c41e3a;
    --accent-green: #2e8b57;
    --accent-blue: #4169e1;
    --accent-purple: #8b5cf6;
    --border-color: #2a2a3a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.lock-icon {
    font-size: 2.2rem;
}

.subtitle {
    color: var(--accent-gold);
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* 区块标题 */
.section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    padding-left: 12px;
    border-left: 4px solid var(--accent-gold);
    color: var(--text-primary);
}

/* 主题选择区域 */
.theme-section {
    margin-bottom: 30px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.theme-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-red));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.theme-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-glow);
}

.theme-card:hover::before {
    transform: scaleX(1);
}

.theme-card.active {
    border-color: var(--accent-gold);
    background: var(--bg-hover);
    box-shadow: var(--shadow-glow);
}

.theme-card.active::before {
    transform: scaleX(1);
}

.theme-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.theme-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.theme-levels {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
}

/* 当前主题显示 */
.current-theme {
    margin-bottom: 24px;
}

.theme-badge {
    background: linear-gradient(135deg, var(--accent-gold), #b8941f);
    color: var(--bg-primary);
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.change-theme-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: inherit;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.change-theme-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 关卡选择区域 */
.level-section {
    margin-bottom: 30px;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.level-btn {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.level-btn:hover {
    border-color: var(--accent-blue);
    transform: scale(1.05);
}

.level-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.level-number {
    font-size: 1.4rem;
    font-weight: 700;
    display: block;
}

.level-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 4px;
}

/* 提示/答案显示区域 */
.hint-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.level-info h3 {
    font-size: 1.4rem;
    color: var(--accent-gold);
}

.back-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.puzzle-description {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-purple);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.puzzle-description strong {
    color: var(--text-primary);
}

.hint-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.hint-btn {
    padding: 16px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.hint-type {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.hint-type:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.answer-type {
    background: linear-gradient(135deg, var(--accent-red), #9f1239);
    color: white;
}

.answer-type:hover {
    background: linear-gradient(135deg, #dc2626, var(--accent-red));
}

.btn-icon {
    font-size: 1.2rem;
}

.hint-display, .answer-display {
    padding: 20px;
    border-radius: 10px;
    margin-top: 16px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hint-display {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.answer-display {
    background: rgba(196, 30, 58, 0.1);
    border: 1px solid rgba(196, 30, 58, 0.3);
}

.hint-label, .answer-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.hint-label {
    color: #f59e0b;
}

.answer-label {
    color: var(--accent-red);
}

.hint-content, .answer-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.answer-content {
    font-weight: 600;
}

/* 使用说明 */
.instructions {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.instruction-content ol {
    padding-left: 24px;
    margin-bottom: 20px;
}

.instruction-content li {
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.instruction-content li strong {
    color: var(--text-primary);
}

.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.warning-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.warning span:last-child {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 24px 16px;
    }

    .title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 8px;
    }

    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .theme-card {
        padding: 16px 12px;
    }

    .theme-icon {
        font-size: 2rem;
    }

    .theme-name {
        font-size: 1rem;
    }

    .level-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .hint-actions {
        grid-template-columns: 1fr;
    }

    .theme-badge {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .level-info {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* 选中状态 */
.selected {
    position: relative;
}

.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-green);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}
