/* ==========================================================================
   编程学习之家 (pgsr.cn) - 组件库样式
   按钮 · 卡片 · 表单 · 面包屑 · 徽章 · 时间线 · FAQ · 定价等
   ========================================================================== */

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 50px;
  transition: all 0.3s var(--ease);
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
}
.btn svg { width: 18px; height: 18px; }

/* 主按钮 — 蓝绿渐变 */
.btn-primary {
  background: linear-gradient(135deg, var(--blue-deep), var(--green-deep));
  color: var(--white);
  box-shadow: 0 6px 20px rgba(91, 167, 181, 0.3);
}
.btn-primary:hover {
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(91, 167, 181, 0.4);
}

/* 蓝色按钮 */
.btn-blue {
  background: var(--blue-deep);
  color: var(--white);
  box-shadow: var(--shadow-blue);
}
.btn-blue:hover { color: var(--white); background: var(--blue-ink); transform: translateY(-2px); }

/* 绿色按钮 */
.btn-green {
  background: var(--green-deep);
  color: var(--white);
  box-shadow: var(--shadow-green);
}
.btn-green:hover { color: var(--white); background: var(--green-ink); transform: translateY(-2px); }

/* 描边按钮 */
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--blue-deep); color: var(--blue-deep); background: var(--blue-mist); }

/* 浅底按钮 */
.btn-soft {
  background: var(--blue-mist);
  color: var(--blue-deep);
}
.btn-soft:hover { background: var(--blue-light); color: var(--blue-ink); }

.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 15px 36px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- 面包屑 ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  padding: 14px 20px;
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.breadcrumb a { color: var(--body); }
.breadcrumb a:hover { color: var(--blue-deep); }
.breadcrumb span.sep { color: var(--faint); }
.breadcrumb span.current { color: var(--blue-deep); font-weight: 600; }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--cream-card);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all 0.35s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--blue-mist);
}

/* 带顶部色条的卡片 */
.card-bar { position: relative; overflow: hidden; }
.card-bar::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

/* ---------- 徽章 / 标签 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}
.badge-blue { background: var(--blue-mist); color: var(--blue-ink); }
.badge-green { background: var(--green-mist); color: var(--green-ink); }
.badge-cream { background: var(--cream-deep); color: var(--body); }
.badge-dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r);
  transition: all 0.25s var(--ease);
  outline: none;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(126, 196, 217, 0.15);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-tip { font-size: 13.5px; margin-top: 12px; color: var(--muted); }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 40px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 14px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--blue), var(--green));
}
.tl-item { position: relative; margin-bottom: 36px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -34px; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--blue-deep);
  box-shadow: 0 0 0 4px var(--blue-mist);
}
.tl-year { font-size: 14px; font-weight: 700; color: var(--blue-deep); margin-bottom: 6px; }
.tl-item h4 { font-size: 16px; margin-bottom: 6px; }
.tl-item p { font-size: 14px; color: var(--body); }

/* ---------- FAQ 折叠 ---------- */
.faq-item {
  background: var(--cream-card);
  border-radius: var(--r);
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s var(--ease);
}
.faq-item.open { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.faq-q .faq-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--blue-mist);
  color: var(--blue-deep);
  transition: all 0.3s var(--ease);
}
.faq-item.open .faq-q .faq-icon { transform: rotate(180deg); background: var(--blue-deep); color: var(--white); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease);
}
.faq-item.open .faq-a { max-height: 400px; }
.faq-a-inner { padding: 0 24px 20px; font-size: 14px; color: var(--body); line-height: 1.8; }

/* ---------- 定价卡片 ---------- */
.price-card {
  background: var(--cream-card);
  border-radius: var(--r-lg);
  padding: 36px 28px;
  text-align: center;
  border: 2px solid var(--border);
  transition: all 0.35s var(--ease);
  position: relative;
}
.price-card:hover { border-color: var(--blue); box-shadow: var(--shadow-lg); }
.price-card.featured {
  border-color: var(--blue-deep);
  box-shadow: var(--shadow-blue);
}
.price-card.featured::before {
  content: "推荐";
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--blue-deep), var(--green-deep));
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 18px;
  border-radius: 20px;
}
.price-name { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.price-desc { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.price-num { font-size: 42px; font-weight: 800; color: var(--blue-deep); margin-bottom: 4px; }
.price-num small { font-size: 16px; font-weight: 500; color: var(--muted); }
.price-unit { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.price-features { text-align: left; margin-bottom: 28px; }
.price-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  color: var(--body);
  border-bottom: 1px dashed var(--border);
}
.price-features li svg { flex-shrink: 0; color: var(--green-deep); }
.price-features li:last-child { border-bottom: none; }

/* ---------- 统计数字 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat-box { text-align: center; }
.stat-box strong {
  display: block;
  font-size: 40px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue-deep), var(--green-deep));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.stat-box span { font-size: 14px; color: var(--muted); }

/* ---------- 信息行 ---------- */
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-row .info-ico {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: var(--blue-mist);
  color: var(--blue-deep);
}
.info-row .info-body h5 { font-size: 15px; margin-bottom: 2px; }
.info-row .info-body p { font-size: 13.5px; color: var(--body); }

/* ---------- 标签云 ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud a {
  display: inline-block;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--body);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.25s var(--ease);
}
.tag-cloud a:hover { color: var(--blue-deep); border-color: var(--blue); background: var(--blue-mist); }

/* ---------- 空状态 / 404 ---------- */
.empty-state { text-align: center; padding: 80px 24px; }
.empty-state .empty-code {
  font-size: 96px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 16px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .stat-box strong { font-size: 32px; }
  .breadcrumb { flex-wrap: wrap; }
}
