/* Base64 编码/解码器样式 */
:root {
    --primary-color: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary-color: #4cc9f0;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --text-color: #333;
    --text-light: #666;
    --background-color: #f9f9f9;
    --card-background: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #4cc9f0;
    --primary-dark: #4895ef;
    --secondary-color: #7209b7;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --error-color: #f43f5e;
    --text-color: #f0f0f0;
    --text-light: #b0b0b0;
    --background-color: #1a1a2e;
    --card-background: #16213e;
    --border-color: #0f3460;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="solarized"] {
    --primary-color: #268bd2;
    --primary-dark: #1b6ac9;
    --secondary-color: #859900;
    --success-color: #2aa198;
    --warning-color: #cb4b16;
    --error-color: #dc322f;
    --text-color: #657b83;
    --text-light: #839496;
    --background-color: #fdf6e3;
    --card-background: #ffffff;
    --border-color: #eee8d5;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

[data-theme="monokai"] {
    --primary-color: #66d9ef;
    --primary-dark: #53c6e1;
    --secondary-color: #a6e22e;
    --success-color: #ae81ff;
    --warning-color: #e6db74;
    --error-color: #f92672;
    --text-color: #f8f8f2;
    --text-light: #a59f85;
    --background-color: #272822;
    --card-background: #2d2e27;
    --border-color: #3e3d32;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 工具区域 */
.tool-section {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

/* 标签页样式 */
.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-right: 0.5rem;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* 面板样式 */
.panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.panel.active {
    display: block;
}

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

/* 编辑器容器 */
.editor-container {
    margin-bottom: 1.5rem;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.editor-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* 输入区域 */
textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    background-color: var(--card-background);
    color: var(--text-color);
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

textarea::placeholder {
    color: var(--text-light);
}

/* 输出区域 */
.output-box {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    background-color: var(--card-background);
    color: var(--text-color);
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    transition: var(--transition);
}

.output-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* 文件处理区域 */
.file-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    background-color: var(--background-color);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.05);
}

.file-input {
    display: none;
}

.file-label {
    display: block;
    cursor: pointer;
    padding: 1rem;
    transition: var(--transition);
}

.file-label:hover {
    color: var(--primary-color);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text p {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.sub-text {
    font-size: 0.9rem;
    color: var(--text-light) !important;
}

/* 文件设置 */
.file-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: 8px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-group label {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
}

.setting-group select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--card-background);
    color: var(--text-color);
    font-size: 0.9rem;
    transition: var(--transition);
}

.setting-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 文件操作按钮 */
.file-actions {
    display: flex;
    gap: 1rem;
}

/* 文件列表 */
.file-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background-color: var(--background-color);
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--card-background);
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    font-size: 1.25rem;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-light);
}

.remove-file {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 0.25rem;
    transition: var(--transition);
}

.remove-file:hover {
    color: #c0392b;
    transform: scale(1.1);
}

.empty-message {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    margin: 0;
}

/* 文件结果区域 */
.file-result {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 辅助功能区域 */
.tools-section {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.tools-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.tool-btn {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-background);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.tool-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 统计信息区域 */
.stats-section {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background-color: var(--background-color);
    border-radius: 8px;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 使用说明区域 */
.info-section {
    background-color: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.info-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.info-content {
    line-height: 1.7;
    color: var(--text-color);
}

.info-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.info-content p {
    margin-bottom: 1rem;
}

.info-content ol,
.info-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.info-content li {
    margin-bottom: 0.5rem;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    opacity: 1;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.notification.success {
    background-color: var(--success-color);
}

.notification.error {
    background-color: var(--error-color);
}

.notification.warning {
    background-color: var(--warning-color);
}

.notification.info {
    background-color: var(--primary-color);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background-color: var(--card-background);
    margin: 10% auto;
    padding: 0;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--error-color);
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* 辅助工具模态框内容 */
.modal-tool {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-tool h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.modal-tool textarea {
    width: 100%;
    min-height: 150px;
}

.modal-tool .output-box {
    width: 100%;
    min-height: 100px;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--primary-color);
    color: white;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background-color: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background-color: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tool-section,
    .tools-section,
    .stats-section,
    .info-section {
        padding: 1.5rem;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1;
        min-width: 80px;
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .editor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .file-settings {
        grid-template-columns: 1fr;
    }
    
    .file-actions {
        flex-direction: column;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .tool-section,
    .tools-section,
    .stats-section,
    .info-section {
        padding: 1rem;
    }
    
    .tabs {
        flex-direction: column;
        border-bottom: none;
    }
    
    .tab {
        border-bottom: 1px solid var(--border-color);
        margin-right: 0;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        font-size: 0.9rem;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* 数据URL和JSON格式的代码高亮 */
.output-box[data-type="dataUrl"] {
    color: var(--primary-color);
    font-weight: 500;
}

.output-box[data-type="json"] {
    color: var(--secondary-color);
}

/* 进度指示器 */
.progress-container {
    position: relative;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
    min-width: 2px;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}