/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 设置根字体大小，便于使用rem单位 */
html {
    font-size: 16px;
}

body {
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    color: #f0f0f0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    width: 150vw;
    height: 150vh;
    top: -25vh;
    left: -25vw;
    z-index: -1;
    background: linear-gradient(217deg, rgba(0, 30, 60, .05), rgba(0, 0, 0, 0) 70.71%),
    linear-gradient(127deg, rgba(0, 60, 90, .05), rgba(0, 0, 0, 0) 70.71%),
    linear-gradient(336deg, rgba(0, 20, 40, .05), rgba(0, 0, 0, 0) 70.71%);
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(1deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* 终端容器 */
.terminal-container {
    width: 100%;
    max-width: 1200px;
    height: 96vh;
    background-color: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.5s ease-out;
    position: relative;
    margin: 0 auto;
}

.terminal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, #78ccf0, #00ff9d);
    z-index: 10;
    opacity: 0.7;
}

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

/* 终端头部 */
.terminal-header {
    background: linear-gradient(to right, #1a1a1a, #2c2c2c);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 5;
    flex-wrap: wrap;
    gap: 10px;
}

.terminal-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(120, 204, 240, 0.3), transparent);
}

.terminal-title {
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 10px rgba(120, 204, 240, 0.5);
    letter-spacing: 1px;
    position: relative;
    padding-left: 24px;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-title::before {
    content: '>';
    position: absolute;
    left: 0;
    color: #00ff9d;
    font-weight: bold;
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.terminal-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.terminal-btn {
    background: rgba(70, 70, 70, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    min-width: 60px;
    text-align: center;
}

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

.terminal-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.terminal-btn:hover {
    background: rgba(90, 90, 90, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

.terminal-btn:hover::after {
    opacity: 1;
    transform: scale(1);
}

.terminal-btn:active {
    transform: translateY(1px);
}

.terminal-btn i {
    margin-right: 5px;
    font-size: 11px;
}

/* 终端主体 */
.terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.7);
    background-image: radial-gradient(rgba(0, 30, 60, 0.1) 1px, transparent 1px),
    radial-gradient(rgba(0, 30, 60, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    position: relative;
}

.terminal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(rgba(0, 10, 20, 0) 50%, rgba(0, 30, 60, 0.15) 50%);
    background-size: 100% 4px;
    z-index: 1;
    opacity: 0.3;
}

.terminal-body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), transparent);
    pointer-events: none;
    z-index: 2;
}

.terminal-content {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #d0d0d0;
    white-space: pre-wrap;
    word-break: break-all;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    position: relative;
    z-index: 2;
}

.terminal-content::after {
    content: '|';
    display: inline-block;
    color: #78ccf0;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
    font-weight: bold;
}

/* 终端底部 */
.terminal-footer {
    background: linear-gradient(to right, #1a1a1a, #2c2c2c);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
    position: relative;
    flex-wrap: wrap;
    gap: 8px;
}

.terminal-footer::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(120, 204, 240, 0.2), transparent);
}

.status {
    color: #00ff9d;
    font-weight: 500;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 18px;
}

.status::before {
    content: '';
    position: absolute;
    left: 0;
    width: 10px;
    height: 10px;
    background-color: #00ff9d;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff9d;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.status.error {
    color: #ff5555;
}

.status.error::before {
    background-color: #ff5555;
    box-shadow: 0 0 10px #ff5555;
    animation: error-pulse 1s infinite;
}

@keyframes error-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.status.paused {
    color: #ffcc00;
}

.status.paused::before {
    background-color: #ffcc00;
    box-shadow: 0 0 10px #ffcc00;
    animation: none;
}

.terminal-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-item {
    color: #78ccf0;
    opacity: 0.8;
}

.stat-divider {
    color: rgba(255, 255, 255, 0.2);
}

.log-path {
    color: #78ccf0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
    opacity: 0.8;
    min-width: 0;
    flex: 1;
}

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

::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #444, #333);
    border-radius: 5px;
    border: 2px solid rgba(30, 30, 30, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #555, #444);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* 日志内容样式 */
.log-error {
    color: #ff5555;
    text-shadow: 0 0 5px rgba(255, 85, 85, 0.5);
}

.log-warning {
    color: #ffcc00;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

.log-info {
    color: #78ccf0;
    text-shadow: 0 0 5px rgba(120, 204, 240, 0.5);
}

.log-success {
    color: #00ff9d;
    text-shadow: 0 0 5px rgba(0, 255, 157, 0.5);
}

/* 添加打字机效果的动画 */
@keyframes typing {
    from {
        width: 0
    }
    to {
        width: 100%
    }
}

/* 添加闪烁光标效果 */
@keyframes blink-caret {
    from, to {
        border-color: transparent
    }
    50% {
        border-color: #78ccf0
    }
}


/* 媒体查询 - 针对不同屏幕尺寸优化 */
@media (max-width: 768px) {

    .terminal-container {
        width: 95%;
        height: 96vh;
    }

    .terminal-title {
        font-size: 0.9rem;
    }

    .terminal-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    .log-content {
        font-size: 13px;
    }
}

@media (max-width: 480px) {

    .terminal-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .terminal-container {
        width: 96%;
        height: 96vh;
    }

    .terminal-title {
        font-size: 0.8rem;
        padding-left: 18px;
    }

    .terminal-title::before {
        width: 10px;
        height: 10px;
    }

    .terminal-btn {
        padding: 4px 6px;
        font-size: 10px;
        min-width: 50px;
    }

    .log-content {
        font-size: 12px;
        padding: 10px;
    }

    .terminal-stats {
        font-size: 10px;
    }
}
