/* style.css */
:root {
    --neon-blue: #0ff;
    --neon-pink: #f0f;
    --matrix-green: #0f0;
    --cyber-dark: #0a0a0a;
    --neon-purple: #a020f0;
    --holographic: linear-gradient(45deg, 
        rgba(0,255,255,0.8) 0%,
        rgba(255,0,255,0.8) 50%,
        rgba(0,255,255,0.8) 100%
    );
}

body {
    background: radial-gradient(circle at center, #1a1a2e 0%, #0a0a0a 100%);
    font-family: 'Rajdhani', 'Orbitron', sans-serif;
    color: var(--neon-blue);
    min-height: 100vh;
    margin: 0;
    position: relative;
    overflow:hidden;
}
/**/
.cyber-container {
    width: 95%; /* 改为相对宽度 */
    max-width: 1000px; /* 保留最大宽度 */
    min-height: 100vh;
    margin: 0 auto;
    background: rgba(10, 10, 16, 0.95);
    border: 1px solid var(--neon-blue); /* 减薄边框 */
    border-radius: 0;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3); /* 减弱阴影 */
    padding: 0.5rem; /* 减少内边距 */
    box-sizing: border-box;
    position: relative;
}

.cyber-glitch {
    text-align: center;
    font-size: 2.5rem;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0.05em 0 0 rgba(255,0,255,.75),
                 -0.025em -0.05em 0 rgba(0,255,0,.75),
                 0.025em 0.05em 0 rgba(0,0,255,.75);
    animation: glitch 500ms infinite;
}

@keyframes glitch {
    0% { text-shadow: 0.05em 0 0 rgba(255,0,255,.75),
                     -0.05em -0.025em 0 rgba(0,255,0,.75),
                     -0.025em 0.05em 0 rgba(0,0,255,.75); }
    14% { text-shadow: 0.05em 0 0 rgba(255,0,255,.75),
                     -0.05em -0.025em 0 rgba(0,255,0,.75),
                     -0.025em 0.05em 0 rgba(0,0,255,.75); }
    15% { text-shadow: -0.05em -0.025em 0 rgba(255,0,255,.75),
                     0.025em 0.025em 0 rgba(0,255,0,.75),
                     -0.05em -0.05em 0 rgba(0,0,255,.75); }
    49% { text-shadow: -0.05em -0.025em 0 rgba(255,0,255,.75),
                     0.025em 0.025em 0 rgba(0,255,0,.75),
                     -0.05em -0.05em 0 rgba(0,0,255,.75); }
    50% { text-shadow: 0.025em 0.05em 0 rgba(255,0,255,.75),
                     0.05em 0 0 rgba(0,255,0,.75),
                     0 -0.05em 0 rgba(0,0,255,.75); }
    99% { text-shadow: 0.025em 0.05em 0 rgba(255,0,255,.75),
                     0.05em 0 0 rgba(0,255,0,.75),
                     0 -0.05em 0 rgba(0,0,255,.75); }
    100% { text-shadow: -0.025em 0 0 rgba(255,0,255,.75),
                      -0.025em -0.025em 0 rgba(0,255,0,.75),
                      -0.025em -0.05em 0 rgba(0,0,255,.75); }
}

#chat-box {
    height: 65vh;
    border: 1px solid var(--neon-blue);
    border-radius: 0;
    padding: 15px;
    margin: 20px 0;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.2);
    font-family: 'Courier New', monospace;
    color: var(--matrix-green);
}

.message {
    border: 1px solid;
    position: relative;
    padding: 1rem;
    margin: 1rem 0;
    background: linear-gradient(45deg, 
      rgba(16,16,32,0.9) 0%,
      rgba(32,16,48,0.9) 100%
    );
    animation: messageIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.3s;
}

.message:hover {
    transform: scale(1.02);
    z-index: 1;
}

.user-message {
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.ai-message {
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.3);
}

.input-area {
    display: flex;
    gap: 0px;
    position: relative;
    border: 1px solid var(--neon-blue);
    background: rgba(16,16,32,0.5);
}

input[type="text"] {
    flex: 1;
    padding: 1rem;
    background: transparent;
    color: var(--matrix-green);
    border: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
}

input[type="text"]:focus {
    outline: none;
    box-shadow: 0 0 20px rgb(0, 255, 255);
}

button {
    padding: 12px 25px;
    background: linear-gradient(45deg, #0ff 0%, #f0f 100%);
    color: black;
    border: 1px solid var(--neon-blue);
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button:hover {
    filter: hue-rotate(90deg);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--holographic);
    opacity: 0.3;
    animation: rotateHolo 4s linear infinite;
}

button.clicked {
    transform: scale(0.95);
    filter: brightness(1.5);
}

.loading {
    position: relative;
    padding: 1rem;
    color: var(--neon-pink);
}

.loading::after {
    content: '>>>_';
    animation: typing 1s infinite steps(4);
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
      to bottom,
      rgba(0, 255, 255, 0.05) 0%,
      rgba(0, 255, 255, 0) 10%
    );
    animation: scan 3s linear infinite;
    pointer-events: none;
}

/* 新增动画 */
@keyframes messageIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes rotateHolo {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes borderFlow {
    0% { -webkit-mask-position: 0% 0%; }
    100% { -webkit-mask-position: 200% 0%; }
}

#chat-box::-webkit-scrollbar {
    width: 8px;
    background: rgba(0,0,0,0.3);
}

#chat-box::-webkit-scrollbar-thumb {
    background: var(--neon-blue);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,255,255,0.5);
}

canvas {
    filter: blur(1px) contrast(1.2);
}
/**/
/* style.css 新增动画 */
/* 页面容器入场动画 */
.cyber-container {
    animation: containerEntrance 1s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes containerEntrance {
    0% {
        opacity: 0;
        transform: perspective(1000px) rotateX(15deg) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: perspective(1000px) rotateX(0) translateY(0);
    }
}

/* 消息发送后的滚动动画 */
@keyframes messageFloat {
    0% { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* 新增平滑滚动锚点 */
html {
    scroll-behavior: smooth;
}

/* 按钮脉冲动画 */
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(0, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 255, 0); }
}

.pulse {
    animation: pulseGlow 1.5s infinite;
}

@keyframes scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
  }

@keyframes typing {
0% { content: '>>>_'; }
25% { content: '> >>_'; }
50% { content: '>> >_'; }
75% { content: '>>> _'; }
100% { content: '>>>_'; }
}

/* 添加移动端适配 */
@media (max-width: 768px) {
    .cyber-container {
        width: 100%;
        border-left: none;
        border-right: none;
        padding: 0.25rem;
    }

    #chat-box {
        height: 60vh; /* 使用视口单位 */
        margin: 10px 0;
        padding: 8px;
    }

    .input-area {
        flex-direction: column;
    }

    input[type="text"] {
        padding: 0.8rem;
        font-size: 1rem;
    }

    button {
        padding: 10px;
        width: 100%;
    }

    .cyber-glitch {
        font-size: 1.8rem;
        margin: 0.5rem 0;
    }

    .message {
        padding: 0.8rem;
        margin: 0.5rem 0;
    }
}

/* 链接基础样式 */
a {
    position: relative;
    display: inline-block;
    padding: 12px 25px;
    color: var(--neon-blue);
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid var(--neon-blue);
    background: linear-gradient(
        45deg, 
        rgba(0, 255, 255, 0.1) 0%,
        rgba(255, 0, 255, 0.1) 100%
    );
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
    clip-path: polygon(0% 0, 100% 0, 100% 100%, 0 100%);
    display: flex; /* 使用 Flexbox 布局 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
}
/* 悬停动态效果 */
a:hover {
    filter: hue-rotate(90deg);
    box-shadow: 
        0 0 20px var(--neon-blue),
        0 0 30px var(--neon-pink);

    background: linear-gradient(
        45deg, 
        rgba(0, 255, 255, 0.3) 0%,
        rgba(255, 0, 255, 0.3) 100%
    );
}

/* 点击反馈 */
a:active {
    transform: translateY(1px);
    filter: brightness(1.5);
}

/* 全息投影效果 */
a::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--holographic);
    opacity: 0.3;
    mix-blend-mode: overlay;
    animation: rotateHolo 4s linear infinite;
    z-index: -1;
}

/* 移动端优化 */
@media (max-width: 768px) {
    a {
        padding: 6px 15px;
        font-size: 0.9em;
        clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
        margin: 3px;
    }
}

/* 特殊状态 */
a[target="_blank"]::before {
    content: '↗';
    margin-right: 5px;
    filter: drop-shadow(0 0 2px var(--neon-pink));
}

a.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.8);
}



@media (max-width: 768px) {
    /* 移动端滚动条核心样式 */
    #chat-box::-webkit-scrollbar {
        width: 6px; /* 更细的滚动条 */
        background: rgba(0,0,0,0.2);
    }

    #chat-box::-webkit-scrollbar-thumb {
        background: var(--neon-blue);
        border-radius: 3px;
        box-shadow: 
            inset 0 0 3px rgba(0,255,255,0.5),
            0 0 5px rgba(0,255,255,0.3); /* 内外双发光 */
        border: 1px solid rgba(0,255,255,0.5); /* 添加发光边框 */
    }

    /* 滚动条轨道动态效果 */
    #chat-box::-webkit-scrollbar-track {
        background: rgba(10,10,16,0.3);
        box-shadow: inset 0 0 10px rgba(0,255,255,0.1);
    }

    /* 滚动条悬停互动 */
    #chat-box::-webkit-scrollbar-thumb:hover {
        background: var(--neon-pink);
        box-shadow: 0 0 10px rgba(255,0,255,0.5);
    }

    /* 滚动条点击反馈 */
    #chat-box::-webkit-scrollbar-thumb:active {
        filter: brightness(1.5);
        transform: scale(1.1);
    }
}