/* ===== 全局 / 首页样式 ===== */
:root {
  --brand: #10b981;
  --brand-2: #2563eb;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e9eef3;
  --bg: #f6f9fb;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 23, 42, .08);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* 顶部导航的样式在 nav.css（编辑页也要用，那边不引 base.css） */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; transition: .15s;
}
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.btn--primary:hover { filter: brightness(1.05); box-shadow: var(--shadow-sm); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

/* Hero */
.hero { text-align: center; padding: 64px 20px 40px; }
.hero__badge {
  display: inline-block; font-size: 12px; color: var(--brand);
  background: #ecfdf5; border: 1px solid #c7f0e0; padding: 4px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: 40px; line-height: 1.2; margin: 0 0 14px; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { font-size: 16px; color: var(--muted); max-width: 620px; margin: 0 auto 26px; }
.hero__cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.tag-new {
  position: relative; font-size: 11px; background: #ef4444; color: #fff;
  padding: 1px 6px; border-radius: 6px; margin-left: 6px; vertical-align: middle;
}

/* 分类标签 */
.tags { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 8px 0 36px; }
.tag {
  display: inline-block;
  padding: 7px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 13px; color: var(--muted); cursor: pointer; transition: .15s;
}
.tag:hover, .tag.is-active { color: #fff; background: var(--brand); border-color: var(--brand); }

/* 区块标题 */
.section { padding: 24px 0 8px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section__title { font-size: 22px; font-weight: 800; }
.section__title small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.section__more { font-size: 13px; color: var(--brand); cursor: pointer; }

/* 模板卡片网格 */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: .18s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__preview { position: relative; height: 340px; overflow: hidden; background: #f1f5f9; }
.card__preview .resume {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%) scale(0.33);
  transform-origin: top center; box-shadow: none !important; border-radius: 0;
}
/* 真实模板缩略图：JS 按纸宽等比缩放 */
.card__preview .pv { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; }
.card__preview .pv .resume,
.card__preview .pv .resume-show-new {
  position: absolute; top: 0; left: 0; width: auto;
  transform-origin: top left; box-shadow: none !important; border-radius: 0;
  animation: pvFade .22s ease both;
}
@keyframes pvFade { from { opacity: 0 } to { opacity: 1 } }
/* 样式加载前的占位 */
.pv__ph { position: absolute; inset: 0; padding: 18px 16px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.pv__ph::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 5px; background: var(--ph, #4672f2); opacity: .85; }
.pv__ph b { display: block; height: 12px; width: 40%; border-radius: 4px; background: var(--ph, #4672f2); opacity: .85; margin: 4px 0 6px 4px; }
.pv__ph i { display: block; height: 6px; border-radius: 3px; background: #e9eef3; margin-left: 4px; }
.pv__ph i:nth-child(2) { width: 86%; }
.pv__ph i:nth-child(3) { width: 64%; }
.pv__ph i:nth-child(4) { width: 78%; }
.pv__err { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 12px; }
.card__body { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.card__name { font-size: 14px; font-weight: 700; }
.card__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card__use {
  margin-top: 10px; width: 100%; justify-content: center;
  background: #f0fdf4; color: var(--brand); border: 1px solid #c7f0e0;
}
.card__use:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 用户评价 */
.quotes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quote { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.quote__text { font-size: 13.5px; color: var(--ink); }
.quote__who { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.quote__who b { color: var(--brand); }

/* 求职百科：术语速查（4 张卡）+ 精选文章（紧凑列表）
 * 以前是 6 个渐变大色块，只有标题+一句描述，而且整块点不动。
 * 现在每张都是真链接，指向 wiki.html 的对应锚点。 */
.wterms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.wterm {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow-sm);
  transition: .16s;
}
.wterm:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c7f0e0; }
.wterm__top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.wterm__badge {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 800; letter-spacing: -.4px;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.wterm__t { font-size: 15px; font-weight: 800; line-height: 1.3; }
.wterm__d { font-size: 13px; color: var(--muted); }
.wterm__go { margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--brand); }

.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.post {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 17px; box-shadow: var(--shadow-sm); transition: .16s;
}
.post:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #dbeafe; }
.post__tag {
  flex: none; margin-top: 2px; font-size: 11px; font-weight: 700;
  color: #2563eb; background: #eff6ff; border: 1px solid #dbeafe;
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.post__b { min-width: 0; }
.post__t { display: block; font-size: 14.5px; font-weight: 700; }
.post__d { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.post__go { margin-left: auto; color: #94a3b8; font-size: 15px; line-height: 1.6; }
.post:hover .post__go { color: var(--brand); }

/* 页脚 */
.footer { margin-top: 50px; padding: 28px 0; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; }

/* 响应式 */
@media (max-width: 980px) {
  .grid, .quotes { grid-template-columns: repeat(2, 1fr); }
  .wterms { grid-template-columns: repeat(2, 1fr); }
  .posts { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .grid, .quotes { grid-template-columns: 1fr; }
  .wterms { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
}
