:root {
    --bg-color: #0f0f1e;
    --primary-color: #00f3ff;
    --secondary-color: #bd00ff;
    --text-color: #e0e0e0;
    --terminal-bg: rgba(16, 16, 24, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Roboto Mono', monospace;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    overflow-y: auto;
    /* 允许页面内容滚动 */
    padding: 20px 0;
    /* 防止内容贴边 */
    /* Let clicks pass through to canvas if needed, but we have interactive elements */
}

.content {
    width: 90%;
    max-width: 800px;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: auto;
    /* 配合 flex 居中且允许滚动 */
}

/* Terminal Window */
.terminal-window {
    background: var(--terminal-bg);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    backdrop-filter: blur(10px);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.8s ease-out forwards;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    /* 防止头部被压缩 */
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background-color: #ff5f56;
}

.yellow {
    background-color: #ffbd2e;
}

.green {
    background-color: #27c93f;
}

.title {
    margin-left: 10px;
    font-size: 0.8rem;
    color: #888;
}

.terminal-body {
    padding: 20px;
    font-size: 1rem;
    line-height: 1.6;
    min-height: 200px;
    max-height: 60vh;
    /* 限制最大高度 */
    overflow-y: auto;
    /* 允许内部滚动 */
    scroll-behavior: smooth;
}

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

.terminal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3);
    border-radius: 4px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 243, 255, 0.5);
}

.prompt {
    margin-bottom: 10px;
}

.user {
    color: var(--primary-color);
    font-weight: bold;
}

.at {
    color: #fff;
}

.host {
    color: var(--secondary-color);
    font-weight: bold;
}

.path {
    color: #27c93f;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--primary-color);
    vertical-align: bottom;
    animation: blink 1s step-end infinite;
}

.success {
    color: #27c93f;
    margin-top: 5px;
}

.warning {
    color: #ffbd2e;
    margin-top: 5px;
}

.info {
    color: var(--primary-color);
    margin-top: 15px;
    font-weight: bold;
}

.error {
    color: #ff5f56;
    margin-top: 5px;
}

.hidden {
    display: none;
}

#user-input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    outline: none;
    min-width: 10px;
    display: inline-block;
}

#input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

/* Cards */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.cards-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 243, 255, 0.2);
    border-color: var(--primary-color);
}

.card h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.card p {
    color: #aaa;
    font-size: 0.9rem;
}

/* Animations */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .content {
        width: 95%;
        gap: 1.5rem;
    }

    .terminal-window {
        margin-top: 10px;
    }

    .terminal-body {
        font-size: 0.85rem;
        /* 稍微减小字体 */
        padding: 15px;
        min-height: 180px;
    }

    .terminal-header {
        padding: 8px 12px;
    }

    .cards-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card {
        padding: 15px;
    }

    /* 优化输入体验 */
    #input-line {
        flex-wrap: wrap;
        /* 允许换行，防止提示符太长挤压输入框 */
    }

    #user-input {
        width: 100%;
        /* 输入框占满一行 */
        margin-top: 5px;
    }
}