/**
 * 二维码生成工具
 * 页面外壳（顶部导航、居中容器、底部版权行）由 ../../tools-page.css 提供，
 * 本文件只保留该工具的专属样式。
 */

/* 代码 / 密文区域统一使用等宽字体，便于查看与复制 */
#otWorkspace textarea,
#otWorkspace pre,
#otWorkspace code {
    font-family: Consolas, Monaco, "Courier New", monospace;
}

/* 通用组件类补齐 */

/* 通用按钮 */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #0989E2;
    border-radius: 6px;
    background: #0989E2;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary:hover {
    background: #12769f;
    border-color: #12769f;
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #36cfc9;
    border-radius: 6px;
    background: #36cfc9;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background: #2bb8b3;
    border-color: #2bb8b3;
}
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    background: #fff;
    color: #4e5969;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-outline:hover {
    border-color: #0989E2;
    color: #0989E2;
}

/* 复选框（未引入 Tailwind forms 插件，这里手动补齐基础样式） */
.form-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #c9cdd4;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.2s;
}
.form-checkbox:checked {
    border-color: #0989E2;
    background: #0989E2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3E%3Cpath d='M6.2 11.4 3 8.2l1.2-1.2 2 2 5.6-5.6L13 4.6z'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* 输入框聚焦态 */
.input-focus:focus {
    border-color: #0989E2;
    box-shadow: 0 0 0 2px rgba(9,137,226, 0.15);
    outline: none;
}

/* 卡片悬浮效果 */
.card-hover {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card-hover:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 淡入动画 */
.fade-in {
    animation: qrcodeFadeIn 0.3s ease;
}
@keyframes qrcodeFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* 错误抖动动画 */
.error-shake {
    animation: qrcodeShake 0.4s ease;
}
@keyframes qrcodeShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* 取色器：去掉默认内边距，避免圆形色块被压扁 */
#otWorkspace input[type="color"] {
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}
#otWorkspace input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
#otWorkspace input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 9999px;
}

/* 样式模板选中态 */
.preset-item.active {
    border-color: #0989E2;
    box-shadow: 0 0 0 2px rgba(9,137,226, 0.15);
    background: #f0f9fd;
}
