/* ============================================================
   广州妙软PCB在线预览报价系统 —— 全局样式
   设计取向：工业软件的高信息密度界面，深色导航 + 浅色工作区
   ============================================================ */

:root {
    --color-primary: #1668dc;
    --color-primary-dark: #0e4fa8;
    --color-accent: #13a8a8;
    --color-bg: #f2f4f7;
    --color-surface: #ffffff;
    --color-border: #dfe3e8;
    --color-text: #1f2328;
    --color-text-muted: #6b7280;
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-danger: #dc2626;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------------- 布局骨架 ---------------- */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 0 24px;
    height: 56px;
    background: #0f1b2d;
    color: #e6edf6;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.brand-mark {
    background: var(--color-primary);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    letter-spacing: 1px;
}

.brand-text {
    font-size: 15px;
}

.app-nav {
    display: flex;
    gap: 4px;
}

.app-nav a {
    color: #9fb3c8;
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 13px;
}

.app-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.app-nav a.active {
    color: #fff;
    background: var(--color-primary);
}

.app-main {
    flex: 1;
    padding: 20px 24px;
    overflow: auto;
}

.app-footer {
    padding: 12px 24px;
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    flex-shrink: 0;
}

/* ---------------- 通用组件 ---------------- */

.page-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
}

/* FocusOnNavigate 会把焦点移到 h1，此处隐藏浏览器默认焦点框 */
.page-title:focus,
.page-title:focus-visible {
    outline: none;
}

.page-subtitle {
    margin: 0 0 18px;
    color: var(--color-text-muted);
    font-size: 13px;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    background: var(--color-primary);
    color: #fff;
    transition: background 0.15s;
}

.btn:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background: #f6f8fa;
}

.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 13px;
    border: 1px solid transparent;
}

.alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    background: #eef2f6;
    color: var(--color-text-muted);
}

.badge-primary {
    background: #e0edff;
    color: var(--color-primary-dark);
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-error {
    background: #fee2e2;
    color: #b91c1c;
}

/* ---------------- DFM 检查面板 ---------------- */

.dfm-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
}

.dfm-pill {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #eef2f6;
    color: var(--color-text-muted);
}

.dfm-pill.dfm-pass {
    background: #dcfce7;
    color: #15803d;
}

.dfm-pill.dfm-warn {
    background: #fef3c7;
    color: #b45309;
}

.dfm-pill.dfm-fail {
    background: #fee2e2;
    color: #b91c1c;
}

.dfm-table tr {
    cursor: pointer;
}

.dfm-table tr:hover {
    background: #f6f9fd;
}

.dfm-table tr.selected {
    background: #e8f1ff;
}

.dfm-detail {
    background: #f8fafc;
    border-top: 1px solid var(--color-border);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

/* ---------------- 上传页 ---------------- */

.dropzone {
    position: relative;
    border: 2px dashed #b9c4d0;
    border-radius: 10px;
    background: var(--color-surface);
    padding: 52px 20px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover {
    border-color: var(--color-primary);
    background: #f8fbff;
}

.dropzone input[type=file] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone-icon {
    font-size: 34px;
    color: var(--color-primary);
}

.dropzone-title {
    margin: 10px 0 6px;
    font-size: 15px;
    font-weight: 600;
}

.dropzone-hint {
    color: var(--color-text-muted);
    font-size: 12px;
    line-height: 1.7;
}

.progress-track {
    height: 6px;
    background: #e5e9ef;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar {
    height: 100%;
    background: var(--color-primary);
    transition: width 0.2s;
}

.upload-item {
    display: grid;
    grid-template-columns: 1fr 96px 92px;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

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

/* ---------------- 分析页三栏布局 ---------------- */

.analysis-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 380px;
    gap: 14px;
    align-items: start;
}

@media (max-width: 1400px) {
    .analysis-grid {
        grid-template-columns: 230px minmax(0, 1fr) 330px;
    }
}

@media (max-width: 1100px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }
}

.layer-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 560px;
    overflow: auto;
}

.layer-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    font-size: 13px;
}

.layer-item:hover {
    background: #f6f9fd;
}

.layer-item.selected {
    background: #e8f1ff;
    border-left: 3px solid var(--color-primary);
    padding-left: 9px;
}

.layer-item-name {
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

/* 图层列表工具条：整体显隐控制 */
.layer-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--color-border);
    background: #fafcff;
}

.layer-toolbar-btn {
    border: 1px solid var(--color-border);
    background: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    color: var(--color-text);
    white-space: nowrap;
    flex: none;
}

.layer-toolbar-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* 图层行：勾选框 + 序号 + 色块 + 短层名 */
.layer-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.layer-visible {
    margin: 0;
    cursor: pointer;
    flex: none;
}

.layer-index {
    color: var(--color-text-muted);
    font-size: 11px;
    min-width: 16px;
    text-align: right;
    flex: none;
}

.layer-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.18);
    flex: none;
}

.layer-short-name {
    font-weight: 500;
    font-size: 13px;
    padding-left: 6px;
    border-left: 3px solid transparent;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 被隐藏的层整体淡出，但仍可点选查看参数 */
.layer-hidden .layer-short-name,
.layer-hidden .layer-item-meta {
    opacity: 0.45;
}

.layer-hidden .layer-swatch {
    opacity: 0.3;
}

.layer-item-meta {
    color: var(--color-text-muted);
    font-size: 11px;
    margin-top: 3px;
}

/* 预览画布：内容区由 JS 施加 transform 实现平移缩放 */
.preview-stage {
    position: relative;
    overflow: hidden;
    background: #0b0f16;
    border-radius: var(--radius);
    min-height: 520px;
    height: 62vh;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.preview-stage.is-panning {
    cursor: grabbing;
}

.preview-stage-message {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    cursor: default;
}

.preview-world {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    will-change: transform;
}

/* 每层用服务端渲染的单色 SVG 作遮罩，层色由 background 提供 */
.preview-layer {
    position: absolute;
    inset: 0;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-position: center;
    mask-position: center;
    pointer-events: none;
}

.preview-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--color-border);
    background: #fafcff;
}

.preview-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 12px;
    margin-top: 10px;
}

.preview-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.preview-caption {
    color: var(--color-text-muted);
    font-size: 12px;
    text-align: center;
    margin-top: 8px;
}

/* ---------------- 表格 ---------------- */

.param-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.param-table th,
.param-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.param-table th {
    width: 42%;
    color: var(--color-text-muted);
    font-weight: 500;
}

.param-table td {
    font-variant-numeric: tabular-nums;
}

.param-group-title {
    margin: 14px 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary-dark);
    letter-spacing: 0.5px;
}

.param-group-title:first-child {
    margin-top: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: #f6f8fa;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--color-border);
    font-variant-numeric: tabular-nums;
}

.data-table tbody tr:hover {
    background: #f9fbfd;
}

.text-right {
    text-align: right;
}

.nowrap {
    white-space: nowrap;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-small {
    font-size: 12px;
}

/* ---------------- 报价页 ---------------- */

.quotation-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

@media (max-width: 1100px) {
    .quotation-grid {
        grid-template-columns: 1fr;
    }
}

.form-row {
    margin-bottom: 12px;
}

.form-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.form-row input[type=number],
.form-row input[type=text],
.form-row select {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 13px;
    background: #fff;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    font-size: 13px;
}

.cost-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.cost-tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 11px 13px;
}

.cost-tile-label {
    font-size: 12px;
    color: var(--color-text-muted);
}

.cost-tile-value {
    font-size: 19px;
    font-weight: 600;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}

.total-panel {
    background: linear-gradient(135deg, #0f1b2d 0%, #1b3a5c 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px;
}

.total-panel .total-label {
    font-size: 12px;
    opacity: 0.75;
}

.total-panel .total-value {
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.total-panel .total-meta {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.8;
    text-align: right;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------------- 登录页 ---------------- */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
}

.login-card {
    width: 380px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.login-brand .brand-mark {
    background: var(--color-primary);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    letter-spacing: 1px;
}

.login-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
}

/* ---------------- 用户管理 ---------------- */

.user-status-on {
    color: var(--color-success);
}

.user-status-off {
    color: var(--color-danger);
}

/* ---------------- 顶栏登录态 ---------------- */

.app-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
}

.app-user-name {
    color: #e6edf6;
}

.app-logout,
.app-login-link {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #9fb3c8;
    padding: 3px 11px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
}

.app-logout:hover,
.app-login-link:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

/* ---------------- 查询筛选栏与分页器 ---------------- */

.filter-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
}

.filter-field label {
    font-size: 12px;
    color: var(--color-text-muted);
}

.filter-field input,
.filter-field select {
    padding: 6px 9px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 13px;
    background: #fff;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.pager {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    justify-content: center;
}

.pager-info {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0 8px;
}

/* 预览卡片标题中的「设计图 / 仿真图」切换页签 */
.view-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 2px;
    background: #eef2f8;
    border-radius: 7px;
}

.view-tab {
    border: none;
    background: transparent;
    padding: 4px 14px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
}

.view-tab.active {
    background: #fff;
    color: var(--color-primary, #1d4ed8);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

/* 仿真图画布：影棚式渐变背景，交互由 three.js 的轨道控制器处理 */
.sim-stage {
    background: radial-gradient(ellipse at 50% 35%, #3a4352 0%, #1b2029 55%, #0d1015 100%);
    cursor: grab;
}

.sim-stage:active {
    cursor: grabbing;
}

.sim-canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.sim-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #cbd5e1;
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}

.sim-color-select {
    padding: 3px 6px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    font-size: 12px;
    background: #fff;
}

/* ---------------- 弹窗（拼版工具 / 计算利用率） ---------------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.45);
}

.modal-backdrop-top {
    z-index: 110;
}

.modal-window {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    max-height: 100%;
    background: #f5f6f8;
    border: 1px solid #c9ced6;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
    overflow: hidden;
}

.modal-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 14px;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
}

.modal-title-icon {
    padding: 1px 4px;
    border-radius: 3px;
    background: linear-gradient(135deg, #3b82f6, #22c3e6);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.3;
}

.modal-title {
    flex: 1;
    font-size: 14px;
}

.modal-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    color: var(--color-text);
    cursor: pointer;
}

.modal-close:hover {
    background: #e81123;
    color: #fff;
}

/* 拼版工具：左参数、右预览 */
.panel-tool {
    width: 1180px;
    height: 820px;
}

.panel-tool-body {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 10px;
    padding: 10px;
}

.panel-tool-form {
    flex: 0 0 540px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.panel-tool-preview {
    flex: 1;
    min-width: 0;
    background: #000;
    display: flex;
}

.pt-svg {
    width: 100%;
    height: 100%;
}

.pt-svg-panel { fill: #0b0b0b; stroke: #6b7280; }
.pt-svg-rail { fill: #3f5f2a; }
.pt-svg-baffle { fill: #4b5563; }
.pt-svg-tab { fill: #8a9a5b; }
.pt-svg-unit { fill: #1f7f1a; }
.pt-svg-glyph { fill: none; stroke: #d9d9d9; stroke-linecap: round; stroke-linejoin: round; }
.pt-svg-mark { fill: #e0b341; }
.pt-svg-tooling { fill: #000; stroke: #e5e7eb; stroke-width: 0.2; }
.pt-svg-stamp { fill: #000; }

.pt-group {
    margin: 0;
    padding: 4px 12px 10px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pt-group legend {
    padding: 0 4px;
    font-size: 13px;
}

.pt-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pt-grid {
    display: grid;
    align-items: center;
    gap: 8px 10px;
}

.pt-grid-3 {
    grid-template-columns: auto 1fr auto 1fr auto;
}

.pt-grid-rail {
    grid-template-columns: 76px 1fr auto 1fr auto 1fr;
}

.pt-grid-rail > .pt-label {
    text-align: right;
}

.pt-label {
    font-size: 13px;
    white-space: nowrap;
}

.pt-label-fixed {
    width: 76px;
    text-align: right;
}

.pt-hint {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.pt-spacer {
    flex: 1;
}

.pt-input {
    min-width: 0;
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #cfd4db;
    border-radius: 3px;
    background: #fff;
    font-size: 13px;
    font-family: inherit;
}

.pt-input:disabled,
.pt-input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
}

.pt-input-wide {
    width: 200px;
}

.pt-input-mid {
    width: 150px;
}

.pt-input-fill {
    flex: 1;
    width: auto;
}

.pt-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

.pt-check-half {
    width: 48%;
}

.pt-disabled {
    color: #9ca3af;
}

.pt-divider {
    border-top: 1px dotted #9ca3af;
    margin: 2px 0;
}

.pt-btn {
    padding: 5px 14px;
    border: 1px solid #cfd4db;
    border-radius: 3px;
    background: #fff;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    white-space: nowrap;
}

.pt-btn:hover:not(:disabled) {
    background: #eef4ff;
    border-color: var(--color-primary);
}

.pt-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pt-btn.active {
    background: #e0edff;
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.pt-result {
    flex: 1;
    min-height: 150px;
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 10px;
}

.pt-stats {
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: start;
    align-items: center;
    gap: 8px 6px;
}

.pt-stats > .pt-label {
    text-align: right;
}

.pt-messages {
    padding: 6px 10px;
    border: 1px solid var(--color-border);
    background: #fff;
    font-size: 13px;
    overflow-y: auto;
}

.pt-message-error { color: #e11d48; }
.pt-message-notice { color: #b45309; }
.pt-message-info { color: #166534; }

/* 计算利用率 */
.utilization-dialog {
    width: 1400px;
    height: 800px;
    background: #fff;
}

.ud-tabs {
    display: flex;
    padding: 10px 14px 0;
}

.ud-tab {
    padding: 8px 22px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--color-text);
}

.ud-tab.active {
    background: #eceef1;
}

.ud-body {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 14px;
    padding: 12px 14px 14px;
}

.ud-form {
    flex: 0 0 250px;
    display: grid;
    grid-template-columns: 90px 1fr 26px;
    align-items: center;
    align-content: start;
    gap: 8px 6px;
    font-size: 13px;
    overflow-y: auto;
}

.ud-span {
    grid-column: 1 / -1;
    margin: 6px 0;
}

.ud-sheet-label {
    align-self: start;
    padding-top: 2px;
}

.ud-sheets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ud-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.ud-drawings {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 16px;
}

.ud-drawing {
    flex: 1;
    min-width: 0;
    height: 100%;
}

.ud-line {
    fill: none;
    stroke: #000;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}

.ud-line-bold {
    stroke-width: 2.5;
}

.ud-board {
    fill: #fff;
}

.ud-coupon {
    fill: #d1d5db;
}

.ud-dim-text {
    fill: #000;
    stroke: #fff;
    paint-order: stroke;
    text-anchor: middle;
    dominant-baseline: central;
    font-family: "Segoe UI", Arial, sans-serif;
}

.ud-sheet-cell {
    background: #fff;
    border-right: 1px solid var(--color-border);
}

.ud-col-fill {
    width: 100%;
}

.ud-result {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ud-table-wrap {
    flex: none;
    height: 150px;
    border: 1px solid var(--color-border);
    overflow: auto;
}

.ud-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ud-table th {
    position: sticky;
    top: 0;
    padding: 8px 6px;
    background: #f3f4f6;
    border-right: 1px solid var(--color-border);
    font-weight: 500;
    white-space: nowrap;
}

.ud-table td {
    padding: 6px;
    border-bottom: 1px solid #eef0f3;
    text-align: center;
    white-space: nowrap;
}

.ud-table tbody tr {
    cursor: pointer;
}

.ud-table tbody tr:hover {
    background: #f6f9ff;
}

.ud-table tbody tr.selected {
    background: #e0edff;
}

.ud-select-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

@media (max-width: 1100px) {
    .panel-tool,
    .utilization-dialog {
        width: 100%;
        height: 100%;
    }

    .panel-tool-body,
    .ud-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .panel-tool-form,
    .ud-form {
        flex: none;
    }

    .panel-tool-preview {
        min-height: 360px;
    }
}

/* ---------------- 注册与企业品牌 ---------------- */

.auth-tabs {
    display: flex;
    gap: 4px;
    margin: 14px 0 16px;
    border-bottom: 1px solid var(--color-border);
}

.auth-tabs a {
    padding: 7px 16px;
    margin-bottom: -1px;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
}

.auth-tabs a:hover {
    color: var(--color-text);
    text-decoration: none;
}

.auth-tabs a.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.auth-submit {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
}

.auth-switch {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--color-text-muted);
    text-align: center;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-row .login-input {
    flex: 1;
    min-width: 0;
}

.captcha-image {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.captcha-row a {
    flex-shrink: 0;
}

.tenant-logo {
    height: 28px;
    max-width: 120px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
}

.tenant-logo-lg {
    height: 36px;
    max-width: 160px;
}

/* ---------------- 企业设置 ---------------- */

.enterprise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 14px;
}

.logo-editor {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 64px;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    background: #fafbfc;
    flex-shrink: 0;
}

.logo-preview img {
    max-width: 88px;
    max-height: 56px;
    object-fit: contain;
}

.logo-upload input[type=file] {
    display: none;
}

.invite-link {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    background: #f7f9fb;
}

.enterprise-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------------- 单价设置 ---------------- */

.price-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-table .price-group td {
    background: #f4f6f9;
    font-weight: 600;
    font-size: 13px;
}

.price-input {
    width: 120px;
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 13px;
    text-align: right;
}

.price-input.price-custom {
    border-color: var(--color-primary);
    background: #f0f6ff;
    font-weight: 600;
}

@media (max-width: 640px) {
    .login-card {
        width: 100%;
    }

    .login-wrapper {
        padding: 24px 16px 0;
    }

    .enterprise-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------------- 使用手册 ---------------- */

.manual {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 900px;
    line-height: 1.8;
}

.manual h3 {
    margin: 10px 0 4px;
    font-size: 14px;
}

.manual ol,
.manual ul {
    margin: 0 0 8px;
    padding-left: 22px;
}

.manual p {
    margin: 6px 0;
}

.manual .data-table {
    margin: 8px 0;
}
