/* 简站 WordPress 教程站 · 自定义样式
   所有字体、图标、框架文件均来自本地 assets/ 目录，无任何 CDN 依赖 */

:root {
  --wp-dark: #1d2327;
  --wp-blue: #21759b;
  --wp-blue-dark: #185a78;
  --wp-accent: #d54e21;
  --wp-soft: #f2f6f8;
  --wp-border: #e3e9ed;
  --wp-muted: #6b7a84;
  --wp-green: #2e8b62;
  --wp-shadow: 0 8px 28px rgba(29, 35, 39, .08);
  --wp-radius: 14px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  color: #2c3a42;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* 大横向间距的行不要顶破 container 边界（移动端尤其明显） */
.container > .row.g-5 { --bs-gutter-x: 1.5rem; }

/* ---------- 顶部导航 ---------- */
.site-navbar {
  background: var(--wp-dark);
  border-bottom: 3px solid var(--wp-blue);
}
.site-navbar .navbar-brand { color: #fff; font-weight: 700; letter-spacing: .3px; }
.site-navbar .navbar-brand:hover { color: #fff; text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--wp-blue);
  color: #fff;
  font-size: 1.25rem;
  margin-right: 10px;
}
.site-navbar .nav-link { color: #c8d2d8; font-size: .94rem; padding: .5rem .85rem; border-radius: 8px; }
.site-navbar .nav-link:hover,
.site-navbar .nav-link.active { color: #fff; background: rgba(255,255,255,.09); text-decoration: none; }
.site-navbar .navbar-toggler { border-color: rgba(255,255,255,.25); }

/* ---------- 阅读进度 ---------- */
.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--wp-accent); z-index: 1100; transition: width .1s linear;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 88% 12%, rgba(33,117,155,.16), transparent 42%),
    radial-gradient(circle at 8% 88%, rgba(213,78,33,.09), transparent 40%),
    linear-gradient(180deg, #f7fafb 0%, #eef4f7 100%);
  border-bottom: 1px solid var(--wp-border);
}
.hero .display-title { font-weight: 800; line-height: 1.25; letter-spacing: -.5px; color: var(--wp-dark); }
.hero .display-title em { font-style: normal; color: var(--wp-blue); }
.hero .lead { color: var(--wp-muted); font-size: 1.06rem; line-height: 1.9; }
.kicker {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  color: var(--wp-blue); background: rgba(33,117,155,.1);
  padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1rem;
}
.hero-visual {
  background: #fff; border: 1px solid var(--wp-border); border-radius: 18px;
  box-shadow: var(--wp-shadow); padding: 1.4rem;
}
.hero-visual .mini-title { font-weight: 700; color: var(--wp-dark); }
.flow-item { display: flex; gap: .85rem; align-items: flex-start; padding: .6rem 0; }
.flow-num {
  flex: 0 0 28px; height: 28px; border-radius: 50%;
  background: var(--wp-soft); color: var(--wp-blue);
  font-weight: 700; font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.flow-item + .flow-item { border-top: 1px dashed var(--wp-border); }
.flow-item strong { display: block; font-size: .95rem; color: var(--wp-dark); }
.flow-item small { color: var(--wp-muted); }

/* ---------- 通用区块 ---------- */
.section { padding: 4.2rem 0; }
.section.soft { background: var(--wp-soft); border-top: 1px solid var(--wp-border); border-bottom: 1px solid var(--wp-border); }
.section-head { margin-bottom: 2.4rem; }
.section-head h2 { font-weight: 800; color: var(--wp-dark); }
.section-head p { color: var(--wp-muted); max-width: 680px; }

.card-lift {
  border: 1px solid var(--wp-border); border-radius: var(--wp-radius);
  box-shadow: none; transition: transform .2s ease, box-shadow .2s ease;
  height: 100%;
}
.card-lift:hover { transform: translateY(-4px); box-shadow: var(--wp-shadow); text-decoration: none; }
.icon-box {
  width: 48px; height: 48px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.35rem; background: rgba(33,117,155,.1); color: var(--wp-blue);
  margin-bottom: 1rem;
}
.icon-box.orange { background: rgba(213,78,33,.1); color: var(--wp-accent); }
.icon-box.green { background: rgba(46,139,98,.12); color: var(--wp-green); }

.badge-soft { background: rgba(33,117,155,.1); color: var(--wp-blue); font-weight: 600; }
.badge-soft.orange { background: rgba(213,78,33,.1); color: var(--wp-accent); }

/* ---------- 步骤时间线 ---------- */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline::before {
  content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(var(--wp-blue), #cfe0e8);
}
.timeline-step { position: relative; padding-bottom: 1.6rem; }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before {
  content: ""; position: absolute; left: -2.2rem; top: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 4px solid var(--wp-blue); box-sizing: border-box;
}
.timeline-step h5 { font-weight: 700; color: var(--wp-dark); margin-bottom: .3rem; }
.timeline-step p { color: var(--wp-muted); margin: 0; }

/* ---------- 教程页 ---------- */
.page-head {
  background: linear-gradient(180deg, #f7fafb, #fff);
  border-bottom: 1px solid var(--wp-border);
}
.page-head h1 { font-weight: 800; color: var(--wp-dark); font-size: 2.1rem; }
.breadcrumb a { color: var(--wp-blue); }
.meta-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .85rem; color: var(--wp-muted);
  background: #fff; border: 1px solid var(--wp-border);
  border-radius: 999px; padding: .3rem .8rem;
}

.toc-wrap { position: sticky; top: 88px; }
.toc-card {
  border: 1px solid var(--wp-border); border-radius: var(--wp-radius);
  background: #fff; padding: 1rem .6rem;
}
.toc-card .toc-title {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; color: var(--wp-muted);
  padding: .2rem .9rem .7rem; text-transform: uppercase;
}
.toc-card .list-group-item {
  border: 0; padding: .38rem .9rem; font-size: .9rem; color: #4a5a63;
  border-left: 3px solid transparent; border-radius: 0; background: transparent;
}
.toc-card .list-group-item:hover { color: var(--wp-blue); text-decoration: none; background: transparent; }
.toc-card .list-group-item.active {
  background: rgba(33,117,155,.07); color: var(--wp-blue);
  border-left-color: var(--wp-blue); font-weight: 700;
}
.toc-card .list-group-item.sub { padding-left: 1.6rem; font-size: .85rem; }

.article { font-size: 1rem; line-height: 1.95; }
.article h2 {
  font-weight: 800; color: var(--wp-dark); font-size: 1.55rem;
  margin: 2.8rem 0 1.2rem; padding-bottom: .6rem;
  border-bottom: 2px solid var(--wp-border);
}
.article h2 .h2-num { color: var(--wp-blue); margin-right: .5rem; }
.article h3 { font-weight: 700; color: var(--wp-dark); font-size: 1.2rem; margin: 2rem 0 .9rem; }
.article h4 { font-weight: 700; font-size: 1.04rem; margin: 1.5rem 0 .6rem; color: var(--wp-blue-dark); }
.article p { color: #3c4b54; }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { margin: .35rem 0; }
.article strong { color: var(--wp-dark); }

.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 .5rem; border-radius: 8px;
  background: var(--wp-blue); color: #fff; font-weight: 700; font-size: .9rem;
  margin-right: .55rem;
}

.callout {
  border: 1px solid var(--wp-border); border-left: 4px solid var(--wp-blue);
  background: #f8fbfc; border-radius: 10px; padding: 1rem 1.15rem; margin: 1.2rem 0;
}
.callout .callout-title { font-weight: 700; color: var(--wp-dark); margin-bottom: .25rem; display: flex; align-items: center; gap: .45rem; }
.callout p:last-child { margin-bottom: 0; }
.callout.danger { border-left-color: #c8392b; background: #fff7f6; }
.callout.danger .callout-title { color: #a52f22; }
.callout.warning { border-left-color: #d99100; background: #fffbf1; }
.callout.warning .callout-title { color: #946200; }
.callout.tip { border-left-color: var(--wp-green); background: #f4fbf7; }
.callout.tip .callout-title { color: #1f6b49; }

/* 界面示意图（替代原教程截图） */
.mock-window {
  border: 1px solid #d7e0e5; border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: var(--wp-shadow); margin: 1.2rem 0;
}
.mock-bar {
  background: #eef3f6; border-bottom: 1px solid #d7e0e5;
  padding: .55rem .9rem; display: flex; align-items: center; gap: .4rem;
}
.mock-dot { width: 10px; height: 10px; border-radius: 50%; background: #cfd9df; }
.mock-dot.r { background: #e6a49a; } .mock-dot.y { background: #e6cf95; } .mock-dot.g { background: #a6d3b5; }
.mock-bar span { margin-left: .6rem; font-size: .8rem; color: var(--wp-muted); }
.mock-body { padding: 1.1rem; font-size: .88rem; }
.mock-crumb { color: var(--wp-muted); font-size: .82rem; margin-bottom: .8rem; }
.mock-crumb b { color: var(--wp-blue); }
.mock-row {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .5rem .7rem; border: 1px solid var(--wp-border); border-radius: 8px; margin-bottom: .45rem;
  background: #fbfdfe;
}
.mock-row .mock-name { display: flex; align-items: center; gap: .5rem; color: #3c4b54; }
.mock-btn {
  font-size: .76rem; padding: .2rem .6rem; border-radius: 6px;
  background: var(--wp-blue); color: #fff; white-space: nowrap;
}
.mock-btn.ghost { background: #e7eef2; color: var(--wp-blue-dark); }
.mock-btn.warn { background: #f6dedb; color: #a52f22; }
.mock-note { font-size: .78rem; color: var(--wp-muted); margin-top: .7rem; margin-bottom: 0; }

.code-block { position: relative; margin: 1.2rem 0; }
.code-block pre {
  background: #1d2327; color: #d7e3ea; border-radius: 12px;
  padding: 1.2rem 1.2rem 1.1rem; font-size: .86rem; line-height: 1.8;
  overflow-x: auto; margin: 0;
}
.code-block pre .c { color: #7d97a5; }
.code-block pre .k { color: #8ec8e8; }
.code-block .copy-btn {
  position: absolute; right: .6rem; top: .6rem;
  background: rgba(255,255,255,.12); color: #e9f2f6; border: 0;
  border-radius: 7px; font-size: .76rem; padding: .25rem .6rem;
}
.code-block .copy-btn:hover { background: rgba(255,255,255,.22); }

.table-clean { border: 1px solid var(--wp-border); border-radius: 10px; }
.table-responsive.table-clean { overflow-x: auto; }
table.table-clean { border: 0; border-radius: 0; }
.table-clean th { background: #f2f7f9; color: var(--wp-dark); font-weight: 700; font-size: .9rem; }
.table-clean td, .table-clean th { vertical-align: middle; }
.table-clean code { color: var(--wp-accent); background: #fdf3ef; padding: .1rem .35rem; border-radius: 5px; font-size: .86em; }

.check-list .form-check {
  padding: .7rem .9rem; border: 1px solid var(--wp-border); border-radius: 10px;
  margin-bottom: .5rem; background: #fff;
}
.check-list .form-check-label { cursor: pointer; }
.check-list .form-check-input:checked + .form-check-label { color: var(--wp-muted); text-decoration: line-through; }

/* ---------- 页面底部 CTA / 页脚 ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--wp-dark), #24404d);
  color: #fff; border-radius: 18px; padding: 2.4rem;
}
.cta-band h3 { font-weight: 800; }
.cta-band p { color: #c6d3da; margin-bottom: 0; }
.site-footer { background: #162025; color: #aebdc5; padding: 3rem 0 1.5rem; }
.site-footer h6 { color: #fff; font-weight: 700; margin-bottom: 1rem; }
.site-footer a { color: #aebdc5; font-size: .9rem; }
.site-footer a:hover { color: #fff; }
.site-footer .footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1.2rem; font-size: .84rem; }
.foot-list { list-style: none; padding: 0; margin: 0; }
.foot-list li { margin-bottom: .5rem; }

.back-to-top {
  position: fixed; right: 20px; bottom: 22px; width: 44px; height: 44px;
  border-radius: 50%; border: 0; background: var(--wp-blue); color: #fff;
  box-shadow: var(--wp-shadow); opacity: 0; visibility: hidden;
  transition: opacity .2s ease; z-index: 1050; font-size: 1.15rem;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--wp-blue-dark); }

/* ---------- 响应式 ---------- */
@media (max-width: 991.98px) {
  .section { padding: 3rem 0; }
  .toc-wrap { position: static; margin-bottom: 2rem; }
  .hero { padding-bottom: 3rem; }
}
@media print {
  .site-navbar, .toc-wrap, .back-to-top, .read-progress, .site-footer, .cta-band { display: none !important; }
  .article h2 { page-break-after: avoid; }
}
