/* ======= 条形码生成器 barcode-generator ======= */

.tool-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-light);
}

.tool-title-wrapper i {
    font-size: 2rem;
    color: var(--primary-color);
}

.tool-title-wrapper .tool-title {
    margin-bottom: 0;
    border-bottom: none;
}

/* ---------- 布局 ---------- */
.bc-layout {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.bc-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bc-field > label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.bc-field input[type="text"],
.bc-field select {
    width: 100%;
    font-size: 15px;
    padding: 10px 12px;
    height: 44px;
}

.bc-field input[type="text"] {
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.bc-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.bc-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bc-slider-row input[type="range"] {
    flex: 1;
    accent-color: var(--primary-color);
}

.bc-slider-row b {
    min-width: 40px;
    text-align: center;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    background: var(--primary-light);
    border-radius: 999px;
    padding: 2px 0;
    flex: 0 0 auto;
}

.bc-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.bc-check input {
    accent-color: var(--primary-color);
    margin: 0;
}

.bc-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bc-color-row input[type="color"] {
    width: 44px;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    cursor: pointer;
}

.bc-error {
    min-height: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #e74c3c;
    line-height: 1.6;
}

.bc-error.is-hint {
    color: var(--text-muted);
    font-weight: 400;
}

/* ---------- 预览 ---------- */
.bc-preview {
    position: sticky;
    top: 90px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background:
        linear-gradient(45deg, #f4f6f9 25%, transparent 25%, transparent 75%, #f4f6f9 75%),
        linear-gradient(45deg, #f4f6f9 25%, #fff 25%, #fff 75%, #f4f6f9 75%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    overflow: auto;
}

.bc-preview svg {
    max-width: 100%;
    height: auto;
    display: block;
    background: #fff;
    box-shadow: 0 2px 10px rgba(20, 40, 80, 0.08);
}

.bc-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bc-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-color);
    border: 1px solid rgba(45, 140, 240, 0.2);
    font-family: 'Consolas', 'Monaco', monospace;
}

.bc-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.bc-actions .btn {
    padding: 9px 18px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---------- 格式说明表 ---------- */
.bc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.bc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 620px;
    background: var(--bg-white);
}

.bc-table th {
    background: var(--bg-light);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: 13px;
}

.bc-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.bc-table tr:last-child td {
    border-bottom: none;
}

.bc-table tr:nth-child(even) td {
    background: #fafcff;
}

.bc-table td:first-child {
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

.bc-table code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    background: var(--bg-light);
    padding: 1px 6px;
    border-radius: 4px;
    color: #3a6ea5;
}

.bc-disclaimer {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.7;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .bc-layout {
        grid-template-columns: 1fr;
    }

    .bc-preview {
        position: static;
        order: -1;
        min-height: 160px;
    }
}

@media (max-width: 560px) {
    .bc-row2 {
        grid-template-columns: 1fr;
    }

    .bc-actions .btn {
        flex: 1 1 45%;
        justify-content: center;
    }
}
