/* ==========================================
   艺只鹅 - 微信小程序风格样式系统
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --mp-green: #8B5CF6;
  --mp-green-light: #C4B5FD;
  --mp-green-dark: #7C3AED;
  --mp-accent: #F59E0B;
  --mp-bg: #F5F3FF;
  --mp-card: #FFFFFF;
  --mp-border: #EDE9FE;
  --mp-text: #111111;
  --mp-text-2: #333333;
  --mp-text-3: #666666;
  --mp-text-4: #999999;
  --mp-success: #10B981;
  --mp-warning: #F59E0B;
  --mp-danger: #EF4444;
  --mp-info: #6366F1;
  --mp-radius: 16px;
  --mp-radius-sm: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #EDEDED;
  color: var(--mp-text);
  -webkit-font-smoothing: antialiased;
}

/* ===== 手机模拟框（桌面端） ===== */
.mp-page {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--mp-bg);
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,0.08);
}
.mp-page * { box-sizing: border-box; }
@media (min-width: 500px) {
  body { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; padding: 20px 0; }
  .mp-page { border-radius: 32px; min-height: calc(100vh - 40px); max-height: calc(100vh - 40px); overflow-y: auto; overflow-x: hidden; }
  .mp-page::-webkit-scrollbar { width: 0; }
}
@media (max-width: 499px) {
  .mp-page { max-width: 100%; }
}

/* ===== 顶部导航栏 ===== */
.mp-navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 44px; padding: 0 12px;
  background: var(--mp-card);
  border-bottom: 0.5px solid var(--mp-border);
  width: 100%; box-sizing: border-box;
}
.mp-navbar.transparent { background: transparent; border-bottom: none; }
.mp-navbar.light .mp-navbar-title, .mp-navbar.light .mp-navbar-back { color: #fff; }
.mp-navbar-left, .mp-navbar-right { width: 44px; display: flex; align-items: center; }
.mp-navbar-back { color: var(--mp-text); display: flex; align-items: center; text-decoration: none; padding: 8px 4px; }
.mp-navbar-title { font-size: 17px; font-weight: 600; text-align: center; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 底部TabBar ===== */
.mp-tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-around;
  height: calc(50px + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--mp-card);
  border-top: 0.5px solid var(--mp-border);
  z-index: 100;
}
.mp-tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: #999999; padding: 4px 0;
  transition: color 0.2s;
}
.mp-tabbar-item.active { color: var(--mp-green); font-weight: 500; }
.mp-tabbar-icon { width: 24px; height: 24px; margin-bottom: 2px; }
.mp-tabbar-icon svg { width: 100%; height: 100%; }
.mp-tabbar-label { font-size: 10px; line-height: 1.2; }
.mp-tabbar-placeholder { height: calc(50px + var(--safe-bottom) + 8px); }

/* ===== 页面内容区 ===== */
.mp-content { padding: 0 16px 16px; width: 100%; box-sizing: border-box; }
.mp-content.has-tabbar { padding-bottom: calc(66px + var(--safe-bottom)); }

/* ===== 卡片 ===== */
.mp-card {
  background: var(--mp-card); border-radius: var(--mp-radius);
  margin-bottom: 12px; overflow: hidden;
  width: 100%; box-sizing: border-box;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.mp-card-header {
  padding: 14px 16px 0;
  font-size: 15px; font-weight: 600; color: var(--mp-text);
}
.mp-card-body { padding: 12px 16px; }

/* ===== 单元格 ===== */
.mp-cell {
  display: flex; align-items: center; padding: 14px 16px;
  background: var(--mp-card); min-height: 48px;
  border-bottom: 0.5px solid var(--mp-border);
  text-decoration: none; color: inherit;
  width: 100%; box-sizing: border-box;
}
.mp-cell:last-child { border-bottom: none; }
.mp-cell-title { flex: 1; font-size: 14px; color: #111111; font-weight: 500; }
.mp-cell-label { font-size: 12px; color: #666666; margin-top: 2px; }
.mp-cell-value { font-size: 14px; color: #666666; margin-left: 8px; text-align: right; }
.mp-cell-arrow::after {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-top: 1.5px solid var(--mp-text-4); border-right: 1.5px solid var(--mp-text-4);
  transform: rotate(45deg); margin-left: 8px;
}
.mp-cell-icon { width: 24px; height: 24px; margin-right: 12px; display: flex; align-items: center; justify-content: center; }

/* ===== 按钮 ===== */
.mp-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 44px; border-radius: 22px;
  font-size: 16px; font-weight: 600; border: none; cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.5px;
}
.mp-btn:active { opacity: 0.7; transform: scale(0.98); }
.mp-btn-primary { background: var(--mp-green); color: #fff; }
.mp-btn-default { background: var(--mp-card); color: var(--mp-text); border: 0.5px solid var(--mp-border); }
.mp-btn-warn { background: var(--mp-danger); color: #fff; }
.mp-btn-sm { height: 32px; border-radius: 16px; font-size: 13px; width: auto; padding: 0 16px; }
.mp-btn-mini { height: 26px; border-radius: 13px; font-size: 11px; width: auto; padding: 0 12px; }
.mp-btn-ghost { background: transparent; color: var(--mp-green); border: 1px solid var(--mp-green); }

/* ===== 输入框 ===== */
.mp-input-group { margin-bottom: 0; }
.mp-input-label { font-size: 14px; color: #111111; font-weight: 600; margin-bottom: 6px; display: block; }
.mp-input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 0.5px solid var(--mp-border); border-radius: var(--mp-radius-sm);
  font-size: 14px; color: var(--mp-text); background: var(--mp-bg);
  outline: none; transition: border-color 0.2s;
}
.mp-input:focus { border-color: var(--mp-green); }
.mp-textarea {
  width: 100%; padding: 10px 12px; min-height: 80px;
  border: 0.5px solid var(--mp-border); border-radius: var(--mp-radius-sm);
  font-size: 14px; color: var(--mp-text); background: var(--mp-bg);
  outline: none; resize: none; font-family: inherit;
}
.mp-textarea:focus { border-color: var(--mp-green); }

/* ===== 标签 ===== */
.mp-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
}
.mp-tag-round { border-radius: 11px; }
.status-success { background: #ECFDF5; color: #059669; }
.status-warning { background: #FFFBEB; color: #D97706; }
.status-info { background: #EDE9FE; color: #7C3AED; }
.status-danger { background: #FEF2F2; color: #EF4444; }
.status-disabled { background: #F3F4F6; color: #9CA3AF; }
.status-purple { background: #EDE9FE; color: #7C3AED; }
.status-default { background: #F3F4F6; color: #6B7280; }

/* ===== Toast ===== */
.mp-toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 9999; opacity: 0; transition: opacity 0.3s;
}
.mp-toast.show { opacity: 1; }
.mp-toast-inner {
  background: rgba(0,0,0,0.72); border-radius: 12px;
  padding: 20px 24px; text-align: center; min-width: 120px;
}
.mp-toast-icon { color: #fff; display: flex; justify-content: center; margin-bottom: 8px; }
.mp-toast-text { color: #fff; font-size: 14px; line-height: 1.4; }

/* ===== Modal ===== */
.mp-modal-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0); display: flex; align-items: center; justify-content: center;
  padding: 32px; transition: background 0.2s;
}
.mp-modal-overlay.show { background: rgba(0,0,0,0.45); }
.mp-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 320px;
  overflow: hidden; transform: scale(0.9); opacity: 0; transition: all 0.2s;
}
.mp-modal-overlay.show .mp-modal { transform: scale(1); opacity: 1; }
.mp-modal-header { padding: 24px 24px 8px; font-size: 17px; font-weight: 600; text-align: center; }
.mp-modal-body { padding: 0 24px 24px; font-size: 14px; color: var(--mp-text-2); text-align: center; line-height: 1.6; }
.mp-modal-footer { display: flex; border-top: 0.5px solid var(--mp-border); }
.mp-modal-btn {
  flex: 1; height: 48px; border: none; font-size: 16px; cursor: pointer;
  background: transparent; transition: background 0.2s;
}
.mp-modal-btn:active { background: #f5f5f5; }
.mp-modal-btn.cancel { color: var(--mp-text-2); }
.mp-modal-btn.confirm { color: var(--mp-green); font-weight: 500; border-left: 0.5px solid var(--mp-border); }

/* ===== 搜索栏 ===== */
.mp-search {
  display: flex; align-items: center; height: 36px;
  background: var(--mp-bg); border-radius: 18px; padding: 0 12px;
  border: 1px solid var(--mp-border);
}
.mp-search-icon { width: 16px; height: 16px; color: #999999; margin-right: 6px; flex-shrink: 0; }
.mp-search input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 14px; color: var(--mp-text); height: 100%;
}
.mp-search input::placeholder { color: #999999; }

/* ===== 网格 ===== */
.mp-grid { display: grid; gap: 10px; }
.mp-grid-2 { grid-template-columns: repeat(2, 1fr); }
.mp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.mp-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== 头像 ===== */
.mp-avatar { border-radius: 50%; object-fit: cover; }
.mp-avatar-round { border-radius: var(--mp-radius-sm); object-fit: cover; }

/* ===== 分割线 ===== */
.mp-divider { height: 0.5px; background: var(--mp-border); margin: 0; }

/* ===== 空状态 ===== */
.mp-empty { text-align: center; padding: 48px 16px; }
.mp-empty-icon { width: 80px; height: 80px; margin: 0 auto 12px; color: var(--mp-text-4); }
.mp-empty-text { font-size: 14px; color: #999999; }

/* ===== 徽标 ===== */
.mp-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--mp-danger); color: #fff; font-size: 10px;
  border-radius: 8px; font-weight: 500;
}

/* ===== 开关 ===== */
.mp-switch { position: relative; width: 44px; height: 26px; cursor: pointer; }
.mp-switch input { display: none; }
.mp-switch-track {
  position: absolute; inset: 0; background: #E5E5EA; border-radius: 13px;
  transition: background 0.3s;
}
.mp-switch input:checked + .mp-switch-track { background: var(--mp-green); }
.mp-switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.3s;
}
.mp-switch input:checked ~ .mp-switch-thumb { transform: translateX(18px); }

/* ===== 筛选标签 ===== */
.mp-filter-tag {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: 14px; font-size: 12px; color: #333333;
  background: var(--mp-bg); border: 1px solid var(--mp-border); cursor: pointer;
  transition: all 0.2s;
}
.mp-filter-tag.active { background: rgba(139,92,246,0.12); color: var(--mp-green); font-weight: 600; border-color: rgba(139,92,246,0.3); }

/* ===== 步骤条 ===== */
.mp-steps { display: flex; align-items: center; padding: 16px 0; }
.mp-step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.mp-step-dot {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; background: var(--mp-border); color: var(--mp-text-4);
  position: relative; z-index: 1;
}
.mp-step.active .mp-step-dot { background: var(--mp-green); color: #fff; }
.mp-step.done .mp-step-dot { background: var(--mp-green); color: #fff; }
.mp-step-label { font-size: 11px; color: var(--mp-text-4); margin-top: 4px; }
.mp-step.active .mp-step-label { color: var(--mp-green); font-weight: 500; }
.mp-step.done .mp-step-label { color: var(--mp-green); }
.mp-step-line {
  position: absolute; top: 12px; left: calc(50% + 16px); right: calc(-50% + 16px);
  height: 2px; background: var(--mp-border);
}
.mp-step.done .mp-step-line { background: var(--mp-green); }

/* ===== 动画 ===== */
.mp-fade-in { animation: mpFadeIn 0.3s ease; }
@keyframes mpFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 下拉选择 ===== */
.mp-select {
  width: 100%; height: 40px; padding: 0 12px;
  border: 0.5px solid var(--mp-border); border-radius: var(--mp-radius-sm);
  font-size: 14px; color: var(--mp-text); background: var(--mp-bg);
  outline: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23C8C9CC' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
