/* 终端科技风格样式 - 优化版 */

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

body {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.03) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0a 0%, #0f0f0f 25%, #1a1a1a 75%, #0f0f0f 100%);
    color: #00ff41;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 0, 0.03) 2px,
            rgba(0, 255, 0, 0.03) 4px
        );
    pointer-events: none;
    z-index: 1;
}

/* 容器布局 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

/* 面板样式 */
.panel {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.3),
        inset 0 0 20px rgba(0, 255, 65, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
    animation: scan 4s infinite;
}

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

.panel:hover {
    border-color: #00ff00;
    box-shadow: 
        0 0 30px rgba(0, 255, 0, 0.4),
        inset 0 0 30px rgba(0, 255, 0, 0.15),
        0 6px 16px rgba(0, 0, 0, 0.6);
}

/* 面板标题样式 */
.panel h2 {
    color: #00ff41;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding: 0 0 8px 0;
    border-bottom: 2px solid rgba(0, 255, 65, 0.5);
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

/* 控制按钮区域 */
.control {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* 按钮基础样式 */
button {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border: 2px solid #00ff41;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: #00ff41;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

button:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: #00ff00;
    color: #00ff00;
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(74, 222, 128, 0.3);
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}

/* 按钮类型样式 */
.btn-import {
    border-color: #60a5fa;
    color: #60a5fa;
}

.btn-import:hover {
    background: rgba(96, 165, 250, 0.1);
    border-color: #93c5fd;
    color: #93c5fd;
    box-shadow: 0 4px 8px rgba(96, 165, 250, 0.2);
}

.btn-export {
    border-color: #fbbf24;
    color: #fbbf24;
}

.btn-export:hover {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fcd34d;
    color: #fcd34d;
    box-shadow: 0 4px 8px rgba(251, 191, 36, 0.2);
}

.btn-clear {
    border-color: #f87171;
    color: #f87171;
}

.btn-clear:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: #fca5a5;
    color: #fca5a5;
    box-shadow: 0 4px 8px rgba(248, 113, 113, 0.2);
}

/* 转换面板 */
.convert-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    grid-column: 2;
    grid-row: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #c084fc;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 
        0 4px 12px rgba(192, 132, 252, 0.15),
        inset 0 1px 0 rgba(192, 132, 252, 0.1);
}

.convert-panel h2 {
    color: #c084fc;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    text-align: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-convert {
    width: 120px;
    height: 50px;
    font-size: 14px;
    font-weight: 700;
    border-color: #c084fc;
    color: #c084fc;
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 12px rgba(192, 132, 252, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-convert::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(192, 132, 252, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.btn-convert:hover::before {
    width: 100%;
    height: 100%;
}

.btn-convert:hover {
    background: rgba(192, 132, 252, 0.1);
    border-color: #d8b4fe;
    color: #d8b4fe;
    box-shadow: 0 6px 16px rgba(192, 132, 252, 0.3);
    transform: translateY(-2px) scale(1.05);
}

.btn-convert:active {
    transform: translateY(0) scale(1);
}

/* 文本区域 */
.text-area {
    width: 100%;
    height: 400px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff41;
    border-radius: 4px;
    color: #00ff41;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 16px;
    resize: none;
    outline: none;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 
        inset 0 0 20px rgba(0, 255, 65, 0.1),
        0 0 15px rgba(0, 255, 65, 0.2);
    transition: all 0.2s ease;
}

.text-area:focus {
    border-color: #00ff00;
    box-shadow: 
        inset 0 0 25px rgba(0, 255, 0, 0.15),
        0 0 20px rgba(0, 255, 0, 0.3);
}

.text-area::placeholder {
    color: rgba(74, 222, 128, 0.4);
    font-style: italic;
}

/* 日志面板 */
.log-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #4ade80;
    border-radius: 6px;
    padding: 16px;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 
        0 4px 12px rgba(74, 222, 128, 0.15),
        inset 0 1px 0 rgba(74, 222, 128, 0.1);
}

.log-list {
    list-style: none;
    font-size: 13px;
    line-height: 1.5;
}

.log-list li {
    margin-bottom: 6px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(74, 222, 128, 0.15);
    display: flex;
    gap: 12px;
    transition: background-color 0.1s ease;
}

.log-list li:hover {
    background-color: rgba(74, 222, 128, 0.05);
    border-radius: 3px;
    padding-left: 4px;
    padding-right: 4px;
}

.log-time {
    color: #60a5fa;
    font-weight: 500;
    min-width: 160px;
    font-size: 12px;
}

.log-message {
    color: #4ade80;
    flex: 1;
}

/* 错误日志样式 */
.log-error {
    border-radius: 3px;
    margin: 2px 0;
}

.log-error .log-time {
    color: #ff6b6b;
}

.log-error .log-message {
    color: #ff6b6b;
    font-weight: bold;
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.5);
    border-radius: 4px;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 222, 128, 0.7);
}

/* 文本区域专用滚动条 */
.text-area::-webkit-scrollbar {
    width: 8px;
}

.text-area::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin: 4px 0;
}

.text-area::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, 0.6);
    border-radius: 4px;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.text-area::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 222, 128, 0.8);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 16px;
    }
    
    .convert-panel {
        grid-column: 1;
        grid-row: 2;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 20px;
        padding: 16px;
    }
    
    .convert-panel h2 {
        order: 2;
        margin: 0 10px;
    }
    
    .btn-convert:first-of-type {
        order: 1;
    }
    
    .btn-convert:last-of-type {
        order: 3;
    }
    
    .log-panel {
        grid-column: 1;
        grid-row: 4;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 13px;
    }
    
    .container {
        padding: 12px;
        gap: 12px;
    }
    
    .control {
        flex-direction: column;
        gap: 8px;
    }
    
    button {
        width: 100%;
        font-size: 13px;
        padding: 12px 16px;
    }
    
    .convert-panel {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .convert-panel h2 {
        order: 0;
        margin: 0 0 8px 0;
    }
    
    .btn-convert {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .btn-convert {
        width: 100px;
        height: 45px;
        font-size: 12px;
    }
    
    .text-area {
        height: 350px;
        font-size: 13px;
    }
    
    .log-panel {
        max-height: 140px;
    }
    
    .log-list {
        font-size: 12px;
    }
}

/* 加载动画 */
@keyframes loading {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #4ade80;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: loading 1s linear infinite;
}

/* 成功/错误状态 */
.success {
    border-color: #4ade80 !important;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3) !important;
}

.error {
    border-color: #f87171 !important;
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3) !important;
}

/* 禁用状态 */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

button:disabled:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: #4ade80;
    color: #4ade80;
    box-shadow: none;
}

/* 焦点可访问性 */
button:focus-visible {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}

.text-area:focus-visible {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
}
