* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', Courier, monospace;
}

:root {
    --terminal-bg: #000;
    --terminal-text: #00ff00;
    --terminal-header: #2d2d2d;
    --terminal-shadow: rgba(0, 255, 0, 0.2);
}

body {
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 10px;
    font-size: 16px;
}

.terminal {
    width: 100%;
    max-width: 800px;
    background-color: var(--terminal-bg);
    border-radius: 8px;
    box-shadow: 0 0 20px var(--terminal-shadow);
    overflow: hidden;
}

.terminal-header {
    background-color: var(--terminal-header);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.close { background-color: #ff5f56; }
.minimize { background-color: #ffbd2e; }
.maximize { background-color: #27c93f; }

.title {
    color: #fff;
    font-size: 14px;
    flex-grow: 1;
    text-align: center;
    margin-right: 36px; /* 平衡左侧控制按钮的宽度 */
}

.terminal-content {
    padding: 15px;
    height: calc(100vh - 120px);
    overflow-y: auto;
    color: var(--terminal-text);
    word-wrap: break-word;
}

.output {
    margin-bottom: 15px;
    line-height: 1.4;
    transition: opacity 1s ease;
}

.input-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.prompt {
    color: var(--terminal-text);
    white-space: nowrap;
    font-weight: bold;
}

.command-input {
    background: transparent;
    border: none;
    color: var(--terminal-text);
    font-size: 16px;
    outline: none;
    flex: 1;
    min-width: 200px;
    padding: 5px 0;
}

/* 自定义滚动条样式 */
.terminal-content::-webkit-scrollbar {
    width: 8px;
}

.terminal-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.terminal-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

/* 打字动画效果 */
.typing {
    border-right: 2px solid var(--terminal-text);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* 移动端优化 */
@media (max-width: 768px) {
    body {
        padding: 0;
        font-size: 14px;
    }

    .terminal {
        height: 100vh;
        border-radius: 0;
    }

    .terminal-content {
        height: calc(100vh - 100px);
        padding: 10px;
    }

    .controls {
        gap: 6px;
    }

    .control {
        width: 10px;
        height: 10px;
    }

    .title {
        font-size: 12px;
    }

    .command-input {
        font-size: 14px;
        width: 100%;
    }

    /* 改善移动端触摸体验 */
    .command-input {
        -webkit-tap-highlight-color: transparent;
        padding: 8px 0;
    }

    /* 优化移动端滚动 */
    .terminal-content {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* 横屏优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .terminal-content {
        height: calc(100vh - 80px);
    }

    .terminal-header {
        padding: 5px 10px;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #000;
    }
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
    :root {
        --terminal-text: #00ff00;
        --terminal-shadow: rgba(0, 255, 0, 0.4);
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    .typing {
        animation: none;
    }
    
    .terminal-content {
        scroll-behavior: auto;
    }
}

/* 游戏介绍弹窗样式 */
.intro-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--terminal-bg);
    border: 1px solid var(--terminal-text);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 20px var(--terminal-shadow);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background-color: var(--terminal-header);
    padding: 15px 20px;
    border-bottom: 1px solid var(--terminal-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--terminal-text);
    margin: 0;
    font-size: 1.5em;
}

.language-switch {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--terminal-text);
    color: var(--terminal-text);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: rgba(0, 255, 0, 0.1);
}

.lang-btn.active {
    background-color: var(--terminal-text);
    color: var(--terminal-bg);
}

.modal-body {
    padding: 20px;
    color: var(--terminal-text);
}

.intro-section {
    line-height: 1.6;
}

.intro-section p {
    margin-bottom: 15px;
}

.intro-section h3 {
    margin: 20px 0 10px;
    color: var(--terminal-text);
}

.intro-section ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.intro-section li {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.intro-section code {
    background-color: rgba(0, 255, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.security-notice {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid var(--terminal-text);
    border-radius: 4px;
    background-color: rgba(0, 255, 0, 0.05);
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--terminal-text);
    text-align: center;
}

.start-btn {
    background-color: var(--terminal-text);
    color: var(--terminal-bg);
    border: none;
    padding: 10px 30px;
    border-radius: 4px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover {
    background-color: #00cc00;
    transform: translateY(-2px);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }

    .modal-header h2 {
        font-size: 1.2em;
    }

    .modal-body {
        padding: 15px;
    }

    .intro-section li {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* 黑客帝国加载动画 */
.matrix-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1s ease;
}

#matrixCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.loading-text {
    position: relative;
    z-index: 2001;
    color: #00ff00;
    text-align: center;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.text-line {
    font-size: 24px;
    margin-bottom: 20px;
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(0, 255, 0, 0.8),
                     0 0 30px rgba(0, 255, 0, 0.6),
                     0 0 40px rgba(0, 255, 0, 0.4);
    }
}

.progress-container {
    width: 300px;
    height: 20px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(0, 255, 0, 0.3),
        rgba(0, 255, 0, 0.6),
        rgba(0, 255, 0, 0.3));
    transition: width 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent);
    animation: progressShine 3s linear infinite;
}

@keyframes progressShine {
    to {
        left: 200%;
    }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ff00;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    transition: all 0.3s ease;
}

.status-text {
    margin-top: 20px;
    font-size: 14px;
    min-height: 20px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .progress-container {
        width: 80%;
        max-width: 300px;
    }

    .text-line {
        font-size: 20px;
    }
}

.output pre {
    font-family: 'Courier New', monospace;
    white-space: pre;
    overflow: hidden;
    margin: 0;
    padding: 0;
    animation: glowText 2s ease-in-out infinite alternate;
}

@keyframes glowText {
    from {
        text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(0, 255, 0, 0.8),
                     0 0 30px rgba(0, 255, 0, 0.6),
                     0 0 40px rgba(0, 255, 0, 0.4);
    }
}

.welcome-text {
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease-out;
}

.welcome-text span {
    display: inline-block;
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    from {
        text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    }
    to {
        text-shadow: 0 0 10px rgba(0, 255, 0, 0.8),
                     0 0 15px rgba(0, 255, 0, 0.6);
    }
} 