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

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* 全局滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 22, 26, 0.3);
    border-radius: 4px;
}

/* 滚动条渐变与发光特效 */
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #00ffe7 0%, #5b7fff 100%);
    border-radius: 4px;
    box-shadow: 0 0 8px 2px #00ffe799, 0 0 2px 1px #5b7fff99;
    transition: background 0.3s, box-shadow 0.3s;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5b7fff 0%, #00ffe7 100%);
    box-shadow: 0 0 16px 4px #00ffe7cc, 0 0 8px 2px #5b7fffcc;
}

/* Firefox 全局滚动条样式 */
html {
    scrollbar-width: thin;
    scrollbar-color: linear-gradient(135deg, #00ffe7 0%, #5b7fff 100%) rgba(20,22,26,0.3) !important;
}

/* 炫酷状态栏样式 */
.status-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: linear-gradient(135deg, rgba(20, 22, 26, 0.6) 0%, rgba(40, 44, 52, 0.6) 100%);
    padding: 20px 30px;
    margin-bottom: 40px;
    border-radius: 12px;
    border: 2px solid rgba(0, 255, 231, 0.3);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

.status-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00ffe7, #ff4757, transparent);
    animation: scan-line 3s infinite;
    box-shadow: 0 0 12px #00ffe7;
}

.status-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 49%, rgba(0, 255, 231, 0.1) 50%, transparent 51%);
    background-size: 15px 15px;
    pointer-events: none;
    animation: grid-move 15s linear infinite;
}

@keyframes scan-line {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(15px, 15px); }
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: relative;
    z-index: 2;
    padding: 15px 20px;
    border-radius: 8px;
    background: rgba(0, 255, 231, 0.08);
    border: 1px solid rgba(0, 255, 231, 0.25);
    transition: all 0.3s ease;
    min-height: 60px;
    flex-direction: column;
    text-align: center;
}

.status-item:hover {
    background: rgba(0, 255, 231, 0.1);
    border-color: rgba(0, 255, 231, 0.4);
    box-shadow: 0 0 12px rgba(0, 255, 231, 0.3);
}

.status-icon {
    width: 32px;
    height: 32px;
    color: #00ffe7;
    filter: drop-shadow(0 0 10px #00ffe7);
    animation: icon-pulse 2s ease-in-out infinite;
    margin-bottom: 5px;
}

@keyframes icon-pulse {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 8px #00ffe7);
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 0 15px #00ffe7);
    }
}

.status-text {
    font-family: 'Orbitron', monospace;
    font-size: 0.85em;
    font-weight: 600;
    color: #00ffe7;
    text-shadow: 0 0 6px #00ffe7;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: text-glow 2.5s ease-in-out infinite alternate;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.digital-clock {
    font-family: 'Orbitron', monospace;
    font-size: 1.1em;
    font-weight: 700;
    color: #00ffe7;
    text-shadow: 0 0 8px #00ffe7;
    letter-spacing: 2px;
    animation: clock-pulse 2s ease-in-out infinite alternate;
}

@keyframes text-glow {
    0% { 
        text-shadow: 0 0 4px #00ffe7;
    }
    100% { 
        text-shadow: 0 0 8px #00ffe7;
    }
}

@keyframes clock-pulse {
    0% { 
        text-shadow: 0 0 5px #00ffe7;
    }
    100% { 
        text-shadow: 0 0 10px #00ffe7;
    }
}

/* 网络状态动画 */
#networkStatus {
    animation: network-pulse 2s infinite;
}

@keyframes network-pulse {
    0%, 100% { 
        color: #00ffe7;
        text-shadow: 0 0 6px #00ffe7, 0 0 12px #00ffe7;
    }
    50% { 
        color: #ff4757;
        text-shadow: 0 0 6px #ff4757, 0 0 12px #ff4757;
    }
}

/* 系统状态闪烁 */
#systemStatus {
    animation: system-blink 4s infinite;
}

@keyframes system-blink {
    0%, 85%, 100% { 
        opacity: 1;
        color: #00ffe7;
    }
    90%, 95% { 
        opacity: 0.6;
        color: #ff4757;
    }
}

body {
    font-family: 'Orbitron', monospace;
    background: #0a0a0a;
    color: #839192;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, rgba(0, 255, 231, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(0, 255, 231, 0.08) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -2;
    animation: grid-flow 25s linear infinite;
}

@keyframes grid-flow {
    0% { background-position: 0 0; }
    100% { background-position: 30px 30px; }
}

.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    object-fit: cover;
    opacity: 0.3; /* 提高透明度以确保可见 */
    filter: sepia(30%) contrast(130%) brightness(80%);
}

/* 粒子效果 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    animation: float 4s infinite linear, fade 4s infinite;
    opacity: 0;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

@keyframes fade {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.9; }
}

.container {
    position: relative;
    max-width: 1200px;
    margin: 20px auto;
    padding: 25px;
    z-index: 1;
    width: 95%;
    box-sizing: border-box;
    background: linear-gradient(135deg, rgba(15, 20, 30, 0.4) 0%, rgba(25, 35, 45, 0.4) 100%);
    border-radius: 16px;
    border: 1px solid rgba(0, 255, 231, 0.4);
    box-shadow: 
        0 0 30px rgba(0, 255, 231, 0.3),
        0 0 60px rgba(91, 127, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, rgba(40, 44, 52, 0.5) 0%, rgba(60, 64, 72, 0.5) 100%);
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 231, 0.3);
    position: relative;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 231, 0.2), transparent);
    animation: header-scan 5s infinite;
}

@keyframes header-scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.header-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: rgba(0, 255, 231, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 231, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 231, 0.3);
}

.x-icon img {
    width: 35px;
    height: 35px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.x-icon:hover img {
    opacity: 0.9;
    transform: scale(1.2);
}

.title {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    color: #00ffe7;
    text-shadow: 0 0 15px #00ffe7, 0 0 30px #5b7fff, 0 0 50px #ff4757;
    animation: title-glow 2s ease-in-out infinite alternate, title-pulse 5s ease-in-out infinite;
}

@keyframes title-glow {
    0% { 
        text-shadow: 0 0 15px #00ffe7, 0 0 30px #5b7fff;
    }
    100% { 
        text-shadow: 0 0 25px #00ffe7, 0 0 40px #5b7fff, 0 0 60px #ff4757;
    }
}

@keyframes title-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    font-weight: 500;
    color: #00ffe7;
    text-shadow: 0 0 5px #00ffe7;
}

.translator-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 100%;
    position: relative;
}

.translator-section::after, .chatbot-section::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00ffe7, #ff4757, transparent);
    transform: translateX(-50%);
    animation: divider-glow 2.5s ease-in-out infinite;
}

@keyframes divider-glow {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.input-section, .output-section {
    background: linear-gradient(135deg, rgba(40, 44, 52, 0.5) 0%, rgba(60, 64, 72, 0.5) 100%);
    padding: 25px;
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 231, 0.3);
    position: relative;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
}

.output-section textarea {
    flex: 1;
    margin-bottom: 15px;
}

.output-section .btn-copy {
    align-self: flex-start;
    margin-top: auto;
}

.input-section::before, .output-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 49%, rgba(0, 255, 231, 0.1) 50%, transparent 51%);
    background-size: 10px 10px;
    pointer-events: none;
    opacity: 0.15;
}

label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: #00ffe7;
    text-shadow: 0 0 4px #00ffe7;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1em;
}

textarea, input[type="text"] {
    width: 100%;
    max-width: 100%;
    background: rgba(20, 22, 26, 0.95);
    border: 2px solid rgba(0, 255, 231, 0.3);
    border-radius: 4px;
    padding: 15px;
    color: #ffffff;
    font-family: 'Orbitron', monospace;
    font-size: 15px;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

textarea::-webkit-scrollbar,
input[type="text"]::-webkit-scrollbar {
    width: 6px;
}

textarea::-webkit-scrollbar-track,
input[type="text"]::-webkit-scrollbar-track {
    background: rgba(20, 22, 26, 0.3);
    border-radius: 3px;
}

textarea::-webkit-scrollbar-thumb,
input[type="text"]::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 231, 0.5);
    border-radius: 3px;
    transition: background 0.3s ease;
}

textarea::-webkit-scrollbar-thumb:hover,
input[type="text"]::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 231, 0.7);
}

textarea, input[type="text"] {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 231, 0.5) rgba(20, 22, 26, 0.3);
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: #00ffe7;
    background: rgba(20, 22, 26, 0.95);
    box-shadow: 0 0 15px rgba(0, 255, 231, 0.8), 0 0 6px #ff4757;
    animation: input-pulse 1.5s ease-in-out infinite;
}

@keyframes input-pulse {
    0% { box-shadow: 0 0 15px rgba(0, 255, 231, 0.8); }
    50% { box-shadow: 0 0 25px rgba(0, 255, 231, 1); }
    100% { box-shadow: 0 0 15px rgba(0, 255, 231, 0.8); }
}

.translation-buttons {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.btn {
    padding: 12px 22px;
    border: 2px solid rgba(0, 255, 231, 0.5);
    border-radius: 6px;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(20, 30, 40, 0.9) 0%, rgba(40, 50, 60, 0.9) 100%);
    color: #ffffff;
    text-shadow: 0 0 6px rgba(0, 255, 231, 0.8);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 231, 0.4), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, rgba(40, 50, 60, 0.9) 0%, rgba(60, 70, 80, 0.9) 100%);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 255, 231, 0.7), 0 0 8px rgba(255, 71, 87, 0.7);
    border-color: rgba(0, 255, 231, 0.9);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 0 12px rgba(0, 255, 231, 0.5);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(0, 255, 231, 0.3) 0%, rgba(255, 71, 87, 0.3) 100%);
}

.btn-secondary, .btn-copy, .btn-send {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.3) 0%, rgba(0, 255, 231, 0.3) 100%);
}

.message-content {
    box-shadow: 0 0 10px 3px #00ffe733, 0 0 3px 1px #ff475733;
    transition: box-shadow 0.3s;
}
.message-content:hover {
    box-shadow: 0 0 20px 5px #00ffe7cc, 0 0 10px 3px #ff4757cc;
}

.chatbot-section {
    background: linear-gradient(135deg, rgba(40, 44, 52, 0.5) 0%, rgba(60, 64, 72, 0.5) 100%);
    padding: 25px;
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 231, 0.3);
    position: relative;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
}

.chatbot-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 49%, rgba(0, 255, 231, 0.1) 50%, transparent 51%);
    background-size: 10px 10px;
    pointer-events: none;
    opacity: 0.15;
}

.chatbot-section h2 {
    margin-bottom: 20px;
    color: #00ffe7;
    text-shadow: 0 0 5px #00ffe7;
}

.chat-container {
    height: 300px;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: linear-gradient(135deg, rgba(20, 22, 26, 0.95) 0%, rgba(30, 32, 36, 0.95) 100%);
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid rgba(0, 255, 231, 0.3);
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(0, 255, 231, 0.2);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(20, 22, 26, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 231, 0.5);
    border-radius: 3px;
    transition: background 0.3s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 231, 0.7);
}

.chat-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 231, 0.5) rgba(20, 22, 26, 0.3);
}

.message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    animation: messageSlideIn 0.8s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message:hover .message-content {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(0, 255, 231, 0.4);
    transition: all 0.3s ease;
}

.bot-message .message-content {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.95) 0%, rgba(52, 73, 94, 0.95) 100%);
    padding: 12px 16px;
    border-radius: 12px;
    border-left: 3px solid #00ffe7;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.4;
    max-width: 85%;
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(0, 255, 231, 0.2);
    backdrop-filter: blur(5px);
}

.bot-english-message .message-content {
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.9) 0%, rgba(52, 73, 94, 0.9) 100%);
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid #ff4757;
    color: #ff4757;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
    max-width: 85%;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 71, 87, 0.2);
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, rgba(52, 73, 94, 0.95) 0%, rgba(60, 84, 104, 0.95) 100%);
    padding: 12px 16px;
    border-radius: 12px;
    border-right: 3px solid #ff4757;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.4;
    max-width: 85%;
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.3),
        0 0 8px rgba(255, 71, 87, 0.2);
    backdrop-filter: blur(5px);
}

.chat-input-container {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.chat-input-container input {
    flex: 1;
}

.alien-font {
    font-family: 'Segoe UI Symbol', 'Noto Sans Symbols', 'Arial Unicode MS', sans-serif;
    font-size: 1.1em;
    letter-spacing: 1px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.5;
    text-shadow: 0 0 6px #00ffe7;
    color: #00ffe7;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .status-bar {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 8px;
        padding: 12px 15px;
        margin-bottom: 25px;
    }

    .status-item {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 10px 8px;
        min-height: 65px;
        gap: 6px;
        text-align: center;
    }

    .status-text, .digital-clock {
        font-size: 0.65em;
        letter-spacing: 0.3px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .status-icon {
        width: 20px;
        height: 20px;
        margin-bottom: 3px;
        flex-shrink: 0;
    }

    .translator-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .alien-font {
        font-size: 1.2em;
        letter-spacing: 2px;
    }

    textarea, input[type="text"] {
        font-size: 13px;
    }

    .btn {
        font-size: 0.8em;
        padding: 10px 15px;
    }

    label {
        font-size: 0.9em;
    }

    .message {
        margin-bottom: 12px;
    }

    .message .message-content {
        font-size: 0.9em;
        padding: 10px 12px;
        max-width: 90%;
    }

    .chat-messages {
        padding: 12px;
    }

    .chat-container {
        height: 250px;
    }

    .input-section, .output-section, .chatbot-section {
        padding: 15px;
    }

    .translation-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .chat-input-container {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .status-bar {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: 6px;
        padding: 10px 12px;
    }

    .status-item {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        padding: 8px 12px;
        min-height: 45px;
        gap: 12px;
        text-align: left;
    }

    .status-text, .digital-clock {
        font-size: 0.7em;
        letter-spacing: 0.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .status-icon {
        width: 18px;
        height: 18px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }
}

footer {
    text-align: center;
    padding: 25px;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

footer .x-icon img {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

footer .x-icon:hover img {
    opacity: 0.9;
    transform: scale(1.2);
}