/* ============================================================
   呼吸树 - 呼吸机随访小程序 线框图原型样式
   配色主题：蓝绿色调
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #0a7a8a;
  --primary-light: #1ab5cc;
  --primary-dark: #065a68;
  --accent: #00c9b1;
  --accent-light: #7eeee3;
  --bg-main: #f0f8f9;
  --bg-card: #ffffff;
  --bg-page: #e8f4f6;
  --border: #b2dde4;
  --border-strong: #7bbfca;
  --text-primary: #1a3a40;
  --text-secondary: #4a7a84;
  --text-muted: #8abbc4;
  --text-white: #ffffff;
  --nav-height: 60px;
  --status-bar: 28px;
  --shadow: 0 2px 8px rgba(10, 122, 138, 0.15);
  --shadow-strong: 0 4px 16px rgba(10, 122, 138, 0.25);
  --radius: 8px;
  --radius-lg: 14px;
  --font: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: #d0ecf0;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  padding: 40px 20px;
}

/* ---------- Page Layout ---------- */
.prototype-header {
  text-align: center;
  margin-bottom: 40px;
}
.prototype-header h1 {
  font-size: 28px;
  color: var(--primary-dark);
  font-weight: 700;
  letter-spacing: 2px;
}
.prototype-header p {
  color: var(--text-secondary);
  margin-top: 6px;
  font-size: 13px;
}

/* ---------- Flow Section ---------- */
.flow-section {
  margin-bottom: 60px;
}
.flow-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-strong);
}
.flow-section-title .icon {
  width: 28px; height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

/* ---------- Screen Group ---------- */
.screen-group {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 50px;
  align-items: flex-start;
}

/* ---------- Arrow between screens ---------- */
.screen-row {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}
.arrow-line {
  width: 40px;
  height: 2px;
  background: var(--primary-light);
  position: relative;
}
.arrow-line::after {
  content: '';
  position: absolute;
  right: -1px; top: -4px;
  border: 5px solid transparent;
  border-left-color: var(--primary-light);
}
.arrow-label {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
  white-space: nowrap;
}

/* ---------- Phone Frame ---------- */
.phone-frame {
  width: 320px;
  min-height: 580px;
  background: var(--bg-card);
  border-radius: 28px;
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-strong);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  flex-shrink: 0;
}
.phone-frame.tall { min-height: 700px; }
.phone-frame.short { min-height: 500px; }

/* Status Bar */
.status-bar {
  height: var(--status-bar);
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}
.status-bar span { color: rgba(255,255,255,0.8); font-size: 11px; }

/* Nav Bar */
.nav-bar {
  height: 44px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
}
.nav-bar .nav-title {
  color: white;
  font-size: 16px;
  font-weight: 600;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-bar .nav-back {
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  cursor: pointer;
}
.nav-bar .nav-right {
  color: rgba(255,255,255,0.9);
  font-size: 12px;
}

/* Page Content */
.page-content {
  flex: 1;
  background: var(--bg-page);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.page-content.padded { padding: 12px; }
.page-content.white-bg { background: var(--bg-card); }

/* Bottom Tab Bar */
.tab-bar {
  height: var(--nav-height);
  background: var(--bg-card);
  border-top: 1.5px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  flex-shrink: 0;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 2px 0;
}
.tab-icon {
  font-size: 20px;
  line-height: 1;
}
.tab-label {
  font-size: 10px;
  color: var(--text-muted);
}
.tab-item.active .tab-label { color: var(--primary); }
.tab-item.active .tab-icon { filter: none; }
.tab-item .tab-icon { color: var(--text-muted); }
.tab-item.active .tab-icon { color: var(--primary); }

/* ---------- Wireframe Components ---------- */

/* Card */
.wf-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 12px;
  margin-bottom: 10px;
}
.wf-card.no-margin { margin-bottom: 0; }
.wf-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wf-card-title .badge {
  background: var(--primary-light);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 400;
}
.wf-card-title .tag-new {
  background: #e8f8f6;
  color: var(--accent);
  border: 1px solid var(--accent-light);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.section-header .title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.section-header .more {
  font-size: 11px;
  color: var(--primary-light);
}

/* Banner */
.wf-banner {
  height: 120px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius);
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  border: 1.5px dashed rgba(255,255,255,0.5);
}
.wf-banner .banner-tag {
  background: rgba(255,255,255,0.25);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.wf-banner .banner-title {
  font-size: 16px;
  font-weight: 700;
}
.wf-banner .banner-sub {
  font-size: 11px;
  opacity: 0.85;
  margin-top: 4px;
}

/* Grid */
.wf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  margin-bottom: 10px;
}
.wf-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.grid-icon-box {
  width: 46px; height: 46px;
  background: var(--bg-page);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.wf-grid-item span { font-size: 10px; color: var(--text-secondary); text-align: center; }

/* List */
.wf-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.wf-list-item .item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wf-list-item .item-icon {
  width: 36px; height: 36px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.wf-list-item .item-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.wf-list-item .item-sub { font-size: 11px; color: var(--text-muted); }
.wf-list-item .item-right { font-size: 14px; color: var(--text-muted); }
.wf-list-item .item-price { font-size: 14px; color: var(--primary); font-weight: 600; }

/* Image Placeholder */
.wf-img {
  background: var(--bg-page);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

/* Button */
.wf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.wf-btn.outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.wf-btn.accent {
  background: var(--accent);
}
.wf-btn.small {
  padding: 4px 12px;
  font-size: 11px;
}
.wf-btn.full {
  width: 100%;
  padding: 11px;
  border-radius: 24px;
}
.wf-btn.disabled {
  opacity: 0.45;
}

/* Input */
.wf-input {
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  display: flex;
  align-items: center;
  background: white;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.wf-input.filled { color: var(--text-primary); }

/* Tag / Badge */
.wf-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg-page);
}
.wf-tag.primary { background: var(--primary); color: white; border-color: var(--primary); }
.wf-tag.success { background: #e8f8f6; color: var(--accent); border-color: var(--accent-light); }
.wf-tag.warn { background: #fff8e6; color: #c68e00; border-color: #f0d080; }
.wf-tag.danger { background: #fef0f0; color: #d94040; border-color: #f0b0b0; }

/* Progress Bar */
.wf-progress-wrap { height: 8px; background: var(--bg-page); border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.wf-progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%); border-radius: 4px; }

/* Step */
.wf-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 8px 12px;
  overflow: hidden;
}
.wf-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.wf-step::before {
  content: '';
  position: absolute;
  top: 10px;
  left: calc(50% + 12px);
  right: calc(-50% + 12px);
  height: 2px;
  background: var(--border);
}
.wf-step:last-child::before { display: none; }
.wf-step.done::before { background: var(--primary); }
.step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-page);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  z-index: 1;
}
.wf-step.done .step-dot { background: var(--primary); border-color: var(--primary); color: white; }
.wf-step.current .step-dot { background: white; border-color: var(--primary); color: var(--primary); }
.step-label { font-size: 10px; color: var(--text-muted); margin-top: 4px; text-align: center; white-space: nowrap; }
.wf-step.done .step-label { color: var(--primary); }
.wf-step.current .step-label { color: var(--primary); font-weight: 600; }

/* Form Row */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: white;
}
.form-row .label { font-size: 13px; color: var(--text-primary); min-width: 70px; }
.form-row .value { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.form-row .value.filled { color: var(--text-primary); }
.form-row .arrow-right { font-size: 12px; color: var(--text-muted); }

/* Notification Dot */
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #e84040;
  display: inline-block;
}
.notif-badge {
  min-width: 16px; height: 16px;
  border-radius: 8px;
  background: #e84040;
  color: white;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Divider */
.wf-divider {
  height: 8px;
  background: var(--bg-page);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wf-divider.thin { height: 1px; background: var(--border); border: none; margin: 6px 0; }
.wf-divider.labeled {
  height: auto;
  padding: 4px 12px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Chart mock */
.wf-chart {
  background: var(--bg-page);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 10px;
  gap: 4px;
  overflow: hidden;
}
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 60px;
  width: 100%;
}
.chart-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
  border-radius: 3px 3px 0 0;
  opacity: 0.7;
}
.chart-x {
  display: flex;
  gap: 6px;
  width: 100%;
}
.chart-x span { flex: 1; text-align: center; font-size: 9px; color: var(--text-muted); }

/* User Avatar */
.wf-avatar {
  border-radius: 50%;
  background: var(--bg-page);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* Annotation */
.annotation {
  font-size: 10px;
  color: var(--primary-dark);
  background: rgba(10,122,138,0.08);
  border-left: 3px solid var(--primary);
  padding: 3px 8px;
  border-radius: 0 4px 4px 0;
  margin-top: 6px;
}

/* Screen Label */
.screen-label {
  text-align: center;
  margin-top: 10px;
}
.screen-label .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
}
.screen-label .desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Scroll indicator */
.scroll-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 10px;
  padding: 5px;
  border-top: 1px dashed var(--border);
}

/* ---------- Bluetooth specific ---------- */
.ble-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  margin: 10px auto;
}
.ble-ring::before {
  content: '';
  position: absolute;
  width: 95px; height: 95px;
  border-radius: 50%;
  border: 2px dashed var(--border);
}
.ble-icon { font-size: 30px; color: var(--primary); }

/* ---------- Survey / Questionnaire ---------- */
.survey-q {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
}
.survey-q .q-num {
  font-size: 10px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}
.survey-q .q-text { font-size: 12px; color: var(--text-primary); margin-bottom: 8px; line-height: 1.4; }
.survey-options { display: flex; flex-direction: column; gap: 5px; }
.survey-option {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}
.survey-option.selected {
  border-color: var(--primary);
  background: rgba(10,122,138,0.06);
  color: var(--primary);
}
.radio-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.survey-option.selected .radio-dot {
  border-color: var(--primary);
  background: var(--primary);
}

/* ---------- Flow Map Legend ---------- */
.flow-legend {
  display: flex;
  gap: 20px;
  padding: 12px 20px;
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.legend-box {
  width: 20px; height: 14px;
  border-radius: 3px;
  border: 2px solid var(--primary);
  background: white;
}
.legend-arrow { display: flex; align-items: center; }
.legend-arrow-line { width: 24px; height: 2px; background: var(--primary-light); }
.legend-arrow-head { border: 4px solid transparent; border-left-color: var(--primary-light); }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .screen-row { flex-direction: column; }
  .arrow { transform: rotate(90deg); margin: 8px 0; }
}
