/* MD5加密工具专用样式 */

/* ===== 输入类型选择器 ===== */
.input-type-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.type-radio {
    flex: 1;
    cursor: pointer;
}

.type-radio input[type="radio"] {
    display: none;
}

.type-radio .radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    color: #495057;
}

.type-radio .radio-label i {
    font-size: 20px;
}

.type-radio input[type="radio"]:checked + .radio-label {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.type-radio:hover .radio-label {
    border-color: #4a90e2;
    transform: translateY(-2px);
}

/* ===== 输入区域 ===== */
.input-section {
    margin-bottom: 24px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.input-label i {
    color: #4a90e2;
}

/* 文本输入框 */
.md5-textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: vertical;
    transition: all 0.3s ease;
}

.md5-textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.md5-textarea::placeholder {
    color: #adb5bd;
}

/* 文件上传区域 */
.file-upload-area {
    position: relative;
    border: 2px dashed #ced4da;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #4a90e2;
    background: #e7f3ff;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-tip {
    pointer-events: none;
}

.file-upload-tip i {
    font-size: 48px;
    color: #4a90e2;
    margin-bottom: 16px;
}

.file-upload-tip p {
    margin: 8px 0;
    color: #495057;
    font-size: 15px;
}

.file-size-tip {
    font-size: 13px !important;
    color: #6c757d !important;
}

/* 文件信息显示 */
.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #e7f3ff;
    border: 1px solid #4a90e2;
    border-radius: 12px;
    margin-top: 16px;
}

.file-info i {
    font-size: 24px;
    color: #28a745;
}

.file-info span {
    font-size: 14px;
    color: #2c3e50;
}

#file-size {
    margin-left: auto;
    font-weight: 600;
    color: #6c757d;
}

/* ===== 输出格式选项 ===== */
.output-options {
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.option-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.option-title i {
    color: #4a90e2;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4a90e2;
}

.checkbox-label {
    font-size: 15px;
    color: #495057;
    user-select: none;
}

/* ===== 操作按钮 ===== */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* ===== 结果区域 ===== */
.result-container {
    margin-bottom: 32px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
}

.result-header i {
    font-size: 24px;
    color: #28a745;
}

.result-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-item {
    padding: 16px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.result-label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.result-value {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.result-value code {
    flex: 1;
    padding: 12px;
    background: #f1f3f5;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: #e83e8c;
    word-break: break-all;
    border: 1px solid #e9ecef;
}

.result-value .copy-btn {
    padding: 8px 16px;
    background: #4a90e2;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.result-value .copy-btn:hover {
    background: #357abd;
    transform: scale(1.05);
}

.result-original {
    font-size: 13px;
    color: #6c757d;
}

/* ===== 历史记录控制 ===== */
.history-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.history-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.history-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4a90e2;
}

.history-checkbox span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: #495057;
    user-select: none;
}

.history-checkbox i {
    color: #4a90e2;
}

.btn-outline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #ffffff;
    border: 2px solid #4a90e2;
    border-radius: 8px;
    color: #4a90e2;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-outline:hover {
    background: #4a90e2;
    color: #ffffff;
    transform: translateY(-2px);
}

.privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background: #e7f3ff;
    border-left: 4px solid #4a90e2;
    border-radius: 6px;
    font-size: 13px;
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

.privacy-note i {
    color: #4a90e2;
    margin-top: 2px;
}

/* ===== 历史记录模态框 ===== */
.md5-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 2px solid #e9ecef;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.modal-header i {
    color: #4a90e2;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    color: #6c757d;
}

.modal-close:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

#history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.history-type {
    padding: 4px 12px;
    background: #4a90e2;
    color: #ffffff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.history-time {
    font-size: 13px;
    color: #6c757d;
}

.history-value {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.history-value code {
    flex: 1;
    padding: 10px;
    background: #ffffff;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #e83e8c;
    word-break: break-all;
    border: 1px solid #dee2e6;
}

.history-value .copy-btn {
    padding: 6px 14px;
    background: #4a90e2;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.history-value .copy-btn:hover {
    background: #357abd;
}

.history-original {
    font-size: 13px;
    color: #6c757d;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #adb5bd;
    font-size: 15px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
}

.btn-danger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #dc3545;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* ===== 消息提示 ===== */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.message-success {
    border-left: 4px solid #28a745;
    color: #28a745;
}

.message-error {
    border-left: 4px solid #dc3545;
    color: #dc3545;
}

.message-info {
    border-left: 4px solid #17a2b8;
    color: #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .input-type-selector {
        flex-direction: column;
        gap: 12px;
    }

    .type-radio .radio-label {
        padding: 14px 20px;
        font-size: 15px;
    }

    .type-radio .radio-label i {
        font-size: 18px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 24px;
    }

    .history-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-outline {
        justify-content: center;
    }

    .md5-modal {
        padding: 10px;
    }

    .modal-content {
        max-height: 90vh;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 16px;
    }

    .result-value {
        flex-direction: column;
        align-items: stretch;
    }

    .result-value .copy-btn {
        width: 100%;
        justify-content: center;
    }

    .history-value {
        flex-direction: column;
        align-items: stretch;
    }

    .history-value .copy-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .md5-textarea {
        font-size: 14px;
    }

    .result-value code,
    .history-value code {
        font-size: 12px;
    }
}
