/* ------------------------------------
 * WeUI 主题 —— 主题自有样式
 *
 * 这里只放 WeUI 核心没有提供的“胶水”样式（页面容器、站点头部、评论等）。
 * WeUI 组件样式全部来自 assets/weui.css（官方 dist 的逐条摘录，未改动）。
 * --------------------------------- */

html,
body {
  height: 100%;
}

/* WeUI 官方示例中 body/.page 使用 --weui-BG-0 作为页面底色（随深浅色自适应） */
body {
  background-color: var(--weui-BG-0);
  /* 页面左右统一留白：站点头部内容、搜索框都用它对齐 */
  --site-gutter: 16px;
}

/* 页面容器：移动端全宽，桌面端居中；文章页内容块用 WeUI 的 --weui-BG-2 */
.page {
  box-sizing: border-box;
  min-height: 100%;
  margin: 0 auto;
  max-width: 640px;
}

/* 文章页正文区：做成一张与首页列表一致的白色内容块，
   与站点头部之间留出 --weui-BG-0 的灰色间隙（见 header 后的 10px） */
.page.article {
  background-color: transparent;
}

.article-wrap {
  margin-top: 10px;
  background-color: var(--weui-BG-2);
}

/* 站点头部（无下边框） */
.site-header {
  padding: 24px var(--site-gutter) 16px;
  background-color: var(--weui-BG-2);
}

/* 去掉 weui-panel 的上下边框（官方组件用 ::before / ::after 画上下细线） */
.weui-panel::before,
.weui-panel::after {
  display: none;
}

/* 可选：将站点头部固定在页面顶部（后台外观设置里切换） */
.site-header--fixed {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* 主标题 + 副标题同一行，副标题字号更小 */
.site-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.site-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--weui-FG-0);
}

.site-desc {
  font-size: 13px;
  color: var(--weui-FG-1);
}

.site-nav {
  margin-top: 12px;
  font-size: 0;
}

.site-nav a {
  display: inline-block;
  margin-right: 16px;
  font-size: 15px;
  color: var(--weui-FG-0);
}

.site-nav a.current {
  color: var(--weui-LINK);
}

/* 归档标题 */
.archive-title {
  margin: 0;
  padding: 24px 16px 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--weui-FG-1);
}

/* 图文列表缩略图：官方 appmsg 的 hd 为 60x60，这里放大到 80x80 并裁切，
   让照片缩略图更清晰；无图时列表项自动退化为 weui-media-box_text。 */
.weui-media-box_appmsg .weui-media-box__hd {
  width: 80px;
  height: 80px;
  line-height: 80px;
}

.weui-media-box_appmsg .weui-media-box__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/* 无图列表项：官方 WeUI 该场景用 <div>（块级），而这里为了整条可点击用的是
   <a>（行内元素）。行内元素的内边距不会作用于其块级子元素，会导致文字贴边，
   因此显式设为块级，使 weui-media-box 的 16px 内边距正常生效。 */
.weui-media-box_text {
  display: block;
}

/* 文章元信息（紧贴居中的大标题） */
.article-meta {
  margin: -32px 0 32px;
  text-align: center;
  font-size: 13px;
  color: var(--weui-FG-2);
}

.article-meta a,
.article-meta time {
  margin: 0 4px;
  color: var(--weui-FG-2);
}

.article-footer {
  padding: 0 24px 24px;
  font-size: 14px;
  color: var(--weui-FG-1);
}

.article-footer a {
  color: var(--weui-LINK);
}

/* 上一篇 / 下一篇 */
.post-near {
  margin: 0 24px;
  padding: 16px 0;
  border-top: 1px solid var(--weui-FG-3);
  font-size: 14px;
  line-height: 2;
  color: var(--weui-FG-1);
}

.post-near a {
  color: var(--weui-LINK);
}

/* 分页 */
.page-navigator {
  list-style: none;
  margin: 0;
  padding: 20px 16px;
  text-align: center;
}

.page-navigator li {
  display: inline-block;
  margin: 0 4px;
}

.page-navigator a {
  display: inline-block;
  padding: 4px 10px;
  color: var(--weui-LINK);
}

.page-navigator .current a {
  color: var(--weui-FG-1);
}

/* 区块小标题（评论区、表单等） */
.section-title {
  margin: 0;
  padding: 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--weui-FG-1);
}

/* 评论列表：头像 + 昵称 + 时间同一行，右侧回复；内容另起一行缩进对齐 */
.comments {
  border-top: 1px solid var(--weui-FG-3);
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-list li.comment-body {
  position: relative;
  padding: 14px 16px;
  border-top: 1px solid var(--weui-FG-3);
}

.comment-list > li.comment-body:first-child {
  border-top: none;
}

/* 第一行：头像、昵称、时间（右侧留出回复按钮的位置） */
.comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-right: 44px;
}

.comment-head .comment-avatar {
  flex: none;
  width: 28px;
  height: 28px;
}

.comment-head .comment-avatar img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--weui-FG-3);
}

.comment-name {
  font-style: normal;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.3;
  color: var(--weui-FG-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comment-name a {
  color: var(--weui-FG-0);
}

.comment-date {
  flex: none;
  font-size: 12px;
  color: var(--weui-FG-2);
}

/* 回复操作：作为 <li> 的最后一个子元素置于右上角。
   放在最后是为了让 Typecho 的「回复」把表单追加到整条评论末尾，
   而不会插到头像行与正文之间。 */
.comment-actions {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 13px;
  white-space: nowrap;
}

.comment-actions a {
  color: var(--weui-FG-2);
}

.comment-actions:empty {
  display: none;
}

/* 内容缩进到与昵称对齐（头像 28px + 间距 8px） */
.comment-content {
  margin: 6px 0 0 36px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--weui-FG-0);
  word-wrap: break-word;
}

.comment-content p {
  margin: 0 0 8px;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

/* 子回复：内缩 + 左侧竖线，形成层级 */
.comment-children {
  list-style: none;
  margin: 10px 0 0 36px;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--weui-FG-3);
}

.comment-children li.comment-body {
  padding: 10px 0;
  border-top: none;
}

.comment-children .comment-head .comment-avatar,
.comment-children .comment-head .comment-avatar img {
  width: 24px;
  height: 24px;
}

.comment-children .comment-content {
  margin-left: 32px;
}

.comment-awaiting-moderation {
  color: #fa5151;
}

.comments-pager .page-navigator {
  padding: 12px 16px;
}

/* 评论表单 */
.respond {
  border-top: 1px solid var(--weui-FG-3);
}

/* 回复某条评论时，Typecho 会把整个表单移进对应的 li，
   这里把它做成一个内嵌的回复卡片，避免与列表样式打架 */
.comment-list li.comment-body .respond {
  margin: 10px 0 2px;
  padding: 10px;
  border-radius: 8px;
  background-color: var(--weui-BG-2);
}

/* 回复框与内容左对齐（头像列宽 28 + 间距 8） */
.comment-list > li.comment-body > .respond {
  margin-left: 36px;
}

.comment-children li.comment-body > .respond {
  margin-left: 32px;
}

/* 内嵌回复卡片的标题行：左"回复"，右"取消回复" */
.comment-list li.comment-body .respond .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 8px;
  font-size: 13px;
}

.comment-list li.comment-body .respond .comment-field,
.comment-list li.comment-body .respond .comment-login {
  padding: 0;
}

.comment-list li.comment-body .respond .comment-submit {
  padding: 0;
}

.respond .cancel-comment-reply {
  float: none;
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
}

.respond .cancel-comment-reply a {
  color: var(--weui-LINK);
}

.comment-login {
  margin: 0 0 12px;
  padding: 0 16px;
  font-size: 13px;
  color: var(--weui-FG-1);
}

.comment-login .logout {
  margin-left: 8px;
  color: var(--weui-LINK);
}

.comment-field {
  margin: 0 0 12px;
  padding: 0 16px;
}

.comment-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--weui-FG-1);
}

#comment-form input[type="text"],
#comment-form input[type="email"],
#comment-form input[type="url"],
#comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--weui-FG-3);
  border-radius: 6px;
  font-size: 15px;
  color: var(--weui-FG-0);
  background-color: var(--weui-BG-2);
}

#comment-form textarea {
  resize: vertical;
}

#comment-form .required:after {
  content: " *";
  color: #fa5151;
}

.comment-submit {
  margin: 0;
  padding: 0 16px 16px;
}

.comment-submit .submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 17px;
  color: #fff;
  background-color: var(--weui-BRAND);
}

/* 归档页（按月分组） */
.archive-month {
  margin: 24px 0 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--weui-FG-1);
}

.archive-month:first-child {
  margin-top: 0;
}

.archive-cells .weui-cell__ft {
  font-size: 13px;
  color: var(--weui-FG-2);
}

/* 评论作者链接（登录态下 Typecho 会输出 <a>：普通文章里 > 与昵称同色；
   相册文章（瀑布流下方）同样适用） */
.comment-author cite a {
  color: var(--weui-FG-0);
}

/* 友链九宫格：无边框线条，三栏等宽，图片/名称/介绍居中 */
.link-grids {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 8px;
  margin: 0;
}

.link-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--weui-FG-0);
}

.link-grid__icon {
  width: 48px;
  height: 48px;
}

.link-grid__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.link-grid__name {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--weui-FG-0);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.link-grid__desc {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--weui-FG-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* 相册详情：瀑布流三栏 + 懒加载淡入 + 灯箱 */
.wf-columns {
  column-count: 3;
  column-gap: 6px;
}

.wf-item {
  display: block;
  break-inside: avoid;
  margin: 0 0 6px;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

.wf-img {
  display: block;
  width: 100%;
  height: auto;
  background-color: var(--weui-FG-3);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.wf-img.is-loaded {
  opacity: 1;
}

.wf-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 8px 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

/* 相册灯箱：左右切换按钮 + 右上角关闭 + 图片下方描述 */
.wf-lightbox__prev,
.wf-lightbox__next {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  font-size: 30px;
  line-height: 1;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
}

.wf-lightbox__prev {
  left: 12px;
}

.wf-lightbox__next {
  right: 12px;
}

.wf-lightbox__prev:active,
.wf-lightbox__next:active {
  opacity: 0.6;
}

.wf-lightbox__close {
  position: absolute;
  top: 12px;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  line-height: 32px;
  text-align: center;
  font-size: 24px;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.35);
  border-radius: 50%;
}

.wf-lightbox__close:active {
  opacity: 0.6;
}

.wf-lightbox__caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  margin: 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* 有描述时，图片底部让出空间，避免与说明重叠 */
.weui-gallery__img:has(+ .wf-lightbox__prev) {
  bottom: 44px;
}

.gallery-empty {
  color: var(--weui-FG-2);
}

/* 页脚 */
.site-footer {
  padding: 32px 16px;
}



