/* ==========================================================================
   注会陪跑 · 智能管理中台 - 复合组件、模态框、真机模拟器与微动效样式 (Components)
   ========================================================================== */

/* 模态对话框 Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: fadeIn 0.2s ease-out;
}
.modal-content,
.modal-card {
  background: #ffffff !important;
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  position: relative;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: white;
  z-index: 5;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #94a3b8;
  transition: var(--transition);
}
.modal-close:hover {
  color: #0f172a;
}
.modal-body {
  padding: 24px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  position: sticky;
  bottom: 0;
  background: white;
}

/* Toast 通知系统 */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.25s ease-out;
}
.toast-success { background: #10b981; color: white; }
.toast-error   { background: #ef4444; color: white; }
.toast-info    { background: #3b82f6; color: white; }

/* 开关 Switch 组件 */
.switch-btn {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  cursor: pointer;
  user-select: none;
}
.switch-btn input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 22px;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.switch-btn input:checked + .switch-slider {
  background-color: #10b981;
}
.switch-btn input:checked + .switch-slider:before {
  transform: translateX(20px);
}

/* 轮播图管理卡片网格 */
.banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.banner-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.banner-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}
.banner-img-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  background: #0f172a;
  overflow: hidden;
}
.banner-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.banner-card:hover .banner-img-wrap img {
  transform: scale(1.04);
}
.banner-status-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.banner-status-active {
  background: rgba(16, 185, 129, 0.9);
  color: #ffffff;
}
.banner-status-inactive {
  background: rgba(100, 116, 139, 0.85);
  color: #ffffff;
}
.banner-order-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.banner-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.banner-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.banner-url-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.banner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

/* 手机真机实时模拟器 (Live Phone Simulator) */
.phone-simulator-container {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.phone-shell {
  width: 290px;
  height: 520px;
  background: #0f172a;
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4), inset 0 0 0 2px #334155;
  position: relative;
}
.phone-screen {
  width: 100%;
  height: 100%;
  background: #f8fafc;
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.phone-notch {
  height: 24px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 10px;
  font-weight: 600;
  color: #0f172a;
  z-index: 10;
}
.phone-mp-header {
  height: 38px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}
.phone-mp-capsule {
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 2px 8px;
  font-size: 10px;
  color: #64748b;
  display: flex;
  gap: 6px;
}
.phone-swiper-box {
  margin: 10px;
  height: 135px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background: #e2e8f0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.phone-swiper-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease;
}
.phone-swiper-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
}
.phone-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}
.phone-dot.active {
  width: 14px;
  background: #ffffff;
}
.phone-mock-body {
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.phone-mock-notice {
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #334155;
}
.phone-mock-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.phone-mock-item {
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 600;
  color: #475569;
}

/* 手机模拟器视图切换器 */
.phone-view-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 12px;
  width: 100%;
}
.phone-view-tab {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #64748b;
}
.phone-view-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* 模拟小程序通知列表卡片 */
.phone-notice-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  cursor: pointer;
  border: 1px solid #f1f5f9;
  transition: all 0.2s ease;
}
.phone-notice-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.phone-notice-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
  line-height: 1.4;
}
.phone-notice-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #94a3b8;
}

/* 上传与预置海报库组件 */
.upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: var(--transition);
}
.upload-dropzone:hover {
  border-color: var(--primary);
  background: #f1f5f9;
}
.preset-card-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.preset-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
}
.preset-card:hover {
  border-color: var(--primary);
  background: #f8fafc;
  transform: translateY(-1px);
}
.preset-card img {
  width: 48px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
}

/* 预置模板标签 */
.tmpl-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tmpl-chip:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* AI 精讲 Markdown 内容美化 */
.ai-box {
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  line-height: 1.7;
  color: #334155;
  white-space: pre-wrap;
  font-family: inherit;
}
.ai-badge {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
