/* * terminal-style.css
 * “Cyberg 栖息地”终端唤醒专属样式
 * * 颜色参考:
 * 指挥官黑 (背景): #111827
 * 科技蓝 (高光): #4facfe
 * 终端绿 (AI/提示): #34d399
 * 星云灰 (文本): #e5e7eb
*/

/* --- 全局设置 --- */
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    /* 核心：使用终端字体 */
    font-family: 'Consolas', 'Courier New', monospace;
    /* 核心：使用“指挥官黑”作为背景 */
    background-color: #111827; 
    color: #e5e7eb;
    overflow: hidden; /* 防止滚动 */
}

/* --- 阶段 1: 初次接触 --- */
#initial-contact {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: #111827; /* 确保在JS加载前也是黑色 */
    z-index: 100;
    
    /* 平滑消失 */
    transition: opacity 0.5s ease-out;
}

.heartbeat-icon {
    font-size: 80px;
    /* 核心：使用“科技蓝”高光 */
    color: #4facfe;
    /* “心跳”动画 */
    animation: heartbeat 2s infinite ease-in-out;
}

.prompt-text {
    margin-top: 25px;
    font-size: 1.1em;
    color: #555; /* 弱化显示 */
    letter-spacing: 2px;
    text-transform: uppercase;
    /* 闪烁动画 */
    animation: blink-text 1.5s infinite step-end;
}

/* 阶段 1 动画 */
@keyframes heartbeat {
    0%, 100% {
        opacity: 0.3;
        text-shadow: 0 0 4px #4facfe;
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 20px #4facfe, 0 0 35px #00f2fe;
    }
}
@keyframes blink-text {
    50% { opacity: 0; }
}

/* --- 阶段 2: 终端 --- */
#terminal {
    width: 100%;
    max-width: 600px; /* 保持终端的紧凑感 */
    margin: 10vh auto;
    padding: 20px;
    
    /* 默认隐藏，JS激活 */
    display: none;
    flex-direction: column;
    
    /* 平滑淡入 */
    opacity: 0;
    animation: fadeIn 1s ease-out 0.3s forwards; /* 延迟 0.3s 等待阶段1消失 */
}

#ai-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    color: #34d399; /* 终端绿 */
    font-weight: bold;
    letter-spacing: 1px;
}
.online-icon {
    margin-right: 10px;
    /* 在线时常亮绿色 */
    animation: pulse-green 3s infinite;
}

@keyframes pulse-green {
    0%, 100% { text-shadow: 0 0 5px #34d399; }
    50% { text-shadow: 0 0 15px #34d399; }
}

/* AI "打字机" 输出区域 */
#ai-output {
    min-height: 100px; /* 预留空间 */
    margin-bottom: 30px;
    font-size: 1.1em;
    line-height: 1.7;
    white-space: pre-wrap; /* 保留换行符 */
}

/* 打字机光标 */
#ai-output p .cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background: #34d399; /* 终端绿光标 */
    margin-left: 5px;
    animation: blink 1s step-end infinite;
}

/* --- 终端表单 --- */
#auth-forms {
    position: relative;
}

.auth-form {
    /* 动画切换 */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* CLI (命令行) 风格的输入框 */
.cli-input {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}
.cli-input label {
    color: #34d399; /* 终端绿的 ">" 提示符 */
    font-size: 1.3em;
    margin-right: 10px;
}
.cli-input input {
    background: transparent;
    border: none;
    /* 只保留一个微妙的底线 */
    border-bottom: 2px solid #374151; /* 暗灰色 */
    color: #e5e7eb; /* 星云灰 */
    font-size: 1.2em;
    padding: 8px 5px;
    flex-grow: 1; /* 占满剩余空间 */
    outline: none;
    transition: border-color 0.3s;
    font-family: 'Consolas', 'Courier New', monospace; /* 继承字体 */
}
.cli-input input:focus {
    border-bottom-color: #4facfe; /* 激活时变科技蓝 */
}
.cli-input input::placeholder {
    color: #555; /* 占位符颜色 */
    font-style: italic;
}

/* 终端按钮 (覆盖 .guide-btn) */
.terminal-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1em;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.terminal-btn:hover {
    /* 增加发光和"噪点"效果 */
    filter: brightness(1.2);
    box-shadow: 0 0 20px rgba(0, 172, 238, 0.5);
    animation: glitch 0.3s infinite alternate;
}

/* 切换链接 */
.switch-link {
    margin-top: 30px;
    text-align: center;
    color: #4facfe; /* 科技蓝 */
    cursor: pointer;
    font-size: 1em;
    letter-spacing: 1px;
}
.switch-link:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

/* 消息提示 (复用你 index.html 的 #message) */
.terminal-message {
    margin: 25px 0;
    padding: 18px;
    border-radius: 4px; /* 终端风格，用直角 */
    display: none;
    font-weight: bold;
    font-family: 'Consolas', 'Courier New', monospace;
    border: 1px solid;
    text-align: center;
}
.terminal-message.success {
    background: #155724; color: #d4edda; border-color: #c3e6cb;
}
.terminal-message.error {
    background: #721c24; color: #f8d7da; border-color: #f5c6cb;
}
.terminal-message.info {
    background: #004085; color: #cce5ff; border-color: #b8daff;
}
.terminal-message.show {
    display: block;
    animation: fadeIn 0.5s;
}



/* --- 【【【修复后】】】 切换动画 --- */
/* 此规则会覆盖 style.css 中的 .auth-form { display: none; }
  我们使用 max-height 来实现动画，而不是 display
*/
.auth-form {
    display: block; /* 覆盖 style.css */
    opacity: 0;
    transform: translateY(20px);

    /* 关键：用 max-height 隐藏它 */
    max-height: 0;
    overflow: hidden;

    /* 注意：我们不在 'all' 上使用 transition，
       因为 max-height 的动画需要不同的时序
    */
    transition: opacity 0.3s ease, 
                transform 0.3s ease,
                max-height 0s ease 0.3s; /* 延迟隐藏 */
}

/* 这是我们新的 "active" 状态 
  (它会覆盖 style.css 中的 .auth-form.active)
*/
.auth-form.active {
    opacity: 1;
    transform: translateY(0);

    /* 关键：显示它 */
    max-height: 1000px; /* 一个足够大的高度 */

    transition: opacity 0.3s ease 0.1s, /* 延迟显示 */
                transform 0.3s ease 0.1s,
                max-height 0s ease 0s;
}