.tool-content {
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    padding: 1.2em;
    border-radius: .6em;
    background: var(--main-bg);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1em;
}

@media (max-width: 768px) {
    .tool-content {
        padding: .8em !important;
    }
}

/* ===================== 程序员报价单生成器 ===================== */
.qg-root {
    --qg-line: #e2e8f0;
    --qg-ink: #0f172a;
    --qg-muted: #64748b;
    --qg-accent: #2563eb;
    --qg-soft: #f8fafc;
    --qg-radius: 12px;
    color: var(--qg-ink);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.qg-root * {
    box-sizing: border-box;
}

.qg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.qg-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qg-logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--qg-ink);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -1px;
    flex: none;
}

.qg-brand b {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

.qg-brand small {
    display: block;
    color: var(--qg-muted);
    font-size: 10px;
    letter-spacing: .5px;
    margin-top: 2px;
}

.qg-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.qg-btn {
    border: 1px solid var(--qg-line);
    background: #fff;
    color: var(--qg-ink);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    transition: .15s;
    white-space: nowrap;
    height: auto;
    box-shadow: var(--card-shadow);
}

.qg-btn:hover {
    border-color: #cbd5e1;
    background: var(--qg-soft);
}

.qg-btn-primary {
    background: var(--qg-accent);
    border-color: var(--qg-accent);
    color: #fff;
}

.qg-btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.qg-btn-danger {
    color: #dc2626;
}

.qg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 14px;
    align-items: start;
}

.qg-preview {
    border: 1px solid #eee;
}

.qg-paper {
    width: 210mm;
    max-width: 100%;
    min-height: 297mm;
    margin: 0 auto;
    background: #fff;
    padding: 14mm 13mm 12mm;
    color: #1e293b;
    font-size: 12px;
    line-height: 1.6;
    box-shadow: var(--card-shadow);
}

.qg-paper-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2.5px solid #0f172a;
    padding-bottom: 14px;
    gap: 20px;
}

.qg-quote-title {
    margin: 0;
    font-size: 27px;
    letter-spacing: 6px;
    line-height: 1.2;
    color: #0f172a;
    font-weight: bold;
}

.qg-en {
    font-size: 9px;
    letter-spacing: 2px;
    color: #94a3b8;
    margin-top: 4px;
    font-weight: 600;
}

.qg-num {
    text-align: right;
    font-size: 11px;
    color: #475569;
    line-height: 1.8;
}

.qg-num b {
    font-size: 13px;
    color: #0f172a;
    letter-spacing: .5px;
    white-space: nowrap;
}

.qg-meta-strip {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 16px 0;
    gap: 26px;
    flex-wrap: wrap;
}

.qg-meta-strip div {
    font-size: 11px;
    color: #64748b;
}

.qg-meta-strip b {
    display: block;
    color: #0f172a;
    font-size: 12px;
    margin-top: 2px;
}

.qg-party-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.qg-party {
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 12px 14px;
    min-height: 104px;
}

.qg-party h3 {
    margin: 0 0 8px;
    font-size: 11px;
    color: #2563eb;
    letter-spacing: 1px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qg-party h3::before {
    content: "";
    width: 3px;
    height: 11px;
    background: #2563eb;
    border-radius: 2px;
}

.qg-party p {
    margin: 2px 0;
    font-size: 11px;
    color: #475569;
    word-break: break-all;
}

.qg-party p span {
    color: #94a3b8;
    margin-right: 6px;
}

.qg-sec-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    margin: 18px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qg-sec-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.qg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.qg-table thead th {
    background: #0f172a;
    color: #fff;
    padding: 8px 7px;
    text-align: left;
    font-weight: 600;
    font-size: 10.5px;
    white-space: nowrap;
}

.qg-table tbody td {
    padding: 8px 7px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
}

.qg-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.qg-r {
    text-align: left;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.qg-c {
    text-align: left;
    white-space: nowrap;
}

.qg-table .qg-desc {
    font-weight: 600;
    color: #1e293b;
}

.qg-tag {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    white-space: nowrap;
}

.qg-summary {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.qg-summary-box {
    width: 290px;
    max-width: 100%;
}

.qg-sum-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 11px;
    color: #64748b;
}

.qg-sum-row b {
    color: #334155;
    font-variant-numeric: tabular-nums;
}

.qg-grand {
    border-top: 1.5px solid #0f172a;
    margin-top: 6px;
    padding-top: 9px;
    align-items: baseline;
    color: #0f172a;
    font-weight: 700;
    font-size: 12px;
}

.qg-grand b {
    color: #dc2626;
    font-size: 21px;
    letter-spacing: -.5px;
}

.qg-upper {
    text-align: right;
    font-size: 10.5px;
    color: #64748b;
    margin-top: 6px;
}

.qg-upper b {
    color: #334155;
}

.qg-terms {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
}

.qg-term h4 {
    margin: 0 0 6px;
    font-size: 11px;
    color: #0f172a;
    font-weight: 700;
}

.qg-term ol, .qg-term ul {
    margin: 0;
    padding-left: 16px;
    color: #64748b;
    font-size: 10.5px;
    line-height: 1.7;
}

.qg-term li {
    margin-bottom: 2px;
    white-space: pre-wrap;
    font-size: 10.5px;
}

.qg-sign {
    margin-top: 26px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.qg-sign div {
    border-top: 1px solid #94a3b8;
    padding-top: 8px;
    font-size: 11px;
    color: #64748b;
}

.qg-sign b {
    display: block;
    color: #0f172a;
    margin-bottom: 16px;
}

.qg-paper-foot {
    margin-top: 22px;
    border-top: 1px dashed #cbd5e1;
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
    font-size: 9.5px;
}

.qg-editor {
    background: #fff;
    border: 1px solid var(--qg-line);
    border-radius: 0.6em;
    box-shadow: var(--card-shadow);
    padding: 4px 14px 16px;
}

.qg-group {
    border-bottom: 1px solid var(--qg-line);
    padding: 4px 0;
}

.qg-group:last-child {
    border-bottom: 0;
}

.qg-group > summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 2px;
    font-weight: 650;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.qg-group > summary::-webkit-details-marker {
    display: none;
}

.qg-group > summary::before {
    content: "";
    width: 6px;
    height: 6px;
    border-right: 1.8px solid var(--qg-accent);
    border-bottom: 1.8px solid var(--qg-accent);
    transform: rotate(45deg);
    transition: .18s;
    margin-left: 2px;
    flex: none;
}

.qg-group[open] > summary::before {
    transform: rotate(-135deg);
}

.qg-sum-note {
    color: var(--qg-muted);
    font-weight: 400;
    font-size: 11px;
    margin-left: auto;
}

.qg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px;
    padding: 2px 2px 16px;
}

.qg-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.qg-full {
    grid-column: 1 / -1;
}

.qg-field label {
    font-size: 11px;
    color: var(--qg-muted);
    font-weight: 600;
    letter-spacing: .2px;
}

.qg-field input, .qg-field select, .qg-field textarea, .qg-tpl-row select {
    width: 100%;
    border: 1px solid var(--qg-line);
    background: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    outline: none;
    transition: .15s;
    font-size: 13px;
    color: var(--qg-ink);
}

.qg-field input:focus, .qg-field select:focus, .qg-field textarea:focus, .qg-tpl-row select:focus {
    border-color: var(--qg-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.qg-field textarea {
    resize: vertical;
    min-height: 74px;
    line-height: 1.6;
}

.qg-divider {
    grid-column: 1 / -1;
    font-size: 11px;
    color: var(--qg-muted);
    font-weight: 700;
    letter-spacing: 1px;
    padding: 4px 0 0;
    border-top: 1px dashed var(--qg-line);
}

.qg-tpl-row {
    display: flex;
    gap: 8px;
    padding: 0 2px 14px;
}

.qg-tpl-row select {
    flex: 1;
    min-width: 0;
}

.qg-tpl-row button {
    border: 1px solid var(--qg-line);
    background: var(--qg-soft);
    border-radius: 8px;
    padding: 0 13px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.qg-tpl-row button:hover {
    border-color: var(--qg-accent);
    color: var(--qg-accent);
}

.qg-items-wrap {
    padding: 0 2px 14px;
    overflow-x: auto;
}

.qg-items {
    width: 100%;
    border-collapse: collapse;
    min-width: 590px;
    font-size: 12px;
}

.qg-items th {
    text-align: left;
    color: var(--qg-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 6px 4px;
    border-bottom: 1px solid var(--qg-line);
}

.qg-items td {
    padding: 5px 4px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.qg-items input, .qg-items select {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    padding: 5px 6px;
    outline: none;
}

.qg-items input:hover, .qg-items select:hover {
    border-color: var(--qg-line);
}

.qg-items input:focus, .qg-items select:focus {
    border-color: var(--qg-accent);
    background: #fff;
}

.qg-items input.qg-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.qg-items .qg-amt {
    text-align: right;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-right: 6px;
}

.qg-row-ops {
    display: flex;
    gap: 2px;
    justify-content: flex-end;
}

.qg-row-ops button {
    border: 0;
    background: transparent;
    color: var(--qg-muted);
    padding: 3px 5px;
    border-radius: 5px;
    font-size: 11px;
}

.qg-row-ops button:hover {
    background: var(--qg-soft);
    color: var(--qg-accent);
}

.qg-row-ops button.qg-del:hover {
    color: #dc2626;
    background: #fef2f2;
}

.qg-add-row {
    border: 1px dashed #cbd5e1;
    background: var(--qg-soft);
    width: 100%;
    padding: 9px;
    border-radius: 8px;
    color: var(--qg-accent);
    font-weight: 600;
    font-size: 12px;
}

.qg-add-row:hover {
    background: #eff6ff;
    border-color: var(--qg-accent);
}

.qg-total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid var(--qg-line);
    border-radius: 8px;
    background: var(--qg-soft);
    font-size: 13px;
    font-weight: 700;
}

.qg-total-line b {
    color: var(--qg-accent);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1280px) {
    .qg-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .qg-actions {
        justify-content: flex-start;
    }

    .qg-paper {
        padding: 10mm 8mm;
    }

    .qg-party-grid, .qg-terms {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html, body {
        height: auto !important;
        background: #fff !important;
        overflow: visible !important;
    }

    body * {
        visibility: hidden !important;
    }

    .qg-paper, .qg-paper * {
        visibility: visible !important;
    }

    body > *:not(.container) {
        display: none !important;
    }

    .container > *:not(.main-content) {
        display: none !important;
    }

    .main-content > *:not(.tool-content) {
        display: none !important;
    }

    .tool-content > *:not(.qg-root) {
        display: none !important;
    }

    .qg-root > *:not(.qg-layout) {
        display: none !important;
    }

    .qg-layout > *:not(.qg-preview) {
        display: none !important;
    }

    .container, .main-content, .tool-content, .qg-root, .qg-layout, .qg-preview {
        display: block !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    .qg-paper {
        width: 210mm !important;
        max-width: none !important;
        min-height: 297mm !important;
        margin: 0 !important;
        box-shadow: none !important;
        padding: 14mm 13mm 12mm !important;
    }

    .qg-party-grid, .qg-terms, .qg-sign {
        grid-template-columns: 1fr 1fr !important;
    }

    .qg-paper, .qg-paper * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}