/* ═══════════════════════════════════════════════════════
   components.css — 全局通用组件样式
   修改此文件影响所有视图的公共元素
   ═══════════════════════════════════════════════════════ */

/* ── 液态玻璃卡片 ── */
.glass-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  padding: 16px;
  margin-bottom: 12px;
}

/* ── 返回按钮 ── */
.back-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}
.back-btn:active { transform: scale(0.92); }
.back-btn svg { width: 18px; height: 18px; color: #555; }

/* ── 磨砂玻璃渐变主按钮（新版高级感） ── */
.glass-btn {
  position: relative;
  padding: 14px 24px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  /* 磨砂半透明底 + 粉紫渐变 */
  background: linear-gradient(
    140deg,
    rgba(220, 200, 255, 0.85) 0%,
    rgba(180, 140, 255, 0.9) 50%,
    rgba(155, 100, 255, 0.88) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* 上边缘高光线 */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 6px 20px rgba(155, 134, 255, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}
/* 内层光泽层 */
.glass-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  pointer-events: none;
}
.glass-btn:active {
  transform: scale(0.97) translateY(1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 3px 10px rgba(155, 134, 255, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 粉色变体（用于训练营、错题本等） */
.glass-btn-rose {
  background: linear-gradient(
    140deg,
    rgba(255, 210, 220, 0.88) 0%,
    rgba(255, 160, 185, 0.9) 50%,
    rgba(255, 120, 160, 0.88) 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 6px 20px rgba(255, 143, 171, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 绿色变体（用于完成、复制等正向操作） */
.glass-btn-mint {
  background: linear-gradient(
    140deg,
    rgba(200, 240, 210, 0.88) 0%,
    rgba(140, 210, 160, 0.9) 50%,
    rgba(80, 180, 110, 0.88) 100%
  );
  color: #1a5c30;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 6px 20px rgba(100, 200, 130, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.08);
}

/* 灰色变体（次要操作：取消、关闭） */
.glass-btn-gray {
  background: rgba(0, 0, 0, 0.06);
  color: #777;
  box-shadow: none;
  backdrop-filter: none;
}
.glass-btn-gray::before { display: none; }
.glass-btn-gray:active {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(0.97);
  box-shadow: none;
}

/* ── 通用页面标题栏（带返回按钮的顶部） ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
}
.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0;
}

/* ── 通用页面容器 ── */
.page-container {
  padding: 0 16px 16px;
  width: 100%;
}

/* ── Badge 徽标 ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-red   { background: #FF5252; color: #fff; }
.badge-green { background: #E8F5E9; color: #4CAF50; }
.badge-gray  { background: rgba(0,0,0,0.06); color: #aaa; }
.badge-orange { background: #FFF3E0; color: #E65100; }

/* ── 区块标题 ── */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: #444;
  margin: 16px 0 8px 4px;
}

/* ── 空状态 ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  text-align: center;
}
.empty-state-icon  { font-size: 56px; margin-bottom: 16px; }
.empty-state-title { font-size: 18px; font-weight: 700; color: #333; margin-bottom: 8px; }
.empty-state-sub   { font-size: 14px; color: #999; margin-bottom: 24px; }

/* ── 通用进度条 ── */
.progress-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
  background: linear-gradient(90deg, #C4B4FF, #FF8FAB);
}

/* ── 打字动画点 ── */
.typing-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.typing-dots span {
  width: 8px;
  height: 8px;
  background: #C4B4FF;
  border-radius: 50%;
  animation: typingDot 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1.0); opacity: 1; }
}

/* ── 通用滑入动画 ── */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
