/* ===========================================================
   sissyblog · 样式表（静态站版）
   =========================================================== */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #17171a;
  --text-2: #52525b;
  --muted: #8c8c94;
  --line: #ecebe7;
  --line-2: #e2e1dc;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-soft: #eef2ff;
  --shadow-sm: 0 1px 2px rgba(20, 20, 26, .04);
  --shadow: 0 1px 2px rgba(20, 20, 26, .04), 0 10px 30px -14px rgba(20, 20, 26, .18);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --read: 748px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Source Han Serif SC",
           Georgia, "Times New Roman", serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.35; margin: 0; font-weight: 700; letter-spacing: -.01em; }

main { flex: 1 0 auto; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container--read { max-width: calc(var(--read) + 48px); }

/* ---------- 固定头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, .84);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner { display: flex; align-items: center; gap: 18px; height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.02em; flex: none; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .6);
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
  font-family: var(--serif);
}

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 6px 13px; border-radius: 999px; font-size: 14.5px; color: var(--text-2);
  white-space: nowrap; transition: background .16s, color .16s;
}
.nav a:hover { background: #f1f1ee; color: var(--text); }
.nav a.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* ---------- 首页头图 ---------- */
.hero { padding: 54px 0 30px; }
.hero__title { font-size: clamp(29px, 4.6vw, 42px); letter-spacing: -.035em; margin-bottom: 12px; }
.hero__title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand), #a855f7 58%, #ec4899);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { color: var(--text-2); font-size: 17px; max-width: 640px; margin: 0 0 22px; }

/* ---------- 分类导航条 ---------- */
.catbar { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 30px; }
.catbar a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; font-size: 14.5px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
  transition: all .16s;
}
.catbar a:hover { border-color: #cfcfc9; color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.catbar a span { color: var(--muted); font-size: 13px; }

/* ---------- 文章网格 ---------- */
.grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  padding-bottom: 64px;
}

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }

.cover {
  height: 150px; border-radius: 11px; margin-bottom: 16px; position: relative; overflow: hidden;
  background-image:
    radial-gradient(circle at 22% 26%, rgba(255,255,255,.55), transparent 46%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,.28), transparent 42%),
    repeating-linear-gradient(48deg, rgba(255,255,255,.14) 0 5px, transparent 5px 11px),
    linear-gradient(135deg, var(--c1, #4f46e5), var(--c2, #8b5cf6));
}
.cover::after {
  content: attr(data-mark);
  position: absolute; right: 14px; bottom: 6px;
  font-family: var(--serif); font-size: 46px; line-height: 1;
  color: rgba(255, 255, 255, .85); letter-spacing: -.03em;
}

/* 图片封面：白底完整展示商品图，不裁切 */
.cover--img { background: #fff; }
.cover--img::after { content: none; }
.cover--img img {
  width: 100%; height: 100%; display: block;
  object-fit: contain;
  transition: transform .45s cubic-bezier(.2,.7,.3,1);
}
.card:hover .cover--img img { transform: scale(1.04); }

/* 文章页商品面板：图片 + 信息 + 按钮 */
.product-hero {
  display: flex; align-items: stretch; gap: 22px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin: 0 0 34px;
  box-shadow: var(--shadow-sm);
}
.product-hero__img {
  flex: none; width: 250px; min-height: 280px;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--line); background: #fff;
}
.product-hero__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-hero__img.is-fallback,
.cover-fallback {
  background-image:
    radial-gradient(circle at 22% 26%, rgba(255,255,255,.55), transparent 46%),
    linear-gradient(135deg, var(--c1, #4f46e5), var(--c2, #8b5cf6));
}
.product-hero__body {
  flex: 1; min-width: 220px;
  display: flex; flex-direction: column; justify-content: center; gap: 7px;
}
.product-hero__body .btn { align-self: flex-start; margin-top: 12px; }

@media (max-width: 680px) {
  .product-hero { flex-direction: column; gap: 16px; }
  .product-hero__img { width: 100%; min-height: 0; height: 300px; }
}

.cover--sm { height: 92px; margin-bottom: 0; flex: none; width: 128px; }

.card__tags {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.card__cat {
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--brand); background: var(--brand-soft);
  padding: 3px 10px; border-radius: 999px;
}
.card__asin {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  letter-spacing: .02em; white-space: nowrap;
}

/* ASIN 标记 */
.asin-chip {
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  background: #f4f4f1; border: 1px solid var(--line);
  padding: 2px 9px; border-radius: 999px;
}
.related__asin {
  display: block; font-family: var(--mono); font-size: 11px;
  color: var(--muted); margin-top: 5px;
}
.card__title { font-size: 18.5px; letter-spacing: -.02em; margin-bottom: 9px; }
.card:hover .card__title { color: var(--brand); }
.card__ex {
  color: var(--text-2); font-size: 14.5px; margin: 0 0 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card__meta {
  margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px;
}
.card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

/* ---------- 分类页列表 ---------- */
.post-list { display: flex; flex-direction: column; padding-bottom: 64px; }
.post-row {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 4px; border-bottom: 1px solid var(--line);
  transition: padding-left .2s;
}
.post-row:hover { padding-left: 10px; }
.post-row:hover .post-row__title { color: var(--brand); }
.post-row__body { flex: 1; min-width: 0; }
.post-row__title { font-size: 17.5px; font-weight: 650; letter-spacing: -.015em; margin-bottom: 5px; }
.post-row__ex {
  color: var(--text-2); font-size: 14px; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-row__meta { font-size: 13px; color: var(--muted); margin-top: 7px; }

/* ---------- 页面头部 ---------- */
.page-head { padding: 42px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.page-head__breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.page-head__breadcrumb a:hover { color: var(--brand); }
.page-head__title { font-size: clamp(25px, 3.8vw, 33px); letter-spacing: -.03em; margin-bottom: 10px; }
.page-head__desc { color: var(--text-2); font-size: 15.5px; margin: 0; }
.page-head__count { color: var(--muted); font-size: 14px; margin-top: 12px; }

/* ---------- 文章详情 ---------- */
.article { padding: 38px 0 70px; }
.article__cat {
  display: inline-block; font-size: 12.5px; font-weight: 600;
  color: var(--brand); background: var(--brand-soft);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 16px;
}
.article__title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(27px, 4.4vw, 38px); line-height: 1.28;
  letter-spacing: -.025em; margin-bottom: 16px;
}
.article__meta {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  color: var(--muted); font-size: 14px; padding-bottom: 24px;
  border-bottom: 1px solid var(--line); margin-bottom: 30px;
}

/* 商品信息卡 */
.product {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, #f7f7ff, #fbf7ff);
  border: 1px solid #e6e4f7; border-radius: var(--radius);
  padding: 18px 20px; margin: 0 0 34px;
}
.product__icon {
  width: 54px; height: 54px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-size: 24px;
  background-image: linear-gradient(135deg, var(--c1, #4f46e5), var(--c2, #8b5cf6));
  box-shadow: 0 6px 16px -8px rgba(79,70,229,.85);
}
.product__body { flex: 1; min-width: 200px; }
.product__label { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 3px; }
.product__name { font-size: 16px; font-weight: 650; line-height: 1.4; letter-spacing: -.01em; }
.product__asin { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* 正文 */
.prose { font-size: 16.5px; line-height: 1.88; color: #24242a; word-wrap: break-word; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: 24px; letter-spacing: -.02em; margin-top: 2.1em; margin-bottom: .7em; }
.prose h3 { font-size: 19px; letter-spacing: -.015em; margin-top: 1.8em; margin-bottom: .6em; }
.prose h2 + *, .prose h3 + * { margin-top: 0; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: #c7d2fe; }
.prose a:hover { text-decoration-color: var(--brand); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .42em; }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--brand-2); color: var(--text-2);
}
.prose blockquote p { margin: 0; }
.prose code {
  font-family: var(--mono); font-size: .88em;
  background: #f2f2ef; padding: .15em .42em; border-radius: 5px; border: 1px solid var(--line);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line-2); padding: 9px 13px; text-align: left; }
.prose th { background: #f7f7f4; font-weight: 650; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }

.article__foot { margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 相关文章 ---------- */
.related { padding: 0 0 68px; }
.related__title { font-size: 19px; letter-spacing: -.02em; margin-bottom: 20px; }
.related__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.related__item {
  display: flex; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.related__item:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.related__item .cover--sm { width: 74px; height: 66px; }
.related__item h4 { font-size: 14.5px; line-height: 1.45; letter-spacing: -.01em; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  cursor: pointer; font-family: inherit; transition: all .16s;
}
.btn:hover { border-color: #cfcfc9; background: #f7f7f4; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 8px 18px -10px rgba(79,70,229,.95); }
.btn--primary:hover { background: #4338ca; border-color: #4338ca; }
.btn--ghost { border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: #f1f1ee; }
.btn--block { width: 100%; justify-content: center; }

/* ---------- 页脚 ---------- */
.site-footer { flex: none; border-top: 1px solid var(--line); padding: 28px 0 44px; color: var(--muted); font-size: 13.5px; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.site-footer a:hover { color: var(--brand); }
.site-footer .disclaimer { margin-top: 10px; font-size: 12.5px; opacity: .85; }

/* ---------- 空态 ---------- */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty__icon { font-size: 34px; margin-bottom: 10px; opacity: .45; }

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .hero { padding: 32px 0 22px; }
  .post-row { align-items: flex-start; }
  .cover--sm { display: none; }
  .site-footer__inner { flex-direction: column; gap: 8px; }
}
