/**
 * 加密工具专区公共样式
 * 路径：/css/encrypt/common.css
 * 用途：所有 /encrypt/{toolName}.html 工具页面共享
 * 最后更新：2026-06-28
 */

/* 平滑滚动 + 减少动画偏好 */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* 卡片悬停光晕 */
.card-glow { transition: all 0.3s ease; }
.card-glow:hover {
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.2), 0 10px 40px rgba(14, 165, 233, 0.1);
}

/* 浮动动画 */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}
.animate-float { animation: float 3s ease-in-out infinite; }

/* 渐变背景动画 */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.animated-gradient-bg {
    background: linear-gradient(-45deg, #f0f9ff, #e0f2fe, #bae6fd, #e0f2fe);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

/* 输入/输出文本域统一样式 */
.encrypt-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.875rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s;
    background: #fff;
    color: #1e293b;
}
.encrypt-textarea:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}
.encrypt-textarea::placeholder { color: #94a3b8; }

/* 单行输入框统一样式 */
.encrypt-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: #fff;
    color: #1e293b;
}
.encrypt-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* 下拉选择框 */
.encrypt-select {
    width: 100%;
    padding: 0.5rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s;
}
.encrypt-select:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* 主操作按钮（蓝渐变） */
.btn-primary-encrypt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(to right, #0ea5e9, #2563eb);
    color: #fff;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
}
.btn-primary-encrypt:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 12px -2px rgba(14, 165, 233, 0.4);
}
.btn-primary-encrypt:active { transform: translateY(0); }
.btn-primary-encrypt:disabled { opacity: 0.6; cursor: not-allowed; }

/* 次要按钮（灰边） */
.btn-secondary-encrypt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #f8fafc;
    color: #475569;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary-encrypt:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

/* 复制按钮 */
.btn-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: #ecfdf5;
    color: #059669;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid #a7f3d0;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-copy:hover { background: #d1fae5; border-color: #6ee7b7; }

/* 清空按钮 */
.btn-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid #fecaca;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-clear:hover { background: #fee2e2; border-color: #fca5a5; }

/* 选项卡按钮 */
.encrypt-tab {
    flex: 1;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}
.encrypt-tab:hover { background: #e2e8f0; color: #1e293b; }
.encrypt-tab.active {
    background: linear-gradient(to right, #0ea5e9, #2563eb);
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
}

/* 选项卡内容 */
.encrypt-tab-content { display: none; }
.encrypt-tab-content.active { display: block; }

/* 标签 */
.encrypt-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* 单选/复选框美化 */
.encrypt-radio-group,
.encrypt-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.encrypt-radio,
.encrypt-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #475569;
    transition: all 0.2s;
}
.encrypt-radio:hover,
.encrypt-checkbox:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.encrypt-radio input,
.encrypt-checkbox input {
    width: 1rem;
    height: 1rem;
    accent-color: #0ea5e9;
    cursor: pointer;
}
.encrypt-radio input:checked + span,
.encrypt-checkbox input:checked + span {
    color: #0284c7;
    font-weight: 600;
}

/* 结果显示框 */
.encrypt-result-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875rem;
    color: #1e293b;
    word-break: break-all;
    white-space: pre-wrap;
    min-height: 60px;
}
.encrypt-result-box.empty {
    color: #94a3b8;
    font-style: italic;
}

/* 信息提示框 */
.encrypt-info-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f0f9ff;
    border-left: 3px solid #0ea5e9;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #075985;
    line-height: 1.5;
}

/* 错误提示框 */
.encrypt-error-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border-left: 3px solid #dc2626;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #991b1b;
    line-height: 1.5;
}

/* 隐藏 */
.hidden { display: none !important; }

/* 字符计数 */
.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* 工具头部图标盒 */
.encrypt-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: linear-gradient(to bottom right, #38bdf8, #3b82f6);
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.3);
    margin-bottom: 1rem;
}
.encrypt-icon-box i {
    font-size: 1.5rem;
    color: #fff;
}
