/* 小程序风格 CSS - mp.css */
:root {
  --mp-primary: #07c160;
  --mp-primary-dark: #06ad56;
  --mp-blue: #2b6cb0;
  --mp-blue-light: #4299e1;
  --mp-bg: #f5f5f5;
  --mp-card: #ffffff;
  --mp-text: #1a1a1a;
  --mp-text-2: #666666;
  --mp-text-3: #999999;
  --mp-border: #ebebeb;
  --mp-radius: 12px;
  --mp-radius-sm: 8px;
  --mp-shadow: 0 2px 12px rgba(0,0,0,0.06);
  --mp-tabbar-h: 56px;
  --mp-navbar-h: 44px;
  --mp-statusbar-h: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; overflow: hidden; }

.mp-body {
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--mp-bg);
  color: var(--mp-text);
  max-width: 430px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.15);
}

/* 状态栏 */
.mp-statusbar {
  height: var(--mp-statusbar-h);
  background: #fff;
  flex-shrink: 0;
}

/* 顶部导航 */
.mp-navbar {
  height: var(--mp-navbar-h);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--mp-border);
  flex-shrink: 0;
}
.mp-navbar-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--mp-text);
}
.mp-navbar-back {
  position: absolute;
  left: 16px;
  font-size: 15px;
  color: var(--mp-blue);
  cursor: pointer;
  padding: 8px 0;
}
.mp-navbar-action {
  position: absolute;
  right: 16px;
  font-size: 14px;
  color: var(--mp-blue);
  cursor: pointer;
}

/* 滚动主区域 */
.mp-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--mp-tabbar-h) + 8px);
}

/* 底部导航 */
.mp-tabbar {
  height: var(--mp-tabbar-h);
  background: #fff;
  border-top: 1px solid var(--mp-border);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}
.mp-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--mp-text-3);
  padding: 6px 0;
  transition: color 0.2s;
}
.mp-tab.active { color: var(--mp-primary); }
.mp-tab-icon { font-size: 22px; line-height: 1; }
.mp-tab-label { font-size: 10px; }

/* 用户横幅 */
.mp-banner {
  background: linear-gradient(135deg, #2b6cb0 0%, #4299e1 100%);
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
}
.mp-banner-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  flex-shrink: 0;
}
.mp-banner-name { font-size: 18px; font-weight: 600; }
.mp-banner-sub { font-size: 13px; opacity: 0.85; margin-top: 2px; }

/* 公告 */
.mp-notice {
  background: #fff;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--mp-text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--mp-border);
}
.mp-notice-icon { font-size: 15px; }

/* 功能宫格 */
.mp-section-title {
  font-size: 13px;
  color: var(--mp-text-3);
  padding: 12px 16px 6px;
  font-weight: 500;
}
.mp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 6px 16px 12px;
}
.mp-grid-item {
  background: #fff;
  border-radius: var(--mp-radius);
  padding: 16px 8px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--mp-text);
  box-shadow: var(--mp-shadow);
  transition: transform 0.15s;
}
.mp-grid-item:active { transform: scale(0.96); }
.mp-grid-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin: 0 auto 8px;
}
.mp-grid-label { font-size: 13px; }

/* 卡片列表 */
.mp-card-list {
  background: #fff;
  border-radius: var(--mp-radius);
  margin: 0 12px 12px;
  overflow: hidden;
  box-shadow: var(--mp-shadow);
}
.mp-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--mp-border);
}
.mp-list-item:last-child { border-bottom: none; }
.mp-list-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.mp-list-info { flex: 1; min-width: 0; }
.mp-list-title { font-size: 14px; font-weight: 500; }
.mp-list-sub { font-size: 12px; color: var(--mp-text-3); margin-top: 2px; }
.mp-list-arrow { color: var(--mp-text-3); font-size: 14px; }

/* 徽标 */
.mp-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}
.badge-green { background: #d4edda; color: #155724; }
.badge-orange { background: #fff3cd; color: #856404; }
.badge-blue { background: #cce5ff; color: #004085; }
.badge-red { background: #f8d7da; color: #721c24; }
.badge-gray { background: #e9ecef; color: #495057; }

/* 提示卡片 */
.mp-tips-card {
  background: #fff;
  border-radius: var(--mp-radius);
  margin: 0 12px 12px;
  padding: 4px 0;
  box-shadow: var(--mp-shadow);
}
.mp-tip-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--mp-border);
}
.mp-tip-item:last-child { border-bottom: none; }
.mp-tip-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: #f0f4ff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.mp-tip-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.mp-tip-desc { font-size: 12px; color: var(--mp-text-2); line-height: 1.5; }

/* 表单 */
.mp-form-group { margin-bottom: 14px; }
.mp-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--mp-border);
  border-radius: var(--mp-radius-sm);
  font-size: 15px;
  background: #f9f9f9;
  outline: none;
  transition: border 0.2s;
}
.mp-input:focus { border-color: var(--mp-blue-light); background: #fff; }
textarea.mp-input { resize: none; line-height: 1.6; }
select.mp-input { appearance: none; }

.mp-label { font-size: 14px; color: var(--mp-text-2); margin-bottom: 6px; display: block; }
.mp-hint { font-size: 12px; color: var(--mp-text-3); margin-bottom: 14px; }

.mp-btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--mp-primary);
  color: #fff;
  border: none;
  border-radius: var(--mp-radius);
  font-size: 16px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}
.mp-btn-primary:active { background: var(--mp-primary-dark); }
.mp-btn-outline {
  width: 100%;
  padding: 12px;
  background: #fff;
  color: var(--mp-blue);
  border: 1px solid var(--mp-blue);
  border-radius: var(--mp-radius);
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
}
.mp-btn-sm {
  padding: 6px 14px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  background: var(--mp-primary);
  color: #fff;
}
.mp-btn-sm.secondary { background: var(--mp-blue); }

/* 弹窗 */
.mp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
}
.mp-modal {
  background: #fff;
  width: 100%;
  max-width: 430px;
  border-radius: 20px 20px 0 0;
  padding-bottom: 20px;
}
.mp-modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--mp-border);
  font-size: 17px;
  font-weight: 600;
}
.mp-modal-close {
  background: none; border: none; font-size: 20px; cursor: pointer; color: var(--mp-text-3);
}
.mp-modal-body { padding: 20px; }

/* 大弹窗（居中） */
.mp-modal-center {
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 20px;
  margin: 20px;
}

/* 量表题目 */
.mp-scale-q {
  background: #f9f9f9;
  border-radius: var(--mp-radius-sm);
  padding: 14px;
  margin-bottom: 12px;
}
.mp-scale-q .q-title { font-size: 15px; font-weight: 500; margin-bottom: 10px; }
.mp-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 4px;
}
.mp-option:hover { background: #e8f4fd; }
.mp-option input[type="radio"] { accent-color: var(--mp-primary); }

/* 音乐播放器 */
.mp-player {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--mp-radius);
  padding: 20px;
  color: #fff;
  text-align: center;
  margin: 0 12px 12px;
}
.mp-player-disc {
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  margin: 0 auto 12px;
}
.mp-player-track { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.mp-player-info { font-size: 12px; opacity: 0.8; margin-bottom: 14px; }
.mp-progress {
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  margin: 12px 0;
  overflow: hidden;
}
.mp-progress-fill {
  height: 100%;
  background: #fff;
  width: 0%;
  transition: width 0.3s;
}
.mp-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
}
.mp-ctrl-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.mp-ctrl-btn.play { width: 56px; height: 56px; font-size: 24px; }

/* 耳穴卡片 */
.mp-acupoint {
  background: #fff;
  border-radius: var(--mp-radius);
  padding: 14px;
  box-shadow: var(--mp-shadow);
}
.mp-acupoint-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.mp-acupoint-dot {
  width: 36px; height: 36px;
  background: #fff5f0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

/* 空状态 */
.mp-empty {
  text-align: center;
  padding: 24px;
  color: var(--mp-text-3);
  font-size: 14px;
}

/* Toast */
.mp-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}

.hidden { display: none !important; }

/* 详情页通用结构 */
.mp-page-content {
  padding: 12px;
}
.mp-detail-card {
  background: #fff;
  border-radius: var(--mp-radius);
  margin-bottom: 12px;
  box-shadow: var(--mp-shadow);
  overflow: hidden;
}
.mp-detail-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--mp-border);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mp-detail-body { padding: 14px 16px; }

/* 信息行 */
.mp-info-row {
  display: flex;
  padding: 11px 0;
  border-bottom: 1px solid var(--mp-border);
  font-size: 14px;
}
.mp-info-row:last-child { border-bottom: none; }
.mp-info-label { color: var(--mp-text-2); width: 80px; flex-shrink: 0; }
.mp-info-value { flex: 1; color: var(--mp-text); }

/* 单选项按钮 */
.mp-radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.mp-radio-btn {
  padding: 7px 14px;
  border: 1px solid var(--mp-border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
}
.mp-radio-btn.active { background: var(--mp-primary); color: #fff; border-color: var(--mp-primary); }
