/* 交互原型共享样式 */
:root {
  --primary: #1a9b96;
  --primary-dark: #158a85;
  --primary-light: #e6f7f6;
  --accent: #ff8c42;
  --danger: #f56c6c;
  --warning: #e6a23c;
  --success: #67c23a;
  --text: #303133;
  --text-secondary: #909399;
  --border: #ebeef5;
  --bg: #f5f7fa;
  --white: #ffffff;
  --sidebar: #1e2a3a;
  --font: "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); }

a, button, [data-go], [data-action], .clickable { cursor: pointer; }
a { text-decoration: none; color: inherit; }

.btn-primary {
  background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 10px 20px; font-size: 14px; cursor: pointer; transition: opacity .2s;
}
.btn-primary:hover { opacity: .9; }
.btn-primary:active { transform: scale(.98); }
.btn-outline {
  background: #fff; color: var(--primary); border: 1px solid var(--primary);
  border-radius: 8px; padding: 10px 20px; font-size: 14px; cursor: pointer;
}
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; border: none; color: var(--primary); cursor: pointer; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-green { background: var(--primary-light); color: var(--primary); }
.tag-red { background: #fef0f0; color: var(--danger); }
.tag-orange { background: #fdf6ec; color: var(--warning); }

.card { background: #fff; border-radius: 12px; padding: 16px; margin: 12px 16px; border: 1px solid var(--border); }

/* Toast */
.proto-toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.75); color: #fff; padding: 14px 24px; border-radius: 8px;
  font-size: 14px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .3s;
}
.proto-toast.show { opacity: 1; }

/* Modal */
.proto-modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000;
  display: none; align-items: center; justify-content: center;
}
.proto-modal-mask.open { display: flex; }
.proto-modal {
  background: #fff; border-radius: 12px; max-width: 95vw; max-height: 90vh; overflow: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

/* Launcher */
.launcher { min-height: 100vh; background: linear-gradient(135deg, #e8f4f8, #f0f0f0); display: flex; align-items: center; justify-content: center; padding: 24px; }
.launcher-box { background: #fff; border-radius: 16px; padding: 48px; max-width: 520px; width: 100%; box-shadow: 0 8px 40px rgba(0,0,0,.08); text-align: center; }
.launcher h1 { color: var(--primary); margin-bottom: 8px; }
.launcher p { color: #999; margin-bottom: 32px; }
.launcher-links { display: flex; flex-direction: column; gap: 12px; }
.launcher-links a {
  display: block; padding: 16px 24px; border-radius: 10px; font-size: 16px; font-weight: 600;
  border: 2px solid var(--primary); color: var(--primary); transition: all .2s;
}
.launcher-links a:hover { background: var(--primary); color: #fff; }
.launcher-links a.secondary { border-color: var(--sidebar); color: var(--sidebar); }
.launcher-links a.secondary:hover { background: var(--sidebar); color: #fff; }

/* Phone frame */
.phone-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #2c2c2c; padding: 24px;
}
.phone-frame {
  width: 375px; height: 812px; background: #fff; border-radius: 32px; overflow: hidden;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.phone-page { display: none; height: 100%; flex-direction: column; }
.phone-page.active { display: flex; }

.mp-status { height: 44px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; flex-shrink: 0; }
.mp-nav {
  height: 44px; display: flex; align-items: center; padding: 0 16px;
  background: var(--primary); color: #fff; font-size: 17px; flex-shrink: 0;
}
.mp-nav .back { margin-right: 8px; font-size: 20px; }
.mp-body { flex: 1; overflow-y: auto; background: var(--bg); }
.mp-body.with-tab { padding-bottom: 56px; }
.mp-tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; height: 56px; background: #fff;
  border-top: 1px solid var(--border); display: flex; z-index: 100;
}
.mp-tabbar a { flex: 1; text-align: center; padding-top: 6px; font-size: 11px; color: #999; text-decoration: none; }
.mp-tabbar a.active { color: var(--primary); }
.mp-tabbar .tab-icon { width: 24px; height: 24px; display: block; margin: 0 auto 2px; object-fit: contain; }

.banner { background: linear-gradient(135deg, #1a9b96, #2bb8b2); margin: 12px 16px; border-radius: 12px; padding: 24px; color: #fff; }
.stat-big { font-size: 48px; font-weight: 700; color: var(--primary); text-align: center; }
.form-row { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.form-row-left { display: flex; align-items: center; gap: 10px; }
.mi-icon { width: 24px; height: 24px; flex-shrink: 0; object-fit: contain; }
.info-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #666; margin-top: 4px; }
.info-line .mi-icon { margin-top: 1px; }
.success-icon { width: 64px; height: 64px; display: block; margin: 0 auto; object-fit: contain; }
.slot { padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; display: inline-block; margin: 4px; }
.slot.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.slot.disabled { color: #ccc; pointer-events: none; }

/* PC shell */
.pc-shell { min-height: 100vh; background: #e8eaed; }
.pc-frame { width: 100%; max-width: 1440px; margin: 0 auto; min-height: 100vh; background: #fff; display: flex; flex-direction: column; }
.pc-topbar {
  height: 48px; background: var(--sidebar); color: #fff; display: flex; align-items: center;
  padding: 0 16px; font-size: 13px; gap: 20px; flex-shrink: 0;
}
.pc-topbar .brand { font-weight: 700; margin-right: 8px; }
.pc-topbar a { color: rgba(255,255,255,.65); text-decoration: none; padding: 4px 0; }
.pc-topbar a:hover, .pc-topbar a.active { color: #fff; border-bottom: 2px solid var(--primary); }
.pc-topbar .right { margin-left: auto; opacity: .85; }
.pc-page { display: none; flex: 1; }
.pc-page.active { display: flex; flex-direction: column; }

.patient-item { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.patient-item:hover { background: #fafafa; }
.patient-item.active { background: var(--primary-light); border-left: 3px solid var(--primary); }
.emr-section { background: #fff; margin: 12px; border-radius: 8px; border: 1px solid var(--border); }
.emr-header { padding: 10px 16px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.emr-body { padding: 16px; }
.field-row { display: flex; margin-bottom: 12px; font-size: 13px; gap: 8px; }
.field-label { width: 72px; color: #666; flex-shrink: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { background: #fafafa; }
.stat-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 140px; background: #fff; padding: 16px; border-radius: 8px; border: 1px solid var(--border); }
.stat-card .num { font-size: 24px; font-weight: 700; color: var(--primary); }

.proto-badge {
  position: fixed; top: 12px; right: 12px; background: var(--primary); color: #fff;
  padding: 6px 12px; border-radius: 20px; font-size: 12px; z-index: 8000; opacity: .9;
}
