/* ============ 二维码解析 - 工具特有样式 ============ */
/* 通用样式（卡片、按钮、分隔线、info-box、empty-state、card-header-* 等）已由 common.css 统一提供 */
/* 排版参照 tupianexifduqu：左卡片识别 + 预览，右卡片（settings-card preview-card）解析结果 */

/* ---- 容器 + 左右 1:2 布局（基于 common.css .section-row-1-2） ---- */
#qr-container {
    margin-bottom: 15px;
}

/* 抵消 common.css 中 .settings-card 的默认 margin-top（仅 :first-child 清零），
   参照 tupianexifduqu 显式重置子卡片间距，避免右栏被下推 */
#qr-container > .section-row-1-2 > .settings-card,
#qr-container > .section-row-1-2 > .preview-card {
    margin-top: 0;
    margin-bottom: 0;
}

/* ---- 识别方式分段选择 ---- */
.mode-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mode-btn {
    flex: 1;
    padding: 8px 6px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: #c4b5fd;
}

.mode-btn.active {
    border-color: #8b5cf6;
    background: #f5f3ff;
    color: #6d28d9;
}

/* ---- 小提示 ---- */
.hint-small {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.6;
}

/* ---- 上传区（与 tupianexifduqu 视觉一致） ---- */
.upload-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 40px;
    border: 3px dashed #d1d5db;
    border-radius: 16px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #8b5cf6;
    background: #f5f3ff;
}

.upload-icon {
    font-size: 48px;
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
}

.upload-hint {
    font-size: 13px;
    color: #9ca3af;
}

/* ---- 图片 / 视频预览 ---- */
.image-wrapper {
    display: flex;
    justify-content: center;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 360px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.camera-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.camera-wrapper video {
    max-width: 100%;
    max-height: 360px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #000;
}

/* ---- 结果区 ---- */
.result-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---- 摄像头状态 ---- */
.camera-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.camera-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6d28d9;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    padding: 6px 14px;
    border-radius: 999px;
}

.scanning-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8b5cf6;
    animation: qr-blink 1s infinite;
}

@keyframes qr-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ---- 控件部件（common.css 未提供的统一配套样式，沿用 二维码生成 视觉） ---- */
.content-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.content-input:focus {
    border-color: #8b5cf6;
}

.content-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.content-textarea:focus {
    border-color: #8b5cf6;
}
