﻿/* LED 结构图纸生成 · 蓝图工场风 */
.tool-led-drawing .dg-container {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 16px;
    margin-top: 0;
}
.tool-led-drawing .dg-panel,
.tool-led-drawing .dg-drawing-wrap {
    background: var(--tool-panel, #fbfcfd);
    border: 1px solid var(--tool-border, #d3d9e0);
    border-radius: 4px;
    box-shadow: none;
}
.dg-panel {
    padding: 18px 16px 20px;
}
.dg-panel-title {
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 14px;
    padding: 0 0 10px;
    border-bottom: 1px dashed #cfd6de;
    color: var(--tool-ink, #1f2933);
    letter-spacing: .08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dg-label-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 400;
    color: #667788;
    position: relative;
    letter-spacing: 0;
    text-transform: none;
}
.dg-label-toggle label { cursor: pointer; }
.dg-label-toggle input[type="checkbox"] {
    position: static;
    opacity: 1;
    margin: 0;
    width: auto;
    height: auto;
    accent-color: var(--tool-brand, #00a0e9);
}
.dg-options-bar {
    display: flex;
    gap: 16px;
    justify-content: flex-start;
    padding: 10px 0 0;
    border-top: 1px dashed #cfd6de;
    margin-top: 8px;
}
.dg-opt-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #667788;
    cursor: pointer;
}
.dg-opt-label input[type="checkbox"] {
    position: static;
    opacity: 1;
    margin: 0;
    width: auto;
    height: auto;
    accent-color: var(--tool-brand, #00a0e9);
}
.dg-form-group { margin-bottom: 14px; }
.dg-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #667788;
    margin-bottom: 6px;
}
.dg-form-row { display: flex; gap: 8px; }
.dg-form-row > div { flex: 1; min-width: 0; }
.dg-form-control {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d3d9e0;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
    font-family: 'Consolas', 'Courier New', monospace;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    background: #fff;
    color: var(--tool-ink, #1f2933);
}
.dg-form-control:focus {
    outline: none;
    border-color: var(--tool-brand, #00a0e9);
    box-shadow: 0 0 0 3px rgba(0, 160, 233, .12);
}
.dg-form-control::-webkit-outer-spin-button,
.dg-form-control::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dg-input-suffix { display: flex; align-items: center; min-width: 0; }
.dg-input-suffix input {
    border-radius: 4px 0 0 4px;
    flex: 1;
    min-width: 0;
    padding: 9px 8px;
}
.dg-input-suffix .dg-suffix {
    padding: 9px 8px;
    background: #eef2f5;
    border: 1px solid #d3d9e0;
    border-left: none;
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    color: #667788;
    white-space: nowrap;
}
.dg-border-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: center;
}
.dg-border-item { display: flex; align-items: center; }
.dg-border-label {
    font-size: 11px;
    color: #667788;
    white-space: nowrap;
    margin-right: 3px;
    width: 36px;
    text-align: right;
}
.dg-border-item input {
    width: 79px;
    padding: 6px 4px;
    font-size: 12px;
    border: 1px solid #d3d9e0;
    border-radius: 4px 0 0 4px;
    border-right: none;
    text-align: center;
    outline: none;
    box-sizing: border-box;
    -moz-appearance: textfield;
}
.dg-border-item input::-webkit-outer-spin-button,
.dg-border-item input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dg-border-item .dg-suffix {
    padding: 6px 4px;
    font-size: 10px;
    background: #eef2f5;
    border: 1px solid #d3d9e0;
    border-left: none;
    border-radius: 0 4px 4px 0;
    white-space: nowrap;
}
.dg-border-item input:focus { outline: none; border-color: var(--tool-brand, #00a0e9); }
.dg-spec-table {
    border: 1px solid #d3d9e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}
.dg-spec-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    background: #eef2f5;
    padding: 5px 0;
    font-size: 10px;
    color: #667788;
    text-align: center;
    border-bottom: 1px solid #d3d9e0;
}
.dg-spec-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    align-items: center;
    border-bottom: 1px solid #e5eaef;
}
.dg-spec-row:last-child { border-bottom: none; }
.dg-spec-no {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--tool-brand, #00a0e9);
    background: var(--tool-brand-light, #e8f6fc);
}
.dg-spec-input {
    width: 100%;
    padding: 7px 4px;
    font-size: 13px;
    border: none;
    text-align: center;
    outline: none;
    font-family: 'Consolas', 'Courier New', monospace;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}
.dg-spec-input:focus { background: #d6eef9; }
.dg-locked {
    width: 100%;
    padding: 7px 4px;
    font-size: 13px;
    border: none;
    text-align: center;
    background: #eef2f5;
    color: #9aa8b8;
    font-family: 'Consolas', 'Courier New', monospace;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}
.dg-spec-hint {
    font-size: 10px;
    color: #8492a6;
    line-height: 1.6;
    margin-top: 4px;
}
.dg-add-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 6px;
    border: 1px dashed #7ab8d4;
    border-radius: 4px;
    background: var(--tool-brand-light, #e8f6fc);
    color: var(--tool-brand, #00a0e9);
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.dg-add-btn:hover {
    border-color: var(--tool-brand, #00a0e9);
    background: #d6eef9;
}
.dg-extra-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border: 1px solid #e5eaef;
    border-radius: 4px;
    margin-top: 4px;
    background: #fff;
}
.dg-extra-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--tool-brand, #00a0e9);
    min-width: 32px;
    text-align: center;
}
.dg-extra-desc {
    font-size: 10px;
    color: #8492a6;
    white-space: nowrap;
    font-family: Consolas, 'Courier New', monospace;
}
.dg-extra-unit { font-size: 10px; color: #667788; }
.dg-extra-info { font-size: 10px; color: #9aa8b8; margin-left: auto; }
.dg-del-btn {
    background: var(--tool-accent, #ff4d4f);
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.dg-del-btn:hover { background: var(--tool-accent-dark, #e03b3d); }
.dg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.dg-btn-success {
    background: var(--tool-brand, #00a0e9);
    color: #fff;
}
.dg-btn-success:hover { background: var(--tool-brand-dark, #0088cc); }
.dg-btn-primary {
    background: var(--tool-brand, #00a0e9);
    color: #fff;
}
.dg-btn-primary:hover { background: var(--tool-brand-dark, #0088cc); }
.dg-btn-block { width: 100%; margin-top: 6px; }
.dg-info-card {
    background: #eef2f5;
    border-radius: 4px;
    border-left: 3px solid var(--tool-brand, #00a0e9);
    padding: 12px 14px;
    margin-top: 14px;
}
.dg-info-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px dashed #d3d9e0;
    font-size: 12px;
}
.dg-info-row:last-child { border-bottom: none; }
.dg-info-row .dg-label { color: #667788; }
.dg-info-row .dg-value { font-weight: 600; color: var(--tool-ink, #1f2933); }
.dg-info-row .dg-value-highlight { color: var(--tool-brand, #00a0e9); font-size: 14px; }
.dg-drawing-wrap { padding: 16px; overflow: auto; }
.dg-drawing-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.dg-drawing-toolbar h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--tool-ink, #1f2933);
    letter-spacing: .04em;
}
.dg-zoom-bar { display: flex; align-items: center; gap: 6px; }
.dg-zoom-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #d3d9e0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}
.dg-zoom-btn:hover {
    border-color: var(--tool-brand, #00a0e9);
    color: var(--tool-brand, #00a0e9);
}
.dg-zoom-label {
    font-size: 12px;
    color: #667788;
    min-width: 42px;
    text-align: center;
}
.dg-drawing-area {
    background-color: #e8f2f8;
    background-image:
        linear-gradient(rgba(0, 160, 233, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 160, 233, .08) 1px, transparent 1px);
    background-size: 24px 24px;
    border: 1px solid #b7c9d6;
    border-radius: 4px;
    padding: 16px;
    overflow: auto;
    min-height: 380px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    touch-action: pan-y;
}
.dg-disclaimer {
    margin-top: 14px;
    padding: 12px 14px;
    background: #fff8eb;
    border: 1px solid #e2d2a8;
    border-left: 3px solid #d97706;
    border-radius: 4px;
}
.dg-disclaimer p {
    margin: 0;
    font-size: 11px;
    color: #7c5a1a;
    line-height: 1.8;
}
svg.dg-drawing {
    background: #fff;
    box-shadow: 0 1px 0 rgba(20, 33, 43, .08);
    max-width: 100%;
    height: auto;
    transform-origin: center;
    border: 1px solid #c5d3de;
}
.dg-drawing-area.grabbing svg.dg-drawing { cursor: grabbing !important; }
.dg-drawing-placeholder {
    font-size: 16px;
    color: #7a8fa0;
    text-align: center;
    user-select: none;
    letter-spacing: .04em;
}
.dg-preset-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}
.dg-preset-btn {
    padding: 8px 10px;
    font-size: 12px;
    border: 1px solid #d3d9e0;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
    font-weight: 600;
}
.dg-preset-btn:hover,
.dg-preset-btn.active {
    border-color: var(--tool-brand, #00a0e9);
    color: var(--tool-brand, #00a0e9);
    background: #d6eef9;
}
.dg-btn-wrap {
    display: flex;
    gap: 10px;
    justify-content: stretch;
}
.dg-btn-wrap .dg-btn { flex: 1; }

.img-preview-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 15, 20, .92);
    z-index: 10000;
    display: none;
}
.img-preview-mask.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.img-preview-close {
    position: fixed;
    top: 12px;
    right: 16px;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    font-size: 24px;
    color: #fff;
    background: rgba(255,255,255,.15);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10002;
}
.img-preview-close:hover { background: rgba(255,255,255,.3); }
.img-preview-wrap {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.img-preview-wrap img {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
}
.img-preview-hint {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255,255,255,.7);
    font-size: 14px;
    z-index: 10002;
}
.dg-canvas-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
}
.dg-watermark-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

@media (max-width: 860px) {
    .tool-led-drawing .dg-container { grid-template-columns: 1fr; }
    .dg-drawing-area { min-height: 200px; padding: 8px; }
    .dg-drawing-placeholder { font-size: 14px; }
    .dg-drawing-wrap { padding: 10px; }
    .dg-disclaimer p { font-size: 10px; }
    .dg-btn-wrap { flex-direction: column; align-items: stretch; }
    .dg-btn-wrap .dg-btn { width: 100%; }
}
@media (max-width: 640px) {
    .dg-container { gap: 6px; }
    .dg-panel { padding: 12px 10px; }
    .dg-panel-title { font-size: 12px; margin-bottom: 10px; padding-bottom: 8px; }
    .dg-form-group label { font-size: 12px; margin-bottom: 3px; }
    .dg-form-control { font-size: 16px; padding: 10px 8px; height: auto; }
    .dg-input-suffix .dg-suffix { font-size: 11px; padding: 10px 6px; }
    .dg-spec-header span { font-size: 9px; }
    .dg-spec-input { font-size: 14px; }
    .dg-drawing-wrap { padding: 6px; }
    .dg-drawing-area { min-height: 150px; padding: 4px; }
    .dg-drawing-toolbar h2 { font-size: 13px; }
    .dg-btn { font-size: 14px; padding: 10px 14px; }
    .dg-info-card { padding: 10px 8px; }
    .dg-info-row { font-size: 11px; }
    .dg-disclaimer { margin-top: 10px; padding: 8px 10px; }
    .dg-zoom-btn { width: 36px; height: 36px; font-size: 18px; }
    .dg-preset-btn { font-size: 11px; padding: 6px 10px; }
    .dg-options-bar { flex-wrap: wrap; gap: 6px; }
    .dg-opt-label { font-size: 11px; }
    .dg-border-item input { width: 56px; font-size: 16px; }
    .dg-canvas-wrap { max-width: 100% !important; }
    img.dg-drawing, svg.dg-drawing { max-width: 100% !important; }
    .dg-preset-btns { grid-template-columns: 1fr; }
}
