/* ============ 搞笑奖状批量生成器 · 工具特有样式 ============ */
/* 公共布局/卡片/按钮/空状态等样式统一来自 common.css */

#cert-container {
    margin-bottom: 15px;
}

/* ---------- 模板选择 ---------- */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.template-item {
    cursor: pointer;
    transition: all 0.2s;
}

.template-preview {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.template-item:hover .template-preview {
    transform: scale(1.05);
}

.template-item.active .template-preview {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

/* ---------- 文本输入框 ---------- */
.text-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1f2937;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.text-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

.hint-small {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

/* ---------- 快捷预设（称呼 / 搞笑奖项） ---------- */
.award-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.award-chip {
    padding: 5px 10px;
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #e9d5ff;
    border-radius: 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.award-chip:hover {
    background: #ede9fe;
    border-color: #8b5cf6;
}

.award-chip.active {
    background: #8b5cf6;
    color: #fff;
    border-color: #8b5cf6;
}

/* ---------- 日期输入 + 今天按钮 ---------- */
.input-with-btn {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-btn .text-input {
    flex: 1;
}

.date-btn {
    flex-shrink: 0;
    padding: 0 16px;
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #e9d5ff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.date-btn:hover {
    background: #ede9fe;
    border-color: #8b5cf6;
}

/* ---------- 头像上传 ---------- */
.avatar-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
}

.avatar-upload:hover {
    border-color: #8b5cf6;
    background: #faf5ff;
}

.avatar-upload-icon {
    font-size: 28px;
}

.avatar-upload-text {
    font-size: 12px;
    color: #9ca3af;
}

.avatar-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-preview img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.avatar-remove {
    padding: 6px 12px;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.avatar-remove:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

/* ---------- 开关 ---------- */
.toggle-switch {
    width: 50px;
    height: 26px;
    background: #e5e7eb;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-switch.active {
    background: #8b5cf6;
}

.toggle-knob {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 10px;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all 0.3s;
}

.toggle-switch.active .toggle-knob {
    left: 27px;
}

/* ---------- 颜色选择 ---------- */
.color-input {
    width: 100%;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
}

/* ---------- 预览区 ---------- */
.preview-area {
    min-height: 400px;
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.certificate-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.certificate-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
}

.certificate-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.certificate-info {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.mini-action {
    padding: 4px 10px;
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #e9d5ff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mini-action:hover {
    background: #ede9fe;
    border-color: #8b5cf6;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .certificates-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
