/* ==============================================
   AES加密解密工具专用样式
   所有样式限定在 .tool-page 作用域内
   ============================================== */

/* ========== 操作模式切换按钮 ========== */
.tool-page .mode-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.tool-page .mode-btn {
    flex: 1;
    max-width: 200px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-page .mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tool-page .mode-btn.active[data-mode="encrypt"] {
    background: linear-gradient(135deg, #4285f4 0%, #357ae8 100%);
    border-color: #4285f4;
    color: #fff;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.tool-page .mode-btn.active[data-mode="decrypt"] {
    background: linear-gradient(135deg, #34a853 0%, #2d8e47 100%);
    border-color: #34a853;
    color: #fff;
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
}

/* ========== 参数配置面板 ========== */
.tool-page .config-panel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    border: 1px solid #e9ecef;
}

.tool-page .config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-page .config-item label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-page .config-item label i {
    color: #4285f4;
    font-size: 14px;
}

.tool-page .config-item select {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-page .config-item select:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.tool-page .config-item input[type="text"] {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    color: #495057;
    transition: all 0.2s ease;
    font-family: 'Courier New', monospace;
}

.tool-page .config-item input[type="text"]:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.tool-page .config-item input[type="text"]:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

.tool-page .config-item .hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: -4px;
}

.tool-page .config-item .hint-warning {
    font-size: 12px;
    color: #ff6b6b;
    font-weight: 600;
    margin-top: 4px;
}

/* ========== 密钥输入组 ========== */
.tool-page .input-group {
    display: flex;
    gap: 8px;
}

.tool-page .input-group input {
    flex: 1;
}

.tool-page .input-group .generate-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #4285f4 0%, #357ae8 100%);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-page .input-group .generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.tool-page .input-group .generate-btn i {
    font-size: 16px;
}

/* ========== IV控制区域 ========== */
.tool-page .iv-control {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.tool-page .radio-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.tool-page .radio-inline input[type="radio"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.tool-page .radio-inline span {
    font-size: 14px;
    color: #495057;
}

/* ========== 输入输出区域 ========== */
.tool-page .io-section {
    margin-bottom: 20px;
}

.tool-page .io-section label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-page .io-section label i {
    color: #4285f4;
}

.tool-page .io-section .iv-display-label {
    color: #ff6b6b;
}

.tool-page .io-section .iv-display-label i {
    color: #ff6b6b;
}

.tool-page .io-section textarea {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: all 0.2s ease;
}

.tool-page .io-section textarea:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.tool-page .io-section textarea[readonly] {
    background: #f8f9fa;
}

.tool-page .output-wrapper {
    position: relative;
}

.tool-page .output-wrapper textarea,
.tool-page .output-wrapper input[type="text"] {
    padding-right: 60px; /* 为复制按钮留空间 */
}

/* ========== 执行按钮 ========== */
.tool-page .execute-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #4285f4 0%, #357ae8 100%);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}

.tool-page .execute-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 133, 244, 0.3);
}

.tool-page .execute-btn:active {
    transform: translateY(0);
}

/* 解密模式按钮变绿色 */
.tool-page .execute-btn.decrypt-mode {
    background: linear-gradient(135deg, #34a853 0%, #2d8e47 100%);
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.2);
}

.tool-page .execute-btn.decrypt-mode:hover {
    box-shadow: 0 6px 16px rgba(52, 168, 83, 0.3);
}

/* ========== 复制按钮 ========== */
.tool-page .copy-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #4285f4;
    border-radius: 6px;
    background: #fff;
    color: #4285f4;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-page .copy-btn:hover {
    background: #4285f4;
    color: #fff;
    transform: translateY(-50%) translateY(-1px);
}

.tool-page .copy-btn.copied {
    background: #34a853;
    border-color: #34a853;
    color: #fff;
}

/* ========== IV输入框高亮效果 ========== */
.tool-page .config-item input[type="text"].iv-highlighted {
    border-color: #34a853 !important;
    background-color: #f0fff4 !important;
    transition: all 0.3s ease;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .tool-page .mode-selector {
        flex-direction: column;
    }

    .tool-page .mode-btn {
        max-width: 100%;
    }

    .tool-page .config-panel {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }

    .tool-page .iv-control {
        flex-direction: column;
        gap: 8px;
    }

    .tool-page .execute-btn {
        font-size: 15px;
        padding: 12px 20px;
    }

    .tool-page .copy-btn {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .tool-page .output-wrapper textarea,
    .tool-page .output-wrapper input[type="text"] {
        padding-right: 12px;
    }
}

@media (max-width: 480px) {
    .tool-page .config-item label {
        font-size: 13px;
    }

    .tool-page .config-item select,
    .tool-page .config-item input[type="text"] {
        font-size: 13px;
        padding: 8px 10px;
    }

    .tool-page .io-section textarea {
        font-size: 13px;
    }
}
