/* ============================================
   超声报告录入系统 - 移动端 H5 样式
   Ultrasound Report Entry System v1.0
   ============================================ */

:root {
  --font-scale: 1;
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --success: #0d904f;
  --warning: #e37400;
  --danger: #d93025;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --text-muted: #80868b;
  --border: #dadce0;
  --border-light: #e8eaed;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  --transition: 0.2s ease;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: calc(16px * var(--font-scale, 1));
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: calc(72px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}

/* ============ Header ============ */
/* ============ Main Content ============ */
.main-content {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* ============ Cards ============ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}

.card:active { box-shadow: var(--shadow-lg); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size:0.9375rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.card-badge {
  font-size:0.6875rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.card-badge.optional { background: var(--border-light); color: var(--text-muted); }
.card-badge.required { background: #fce8e6; color: var(--danger); }
.card-badge.active { background: #e6f4ea; color: var(--success); }

/* ============ Form Elements ============ */
.form-group { margin-bottom: 12px; }

.form-label {
  display: block;
  font-size:0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size:0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

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

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2380868b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
  font-size:0.875rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* ============ Category Grid ============ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.category-item {
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: #fff;
  user-select: none;
}

.category-item:active { transform: scale(0.97); }

.category-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.category-item .cat-name {
  font-size:0.875rem;
  font-weight: 500;
  color: var(--text);
}

.category-item.selected .cat-name { color: var(--primary); }

.category-item .cat-sub {
  display: block;
  font-size:0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.category-item.selected .cat-sub { color: var(--primary); }

/* 首页子页面切换标签（常规超声 / 体检套餐） */
.home-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 4px;
}
.home-tab {
  flex: 1 1 0;
  padding: 11px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4f5f7;
  color: var(--text-muted);
  font-size:0.8125rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.home-tab:active { transform: scale(0.98); }
/* 选中时底色与对应列表卡片背景一致；字体加字距以区别于类别文字 */
.home-tab[data-tab="cat"].active {
  background: #e8f0fe;
  color: #1b54b8;
  border-color: var(--primary-light);
}
.home-tab[data-tab="pkg"].active {
  background: #eafaf0;
  color: #2f7d4f;
  border-color: #b7e4c7;
}
.home-subpage { /* 默认显示，由 .hidden 控制隐藏 */ }

/* ============ 设置页·类别管理 ============ */
.cat-manage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cat-manage-input {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size:0.875rem;
  background: #fff;
  color: var(--text);
}
.cat-manage-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.cat-add-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.cat-add-row .form-input { flex: 1; }

/* ============ Voice Recording ============ */
.recording-panel {
  text-align: center;
  padding: 20px 0;
}

.record-btn-wrap {
  position: relative;
  display: inline-block;
}

.record-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size:32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.record-btn.idle {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(26,115,232,0.3);
}

.record-btn.recording {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 20px rgba(217,48,37,0.4);
  animation: pulse 1.5s infinite;
}

.record-btn.disabled {
  background: var(--border-light);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.record-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--danger);
  opacity: 0;
  z-index: 1;
}

.record-ripple.active {
  animation: ripple 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes ripple {
  0% { width: 80px; height: 80px; opacity: 0.6; }
  100% { width: 140px; height: 140px; opacity: 0; }
}

.recording-status {
  margin-top: 12px;
  font-size:0.875rem;
  color: var(--danger);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.recording-segments {
  margin-top: 20px;
  text-align: left;
}

.segment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
  background: #fff;
}

.segment-item.recording {
  border-color: var(--danger);
  background: #fff5f5;
}

.segment-item.done {
  border-color: var(--success);
  background: #f6fef6;
}

.segment-item .seg-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size:0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.segment-item.done .seg-num {
  background: var(--success);
  color: #fff;
}

.segment-item .seg-label {
  flex: 1;
  margin-left: 12px;
  font-size:0.875rem;
  font-weight: 500;
}

.segment-item .seg-duration {
  font-size:0.75rem;
  color: var(--text-muted);
  margin-right: 8px;
}

.segment-item .seg-status {
  font-size:0.8125rem;
  font-weight: 500;
}

.segment-item .seg-status.done { color: var(--success); }
.segment-item .seg-status.pending { color: var(--text-muted); }
.segment-item .seg-status.active { color: var(--danger); }

.segment-text-preview {
  font-size:0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-left: 40px;
  line-height: 1.5;
  max-height: 60px;
  overflow: hidden;
}

/* ============ AI Processing ============ */
.ai-panel {
  border: 2px solid var(--primary-light);
  background: linear-gradient(135deg, #f8fbff, #fff);
}

.ai-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.ai-progress .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.ai-progress-text {
  font-size:0.8125rem;
  color: var(--primary);
  font-weight: 500;
}

.report-section {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
}

.report-section-header {
  padding: 10px 14px;
  background: var(--bg);
  font-size:0.875rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.report-section-header .section-icon { font-size:16px; }

/* 报告页「超声所见」：每个 L2 模板一个按钮模块（复用录入页 .record-entry-btn 样式） */
.report-finding-modules { display: flex; flex-direction: column; gap: 10px; }
.report-finding-modules .record-entry-btn { width: 100%; }

.report-section-body {
  padding: 12px 14px;
}

.report-section-body .editable-area {
  width: 100%;
  min-height: 2.4em;
  padding: 10px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-xs);
  font-size:0.875rem;
  line-height: 1.8;
  color: var(--text);
  background: transparent;
  font-family: inherit;
  resize: none;
  overflow: hidden;
  transition: border-color var(--transition);
}

.report-section-body .editable-area:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.report-section-body .editable-area.ai-generated {
  color: var(--primary-dark);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size:0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.97); }

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

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

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

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

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-lg {
  padding: 14px 24px;
  font-size:1rem;
  border-radius: 12px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-group {
  display: flex;
  gap: 10px;
}

.btn-group .btn { flex: 1; }

/* ============ Output Panel ============ */
.output-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.output-card {
  border: 2px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 14px;
}

.output-card:active { border-color: var(--primary); background: var(--primary-light); }

.output-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size:24px;
  flex-shrink: 0;
}

.output-card-icon.copy { background: #e8f0fe; }
.output-card-icon.qr { background: #fef7e0; }
.output-card-icon.download { background: #e6f4ea; }

.output-card-info { flex: 1; }

.output-card-title { font-size:0.9375rem; font-weight: 600; margin-bottom: 2px; }

.output-card-desc { font-size:0.75rem; color: var(--text-secondary); }

/* QR Code Modal */
.qr-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.qr-modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.qr-modal h3 {
  font-size:1rem;
  margin-bottom: 8px;
}

/* 模板编辑模态框：内容可能很长，限制高度并允许内部滚动 */
#tmplEditModal .qr-modal {
  max-height: 85vh;
  overflow-y: auto;
  text-align: left;
}

/* 录入条目编辑模态框：左对齐，含超声所见/超声提示文本框 */
.entry-edit-modal {
  max-width: 460px;
  width: 92vw;
  text-align: left;
}
.entry-edit-modal h3 { text-align: left; }
.entry-edit-field { margin-bottom: 12px; }
.entry-edit-field .form-label { margin-bottom: 6px; display: block; }
.entry-edit-field .form-textarea {
  width: 100%;
  font-size:0.875rem;
  line-height: 1.6;
  border-radius: 10px;
  border: 1px solid #e1e6ec;
  padding: 10px 12px;
  resize: vertical;
}
.entry-edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.entry-edit-actions .btn { flex: 1 1 auto; }

.qr-modal .qr-subtitle {
  font-size:0.75rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.qr-code-container {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border: 2px solid var(--border-light);
  border-radius: 12px;
}

.qr-code-container canvas, .qr-code-container img {
  display: block;
}

.qr-one-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fce8e6;
  color: var(--danger);
  padding: 4px 12px;
  border-radius: 10px;
  font-size:0.75rem;
  font-weight: 500;
  margin-top: 12px;
}

.qr-modal .btn { margin-top: 16px; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #323232;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size:0.875rem;
  z-index: 2000;
  animation: toastIn 0.3s ease;
  white-space: nowrap;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============ Bottom Navigation ============ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border-light);
  display: flex;
  padding: 6px 0 var(--safe-bottom);
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  font-size:0.6875rem;
  transition: color var(--transition);
}

.nav-item .nav-icon { font-size:22px; transition: transform var(--transition); }

/* 当前页底部标签：明显高亮（浅色胶囊背景 + 图标放大上浮 + 文字加粗） */
.nav-item.active {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-light, #e8f0fe);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(26, 115, 232, .25);
}
.nav-item.active .nav-icon {
  transform: translateY(-1px) scale(1.18);
}

/* 导航锁定（输出页时录入/报告不可点） */
.nav-item.nav-disabled {
  color: var(--text-muted, #999);
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* 主流程四页滑动指示点（首页/录入/报告/输出），仅在四页显示 */
.swipe-dots {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 6px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 120;
}
.swipe-dots .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #cfd6df;
  transition: background .25s, transform .25s;
}
.swipe-dots .dot.active {
  background: var(--primary);
  transform: scale(1.25);
}
.swipe-dots.hidden { display: none !important; }

/* ============ Settings Panel ============ */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

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

.setting-label {
  font-size:0.875rem;
  font-weight: 500;
}

.setting-desc {
  font-size:0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { display: none; }

.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }

.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Cache duration select */
.cache-select {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size:0.8125rem;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

/* Timer display */
.timer-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size:0.8125rem;
  color: var(--text-secondary);
  margin-top: 12px;
}

.timer-display .timer-value {
  font-weight: 600;
  color: var(--primary);
  font-family: var(--font-mono);
}

.timer-display.expiring .timer-value { color: var(--danger); }

/* ============ Template Management ============ */
.template-list-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all var(--transition);
  overflow: hidden;
}

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

.template-list-item .template-info {
  width: 100%;
  min-width: 0;
}

.template-list-item .template-name {
  font-size:0.875rem;
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.template-list-item .template-category {
  font-size:0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.template-list-item .template-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
  flex-wrap: wrap;
}

.template-list-item .template-actions .btn {
  white-space: nowrap;
  flex-shrink: 0;
  font-size:0.75rem;
  padding: 4px 10px;
}

/* 模板分组列表 */
.template-grouped-list { margin-top: 8px; }

.template-cat-group {
  margin-bottom: 12px;
}

.template-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
  user-select: none;
}

.template-cat-header .cat-name {
  font-size:0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.template-cat-header .cat-collapse-icon {
  font-size:0.75rem;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.template-cat-header.collapsed .cat-collapse-icon {
  transform: rotate(-90deg);
}

.template-cat-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 2000px;
}

.template-cat-body.collapsed {
  max-height: 0;
}

.template-cat-header .cat-count {
  font-size:0.75rem;
  color: var(--text-muted);
  font-weight: normal;
  margin-left: 6px;
}

/* "生成常用模板"按钮 */
.btn-preset {
  font-size:0.75rem;
  padding: 5px 12px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-preset:hover { opacity: 0.9; }

/* 模板项 — 确保按钮组不换行 */
.template-list-item .template-actions .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* AI 辅助按钮 */
.btn-xs {
  padding: 3px 8px;
  font-size:0.6875rem;
  border-radius: 10px;
}

/* 模板预览行（快捷识别下方显示超声提示第一句） */
.template-list-item .template-preview {
  font-size:0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

/* 经验案例库 */
.card-count {
  font-size:0.6875rem;
  color: var(--text-muted);
  font-weight: 400;
}
.case-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md, 8px);
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--background-secondary, #f7f8fa);
}
.case-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.case-trans {
  font-size:0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.case-cat {
  font-size:0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.case-prev {
  font-size:0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.case-item .btn {
  font-size:0.6875rem;
  padding: 4px 10px;
}
/* 案例同步行 + 来源标记 */
.case-sync-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.case-sync-row .setting-desc { flex: 1; }
.case-sub { margin: 2px 0; }
.case-src {
  font-size:0.6875rem;
  padding: 1px 6px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.case-src-cloud { background: #e6f0ff; color: #1a73e8; }
.case-src-local { background: #eef1f4; color: #5f6b7a; }

/* 超声提示情境标签 */
.template-ctx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.ctx-tag {
  font-size:0.625rem;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  line-height: 1.6;
  white-space: nowrap;
  display: inline-block;
}

/* ============ Empty State ============ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size:48px; margin-bottom: 12px; }

.empty-state .empty-title {
  font-size:1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state .empty-desc {
  font-size:0.8125rem;
  line-height: 1.6;
}

/* ============ Utility ============ */
.hidden { display: none !important; }

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

.text-muted { color: var(--text-muted); font-size:0.75rem; }

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

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

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

.mb-8 { margin-bottom: 8px; }

.mb-16 { margin-bottom: 16px; }

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-12 { gap: 12px; }

.flex-1 { flex: 1; }

/* ============ Scrollbar ============ */
::-webkit-scrollbar { width: 4px; }

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ============ Responsive ============ */
@media (min-width: 600px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .main-content { padding: 20px; }
}

@media (max-width: 360px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .category-grid { gap: 8px; }
  .category-item { padding: 10px 6px; }
}

/* ============ Print (for reference) ============ */
@media print {
  .app-header, .bottom-nav, .btn { display: none; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { padding: 0; background: #fff; }
}

/* ============ Page / Tab Container ============ */
.page {
  display: none;
  animation: fadeIn 0.25s ease;
}

.page.active { display: block; }

/* ============ P3b 组装页 ============ */
.assemble-region-card { border:1px solid var(--border, #e5e7eb); border-radius: var(--radius-sm, 8px); padding:10px 12px; margin-top:10px; background:var(--bg, #fff); }
.assemble-region-title { font-weight:600; font-size:0.875rem; margin-bottom:6px; color:var(--text, #333); }
.assemble-row { display:flex; align-items:center; gap:10px; margin-top:8px; flex-wrap:wrap; }
.assemble-row-label { min-width:34px; font-size:0.8125rem; color:var(--text-muted, #888); }
.assemble-l3-list { display:flex; flex-wrap:wrap; gap:8px 14px; }
.assemble-l3-item { display:inline-flex; align-items:center; gap:4px; font-size:0.8125rem; color:var(--text, #333); cursor:pointer; user-select:none; }
.assemble-l3-item input { width:16px; height:16px; accent-color:var(--primary, #1a73e8); }

/* ============ P3c L3 测量变量录入 ============ */
.assemble-measure-row { display:flex; align-items:center; gap:8px; margin:6px 0 6px 24px; }
.assemble-measure-label { font-size:0.8125rem; color:var(--text-muted, #888); min-width:40px; }
.assemble-measure-input { flex:1; min-width:0; }
.assemble-measure-mic { padding:6px 10px; line-height:1; flex:0 0 auto; }
.assemble-measure-mic:active { transform: scale(0.94); }
.assemble-seq-btn { margin:2px 0 0; padding:7px 14px; font-size:0.8125rem; border:1px solid var(--primary, #1a73e8); color:var(--primary, #1a73e8); background:var(--primary-light, #e8f0fe); }
.assemble-seq-btn:active { transform: scale(0.97); }
.assemble-seq-active { background:var(--primary, #1a73e8); color:#fff; border-color:var(--primary, #1a73e8); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 单窗口智能录入 ============ */
.record-stage-card { overflow: hidden; }
/* 20260819 方案B：录入页左右留白收窄（16→4px）+ 底部预留 160px 防三键遮挡 */
#page-record .main-content {
  padding: 4px 4px calc(160px + var(--safe-bottom));
}
.record-stage {
  position: relative;
  min-height: 260px;
  max-height: min(79vh, 690px);
  overflow: hidden;
  background: linear-gradient(160deg, #f7faff, #eef3ff);
  border: 1px solid var(--primary-light);
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* 初始半透明项目 tab */
.record-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
}
.cat-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(26, 115, 232, 0.25);
  border-radius: 14px;
  backdrop-filter: blur(2px);
  opacity: 0.78;
  min-width: 92px;
}
.cat-tab-name { font-size:0.875rem; font-weight: 600; color: var(--text); }

/* 实时转写：顶部悬浮胶囊按钮 */
.record-live {
  width: 100%;
  margin-bottom: 12px;
  flex: 0 0 auto;
  animation: fadeIn 0.2s ease;
}
.live-pill {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, #ffffff, #eaf1ff);
  border: 1px solid var(--primary-light);
  border-radius: 999px;
  padding: 12px 16px;
  font-size:0.9375rem;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(26, 115, 232, 0.18);
  text-align: left;
  white-space: pre-wrap;
  max-height: 160px; /* 20260819 方案B：120→160px，长句更完整 */
  overflow-y: auto;
}
.live-pill::before { content: '🎙️'; font-size:16px; flex: 0 0 auto; line-height: 1.4; }
.record-live.recording .live-pill { animation: pulseSoft 1.5s infinite; }
@keyframes pulseSoft {
  0%, 100% { box-shadow: 0 6px 18px rgba(26, 115, 232, 0.18); }
  50% { box-shadow: 0 6px 26px rgba(26, 115, 232, 0.42); }
}

/* 已生成提示列表：每条一个按钮，最新在上；超出高度时独立上下滑动 */
.record-entry-list {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 0.25s ease;
}
.record-entry-list::-webkit-scrollbar { width: 5px; }
.record-entry-list::-webkit-scrollbar-thumb { background: rgba(26, 115, 232, 0.35); border-radius: 999px; }
.record-entry-list::-webkit-scrollbar-track { background: transparent; }

.record-entry-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid #e1e6ec;
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
}
.record-entry-btn:active {
  transform: scale(0.98);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.18);
}
.reb-cat {
  font-size:0.6875rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .5px;
}
.reb-text {
  font-size:0.875rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.record-entry-empty { font-size:0.8125rem; color: var(--text-muted); text-align: center; padding: 8px; }

/* 长按拖动排序：右侧抓手提示 + 抓取光标 + 禁止文本选中/长按菜单 */
.record-entry-btn { position: relative; padding-right: 34px; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.record-entry-btn::after { content: "\2261"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #c2c8d0; font-size:20px; line-height: 1; }
.record-entry-btn:active { cursor: grabbing; }
.record-entry-btn.sort-source { opacity: .25; }
.sort-clone { background: #fff !important; border-color: var(--primary) !important; }

/* 顶部滑出的提示 tab（位置 / 径线 等） */
.hint-tray {
  position: absolute;
  top: 10px; left: 0; right: 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 10px;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}
.hint-tab {
  border: none;
  background: var(--primary);
  color: #fff;
  font-size:0.8125rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  box-shadow: 0 3px 10px rgba(26, 115, 232, 0.35);
}

.recording-status { text-align: center; color: var(--text-muted); font-size:0.8125rem; margin: 10px 0; min-height: 18px; }

/* AI 生成中 — 呼吸脉冲 */
@keyframes aiPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.recording-status.ai-generating {
  color: var(--primary);
  font-weight: 600;
  animation: aiPulse 1.2s ease-in-out infinite;
}

/* AI 会话已激活 — 持续高亮（不脉冲），让用户清晰看到会话状态 */
.recording-status.ai-session-active {
  color: var(--primary);
  font-weight: 600;
  border-top: 2px solid var(--primary);
  padding-top: 8px;
}

.record-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; }

/* 录入页底部三键一行：键盘输入(左) / 🎤圆形(中) / 生成报告(右)
   20260819 方案B：sticky → fixed，始终悬浮于底部导航之上，不随内容滚动；
   大屏/平板 max-width 600px 居中（与内容区对齐），半透明白底+毛玻璃+上阴影 */
.record-actions-bottom {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(60px + var(--safe-bottom)); /* 底部导航(60px)之上 */
  max-width: 600px;
  margin: 0 auto;
  z-index: 90;
  background: rgba(244, 247, 251, .96);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-top: none;
  box-shadow: 0 -6px 18px rgba(20, 40, 80, .12);
}
/* 两侧按钮：同一样式（浅底圆角），靠图标+文字区分 */
.rb-side {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 62px;
  border-radius: 14px;
  border: 1px solid #e1e6ec;
  background: #eef1f5;
  color: #3a3f47;
  font-size:0.8125rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, background .2s ease;
}
.rb-side:active { transform: scale(0.97); background: #e4e9f0; }
.rb-side .rb-ico { font-size:22px; line-height: 1; }
.rb-side .rb-txt { line-height: 1.1; white-space: nowrap; }
/* 中间录音键：圆形（沿用 .record-btn），缩小贴合单行，录音变红脉冲 */
.record-btn--sm { width: 64px; height: 64px; font-size:28px; flex: 0 0 auto; margin: 0 2px; }

.record-btn {
  width: 76px; height: 76px;
  border-radius: 50%;
  border: none;
  font-size:32px;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 6px 18px rgba(26, 115, 232, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.record-btn.idle:active { transform: scale(0.94); }
.record-btn.recording {
  background: #e53935;
  animation: pulseRed 1.4s infinite;
}
@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.5); }
  70% { box-shadow: 0 0 0 16px rgba(229, 57, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}
.recording-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #e53935;
  margin-right: 6px;
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0.2; } }

/* ============ L0 常规测值采集 ============ */
.l0-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.l0-item {
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  transition: border-color .25s ease, box-shadow .25s ease, opacity .25s ease, transform .25s ease;
  opacity: 0.5;
}
.l0-item.l0-current {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  opacity: 1;
  transform: scale(1.015);
}
.l0-item.l0-done { opacity: 1; }
.l0-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.l0-item-idx { font-size:0.75rem; color: var(--text-muted); min-width: 22px; }
.l0-item-name { font-size:0.9375rem; font-weight: 600; color: var(--text); flex: 1; }
.l0-item-unit { font-size:0.75rem; color: var(--text-muted); margin-left: 6px; flex: 0 0 auto; }
.l0-text-badge { font-size:0.6875rem; font-weight: 600; color: #1c7a43; background: #eafaf0; border: 1px solid #bfe9cf; border-radius: 10px; padding: 1px 7px; margin-left: 8px; flex: 0 0 auto; }
.l0-item-value { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.l0-value-display {
  flex: 1;
  min-width: 0;
  font-size:1.625rem; font-weight: 700; color: var(--primary);
  line-height: 1.2;
  border: none; border-bottom: 2px solid transparent;
  background: transparent; cursor: text;
  padding: 4px 2px;
  font-family: inherit;
}
.l0-value-display::placeholder { color: var(--text-muted); font-weight: 500; font-size:0.9375rem; }
.l0-value-display:focus { outline: none; border-bottom-color: var(--primary); }
.l0-actions { display: flex; justify-content: center; margin: 14px 0 6px; }
.l0-confirm-row { margin-top: 8px; }
.l0-result {
  margin-top: 14px; padding: 12px; border-radius: 12px;
  background: var(--primary-light); border: 1px solid var(--primary-light);
  font-size:0.8125rem; line-height: 1.7; color: var(--text);
}
.l0-result textarea {
  width: 100%; margin-top: 8px; font-size:0.75rem; font-family: 'SF Mono','Consolas',monospace;
  border: 1px solid var(--border-light); border-radius: 8px; padding: 8px; resize: vertical;
}
.l0-result .l0-result-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.l0-empty-hint { color: var(--text-muted); }
.l0-qr-box { margin-top: 12px; padding: 12px; background: #fff; border: 1px solid var(--border-light); border-radius: 12px; text-align: center; }
.l0-qr-tip { font-size:0.75rem; color: var(--text-muted); margin-bottom: 8px; }
.l0-qr-box img, .l0-qr-box canvas { margin: 0 auto; display: block; max-width: 100%; height: auto; }
.l0-empty-hint b { color: var(--primary); }

/* ============ 测值中心表越界标红（仅视觉提示，不自动改写报告） ============ */
.out-of-range,
.assemble-measure-input.out-of-range {
  border-color: #e53935 !important;
  background: #fdecea !important;
  color: #c0392b !important;
}
.l0-value-display.out-of-range { border-bottom-color: #e53935; color: #c0392b; }
.l0-range-tip { font-size:0.6875rem; color: #c0392b; margin-top: 4px; line-height: 1.4; }
.assemble-measure-row--stacked { flex-wrap: wrap; margin: 8px 0 10px 24px; }
.assemble-measure-row--stacked .assemble-measure-input,
.assemble-measure-row--stacked .assemble-measure-mic { flex: 0 1 auto; }
.assemble-measure-row--stacked .assemble-measure-input { flex: 1 1 60%; }
.assemble-measure-tip { flex-basis: 100%; font-size:0.6875rem; color: #c0392b; line-height: 1.4; margin-top: 3px; }

/* ===== 常规测值采集页（Measures） ===== */
.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.category-tabs .category-item { padding: 8px 14px; font-size:0.875rem; border-radius: 10px; border: 1px solid var(--border-light); background: #fff; }
.l0-status { font-size:0.8125rem; color: var(--primary); background: var(--primary-light); border-radius: 8px; padding: 6px 10px; margin: 6px 0; line-height: 1.5; }
.l0-status.hidden { display: none; }
.l0-progress { font-size:0.75rem; color: var(--text-muted); margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border-light); line-height: 1.5; }
.l0-action-bar { position: sticky; bottom: 0; display: flex; gap: 12px; padding: 12px 0 16px; background: var(--bg); z-index: 5; }
.l0-action-bar .btn { flex: 1; font-size:1rem; padding: 14px 0; }
.l0-item-name { cursor: pointer; }
/* 连续测值页顶部栏：滚动时吸顶，始终显示标题与连续听写按钮 */
.l0-top-sticky { position: sticky; top: 0; z-index: 20; background: var(--card-bg); }

/* ============ L3 逐条填写卡片（录入页内嵌） ============ */
.l3-fill-card {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 8px 0 4px;
  padding: 0;
  border: 1px solid var(--line, #e8eaee);
  border-radius: 16px;
  background: var(--card-bg, #fff);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  /* 20260819 方案B：62vh → min(76vh, 660px)（大屏/平板 660px 封顶，避免卡片过高空旷） */
  height: min(76vh, 660px);
}
.l3-fill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: var(--background-secondary, #f5f7fa);
  transition: background-color .2s ease;
}
.l3-fill-item.l3-fill-active { background: var(--primary-light, #e6f1fb); }
.l3-fill-item.l3-fill-done { background: var(--background-secondary, #f5f7fa); opacity: 1; }
.l3-fill-item-head {
  display: flex; align-items: center; gap: 6px;
  flex: 0 0 auto; min-width: 90px;
}
.l3-fill-idx {
  width: 22px; height: 22px; border-radius: 50%;
  font-size:0.75rem; font-weight: 600; color: #fff;
  background: var(--primary, #378add);
  display: flex; align-items: center; justify-content: center;
}
.l3-fill-item.l3-fill-done .l3-fill-idx { background: var(--text-muted, #888); }
.l3-fill-name { font-size:0.875rem; font-weight: 600; color: var(--text); flex: 1; }
.l3-fill-unit { font-size:0.6875rem; color: var(--text-muted); flex: 0 0 auto; }
.l3-fill-value-row { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.l3-fill-input {
  width: 100%; flex: 1; min-width: 0;
  font-size:1.0625rem; font-weight: 600; color: var(--primary, #378add);
  border: none;
  background: transparent; padding: 4px 2px;
  font-family: inherit;
  text-align: right;
}
.l3-fill-input:focus { outline: none; }
.l3-fill-input::placeholder { color: var(--text-muted); font-weight: 400; font-size:0.8125rem; }
.l3-fill-tip { font-size:0.6875rem; color: var(--text-muted); margin-top: 2px; padding-left: 4px; }
.l3-fill-voice-status {
  font-size:0.8125rem; color: var(--primary); padding: 4px 10px;
  background: var(--primary-light); border-radius: 8px; margin: 4px 10px;
}
/* L3 填写卡片：分类（单选必选）/ 加分项（多选）/ 左右（侧别）按钮组
   20260819：按钮加大 + 固定列数（手机一行 3 个、平板一行 4 个），圆角矩形 */
.l3-fill-item.l3-fill-btngrp { flex-direction: column; align-items: stretch; gap: 8px; }
.l3-fill-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.l3-btn {
  -webkit-appearance: none; appearance: none;
  font-family: inherit;
  font-size:0.9375rem; font-weight: 600;
  color: var(--text, #333);
  background: #fff;
  border: 1.5px solid var(--primary-border, #c0c4cc);
  border-radius: 10px; /* 圆角矩形 */
  padding: 12px 6px;
  min-width: 0;
  flex: 0 0 calc((100% - 16px) / 3); /* 手机：固定一行 3 个 */
  box-sizing: border-box;
  text-align: center;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease, color .12s ease;
  user-select: none; -webkit-user-select: none;
}
/* 平板（内容区 600px）：固定一行 4 个，按钮更大 */
@media (min-width: 768px) {
  .l3-btn {
    flex: 0 0 calc((100% - 24px) / 4);
    font-size:1rem;
    padding: 14px 8px;
  }
}
.l3-btn:active { transform: translateY(-1px); }
.l3-btn.l3-btn-on {
  background: var(--primary, #378add);
  border-color: var(--primary, #378add);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(55,138,221,.35);
}
.l3-btn.l3-btn-on:active { transform: translateY(-1px); }

/* ============ L3 分步内联卡片（竖向滑动 + 进度点，20260818 由全屏横向弹窗改为录入框内联竖向） ============ */
.l3-fill-head { flex: 0 0 auto; padding: 12px 14px 8px; border-bottom: 1px solid var(--line, #eef0f3); background: var(--card-bg, #fff); }
.l3-fill-head-row { display: flex; align-items: center; justify-content: space-between; }
.l3-fill-title { font-size:1rem; font-weight: 700; color: var(--text); }
.l3-fill-close { border: none; background: transparent; font-size:26px; line-height: 1; color: var(--text-muted); cursor: pointer; padding: 0 6px; }
.l3-fill-progress { display: flex; gap: 6px; margin-top: 8px; }
.l3-fill-dot { width: 22px; height: 4px; border-radius: 2px; background: var(--line, #e0e3e8); transition: background-color .2s ease; }
.l3-fill-dot.on { background: var(--primary, #378add); }
.l3-fill-dot.done { background: var(--primary-light, #bcd6f0); }

.l3-fill-track { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.l3-fill-track::-webkit-scrollbar { display: none; }
/* 面板恒等于轨道一屏高（卡片 height:62vh 定高后 flex-basis:100% 可解析），
   每个面板的 snap 点都可达（第 N 屏顶 = (N-1)×屏高 ≤ 最大滚动）；
   超长内容（如 17 个位置按钮）在面板内滚动。20260818 恢复 */
.l3-fill-panel { flex: 0 0 100%; min-height: 100%; scroll-snap-align: start; box-sizing: border-box; overflow-y: auto; padding: 14px 16px 20px; }
.l3-fill-step-title { font-size:0.8125rem; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }
.l3-fill-sub-title { font-size:0.75rem; font-weight: 600; color: var(--text-muted); margin: 12px 0 8px; }

/* 20260902-2：L3 分步导航按钮——加分项屏"跳过，去分类"（虚线弱样式）/ 分类屏"完成本条"（主色实心） */
.l3-step-nav {
  display: block; width: 100%; margin-top: 14px; box-sizing: border-box;
  -webkit-appearance: none; appearance: none; font-family: inherit;
  font-size:0.9375rem; font-weight: 600; border-radius: 10px; padding: 12px 8px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.l3-step-skip { background: transparent; border: 1.5px dashed var(--primary-border, #c0c4cc); color: var(--text-muted); }
.l3-step-skip:active { transform: translateY(-1px); }
.l3-step-done { background: var(--primary, #378add); border: 1.5px solid var(--primary, #378add); color: #fff; box-shadow: 0 4px 10px rgba(55,138,221,.3); }
.l3-step-done:active { transform: translateY(-1px); }

.l3-fill-item.l3-fill-size { flex-direction: column; align-items: stretch; gap: 4px; background: var(--background-secondary, #f5f7fa); padding: 14px 12px; }
.l3-fill-size-row { display: flex; align-items: center; gap: 10px; }
/* 20260821：多测值纵向排列（每行：变量名标签 + 输入框 + 单位） */
.l3-fill-size-col { display: flex; flex-direction: column; gap: 10px; }
.l3-fill-size-line { display: flex; align-items: center; gap: 10px; }
.l3-size-label { flex: 0 0 auto; width: 88px; font-size:0.9375rem; color: var(--text-muted); text-align: left; white-space: nowrap; }
.l3-size-input { flex: 1; text-align: center; font-size:1.375rem; font-weight: 600; color: var(--primary, #378add); border: none; border-bottom: 2px solid var(--line, #d7dbe0); background: transparent; padding: 10px 4px; font-family: inherit; }
.l3-size-input:focus { outline: none; border-bottom-color: var(--primary, #378add); }
.l3-size-input::placeholder { color: var(--text-muted); font-weight: 400; font-size:0.875rem; }
.l3-size-x { font-size:1.125rem; font-weight: 600; color: var(--text-muted); }
.l3-size-unit { font-size:0.875rem; color: var(--text-muted); flex: 0 0 auto; }
