/* =========================================================
   氷ノ箱庭 · pixel pages
   主页模块 / 手记 / 文章 / 归档 / 相册 / 友链 / 追番 / 关于
   ========================================================= */

/* =============================== 横幅 =============================== */

.hero {
  position: relative;
  border: var(--bw) solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--paper-3);
  line-height: 0;
}

.hero__media {
  position: relative;
  height: clamp(220px, 34vw, 380px);
  overflow: hidden;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 8px;
  background: var(--pink-soft);
  border-top: var(--bw) solid var(--border);
  font-size: 11px;
  line-height: 1.6;
}

.hero__bar .spacer {
  margin-left: auto;
}

.hero__sticker {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 2px 7px;
  background: var(--paper);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--shadow-color);
  font-size: 10px;
  line-height: 1.5;
  transform: rotate(-4deg);
}

/* =============================== 公告 =============================== */

.announce {
  position: relative;
  padding: 10px 12px 10px 34px;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0 21px,
    var(--cyan-soft) 21px 22px
  );
  border: var(--bw) solid var(--border);
  box-shadow: var(--shadow);
  font-size: 11px;
  line-height: 22px;
  color: var(--ink-2);
}

.announce::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--pink);
}

.announce::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 14px;
  width: 6px;
  height: 6px;
  background: var(--paper-3);
  border: 2px solid var(--border);
  box-shadow: 0 16px 0 -2px var(--paper-3), 0 16px 0 0 var(--ink), 0 28px 0 -2px var(--paper-3),
    0 28px 0 0 var(--ink);
}

/* =============================== 更新列表 =============================== */

.updates {
  display: grid;
}

.update-row {
  display: grid;
  grid-template-columns: 58px 62px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 5px 4px;
  border-bottom: 2px dotted var(--ink-3);
  font-size: 11.5px;
}

.update-row:last-child {
  border-bottom: 0;
}

.update-row:hover {
  background: var(--butter-soft);
}

.update-row time {
  font-size: 10px;
  color: var(--ink-3);
}

.update-row a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-row .chip {
  justify-self: start;
}

@media (max-width: 560px) {
  .update-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }
  .update-row .chip {
    display: none;
  }
}

/* =============================== 相册格 =============================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.gallery__item {
  position: relative;
  display: block;
  border: 2px solid var(--border);
  overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 4 / 3;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__item span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 6px;
  background: rgba(36, 31, 49, 0.72);
  color: #fff;
  font-size: 10px;
  line-height: 1.6;
}

.gallery__item:hover img {
  filter: brightness(1.08);
}

/* 瞬间配图 */
.moment__img {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin-top: 8px;
  border: 2px solid var(--border);
}

/* =============================== 留言格 =============================== */

.chatbox {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.chat-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 6px;
  border: 2px solid transparent;
  font-size: 11px;
  line-height: 1.7;
}

.chat-row:hover {
  border-color: var(--border);
  background: var(--paper-2);
}

.chat-row__ava {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--lilac-soft);
  border: 2px solid var(--border);
  font-size: 10px;
}

.chat-row__head {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.chat-row__name {
  font-size: 11px;
}

.chat-row__time {
  font-size: 9px;
  color: var(--ink-3);
}

.chat-row__text {
  color: var(--ink-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* =============================== 手记列表 =============================== */

.list-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: var(--bw) solid var(--border);
  background: var(--paper-2);
}

.search {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  background: var(--paper);
  border: 2px solid var(--border);
  min-width: 180px;
  flex: 1;
  max-width: 280px;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 11px;
  color: var(--ink);
}

.search .pi {
  font-size: 13px;
  color: var(--ink-3);
}

.post-list {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.post-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  background: var(--paper);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow-color);
}

.post-card:hover {
  background: var(--paper-2);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow-color);
}

.post-card__thumb {
  width: 96px;
  height: 72px;
  border: 2px solid var(--border);
  overflow: hidden;
  background: var(--paper-3);
  align-self: start;
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card__body {
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: start;
}

.post-card__title {
  font-size: 13px;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 10px;
  color: var(--ink-3);
}

.post-card__excerpt {
  font-size: 11px;
  line-height: 1.75;
  color: var(--ink-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 1px;
}

.empty-state {
  padding: 24px 10px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
}

@media (max-width: 520px) {
  .post-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .post-card__thumb {
    width: 72px;
    height: 56px;
  }
}

/* =============================== 文章页 =============================== */

.article-hero {
  position: relative;
  border: var(--bw) solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  line-height: 0;
}

.article-hero img {
  width: 100%;
  height: clamp(180px, 26vw, 300px);
  object-fit: cover;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--ink-2);
}

.article-title {
  font-size: 18px;
  line-height: 1.5;
  margin-top: 6px;
}

.prose {
  font-size: 12.5px;
  line-height: 2.05;
  color: var(--ink-2);
}

.prose > * + * {
  margin-top: 10px;
}

.prose h2 {
  font-size: 15px;
  line-height: 1.6;
  margin-top: 18px;
  padding-left: 6px;
  border-left: 6px solid var(--pink);
  scroll-margin-top: 84px;
}

.prose h3 {
  font-size: 13px;
  margin-top: 14px;
  color: var(--ink);
  scroll-margin-top: 84px;
}

.prose p {
  margin: 0;
}

.prose strong {
  color: var(--ink);
  font-weight: 400;
  background: var(--butter-soft);
  padding: 0 2px;
}

.prose em {
  font-style: normal;
  background: var(--cyan-soft);
  padding: 0 2px;
}

.prose a {
  color: var(--ink);
  border-bottom: 2px solid var(--pink);
}

.prose ul,
.prose ol {
  display: grid;
  gap: 4px;
}

.prose ul li {
  position: relative;
  padding-left: 14px;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.75em;
  width: 6px;
  height: 6px;
  background: var(--pink);
  border: 1px solid var(--border);
}

.prose ol {
  counter-reset: li;
}

.prose ol li {
  counter-increment: li;
  position: relative;
  padding-left: 20px;
}

.prose ol li::before {
  content: counter(li) '.';
  position: absolute;
  left: 0;
  color: var(--ink-3);
}

.prose blockquote {
  margin: 12px 0;
  padding: 8px 10px;
  background: var(--lilac-soft);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--shadow-color);
  color: var(--ink);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.94em;
  background: var(--paper-3);
  border: 1px solid var(--border);
  padding: 0 3px;
}

.prose pre {
  padding: 8px;
  background: var(--paper-2);
  border: 2px solid var(--border);
  overflow-x: auto;
  font-size: 11px;
  line-height: 1.8;
}

.prose pre code {
  border: 0;
  background: none;
  padding: 0;
}

.prose img {
  border: 2px solid var(--border);
}

.prose figure {
  margin: 12px 0;
}

.prose figcaption {
  margin-top: 6px;
  text-align: center;
  font-size: 10px;
  color: var(--ink-3);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin: 12px 0;
}

.prose th {
  text-align: left;
  padding: 3px 6px;
  background: var(--cyan-soft);
  border: 2px solid var(--border);
  font-weight: 400;
}

.prose td {
  padding: 3px 6px;
  border: 2px solid var(--border);
  color: var(--ink-2);
}

.prose hr {
  border: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 10px);
  margin: 14px 0;
}

.article-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: var(--bw) solid var(--border);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--paper);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--shadow-color);
  font-size: 11px;
}

.like-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.like-btn.is-liked {
  background: var(--pink-soft);
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.pager a,
.pager span {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  background: var(--paper-2);
  border: 2px solid var(--border);
  font-size: 11px;
}

.pager span {
  font-size: 9px;
  color: var(--ink-3);
}

.pager b {
  font-weight: 400;
  font-size: 11px;
  line-height: 1.6;
}

.pager .is-off {
  opacity: 0.5;
}

.pager__next {
  text-align: right;
}

/* 目录 */
.toc a {
  display: block;
  padding: 3px 0 3px 8px;
  font-size: 11px;
  color: var(--ink-2);
  border-left: 3px solid transparent;
}

.toc a.is-active {
  color: var(--ink);
  border-left-color: var(--pink);
  background: var(--paper-2);
}

.toc a[data-level='3'] {
  padding-left: 16px;
  font-size: 10px;
  color: var(--ink-3);
}

/* =============================== 归档 =============================== */

.archive-year {
  padding: 6px 8px;
  background: var(--pink-soft);
  border-bottom: 2px solid var(--border);
  font-size: 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.archive-year span {
  font-size: 10px;
  color: var(--ink-2);
}

.archive-month {
  padding: 4px 8px;
  font-size: 10px;
  color: var(--ink-3);
  background: var(--paper-2);
  border-bottom: 2px dotted var(--ink-3);
}

.archive-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 8px;
  font-size: 11.5px;
  border-bottom: 2px dotted var(--ink-3);
}

.archive-row:last-child {
  border-bottom: 0;
}

.archive-row time {
  width: 46px;
  flex: none;
  font-size: 10px;
  color: var(--ink-3);
}

.archive-row a {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-row:hover {
  background: var(--butter-soft);
}

/* =============================== 相册页 =============================== */

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.album {
  display: grid;
  background: var(--paper);
  border: var(--bw) solid var(--border);
  box-shadow: var(--shadow);
}

.album__img {
  border-bottom: var(--bw) solid var(--border);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--paper-3);
}

.album__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album__body {
  padding: 6px 8px;
  display: grid;
  gap: 2px;
}

.album__title {
  font-size: 13px;
}

.album__note {
  font-size: 10.5px;
  color: var(--ink-2);
  line-height: 1.7;
}

@media (max-width: 640px) {
  .album-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================== 友链 =============================== */

.friend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.friend {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  background: var(--paper);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow-color);
}

.friend:hover {
  background: var(--paper-2);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow-color);
}

.friend__ava {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--lilac-soft);
  border: 2px solid var(--border);
  font-size: 14px;
}

.friend__name {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.friend__desc {
  font-size: 10px;
  color: var(--ink-2);
  line-height: 1.6;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 640px) {
  .friend-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================== 追番 =============================== */

.anime-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 74px;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 2px dotted var(--ink-3);
}

.anime-row:last-child {
  border-bottom: 0;
}

.anime-cover {
  width: 42px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 2px solid var(--border);
  font-size: 11px;
  color: var(--paper);
  text-align: center;
  line-height: 1.3;
  overflow: hidden;
}

.anime-title {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.anime-meta {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 2px;
}

.anime-progress {
  display: flex;
  gap: 1px;
  margin-top: 4px;
  max-width: 160px;
}

.anime-progress i {
  flex: 1;
  height: 6px;
  background: var(--paper-3);
  border: 1px solid var(--border);
}

.anime-progress i.is-on {
  background: var(--cyan);
}

.anime-side {
  text-align: right;
  font-size: 11px;
}

.anime-side b {
  font-weight: 400;
  color: var(--pink-deep);
}

/* =============================== 关于 =============================== */

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.fact {
  padding: 6px 8px;
  background: var(--paper-2);
  border: 2px solid var(--border);
  display: grid;
  gap: 2px;
}

.fact dt {
  font-size: 10px;
  color: var(--ink-3);
}

.fact dd {
  margin: 0;
  font-size: 12px;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

@media (max-width: 640px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================== 表单 / 评论 =============================== */

.form {
  display: grid;
  gap: 8px;
}

.field {
  display: grid;
  gap: 3px;
}

.field > span {
  font-size: 10px;
  color: var(--ink-2);
}

.field input,
.field textarea {
  width: 100%;
  padding: 4px 6px;
  background: var(--paper);
  border: 2px solid var(--border);
  box-shadow: inset 2px 2px 0 var(--paper-3);
  font-size: 11.5px;
  line-height: 1.8;
  color: var(--ink);
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  background: var(--butter-soft);
}

.form__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.form__hint {
  font-size: 10px;
  color: var(--ink-3);
}

.comments {
  display: grid;
  margin-top: 8px;
}

.comment {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-top: 2px dotted var(--ink-3);
}

.comment__ava {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: var(--mint-soft);
  border: 2px solid var(--border);
  font-size: 11px;
}

.comment__head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.comment__name {
  font-size: 11px;
}

.comment__time {
  font-size: 9px;
  color: var(--ink-3);
}

.comment__text {
  font-size: 11px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.comments__empty {
  padding: 14px 0;
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
}

/* =============================== 页头（内页） =============================== */

.page-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  background: var(--paper);
  border: var(--bw) solid var(--border);
  box-shadow: var(--shadow-sm);
}

.page-head h1 {
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-head .pi {
  font-size: 18px;
  color: var(--pink-deep);
}

.page-head__sub {
  font-size: 10px;
  color: var(--ink-3);
  width: 100%;
}

/* 两栏内页 */
.inner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 10px;
  align-items: start;
}

@media (max-width: 900px) {
  .inner-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* =============================== 侧栏卡片翻页 =============================== */

.cardflip {
  padding: 8px;
}

.cardflip__stage {
  position: relative;
  aspect-ratio: 16 / 10;
  perspective: 720px;
}

.cardflip__card {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 2px solid var(--border);
  background: var(--paper-2);
  box-shadow: 3px 3px 0 var(--shadow-color);
  transform-origin: left center;
  transform: rotateY(-92deg);
  opacity: 0;
  backface-visibility: hidden;
  transition: transform 280ms steps(4), opacity 120ms steps(2);
  pointer-events: none;
}

.cardflip__card.is-active {
  transform: none;
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

.cardflip__card.is-prev {
  transform: rotateY(92deg);
}

.cardflip__card img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.cardflip__card img.is-contain {
  object-fit: contain;
  padding: 10px;
  background-image: repeating-conic-gradient(
    var(--butter-soft) 0 25%,
    var(--paper) 0 50%
  );
  background-size: 12px 12px;
}

.cardflip__card figcaption {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-top: 2px solid var(--border);
  background: var(--butter-soft);
  font-size: 10px;
  line-height: 1.7;
}

.cardflip__card figcaption .pi {
  font-size: 12px;
}

.cardflip__card--note {
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0 18px,
    var(--cyan-soft) 18px 19px
  );
}

.cardflip__note {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  padding: 10px;
  text-align: center;
}

.cardflip__note b {
  font-size: 13px;
  font-weight: 400;
}

.cardflip__note span {
  font-size: 10px;
  line-height: 1.8;
  color: var(--ink-2);
}

.cardflip__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 6px;
}

.cardflip__btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 22px;
  background: var(--paper);
  border: 2px solid var(--border);
  box-shadow: 2px 2px 0 var(--shadow-color);
}

.cardflip__btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.cardflip__btn .pi {
  font-size: 12px;
}

.cardflip__dots {
  display: flex;
  gap: 4px;
}

.cardflip__dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--border);
  background: var(--paper);
  padding: 0;
}

.cardflip__dot.is-on {
  background: var(--pink);
}

@media (prefers-reduced-motion: reduce) {
  .cardflip__card {
    transition: none;
  }
}
