/* 站内阅读弹层（iMod / Rockbox 共用）：读本地存档，取消外站跳转 */

/* 卡片上的「本站阅读」按钮 */
.imod-link.is-read {
  background: none;
  border: 0;
  padding: 14px 0 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  text-align: left;
}

.imod-link.is-read::after {
  content: '→';
}

.rb-links a[data-read]::after {
  content: ' →';
  opacity: 0.7;
}

body.no-scroll {
  overflow: hidden;
}

.imod-reader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.imod-reader.is-on {
  display: block;
}

.imod-reader__mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  animation: imod-fade 0.25s var(--ease) both;
}

.imod-reader__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(780px, calc(100vw - 32px));
  max-height: min(84vh, 880px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  padding: 44px 30px 34px;
  animation: imod-pop 0.3s var(--ease) both;
}

.imod-reader__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: pointer;
}

.imod-reader__close svg {
  width: 17px;
  height: 17px;
}

.imod-reader__close:hover {
  background: #e8e8ed;
  color: var(--text);
}

.imod-reader__title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text);
}

.imod-reader__loading {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- 存档正文排版 ---------- */
.imod-read {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
}

.imod-read h4 {
  margin: 22px 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.imod-read p {
  margin: 0 0 12px;
  color: #3a3a3c;
}

.imod-read ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.imod-read li {
  margin: 0 0 6px;
  color: #3a3a3c;
}

.imod-read strong {
  font-weight: 600;
}

.imod-read figure {
  margin: 14px 0 18px;
}

.imod-read figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: var(--bg-alt);
}

.imod-read-meta {
  margin: 0 0 16px !important;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-alt);
  font-size: 13px;
  color: var(--text-muted) !important;
}

.imod-read-src {
  margin: 20px 0 0 !important;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-muted) !important;
  word-break: break-all;
}

@keyframes imod-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes imod-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@media (max-width: 640px) {
  .imod-reader__panel {
    padding: 40px 18px 26px;
    max-height: 90vh;
  }
  .imod-reader__title {
    font-size: 19px;
  }
  .imod-read {
    font-size: 14px;
  }
}
