/* TEPoster styles */
.teposter-button-wrap {
  margin: 16px 0;
}

.teposter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.teposter-btn:hover {
  background: #155cc0;
}

/* Modal */
.teposter-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.teposter-modal {
  width: 400px;
  max-height: 92vh;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}

@media (max-width: 420px) {
  .teposter-modal {
    width: 300px;
  }
}

.teposter-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.teposter-modal-body {
  padding: 14px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teposter-modal-footer {
  padding: 14px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
  justify-content: center;
  /* center download button */
}

.teposter-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* Poster canvas root */
.teposter-root {
  width: 400px;
  /* will be overridden by inline style from config */
  background: #fff;
  color: #111;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 37px;
  /* add 5px vertical white margin overall */
}

.teposter-header {
  padding: 0 0 20px 0;
  display: flex;
  align-items: center;
}

.teposter-content {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.teposter-title {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
  text-align: center;
}

.teposter-summary {
  font-size: 13px;
  color: #333;
  line-height: 1.8;
  /* requested line-height */
  letter-spacing: 0.3px;
  /* requested tracking */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  /* clamp to 4 lines */
  -webkit-box-orient: vertical;
  line-clamp: 4;
  /* non-prefixed fallback */
  overflow: hidden;
}

.teposter-logo {
  height: 33px;
  width: auto;
}

.teposter-random {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  /* Reserve space so the badge always has a place even before image loads */
  aspect-ratio: 4 / 3;
  min-height: 200px;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
}

.teposter-random img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.teposter-date-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  border-radius: 8px;
  padding: 6px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  text-align: center;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}

.teposter-date-day {
  font-size: 22px;
  font-weight: 800;
}

.teposter-date-monthyear {
  margin-top: 4px;
  font-size: 11px;
  color: #444;
}

.teposter-qrcode {
  width: 140px;
  height: 140px;
  margin: 10px auto 6px auto;
}

/* Hidden staging area for html2canvas */
.teposter-staging {
  position: fixed;
  top: -10000px;
  left: -10000px;
  opacity: 1;
  /* ensure accurate colors */
  pointer-events: none;
  z-index: -1;
}

/* Loading toast */
.teposter-toast {
  position: fixed;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 99999;
  display: none;
}

/* progress bar removed to avoid interfering with site header */

/* ninetheme layout */
.teposter-nt {
  background: #ffffff;
  color: #111;
  padding: 16px;
  /* outer white border */
  border-radius: 22px;
}

.teposter-nt .nt-hero {
  position: relative;
  height: 78%;
  /* higher hero */
  min-height: 460px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  border-radius: 18px;
  /* rounded corners for background image */
  overflow: hidden;
}

.teposter-nt .nt-date {
  position: absolute;
  left: 22px;
  top: 18px;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.teposter-nt .nt-day {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
}

.teposter-nt .nt-monthyear {
  margin-top: 2px;
  font-size: 18px;
  letter-spacing: 2px;
}

.teposter-nt .nt-hero-info {
  width: 100%;
  padding: 16px 22px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.teposter-nt .nt-hero-info-top {
  align-self: stretch;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}

.teposter-nt .nt-hero-info-bottom {
  align-self: stretch;
  position: relative;
  margin-top: auto;
}

.teposter-nt .nt-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
}

.teposter-nt .nt-summary {
  margin-top: 13px;
  font-size: 14px;
  opacity: 0.95;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.teposter-nt .nt-footer-white {
  background: transparent;
  /* merge with outer white area */
  color: #111111;
  padding: 16px 18px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.teposter-nt .nt-footer-white.no-desc {
  align-items: center;
}

.teposter-nt .nt-brand-name {
  font-size: 26px;
  font-weight: 800;
}

.teposter-nt .nt-brand-desc {
  margin-top: 6px;
  font-size: 14px;
  color: #555555;
}

.teposter-nt .nt-qrcode {
  width: 120px;
  height: 120px;
}

.teposter-nt .nt-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.teposter-nt .nt-brand-logo {
  height: 44px;
  width: auto;
}

.teposter-nt .nt-brand-title {
  font-size: 28px;
  font-weight: 800;
}


/* Netease Style */
.teposter-netease {
  background: #eef1f5;
  color: #333;
  padding: 20px;
  border-radius: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.netease-image-wrap {
  background: #fff;
  padding: 10px;
  /* Reduced padding (border effect) */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* For overlay info */
  border-radius: 12px;
  /* Added rounded corners to wrapper */
}

.netease-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  /* Rounded image */
}

/* Overlay Info (Title + Author) inside image */
.netease-overlay-info {
  position: absolute;
  left: 25px;
  bottom: 25px;
  z-index: 10;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.netease-info {
  margin-bottom: 30px;
  padding: 0 10px;
}

.netease-title {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  /* White text on image */
  margin-bottom: 6px;
  line-height: 1.3;
}

.netease-author {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.netease-middle {
  display: flex;
  align-items: flex-start;
  margin-bottom: 25px;
  padding: 0 10px;
}

.netease-date-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 20px;
  position: relative;
  min-width: 60px;
}

.netease-date-slash {
  width: 14px;
  height: 2px;
  background: #333;
  margin: 4px 0;
  transform: none;
}

.netease-month {
  font-size: 28px;
  /* Matched to day */
  font-weight: bold;
  color: #000;
  align-self: center;
  margin: 0;
  line-height: 1;
}

.netease-day {
  font-size: 28px;
  /* Matched to month */
  font-weight: bold;
  color: #000;
  line-height: 1;
  align-self: center;
  margin: 0;
}

.netease-desc {
  flex: 1;
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  align-self: center;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.netease-dotted-line {
  border-top: 2px dotted #ccc;
  margin: 0 10px 20px 10px;
}

.netease-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 10px;
}

.netease-footer-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.netease-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.netease-brand-dot {
  width: 12px;
  height: 12px;
  background: #333;
  border-radius: 50%;
}

.netease-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.teposter-netease .netease-site-name {
  font-size: 16px;
  font-weight: bold;
  color: #000;
}

.netease-site-name {
  font-size: 14px;
  font-weight: bold;
  color: #000;
}

.netease-brand-divider {
  color: #ccc;
  font-size: 12px;
}

.netease-footer-author {
  font-size: 12px;
  color: #666;
}

.netease-scan-text {
  font-size: 12px;
  color: #888;
}

.netease-footer-right {
  position: relative;
}

.netease-qrcode {
  background: #fff;
  padding: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.netease-qrcode img {
  display: block;
}