/* === 飞利浦 Dynalite 安装指导报告生成器 === */

:root {
  --philips-blue: #0066a1;
  --philips-light: #0099cc;
  --philips-dark: #004b75;
  --accent: #00a0e9;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #e4e8ec;
  --text: #1a1f2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 0.15s ease;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

.app-container {
  display:flex; flex-direction:column;
  height:100vh; height:100dvh; overflow:hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* === Header === */
.header {
  display:flex; align-items:center; justify-content:space-between;
  height:56px; padding:0 20px;
  background: linear-gradient(135deg, var(--philips-dark), var(--philips-blue));
  color: white; flex-shrink:0; z-index:100;
}

.header-left { display:flex; align-items:center; gap:16px; }
.header-divider { width:1px; height:32px; background:rgba(255,255,255,0.3); }

.brand { display:flex; flex-direction:column; line-height:1.2; }
.brand-philips { font-size:16px; font-weight:900; letter-spacing:2px; }
.brand-dynalite { font-size:11px; font-weight:400; opacity:0.85; letter-spacing:1px; }

.header-title { font-size:15px; font-weight:600; }
.header-subtitle { font-size:10px; opacity:0.7; }

.header-right { display:flex; gap:8px; align-items:center; }

/* === Buttons === */
.btn {
  padding:7px 16px; border:none; border-radius:var(--radius);
  font-size:13px; font-weight:600; cursor:pointer;
  transition: all var(--transition); white-space:nowrap;
  display:flex; align-items:center; gap:4px;
}

.btn-primary { background:white; color:var(--philips-blue); }
.btn-primary:hover { background:#e6f4fc; transform:translateY(-1px); box-shadow:var(--shadow); }

.btn-report {
  background: var(--accent); color:white; font-size:14px;
  padding:8px 24px; font-weight:700;
}
.btn-report:hover { background:#0091d4; transform:translateY(-1px); box-shadow:0 2px 8px rgba(0,0,0,0.15); }

.btn-ghost { background:rgba(255,255,255,0.1); color:white; }
.btn-ghost:hover { background:rgba(255,255,255,0.2); }

.btn-outline { background:white; border:1.5px solid var(--border); color:var(--text-secondary); }
.btn-outline:hover { border-color:var(--philips-blue); color:var(--philips-blue); }

.btn-close { background:var(--bg); color:var(--text); padding:7px 12px; }
.btn-close:hover { background:#e5e7eb; }

.btn-sm { padding:4px 10px; font-size:12px; }

/* === Main Layout === */
.main-content { display:flex; flex:1; overflow:hidden; }

/* === Project Bar === */
.project-bar {
  flex-shrink:0; border-bottom:1px solid var(--border);
  background:var(--surface); padding:8px 16px;
}
.project-bar-inner {
  display:flex; gap:10px; align-items:flex-end; flex-wrap:wrap;
}
.pb-field { display:flex; flex-direction:column; gap:2px; min-width:100px; }
.pb-field label {
  font-size:13px; color:var(--text); font-weight:700;
  white-space:nowrap;
}
.pb-field input {
  padding:6px 10px; border:1.5px solid var(--border);
  border-radius:var(--radius-sm); font-size:14px; outline:none;
  width:140px; transition:border-color var(--transition);
}
.pb-field input:focus { border-color:var(--philips-blue); }
.pb-field input[type="date"] { width:135px; }
.pb-field-wide { flex:1; min-width:160px; }
.pb-field-wide input { width:100%; }

.pb-locate-row { display:flex; gap:4px; align-items:center; width:290px; }
.pb-locate-row input { flex:1; width:auto; }
#engineerName { width:80px; }
.btn-locate {
  width:30px; height:30px; border:1.5px solid var(--border);
  border-radius:var(--radius-sm); background:var(--bg);
  cursor:pointer; font-size:14px; display:flex;
  align-items:center; justify-content:center;
  transition:all var(--transition); flex-shrink:0; padding:0;
}
.btn-locate:hover { border-color:var(--philips-blue); background:#e6f4fc; }
.btn-locate.loading { opacity:0.6; pointer-events:none; animation:pulse 0.8s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* === Sidebar === */
.sidebar {
  width:240px; background:var(--surface); border-right:1px solid var(--border);
  display:flex; flex-direction:column; flex-shrink:0;
}
.sidebar-search { padding:8px 12px; border-bottom:1px solid var(--border); }
.sidebar-search input {
  width:100%; padding:7px 10px; border:1.5px solid var(--border);
  border-radius:var(--radius); font-size:12px; outline:none;
  transition:border-color var(--transition);
}
.sidebar-search input:focus { border-color:var(--philips-blue); }

/* 软件安装教程入口 */
.sw-tutorial-entry {
  display:flex; align-items:center; justify-content:center; gap:6px;
  padding:6px 10px; margin:6px 6px 2px;
  background:linear-gradient(135deg, #eef2ff, #e0e7ff);
  border:1.5px solid #a5b4fc; border-radius:6px; cursor:pointer;
  transition:all var(--transition);
}
.sw-tutorial-entry:hover {
  background:linear-gradient(135deg, #e0e7ff, #c7d2fe);
  border-color:#6366f1; transform:translateY(-1px);
  box-shadow:0 2px 8px rgba(99,102,241,0.2);
}
.sw-tutorial-entry.active {
  background:linear-gradient(135deg, #c7d2fe, #a5b4fc);
  border-color:#4f46e5;
}
.sw-tutorial-icon { font-size:14px; flex-shrink:0; }
.sw-tutorial-title { font-size:11px; font-weight:700; color:#4338ca; }

.category-nav { flex-shrink:0; overflow-y:auto; padding:3px 4px; max-height:38%; border-bottom:1px solid var(--border); }
.category-item {
  display:flex; align-items:center; gap:5px; padding:3px 8px;
  border-radius:var(--radius); cursor:pointer; font-size:12px;
  transition:all var(--transition); margin-bottom:0;
  border:1.5px solid transparent; color:var(--text-secondary);
}
.category-item:hover { background:var(--bg); color:var(--text); }
.category-item.active {
  background:#e6f4fc; border-color:var(--philips-light);
  color:var(--philips-blue); font-weight:600;
}
.category-item .cat-icon { font-size:14px; width:18px; text-align:center; }
.category-item .cat-count {
  margin-left:auto; background:var(--border); padding:0 6px;
  border-radius:10px; font-size:10px; font-weight:600;
}
.category-item.active .cat-count { background:var(--philips-blue); color:white; }

.sidebar-footer {
  padding:5px 12px; border-top:1px solid var(--border);
  font-size:11px; color:var(--text-muted); text-align:center; flex-shrink:0;
}

/* === Device Panel === */
.device-panel { flex:1; overflow-y:auto; padding:12px 16px; scroll-behavior:smooth; }

.category-section { margin-bottom:2px; }

.category-header {
  display:flex; align-items:center; gap:10px; margin-bottom:6px;
}
.category-header h2 { font-size:18px; font-weight:700; color:var(--text); }
.category-header span { font-size:13px; color:var(--text-secondary); }

.category-divider {
  height:1px; background:linear-gradient(to right, transparent, var(--philips-light), transparent);
  margin:16px 0 2px; opacity:0.5;
}

.device-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(340px, 1fr)); gap:6px; }

/* Device Card */
.device-card {
  background:var(--surface); border:2px solid var(--border);
  border-radius:var(--radius); padding:6px 10px; cursor:pointer;
  transition:all var(--transition); position:relative;
  display:flex; gap:8px;
  user-select:none; -webkit-user-select:none;
  -webkit-touch-callout:none;
}
.device-card:hover { border-color:var(--philips-light); box-shadow:var(--shadow); }
.device-card.selected { border-color:var(--philips-blue); background:#f0f9ff; }

/* 禁用设备卡片 */
.device-card.device-disabled {
  cursor: not-allowed; opacity:0.6; filter:grayscale(30%);
}
.device-card.device-disabled:hover {
  border-color:var(--border); box-shadow:none;
}
.device-card.device-disabled .card-check {
  opacity:0.4; pointer-events:none;
}

.device-card .card-check {
  width:22px; height:22px; min-width:22px; border-radius:6px;
  border:2px solid var(--border); display:flex; align-items:center;
  justify-content:center; transition:all var(--transition); margin-top:0;
}
.device-card.selected .card-check { background:var(--philips-blue); border-color:var(--philips-blue); }
.device-card.selected .card-check::after { content:'✓'; color:white; font-size:13px; font-weight:bold; }

.device-card .card-body { flex:1; min-width:0; }
.device-card .card-model { font-size:12px; font-weight:700; color:var(--philips-blue); letter-spacing:0.3px; line-height:1.3; }
.device-card .card-name { font-size:13px; font-weight:600; margin:0; line-height:1.3; }
.device-card .card-desc { font-size:11px; color:var(--text-secondary); line-height:1.3; margin-bottom:2px; }
.device-card .card-tags { display:flex; flex-wrap:wrap; gap:3px; }
.device-card .card-tag {
  font-size:10px; background:var(--bg); padding:1px 6px;
  border-radius:var(--radius-sm); color:var(--text-secondary); line-height:1.3;
}

.device-card .card-qr-badge {
  width:52px; min-width:52px; height:52px; border-radius:4px;
  border:1px solid var(--border); overflow:hidden; position:relative;
  display:flex; align-items:center; justify-content:center;
  background:white;
}
.device-card .card-qr-badge img { width:48px; height:48px; object-fit:contain; }
.device-card .card-qr-badge .qr-label {
  position:absolute; bottom:0; left:0; right:0;
  background:rgba(0,0,0,0.6); color:white; font-size:8px;
  text-align:center; padding:1px 0; line-height:1;
}

/* 设备照片 - 卡片内 */
.device-card .card-photo {
  width:70px; min-width:70px; height:70px; border-radius:6px;
  border:1px solid var(--border); overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  background:white; flex-shrink:0;
}
.device-card .card-photo img {
  width:100%; height:100%; object-fit:contain; padding:2px;
}

/* === Sidebar Cart (已选设备) === */
.sidebar-cart {
  flex:1; display:flex; flex-direction:column; min-height:0;
  border-bottom:1px solid var(--border);
}
.sidebar-cart-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:5px 12px; font-size:12px; font-weight:700; color:var(--philips-blue);
  flex-shrink:0;
}
.sidebar-cart-body { flex:1; overflow-y:auto; padding:0 6px 4px; }

.cart-badge {
  background:var(--philips-blue); color:white; min-width:22px; height:22px;
  border-radius:11px; display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; padding:0 6px;
}

.cart-empty-state { text-align:center; padding:20px 12px; }
.cart-empty-text { font-size:11px; color:var(--text-muted); line-height:1.5; }

.cart-item {
  display:flex; align-items:center; gap:6px; padding:4px 8px;
  border-radius:var(--radius); margin-bottom:1px;
  background:var(--bg); transition:all var(--transition);
}
.cart-item:hover { background:#e6f4fc; }
.cart-item .ci-info { flex:1; min-width:0; }
.cart-item .ci-model { font-size:11px; font-weight:700; color:var(--philips-blue); }
.cart-item .ci-name { font-size:11px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cart-item .ci-remove {
  width:18px; height:18px; border-radius:50%; border:none;
  background:#fee2e2; color:var(--danger); cursor:pointer;
  font-size:12px; display:flex; align-items:center; justify-content:center;
  transition:all var(--transition); flex-shrink:0; line-height:1;
}
.cart-item .ci-remove:hover { background:var(--danger); color:white; }

/* === Sidebar Options (报告选项) === */
.sidebar-options {
  flex-shrink:0; padding:0;
  border-bottom:1px solid var(--border);
}
.sidebar-options-header {
  padding:4px 12px; font-size:11px; font-weight:700; color:var(--philips-blue);
}
.report-options { display:flex; flex-direction:column; gap:0; padding:0 12px 4px; }
.check-label {
  display:flex; align-items:center; gap:5px; font-size:11px;
  color:var(--text-secondary); cursor:pointer; padding:2px 0;
}
.check-label input[type="checkbox"] {
  accent-color:var(--philips-blue); width:13px; height:13px;
}

/* === Remove old cart-panel & cart-project === */
.cart-panel, .cart-project { display:none; }

/* === Modal === */
.modal-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5);
  z-index:1000; align-items:center; justify-content:center;
}
.modal-overlay.active { display:flex; }

.modal-content {
  background:var(--surface); border-radius:var(--radius); width:96%;
  max-width:1100px; max-height:92vh; display:flex; flex-direction:column;
  box-shadow:0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px; border-bottom:1px solid var(--border); flex-shrink:0;
}
.modal-header h2 { font-size:16px; color:var(--philips-blue); }
.modal-header-actions { display:flex; gap:6px; }

.modal-body { flex:1; overflow-y:auto; padding:24px; }

/* === Report Print Styles === */
@media print {
  body * { visibility:hidden; }
  .modal-overlay, .modal-overlay * { visibility:visible; }
  .modal-overlay { position:absolute; inset:0; background:white; }
  .modal-content { box-shadow:none; max-width:100%; max-height:none; border-radius:0; }
  .modal-header { display:none; }
  .modal-body { padding:0; background:white; }
  .report-page {
    width:auto; min-height:auto; max-width:none; padding:0; margin:0;
    box-shadow:none; border-radius:0; background:transparent;
    page-break-after:always;
  }
  .report-page::after { display:none; }
  .report-page-cover { min-height:100vh; }
  .device-block { break-inside:avoid; page-break-inside:avoid; }
  .report-section { break-inside:avoid; page-break-inside:avoid; }
}

/* ========== A4 报告预览模式 ========== */
.report-preview-mode {
  background:#e5e7eb;
  padding:20px 12px;
}

.report {
  display:flex; flex-direction:column; align-items:center;
  gap:20px;
  font-size:13px; line-height:1.7; color:#1a1f2e;
}

/* A4 纸页 */
.report-page {
  width:210mm; min-height:297mm;
  background:white;
  padding:20mm 18mm 22mm 18mm;
  box-shadow:0 2px 12px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
  box-sizing:border-box;
  position:relative;
  overflow:hidden;
}

/* 封面页特殊处理 */
.report-page-cover {
  display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start;
}

/* 页码 */
.report-page::after {
  content:attr(data-page);
  position:absolute; bottom:8mm; left:0; right:0;
  text-align:center; font-size:10px; color:#9ca3af;
}

/* ---- 封面 ---- */
.report-cover {
  text-align:left;
  width:100%;
}
.report-cover .rc-logo { font-size:28px; font-weight:900; color:var(--philips-blue); letter-spacing:2px; margin-bottom:12px; }
.report-cover .rc-title { font-size:22px; font-weight:700; margin:12px 0; }
.report-cover .rc-subtitle { font-size:13px; color:var(--text-secondary); margin-bottom:16px; }

.report-meta {
  display:grid; grid-template-columns:1fr 1fr; gap:6px 20px;
  padding:16px 20px; background:var(--bg); border-radius:var(--radius);
  font-size:12px; max-width:500px; width:100%; text-align:left;
}
.report-meta .rm-item { display:flex; gap:6px; }
.report-meta .rm-label { color:var(--text-secondary); font-weight:500; white-space:nowrap; }

/* ---- 章节 ---- */
.report-section { }
.report-section h3 {
  font-size:12px; color:var(--philips-blue); border-bottom:2px solid var(--philips-light);
  padding-bottom:2px; margin-bottom:4px;
}
.report-section h4 {
  font-size:10px; color:var(--philips-dark); margin:4px 0 2px;
  padding-left:6px; border-left:3px solid var(--philips-blue);
}
.report-section-desc {
  font-size:9px; color:var(--text-secondary); margin-bottom:4px;
}

/* 目录表格 */
.toc-main-title {
  text-align:center; font-size:20px; letter-spacing:10px;
  color:var(--philips-blue); margin-bottom:20px; padding-bottom:12px;
  border-bottom:2px solid var(--philips-light);
}

/* 目录章节块 */
.toc-chapter {
  margin-bottom:12px;
}
.toc-chapter h3 {
  font-size:14px; color:var(--philips-blue); margin-bottom:6px;
  padding-bottom:4px; border-bottom:1px solid var(--border);
}

/* 目录二级子项 */
.toc-sub {
  font-size:12px; color:var(--text-secondary); margin-bottom:3px;
  padding-left:16px; line-height:1.5;
  position:relative;
}
.toc-sub::before {
  content:''; position:absolute; left:4px; top:8px;
  width:5px; height:5px; background:var(--philips-blue);
  border-radius:50%;
}

/* 目录页简单页码对照表 */
.toc-simple-table {
  width:100%; border-collapse:collapse; font-size:11px; margin-top:2px;
}
.toc-simple-table td {
  padding:2px 8px; border-bottom:1px dotted #e4e8ec;
}
.toc-simple-table td:first-child {
  color:var(--philips-blue); font-weight:600;
}

.toc-table {
  width:100%; border-collapse:collapse; font-size:11px; margin-top:2px;
}
.toc-table th {
  background:var(--philips-blue); color:white; padding:4px 8px;
  text-align:left; font-size:10px; white-space:nowrap;
}
.toc-table td {
  padding:2px 8px; border-bottom:1px solid var(--border);
  white-space:nowrap;
}
.toc-table .toc-section {
  font-weight:700; color:var(--philips-dark);
  background:#f5f7fa;
}
/* 目录页特殊页码样式 */
.report-page-toc { }
.report-page-toc h3 {
  text-align:left; font-size:14px; letter-spacing:normal;
}

/* 报告底部状态栏 */
.report-footer-bar {
  text-align:left; width:100%; max-width:210mm;
  padding:14px 18mm; color:var(--text-muted); font-size:11px; line-height:1.6;
}

/* === 软件安装教程面板 === */
.sw-tutorial-panel {
  padding:20px 24px; max-width:800px;
}
.sw-tutorial-header {
  border-bottom:2px solid var(--philips-light);
  padding-bottom:12px; margin-bottom:16px;
}
.sw-tutorial-header h2 {
  font-size:18px; color:var(--philips-blue); margin:0 0 4px;
}
.sw-tutorial-header p {
  font-size:12px; color:var(--text-secondary); margin:0;
}
.sw-pdf-download {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  margin-top:8px; padding:7px 32px; min-width:200px;
  background:linear-gradient(135deg, #fee2e2, #fecaca);
  border:1px solid #f87171; border-radius:6px;
  font-size:13px; font-weight:700; color:#b91c1c;
  text-decoration:none; cursor:pointer;
  transition:all 0.2s;
}
.sw-pdf-download:hover {
  background:linear-gradient(135deg, #fecaca, #fca5a5);
  box-shadow:0 2px 8px rgba(239,68,68,0.25);
  transform:translateY(-1px);
}
.sw-tutorial-section {
  background:var(--bg); border-radius:8px; padding:14px 18px;
  margin-bottom:14px; border-left:4px solid #6366f1;
}
.sw-tutorial-section h3 {
  font-size:15px; color:#4338ca; margin:0 0 4px;
}
.sw-sec-subtitle {
  font-size:11px; color:var(--text-secondary); margin:0 0 8px;
}
.sw-tutorial-section .step-list {
  margin:0;
}
.sw-tutorial-section .step-list li {
  font-size:13px; line-height:1.7; padding:3px 0;
}

/* 软件教程图片样式 */
.sw-step-img {
  display:block; max-width:100%; max-height:320px;
  margin:6px 0 2px; border-radius:6px; border:1px solid var(--border);
  cursor:zoom-in; transition:transform 0.2s;
}
.sw-step-img:hover { transform:scale(1.02); }
.sw-note-img {
  display:block; max-width:160px; margin:8px auto 0;
  border-radius:4px; border:1px solid var(--border);
}
.sw-img-gallery {
  display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 10px;
}
.sw-gallery-img {
  max-width:180px; max-height:180px; border-radius:6px;
  border:1px solid var(--border); cursor:zoom-in;
  object-fit:contain; background:#f8fafc;
}
.sw-img-zoom-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.75);
  display:flex; align-items:center; justify-content:center;
  z-index:9999; cursor:zoom-out;
}
.sw-step-text { margin-bottom:2px; }
.sw-step-note {
  font-size:12px; font-weight:700; color:#b91c1c;
  background:#fef2f2; border-left:3px solid #ef4444;
  padding:4px 10px; margin:4px 0 6px; border-radius:0 4px 4px 0;
}

/* Report内图片适配 */
.report-section .sw-step-img { max-height:260px; }
.report-section .sw-gallery-img { max-width:150px; max-height:150px; }
.report-section .sw-note-img { max-width:120px; }

/* Device Block */
.device-block {
  background:var(--bg); border-radius:var(--radius); padding:12px; margin-bottom:10px;
  border-left:3px solid var(--philips-blue);
}
.device-block .db-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.device-block .db-model { font-size:17px; color:var(--philips-blue); font-weight:700; }
.device-block .db-name { font-size:20px; font-weight:700; }

.device-block .db-qr-area {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:white; padding:6px 10px; border-radius:var(--radius);
  margin:4px 0; border:1px dashed var(--border);
}
.device-block .db-qr-img { width:240px; min-width:240px; height:240px; border-radius:4px; border:1px solid var(--border); }
.device-block .db-qr-text { font-size:10px; color:var(--text-secondary); line-height:1.4; flex:1; }
.device-block .db-qr-text strong { color:var(--philips-blue); }
.db-peer-note { display:inline-block; color:#d97706; font-weight:600; font-size:10px; background:#fffbeb; padding:2px 6px; border-radius:3px; border:1px solid #fcd34d; margin-top:1px; }

.device-block .db-photo-area {
  display:flex; align-items:center; gap:8px;
  background:white; padding:4px 8px; border-radius:var(--radius);
  margin:3px 0; border:1px dashed var(--border);
}
.device-block .db-photo-img {
  width:160px; border-radius:4px; border:1px solid var(--border);
  object-fit:contain;
}
.device-block .db-photo-text {
  font-size:10px; color:var(--text-secondary);
}

/* Tables */
.spec-table { width:100%; border-collapse:collapse; font-size:10px; margin:6px 0 8px; }
.spec-table tr:not(:last-child) td { border-bottom:1px solid var(--border); }
.spec-table td { padding:3px 8px; }
.spec-table td:first-child { color:var(--text-secondary); font-weight:500; width:110px; }

.wiring-table { width:100%; border-collapse:collapse; font-size:10px; margin:6px 0 8px; }
.wiring-table th { background:var(--philips-blue); color:white; padding:4px 8px; text-align:left; font-size:10px; }
.wiring-table td { padding:3px 8px; border-bottom:1px solid var(--border); }

/* Lists */
.step-list { counter-reset:step; list-style:none; padding:0; }
.step-list li {
  padding:3px 0 3px 22px; position:relative; font-size:10px;
  border-bottom:1px dashed var(--border); line-height:1.5;
}
.step-list li::before {
  counter-increment:step; content:counter(step);
  position:absolute; left:0; top:3px;
  width:16px; height:16px; background:var(--philips-blue);
  color:white; border-radius:50%; font-size:9px;
  display:flex; align-items:center; justify-content:center;
}

.warn-list {
  list-style:none; padding:8px 10px;
  background:#fef2f2; border:1px solid #ef4444;
  border-radius:6px; margin:8px 0;
}
.warn-list li {
  padding:4px 0 4px 20px; position:relative; font-size:11px;
  color:#991b1b; line-height:1.6;
}
.warn-list li::before { content:'⚠️'; position:absolute; left:0; top:4px; font-size:11px; }
.warn-list li strong { color:#dc2626; font-size:14px; }

/* 系统要求（左文字右图片） */
.sys-req-row {
  display:flex; align-items:flex-start; gap:12px;
  background:white; padding:8px 10px; border-radius:6px;
  margin:6px 0; border:1px solid #e4e8ec;
}
.sys-req-text { flex:1; min-width:0; }
.sys-req-text ul { margin:0; padding-left:16px; }
.sys-req-text li { font-size:11px; color:var(--text); line-height:1.5; }
.sys-req-img { width:170px; min-width:170px; border-radius:4px; border:1px solid var(--border); object-fit:contain; }
/* 系统配置大框 */
.sys-req-box {
  background:#fef2f2; border:1px dashed #ef4444;
  padding:8px 10px; border-radius:6px;
  margin:8px 0;
}
.sys-req-box h4 { margin-top:6px; margin-bottom:6px; }
.sys-req-box .sys-req-row {
  border:1px solid #e4e8ec;
}
.sys-req-notice {
  font-size:11px; font-weight:700; color:#b91c1c;
  text-align:center; padding:6px 8px 2px;
  margin-top:6px;
}

.checklist-table { width:100%; border-collapse:collapse; font-size:12px; margin-top:6px; }
.checklist-table th { background:var(--philips-blue); color:white; padding:5px 10px; text-align:left; font-size:11px; }
.checklist-table td { padding:4px 10px; border-bottom:1px solid var(--border); }
.checklist-table .chk-box { text-align:center; font-size:14px; }

.trouble-block {
  background:white; padding:5px 8px; border-radius:6px;
  margin-bottom:4px; border:1px solid #e4e8ec;
  border-left:3px solid var(--philips-blue);
}
.trouble-block .tb-header {
  display:flex; align-items:center; gap:6px; margin-bottom:3px;
  padding-bottom:3px; border-bottom:1px solid #e4e8ec;
}
.trouble-block .tb-num {
  width:20px; height:20px; display:flex; align-items:center; justify-content:center;
  background:var(--philips-blue); color:white; border-radius:50%;
  font-size:9px; font-weight:700; flex-shrink:0;
}
.trouble-block .tb-title {
  font-weight:700; color:var(--text); font-size:11px;
}
.trouble-block .tb-row {
  display:flex; gap:4px; margin-bottom:2px; font-size:10px; line-height:1.4;
}
.trouble-block .tb-label {
  flex-shrink:0; color:var(--philips-blue); font-weight:600; font-size:9px;
}
.trouble-block .tb-value {
  color:var(--text-secondary);
}
.trouble-block .tb-close {
  margin-top:3px; padding-top:3px; border-top:1px dashed #e4e8ec;
}
.trouble-block .tb-close .tb-label {
  color:#16a34a;
}
.trouble-block .tb-close .tb-value {
  color:#15803d; font-weight:500;
}

/* === 报告内调试条件确认单表格 === */
.report-checklist-wrap {
  margin:8px 0; overflow-x:auto;
}
.report-checklist-table {
  width:100%; border-collapse:collapse; font-size:12px;
  margin-bottom:16px;
}
.report-checklist-table thead th {
  background:var(--philips-blue); color:white;
  padding:7px 12px; text-align:left; font-size:11px; font-weight:600;
}
.report-checklist-table thead th:first-child {
  border-radius:6px 0 0 0;
}
.report-checklist-table thead th:last-child {
  border-radius:0 6px 0 0;
}
.report-checklist-table tbody td {
  padding:8px 12px; border-bottom:1px solid #e4e8ec;
  line-height:1.6; color:var(--text);
}
.report-checklist-table tbody tr:nth-child(even) td {
  background:#f8fafc;
}
.report-checklist-footer-table {
  width:100%; border-collapse:collapse; font-size:12px;
}
.report-checklist-footer-table thead th {
  background:#475569; color:white;
  padding:7px 12px; text-align:left; font-size:11px; font-weight:600;
}
.report-checklist-footer-table thead th:first-child {
  border-radius:6px 0 0 0;
}
.report-checklist-footer-table thead th:last-child {
  border-radius:0 6px 0 0;
}
.report-checklist-footer-table tbody td {
  padding:11px 12px; border:1px solid #e4e8ec;
  line-height:1.6; color:var(--text); background:#fafbfc;
  font-weight:600; font-size:12px;
}

/* === 施工图及要求 === */
.construct-section {
  margin-bottom:14px; padding-bottom:8px;
  border-bottom:1px solid #e4e8ec;
}
.construct-section:last-child { border-bottom:none; }
.construct-section h4 {
  font-size:13px; color:var(--philips-blue); margin:0 0 6px;
  padding-bottom:4px; border-bottom:1px solid var(--philips-light);
}
.construct-intro {
  font-size:12px; color:var(--text); margin:0 0 6px; line-height:1.7;
}
.construct-items {
  margin:4px 0 8px; padding-left:20px; font-size:12px; color:var(--text); line-height:1.7;
}
.construct-items li { margin-bottom:3px; }
.construct-req-box {
  background:#fff7ed; border:1px solid #fdba74; border-radius:6px;
  padding:8px 12px; margin:8px 0; font-size:12px;
}
.construct-req-box strong { color:#c2410c; display:block; margin-bottom:4px; }
.construct-req-box ul { margin:0; padding-left:18px; color:#9a3412; line-height:1.7; }
.construct-restrict-box {
  background:#fef2f2; border-color:#fca5a5;
}
.construct-restrict-box strong { color:#dc2626; }
.construct-restrict-box ul { color:#991b1b; }
.construct-example {
  background:#f0f9ff; border:1px solid #7dd3fc; border-radius:6px;
  padding:8px 12px; margin:8px 0; font-size:12px;
}
.construct-example-title {
  font-weight:700; color:#0369a1; margin:0 0 4px;
}
.construct-example-correct {
  color:#15803d; margin:2px 0; font-weight:500;
}
.construct-example-wrong {
  color:#dc2626; margin:2px 0; font-weight:500;
}
.construct-note {
  background:#fffbeb; border:1px solid #fcd34d; border-radius:6px;
  padding:8px 12px; margin:8px 0; font-size:12px;
  color:#92400e; line-height:1.7;
}

/* === 模块安装 === */
.module-env-intro {
  font-size:9px; color:#64748b; margin:1px 0 4px; font-style:italic; line-height:1.3;
}
.module-env-table-wrap {
  overflow-x:auto; margin:4px 0 6px;
}
.module-env-table {
  width:100%; border-collapse:collapse; font-size:9px; table-layout:auto;
}
.module-env-table th {
  background:var(--philips-blue); color:white; padding:4px 6px; text-align:left; font-size:9px; white-space:nowrap;
}
.module-env-table td {
  padding:2px 6px; border-bottom:1px solid #e4e8ec; line-height:1.3; white-space:nowrap; font-size:9px;
}
.module-env-table tr:nth-child(even) td { background:#f8fafc; }
.module-env-table .env-source {
  font-size:8px; color:#64748b; white-space:nowrap;
}
.module-req-list {
  margin:4px 0 6px; padding-left:20px; font-size:10px; color:var(--text); line-height:1.4;
}
.module-req-list li {
  margin-bottom:1px; padding:1px 0;
}
.module-req-list li::marker { color:var(--philips-blue); }
.module-img-grid {
  display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:6px 0 8px;
}
.module-img-card {
  border:1px solid #e4e8ec; border-radius:6px; overflow:hidden;
  background:#fafbfc; transition:box-shadow 0.2s;
}
.module-img-card:hover {
  box-shadow:0 2px 10px rgba(0,102,161,0.12);
}
.module-img-placeholder {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-height:120px; background:linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-bottom:1px solid #cbd5e1; padding:10px 10px; text-align:center;
}
.module-img-placeholder .module-img-icon {
  font-size:36px; opacity:0.35; margin-bottom:4px;
}
.module-img-placeholder .module-img-label {
  font-size:10px; font-weight:700; color:#475569;
}
.module-img-placeholder .module-img-hint {
  font-size:9px; color:#94a3b8; margin-top:2px;
}
.module-img-desc {
  font-size:9px; color:#64748b; padding:4px 8px; margin:0;
  line-height:1.3; text-align:center;
}

/* === 安装后的检查 === */
.pcheck-list {
  margin:8px 0 14px;
}
.pcheck-item {
  display:flex; align-items:flex-start; gap:12px;
  padding:9px 14px; margin-bottom:8px;
  background:#f8fafc; border-left:3px solid #22c55e;
  border-radius:0 6px 6px 0; font-size:12px; line-height:1.7;
}
.pcheck-num {
  flex-shrink:0; width:26px; height:26px;
  display:flex; align-items:center; justify-content:center;
  background:#22c55e; color:white; border-radius:50%;
  font-size:12px; font-weight:700;
}
.pcheck-text {
  color:var(--text); padding-top:2px;
}
.pcheck-warning {
  background:#fef2f2; border:1px solid #fca5a5;
  border-left:4px solid #dc2626; border-radius:6px;
  padding:12px 16px; margin:14px 0;
}
.pcheck-warning strong {
  color:#dc2626; display:block; margin-bottom:4px; font-size:13px;
}
.pcheck-warning p {
  color:#991b1b; margin:0; font-size:12px; line-height:1.7;
}

/* === 设备强启 (Set 按钮临时开灯) === */
.forceon-desc-wrap {
  background:#f0f7ff; border:1px solid #b9d9f5; border-radius:6px;
  padding:8px 12px; margin:6px 0 8px;
}
.forceon-desc-text {
  font-size:11px; color:var(--text); line-height:1.5; margin:0;
}
.forceon-img-grid {
  display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin:4px 0 8px;
}
.forceon-img-card {
  border:1px solid #e4e8ec; border-radius:6px; overflow:hidden;
  background:#fafbfc;
}
.forceon-img-placeholder {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-height:140px; background:linear-gradient(135deg, #f1f5f9, #e2e8f0);
  padding:12px; text-align:center;
}
.forceon-img-placeholder .forceon-img-icon {
  font-size:38px; opacity:0.35; margin-bottom:4px;
}
.forceon-img-placeholder .forceon-img-label {
  font-size:11px; font-weight:700; color:#475569;
}
.forceon-img-placeholder .forceon-img-hint {
  font-size:9px; color:#94a3b8; margin-top:2px;
}

/* 紧凑安装方式表格 */
.report-install-table {
  width:100%; border-collapse:collapse; font-size:10px; margin:4px 0 8px;
}
.report-install-table th {
  background:var(--philips-blue); color:white; padding:4px 8px;
  text-align:left; font-size:10px; white-space:nowrap;
}
.report-install-table td {
  padding:3px 8px; border-bottom:1px solid #e4e8ec;
  white-space:nowrap; line-height:1.4;
}
.report-install-table tr:nth-child(even) td {
  background:#f8fafc;
}

.report-footer-bar {
  text-align:left; width:100%; max-width:210mm;
  padding:14px 18mm; color:var(--text-muted); font-size:11px; line-height:1.6;
}

/* === 标准资料下载面板 === */
.ref-docs-panel {
  padding:20px 24px; max-width:960px;
}

.ref-docs-header {
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:24px; padding-bottom:16px; border-bottom:2px solid var(--philips-light);
  margin-bottom:12px; flex-wrap:wrap;
}
.ref-docs-header-text h2 {
  font-size:18px; color:var(--philips-blue); margin:0 0 4px;
}
.ref-docs-header-text p {
  font-size:12px; color:var(--text-secondary); margin:0; max-width:420px;
}
.ref-docs-search {
  padding:8px 14px; border:1.5px solid var(--border); border-radius:8px;
  font-size:13px; outline:none; min-width:220px;
  transition:border-color var(--transition);
  align-self:center;
}
.ref-docs-search:focus { border-color:var(--philips-blue); }

/* 统计栏 */
.ref-docs-stats {
  display:flex; align-items:center; justify-content:space-between;
  font-size:12px; color:var(--text-secondary); margin-bottom:16px;
  flex-wrap:wrap; gap:6px;
}
.ref-docs-types { display:flex; gap:6px; }
.ref-type-badge {
  padding:2px 10px; border-radius:10px; font-size:10px; font-weight:700;
}
.type-pdf { background:#fee2e2; color:#b91c1c; }
.type-dwg { background:#dbeafe; color:#1d4ed8; }
.type-xlsx { background:#d1fae5; color:#047857; }

/* 分类区块 */
.ref-docs-body { display:flex; flex-direction:column; gap:20px; }
.ref-docs-category { /* container */ }
.ref-cat-header {
  display:flex; align-items:baseline; gap:10px; margin-bottom:10px;
}
.ref-cat-header h3 {
  font-size:15px; color:#4338ca; margin:0;
}
.ref-cat-icon { margin-right:2px; }
.ref-cat-desc {
  font-size:11px; color:var(--text-muted);
}

/* 文档卡片网格 */
.ref-docs-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
  gap:10px;
}

.ref-doc-card {
  background:var(--surface); border:1.5px solid var(--border);
  border-radius:var(--radius); padding:14px;
  display:flex; gap:10px; align-items:flex-start;
  transition:all var(--transition);
}
.ref-doc-card:hover {
  border-color:var(--philips-light);
  box-shadow:0 2px 8px rgba(0,102,161,0.1);
  transform:translateY(-1px);
}

.ref-doc-card-icon {
  flex-shrink:0; width:44px; height:44px;
  display:flex; align-items:center; justify-content:center;
}

.ref-doc-format-badge {
  padding:4px 8px; border-radius:4px;
  font-size:10px; font-weight:800; letter-spacing:0.5px;
  text-align:center;
}
.format-pdf { background:#fee2e2; color:#b91c1c; border:1px solid #fca5a5; }
.format-dwg { background:#dbeafe; color:#1d4ed8; border:1px solid #93c5fd; }
.format-xlsx { background:#d1fae5; color:#047857; border:1px solid #6ee7b7; }

.ref-doc-card-body { flex:1; min-width:0; }
.ref-doc-title {
  font-size:13px; font-weight:700; color:var(--text);
  line-height:1.4; margin-bottom:4px;
}
.ref-doc-desc {
  font-size:11px; color:var(--text-secondary);
  line-height:1.5; margin-bottom:6px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden;
}
.ref-doc-meta { display:flex; gap:8px; align-items:center; }
.ref-doc-size {
  font-size:10px; color:var(--text-muted);
}

.ref-doc-card-action {
  flex-shrink:0; display:flex; flex-direction:column;
  align-items:center; gap:4px;
}
.ref-doc-dl-btn {
  display:inline-flex; align-items:center; gap:4px;
  padding:6px 12px; background:var(--philips-blue);
  color:white; border-radius:6px; font-size:11px; font-weight:700;
  text-decoration:none; cursor:pointer; white-space:nowrap;
  transition:all var(--transition);
}
.ref-doc-dl-btn:hover {
  background:var(--philips-dark);
  box-shadow:0 2px 6px rgba(0,102,161,0.3);
}
.ref-doc-preview-btn {
  width:28px; height:28px; border:1.5px solid var(--border);
  border-radius:6px; background:white; cursor:pointer;
  font-size:13px; display:flex; align-items:center;
  justify-content:center; transition:all var(--transition);
}
.ref-doc-preview-btn:hover {
  border-color:var(--philips-blue); background:#e6f4fc;
}
.ref-doc-pending {
  font-size:10px; color:var(--text-muted);
  background:var(--bg); padding:6px 10px; border-radius:4px;
  white-space:nowrap;
}

/* 空状态 */
.ref-docs-empty {
  text-align:center; padding:48px 20px;
  color:var(--text-secondary);
}
.ref-docs-empty p { margin:8px 0; }

/* 底部 */
.ref-docs-footer {
  display:flex; align-items:center; justify-content:space-between;
  margin-top:24px; padding-top:14px; border-top:1px solid var(--border);
  flex-wrap:wrap; gap:10px;
}
.ref-docs-note {
  font-size:11px; color:var(--text-muted);
}

/* === 调试条件确认单表格 === */
.ref-checklist-wrap {
  margin:0; overflow-x:auto;
}
.ref-checklist-table {
  width:100%; border-collapse:collapse; font-size:12px;
  margin-bottom:20px;
}
.ref-checklist-table thead th {
  background:var(--philips-blue); color:white;
  padding:8px 12px; text-align:left; font-size:11px; font-weight:600;
  white-space:nowrap;
}
.ref-checklist-table thead th:first-child {
  border-radius:6px 0 0 0;
}
.ref-checklist-table thead th:last-child {
  border-radius:0 6px 0 0;
}
.ref-checklist-table tbody td {
  padding:9px 12px; border-bottom:1px solid #e4e8ec;
  line-height:1.6; color:var(--text);
}
.ref-checklist-table tbody tr:hover td {
  background:#f8fafc;
}
.ref-checklist-table tbody tr:nth-child(even) td {
  background:#fafbfc;
}
.ref-checklist-table tbody tr:nth-child(even):hover td {
  background:#f1f5f9;
}
.ref-checklist-footer-table {
  width:100%; border-collapse:collapse; font-size:12px;
  margin-top:0; margin-bottom:10px;
}
.ref-checklist-footer-table thead th {
  background:#475569; color:white;
  padding:8px 12px; text-align:left; font-size:11px; font-weight:600;
  white-space:nowrap;
}
.ref-checklist-footer-table thead th:first-child {
  border-radius:6px 0 0 0;
}
.ref-checklist-footer-table thead th:last-child {
  border-radius:0 6px 0 0;
}
.ref-checklist-footer-table tbody td {
  padding:12px 12px; border:1px solid #e4e8ec;
  line-height:1.6; color:var(--text); background:#fafbfc;
  vertical-align:top;
}
.ref-checklist-footer-table tbody td:first-child {
  font-weight:600; font-size:13px;
}

/* 入口高亮 */
.ref-docs-entry {
  background:linear-gradient(135deg, #fef9e7, #fef3c7) !important;
  border-color:#f59e0b !important;
}
.ref-docs-entry:hover {
  background:linear-gradient(135deg, #fef3c7, #fde68a) !important;
  border-color:#d97706 !important;
  box-shadow:0 2px 8px rgba(217,119,6,0.2) !important;
}
.ref-docs-entry.active {
  background:linear-gradient(135deg, #fde68a, #fcd34d) !important;
  border-color:#b45309 !important;
}
.ref-docs-entry .sw-tutorial-title { color:#92400e !important; }

/* 移动端适配 */
@media (max-width:640px) {
  .ref-docs-panel { padding:12px; }
  .ref-docs-header { flex-direction:column; gap:12px; }
  .ref-docs-search { width:100%; min-width:0; }
  .ref-docs-grid { grid-template-columns:1fr; }
  .ref-docs-footer { flex-direction:column; align-items:flex-start; }
}
.toast {
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%);
  background:#1a1f2e; color:white; padding:10px 24px;
  border-radius:var(--radius); font-size:13px; z-index:2000;
  animation:toastIn 0.3s ease;
  box-shadow:var(--shadow-lg);
}
.validate-alert {
  position:fixed; top:50%; left:50%; transform:translate(-50%,-50%);
  background:#fff; color:#dc2626; padding:20px 36px;
  border:3px solid #dc2626; border-radius:12px; font-size:18px;
  font-weight:700; z-index:3000; text-align:center;
  animation:alertIn 0.35s ease;
  box-shadow:0 8px 32px rgba(220,38,38,0.25);
  transition:opacity 0.4s ease;
}
@keyframes alertIn {
  from { opacity:0; transform:translate(-50%,-50%) scale(0.85); }
  to { opacity:1; transform:translate(-50%,-50%) scale(1); }
}
@keyframes toastIn {
  from { opacity:0; transform:translateX(-50%) translateY(16px); }
  to { opacity:1; transform:translateX(-50%) translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:3px; }
::-webkit-scrollbar-thumb:hover { background:#94a3b8; }



/* === Header Tabs === */
.header-tabs { display:flex; gap:4px; margin-left:4px; }
.header-tab {
  padding:6px 16px; border:none; border-radius:6px;
  font-size:13px; font-weight:600; cursor:pointer;
  background:rgba(255,255,255,0.12); color:rgba(255,255,255,0.8);
  transition:all var(--transition); white-space:nowrap;
}
.header-tab:hover { background:rgba(255,255,255,0.2); color:white; }
.header-tab.active { background:white; color:var(--philips-blue); }

/* === Tab Panels === */
.tab-panel { display:none; flex-direction:column; flex:1; min-height:0; }
.tab-panel.active { display:flex; }

/* === 报审资料布局 === */
.audit-layout { display:flex; flex:1; min-height:0; overflow:hidden; }
.audit-sidebar {
  width:340px; min-width:280px; background:white;
  border-right:1px solid var(--border); display:flex;
  flex-direction:column; overflow-y:auto;
}
.audit-main {
  flex:1; overflow-y:auto; padding:16px 20px;
  background:var(--bg);
}
.audit-section {
  padding:12px 14px; border-bottom:1px solid var(--border);
}
.audit-section:last-child { border-bottom:none; }
.audit-section h3 {
  font-size:13px; color:var(--philips-blue); margin-bottom:8px;
  font-weight:700;
}

.audit-form { display:flex; flex-direction:column; gap:6px; }
.af-row { display:flex; gap:8px; }
.af-field { flex:1; display:flex; flex-direction:column; gap:2px; }
.af-field.af-w2 { flex:2; }
.af-field label { font-size:10px; font-weight:600; color:var(--text-secondary); }
.af-field input {
  width:100%; padding:6px 10px; border:1px solid var(--border);
  border-radius:6px; font-size:12px; outline:none;
  transition:border-color var(--transition);
}
.af-field input:focus { border-color:var(--philips-blue); }
/* 申报单位 - 公司选择器 */
.audit-company-select {
  width: 100%; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; outline: none; cursor: pointer;
  transition: border-color var(--transition);
  background: white; color: var(--text);
  appearance: auto; -webkit-appearance: auto;
}
.audit-company-select:focus { border-color: var(--philips-blue); }

/* Excel 上传按钮 */
.af-excel-row { margin-top:2px; align-items:center; }
.btn-excel-upload {
  padding: 6px 14px; background: #f0f9ff; border: 1.5px dashed var(--philips-blue);
  border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--philips-blue);
  transition: all var(--transition); white-space: nowrap;
}
.btn-excel-upload:hover { background: #dbeafe; border-style: solid; }
.excel-status { font-size: 11px; color: var(--text-secondary); margin-left: 8px; }

/* Excel 预览弹窗 */
.excel-modal { max-width: 700px; max-height: 85vh; }
.excel-modal .modal-body { padding: 16px 20px; }
.excel-section { margin-bottom: 16px; }
.excel-section h4 { font-size:13px; color:var(--text); margin-bottom:8px; padding-bottom:4px; border-bottom:1px solid var(--border); }
.excel-info-table { width:100%; border-collapse:collapse; font-size:12px; }
.excel-info-table td { padding:6px 10px; border-bottom:1px solid #f3f4f6; }
.eit-label { color:var(--text-secondary); width:80px; font-weight:600; }
.eit-value { color:var(--text); }
.eit-value.empty { color:#999; font-style:italic; }
.excel-empty-hint { color:#999; font-size:12px; padding:12px 0; }
.excel-model-grid { display:flex; flex-wrap:wrap; gap:8px; }
.excel-model-card {
  display:flex; flex-direction:column; gap:2px; padding:8px 12px;
  background:#f8fafc; border:1px solid #e5e7eb; border-radius:8px;
  min-width:160px;
}
.excel-model-card .emc-model { font-size:13px; font-weight:700; color:var(--philips-blue); }
.excel-model-card .emc-name { font-size:11px; color:var(--text-secondary); }
.excel-model-card .emc-loc { font-size:10px; color:#999; }

.audit-search { margin-bottom:6px; }
.audit-search input {
  width:100%; padding:7px 10px; border:1px solid var(--border);
  border-radius:6px; font-size:12px; outline:none;
}
.audit-search input:focus { border-color:var(--philips-blue); }

.audit-device-list { max-height:260px; overflow-y:auto; }
.audit-device-card {
  display:flex; align-items:center; gap:8px;
  padding:6px 8px; border-radius:6px; cursor:pointer;
  border:1px solid transparent; margin-bottom:2px;
  transition:all var(--transition);
}
.audit-device-card:hover { background:var(--bg); }
.audit-device-card.selected { background:#e0f2fe; border-color:var(--philips-blue); }
.audit-dev-check { font-size:14px; color:var(--philips-blue); min-width:20px; }
.audit-dev-info { display:flex; flex-direction:row; gap:6px; align-items:baseline; flex-wrap:wrap; }
.audit-dev-model { font-size:12px; font-weight:700; color:var(--philips-blue); }
.audit-dev-name { font-size:11px; color:var(--text); }
.audit-dev-empty { text-align:center; padding:16px; color:var(--text-muted); font-size:12px; }

.audit-selected-bar {
  margin-top:6px; padding:8px 12px; background:var(--philips-blue);
  border-radius:6px; font-size:12px; color:#fff; font-weight:600;
  display:flex; align-items:center; justify-content:space-between;
}
.audit-selected-bar strong { color:#fff; }
.audit-selected-bar .btn-reset {
  background:rgba(255,255,255,0.2); border:1.5px solid rgba(255,255,255,0.6);
  color:#fff; font-size:12px; padding:4px 12px; border-radius:6px;
  cursor:pointer; font-weight:600; transition:all var(--transition);
}
.audit-selected-bar .btn-reset:hover {
  background:rgba(255,255,255,0.35); border-color:#fff;
}
.audit-selected-bar .btn-select-all {
  font-size:11px; padding:3px 10px; 
}

.audit-materials { display:flex; flex-direction:column; gap:2px; }
.audit-check { font-size:11px !important; padding:4px 6px; }
.audit-mat-pd { font-weight:700; color:#dc2626 !important; }

.audit-preview-placeholder {
  display:flex; flex-direction:column; align-items:center;
  justify-content:center; min-height:300px; text-align:center;
  color:var(--text-muted);
}
.audit-empty-icon { font-size:48px; margin-bottom:12px; }
.audit-preview-placeholder h3 { font-size:16px; color:var(--text-secondary); margin-bottom:6px; }
.audit-preview-placeholder p { font-size:13px; line-height:1.6; }

.audit-report-content { display:none; }

/* === 产品证书配置表格（右侧主区域） === */
.audit-device-config {
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}
.adc-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 200px;
  text-align: center; color: var(--text-muted); padding: 32px;
}
.adc-empty .audit-empty-icon { font-size: 38px; margin-bottom: 8px; }
.adc-empty h3 { font-size: 15px; color: var(--text-secondary); margin-bottom: 4px; }
.adc-empty p { font-size: 12px; line-height: 1.6; }

.adc-table-area { }
.adc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.adc-header h3 { font-size: 14px; color: var(--philips-blue); font-weight: 700; margin: 0; }
.adc-hint { font-size: 11px; color: var(--text-muted); }

.adc-table-wrap {
  max-height: calc(100vh - 380px); overflow-y: auto; overflow-x: auto;
}
.adc-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.adc-table thead {
  position: sticky; top: 0; z-index: 2;
}
.adc-table thead th {
  background: #1e293b; color: white;
  padding: 8px 10px; text-align: left; font-size: 11px;
  white-space: nowrap; font-weight: 600;
}
.adc-table tbody td {
  padding: 7px 10px; border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.adc-table tbody tr:hover { background: #f8fafc; }
.adc-table tbody tr:nth-child(even) { background: #fafbfc; }
.adc-table tbody tr:nth-child(even):hover { background: #f1f5f9; }

.adc-no { text-align: center; color: var(--text-muted); font-weight: 600; }
.adc-model { font-weight: 700; color: var(--philips-blue); font-size: 12px; white-space: nowrap; }
.adc-name { font-size: 12px; color: var(--text); }
.adc-cb-cell { text-align: center; width: 80px; }
.adc-cb-cell input[type="checkbox"] {
  width: 17px; height: 17px; accent-color: var(--philips-blue); cursor: pointer;
}
.adc-cb-disabled { opacity: 0.4; }
.adc-cb-disabled input[type="checkbox"] {
  cursor: not-allowed; accent-color: #aaa;
}

.adc-th-check { text-align: center !important; padding: 6px 6px !important; }
.adc-th-label {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; font-size: 10px; color: white; line-height: 1.3;
}
.adc-th-label input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: white; cursor: pointer;
}

.adc-footer {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-top: 1px solid var(--border);
  background: #f8fafc; font-size: 12px; color: var(--text-secondary);
}
.adc-footer strong { color: var(--philips-blue); }
.adc-footer .btn-sm { margin: 0; }

/* === Responsive === */
@media (max-width:1200px) {
  .sidebar { width:200px; }
  .device-grid { grid-template-columns:1fr; }
}

/* ========== 平板/小屏 (≤900px) ========== */
@media (max-width:900px) {
  .main-content { flex-direction:column; }
  .sidebar { width:100%; max-height:50vh; flex-shrink:0; }
  .category-nav { max-height:30vh; }
  .sidebar-cart { max-height:30vh; }
  .project-bar-inner { gap:6px; }
  .pb-field input { width:100px; }
  .modal-content { width:98%; max-height:96vh; }
  .report-meta { grid-template-columns:1fr; }
  .device-block .db-qr-area { flex-direction:column; align-items:flex-start; }
  .device-block .db-qr-img { width:300px; min-width:300px; height:300px; }
}

/* ========== 手机端 (≤640px) ========== */
@media (max-width:640px) {
  /* 全局 */
  body {
    font-size:15px;
    -webkit-text-size-adjust:100%;
    -webkit-overflow-scrolling:touch;
  }

  .app-container { height:100dvh; }

  /* 顶部导航 - 垂直堆叠 */
  .header {
    flex-direction:column; height:auto; gap:8px;
    padding:10px 12px;
  }
  .header-left { flex-wrap:wrap; gap:8px; justify-content:center; }
  .header-divider { display:none; }
  .brand-philips { font-size:14px; }
  .brand-dynalite { font-size:10px; }
  .header-title { font-size:13px; text-align:center; }
  .header-subtitle { font-size:9px; text-align:center; display:none; }
  .header-right { width:100%; justify-content:center; }
  .btn { padding:8px 14px; font-size:13px; }
  .btn-report { font-size:13px; padding:8px 18px; }

  /* 项目信息栏 */
  .project-bar { padding:8px 10px; }
  .project-bar-inner { flex-direction:column; gap:8px; }
  .pb-field { width:100%; min-width:0; }
  .pb-field label { font-size:14px; }
  .pb-field input {
    width:100% !important; padding:10px 8px; font-size:16px;
    border-radius:6px;
  }
  .pb-field input[type="date"] { width:100% !important; }
  .pb-locate-row { width:100% !important; }
  #engineerName { width:100% !important; }
  .btn-locate { width:40px; height:40px; font-size:18px; border-radius:6px; }

  /* 侧边栏 */
  .sidebar { border-right:none; border-bottom:2px solid var(--philips-light); }
  .sidebar-search input { padding:8px 12px; font-size:15px; border-radius:6px; }
  .category-item { padding:7px 10px; font-size:13px; border-radius:6px; }
  .category-item .cat-icon { font-size:16px; }
  .category-item .cat-count { font-size:11px; min-width:22px; height:22px; line-height:22px; }

  .sidebar-cart-header { padding:8px 12px; font-size:14px; }
  .cart-badge { min-width:26px; height:26px; line-height:26px; font-size:12px; border-radius:13px; }
  .cart-item { padding:6px 10px; border-radius:6px; }
  .cart-item .ci-model { font-size:12px; }
  .cart-item .ci-name { font-size:12px; }
  .cart-item .ci-remove { width:26px; height:26px; font-size:16px; }
  .check-label { font-size:13px; padding:4px 0; }
  .check-label input[type="checkbox"] { width:16px; height:16px; }

  /* 设备面板 */
  .device-panel { padding:12px 8px; }
  .device-grid { gap:8px; }
  .category-header h2 { font-size:16px; }
  .category-header span { font-size:12px; }

  /* 设备卡片 */
  .device-card {
    flex-direction:column; padding:14px; gap:10px;
    border-radius:10px;
  }
  .device-card .card-check { margin-top:0; position:absolute; top:12px; right:12px; width:26px; height:26px; border-radius:7px; }
  .device-card .card-model { font-size:14px; }
  .device-card .card-name { font-size:15px; }
  .device-card .card-desc { font-size:13px; }
  .device-card .card-tag { font-size:11px; padding:3px 10px; border-radius:6px; }
  .device-card .card-photo { width:100%; min-width:0; height:auto; aspect-ratio:4/3; }
  .device-card .card-qr-badge { width:80px; min-width:80px; height:80px; align-self:center; }
  .device-card .card-qr-badge img { width:74px; height:74px; }

  /* 报告弹窗 - 全屏 */
  .modal-overlay.active { align-items:flex-start; }
  .modal-content {
    width:100%; max-width:100%; max-height:100dvh;
    border-radius:0; height:100dvh;
  }
  .modal-header { padding:10px 14px; flex-wrap:wrap; gap:6px; }
  .modal-header h2 { font-size:15px; }
  .modal-header-actions { gap:4px; }
  .modal-header-actions .btn { padding:6px 10px; font-size:12px; }
  .modal-body { padding:8px; }
  .report-preview-mode { padding:8px 4px; }

  /* A4 页自适应 */
  .report-page {
    width:100%; min-height:auto;
    padding:16px 14px 36px 14px;
    box-shadow:0 1px 4px rgba(0,0,0,0.08);
  }
  .report-page::after { bottom:3mm; }

  /* 报告内容 */
  .report { font-size:14px; gap:12px; }
  .report-cover { padding:24px 12px; }
  .report-cover .rc-logo { font-size:22px; }
  .report-cover .rc-title { font-size:17px; }
  .report-cover .rc-subtitle { font-size:13px; }
  .report-meta { grid-template-columns:1fr; gap:4px 0; padding:10px; font-size:13px; }
  .report-meta .rm-item { flex-direction:column; gap:1px; }
  .report-section h3 { font-size:15px; }
  .report-section h4 { font-size:13px; }

  /* 设备块 */
  .device-block { padding:10px; border-left-width:3px; }
  .device-block .db-header { flex-direction:column; align-items:flex-start; gap:4px; }
  .device-block .db-name { font-size:15px; }
  .db-photo-area { flex-direction:column; align-items:flex-start; }
  .db-photo-img { width:100%; max-width:100%; }
  .db-qr-img { width:260px !important; min-width:260px !important; height:260px !important; }

  /* 系统要求手机端堆叠 */
  .sys-req-row { flex-direction:column; }
  .sys-req-img { width:100%; min-width:0; }

  /* 表格滚动 */
  .spec-table, .wiring-table { font-size:12px; display:block; overflow-x:auto; }
  .spec-table td:first-child { width:auto; }
  .checklist-table { display:block; overflow-x:auto; }

  /* 步骤列表 */
  .step-list li { padding:6px 0 6px 28px; font-size:13px; }
  .step-list li::before { width:20px; height:20px; font-size:11px; top:6px; }

  /* 修复通知 */
  .toast { width:90%; text-align:center; font-size:14px; padding:12px 16px; }
}

/* ========== 报审手机端适配 ========== */
@media (max-width:900px) {
  .audit-layout { flex-direction: column; }
  .audit-sidebar { width: 100%; min-width: 0; max-height: 40vh; }
  .audit-main { padding: 10px; }
  .adc-table-wrap { max-height: 46vh; }
  .adc-table { font-size: 11px; }
  .adc-table thead th { padding: 6px 6px; font-size: 10px; }
  .adc-table tbody td { padding: 5px 6px; }
  .adc-th-label { font-size: 9px; }
  .adc-cb-cell { width: 50px; }
  .adc-cb-cell input[type="checkbox"] { width: 15px; height: 15px; }
}

/* ========== 个人信息维护 ========== */
.pb-person-row {
  display:flex; gap:4px; align-items:center;
}
.pb-person-row input {
  flex:1; width:auto !important;
}
.btn-person {
  width:30px; height:30px; flex-shrink:0;
  border:1.5px solid var(--border); border-radius:6px;
  background:var(--bg); cursor:pointer; font-size:14px;
  display:flex; align-items:center; justify-content:center;
  transition:all var(--transition); padding:0;
}
.btn-person:hover {
  border-color:var(--philips-blue); background:#e6f4fc;
}

.person-modal-content {
  max-width:480px; max-height:70vh;
}
.person-modal-body {
  padding:12px 20px 20px;
}
.person-search {
  margin-bottom:10px;
}
.person-search input {
  width:100%; padding:7px 10px; border:1.5px solid var(--border);
  border-radius:6px; font-size:13px; outline:none;
}
.person-search input:focus { border-color:var(--philips-blue); }
.person-list {
  max-height:260px; overflow-y:auto;
}
.person-item {
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 10px; border-radius:6px; cursor:pointer;
  border:1px solid transparent; margin-bottom:2px;
  transition:all var(--transition);
}
.person-item:hover { background:#e6f4fc; border-color:var(--philips-light); }
.person-item-info { flex:1; min-width:0; }
.person-item-name { font-size:13px; font-weight:700; color:var(--philips-blue); }
.person-item-company { font-size:11px; font-weight:400; color:var(--text-secondary); }
.person-item-detail { font-size:11px; color:var(--text-secondary); }
.person-item-actions { display:flex; gap:4px; }
.person-item-actions button {
  width:26px; height:26px; border:1px solid var(--border);
  border-radius:4px; background:white; cursor:pointer;
  font-size:12px; display:flex; align-items:center;
  justify-content:center; transition:all var(--transition);
}
.person-item-actions .btn-person-del:hover {
  border-color:#ef4444; background:#fef2f2; color:#dc2626;
}
.person-item-actions .btn-person-use {
  font-size:12px; width:auto; padding:5px 14px;
  font-weight:600; color:var(--philips-blue);
}
.person-item-actions .btn-person-use:hover {
  background:#e6f4fc; border-color:var(--philips-blue);
}
.person-empty {
  text-align:center; padding:24px; color:var(--text-muted); font-size:12px;
}

/* 新增/编辑表单 */
.person-form {
  border-top:2px solid var(--philips-light); padding-top:12px; margin-top:12px;
}
.person-form-row {
  display:flex; align-items:center; gap:8px; margin-bottom:8px;
}
.person-form-row label {
  font-size:11px; font-weight:600; color:var(--text-secondary); min-width:36px; text-align:right;
}
.person-form-row input {
  flex:1; padding:6px 10px; border:1.5px solid var(--border);
  border-radius:6px; font-size:13px; outline:none;
}
.person-form-row input:focus { border-color:var(--philips-blue); }
.person-form-actions {
  display:flex; gap:8px; justify-content:flex-end; margin-top:10px;
}
.person-form-actions .btn { padding:6px 16px; }

/* 必填项高亮闪烁 */
.required-blink {
  animation: reqBlink 0.3s ease 3;
}
@keyframes reqBlink {
  0%, 100% { border-color: var(--philips-blue); }
  50% { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }
}

/* ========== 超小屏 (≤380px) ========== */
@media (max-width:380px) {
  .header { padding:8px; }
  .btn { padding:7px 10px; font-size:12px; }
  .btn-report { padding:7px 14px; font-size:12px; }
  .modal-header h2 { font-size:13px; }
  .modal-header-actions .btn { padding:5px 8px; font-size:11px; }
}

/* ========== 报告历史 ========== */
.history-entry {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border-left: 3px solid #3b82f6;
}
.history-entry:hover {
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  border-left-color: #2563eb;
}
.history-entry.active { background:#bfdbfe; border-left-color:#1d4ed8; }
.history-entry .sw-tutorial-title { color:#1e40af !important; font-weight:600; }

/* 报审历史入口 */
.audit-history-entry {
  margin: 4px 6px 8px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1.5px solid #86efac;
}
.audit-history-entry:hover {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border-color: #22c55e;
  box-shadow: 0 2px 8px rgba(34,197,94,0.2);
}
.audit-history-entry .sw-tutorial-title { color: #15803d !important; font-weight: 600; }

/* 导出压缩包弹窗 */
.export-zip-modal {
  max-width: 700px !important;
  max-height: 90vh;
}
.export-zip-table-wrap {
  max-height: 50vh;
  overflow-y: auto;
  border: 1px solid #e4e8ec;
  border-radius: 8px;
}
#exportZipTable th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* 历史弹窗 */
.history-modal-overlay { z-index:1100; }
.history-modal-content {
  max-width: 960px; max-height: 90vh;
}
.history-modal-content .modal-body.history-body {
  padding: 16px 20px;
}
.history-stats {
  display:flex; gap:16px; flex-wrap:wrap;
  margin-bottom:12px; padding:8px 12px;
  background:#f8fafc; border-radius:8px;
  border:1px solid #e2e8f0;
}
.hstat {
  font-size:12px; color:#475569;
}
.hstat strong {
  color:var(--philips-blue); font-size:15px;
}

.history-table-wrap {
  max-height: 60vh; overflow-y:auto;
}
.history-table {
  width:100%; border-collapse:collapse; font-size:12px;
}
.history-table th {
  position:sticky; top:0; z-index:1;
  background:#1e293b; color:white;
  padding:8px 8px; text-align:left; font-size:11px;
  white-space:nowrap;
}
.history-table td {
  padding:6px 8px; border-bottom:1px solid #e2e8f0;
  line-height:1.4; vertical-align:top;
}
.history-table tbody tr:hover { background:#f1f5f9; }
.history-table tbody tr:nth-child(even) { background:#fafbfc; }
.history-table tbody tr:nth-child(even):hover { background:#f1f5f9; }

.h-no { text-align:center; color:#94a3b8; font-weight:600; }
.h-time { white-space:nowrap; color:#64748b; font-size:11px; }
.h-pn { font-weight:600; color:#1a1f2e; max-width:130px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.h-loc { color:#475569; max-width:110px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.h-eng { white-space:nowrap; color:#334155; }
.h-dev { text-align:center; font-weight:600; color:var(--philips-blue); }
.h-opts { min-width:140px; }
.h-opt-tags {
  font-size:10px; color:#475569; line-height:1.5;
}
.history-empty {
  text-align:center; padding:40px 20px !important;
  color:#94a3b8; font-size:13px;
}

.btn-danger-outline {
  border-color: #ef4444; color: #ef4444;
  background:transparent;
}
.btn-danger-outline:hover {
  background:#fef2f2; border-color:#dc2626; color:#dc2626;
}

/* 手机端历史表格 */
@media (max-width:768px) {
  .history-modal-content { max-width:100%; border-radius:12px 12px 0 0; margin-top:auto; }
  .history-table { font-size:11px; }
  .history-table th, .history-table td { padding:5px 4px; }
  .h-pn, .h-loc { max-width:80px; }
  .history-stats { gap:8px; padding:6px 10px; }
  .hstat { font-size:11px; }
  .hstat strong { font-size:13px; }
  .excel-modal { max-width:96%; max-height:90vh; }
  .excel-model-card { min-width:130px; padding:6px 10px; }
  .excel-model-card .emc-model { font-size:12px; }
  .btn-excel-upload { padding:5px 10px; font-size:11px; }
}
