/* 压铸工艺计算系统 - 样式表 */
:root {
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --primary: #1e4d8b;
  --primary-light: #eef4fb;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
}

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

.brand-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
}

.brand h1 {
  margin: 0;
  font-size: 26px;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.brand p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: #163e70;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
}

.btn-danger:hover {
  background: #fecaca;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
  border: 1px solid rgba(0,0,0,0.03);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 18px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title .icon {
  font-size: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* Form Elements */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: #fafafa;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 77, 139, 0.08);
  background: #fff;
}

.form-group input:read-only {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Result blocks */
.result-list {
  background: var(--primary-light);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 10px;
  border-left: 4px solid var(--accent);
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(30, 77, 139, 0.12);
}

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

.result-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  position: relative;
}

/* 公式悬浮提示（桌面 hover / 移动端 tap） */
.formula-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 50%;
  background: var(--primary, #1e4d8b);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.formula-trigger:hover { background: #2f6fc0; }
.formula-pop {
  display: none;
  position: absolute;
  left: 0;
  top: 130%;
  z-index: 999;
  max-width: 280px;
  padding: 8px 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  white-space: normal;
  text-align: left;
}
.formula-pop.open { display: block; }
.formula-pop b { color: #93c5fd; display: block; margin-bottom: 2px; }
.formula-pop sub { font-size: 10px; }
.formula-pop .fn-sym { font-family: "SF Mono", Consolas, monospace; color: #fde68a; font-size: 12px; margin: 4px 0; }
.formula-pop .fn-note { display: block; color: #cbd5e1; font-size: 11px; line-height: 1.5; border-top: 1px solid rgba(148,163,184,.3); padding-top: 4px; margin-top: 4px; }
.fn-note { color: var(--text-muted); font-size: 11px; }

.result-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  font-family: "SF Mono", Consolas, monospace;
}

.result-unit {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 3px;
  font-weight: 500;
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.5;
}

.hint-strong {
  background: #ecfdf5;
  color: #065f46;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 12px;
  font-size: 12px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  flex-wrap: wrap;
}

.tab {
  padding: 10px 18px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.18s;
}

.tab:hover {
  color: var(--primary);
  background: rgba(30, 77, 139, 0.04);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(30, 77, 139, 0.06);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Part Library */
.part-search {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.part-search input {
  flex: 1;
}

.part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.part-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.18s;
}

.part-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.part-card.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}

.part-card h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--primary);
}

.part-card p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.part-card .tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e5e7eb;
  color: var(--text-muted);
  margin-top: 6px;
}

/* History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.history-item:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.history-info {
  font-size: 13px;
}

.history-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.history-actions {
  display: flex;
  gap: 6px;
}

/* Diagram */
.diagram-container {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 1px dashed var(--border);
}

.diagram-container svg {
  max-width: 100%;
  height: auto;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-hover);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
}

/* ===== PDF 工艺卡 ===== */
.process-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.process-card h3 { color: var(--primary); }
.card-table { table-layout: fixed; }
.card-table .pc-k { width: 22%; color: var(--text-muted); font-weight: 500; background: #f1f5f9; }
.card-table .pc-v { font-weight: 700; font-family: "SF Mono", Consolas, monospace; color: var(--primary); }
.pc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); flex-wrap: wrap; }
.pc-logo { max-height: 44px; max-width: 180px; object-fit: contain; }
.pc-head-mid-stub { font-weight: 700; color: var(--primary); font-size: 15px; }
.pc-head-title { flex: 1; min-width: 160px; font-weight: 700; color: var(--primary); font-size: 15px; line-height: 1.4; }
.pc-qr { margin-left: auto; text-align: center; flex-shrink: 0; }
.pc-qr svg, .pc-qr img { width: 88px; height: 88px; display: block; }
.pc-qr-empty { width: 88px; height: 88px; border: 1px dashed #cbd5e1; border-radius: 4px; }
.pc-qr-cap { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* Print */
@media print {
  .container {
    display: none !important;
  }
  #reportArea {
    display: block !important;
  }
  body {
    background: #fff;
  }
}

/* ===== PDF 报告区 ===== */
#reportArea {
  display: none;
  background: #fff;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  color: #1f2937;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--primary);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.report-header .logo {
  max-height: 56px;
  max-width: 220px;
}

.report-header .meta {
  text-align: right;
  font-size: 12px;
  color: #6b7280;
}

.report-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.report-section {
  margin: 18px 0;
}

.report-section h3 {
  font-size: 15px;
  color: var(--primary);
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  margin: 0 0 10px;
}

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

.report-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #e5e7eb;
}

.report-table td:first-child {
  color: #6b7280;
  width: 55%;
}

.report-table td:last-child {
  font-weight: 600;
  text-align: right;
  color: var(--primary);
}

.report-footer {
  margin-top: 28px;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  padding-top: 12px;
}

/* 语言选择 */
.lang-select {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

/* 区块分隔 */
.section-divider {
  margin: 28px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-top: 1px dashed var(--border);
  padding-top: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* Utility */
.text-right {
  text-align: right;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-12 {
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-blue {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-green {
  background: #d1fae5;
  color: #065f46;
}

.badge-orange {
  background: #fef3c7;
  color: #92400e;
}

/* ===== 3D 干涉校验视图 ===== */
.interf-view {
  width: 100%;
  height: 360px;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  touch-action: none;
}
.interf-view canvas {
  display: block;
}
.gesture-badge {
  display: inline-block;
  margin: 2px 0 6px;
  padding: 3px 10px;
  font-size: 11px;
  color: #1e4d8b;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  line-height: 1.5;
}

/* ===== 手绘签名板 ===== */
.sign-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.sign-pad {
  width: 100%;
  max-width: 420px;
  height: 130px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  display: block;
}

/* ===== 报告：二维码 + 签字区 ===== */
.report-sign {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed #e5e7eb;
  flex-wrap: wrap;
}
.qr-box {
  text-align: center;
  flex: 0 0 auto;
}
.qr-box svg {
  width: 110px;
  height: 110px;
  display: block;
  margin: 0 auto;
}
.qr-cap {
  font-size: 11px;
  color: #6b7280;
  margin-top: 6px;
  max-width: 120px;
}
.sign-box-r {
  flex: 1;
  min-width: 240px;
}
.sign-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.sign-row2 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #e5e7eb;
}
.sign-row2 .s-role {
  min-width: 64px;
  font-weight: 600;
  color: #374151;
}
.sign-row2 .s-name {
  flex: 1;
  font-weight: 600;
  color: var(--primary);
}
.sign-row2 .s-slot {
  min-width: 170px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.sign-img {
  max-height: 40px;
  max-width: 170px;
}

/* ===== 双滑块 / 多障碍并发校验 ===== */
.card-wide {
  grid-column: 1 / -1;
}
.sub-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 14px;
  background: #fafbff;
}
.sub-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 14px;
}
.table-scroll {
  overflow-x: auto;
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.mini-table th {
  text-align: center;
  padding: 5px 6px;
  color: #64748b;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-weight: 600;
}
.mini-table td {
  padding: 4px 4px;
  border-bottom: 1px solid #eef2f7;
  text-align: center;
}
.mini-in {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 5px;
  font-size: 12px;
  width: 48px;
  text-align: center;
}
.mini-sel {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 5px;
  font-size: 12px;
}
.slide-verdict-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sv-head {
  font-weight: 700;
  color: #374151;
  font-size: 13px;
}
.sv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  border-left: 4px solid #cbd5e1;
}
.sv-item.sv-safe { background: #ecfdf5; border-left-color: #22c55e; }
.sv-item.sv-crit { background: #fffbeb; border-left-color: #f59e0b; }
.sv-item.sv-hit  { background: #fef2f2; border-left-color: #dc2626; }
.sv-name { font-weight: 700; min-width: 36px; }
.sv-badge { font-weight: 700; }
.sv-safe .sv-badge { color: #16a34a; }
.sv-crit .sv-badge { color: #d97706; }
.sv-hit  .sv-badge { color: #dc2626; }
.sv-detail { color: #6b7280; margin-left: auto; }

/* ===== 防伪水印 & 电子签章 ===== */
.wm-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
}
.report-root {
  position: relative;
}
.watermark-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: repeat;
}
.report-inner {
  position: relative;
  z-index: 1;
}
.sign-seal {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.sign-seal svg {
  width: 110px;
  height: 110px;
  display: block;
}
.seal-code {
  font-size: 10px;
  color: #c0392b;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 0.5px;
}


/* ===== 双滑块 / 多障碍并发校验 ===== */
.card-wide {
  grid-column: 1 / -1;
}
.sub-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 14px;
  background: #fafbff;
}
.sub-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 14px;
}
.table-scroll {
  overflow-x: auto;
}
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.mini-table th {
  text-align: center;
  padding: 5px 6px;
  color: #64748b;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-weight: 600;
}
.mini-table td {
  padding: 4px 4px;
  border-bottom: 1px solid #eef2f7;
  text-align: center;
}
.mini-in {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 5px;
  font-size: 12px;
  width: 48px;
  text-align: center;
}
.mini-sel {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 5px;
  font-size: 12px;
}
.slide-verdict-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sv-head {
  font-weight: 700;
  color: #374151;
  font-size: 13px;
}
.sv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  border-left: 4px solid #cbd5e1;
}
.sv-item.sv-safe { background: #ecfdf5; border-left-color: #22c55e; }
.sv-item.sv-crit { background: #fffbeb; border-left-color: #f59e0b; }
.sv-item.sv-hit  { background: #fef2f2; border-left-color: #dc2626; }
.sv-name { font-weight: 700; min-width: 36px; }
.sv-badge { font-weight: 700; }
.sv-safe .sv-badge { color: #16a34a; }
.sv-crit .sv-badge { color: #d97706; }
.sv-hit  .sv-badge { color: #dc2626; }
.sv-detail { color: #6b7280; margin-left: auto; }

/* ===== 防伪水印 & 电子签章 ===== */
.wm-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
}
.report-root {
  position: relative;
}
.watermark-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: repeat;
}
.report-inner {
  position: relative;
  z-index: 1;
}
.sign-seal {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.sign-seal svg {
  width: 110px;
  height: 110px;
  display: block;
}
.seal-code {
  font-size: 10px;
  color: #c0392b;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* ===== v2.0 扩展模块 ===== */
.card-wide { grid-column: 1 / -1; }
.chart-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  justify-content: center;
}
.result-value-lg {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}
.dfm-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.dfm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  border-left: 4px solid #cbd5e1;
}
.dfm-name { font-weight: 600; flex: 0 0 auto; }
.dfm-lv { font-weight: 700; flex: 0 0 36px; text-align: center; border-radius: 4px; padding: 1px 0; }
.dfm-sug { color: #475569; margin-left: auto; text-align: right; }
.dfm-high { background: #fef2f2; border-left-color: #dc2626; }
.dfm-high .dfm-lv { background: #dc2626; color: #fff; }
.dfm-mid { background: #fffbeb; border-left-color: #f59e0b; }
.dfm-mid .dfm-lv { background: #f59e0b; color: #fff; }
.dfm-low { background: #f0fdf4; border-left-color: #22c55e; }
.dfm-low .dfm-lv { background: #22c55e; color: #fff; }
.template-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.tpl-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; cursor: pointer; background: #fff;
}
.tpl-item:hover { border-color: var(--primary); background: #f1f6fc; }
.valid-banner { padding: 10px 14px; border-radius: 8px; font-size: 13px; line-height: 1.7; }
.valid-banner.ok { background: #ecfdf5; color: #15803d; border: 1px solid #a7f3d0; }
.valid-banner.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

/* 工具栏（恢复默认 / 提示） */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.toolbar-hint { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* 移动端适配（手机直接可用） */
@media (max-width: 640px) {
  .container { padding: 12px; }
  .app-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .brand-icon { width: 40px; height: 40px; }
  .form-row { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .form-group input, .form-group select { font-size: 16px; padding: 12px; min-height: 44px; }
  .card { padding: 14px; border-radius: 12px; }
  .tab { flex-wrap: wrap; gap: 6px; }
  .btn, button { min-height: 44px; }
  input, select, textarea { max-width: 100%; }
  .toolbar { margin-bottom: 12px; }
}
