/* ===== 解析二维码工具样式规范 - 2026 Modern UI ===== */

.qrcode-decode-page {
    background-color: var(--page-bg, #f8fafc);
}

/* 模式切换 Tab 样式 */
.decode-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 10px;
}

.decode-mode-tab {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
}

.decode-mode-tab:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.decode-mode-tab.is-active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 拖拽上传区域 */
.decode-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    padding: 40px 20px;
    text-align: center;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.decode-dropzone:hover,
.decode-dropzone.is-dragover {
    border-color: #2563eb;
    background: #f0f9ff;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}

.decode-dropzone__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: transform 0.25s ease;
}

.decode-dropzone:hover .decode-dropzone__icon {
    transform: translateY(-4px) scale(1.05);
}

.decode-dropzone__title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
}

.decode-dropzone__desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.decode-dropzone__tips {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12px;
    color: #475569;
}

/* 粘贴提示区域 */
.decode-paste-box {
    border: 2px dashed #cbd5e1;
    border-radius: 14px;
    padding: 50px 20px;
    text-align: center;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
}

.decode-paste-box:focus,
.decode-paste-box:hover {
    border-color: #0284c7;
    background: #f0f9ff;
}

/* 摄像头扫描区域 */
.decode-webcam-box {
    position: relative;
    background: #0f172a;
    border-radius: 14px;
    overflow: hidden;
    text-align: center;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.decode-webcam-video {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    background: #000;
}

.decode-webcam-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    pointer-events: none;
}

.decode-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(37,99,235,0) 0%, #3b82f6 50%, rgba(37,99,235,0) 100%);
    box-shadow: 0 0 12px #3b82f6;
    animation: scanLine 2.2s ease-in-out infinite;
}

@keyframes scanLine {
    0% { top: 0%; }
    50% { top: 98%; }
    100% { top: 0%; }
}

.decode-webcam-toolbar {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* 快捷示例体验 */
.decode-samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.decode-sample-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #334155;
    font-size: 13px;
    font-weight: 600;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.decode-sample-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.decode-sample-btn i {
    font-size: 20px;
    color: #3b82f6;
}

/* Canvas Preview & Highlight Box */
.decode-preview-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    margin-top: 16px;
}

.decode-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.decode-preview-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.decode-canvas-wrapper {
    position: relative;
    max-width: 100%;
    min-height: 200px;
    max-height: 420px;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.decode-canvas-wrapper canvas {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.decode-img-controls {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* 解析结果卡片 */
.decode-result-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.decode-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.decode-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.decode-type-tag--url { background: #dbeafe; color: #1e40af; }
.decode-type-tag--wifi { background: #dcfce7; color: #166534; }
.decode-type-tag--vcard { background: #fef3c7; color: #92400e; }
.decode-type-tag--text { background: #f3e8ff; color: #6b21a8; }
.decode-type-tag--email { background: #fee2e2; color: #991b1b; }
.decode-type-tag--phone { background: #ccfbf1; color: #115e59; }

.decode-parsed-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.decode-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.decode-field-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
}

.decode-field-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
}

.decode-field-value {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    word-break: break-all;
}

.decode-raw-box {
    position: relative;
    background: #0f172a;
    border-radius: 10px;
    padding: 14px;
    color: #38bdf8;
    font-family: 'Consolas', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-all;
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.decode-actions-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 右侧边栏历史记录与元数据 */
.decode-meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.decode-meta-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #e2e8f0;
    color: #475569;
}

.decode-meta-item:last-child {
    border-bottom: none;
}

.decode-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 280px;
    overflow-y: auto;
}

.decode-history-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.decode-history-item:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.decode-history-head {
    display: flex;
    justify-content: space-between;
    color: #64748b;
    margin-bottom: 4px;
}

.decode-history-text {
    color: #0f172a;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 侧边栏推荐工具精美卡片样式 */
.qrcode-decode-page .tool-related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qrcode-decode-page .tool-related-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.qrcode-decode-page .tool-related-item:hover {
    border-color: #2563eb !important;
    background: #f8fafc !important;
    transform: translateX(3px) !important;
}

.qrcode-decode-page .tool-related-item i {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 8px !important;
    background: #eff6ff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.qrcode-decode-page .tool-related-item div {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    overflow: hidden !important;
    text-align: left !important;
}

.qrcode-decode-page .tool-related-item strong {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    display: block !important;
}

.qrcode-decode-page .tool-related-item small {
    font-size: 12px !important;
    color: #64748b !important;
    line-height: 1.3 !important;
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ===== 适用场景与指南 4 卡片网格布局 ===== */
.decode-scenario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.decode-scenario-card {
    background: #ffffff;
    border: 1px solid var(--border-main, #e2e8f0);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.decode-scenario-card:hover {
    border-color: #2563eb;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
    transform: translateY(-2px);
}

.scenario-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.scenario-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.scenario-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main, #0f172a);
    margin: 0 0 3px 0;
}

.scenario-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.badge-cafe { background: #fef3c7; color: #78350f; border: 1px solid #fde68a; }
.badge-mint { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-business { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-darkgold { background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }

.scenario-desc {
    font-size: 12.5px;
    color: var(--text-sub, #475569);
    line-height: 1.6;
    margin: 0;
}


