/* =====================================================================
 * 素问生命观 · 会员系统样式（全局脚本 member.js 配套）
 * 命名空间 sw- 前缀，避免与主题冲突
 * ===================================================================== */

/* ---- 顶部登录按钮 ---- */
.member-widget { display: inline-flex; align-items: center; }
.member-widget-btn {
  border: 1px solid #2b8a4e;
  background: #fff;
  color: #1e6f3e;
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.member-widget-btn:hover { background: #1e6f3e; color: #fff; }
.member-user-btn { background: #1e6f3e; color: #fff; }
.member-user-btn:hover { background: #2b8a4e; color: #fff; }

/* ---- 弹窗 ---- */
.sw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 24, 0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: swFade 0.18s ease;
}
.sw-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  padding: 26px 26px 24px;
  position: relative;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  max-height: 92vh;
  overflow-y: auto;
}
.sw-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 26px;
  color: #6b7a6e;
  cursor: pointer;
  line-height: 1;
}
.sw-modal-close:hover { color: #1e6f3e; }

/* ---- 表单 ---- */
.sw-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.sw-tab {
  flex: 1;
  border: 1px solid #c8d8bc;
  background: #f2f7f3;
  color: #3a4a3e;
  padding: 9px 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
}
.sw-tab.active { background: #1e6f3e; color: #fff; border-color: #1e6f3e; }
.sw-form { display: flex; flex-direction: column; gap: 8px; }
.sw-form label { font-size: 13px; color: #5a6a5e; font-weight: 600; }
.sw-form input {
  border: 1px solid #c8d8bc;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  background: #fbfdfb;
}
.sw-form input:focus { border-color: #2b8a4e; }
.sw-btn-primary {
  margin-top: 8px;
  border: none;
  background: #1e6f3e;
  color: #fff;
  padding: 11px 0;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 700;
}
.sw-btn-primary:hover { background: #2b8a4e; }
.sw-btn-primary:disabled { opacity: 0.6; cursor: default; }
.sw-hint { font-size: 13px; color: #8a978c; margin: 8px 0 0; }
.sw-link { background: none; border: none; color: #2b8a4e; cursor: pointer; text-decoration: underline; font-size: 14px; margin-top: 10px; }

/* ---- 报名成功 ---- */
.sw-join h3 { margin: 0 0 8px; color: #1e6f3e; }
.sw-join-price { font-size: 20px; font-weight: 700; color: #1e6f3e; margin: 6px 0 14px; }
.sw-join-step { font-size: 14px; color: #4a5a4e; margin: 0 0 10px; }
.sw-join-steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sw-step { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #3a4a3e; }
.sw-step b {
  background: #e9f1e2;
  color: #1e6f3e;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.sw-join .qr-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px dashed #2b8a4e;
  border-radius: 12px;
  padding: 12px;
  background: #f2f7f3;
  margin-top: 4px;
}
.sw-order-box {
  border: 1px solid #c8d8bc;
  border-radius: 10px;
  background: #fbfdfb;
  padding: 12px;
  margin-bottom: 12px;
}
.sw-order-label {
  font-size: 13px;
  color: #6a7a6e;
  font-weight: 600;
  margin-bottom: 6px;
}
.sw-order-no {
  font-size: 15px;
  color: #1e6f3e;
  font-weight: 700;
  word-break: break-all;
  line-height: 1.5;
  background: #e9f1e2;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.sw-copy-btn { margin-top: 0; width: 100%; }
.sw-join .qr-card code { background: #e9f1e2; padding: 2px 6px; border-radius: 6px; color: #1e6f3e; }
.sw-join .qr-card-text { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #4a5a4e; }
.sw-join .qr-card-text strong { color: #1e6f3e; }

/* ---- 用户面板 ---- */
.sw-user h3 { margin: 0; color: #1e6f3e; }
.sw-role { font-size: 13px; color: #6a7a6e; margin: 6px 0 16px; }
.sw-user-nav { display: flex; gap: 8px; margin-bottom: 16px; }
.sw-nav {
  flex: 1;
  border: 1px solid #c8d8bc;
  background: #f2f7f3;
  color: #4a5a4e;
  padding: 9px 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.sw-nav:hover { border-color: #2b8a4e; color: #1e6f3e; }
.sw-nav.active { background: #1e6f3e; color: #fff; border-color: #1e6f3e; }
.sw-user-body { min-height: 80px; }
.sw-admin-link { display: block; margin: 14px 0 10px; font-size: 14px; color: #b45309; text-decoration: none; }
.sw-nav-logout { width: 100%; border: 1px solid #e2c1c1; background: #fff; color: #b3452b; padding: 9px 0; border-radius: 10px; cursor: pointer; font-size: 14px; margin-top: 12px; }
.sw-nav-logout:hover { background: #fdeeea; }

/* ---- 我的课程 ---- */
.sw-course {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #e3ecdf;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fbfdfb;
}
.sw-course b { color: #3a4a3e; font-size: 14px; }
.sw-badge { font-size: 12px; padding: 2px 8px; border-radius: 20px; background: #eef1ed; color: #7a877b; }
.sw-badge.ok { background: #e9f1e2; color: #1e6f3e; font-weight: 600; }
.sw-joinbtn {
  border: none;
  background: #1e6f3e;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.sw-enter { color: #2b8a4e; font-size: 14px; text-decoration: none; font-weight: 600; background: none; border: none; cursor: pointer; }

/* ---- 推荐/佣金 ---- */
.sw-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.sw-stats > div {
  background: #f2f7f3;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.sw-stats b { display: block; font-size: 22px; color: #1e6f3e; }
.sw-stats span { font-size: 12px; color: #6a7a6e; }
.sw-referral-link { margin: 8px 0 16px; }
.sw-referral-link p { font-size: 14px; color: #4a5a4e; margin: 0 0 8px; }
.sw-copy { display: flex; gap: 8px; align-items: center; }
.sw-copy code {
  flex: 1;
  background: #eef1ed;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: #4a5a4e;
  word-break: break-all;
}
.sw-copy-btn { margin-top: 0; padding: 8px 14px; font-size: 13px; }
.sw-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.sw-table th, .sw-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #eef1ed; color: #4a5a4e; }
.sw-table th { color: #6a7a6e; font-weight: 600; }

/* ---- 门禁遮罩 ---- */
[data-paywall="locked"] { position: relative; }
[data-paywall="locked"] .content-container,
[data-paywall="locked"] .vp-doc {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}
.sw-paywall-cover {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
}
.sw-paywall-box {
  background: #fff;
  border: 1px solid #c8d8bc;
  border-radius: 14px;
  padding: 26px 30px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  max-width: 340px;
  width: 90%;
}
.sw-paywall-box h3 { color: #1e6f3e; margin: 0 0 8px; }
.sw-paywall-box p { font-size: 14px; color: #4a5a4e; margin: 6px 0; }
.sw-paywall-box .sw-price { font-size: 22px; font-weight: 700; color: #1e6f3e; margin: 12px 0; }

/* ____ toast ____ */
.sw-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e6f3e;
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease;
}
.sw-toast.info { background: #2b8a4e; }
.sw-toast.success { background: #1e6f3e; }
.sw-toast.error { background: #b3452b; }
.sw-toast.out { opacity: 0; }

@keyframes swFade { from { opacity: 0; } to { opacity: 1; } }

/* ---- 移动端适配 ---- */
@media (max-width: 768px) {
  .member-widget-btn { padding: 5px 10px; font-size: 13px; }
  .sw-stats { grid-template-columns: repeat(2, 1fr); }
}
