/* 通用样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
}

.language-selector select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.language-selector select:focus {
    outline: none;
    border-color: #667eea;
}

/* 主要内容区域 */
main {
    display: grid;
    gap: 30px;
}

/* 输入区域 */
.input-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.input-method-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-button:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.input-content {
    display: none;
}

.input-content.active {
    display: block;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 文件拖拽区域 */
.file-drop-zone {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    background: rgba(102, 126, 234, 0.02);
}

.file-drop-zone.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: #667eea;
}

.drop-zone-content p {
    color: #666;
    font-size: 18px;
    margin: 0;
}

.select-file-btn, .decode-btn, .action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: none;
}

.decode-btn, .action-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.select-file-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.action-btn.secondary {
    background: #6c757d;
}

.decode-btn:hover, .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.select-file-btn:hover {
    background: #667eea;
    color: white;
}

/* 结果区域 */
.result-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.result-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.result-content {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border-left: 5px solid #667eea;
    margin-bottom: 20px;
}

.result-field {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.result-field:last-child {
    border-bottom: none;
}

.field-label {
    font-weight: 600;
    color: #495057;
}

.field-value-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.field-value {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    word-break: break-all;
    flex: 1;
}

.field-value.highlight {
    background: #e7f3ff;
    border-color: #667eea;
}

.copy-field-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    color: #6c757d;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-field-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: scale(1.1);
}

.result-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* 错误区域 */
.error-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-left: 5px solid #dc3545;
}

.error-content h3 {
    color: #dc3545;
    margin-bottom: 10px;
}

.error-content p {
    color: #6c757d;
    line-height: 1.6;
}

/* 页脚信息 */
footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-top: 30px;
}

.info-section h3, .format-info h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.info-section p {
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.7;
}

.format-info ul {
    list-style: none;
    padding-left: 0;
}

.format-info li {
    padding: 8px 0;
    color: #6c757d;
    border-bottom: 1px solid #f0f0f0;
}

.format-info li:before {
    content: "▶ ";
    color: #667eea;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .input-section, .result-section, footer {
        padding: 20px;
    }
    
    .result-field {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .field-value-container {
        flex-direction: row;
        align-items: stretch;
    }
    
    .copy-field-btn {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .field-label {
        font-size: 14px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .input-method-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: none;
        border-right: 3px solid transparent;
        text-align: left;
    }
    
    .tab-button.active {
        border-right-color: #667eea;
        border-bottom-color: transparent;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section, .error-section {
    animation: fadeIn 0.5s ease-out;
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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