/* 全局样式 */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #4cc9f0;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    
    /* 游戏相关颜色 */
    --auth-token-color: #4361ee;
    --access-token-color: #2ecc71;
    --value-token-color: #f1c40f;
    --wall-color: #34495e;
    --player-color: #e74c3c;
    --door-color: #8e44ad;
    --floor-color: #ecf0f1;
    --locked-area-color: rgba(52, 73, 94, 0.2);
    
    /* AI Token相关颜色 */
    --ai-token-bg: #e3f2fd;
    --ai-token-border: #bbdefb;
    --ai-token-text: #1565c0;
    --token-id-bg: #fff3cd;
    --token-id-border: #ffeeba;
    --token-id-text: #856404;
    --process-step-bg: #f8f9fa;
    --process-step-border: #dee2e6;
    --step-icon-bg: #4361ee;
    --model-icon-bg: #3a0ca3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
    padding-bottom: 2rem;
}

/* 页面加载动画和过渡效果 */
body {
    opacity: 1; /* 改为默认可见 */
    transition: opacity 0.3s ease;
}

body.loaded .loading-overlay {
    opacity: 0;
    visibility: hidden;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(67, 97, 238, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 元素渐入动画 */
section, .content-box, .application, .real-world-example, .trend {
    opacity: 0.3; /* 降低初始透明度但不完全隐藏 */
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

section.visible, .content-box.visible, .application.visible, 
.real-world-example.visible, .trend.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>') repeat;
    opacity: 0.3;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
}

/* 导航样式 */
nav {
    background-color: white;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    flex-wrap: wrap;
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

nav a:hover {
    color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.05);
}

/* 主内容区域 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

section {
    margin-bottom: 4rem;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    position: relative;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.content-box {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* 类比部分样式 */
.analogy {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.analogy-item {
    flex: 1;
    min-width: 200px;
    text-align: center;
    padding: 1rem;
    margin: 0.5rem;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.analogy-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

/* 特性列表样式 */
.feature-list {
    list-style-type: none;
}

.feature-list li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.feature-list li::before {
    content: "✓";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 应用场景样式 */
.application {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
}

.app-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 1rem;
}

.app-text {
    flex: 1;
    min-width: 300px;
}

.app-visual {
    flex: 1;
    min-width: 300px;
    min-height: 200px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    margin-left: 1rem;
}

/* AI Token处理流程样式 */
.ai-token-process {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.process-step {
    display: flex;
    background-color: var(--process-step-bg);
    border: 1px solid var(--process-step-border);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    background-color: var(--step-icon-bg);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

.step-content {
    flex: 1;
    padding: 1.5rem;
}

.step-content h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.example {
    margin-top: 1rem;
    padding: 1rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.text-original {
    font-size: 1.2rem;
    padding: 1rem;
    background-color: white;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    text-align: center;
}

.arrow-down {
    margin: 0.5rem 0;
    color: var(--primary-color);
    font-weight: bold;
    text-align: center;
}

.tokens {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.token-item {
    background-color: var(--ai-token-bg);
    border: 1px solid var(--ai-token-border);
    color: var(--ai-token-text);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    display: inline-block;
    animation: tokenPulse 2s infinite alternate;
}

.token-ids {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.id-item {
    background-color: var(--token-id-bg);
    border: 1px solid var(--token-id-border);
    color: var(--token-id-text);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    display: inline-block;
    font-family: monospace;
}

.model-processing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.model-icon {
    width: 60px;
    height: 60px;
    background-color: var(--model-icon-bg);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
}

.processing-animation {
    flex: 1;
    height: 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.processing-animation::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    animation: processing 1.5s infinite;
}

@keyframes processing {
    0% { transform: translateX(0); }
    100% { transform: translateX(200%); }
}

@keyframes tokenPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

/* Token计算器样式 */
.token-calculator {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
}

.token-calculator h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

#token-input {
    width: 100%;
    height: 100px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-family: inherit;
    resize: vertical;
}

.calculator-result {
    background-color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    font-weight: bold;
}

#token-count {
    color: var(--primary-color);
}

/* Token比较样式 */
.token-comparison {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 1.5rem 0;
}

.language-token {
    flex: 1;
    min-width: 300px;
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.language-token h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.token-example {
    background-color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.example-text {
    margin-bottom: 0.5rem;
}

.token-count {
    font-weight: bold;
    color: var(--primary-color);
}

.token-explanation {
    font-style: italic;
}

.token-tips {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.token-tips h4 {
    color: #856404;
    margin-bottom: 1rem;
}

.token-tips ul {
    padding-left: 1.5rem;
}

.token-tips li {
    margin-bottom: 0.5rem;
}

.token-context-comparison {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.context-model {
    flex: 1;
    min-width: 250px;
    text-align: center;
    padding: 1rem;
}

.model-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.context-window {
    height: 150px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.small .context-window {
    height: 80px;
}

.large .context-window {
    height: 200px;
}

.token-blocks {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(to top, var(--primary-color), var(--accent-color));
    animation: fillTokens 3s ease-in-out infinite alternate;
}

.small .token-blocks {
    animation-name: fillTokensSmall;
}

.large .token-blocks {
    animation-name: fillTokensLarge;
}

@keyframes fillTokensSmall {
    0% { height: 10%; }
    100% { height: 50%; }
}

@keyframes fillTokensLarge {
    0% { height: 30%; }
    100% { height: 90%; }
}

.model-capability {
    font-style: italic;
}

/* AI记忆挑战游戏样式 */
/* 游戏容器优化 */
.game-container {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin: 2rem 0;
}

.game-info {
    padding: 1.5rem;
    background-color: var(--light-bg);
    border-bottom: 1px solid #e0e0e0;
}

.game-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 1rem;
    background-color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    background-color: var(--ai-token-bg);
    border-radius: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--ai-token-text);
    font-weight: 500;
}

#difficulty-level, #token-limit, #game-score {
    font-weight: bold;
    color: var(--secondary-color);
}

.game-message {
    margin: 1rem 0;
    padding: 1rem;
    background-color: white;
    border-radius: var(--border-radius);
    text-align: center;
    border-left: 4px solid var(--primary-color);
    font-weight: 500;
}

#start-game {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#start-game:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.game-board {
    padding: 1.5rem;
    background-color: white;
}

.memory-test {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.memory-prompt, .memory-question {
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.memory-prompt {
    background-color: #f8f9ff;
    border-left: 4px solid #4361ee;
}

.memory-question {
    background-color: #fff8f8;
    border-left: 4px solid #e74c3c;
}

.memory-prompt h4, .memory-question h4 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.memory-content, .question-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    max-height: 200px;
    overflow-y: auto;
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.answer-option {
    padding: 1rem 1.2rem;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--text-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-option:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.answer-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.1);
    font-weight: bold;
}

.answer-option.correct {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.answer-option.incorrect {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.game-explanation {
    margin-top: 2rem;
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.game-explanation h4 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.game-explanation ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.game-explanation li {
    margin-bottom: 0.8rem;
}

.game-explanation p {
    line-height: 1.6;
    color: #555;
    font-style: italic;
    border-left: 3px solid var(--accent-color);
    padding-left: 1rem;
    margin-top: 1rem;
}

/* Token分词可视化样式 */
.code-example {
    display: flex;
    flex-wrap: wrap;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.tokenizer-input {
    flex: 1;
    min-width: 300px;
    padding: 1.5rem;
    background-color: var(--light-bg);
}

.tokenizer-input h4 {
    margin-bottom: 1rem;
}

#tokenize-input {
    width: 100%;
    height: 100px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    font-family: inherit;
    resize: vertical;
}

.tokenizer-result {
    flex: 1;
    min-width: 300px;
    padding: 1.5rem;
}

.tokenizer-result h4 {
    margin-bottom: 1rem;
}

.token-result-container {
    background-color: var(--light-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    min-height: 100px;
    margin-bottom: 1rem;
}

.token-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.token-stat-item {
    flex: 1;
    min-width: 100px;
    padding: 0.5rem;
    background-color: white;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.token-result-container .token-item {
    margin: 0.25rem;
    animation: none;
}

/* 上下文窗口模拟样式 */
.interactive-demo {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
}

.context-controls {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.control-group label {
    min-width: 150px;
}

.control-group input[type="range"] {
    flex: 1;
}

.context-visualization {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.context-window-visual {
    background-color: var(--light-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.window-label, .message-label {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.context-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-height: 50px;
    padding: 0.5rem;
    background-color: white;
    border-radius: var(--border-radius);
}

.context-token {
    background-color: var(--ai-token-bg);
    border: 1px solid var(--ai-token-border);
    color: var(--ai-token-text);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.context-token.overflow {
    opacity: 0.5;
    text-decoration: line-through;
}

.context-message {
    background-color: var(--light-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.message-history {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message {
    padding: 0.75rem;
    border-radius: var(--border-radius);
    background-color: white;
}

.message.user {
    align-self: flex-end;
    background-color: #e3f2fd;
    max-width: 80%;
}

.message.ai {
    align-self: flex-start;
    background-color: white;
    max-width: 80%;
}

/* 未来趋势样式 */
.future-trends {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.trend {
    background-color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-top: 4px solid var(--accent-color);
}

.trend:hover {
    transform: translateY(-5px);
}

/* 页脚样式 */
footer {
    background-color: white;
    margin-top: 4rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-nav {
    list-style: none;
}

.footer-nav li {
    margin-bottom: 0.5rem;
}

.footer-nav a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid #eee;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .app-visual {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .tokenizer-input, .tokenizer-result {
        width: 100%;
    }
    
    .token-comparison {
        gap: 1rem;
    }
    
    .language-token {
        min-width: 100%;
    }
    
    .process-step {
        flex-direction: column;
    }
    
    .step-icon {
        width: 100%;
        padding: 0.5rem;
    }
}

/* 增强响应式设计 */
@media (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
    }
    
    nav a {
        width: 100%;
        text-align: center;
        padding: 0.8rem;
    }
    
    .content-box {
        padding: 1.5rem;
    }
    
    .analogy {
        flex-direction: column;
    }
    
    .analogy-item {
        margin: 0.5rem 0;
    }
    
    .app-content {
        flex-direction: column;
    }
    
    .app-visual {
        width: 100%;
        margin-top: 1.5rem;
    }
    
    .animation-container {
        height: 400px;
    }
    
    .real-world-example {
        flex-direction: column;
    }
    
    .example-icon {
        margin: 0 auto 1rem auto;
    }
    
    .token-comparison {
        flex-direction: column;
    }
    
    .language-token {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .ai-token-process {
        flex-direction: column;
    }
    
    .process-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .step-icon {
        margin-bottom: 1rem;
        margin-right: 0;
    }
    
    .memory-test {
        gap: 1rem;
    }
    
    .answer-options {
        grid-template-columns: 1fr;
    }
    
    .future-trends {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-section {
        width: 100%;
        margin-bottom: 1.5rem;
    }
}

/* 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .animation-container {
        height: 350px;
    }
    
    .content-workspace, .code-workspace {
        flex-direction: column;
    }
    
    .content-input, .content-output {
        width: 100%;
    }
    
    .code-editor, .code-suggestion {
        width: 100%;
    }
    
    .answer-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .future-trends {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #e1e1e1;
        --light-bg: #2d2d2d;
        --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    }
    
    body {
        background-color: #1a1a1a;
    }
    
    .content-box, .animation-container, .game-message, 
    .memory-content, .question-content, .code-example,
    .interactive-demo, .trend {
        background-color: #2d2d2d;
    }
    
    .memory-prompt {
        background-color: #263046;
    }
    
    .memory-question {
        background-color: #3d2a2a;
    }
    
    .answer-option {
        background-color: #333;
        border-color: #555;
    }
    
    .answer-option:hover {
        background-color: #444;
    }
    
    input, textarea, button {
        background-color: #333;
        color: #e1e1e1;
        border-color: #555;
    }
    
    .code-content {
        background-color: #1e1e1e;
    }
    
    .line-numbers {
        background-color: #151515;
    }
}

/* 动画效果 */
.decoded-part {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 游戏完成提示 */
.game-complete {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.game-complete.show {
    opacity: 1;
    pointer-events: auto;
}

.complete-message {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 90%;
    width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.complete-message h3 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.complete-message p {
    margin-bottom: 1.5rem;
}

.complete-message button {
    padding: 0.8rem 2rem;
    font-size: 1rem;
} 

/* 实世界例子样式 */
.real-world-example {
    display: flex;
    margin: 1.5rem 0;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.real-world-example:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.example-icon {
    font-size: 2.5rem;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    box-shadow: var(--box-shadow);
}

.example-content {
    flex: 1;
}

.example-content h4 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.example-content p {
    margin-bottom: 0.8rem;
}

.example-content p:last-child {
    font-style: italic;
    color: #555;
    border-left: 3px solid var(--accent-color);
    padding-left: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .real-world-example {
        flex-direction: column;
    }
    
    .example-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
} 

/* 应用场景动画样式 */
.animation-container {
    width: 100%;
    height: 300px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    position: relative;
}

/* 聊天动画样式 */
.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0.5rem;
}

.chat-header {
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    font-weight: bold;
    text-align: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.message {
    max-width: 80%;
    padding: 0.8rem;
    border-radius: 1rem;
    animation: fadeIn 0.5s ease-out;
}

.message.user {
    align-self: flex-end;
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 0.2rem;
}

.message.ai {
    align-self: flex-start;
    background-color: #f1f1f1;
    color: var(--text-color);
    border-bottom-left-radius: 0.2rem;
}

.chat-context {
    padding: 1rem;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.context-meter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meter-label {
    font-size: 0.9rem;
    color: #666;
    min-width: 130px;
}

.meter-bar {
    flex: 1;
    height: 0.8rem;
    background-color: #e0e0e0;
    border-radius: 1rem;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    width: 0;
    background-color: var(--primary-color);
    transition: width 1s ease-in-out;
}

.meter-value {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* 内容生成动画样式 */
.content-generation {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: white;
}

.content-title {
    font-weight: bold;
}

.content-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-label {
    font-size: 0.8rem;
}

.progress-bar {
    width: 120px;
    height: 0.5rem;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background-color: white;
    transition: width 1.5s ease-in-out;
}

.content-workspace {
    display: flex;
    flex: 1;
}

.content-input, .content-output {
    flex: 1;
    padding: 0.8rem;
    overflow-y: auto;
}

.content-input {
    background-color: #f9f9f9;
    border-right: 1px solid #eee;
}

.input-header, .output-header {
    font-weight: bold;
    margin-bottom: 0.8rem;
    color: var(--secondary-color);
}

.input-text p, .output-text p {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.output-text .typing {
    position: relative;
    opacity: 0.7;
}

.output-text .typing::after {
    content: '|';
    position: absolute;
    right: -2px;
    animation: blink 1s infinite;
}

.output-text .typed::after {
    display: none;
}

.output-text .typed {
    opacity: 1;
}

.output-text .waiting {
    opacity: 0.5;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.token-usage {
    padding: 0.8rem;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.token-count {
    font-weight: bold;
    color: var(--primary-color);
}

/* 代码辅助动画样式 */
.code-assistant {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background-color: #2c3e50;
    color: white;
}

.code-title {
    font-weight: bold;
}

.code-files {
    display: flex;
    gap: 0.5rem;
}

.file {
    padding: 0.3rem 0.8rem;
    border-radius: 0.3rem;
    font-size: 0.8rem;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.1);
}

.file.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: bold;
}

.code-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.code-editor {
    flex: 1.5;
    background-color: #1e272e;
    color: #f1f1f1;
    font-family: monospace;
    display: flex;
}

.line-numbers {
    padding: 0.8rem 0.5rem;
    background-color: #151a1f;
    color: #607d8b;
    text-align: right;
    user-select: none;
    font-size: 0.9rem;
}

.code-content {
    padding: 0.8rem;
    overflow-x: auto;
    flex: 1;
}

.code-content pre {
    margin: 0;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.code-suggestion {
    flex: 1;
    padding: 0.8rem;
    background-color: #f9f9f9;
    border-left: 1px solid #eee;
    overflow-y: auto;
}

.suggestion-header {
    font-weight: bold;
    margin-bottom: 0.8rem;
    color: var(--secondary-color);
}

.suggestion-content p {
    margin-bottom: 0.5rem;
}

.suggestion-content pre {
    background-color: #f1f1f1;
    padding: 0.5rem;
    border-radius: 0.3rem;
    margin-bottom: 1rem;
    font-family: monospace;
    font-size: 0.9rem;
}

.token-analysis {
    padding: 0.8rem;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.analysis-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-value {
    font-weight: bold;
    color: var(--secondary-color);
}

/* 代码高亮样式 */
.keyword {
    color: #9b59b6;
}

.function {
    color: #3498db;
}

.parameter {
    color: #e67e22;
}

.variable {
    color: #2ecc71;
}

.string {
    color: #e74c3c;
}

.error {
    color: #f39c12;
}

.highlight {
    filter: brightness(1.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .content-workspace, .code-workspace {
        flex-direction: column;
    }
    
    .content-input, .code-editor {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .animation-container {
        height: 450px;
    }
} 