/* ============================================================
   workspace-utilization-calc · 办公空间工位利用率计算器
   设计语言：蓝图制图风 —— 方格纸底纹、尺寸标注线、工位平面图
   主色 制图蓝 #0b6e99 / 深墨蓝 #16323f / 警示珊瑚 #d64550 / 达标绿 #2f9e6e
   ============================================================ */
.wuc-page {
    --wuc-bg: #edf2f5;
    --wuc-paper: #ffffff;
    --wuc-ink: #16323f;
    --wuc-primary: #0b6e99;
    --wuc-primary-deep: #075578;
    --wuc-primary-soft: #e1eef5;
    --wuc-accent: #d64550;
    --wuc-accent-soft: #fbecee;
    --wuc-ok: #2f9e6e;
    --wuc-ok-soft: #e6f5ee;
    --wuc-line: #c9d9e2;
    --wuc-muted: #5c7787;
    --wuc-grid: rgba(11, 110, 153, 0.07);
    --wuc-shadow: 0 10px 28px rgba(22, 50, 63, 0.08);
    position: relative;
    margin-top: 18px;
    color: var(--wuc-ink);
    font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .wuc-page {
    --wuc-bg: #0c161d;
    --wuc-paper: #13222c;
    --wuc-ink: #d9e8f0;
    --wuc-primary: #3aa7d4;
    --wuc-primary-deep: #6cc3e6;
    --wuc-primary-soft: #16323f;
    --wuc-accent: #e8636e;
    --wuc-accent-soft: #3a1d22;
    --wuc-ok: #4cc38a;
    --wuc-ok-soft: #17352a;
    --wuc-line: #27404e;
    --wuc-muted: #8aa5b4;
    --wuc-grid: rgba(58, 167, 212, 0.08);
    --wuc-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

/* ---------- 首屏：方格纸 ---------- */
.wuc-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.9fr);
    gap: 26px;
    align-items: stretch;
    padding: 30px 30px 26px;
    border: 1px solid var(--wuc-line);
    border-top: 4px solid var(--wuc-primary);
    border-radius: 16px;
    background:
        linear-gradient(var(--wuc-grid) 1px, transparent 1px) 0 0 / 100% 24px,
        linear-gradient(90deg, var(--wuc-grid) 1px, transparent 1px) 0 0 / 24px 100%,
        var(--wuc-bg);
    box-shadow: var(--wuc-shadow);
    position: relative;
    overflow: hidden;
}
.wuc-hero::after {
    content: "PLAN · 1:100";
    position: absolute;
    right: 16px;
    bottom: 10px;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--wuc-muted);
    opacity: 0.7;
}
.wuc-hero-copy { min-width: 0; }
.wuc-kicker {
    display: inline-block;
    padding: 4px 12px;
    border: 1px dashed var(--wuc-primary);
    border-radius: 4px;
    color: var(--wuc-primary);
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.wuc-hero-copy h1 {
    margin: 0 0 10px;
    font-size: clamp(22px, 3.2vw, 31px);
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--wuc-ink);
}
.wuc-hero-sub { margin: 0 0 14px; font-size: 15px; line-height: 1.75; color: var(--wuc-muted); max-width: 60ch; }
.wuc-hero-sub b { color: var(--wuc-primary-deep); }
.wuc-hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.wuc-hero-chips li {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--wuc-paper);
    border: 1px solid var(--wuc-line);
    color: var(--wuc-muted);
    font-size: 12.5px;
}

/* 工位平面图装饰 */
.wuc-blueprint {
    position: absolute;
    inset: auto -10px -14px auto;
    width: 210px;
    opacity: 0.14;
    pointer-events: none;
}
.wuc-deskmap { display: grid; grid-template-columns: repeat(7, 22px); gap: 6px; }
.wuc-cell { height: 14px; border: 1.5px solid var(--wuc-primary); border-radius: 2px; }
.wuc-cell.is-used { background: var(--wuc-primary); }
.wuc-cell.is-room { border-style: dashed; }
.wuc-cell.is-aisle { border: none; background: repeating-linear-gradient(-45deg, var(--wuc-primary) 0 3px, transparent 3px 7px); }
.wuc-dim { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--wuc-primary); }
.wuc-dim i { flex: 1; height: 1px; background: var(--wuc-primary); position: relative; }
.wuc-dim i::before, .wuc-dim i::after { content: ""; position: absolute; top: -3px; border: 3.5px solid transparent; }
.wuc-dim i:first-child::before { left: 0; border-right-color: var(--wuc-primary); }
.wuc-dim i:last-child::after { right: 0; border-left-color: var(--wuc-primary); }
.wuc-dim b { font-size: 11px; letter-spacing: 1px; }

/* 首屏读数卡 */
.wuc-hero-readout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 22px 24px;
    border-radius: 14px;
    background: var(--wuc-primary-deep);
    color: #eaf6fc;
    box-shadow: var(--wuc-shadow);
    position: relative;
}
.wuc-hero-readout::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 14px;
    width: 14px;
    height: 14px;
    border-top: 2px solid rgba(234, 246, 252, 0.55);
    border-left: 2px solid rgba(234, 246, 252, 0.55);
}
.wuc-hero-readout::after {
    content: "";
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 14px;
    height: 14px;
    border-bottom: 2px solid rgba(234, 246, 252, 0.55);
    border-right: 2px solid rgba(234, 246, 252, 0.55);
}
.wuc-readout-label { font-size: 12.5px; letter-spacing: 1.5px; opacity: 0.8; }
.wuc-readout-num { font-size: 40px; font-weight: 800; line-height: 1.1; }
.wuc-readout-avg { font-size: 14px; opacity: 0.92; }
.wuc-readout-meta { font-size: 12px; opacity: 0.7; }
.wuc-readout-tip { margin-top: 4px; font-size: 11px; opacity: 0.55; }

/* ---------- 测算区 ---------- */
.wuc-calc {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 24px;
    margin-top: 24px;
    align-items: start;
}
.wuc-input-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.wuc-panel {
    background: var(--wuc-paper);
    border: 1px solid var(--wuc-line);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: var(--wuc-shadow);
}
.wuc-panel-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.wuc-step {
    flex: none;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid var(--wuc-primary);
    outline: 1px dashed var(--wuc-primary);
    outline-offset: 3px;
    color: var(--wuc-primary);
    font-weight: 800;
    font-size: 14px;
}
.wuc-panel-head h2 { margin: 0 0 3px; font-size: 17px; font-weight: 700; }
.wuc-panel-head p { margin: 0; font-size: 12.5px; color: var(--wuc-muted); line-height: 1.6; }

.wuc-grid1, .wuc-grid2, .wuc-grid3 { display: grid; gap: 12px 14px; margin-bottom: 12px; }
.wuc-grid1 { grid-template-columns: 1fr; }
.wuc-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wuc-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wuc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wuc-label { font-size: 12.5px; color: var(--wuc-muted); }
.wuc-input-wrap, .wuc-select-wrap { position: relative; display: block; }
.wuc-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wuc-line);
    border-radius: 8px;
    background: var(--wuc-bg);
    color: var(--wuc-ink);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wuc-input:focus {
    outline: none;
    border-color: var(--wuc-primary);
    box-shadow: 0 0 0 3px rgba(11, 110, 153, 0.15);
    background: var(--wuc-paper);
}
.wuc-input:disabled { opacity: 0.5; cursor: not-allowed; }
.wuc-unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-style: normal;
    font-size: 12px;
    color: var(--wuc-muted);
    pointer-events: none;
}
.wuc-input-wrap .wuc-input { padding-right: 62px; }
select.wuc-input { appearance: none; padding-right: 30px; cursor: pointer; }
.wuc-select-wrap::after {
    content: "▾";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wuc-muted);
    pointer-events: none;
    font-size: 12px;
}
.wuc-hint { margin: 2px 0 0; font-size: 12px; color: var(--wuc-muted); line-height: 1.65; border-left: 3px solid var(--wuc-primary-soft); padding-left: 10px; }

.wuc-error {
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--wuc-accent-soft);
    border: 1px solid var(--wuc-accent);
    color: var(--wuc-accent);
    font-size: 13.5px;
    line-height: 1.6;
}
.wuc-actions { display: flex; gap: 12px; }
.wuc-btn {
    padding: 11px 22px;
    border-radius: 9px;
    border: 1px solid var(--wuc-line);
    background: var(--wuc-paper);
    color: var(--wuc-ink);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.wuc-btn:hover { transform: translateY(-1px); box-shadow: var(--wuc-shadow); }
.wuc-btn:active { transform: translateY(0); }
.wuc-btn--primary {
    background: var(--wuc-primary);
    border-color: var(--wuc-primary);
    color: #fff;
}
.wuc-btn--primary:hover { background: var(--wuc-primary-deep); }
:root[data-theme="dark"] .wuc-btn--primary { color: #06181f; }

/* ---------- 结果列 ---------- */
.wuc-result-col { position: sticky; top: 84px; }
.wuc-result-card {
    background: var(--wuc-paper);
    border: 1px solid var(--wuc-line);
    border-top: 4px solid var(--wuc-primary);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: var(--wuc-shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.wuc-result-head { display: flex; justify-content: space-between; align-items: center; }
.wuc-result-tag {
    padding: 4px 12px;
    border-radius: 4px;
    background: var(--wuc-primary-soft);
    color: var(--wuc-primary-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}
.wuc-result-note { font-size: 12.5px; color: var(--wuc-muted); }
.wuc-result-note b { color: var(--wuc-primary-deep); }
.wuc-result-main { text-align: center; padding: 8px 0 4px; border-bottom: 1px dashed var(--wuc-line); }
.wuc-result-label { display: block; font-size: 13px; color: var(--wuc-muted); margin-bottom: 4px; }
.wuc-result-total { display: block; font-size: 36px; font-weight: 800; color: var(--wuc-primary-deep); line-height: 1.15; }
.wuc-result-mid { display: block; margin-top: 4px; font-size: 13.5px; color: var(--wuc-muted); }

/* 利用率条 */
.wuc-gauge { display: flex; flex-direction: column; gap: 10px; }
.wuc-gauge-row { display: grid; grid-template-columns: 92px 1fr 52px; gap: 10px; align-items: center; }
.wuc-gauge-k { font-size: 12.5px; color: var(--wuc-muted); }
.wuc-gauge-bar { height: 10px; border-radius: 5px; background: var(--wuc-bg); border: 1px solid var(--wuc-line); overflow: hidden; }
.wuc-gauge-bar i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--wuc-primary); transition: width 0.35s ease; }
.wuc-gauge-bar i.is-warn { background: var(--wuc-accent); }
.wuc-gauge-bar i.is-ok { background: var(--wuc-ok); }
.wuc-gauge-v { font-size: 13px; font-weight: 700; text-align: right; }

.wuc-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wuc-metric {
    padding: 12px 14px;
    border: 1px solid var(--wuc-line);
    border-radius: 10px;
    background: var(--wuc-bg);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.wuc-metric-k { font-size: 12px; color: var(--wuc-muted); }
.wuc-metric-v { font-size: 17px; font-weight: 800; color: var(--wuc-ink); }
.wuc-metric-v.is-warn { color: var(--wuc-accent); }
.wuc-metric-v.is-ok { color: var(--wuc-ok); }

.wuc-breakdown h3 { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--wuc-primary-deep); }
.wuc-table-scroll { overflow-x: auto; }
.wuc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wuc-table th, .wuc-table td { padding: 8px 10px; border: 1px solid var(--wuc-line); text-align: right; white-space: nowrap; }
.wuc-table th { background: var(--wuc-primary-soft); color: var(--wuc-primary-deep); font-weight: 700; }
.wuc-table th:first-child, .wuc-table td:first-child { text-align: left; }
.wuc-table td { color: var(--wuc-ink); }
.wuc-table tr.is-best td { background: var(--wuc-ok-soft); font-weight: 700; }
.wuc-table tr.is-warnrow td { background: var(--wuc-accent-soft); }
.wuc-table-empty { text-align: center !important; color: var(--wuc-muted); }
.wuc-table .is-price { font-weight: 700; color: var(--wuc-primary-deep); }

.wuc-verdict {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px dashed var(--wuc-line);
    background: var(--wuc-bg);
    font-size: 13.5px;
    line-height: 1.7;
}
.wuc-verdict.is-good { border-color: var(--wuc-ok); background: var(--wuc-ok-soft); }
.wuc-verdict.is-warn { border-color: var(--wuc-accent); background: var(--wuc-accent-soft); }
.wuc-verdict b { color: var(--wuc-primary-deep); }
.wuc-verdict.is-warn b { color: var(--wuc-accent); }
.wuc-verdict.is-good b { color: var(--wuc-ok); }

.wuc-notes { display: flex; flex-direction: column; gap: 8px; }
.wuc-notes p { margin: 0; font-size: 12.5px; color: var(--wuc-muted); line-height: 1.65; }
.wuc-result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wuc-result-actions .wuc-btn { flex: 1; text-align: center; }
.wuc-result-foot { margin: 0; font-size: 11.5px; color: var(--wuc-muted); }

/* ---------- A4 分摊表 ---------- */
.wuc-sheet-wrap { margin-top: 30px; }
.wuc-sheet-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.wuc-sheet-kicker { font-size: 12px; letter-spacing: 2px; color: var(--wuc-primary); }
.wuc-sheet-head h2 { margin: 4px 0 6px; font-size: 20px; }
.wuc-sheet-head p { margin: 0; font-size: 13px; color: var(--wuc-muted); max-width: 62ch; }
.wuc-sheet-badge {
    flex: none;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--wuc-line);
    font-size: 12px;
    color: var(--wuc-muted);
    background: var(--wuc-paper);
}
.wuc-sheet {
    background: #fff;
    color: #1c2b33;
    border: 1px solid var(--wuc-line);
    border-radius: 12px;
    padding: 26px 30px;
    box-shadow: var(--wuc-shadow);
    font-variant-numeric: tabular-nums;
}
.wuc-sheet-top { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px double #0b6e99; padding-bottom: 12px; margin-bottom: 14px; }
.wuc-sheet-top h3 { margin: 0 0 4px; font-size: 19px; color: #0b3a52; }
.wuc-sheet-top p { margin: 0; font-size: 12px; color: #5c7787; }
.wuc-sheet-meta { text-align: right; font-size: 12px; color: #5c7787; display: flex; flex-direction: column; gap: 4px; }
.wuc-sheet-meta b { color: #1c2b33; }
.wuc-sheet-info { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: #5c7787; margin-bottom: 14px; }
.wuc-sheet-info b { color: #1c2b33; }
.wuc-sheet-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 14px; }
.wuc-sheet-table th, .wuc-sheet-table td { border: 1px solid #b9ccd6; padding: 7px 9px; text-align: right; }
.wuc-sheet-table th { background: #e1eef5; color: #0b3a52; }
.wuc-sheet-table th:first-child, .wuc-sheet-table td:first-child { text-align: center; width: 34px; }
.wuc-sheet-table th:nth-child(2), .wuc-sheet-table td:nth-child(2) { text-align: left; }
.wuc-sheet-table .w-no { width: 34px; }
.wuc-sheet-table .w-num { width: 84px; }
.wuc-sheet-table .w-sub { width: 110px; }
.wuc-sheet-summary { border: 1px solid #0b6e99; border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.wuc-sheet-row { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 13px; border-bottom: 1px dashed #b9ccd6; }
.wuc-sheet-row:last-child { border-bottom: none; }
.wuc-sheet-row b { color: #0b3a52; }
.wuc-sheet-row--total { background: #e1eef5; font-weight: 700; }
.wuc-sheet-notes p { margin: 0 0 6px; font-size: 11.5px; color: #4c6575; line-height: 1.7; }
.wuc-sheet-notes b { color: #1c2b33; }
.wuc-sheet-foot { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #b9ccd6; font-size: 11px; color: #7d93a0; text-align: center; }

/* ---------- 参考 / 规则 / FAQ ---------- */
.wuc-reference, .wuc-rules { margin-top: 34px; }
.wuc-section-head { margin-bottom: 16px; }
.wuc-section-kicker { font-size: 12px; letter-spacing: 2px; color: var(--wuc-primary); }
.wuc-section-head h2 { margin: 4px 0 8px; font-size: 21px; }
.wuc-section-head p { margin: 0; font-size: 13.5px; color: var(--wuc-muted); line-height: 1.7; }
.wuc-ref-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.wuc-ref-card { background: var(--wuc-paper); border: 1px solid var(--wuc-line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--wuc-shadow); }
.wuc-ref-card h3 { margin: 0 0 2px; font-size: 15.5px; }
.wuc-ref-sub { margin: 0 0 12px; font-size: 12px; color: var(--wuc-muted); }
.wuc-ref-note { margin-top: 14px; font-size: 12.5px; color: var(--wuc-muted); line-height: 1.7; background: var(--wuc-primary-soft); border-left: 3px solid var(--wuc-primary); padding: 10px 14px; border-radius: 0 8px 8px 0; }
.wuc-rule-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.wuc-rule { background: var(--wuc-paper); border: 1px solid var(--wuc-line); border-radius: 14px; padding: 18px; box-shadow: var(--wuc-shadow); }
.wuc-rule-no { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--wuc-primary); color: #fff; font-weight: 800; margin-bottom: 10px; }
:root[data-theme="dark"] .wuc-rule-no { color: #06181f; }
.wuc-rule h3 { margin: 0 0 6px; font-size: 14.5px; }
.wuc-rule p { margin: 0; font-size: 12.5px; color: var(--wuc-muted); line-height: 1.7; }
.wuc-example { margin-top: 18px; background: var(--wuc-paper); border: 1px dashed var(--wuc-primary); border-radius: 14px; padding: 20px 22px; }
.wuc-example h3 { margin: 0 0 8px; font-size: 15px; color: var(--wuc-primary-deep); }
.wuc-example p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.8; color: var(--wuc-ink); }
.wuc-example b { color: var(--wuc-primary-deep); }
.wuc-example-note { font-size: 12px !important; color: var(--wuc-muted) !important; }
.wuc-faq { margin-top: 34px; }

/* ---------- 返回顶部 ---------- */
.wuc-top {
    position: fixed;
    right: 22px;
    bottom: 26px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--wuc-line);
    background: var(--wuc-paper);
    color: var(--wuc-primary);
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--wuc-shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 60;
}
.wuc-top.is-show { opacity: 1; pointer-events: auto; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
    .wuc-calc { grid-template-columns: 1fr; }
    .wuc-result-col { position: static; }
    .wuc-hero { grid-template-columns: 1fr; }
    .wuc-rule-grid { grid-template-columns: repeat(2, 1fr); }
    .wuc-ref-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .wuc-grid3 { grid-template-columns: 1fr; }
    .wuc-grid2 { grid-template-columns: 1fr; }
    .wuc-metrics { grid-template-columns: 1fr; }
    .wuc-rule-grid { grid-template-columns: 1fr; }
    .wuc-hero { padding: 22px 18px; }
    .wuc-sheet { padding: 18px 14px; }
}

/* ---------- 打印：只保留 A4 分摊表 ---------- */
@media print {
    body * { visibility: hidden !important; }
    .wuc-sheet, .wuc-sheet * { visibility: visible !important; }
    .wuc-sheet {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        box-shadow: none;
        border-radius: 0;
        color: #000;
    }
    .wuc-top { display: none !important; }
}
