:root {
      font-family: Microsoft YaHei, PingFang SC, system-ui, sans-serif;
      --green: #0f6249;
      --green-deep: #0a4937;
      --green-pale: #e6f2ee;
      --green-light: #d4ede4;
      --orange: #c65d22;
      --amber: #e8983e;
      --red: #b42318;
      --red-pale: #fff0ee;
      --blue: #2563eb;
      --blue-pale: #eff4ff;
      --line: #dce3e0;
      --muted: #66746f;
      --card: #fff;
      --bg: #f3f5f4;
      --sidebar-w: 230px;
      --header-h: 56px;
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    html, body { height: 100%; }
    body { color: #14211d; background: var(--bg); }
    a { color: var(--blue); text-decoration: none; }

    /* ===== Layout ===== */
    .layout { display: flex; height: 100vh; overflow: hidden; }
    .sidebar {
      width: var(--sidebar-w); flex-shrink: 0;
      background: var(--green-deep); color: #fff;
      display: flex; flex-direction: column; overflow-y: auto;
      z-index: 10;
    }
    .sidebar-logo {
      padding: 20px 18px; display: flex; align-items: center; gap: 10px;
      border-bottom: 1px solid #0d5a3e;
    }
    .sidebar-logo .logo-icon {
      width: 36px; height: 36px; border-radius: 7px;
      display: grid; place-items: center; color: var(--green-deep); background: #fff;
    }
    .sidebar-logo h1 { font-size: 16px; margin: 0; }
    .sidebar-logo p { font-size: 10px; color: #84b09e; margin-top: 2px; }
    .sidebar-nav { flex: 1; padding: 10px 0; }
    .sidebar-nav .nav-group { margin-bottom: 4px; }
    .sidebar-nav .nav-group-title {
      padding: 12px 18px 6px; font-size: 10px; text-transform: uppercase;
      color: #84b09e; letter-spacing: 1px;
    }
    .sidebar-nav .nav-item {
      display: flex; align-items: center; gap: 10px;
      padding: 11px 18px; color: #c4dbd1; font-size: 13px;
      cursor: pointer; transition: all .15s;
      border-left: 3px solid transparent;
    }
    .sidebar-nav .nav-item:hover { background: #0d543a; color: #fff; }
    .sidebar-nav .nav-item.active {
      color: #fff; background: #0a4530; border-left-color: #5fc29c;
    }
    .sidebar-nav .nav-item svg { flex-shrink: 0; }
    .sidebar-nav .nav-badge {
      margin-left: auto; min-width: 20px; height: 20px; border-radius: 10px;
      display: grid; place-items: center; background: var(--orange);
      color: #fff; font-size: 10px; font-weight: 700; padding: 0 6px;
    }
    .sidebar-nav .nav-badge.red { background: var(--red); }

    .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
    .topbar {
      height: var(--header-h); flex-shrink: 0;
      display: flex; align-items: center; justify-content: space-between;
      padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line);
    }
    .topbar-left { display: flex; align-items: center; gap: 16px; }
    .topbar-breadcrumb { font-size: 13px; color: var(--muted); }
    .topbar-breadcrumb span { color: #14211d; font-weight: 600; }
    .topbar-right { display: flex; align-items: center; gap: 16px; }
    .topbar-user { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
    .topbar-avatar {
      width: 32px; height: 32px; border-radius: 50%;
      display: grid; place-items: center; color: #fff;
      background: linear-gradient(135deg, #0f6249, #198565);
      font-size: 13px; font-weight: 700;
    }
    .topbar-btn {
      width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 6px;
      display: grid; place-items: center; background: #fff; cursor: pointer;
      position: relative; color: var(--muted);
    }
    .topbar-btn .dot {
      position: absolute; top: 5px; right: 5px; width: 7px; height: 7px;
      border-radius: 50%; background: var(--red);
    }

    .content { flex: 1; overflow-y: auto; padding: 24px; }
    .page { display: none; }
    .page.active { display: block; animation: fadeIn .25s; }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

    /* ===== Stats ===== */
    .stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
    .stat-card {
      background: #fff; border-radius: 10px; padding: 18px 20px;
      box-shadow: 0 1px 3px #00000008; cursor: default;
      display: flex; align-items: center; gap: 14px; transition: box-shadow .18s;
    }
    .stat-card:hover { box-shadow: 0 4px 12px #00000010; }
    .stat-card .sc-icon {
      width: 44px; height: 44px; border-radius: 10px;
      display: grid; place-items: center; flex-shrink: 0;
    }
    .stat-card .sc-val { font-size: 26px; font-weight: 800; line-height: 1.1; }
    .stat-card .sc-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

    /* ===== Card ===== */
    .card {
      background: #fff; border-radius: 10px; box-shadow: 0 1px 3px #00000008;
      margin-bottom: 20px; overflow: hidden;
    }
    .card-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px; border-bottom: 1px solid var(--line);
    }
    .card-header h3 { font-size: 15px; margin: 0; }
    .card-body { padding: 20px; }
    .card-body.nopad { padding: 0; }

    /* ===== Buttons ===== */
    .btn {
      height: 36px; padding: 0 16px; border: 0; border-radius: 6px;
      display: inline-flex; align-items: center; gap: 6px;
      font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
      white-space: nowrap;
    }
    .btn-primary { color: #fff; background: var(--green); }
    .btn-primary:hover { background: var(--green-deep); }
    .btn-outline { color: var(--green); background: #fff; border: 1px solid var(--green); }
    .btn-outline:hover { background: var(--green-pale); }
    .btn-danger { color: #fff; background: var(--red); }
    .btn-danger:hover { background: #9a1d14; }
    .btn-warn { color: var(--orange); background: #fff3eb; border: 1px solid var(--orange); }
    .btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
    .btn-group { display: flex; gap: 8px; }
    .btn:disabled { opacity: .5; cursor: not-allowed; }

    /* ===== Table ===== */
    .table-wrap { overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; font-size: 13px; }
    table th, table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid #f0f3f2; }
    table th { background: #f8faf9; color: var(--muted); font-weight: 600; font-size: 11px; white-space: nowrap; }
    table tr:hover td { background: #fafcfb; }
    .tag {
      padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap;
      display: inline-block;
    }
    .tag-green { color: #527a5a; background: #edf6ef; }
    .tag-orange { color: #8b4a1e; background: #fff3eb; }
    .tag-red { color: #9b2c2c; background: #fff0ee; }
    .tag-blue { color: #3b5fa0; background: #eff4ff; }

    /* ===== Filter ===== */
    .filter-bar {
      display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
      padding: 16px 20px; border-bottom: 1px solid var(--line);
    }
    .filter-bar input, .filter-bar select {
      height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px;
      font-size: 13px; outline: 0; background: #fff;
    }
    .filter-bar input:focus, .filter-bar select:focus { border-color: var(--green); box-shadow: 0 0 0 2px #0f624918; }
    .search-box { position: relative; }
    .search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); z-index: 1; }
    .search-box input { padding-left: 33px; width: 220px; }

    /* ===== Modal ===== */
    .modal-backdrop {
      position: fixed; z-index: 100; top: 0; right: 0; bottom: 0; left: 0;
      display: flex; align-items: center; justify-content: center;
      background: #0619139c; opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    .modal-backdrop.show { opacity: 1; pointer-events: auto; }
    .modal {
      width: min(92%, 780px); max-height: 85vh; overflow-y: auto;
      border-radius: 12px; background: #fff; box-shadow: 0 20px 60px #00000030;
      transform: translateY(12px); transition: transform .25s;
    }
    .modal-backdrop.show .modal { transform: translateY(0); }
    .modal-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px; border-bottom: 1px solid var(--line);
      position: sticky; top: 0; background: #fff; z-index: 2; border-radius: 12px 12px 0 0;
    }
    .modal-header h3 { font-size: 16px; margin: 0; }
    .modal-close {
      width: 32px; height: 32px; border: 0; border-radius: 6px;
      display: grid; place-items: center; background: #eff2f1; cursor: pointer;
    }
    .modal-body { padding: 20px; }
    .modal-footer {
      display: flex; gap: 10px; justify-content: flex-end;
      padding: 14px 20px; border-top: 1px solid var(--line);
      position: sticky; bottom: 0; background: #fff; border-radius: 0 0 12px 12px;
    }

    /* ===== Form ===== */
    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .form-group { margin-bottom: 14px; }
    .form-group label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
    .form-group input, .form-group select, .form-group textarea {
      width: 100%; padding: 0 12px; border: 1px solid var(--line);
      border-radius: 6px; font-size: 13px; outline: 0; background: #fff;
    }
    .form-group input, .form-group select { height: 40px; }
    .form-group textarea { padding: 10px 12px; min-height: 80px; resize: vertical; }
    .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--green); box-shadow: 0 0 0 2px #0f624918; }
    .form-full { grid-column: 1 / -1; }

    /* ===== Upload zone ===== */
    .upload-zone {
      border: 2px dashed var(--line); border-radius: 8px;
      padding: 36px; text-align: center; cursor: pointer; transition: all .2s;
    }
    .upload-zone:hover { border-color: var(--green); background: var(--green-pale); }
    .upload-zone svg { color: var(--muted); margin-bottom: 8px; }
    .upload-zone p { color: var(--muted); font-size: 13px; }
    .upload-zone .hint { font-size: 11px; color: #a0b0a8; margin-top: 4px; }

    /* ===== Hierarchy ===== */
    .hierarchy-chain {
      display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    }
    .hierarchy-chain select {
      height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px;
      font-size: 13px; outline: 0; min-width: 130px; background: #fff;
    }
    .hierarchy-chain .arrow { color: var(--muted); font-size: 14px; }

    /* ===== Detail sections ===== */
    .detail-section {
      background: #f8faf9; border-radius: 8px; padding: 16px; margin-bottom: 12px;
    }
    .detail-section h4 {
      font-size: 13px; font-weight: 700; color: #14211d;
      margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
    }
    .detail-section h4 .dot {
      width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    }
    .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; font-size: 13px; }
    .detail-grid div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #edf0ef; }
    .detail-grid .dl { color: var(--muted); }
    .detail-grid .dv { font-weight: 600; text-align: right; }
    .photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .photo-thumb {
      aspect-ratio: 4/3; border-radius: 6px; overflow: hidden; border: 1px solid var(--line);
      cursor: pointer; background: #f0f3f2; position: relative;
    }
    .photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
    .photo-thumb .plabel { position: absolute; bottom: 0; left: 0; right: 0; background: #00000070; color: #fff; font-size: 10px; padding: 3px 6px; text-align: center; }

    /* ===== Employee card ===== */
    .emp-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .emp-card {
      background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px;
      cursor: pointer; transition: all .15s; position: relative;
    }
    .emp-card:hover { border-color: var(--green); box-shadow: 0 2px 8px #0f624912; }
    .emp-card .emp-avatar {
      width: 40px; height: 40px; border-radius: 50%; margin-bottom: 10px;
      display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px;
      background: linear-gradient(135deg, #0f6249, #198565);
    }
    .emp-card .emp-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
    .emp-card .emp-title { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
    .emp-card .emp-stats { display: flex; gap: 14px; font-size: 11px; }
    .emp-card .emp-stats span { display: flex; align-items: center; gap: 3px; }

    /* ===== Approval list ===== */
    .approval-item {
      display: flex; align-items: center; padding: 14px 20px; border-bottom: 1px solid #f0f3f2;
      cursor: pointer; transition: background .12s; gap: 16px;
    }
    .approval-item:hover { background: #fafcfb; }
    .approval-item .ai-icon {
      width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
      display: grid; place-items: center; font-size: 18px;
    }
    .approval-item .ai-body { flex: 1; min-width: 0; }
    .approval-item .ai-body .ai-title { font-size: 14px; font-weight: 600; }
    .approval-item .ai-body .ai-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
    .approval-item .ai-extra { text-align: right; flex-shrink: 0; }
    .approval-item .ai-extra .ai-time { font-size: 11px; color: var(--muted); }
    .approval-item .ai-actions { display: flex; gap: 6px; margin-top: 8px; }

    /* ===== Quick actions ===== */
    .quick-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
    .quick-action {
      flex: 1; min-width: 140px; padding: 16px; border-radius: 10px; background: #fff;
      border: 1px solid var(--line); cursor: pointer; text-align: center;
      transition: all .18s; box-shadow: 0 1px 3px #00000006;
    }
    .quick-action:hover { border-color: var(--green); box-shadow: 0 4px 14px #0f624916; }
    .quick-action .qa-icon {
      width: 40px; height: 40px; border-radius: 8px; margin: 0 auto 10px;
      display: grid; place-items: center;
    }
    .quick-action .qa-label { font-size: 13px; font-weight: 700; color: #14211d; }

    /* ===== Toast ===== */
    .toast {
      position: fixed; z-index: 200; left: 50%; top: 24px;
      transform: translateX(-50%); padding: 10px 20px; border-radius: 6px; color: #fff;
      background: #17372d; box-shadow: 0 8px 25px #0003;
      font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s;
    }
    .toast.show { opacity: 1; }

    /* ===== Empty ===== */
    .empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
    .empty-state svg { margin-bottom: 12px; }

    /* ===== Fullscreen photo ===== */
    .photo-fullscreen {
      position: fixed; z-index: 300; inset: 0; background: #000c;
      display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    .photo-fullscreen.show { opacity: 1; pointer-events: auto; }
    .photo-fullscreen img { max-width: 90vw; max-height: 85vh; border-radius: 8px; object-fit: contain; }
    .photo-fullscreen .close-btn {
      position: absolute; top: 20px; right: 20px; width: 40px; height: 40px;
      border-radius: 50%; border: 0; background: #fff3; color: #fff; cursor: pointer;
      display: grid; place-items: center; font-size: 20px;
    }

    /* ===== Hierarchy Flow ===== */
    .hierarchy-flow {
      display: flex; align-items: center; justify-content: center; gap: 16px;
      flex-wrap: wrap;
    }
    .hf-node {
      text-align: center; padding: 20px 24px; border-radius: 12px;
      min-width: 140px; position: relative; transition: all .2s;
    }
    .hf-node-platform { background: var(--green-pale); border: 2px solid var(--green); }
    .hf-node-provider { background: #edf6ef; border: 1px solid var(--line); }
    .hf-node-employee { background: #fff3eb; border: 1px solid var(--line); }
    .hf-icon { font-size: 32px; margin-bottom: 6px; }
    .hf-title { font-weight: 700; font-size: 14px; color: #14211d; }
    .hf-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
    .hf-badge {
      position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
      background: var(--green); color: #fff; font-size: 10px; padding: 2px 10px;
      border-radius: 10px; white-space: nowrap;
    }
    .hf-count {
      margin-top: 8px; display: inline-block; min-width: 28px; height: 28px;
      border-radius: 14px; background: var(--green); color: #fff;
      font-size: 13px; font-weight: 700; line-height: 28px; padding: 0 8px;
    }
    .hf-arrow { font-size: 22px; color: var(--green); font-weight: 700; }

    /* ===== Provider Accordion ===== */
    .provider-accordion-item {
      border-bottom: 1px solid var(--line);
    }
    .provider-accordion-item:last-child { border-bottom: 0; }
    .pa-header {
      display: flex; align-items: center; gap: 14px;
      padding: 14px 20px; cursor: pointer; transition: background .12s;
    }
    .pa-header:hover { background: #fafcfb; }
    .pa-header .pa-avatar {
      width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
      display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px;
      background: linear-gradient(135deg, #0f6249, #198565);
    }
    .pa-header .pa-info { flex: 1; min-width: 0; }
    .pa-header .pa-name { font-size: 14px; font-weight: 700; }
    .pa-header .pa-meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; gap: 12px; }
    .pa-header .pa-actions { display: flex; gap: 6px; flex-shrink: 0; }
    .pa-header .pa-chevron {
      width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
      display: grid; place-items: center; transition: transform .2s; color: var(--muted);
    }
    .pa-header.expanded .pa-chevron { transform: rotate(180deg); color: var(--green); }
    .pa-body {
      display: none; padding: 0 20px 16px; background: #f8faf9;
    }
    .pa-body.open { display: block; animation: fadeIn .2s; }
    .pa-body .pa-subtitle {
      font-size: 12px; font-weight: 700; color: var(--muted);
      padding: 10px 0 6px; display: flex; align-items: center; justify-content: space-between;
    }
    .pa-employee-row {
      display: flex; align-items: center; gap: 10px; padding: 8px 12px;
      background: #fff; border-radius: 6px; margin-bottom: 6px;
      font-size: 13px; transition: box-shadow .12s;
    }
    .pa-employee-row:hover { box-shadow: 0 2px 6px #0000000a; }
    .pa-employee-row .pe-avatar {
      width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
      display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700;
      background: linear-gradient(135deg, #527a5a, #6fa87b);
    }
    .pa-employee-row .pe-info { flex: 1; min-width: 0; }
    .pa-employee-row .pe-stats { display: flex; gap: 10px; font-size: 11px; flex-shrink: 0; }
    .no-employees {
      text-align: center; padding: 16px; color: var(--muted); font-size: 12px;
    }

    /* ===== Employee Card List ===== */
    .employee-list-item {
      display: flex; align-items: center; gap: 14px;
      padding: 14px 20px; border-bottom: 1px solid var(--line);
      cursor: pointer; transition: background .12s;
    }
    .employee-list-item:hover { background: #fafcfb; }
    .employee-list-item:last-child { border-bottom: 0; }
    .el-avatar {
      width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
      display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px;
      background: linear-gradient(135deg, #0f6249, #198565);
    }
    .el-avatar.supervisor { background: linear-gradient(135deg, var(--blue), #4f7fef); }
    .el-info { flex: 1; min-width: 0; }
    .el-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
    .el-meta { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
    .el-stats { display: flex; gap: 12px; font-size: 12px; flex-shrink: 0; text-align: center; }
    .el-stat { min-width: 40px; }
    .el-stat-val { font-weight: 700; font-size: 16px; }
    .el-stat-label { font-size: 10px; color: var(--muted); }
    .el-actions { display: flex; gap: 6px; flex-shrink: 0; }

    /* ===== Export A4 ===== */
    .export-a4 {
      background: #fff; padding: 40px 36px; font-size: 13px; color: #1a1a1a;
      line-height: 1.6;
    }
    .export-a4 h2.export-title {
      text-align: center; font-size: 17px; font-weight: 800; margin-bottom: 6px;
      letter-spacing: 1px; color: #14211d;
    }
    .export-a4 .export-subtitle {
      text-align: center; font-size: 11px; color: var(--muted); margin-bottom: 20px;
    }
    .export-a4 table.export-table {
      width: 100%; border-collapse: collapse; margin-bottom: 18px;
      font-size: 12px;
    }
    .export-a4 table.export-table th,
    .export-a4 table.export-table td {
      border: 1px solid #999; padding: 7px 10px; text-align: left; vertical-align: top;
    }
    .export-a4 table.export-table th {
      background: #f0f3f2; font-weight: 700; width: 130px; color: #14211d;
      white-space: nowrap;
    }
    .export-a4 table.export-table td { color: #333; }
    .export-a4 .export-section-title,
    .export-a4 .export-photo-section-title {
      font-size: 14px; font-weight: 700; margin: 20px 0 10px;
      padding-bottom: 6px; border-bottom: 2px solid var(--green);
      color: var(--green);
    }
    .export-a4 .export-survey-row {
      display: flex; justify-content: space-between; padding: 6px 10px;
      border-bottom: 1px dashed #ddd; font-size: 12px; gap: 12px;
    }
    .export-a4 .export-survey-row span { flex: 1 1 auto; min-width: 0; word-break: break-all; }
    .export-a4 .export-survey-row strong { flex: 0 0 auto; white-space: nowrap; text-align: right; min-width: 60px; }
    .export-a4 .export-survey-row:nth-child(odd) { background: #fafcfb; }
    .export-a4 .export-inspect-grid {
      display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
      margin: 12px 0;
    }
    .export-a4 .export-inspect-item {
      padding: 10px 14px; border-radius: 8px; border: 1.5px solid #ddd;
      font-size: 13px; display: flex; align-items: center; gap: 8px;
      color: #333; background: #fff;
    }
    .export-a4 .export-inspect-item.checked {
      color: var(--green); background: #e6f2ee; border-color: var(--green);
      font-weight: 600;
    }
    .export-a4 .export-inspect-item .check-icon { font-size: 15px; flex-shrink: 0; }
    .export-a4 .export-photo-grid {
      display: grid; grid-template-columns: repeat(3, 25%); justify-content: space-between; gap: 4px;
      margin: 12px 0;
    }
    .export-a4 .export-photo-slot {
      display: flex; flex-direction: column; align-items: stretch; font-size: 11px;
      color: var(--muted); break-inside: avoid; page-break-inside: avoid;
      border: 1px solid #bbb; padding: 2px;
    }
    .export-a4 .export-photo-image {
      display: flex; align-items: center; justify-content: center; width: 100%; height: 165px;
      box-sizing: border-box; border: 0; border-radius: 0; overflow: hidden; background: #f8faf9;
      break-inside: avoid; page-break-inside: avoid;
    }
    /* 巡检照片独立页面：大图铺满 */
    .export-a4 .export-photo-page-break {
      page-break-before: always; border: none; margin: 0;
    }
    .export-a4 .export-photo-image img {
      display: block; width: 100%; height: 100%; object-fit: contain;
    }
    .export-a4 .export-photo-slot .ps-label {
      display: block; padding: 2px 0 0; color: #475650;
      font-size: 10px; text-align: center;
    }
    .export-a4 .export-sign-row {
      display: flex; justify-content: space-between; margin-top: 24px;
      padding-top: 12px; border-top: 1px solid #ddd;
    }
    .export-a4 .export-sign-row span { font-size: 12px; }
    .export-a4 .export-sign-row strong { font-size: 14px; }
    /* 新版巡检记录表：与 Word 模板保持“题目 + 勾选项”纵向布局。 */
    .export-a4 .official-meta { margin: 12px 0 16px; }
    .export-a4 .official-meta-line { min-height: 26px; padding: 2px 0; }
    .export-a4 .official-section { font-size: 15px; font-weight: 700; margin: 12px 0 5px; }
    .export-a4 .official-question { padding: 5px 0 6px; border-bottom: 1px solid #eee; break-inside: avoid; page-break-inside: avoid; }
    .export-a4 .official-q { font-size: 13px; line-height: 1.55; }
    .export-a4 .official-a { padding: 3px 0 0 8px; font-size: 13px; line-height: 1.55; white-space: normal; }
    .export-a4 .official-detail { display: block; color: #333; padding-top: 2px; }
    .export-a4 .handling-line { line-height: 2.2; padding: 3px 0 8px; }
    .export-a4 .official-remark { min-height: 58px; margin-top: 10px; padding: 7px 0; border-bottom: 1px solid #777; }
    .export-a4 .official-sign { margin: 18px 0; min-height: 26px; }
    .export-a4 .official-photo-note { font-size: 12px; line-height: 1.55; margin: 6px 0 8px; }
    .export-a4 .official-date-line { margin: 4px 0; }
    .export-a4 .official-form-table,
    .export-a4 .official-photo-table { width: 100%; border-collapse: collapse; margin: 0 0 8px; table-layout: fixed; }
    .export-a4 .official-form-table col:first-child { width: 72%; }
    .export-a4 .official-form-table col:last-child { width: 28%; }
    .export-a4 .official-form-table td,
    .export-a4 .official-photo-table td { border: 1px solid #555; padding: 4px 6px; vertical-align: top; }
    .export-a4 .official-form-table .official-section-row td { font-weight: 700; background: #f6f6f6; }
    .export-a4 .official-form-table .official-question-row td:first-child { width: 72%; }
    .export-a4 .official-form-table .official-question-row td:last-child { width: 28%; }
    .export-a4 .official-form-table .official-q { padding: 4px 6px; }
    .export-a4 .official-form-table .official-a { padding: 4px 6px; }
    .export-a4 .official-form-table .official-remark { min-height: 66px; }
    .export-a4 .official-form-table .official-sign { min-height: 36px; }
    .export-a4 .official-inline-field { display: block; margin-top: 4px; }
    .export-a4 .official-option { font-weight: 400; white-space: nowrap; }
    .export-a4 .official-selected { color: #000; font-size: 1.08em; font-weight: 900; }
    .export-a4 .handling-line { font-size: 11px; line-height: 1.6; white-space: nowrap; }
    .export-page-break {
      border-bottom: 2px dashed var(--muted); margin: 24px 0; padding: 0;
    }

    /* ===== Searchable Select ===== */
    .ss-wrapper { position: relative; }
    .ss-input {
      width: 100%; height: 38px; padding: 0 32px 0 10px; border: 1px solid var(--line);
      border-radius: 6px; font-size: 13px; background: #fff; cursor: pointer;
      box-sizing: border-box;
    }
    .ss-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 2px #0f624920; }
    .ss-arrow {
      position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
      pointer-events: none; color: var(--muted);
    }
    .ss-dropdown {
      position: absolute; left: 0; right: 0; top: 100%; max-height: 200px; overflow-y: auto;
      background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px #00000014;
      z-index: 100; display: none; margin-top: 2px;
    }
    .ss-dropdown.open { display: block; }
    .ss-search {
      position: sticky; top: 0; background: #fff; padding: 6px 8px;
      border-bottom: 1px solid var(--line);
    }
    .ss-search input {
      width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--line);
      border-radius: 4px; font-size: 12px; box-sizing: border-box;
    }
    .ss-option {
      padding: 8px 10px; font-size: 12px; cursor: pointer; transition: background .1s;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .ss-option:hover { background: var(--green-pale); }
    .ss-option.selected { background: #e6f2ee; font-weight: 600; color: var(--green); }
    .ss-no-result { padding: 12px 10px; font-size: 12px; color: var(--muted); text-align: center; }

    @media print {
      html, body { margin: 0; padding: 0; height: auto; overflow: visible; }
      .layout, .topbar, .sidebar, .toast-container, .photo-fullscreen,
      .modal-backdrop:not(#exportReportModal) { display: none !important; }
      
      #exportReportModal {
        display: block !important; position: static; width: 100%; height: auto;
        background: #fff !important; opacity: 1 !important; pointer-events: auto !important;
      }
      #exportReportModal .modal {
        width: 100% !important; max-width: 100% !important; box-shadow: none !important;
        transform: none !important; border-radius: 0 !important; max-height: none !important;
        display: block !important; overflow: visible !important;
      }
      #exportReportModal .modal-header { display: none !important; }
      #exportReportModal .modal-body { overflow: visible !important; flex: none !important; padding: 0 !important; }
      .export-a4 { padding: 10px 36px !important; }
      .export-a4 .export-photo-grid { grid-template-columns: repeat(3, 25%); justify-content: space-between; gap: 2mm; }
      .export-a4 .export-photo-slot, .export-a4 .export-photo-image { break-inside: avoid; page-break-inside: avoid; }
      .export-a4 .export-photo-image { height: 40mm; }
      .export-a4 .export-photo-grid img { width: 100%; height: 100%; object-fit: contain; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
      .export-inspect-item.checked { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
      .export-page-break { page-break-before: always; border: none; margin: 0; }
      /* 不为浏览器默认页眉页脚预留额外边距；浏览器打印设置中的“页眉和页脚”仍需关闭。 */
      @page { margin: 0; size: A4; }
      .export-a4 { padding: 10mm 12mm !important; }
    }

    /* ===== Responsive ===== */
    @media(max-width:1200px) {
      .stat-row { grid-template-columns: 1fr 1fr; }
      .emp-card-grid { grid-template-columns: 1fr 1fr; }
    }
    @media(max-width:900px) {
      .sidebar { width: 60px; }
      .sidebar-logo h1, .sidebar-logo p, .sidebar-nav .nav-group-title,
      .sidebar-nav .nav-item span, .sidebar-nav .nav-badge { display: none; }
      .sidebar-nav .nav-item { justify-content: center; padding: 12px; }
      .stat-row { grid-template-columns: 1fr 1fr; }
      .emp-card-grid { grid-template-columns: 1fr; }
      .detail-grid { grid-template-columns: 1fr; }
      .photo-grid { grid-template-columns: repeat(2, 1fr); }
      .form-grid { grid-template-columns: 1fr; }
    }
