/* ============================================================
   全站样式  style.css
   主题色由 --brand 控制，data.js 里的 site.theme 会自动改它
   ============================================================ */

:root {
  --brand: #2563eb;
  --brand-soft: color-mix(in srgb, var(--brand) 8%, #fff);
  --brand-line: color-mix(in srgb, var(--brand) 22%, #fff);

  --bg: #f7f8fa;
  --card: #fff;
  --line: #e8ebf0;
  --line-soft: #f1f3f7;

  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .03);
  --shadow-lg: 0 8px 28px rgba(15, 23, 42, .10);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; }

a { color: var(--brand); }

::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }

/* ---------------- 顶部栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .2px;
  min-width: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 32%, transparent);
}

.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  transition: .16s;
}

.topbar-link:hover {
  color: var(--brand);
  border-color: var(--brand-line);
  background: var(--brand-soft);
}

/* ---------------- 布局 ---------------- */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 20px 72px;
}

.wrap-narrow { max-width: 920px; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 28px;
  align-items: start;
}

/* ---------------- 首页头部 ---------------- */
.hero { margin-bottom: 26px; }

.hero h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--text);
}

.hero p {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
}

/* ---------------- 提示条 ---------------- */
.notice {
  position: relative;
  background: linear-gradient(180deg, #fffaf3, #fff7ee);
  border: 1px solid #ffe4c7;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin-bottom: 22px;
  font-size: 14px;
  line-height: 1.65;
  color: #92400e;
}

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-pad { padding: 20px; }

.card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
}

.card-title .dot {
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--brand);
  flex: 0 0 auto;
}

/* ---------------- 链接列表 ---------------- */
.links { list-style: none; margin: 0; padding: 0; }

.links li + li { border-top: 1px solid var(--line-soft); }

.links a,
.links .dead,
.links .group {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 20px;
  text-decoration: none;
  line-height: 1.55;
  transition: background .15s ease;
}

.links a { color: var(--text); }

.links a .lk-name {
  font-weight: 600;
  color: var(--brand);
  font-size: 15px;
}

.links a .lk-desc {
  display: block;
  font-size: 12.5px;
  color: var(--text-3);
  font-weight: 400;
  margin-top: 2px;
}

.links a::after {
  content: "";
  margin-left: auto;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid #cbd5e1;
  border-bottom: 2px solid #cbd5e1;
  transform: rotate(-45deg);
  transition: .18s;
}

.links a:hover { background: var(--brand-soft); }
.links a:hover::after { border-color: var(--brand); transform: rotate(-45deg) translate(2px, 2px); }

.links .lk-ico {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.links .dead { color: var(--text-3); }

.links .group {
  background: var(--line-soft);
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: .3px;
}

.links .group .lk-desc {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 1px;
}

.links .body { min-width: 0; }

/* ---------------- 右侧栏 ---------------- */
.side { position: sticky; top: 76px; }

.side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  text-align: center;
}

.profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: left;
  margin-bottom: 18px;
}

.avatar {
  position: relative;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--line-soft);
  overflow: hidden;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--brand-line);
}

.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.missing { border: 1px dashed #cbd5e1; box-shadow: none; }

.name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.35; }
.loc  { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }

.qr {
  width: 190px;
  height: 190px;
  margin: 0 auto 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 7px;
  overflow: hidden;
}

.qr img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 6px; }

.qr.missing {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-style: dashed;
  border-color: #cbd5e1;
  background: #fafbfc;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.qr-tip { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--text-3); }

/* 右侧栏里可以放多块内容（多个二维码、文字、按钮…） */
.side-block + .side-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

.side-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: .3px;
}

.side-text {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}

.side-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: .16s;
}

.side-btn:hover { background: color-mix(in srgb, var(--brand) 86%, #000); }

.side-block .qr { margin-top: 0; }

/* ---------------- 教程页 ---------------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 14px;
}

.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { color: #cbd5e1; }
.crumbs .cur { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page-title {
  margin: 0 0 18px;
  font-size: 27px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -.4px;
  color: var(--text);
}

.video {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 22px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
}

.video iframe { display: block; width: 100%; height: 100%; border: 0; }

.content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.para {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-2);
}

.para a { color: var(--brand); font-weight: 600; text-decoration: none; }
.para a:hover { text-decoration: underline; }

.block-head {
  padding: 4px 0 0;
  background: none;
  border: 0;
  box-shadow: none;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.tip-box, .warn-box {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  line-height: 1.8;
}

.tip-box {
  background: color-mix(in srgb, var(--brand) 5%, #fff);
  border-color: var(--brand-line);
  color: var(--text-2);
}

.warn-box {
  background: #fff8f1;
  border-color: #ffe0bd;
  color: #92400e;
}

.tip-box .tip-icon, .warn-box .tip-icon { flex: 0 0 auto; font-size: 16px; line-height: 1.7; }

/* 图片卡片 */
.shot { margin: 0; }

.pic {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}

.pic:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

.pic img { display: block; width: 100%; height: auto; cursor: zoom-in; }

.pic .file {
  display: none;
  padding: 34px 12px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  word-break: break-all;
}

.pic.missing { border-style: dashed; border-color: #cbd5e1; box-shadow: none; }
.pic.missing:hover { box-shadow: none; transform: none; }
.pic.missing img { display: none; }
.pic.missing .file { display: block; }

figcaption {
  margin-top: 9px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
  text-align: center;
}

/* ---------------- 上一篇 / 下一篇 ---------------- */
.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 34px;
}

.pn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: .18s;
  min-width: 0;
}

.pn:hover { border-color: var(--brand-line); background: var(--brand-soft); transform: translateY(-2px); }
.pn.next { text-align: right; }
.pn-dir { font-size: 12px; color: var(--text-3); }
.pn-title { font-size: 14.5px; font-weight: 600; color: var(--brand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 空状态 ---------------- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 10px; }
.empty-state h2 { margin: 0 0 6px; font-size: 19px; }
.empty-state p { margin: 0 0 20px; color: var(--text-3); font-size: 14px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  transition: .16s;
  white-space: nowrap;
}

.btn:hover { background: var(--line-soft); border-color: #d7dce5; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--brand) 30%, transparent);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--brand) 86%, #000);
  border-color: color-mix(in srgb, var(--brand) 86%, #000);
}

.btn:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------------- 底部 ---------------- */
.foot {
  margin-top: 46px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-3);
}

.foot p { margin: 0 0 6px; }
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--brand); text-decoration: underline; }

/* ---------------- 图片放大 ---------------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 40px 24px 24px;
  background: rgba(9, 14, 26, .93);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: lbIn .18s ease;
}

@keyframes lbIn { from { opacity: 0 } to { opacity: 1 } }

.lightbox.show { display: flex; }

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}

.lb-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: .16s;
}

.lb-close:hover { background: rgba(255, 255, 255, .26); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 22px; }
  .side { position: static; }
  .content { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-card { display: flex; flex-direction: column; align-items: center; }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .wrap { padding: 22px 15px 56px; }
  .hero h1 { font-size: 24px; }
  .page-title { font-size: 22px; }
  .content { grid-template-columns: 1fr; gap: 15px; }
  .page-nav { grid-template-columns: 1fr; }
  .pn.next { text-align: left; }
  .topbar-in { padding: 10px 15px; }
  .brand-text { font-size: 15px; }
  .para { padding: 14px 16px; }
  .qr { width: 100%; max-width: 240px; height: auto; aspect-ratio: 1; }
}

/* 触摸设备取消 hover 位移，避免点完卡住 */
@media (hover: none) {
  .pic:hover { transform: none; }
  .pn:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 打印 */
@media print {
  .topbar, .side, .page-nav, .lightbox { display: none !important; }
  body { background: #fff; }
  .content { grid-template-columns: repeat(2, 1fr); }
}
