/* ==================================================================
   前台 SSR 页面（教程中心 / 文章页）样式 · 与首页 v5（pdfmao 风格）保持同一套视觉
   浅蓝底 + 白色圆角卡片 + 蓝色单主色
   ================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --accent: #4D89FA;
  --accent-deep: #1357D2;
  --accent-soft: #EAF1FF;
  --ink: #1B2B4B;
  --muted: #717E94;
  --muted-2: #9AA6BC;
  --line: #E6EDFB;
  --line-soft: #EFF3FC;
  --paper: #F4F6FF;
  --band: #EEF3FF;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--paper); color: #2C3550;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }

/* ---------- 顶部导航：与首页完全一致（62px 吸顶 + 分类下拉） ---------- */
.topbar{
  position:sticky;top:0;z-index:100;height:62px;
  background:rgba(255,255,255,.96);
  backdrop-filter:saturate(1.4) blur(8px);
  border-bottom:1px solid var(--line);
  box-shadow:0 2px 10px rgba(23,43,99,.04);
}
.tb-inner{
  max-width:1100px;height:100%;margin:0 auto;padding:0 20px;
  display:flex;align-items:center;justify-content:space-between;gap:14px;
}
.logo{
  display:flex;align-items:center;gap:10px;color:var(--ink);
  font-size:18px;font-weight:800;letter-spacing:.2px;
  text-decoration:none;white-space:nowrap;
}
.logo img{
  height:48px;width:auto;display:block;border-radius:8px;
}
.tb-links{flex:none;display:flex;align-items:center;gap:4px}
.tb-a,.tb-btn{
  color:var(--muted);font-size:14px;font-weight:500;padding:8px 16px;
  border-radius:999px;text-decoration:none;white-space:nowrap;
  transition:background .15s,color .15s;
}
.tb-a:hover,.tb-btn:hover{background:#EAF1FF;color:var(--accent-deep)}
.tb-cats{flex:1;min-width:0;display:flex;align-items:center;justify-content:flex-start;gap:2px}
.tb-cat{position:relative;height:100%;display:flex;align-items:center}
.tb-cat-btn{
  display:inline-flex;align-items:center;gap:5px;height:34px;padding:0 12px;
  border:0;background:none;border-radius:8px;cursor:pointer;
  color:#2C3550;font-size:14px;font-weight:500;white-space:nowrap;
  text-decoration:none;transition:background .15s,color .15s;
}
.tb-cat-btn svg{opacity:.55;transition:transform .18s}
.tb-cat:hover .tb-cat-btn,.tb-cat.open .tb-cat-btn{background:#EAF1FF;color:var(--accent-deep)}
.tb-cat:hover .tb-cat-btn svg,.tb-cat.open .tb-cat-btn svg{transform:rotate(180deg)}
.tb-news{color:var(--muted)}
.tb-drop{
  display:none;position:absolute;top:100%;left:0;z-index:120;
  width:212px;padding:8px;background:#fff;border:1px solid var(--line);
  border-radius:var(--radius);box-shadow:0 14px 34px rgba(23,43,99,.14);
  grid-template-columns:1fr;gap:2px;
}
@media (hover:hover){.tb-cat:hover .tb-drop{display:grid}}
.tb-cat.open .tb-drop{display:grid}
.tb-drop.wide{width:430px;grid-template-columns:repeat(2,minmax(0,1fr))}
.tb-drop-item{
  display:flex;align-items:center;gap:8px;min-width:0;padding:8px 10px;
  border-radius:8px;font-size:13px;color:#2C3550;text-align:left;
  transition:background .15s,color .15s;
}
.tb-drop-item>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tb-drop-item:hover{background:#EAF1FF;color:var(--accent-deep)}
.tb-drop-ic{flex:none;width:22px;height:22px;display:flex;align-items:center;justify-content:center;color:var(--accent)}
.tb-drop-ic svg{width:18px;height:18px;opacity:1;transform:none}

/* ---------- 页面 hero（slim）：浅蓝色带 + 蓝色侧标 ---------- */
.phero {
  background: var(--band); color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding: 44px 20px 40px;
}
.phero > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.phero h1 {
  font-size: 28px; letter-spacing: -.5px; margin-bottom: 8px; color: var(--ink);
  border-left: 4px solid var(--accent); padding-left: 14px;
}
.phero p { font-size: 14px; color: var(--muted); padding-left: 18px; }
.phero-slim { padding: 34px 20px 32px; }

.pmain { min-height: 55vh; }
.pwrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 46px; }
.pempty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- 旧版教程卡片（保留兼容） ---------- */
.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.post-card {
  background: #fff; border: 1px solid var(--line); border-radius:var(--radius-lg);
  box-shadow: 0 1px 2px rgba(23,43,99,.04);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .16s cubic-bezier(.22,.61,.36,1), border-color .16s;
}
.post-card:hover {
  transform: translateY(-3px); border-color: #C9DBFF;
  box-shadow: 0 12px 26px rgba(77,137,250,.16);
}
.pc-cover { height: 160px; overflow: hidden; background: var(--band); }
.pc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-body { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pc-body h3 { font-size: 17px; line-height: 1.45; letter-spacing: -.2px; color: var(--ink); }
.pc-body p {
  font-size: 13.5px; color: var(--muted); line-height: 1.7; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted-2); }
.pc-meta time { color: var(--accent-deep); font-weight: 500; }
.pc-meta i { font-style: normal; }

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 30px; }
.pager a {
  padding: 8px 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; font-size: 14px; color: var(--ink); transition: all .15s;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pg-cur { font-size: 13.5px; color: var(--muted); }

/* ---------- 文章页 ---------- */
.post {
  max-width: 800px; margin: 30px auto 0; background: #fff;
  border: 1px solid var(--line); border-radius:var(--radius-lg);
  box-shadow: 0 1px 2px rgba(23,43,99,.04);
  padding: 40px 46px 36px;
}
.post-head h1 { font-size: 28px; line-height: 1.4; letter-spacing: -.4px; margin-bottom: 12px; color: var(--ink); }
.post-meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted-2); }
.post-meta time { color: var(--accent-deep); font-weight: 500; }
.post-meta i { font-style: normal; }
.post-content { margin-top: 26px; font-size: 15.5px; line-height: 1.9; color: #2C3550; }
.post-content h2 {
  font-size: 21px; margin: 32px 0 14px; letter-spacing: -.3px;
  padding-left: 12px; border-left: 4px solid var(--accent);
}
.post-content h3 { font-size: 17.5px; margin: 26px 0 12px; }
.post-content p { margin-bottom: 14px; }
.post-content ul, .post-content ol { margin: 0 0 16px 24px; }
.post-content li { margin-bottom: 6px; }
.post-content img { max-width: 100%; border-radius: 6px; border: 1px solid var(--line); margin: 8px 0; }
.post-content blockquote {
  border-left: 4px solid var(--line); background: #F7FAFF;
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 16px 0;
  color: var(--muted); font-size: 14.5px;
}
.post-content code {
  background: #F1F5FF; border: 1px solid var(--line); border-radius: 5px;
  padding: 1.5px 6px; font-size: 13.5px; color: var(--accent-deep);
}
.post-content pre {
  background: #16233D; color: #E7EDF9; border-radius:var(--radius-sm);
  padding: 16px 18px; overflow-x: auto; margin: 16px 0; font-size: 13.5px;
}
.post-content pre code { background: none; border: none; color: inherit; padding: 0; }
.post-content table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
.post-content th, .post-content td { border: 1px solid var(--line); padding: 8px 12px; }
.post-content th { background: #F4F7FF; }
.post-content hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }

.post-cta {
  margin-top: 34px; padding: 22px 24px; border-radius:var(--radius-lg);
  background: linear-gradient(120deg,#4F86F7,#6A74F2); color: #fff;
}
.post-cta b { font-size: 16.5px; }
.post-cta p { font-size: 13.5px; opacity: .85; margin: 6px 0 10px; }
.post-cta a {
  display: inline-block; background: var(--accent); color: #fff;
  font-weight: 600; font-size: 14px; padding: 9px 20px; border-radius: 999px; background: #fff; color: var(--accent-deep);
}
.post-cta a:hover { background: #EAF1FF; }
.post-pn {
  display: flex; justify-content: space-between; gap: 14px; margin-top: 26px;
}
.pn {
  flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line);
  border-radius:var(--radius); padding: 12px 16px; font-size: 13.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: all .15s;
}
.pn:hover { border-color: var(--accent); color: var(--accent); }
.pn-r { text-align: right; }

/* ---------- 友链页 ---------- */
.lk-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.lk-card {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 6px;
  transition: transform .16s, border-color .16s;
}
.lk-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.lk-name { font-weight: 700; font-size: 15.5px; color: var(--ink); }
.lk-desc {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lk-apply {
  margin-top: 28px; background: #fff; border: 1.5px dashed var(--line);
  border-radius:var(--radius-sm); padding: 22px 24px; color: var(--muted); font-size: 14px; line-height: 1.8;
}
.lk-apply b { color: var(--ink); font-size: 15.5px; display: block; margin-bottom: 6px; }
.lk-mine { font-size: 13px; color: var(--muted-2); }

/* ---------- 页脚 ---------- */
.pfoot { background: #1357D2; color: rgba(255,255,255,.78); margin-top: 50px; }
.pfoot .inner { max-width: 1100px; margin: 0 auto; padding: 36px 20px 26px; }
.pf-cols { display: grid; grid-template-columns: 1.2fr .8fr 1fr; gap: 30px; }
.pf-col h4 { color: #fff; font-size: 15px; margin-bottom: 12px; font-weight: 700; }
.pf-col p { font-size: 13px; line-height: 1.8; }
.pf-col a { display: block; color: rgba(255,255,255,.78); font-size: 13px; margin-bottom: 8px; transition: color .15s; }
.pf-col a:hover { color: #fff; }
.pf-muted { font-size: 13px; }
.pf-bottom {
  border-top: 1px solid rgba(255,255,255,.18); margin-top: 26px; padding-top: 18px;
  font-size: 12.5px; text-align: center; color: rgba(255,255,255,.62);
}

@media (max-width: 720px) {
  .logo { font-size: 15.5px; }
  .phero h1 { font-size: 21px; }
  .post { padding: 26px 20px; margin-top: 18px; border-radius: 8px; }
  .post-head h1 { font-size: 21px; }
  .pf-cols { grid-template-columns: 1fr; gap: 22px; }
  .post-pn { flex-direction: column; }
  .pn { white-space: normal; }
}

/* ---------- 教程中心：左分类 / 右单列文字列表 / 搜索 ---------- */
.tut-wrap { display: grid; grid-template-columns: 246px minmax(0, 1fr); gap: 22px; align-items: start; }
.tut-side {
  background: #fff; border: 1px solid var(--line); border-radius:var(--radius-lg);
  padding: 16px 13px 18px; position: sticky; top: 62px;
  max-height: calc(100vh - 96px); overflow-y: auto;
  box-shadow: 0 1px 2px rgba(23,43,99,.04);
}
.tut-side h3 {
  font-size: 15px; color: var(--ink); font-weight: 700;
  padding: 0 8px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 8px;
}
.tut-mod {
  font-size: 12px; color: var(--muted-2); letter-spacing: .5px;
  padding: 14px 8px 5px; font-weight: 600;
}
.tut-cat-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 8px; font-size: 13.5px;
  color: #3C4A66; line-height: 1.5; transition: background .15s, color .15s;
}
.tut-cat-link em { font-style: normal; font-size: 12px; color: var(--muted-2); flex: none; }
.tut-cat-link:hover { background: var(--accent-soft); color: var(--accent-deep); }
.tut-cat-link.on { background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; }
.tut-cat-all { font-weight: 700; color: var(--ink); }
.tut-main { min-width: 0; }
.tut-search {
  position: sticky; top: 62px; z-index: 80;
  display: flex; gap: 9px; background: #fff; border: 1px solid var(--line);
  border-radius:var(--radius); padding: 10px; margin-bottom: 14px;
  box-shadow: 0 6px 18px rgba(23,43,99,.10);
}
.tut-search input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 14px; color: var(--ink); outline: none;
  background: #FBFCFF;
}
.tut-search input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.tut-search button {
  border: 0; border-radius: 8px; padding: 0 22px; font-size: 14px; font-weight: 600;
  color: #fff; background: var(--accent); cursor: pointer; white-space: nowrap;
}
.tut-search button:hover { background: var(--accent-deep); }
.tut-list-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 13px; color: var(--muted); padding: 2px 4px 11px;
}
.tut-list-head a { font-size: 13px; }
.tut-list {
  list-style: none; background: #fff; border: 1px solid var(--line);
  border-radius:var(--radius-lg); overflow: hidden;
  box-shadow: 0 1px 2px rgba(23,43,99,.04);
}
.tut-item { padding: 15px 20px 16px; border-bottom: 1px solid var(--line-soft); }
.tut-item:last-child { border-bottom: 0; }
.tut-item:hover { background: #FBFCFF; }
.tut-title { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.tut-title:hover { color: var(--accent-deep); }
.tut-desc {
  font-size: 13px; color: var(--muted); line-height: 1.7; margin-top: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tut-meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted-2); }
.tut-meta .tut-cat {
  background: var(--accent-soft); color: var(--accent-deep);
  padding: 2px 9px; border-radius: 999px; font-size: 12px;
}
.tut-meta i { font-style: normal; }
@media (max-width: 860px) {
  .tut-wrap { grid-template-columns: 1fr; gap: 14px; }
  .tut-side { position: static; max-height: 220px; }
  .tut-search button { padding: 0 16px; }
  .tut-item { padding: 13px 15px 14px; }
}

/* ---------- 顶栏响应式（与首页一致） ---------- */
@media (max-width:1024px){
  .tb-cat-btn{padding:0 9px;font-size:13px}
  .tb-drop,.tb-drop.wide{width:360px}
}
@media (max-width:820px){
  .tb-inner{padding:0 14px}
  .logo{font-size:16px}
  .tb-cats{justify-content:flex-start;overflow-x:auto;scrollbar-width:none;gap:0}
  .tb-cats::-webkit-scrollbar{display:none}
  .tb-cat-btn{height:32px;padding:0 9px;font-size:13px}
  .tb-drop,.tb-drop.wide{
    position:fixed;top:62px;left:12px;right:12px;width:auto;
    max-height:60vh;overflow-y:auto;margin-top:0;
  }
  .tb-btn{display:none}
}

/* ================= 加粗文字：回退站点默认字体；b 标签字号略放大 ================= */
b{font-size:1.06em}

/* ================= 文章详情页：复用列表页的 tut-side + 搜索框，文章卡铺满右栏 ================= */
.tut-post-wrap .tut-search{ margin-bottom:18px }
.tut-post-wrap .post{ max-width:none; margin:0; }
