/* AES 加密解密工具样式 */

/* 主容器布局 */
.aes-container {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 20px;
}

/* 左侧输入区域 */
.aes-input-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    overflow: hidden;
}

/* 右侧输出区域 */
.aes-output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    overflow: hidden;
}

/* 编辑器容器 */
.aes-editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 加密选项区域 */
.encryption-options-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.encryption-options-header {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.options-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* 加密算法和模式合并行 */
.encryption-config-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

/* 加密算法选择块 */
.encryption-algorithm-block {
    flex: 1;
}

.algorithm-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.algorithm-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.algorithm-select:focus {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* 加密模式选择块 */
.encryption-mode-block {
    flex: 1;
}

.mode-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

.mode-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.mode-select:focus {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* 信息提示图标 */
.info-tip {
    font-size: 12px;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.info-tip:hover {
    opacity: 1;
}

/* 密钥输入块 */
.key-input-block {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 12px;
}

.key-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.key-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.key-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 密钥位数下拉框 */
.key-size-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s ease;
    cursor: pointer;
    min-width: 140px;
}

.key-size-select:hover {
    border-color: var(--accent-light);
}

.key-size-select:focus {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.key-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s ease;
}

.key-input:focus {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.key-input::placeholder {
    color: var(--text-muted);
}

.key-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.6;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
    min-height: 180px;
}

.key-textarea:focus {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.key-textarea::placeholder {
    color: var(--text-muted);
}

.key-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.key-status {
    font-size: 12px;
    font-weight: 500;
}

.key-status.key-valid {
    color: #10b981;
}

.key-status.key-invalid {
    color: #ef4444;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.label-row label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.label-row label small {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 8px;
}

.key-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.key-input-wrapper {
    position: relative;
}

.key-result-section {
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.key-result-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-result-section pre {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.key-result-section pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.key-result-section pre::-webkit-scrollbar-track {
    background: transparent;
}

.key-result-section pre::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.key-result-section pre::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 结果显示样式 */
.result-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.encrypted-result,
.decrypted-result {
    flex: 1;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.6;
    word-break: break-all;
    white-space: pre-wrap;
    overflow-y: auto;
}


.result-fade-in {
    animation: fadeIn 0.3s ease;
}

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

/* 统计信息样式 */
.stats-section {
    margin-top: 16px;
    padding: 12px;
}

.stats-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    flex-wrap: nowrap;
    justify-content: space-between;
}

.stat-item {

    align-items: flex-start;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
    text-align: left;
}

.stat-label {
    font-weight: 500;
    font-size: 11px;
    white-space: nowrap;
    color: var(--text-tertiary);
}

.stat-value {
    font-weight: 600;
    font-family: var(--font-family-mono);
    font-size: 11px;
    white-space: nowrap;
    color: var(--text-tertiary);
}

/* 响应式：小屏幕时统计信息纵向排列 */
@media (max-width: 1300px) {
    .info-tip{
        font-size: 10px;
    }
    .algorithm-label, .mode-label , .key-label, .label-row label{
        font-size: 12px;
    }
    #paddingSelect{
        width: 50px;
    }
}

.key-info {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.key-length-info {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-family-mono);
}

.key-length-valid {
    color: var(--accent-light);
}

.key-length-invalid {
    color: var(--error-color);
}

.encryption-config-block {
    padding: 12px 0px;
}

/* 结果查看器 */
.aes-result {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    overflow-wrap: break-word;
}

.result-viewer {
    overflow: auto;
    padding: 0;
    margin: 0;
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
}

#resultOutput {
    background-color: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-family: var(--font-family-mono);
    font-size: 14px;
    line-height: 1.4;
    overflow-x: auto;
    min-height: 200px;
    max-height: 670px;
}

.resize-handle {
    width: 12px;
    background-color: var(--bg-primary);
    cursor: col-resize;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    min-width: 8px;
    flex-shrink: 0;
}

.resize-line {
    width: 2px;
    height: 60px;
    background-color: var(--border-color);
    border-radius: 1px;
    transition: background-color 0.2s ease;
}

.resize-handle:hover .resize-line {
    background-color: var(--text-primary);
}

.resize-handle:active .resize-line {
    background-color: var(--text-primary);
}

/* 结果占位符 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}

.placeholder-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.4;
    color: var(--text-muted);
}

.placeholder-text {
    font-size: 14px;
    max-width: 280px;
    line-height: 1.4;
    color: var(--text-muted);
    font-weight: 400;
}

/* 错误信息样式 */
.aes-error {
    background-color: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 16px;
}

.aes-error h4 {
    color: var(--error-color);
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #3c1b1a;
}

.aes-error h4::before {
    font-size: 18px;
}

.aes-error .error-message {
    display: block;
    margin-top: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    border-left: none;
    padding: 15px 0px;
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.5;
}

/* 结果内容样式 */
.result-content {
    font-family: var(--font-family-mono);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 16px;
    margin: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    width: 100%;
    min-height: 120px;
}

/* 成功状态样式 */
.result-success {
    border-left: 3px solid var(--success-color);
    background: rgba(16, 185, 129, 0.05);
}

/* 加密结果样式 */

/* 解密结果样式 */
.decrypted-result {
    color: var(--accent-light);
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid var(--accent-color);
    margin-bottom: 8px;
}

/* 结果区域整体样式 */
.result-section {
    padding: 12px;
}

/* 结果标题 */
.result-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

/* 统计区域整体样式 */
.stats-section {
    margin-top: 16px;
    padding: 12px;
}

/* 统计标题 */
.stats-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

/* 结果统计信息 */
.result-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    flex-wrap: nowrap;
    justify-content: space-between;
}

.stat-item {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1 1 0;
    min-width: 0;
    text-align: left;
}

.stat-label {
    font-weight: 500;
    font-size: 11px;
    white-space: nowrap;
    color: var(--text-tertiary);
}

.stat-value {
    font-weight: 600;
    font-family: var(--font-family-mono);
    font-size: 11px;
    white-space: nowrap;
    color: var(--text-tertiary);
}

/* 加密结果样式 */
.encrypted-result {
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.5;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
    color: var(--accent-light);
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--success-color);
    margin-bottom: 8px;
}

/* 动画效果 */
.result-fade-in {
    animation: fadeInResult 0.3s ease-in-out;
}

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

/* 处理状态指示器 */
.processing-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 14px;
}

.processing-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    border-top-color: var(--accent-light);
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 文档区域样式 */
.character-set {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
    border: 1px solid var(--border-color);
}

.charset-item {
    margin-bottom: 16px;
}

.charset-item:last-child {
    margin-bottom: 0;
}

.charset-item h4 {
    color: var(--accent-light);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.charset-item code {
    display: block;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 6px;
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 8px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.charset-item p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 8px 0 0 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .aes-container {
        flex-direction: column;
        height: auto;
    }
    
    .aes-input-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .resize-handle {
        display: none;
    }
    
    .encryption-options-section {
        padding: 12px;
        margin-top: 8px;
    }
    
    .options-title {
        font-size: 14px;
    }
    
    /* 移动端：算法和模式垂直排列 */
    .encryption-config-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .mode-select {
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .key-input-block {
        padding: 10px;
    }
    
    .key-input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .key-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .key-size-select {
        min-width: 120px;
        font-size: 11px;
    }
    
    .key-input {
        font-size: 12px;
        padding: 10px;
    }
    
    .result-title {
        font-size: 12px;
        margin-bottom: 6px;
        padding-bottom: 4px;
    }
    
    .encrypted-result {
        font-size: 12px;
        padding: 10px;
    }
    
    .stats-section {
        padding: 8px;
        margin-top: 12px;
    }
    
    .stats-title {
        font-size: 12px;
        margin-bottom: 6px;
        padding-bottom: 4px;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .stat-item {
        justify-content: space-between;
        flex: none;
    }
    
    #algorithmSelect {
        min-width: 150px;
        margin-right: 4px;
    }
}

/* AES优势展示 */
.image-base64-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.benefit-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.benefit-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.benefit-item h4 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.benefit-item p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* 高对比度模式适配 */
@media (prefers-contrast: high) {
    .result-viewer {
        border: 2px solid var(--border-color);
    }
    
    .encrypted-result {
        border-width: 2px;
    }
    
    .aes-error {
        border-width: 2px;
    }
    
    .benefit-item {
        border: 2px solid var(--border-color);
    }
    
    .key-input {
        border-width: 2px;
    }
}

/* 减少动画模式适配 */
@media (prefers-reduced-motion: reduce) {
    .result-fade-in,
    .processing-spinner {
        animation: none;
    }
}

/* ========== 新增样式：高级配置区域 ========== */

/* 密钥信息栏 */
.key-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-size: 12px;
}

.key-format-toggle {
    display: flex;
    gap: 12px;
    align-items: center;
}

.key-format-toggle label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.key-format-toggle label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.key-format-toggle input[type="radio"] {
    margin: 0;
}

.key-info-left, .key-info-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.key-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.key-status.valid {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.key-status.invalid {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.key-status.warning {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

/* 高级选项区域 */
.advanced-options-block {
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.advanced-options-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.advanced-options-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s;
}

.advanced-options-toggle.expanded .toggle-icon {
    transform: rotate(-180deg);
}

.toggle-text {
    font-weight: 500;
    font-size: 14px;
}

.toggle-hint {
    color: var(--text-secondary);
    font-size: 12px;
    opacity: 0.7;
}

.advanced-options-content {
    margin-top: 16px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 2000px;
        transform: translateY(0);
    }
}

/* 选项行 */
.option-row {
    display: flex;
    margin-bottom: 20px;
    gap: 16px;
}

.option-label {
    flex: 0 0 120px;
    font-weight: 500;
    padding-top: 8px;
    color: var(--text-primary);
    font-size: 13px;
}

.option-control {
    flex: 1;
}

.required-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* 单选按钮组 */
.radio-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 20px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.radio-option input[type="radio"] {
    margin: 0;
}

/* 选项选择器 */
.option-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
}

.option-select:focus {
    border-color: var(--accent-light);
    outline: none;
}

/* IV输入组 */
.iv-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.iv-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    font-size: 13px;
}

.iv-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
}

.iv-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
}

.checkbox-option input[type="checkbox"] {
    margin: 0;
}

.iv-status {
    font-size: 11px;
    color: var(--text-secondary);
}

.iv-hint, .option-hint {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(33, 150, 243, 0.1);
    border-left: 3px solid #2196f3;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 编码配置 */
.encoding-control {
    display: flex;
    gap: 24px;
}

.encoding-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.encoding-label {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 70px;
}

.encoding-hint {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-left: 4px;
}

.encoding-select {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

/* 模板按钮 */
.template-control {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-template {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
    min-width: 160px;
}

.btn-template:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-light);
    transform: translateY(-2px);
}

.template-desc {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* 代码查看模态框 */
.code-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 通用弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.modal-hint {
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.modal-hint strong {
    color: var(--text-primary);
}

.modal-hint ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.key-pair-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.key-pair-item h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.key-output {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
}

.key-output:focus {
    outline: none;
    border-color: var(--accent-light);
}

/* 代码弹窗样式 */
.code-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.code-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

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

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

.code-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.code-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.code-language-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.code-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.code-tab.active {
    color: var(--accent-light);
    border-bottom-color: var(--accent-light);
}

.code-display-area {
    flex: 1;
    overflow: auto;
    padding: 20px 24px;
}

.code-display-area pre {
    margin: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 16px;
}

.code-display-area code {
    font-family: var(--font-family-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

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

/* 响应式适配 */
@media (max-width: 768px) {
    .key-info-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .option-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .option-label {
        flex: none;
        padding-top: 0;
    }
    
    .radio-option {
        display: flex;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .encoding-control {
        flex-direction: column;
        gap: 12px;
    }
    
    .template-control {
        flex-direction: column;
    }
    
    .btn-template {
        width: 100%;
    }
    
    .code-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .code-language-tabs {
        overflow-x: auto;
    }
}
