/* ============================================================
   source/css/custom.css —— 自定义组件样式
   配合 scripts/tags.js 的标签使用；也覆盖 butterfly 的部分样式，
   让整站更贴合"汉化发布站"的定位。
   改动后重新 generate 即可生效。
   ============================================================ */

:root {
  --hb-primary:    #f59e0b;
  --hb-primary-d:  #d97706;
  --hb-primary-s:  #fdf2dd;
  --hb-manga:      #f0783a;
  --hb-novel:      #6b7fd7;
  --hb-warn:       #e6a23c;
  --hb-radius:     14px;
}

/* 全局字体：霞鹜文楷（书卷气），加载失败回退系统字体 */
body {
  font-family: "LXGW WenKai", "LXGW WenKai Screen", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑",
    "KaiTi", "楷体", sans-serif;
}

/* ---------------- 蓝天插画背景上的标题可读性 ---------------- */
/* 顶部横幅与网站背景均为浅色蓝天插画，标题从白色改为深蓝，加白色光晕 */
#site-info #site-title,
#site-info #site-subtitle,
#page-site-info #site-title {
  color: #2f5d8a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85), 0 0 16px rgba(255, 255, 255, .75);
}
[data-theme="dark"] #site-info #site-title,
[data-theme="dark"] #site-info #site-subtitle,
[data-theme="dark"] #page-site-info #site-title {
  color: #e8f2fb;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}

/* butterfly 主色跟随 */
:root {
  --btn-bg: var(--hb-primary);
  --btn-hover-color: #fff;
  --light-blue: var(--hb-primary);
}
[data-theme="dark"] {
  --hb-primary:   #fbbf24;
  --hb-primary-d: #f59e0b;
  --hb-primary-s: #3b2d13;
}

/* ---------------- 下载按钮 ---------------- */
.hb-dlbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 22px;
}
.hb-dlbox-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--font-color, #1e2a32);
}
.hb-dlbox-hd::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--hb-primary);
}

.hb-dl {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 17px;
  border-radius: var(--hb-radius);
  background: var(--card-bg, #fff);
  border: 1px solid rgba(128, 128, 128, .22);
  text-decoration: none !important;
  transition: all .22s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.hb-dl:hover {
  border-color: var(--hb-primary);
  background: var(--hb-primary-s);
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(245, 159, 11, .18);
}
.hb-dl-ico {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--hb-primary-s);
  color: var(--hb-primary);
  transition: all .22s ease;
}
.hb-dl:hover .hb-dl-ico { background: var(--hb-primary); color: #fff; }
.hb-dl-main { flex: 1; min-width: 0; }
.hb-dl-main b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--font-color, #1e2a32);
  line-height: 1.5;
}
.hb-dl-main i {
  display: block;
  font-style: normal;
  font-size: 12.5px;
  color: var(--hb-primary);
  opacity: .9;
  margin-top: 1px;
}
/* 提取码 / 通用内容：点击即复制 */
.hb-dl-code, .hb-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 2px;
  padding: 1px 7px;
  border: 1px dashed var(--hb-primary);
  border-radius: 6px;
  background: var(--hb-primary-s, rgba(128, 128, 128, .1));
  color: var(--hb-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .5px;
  line-height: 1.5;
  cursor: pointer;
  transition: all .18s ease;
}
.hb-dl-code:hover, .hb-copy:hover { background: var(--hb-primary); border-style: solid; color: #fff; }
.hb-dl-code.is-ok, .hb-copy.is-ok { background: #4caf7d; border-color: #4caf7d; border-style: solid; color: #fff; }
.hb-dl-arrow { flex: 0 0 auto; color: var(--hb-primary); opacity: .6; transition: all .22s ease; }
.hb-dl:hover .hb-dl-arrow { opacity: 1; transform: translateX(3px); }

/* ---------------- 下载链接：点击显示 + 复制 ---------------- */
.hb-dl { cursor: default; }
.hb-dl-show {
  flex: 0 0 auto;
  padding: 7px 15px;
  border-radius: 9px;
  border: 1px solid var(--hb-primary);
  background: var(--hb-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.hb-dl-show:hover { background: var(--hb-primary-d); border-color: var(--hb-primary-d); }
.hb-dl-open { align-items: flex-start; cursor: default; }
.hb-dl-open:hover { transform: none; }
.hb-dl-open .hb-dl-arrow { display: none; }
.hb-dl-url {
  display: block;
  font-size: 12.5px;
  color: var(--font-color, #1e2a32);
  opacity: .85;
  word-break: break-all;
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(128, 128, 128, .08);
}
.hb-dl-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hb-dl-copy, .hb-dl-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 15px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--hb-primary);
  transition: all .2s ease;
  text-decoration: none !important;
  white-space: nowrap;
}
.hb-dl-copy { background: var(--hb-primary); color: #fff; }
.hb-dl-copy:hover { background: var(--hb-primary-d); }
.hb-dl-copy.is-ok { background: #4caf7d; border-color: #4caf7d; }
.hb-dl-go { background: transparent; color: var(--hb-primary); }
.hb-dl-go:hover { background: var(--hb-primary-s); }

/* ---------------- 提示框 ---------------- */
.hb-tip {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: var(--hb-radius);
  border-left: 4px solid var(--hb-primary);
  background: var(--hb-primary-s);
  font-size: 14px;
  line-height: 1.85;
}
.hb-tip p:first-child { margin-top: 0; }
.hb-tip p:last-child { margin-bottom: 0; }
.hb-tip-info { border-left-color: var(--hb-primary); background: var(--hb-primary-s); }
.hb-tip-warn { border-left-color: var(--hb-warn); background: rgba(230, 162, 60, .10); }
.hb-tip-ok   { border-left-color: #4caf7d;          background: rgba(76, 175, 125, .10); }
.hb-tip-danger { border-left-color: #e05c5c;        background: rgba(224, 92, 92, .10); }

/* ---------------- 曝光墙条目 ---------------- */
.hb-expose {
  margin: 16px 0;
  padding: 16px 18px;
  border-radius: var(--hb-radius);
  border: 1px solid rgba(224, 92, 92, .35);
  background: rgba(224, 92, 92, .06);
}
.hb-expose-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hb-expose-hd b { font-size: 15px; font-weight: 600; }
.hb-expose-tag {
  padding: 3px 10px;
  border-radius: 6px;
  background: #e05c5c;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}
.hb-expose p { margin: 4px 0; font-size: 13.5px; line-height: 1.7; }
.hb-expose p label {
  display: inline-block;
  min-width: 72px;
  opacity: .55;
  font-size: 12.5px;
}

/* ---------------- 进度条 ---------------- */
.hb-progress {
  position: relative;
  height: 30px;
  border-radius: 99px;
  background: rgba(128, 128, 128, .14);
  overflow: hidden;
  margin: 16px 0;
}
.hb-progress-bar {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--hb-primary), #f6b733);
  transition: width .5s ease;
}
.hb-progress-txt {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  letter-spacing: .02em;
}

/* ---------------- 作品信息条 ---------------- */
.hb-workhead {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 16px 0 22px;
}
.hb-wh-item {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(128, 128, 128, .07);
  border: 1px solid rgba(128, 128, 128, .13);
}
.hb-wh-item label {
  display: block;
  font-size: 11.5px;
  opacity: .62;
  margin-bottom: 2px;
}
.hb-wh-item b { font-size: 14px; font-weight: 600; }
.hb-st-ongoing   { color: var(--hb-primary); }
.hb-st-completed { color: #4caf7d; }
.hb-st-hiatus    { color: var(--hb-warn); }
.hb-st-planned   { color: #93a3af; }
/* 信息条里的「官网」链接 */
.hb-wh-link {
  color: var(--hb-primary);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.hb-wh-link::after { content: " ↗"; font-size: .82em; opacity: .7; }
.hb-wh-link:hover { opacity: .78; border-bottom-style: solid; }

/* ---------------- 作品卡片网格 ---------------- */
.hb-work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
  margin: 22px 0 8px;
}
.hb-work-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--hb-radius);
  overflow: hidden;
  background: var(--card-bg, #fff);
  border: 1px solid rgba(128, 128, 128, .18);
  text-decoration: none !important;
  transition: all .28s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}
.hb-work-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .13);
  border-color: var(--hb-primary);
}
.hb-work-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: rgba(128, 128, 128, .1);
}
.hb-work-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
  display: block;
}
.hb-work-card:hover .hb-work-cover img { transform: scale(1.06); }

.hb-cover-gen {
  width: 100%; height: 100%;
  display: flex;
  align-items: flex-end;
  padding: 16px 14px;
  position: relative;
}
.hb-cover-gen::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 78% 12%, rgba(255, 255, 255, .30), transparent 44%);
}
.hb-cover-gen span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .26);
}

.hb-badge, .hb-badge-status {
  position: absolute;
  top: 9px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .04em;
  z-index: 2;
}
.hb-badge { left: 9px; }
.hb-badge-manga { background: rgba(240, 151, 90, .95); }
.hb-badge-novel { background: rgba(107, 127, 215, .95); }
.hb-badge-status { right: 9px; background: rgba(0, 0, 0, .5); }
.hb-badge-status.hb-st-completed { background: rgba(76, 175, 125, .95); }
.hb-badge-status.hb-st-hiatus    { background: rgba(230, 162, 60, .95); }
.hb-badge-status.hb-st-planned   { background: rgba(147, 163, 175, .95); }

.hb-work-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 12px 14px 14px;
}
.hb-work-body > b {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--font-color, #1e2a32);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hb-work-body > i {
  font-style: normal;
  font-size: 11.5px;
  opacity: .55;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hb-work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}
.hb-work-tags em {
  font-style: normal;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(128, 128, 128, .12);
  opacity: .8;
}
.hb-work-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  font-size: 11.5px;
  opacity: .58;
  border-top: 1px dashed rgba(128, 128, 128, .25);
}

/* ---------------- 移动端 ---------------- */
@media (max-width: 768px) {
  .hb-work-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .hb-cover-gen span { font-size: 14px; }
  .hb-dl-main b { font-size: 14px; }
  .hb-workhead { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- 打印 ---------------- */
@media print {
  .hb-dlbox, .hb-work-grid { display: none !important; }
}

/* ============================================================
   全局质感增强（首页卡片、链接、滚动）
   ============================================================ */
html { scroll-behavior: smooth; }

/* 首页文章卡片：圆角 + 上浮 */
.recent-post-item {
  border-radius: 16px !important;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease !important;
}
.recent-post-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .10) !important;
}
.recent-post-item .post_cover img { transition: transform .5s ease; }
.recent-post-item:hover .post_cover img { transform: scale(1.05); }

/* 链接 hover 统一 */
a:hover { color: var(--hb-primary-d); }

/* 标题更舒展 */
#site-title, .post-title, h1, h2, h3 { letter-spacing: .01em; }

/* 去掉「文章/标签/分类」站点统计条（作者卡 + 移动端侧边栏） */
.card-info .site-data,
#sidebar-menus .site-data {
  display: none;
}

/* ============================================================
   视觉增强（进度条 / 涟漪 / 花瓣 / 问候语 / 导航栏 / 滚动条）
   ============================================================ */

/* 顶部滚动进度条 */
#hb-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #f59e0b, #f6b733, #f0783a);
  z-index: 1001;
  box-shadow: 0 0 8px rgba(245, 159, 11, .45);
  transition: width .08s linear;
}

/* 鼠标点击涟漪 */
.hb-ripple {
  position: fixed;
  border-radius: 50%;
  border: 2px solid var(--hb-primary);
  pointer-events: none;
  z-index: 9999;
  animation: hb-ripple .7s ease-out forwards;
}
@keyframes hb-ripple {
  0%   { transform: scale(.3); opacity: .9; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* 飘落花瓣（配合 hb-effects.js） */
.hb-petal {
  position: fixed;
  top: -24px;
  z-index: 2;
  pointer-events: none;
  animation-name: hb-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes hb-fall {
  0%   { transform: translateY(-30px) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(360deg); }
}

/* 首页按时间问候语 */
#hb-greeting {
  font-size: 15px;
  color: #2f5d8a;
  letter-spacing: .06em;
  margin-bottom: 6px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85), 0 0 12px rgba(255, 255, 255, .75);
  animation: hb-greet-in .8s ease;
}
[data-theme="dark"] #hb-greeting {
  color: #e8f2fb;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
@keyframes hb-greet-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 毛玻璃导航栏增强：原 blur 7px 提升到 18px + 暖白底 */
#page-header.nav-fixed #nav,
#page-header.fixed #nav {
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  background: rgba(255, 250, 243, .74) !important;
}
[data-theme="dark"] #page-header.nav-fixed #nav,
[data-theme="dark"] #page-header.fixed #nav {
  background: rgba(19, 20, 24, .74) !important;
}

/* 自定义滚动条（更精致的芒果色圆角） */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--hb-primary);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--hb-primary-d);
  background-clip: padding-box;
}

/* 卡片阴影更柔和（覆盖全局浅阴影） */
.recent-post-item {
  box-shadow: 0 4px 18px rgba(120, 100, 60, .08) !important;
}
.recent-post-item:hover {
  box-shadow: 0 18px 40px rgba(120, 100, 60, .16) !important;
}

/* ---------------- 小说下载区（输密码解锁 zip） ---------------- */
.hb-novel-empty {
  padding: 36px 0;
  text-align: center;
  color: #93a3af;
  font-size: 14px;
}
.hb-novel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(336px, 1fr));
  gap: 18px;
  margin: 22px 0 8px;
}
.hb-novel {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: var(--hb-radius);
  background: var(--card-bg, #fff);
  border: 1px solid rgba(128, 128, 128, .18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  transition: all .28s ease;
}
.hb-novel:hover {
  border-color: var(--hb-novel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .11);
}
.hb-novel-cover {
  flex: 0 0 104px;
  width: 104px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(128, 128, 128, .1);
}
.hb-novel-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hb-novel-cover .hb-cover-gen span { font-size: 13px; }
.hb-novel-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hb-novel-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--font-color, #1e2a32);
}
.hb-novel-original {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  opacity: .55;
  margin-top: 3px;
}
.hb-novel-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.hb-novel-tags em {
  font-style: normal;
  font-size: 11px;
  padding: 1.5px 8px;
  border-radius: 6px;
  background: rgba(107, 127, 215, .13);
  color: var(--hb-novel);
}
.hb-novel-intro {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  opacity: .78;
}
/* 密码行 */
.hb-novel-lock { margin-top: auto; padding-top: 10px; }
.hb-novel-lock.is-done { display: none; }
.hb-novel-lock-row { display: flex; gap: 8px; }
.hb-novel-pw {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  font-size: 13px;
  border-radius: 9px;
  border: 1px solid rgba(128, 128, 128, .3);
  background: transparent;
  color: inherit;
  outline: none;
  transition: border-color .2s ease;
}
.hb-novel-pw:focus { border-color: var(--hb-novel); }
.hb-novel-btn {
  flex: 0 0 auto;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  background: var(--hb-novel);
  color: #fff;
  transition: filter .2s ease;
}
.hb-novel-btn:hover { filter: brightness(1.1); }
.hb-novel-msg { display: block; margin-top: 6px; font-size: 12px; min-height: 1em; }
.hb-novel-msg.is-err  { color: #e05c5c; }
.hb-novel-msg.is-warn { color: var(--hb-warn); }
/* 解锁后的下载区 */
.hb-novel-files { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
/* ⚠ 必须显式再声明一次 [hidden]：
   hidden 属性靠 UA 样式表的 [hidden]{display:none} 生效，优先级最低，
   上面这行的 display:flex 会把它覆盖掉 —— 下载链接就会在解锁前一直显示。 */
.hb-novel-files[hidden] { display: none; }
.hb-novel-file {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid rgba(107, 127, 215, .35);
  background: rgba(107, 127, 215, .07);
  color: inherit;
  text-decoration: none !important;
  font-size: 13px;
  transition: all .2s ease;
}
.hb-novel-file:hover {
  background: var(--hb-novel);
  border-color: var(--hb-novel);
  color: #fff;
}
.hb-nf-ico { flex: 0 0 auto; display: flex; }
.hb-nf-main { flex: 1; min-width: 0; }
.hb-nf-main b { font-weight: 600; }
.hb-nf-main i { font-style: normal; font-size: 11.5px; opacity: .6; margin-left: 7px; }
.hb-nf-arrow { flex: 0 0 auto; opacity: .6; display: flex; transition: transform .2s ease; }
.hb-novel-file:hover .hb-nf-arrow { opacity: 1; transform: translateX(3px); }

/* 暗色模式：小说蓝调亮一点，保证对比度 */
[data-theme="dark"] {
  --hb-novel: #8b9ded;
}

@media (max-width: 520px) {
  .hb-novel-grid { grid-template-columns: 1fr; }
  .hb-novel-cover { flex: 0 0 84px; width: 84px; }
  .hb-novel { gap: 11px; padding: 12px; }
}

/* ---------------- 18+ 年龄确认门 ---------------- */
html.hb-age-lock, html.hb-age-lock body { overflow: hidden !important; }

.hb-age {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 12, 18, .84);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}
.hb-age[hidden] { display: none; }

.hb-age-box {
  width: 100%;
  max-width: 430px;
  padding: 30px 26px 26px;
  border-radius: 18px;
  background: var(--card-bg, #fff);
  color: var(--font-color, #1e2a32);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
  text-align: center;
  animation: hbAgeIn .3s ease;
}
.hb-age-box[hidden] { display: none; }
@keyframes hbAgeIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.hb-age-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  background: #e05c5c;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}
.hb-age-title { margin: 14px 0 10px; font-size: 19px; font-weight: 700; line-height: 1.45; }
.hb-age-desc { margin: 0; font-size: 13px; line-height: 1.8; opacity: .68; }
.hb-age-q { margin: 20px 0 0; font-size: 15.5px; font-weight: 600; }
.hb-age-btns { display: flex; gap: 10px; margin-top: 20px; }
.hb-age-btn {
  flex: 1;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.hb-age-yes { background: var(--hb-primary); color: #fff; }
.hb-age-yes:hover { background: var(--hb-primary-d); }
.hb-age-no { background: transparent; border-color: rgba(128, 128, 128, .38); color: inherit; opacity: .8; }
.hb-age-no:hover { border-color: #e05c5c; color: #e05c5c; opacity: 1; }

/* 满屏「请成年后再来」 */
.hb-age-deny {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #101219;
}
.hb-age-deny[hidden] { display: none; }
.hb-age-deny-bg {
  position: absolute;
  inset: -15%;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 8px 18px;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.25;
  color: rgba(224, 92, 92, .16);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  transform: rotate(-12deg);
  animation: hbAgeDrift 26s linear infinite;
}
@keyframes hbAgeDrift {
  from { transform: rotate(-12deg) translateY(0); }
  to   { transform: rotate(-12deg) translateY(-60px); }
}
.hb-age-deny-main { position: relative; text-align: center; padding: 24px; }
.hb-age-deny-main h2 {
  margin: 0;
  font-size: clamp(32px, 8.5vw, 62px);
  font-weight: 900;
  color: #fff;
  letter-spacing: .06em;
  text-shadow: 0 6px 34px rgba(224, 92, 92, .6);
}
.hb-age-deny-main p { margin: 16px 0 0; font-size: 14px; color: rgba(255, 255, 255, .55); }

@media (prefers-reduced-motion: reduce) {
  .hb-age-deny-bg { animation: none; }
  .hb-age-box { animation: none; }
}

/* ============================================================
   RIDIBOOKS 图文教程（折叠面板，仿「Kirikiri」条目风格）
   用于 source/tutorial/index.md 的官方购买教程页
   ============================================================ */
.hb-guide { margin: 22px 0; }
.hb-guide-head {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #5b7bd5, #3d5cc0);
  color: #fff; border-radius: 12px;
  padding: 13px 20px; font-size: 1.12em; font-weight: 700;
  box-shadow: 0 4px 16px rgba(61, 92, 192, .28);
}
.hb-guide-head .hb-guide-ico { display: inline-flex; }
.hb-guide-head .hb-guide-more { margin-left: auto; opacity: .8; letter-spacing: -2px; font-weight: 900; }
.hb-guide-intro { margin: 14px 6px 6px; line-height: 2.1; font-size: .96em; }
.hb-guide-intro code {
  background: #e9eefb; color: #3d5cc0; border-radius: 6px;
  padding: 2px 9px; margin: 0 3px; font-size: .9em; white-space: nowrap;
}
.hb-guide details {
  border: 2px solid #5b7bd5; border-radius: 12px;
  margin: 12px 0; background: rgba(91, 123, 213, .05);
  overflow: hidden;
}
.hb-guide summary {
  cursor: pointer; list-style: none; user-select: none;
  padding: 12px 18px; font-weight: 600; color: #3a4a7a;
  display: flex; align-items: baseline; gap: 9px;
}
.hb-guide summary::-webkit-details-marker { display: none; }
.hb-guide summary::before {
  content: "\25B6"; font-size: .72em; color: #5b7bd5;
  transition: transform .2s ease; transform-origin: center;
}
.hb-guide details[open] summary::before { transform: rotate(90deg); }
.hb-guide-body { padding: 2px 20px 18px; }
.hb-guide-body p { margin: 10px 0; line-height: 1.9; }
.hb-guide-body p.hb-guide-cap { color: #6a7aa8; font-size: .9em; margin: 2px 0 4px; }
.hb-guide-body img {
  display: block; max-width: 100%; height: auto;
  margin: 6px auto 14px; border-radius: 10px;
  border: 1px solid #d5def0;
  box-shadow: 0 3px 14px rgba(60, 80, 140, .13);
}
.hb-guide-body a { color: #3d5cc0; font-weight: 600; }
[data-theme="dark"] .hb-guide-head { background: linear-gradient(135deg, #46599c, #32447e); box-shadow: 0 4px 16px rgba(0, 0, 0, .35); }
[data-theme="dark"] .hb-guide-intro code { background: #2a3450; color: #9db4ef; }
[data-theme="dark"] .hb-guide details { border-color: #4a5f9e; background: rgba(70, 89, 156, .12); }
[data-theme="dark"] .hb-guide summary { color: #aebbdb; }
[data-theme="dark"] .hb-guide summary::before { color: #7f96d6; }
[data-theme="dark"] .hb-guide-body img { border-color: #3a4460; box-shadow: 0 3px 14px rgba(0, 0, 0, .4); }
[data-theme="dark"] .hb-guide-body a { color: #9db4ef; }

/* ============================================================
   链接失效标注（数据源 source/_data/deadlinks.yml，由 工具/巡检链接.py 生成）
   ============================================================ */
.hb-dead-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  color: #fff;
  background: #e5484d;
  border-radius: 999px;
  vertical-align: 1px;
}
.hb-dl.hb-dead {
  border-color: rgba(229, 72, 77, .45);
  background: rgba(229, 72, 77, .05);
}
.hb-dl.hb-dead:hover {
  border-color: #e5484d;
  background: rgba(229, 72, 77, .1);
  transform: none;
  box-shadow: 0 3px 12px rgba(229, 72, 77, .15);
}
.hb-dl.hb-dead .hb-dl-main b { color: #b33035; text-decoration: line-through; }
.hb-dl.hb-dead .hb-dl-ico { background: rgba(229, 72, 77, .12); }

/* 补链页顶部的失效警示块 */
.hb-deadlist {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: var(--hb-radius);
  border: 1px solid;
  line-height: 1.9;
}
.hb-deadlist-ok {
  border-color: rgba(76, 175, 125, .4);
  background: rgba(76, 175, 125, .08);
  color: #3a9a6b;
}
.hb-deadlist-bad {
  border-color: rgba(229, 72, 77, .4);
  background: rgba(229, 72, 77, .07);
  color: #c0392b;
}
.hb-deadlist-hd { font-weight: 700; margin-bottom: 6px; }
.hb-deadlist ul { margin: 0; padding-left: 20px; }
.hb-deadlist li { margin: 4px 0; }
.hb-deadlist code { font-size: .88em; word-break: break-all; }

[data-theme="dark"] .hb-deadlist-ok { background: rgba(76,175,125,.12); color: #6fd39a; }
[data-theme="dark"] .hb-deadlist-bad { background: rgba(229,72,77,.12); color: #f08a8d; }
[data-theme="dark"] .hb-dl.hb-dead { background: rgba(229,72,77,.08); }
[data-theme="dark"] .hb-dl.hb-dead .hb-dl-main b { color: #f08a8d; }
