/* index.css - Homepage specific styles - MODERNIZED 2026-09-05 */

/* ── Banner List Blocks (3-col grid rows, no Slick needed) ── */
.bannerlist {
  padding: 6px 12px 0;
  background: var(--bg-white);
}
.bannerlist + .bannerlist { padding-top: 12px; }
.bannerlist .tit {
  padding: 4px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-red);
}
.bannerlist .tit:empty { display: none; }
.bannerlist .slick {
  display: block;
}
.bannerlist .listone {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.bannerlist .listone + .listone {
  margin-top: 8px;
}

.oneimg {
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  /* FIX: always visible even when image fails to load */
  min-height: 100px;
  height: 100%;
}
.oneimg:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.oneimg img {
  width: 100%;
  /* Force a visible height even before image loads */
  height: 120px;
  object-fit: cover;
  background: #e8e8e8;
  display: block;
  flex-shrink: 0;
}
.oneimg p {
  width: 100%;
  padding: 5px 4px;
  font-size: 11px;
  color: var(--text-dark);
  text-align: center;
  background: var(--bg-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--border-color);
  line-height: 1.4;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}


/* ── Type Block (Homepage sections) ── */
.typelist {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.typelist.clearafter { display: flex; flex-direction: column; gap: 12px; }

.typeone {
  background: var(--bg-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.typeone .tit {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-primary);
}
.typeone .tit::before { content: '📌'; font-size: 15px; }
.typeone .cont { padding: 6px 0; }

.typeone .one {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}
.typeone .one:last-of-type { border-bottom: none; }
.typeone .one a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: var(--text-dark);
  font-size: 13px;
  line-height: 1.4;
}
.typeone .one a:hover { color: var(--brand-primary); }
.typeone .one a span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.typeone .more {
  padding: 8px 12px;
  border-top: 1px solid var(--border-color);
  text-align: right;
  background: var(--bg-white);
}
.typeone .more a {
  font-size: 13px;
  color: var(--brand-primary);
  font-weight: 600;
}
.typeone .more a:hover { text-decoration: underline; }

/* ── External Links Section ── */
.ext-links {
  padding: 12px;
}
.ext-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ext-links-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  font-size: 12px;
  color: var(--brand-primary);
  background: #e8f4fc;
  border: 1px solid #c5e3f7;
  border-radius: var(--radius-sm);
  text-align: center;
  line-height: 1.3;
  transition: all 0.2s;
}
.ext-links-grid a:hover {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

/* ── Letter Section Divider ── */
.letter-section {
  padding: 12px;
}
.letter-section-title {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-red);
  padding: 10px 0 8px;
  border-top: 2px solid var(--border-color);
}
.letter-section-title::before { content: '▼ '; color: #ccc; font-size: 10px; }
.letter-section-title::after { content: ' ▼'; color: #ccc; font-size: 10px; }

/* ── Ad containers ── */
.ad-wrapper {
  padding: 0 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ══ TKG Gallery: search + grid(15/page) + pager + lightbox ══ 2026-09-05 */
.search-panel {
  margin: 8px 12px 0;
}
.search-panel input {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid #d9e2ea;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #333;
  transition: border-color 0.2s;
}
.search-panel input:focus {
  border-color: var(--brand-primary);
}
.search-hint {
  font-size: 12px;
  color: #999;
  text-align: right;
  margin-top: 5px;
  min-height: 16px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 12px 0;
}
@media (max-width: 420px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
.g-card {
  position: relative;
  background: var(--bg-white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.g-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.g-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #eceff3;
  overflow: hidden;
}
.g-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.g-thumb.bad {
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-thumb.bad::after {
  content: '图片加载失败';
  color: #bbb;
  font-size: 11px;
}
.g-cap {
  padding: 6px;
  font-size: 12px;
  color: var(--text-dark);
  text-align: center;
  background: var(--bg-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--border-color);
}
.g-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  font-style: normal;
  font-size: 10px;
  line-height: 1;
  color: #fff;
  padding: 3px 7px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff7043, #e84118);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.g-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 28px 0;
}
.g-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 14px 12px 8px;
}
.g-pager button {
  min-width: 34px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 13px;
  color: var(--brand-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.g-pager button.on {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.g-pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.94);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lightbox.show {
  display: flex;
}
.lb-img {
  max-width: 94vw;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6);
}
.lb-name {
  color: #fff;
  font-size: 14px;
  margin-top: 10px;
  max-width: 92vw;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 10px;
}
.lb-count {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  margin-top: 6px;
  min-height: 16px;
}
.lb-close {
  position: absolute;
  top: 10px;
  right: 16px;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  padding: 4px;
  opacity: 0.85;
}
.lb-close:hover { opacity: 1; }
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  z-index: 10;
}
.lb-arrow:hover { background: rgba(255, 255, 255, 0.32); }
.lb-arrow.prev { left: 10px; }
.lb-arrow.next { right: 10px; }
.lb-actions {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}
.lb-actions button {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 13px;
  cursor: pointer;
}
.lb-actions button:hover { background: rgba(255, 255, 255, 0.32); }
@media (max-width: 420px) {
  .lb-arrow { width: 34px; height: 34px; font-size: 20px; }
  .lb-arrow.prev { left: 6px; }
  .lb-arrow.next { right: 6px; }
}
