﻿/*
Theme Name: CX-MINI 图片主题
Theme URI: https://example.com/cx-mini
Description: 简洁的图片/写真展示主题，瀑布流布局，支持多图灯箱
Version: 1.0
Author: AI Generated
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cx-mini
*/

/* =Reset
-------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f0f13;
  color: #e0e0e0;
  line-height: 1.7;
  min-height: 100vh;
}
a { color: #f0a500; text-decoration: none; transition: color .2s; }
a:hover { color: #ffd166; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* =Layout
-------------------------------------------------------------- */
.site-wrap { max-width: 1400px; margin: 0 auto; padding: 0 16px; }

/* =Header
-------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(15,15,19,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 20px;
}
.site-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f0a500;
  letter-spacing: .05em;
  white-space: nowrap;
}
.site-logo:hover { color: #ffd166; }

/* Nav */
.main-nav { flex: 1; }
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.main-nav li { position: relative; }
.main-nav a {
  display: block;
  padding: 6px 12px;
  font-size: .9rem;
  color: #b0b0b0;
  border-radius: 6px;
  transition: all .2s;
}
.main-nav a:hover,
.main-nav .current-menu-item a,
.main-nav .current-menu-parent a {
  color: #f0a500;
  background: rgba(240,165,0,.1);
}

/* Dropdown */
.main-nav li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #1a1a24;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  padding: 6px;
  z-index: 1000;
}
.main-nav li:hover > ul { display: block; }
.main-nav li ul a { padding: 8px 14px; border-radius: 4px; }
.main-nav li ul a:hover { background: rgba(240,165,0,.12); }

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #e0e0e0;
  border-radius: 2px;
  transition: all .3s;
}

/* =Hot Tags Bar
-------------------------------------------------------------- */
.hot-bar {
  background: #14141c;
  border-bottom: 1px solid rgba(255,255,255,.04);
  padding: 10px 0;
  overflow: hidden;
}
.hot-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.hot-bar-inner::-webkit-scrollbar { display: none; }
.hot-bar-label {
  font-size: .75rem;
  color: #f0a500;
  font-weight: 700;
  white-space: nowrap;
  padding: 2px 8px;
  background: rgba(240,165,0,.12);
  border-radius: 4px;
  border: 1px solid rgba(240,165,0,.2);
}
.hot-bar a {
  font-size: .8rem;
  color: #888;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.06);
  transition: all .2s;
}
.hot-bar a:hover {
  color: #f0a500;
  border-color: rgba(240,165,0,.3);
  background: rgba(240,165,0,.06);
}

/* =Content Layout
-------------------------------------------------------------- */
.content-area {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  padding: 24px 0;
}
.content-area.no-sidebar { grid-template-columns: 1fr; }

/* =Page Title
-------------------------------------------------------------- */
.page-header {
  background: #14141c;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,.05);
}
.page-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f0a500;
}
.page-header .term-desc {
  font-size: .85rem;
  color: #777;
  margin-top: 4px;
}

/* =Image Grid (Masonry-like)
-------------------------------------------------------------- */
.img-grid {
  columns: 4;
  column-gap: 14px;
}
.img-grid .grid-item {
  break-inside: avoid;
  margin-bottom: 14px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #1c1c26;
  border: 1px solid rgba(255,255,255,.05);
  transition: transform .25s, box-shadow .25s;
  cursor: pointer;
}
.img-grid .grid-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  border-color: rgba(240,165,0,.2);
}
.img-grid .grid-item img {
  width: 100%;
  display: block;
  transition: transform .4s;
}
.img-grid .grid-item:hover img { transform: scale(1.04); }

/* Card overlay */
.img-grid .card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 12px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  opacity: 0;
  transition: opacity .25s;
}
.img-grid .grid-item:hover .card-overlay { opacity: 1; }
.img-grid .card-overlay .card-title {
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.img-grid .card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: .72rem;
  color: #aaa;
}
.img-grid .card-meta svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  vertical-align: middle;
}

/* Tag badge on card */
.img-grid .card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: .68rem;
  padding: 2px 8px;
  background: rgba(240,165,0,.85);
  color: #000;
  font-weight: 700;
  border-radius: 4px;
}

/* VIP badge */
.img-grid .card-vip {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: .65rem;
  padding: 2px 7px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  font-weight: 700;
  border-radius: 4px;
}

/* =Pagination
-------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 30px 0;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-size: .9rem;
  color: #888;
  background: #1a1a24;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  transition: all .2s;
}
.pagination a:hover {
  color: #f0a500;
  border-color: rgba(240,165,0,.3);
  background: rgba(240,165,0,.08);
}
.pagination .current,
.pagination .page-numbers.current {
  color: #000;
  background: #f0a500;
  border-color: #f0a500;
  font-weight: 700;
}
.pagination .dots {
  background: none;
  border: none;
  color: #555;
  cursor: default;
}

/* =Sidebar
-------------------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-widget {
  background: #14141c;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 12px;
  overflow: hidden;
}
.sidebar-widget-title {
  padding: 14px 16px;
  font-size: .9rem;
  font-weight: 700;
  color: #f0a500;
  border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar-widget-title svg { width: 14px; height: 14px; fill: #f0a500; }
.sidebar-widget-body { padding: 12px; }

/* Rank list */
.rank-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  transition: background .2s;
}
.rank-list li:hover { background: rgba(255,255,255,.04); }
.rank-list .rank-num {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(240,165,0,.12);
  color: #f0a500;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rank-list .rank-num.top3 { background: rgba(240,165,0,.25); }
.rank-list .rank-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.rank-list .rank-info { flex: 1; min-width: 0; }
.rank-list .rank-title {
  font-size: .82rem;
  font-weight: 600;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-list .rank-views {
  font-size: .72rem;
  color: #666;
  margin-top: 2px;
}

/* =Single Post
-------------------------------------------------------------- */
.single-header {
  padding: 30px 0 20px;
}
.single-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.4;
}
.single-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .82rem;
  color: #666;
  flex-wrap: wrap;
}
.single-meta span { display: flex; align-items: center; gap: 4px; }
.single-meta svg { width: 13px; height: 13px; fill: currentColor; }
.single-meta .tag { color: #f0a500; }

/* Gallery */
.gallery-wrap { margin-top: 20px; }
.gallery-item {
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
  background: #1c1c26;
  cursor: zoom-in;
  border: 1px solid rgba(255,255,255,.05);
}
.gallery-item img {
  width: 100%;
  transition: transform .3s;
}
.gallery-item:hover img { transform: scale(1.02); }

/* Post pagination (prev/next) */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 30px;
}
.post-nav a {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  background: #14141c;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  transition: all .2s;
  font-size: .85rem;
  color: #888;
}
.post-nav a:hover { border-color: rgba(240,165,0,.2); color: #f0a500; }
.post-nav .post-nav-label { font-size: .72rem; color: #555; margin-bottom: 4px; }
.post-nav .post-nav-title { font-weight: 600; color: #ccc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-nav a:hover .post-nav-title { color: #f0a500; }
.post-nav .next-post { text-align: right; }

/* =Footer
-------------------------------------------------------------- */
.site-footer {
  background: #0a0a10;
  border-top: 1px solid rgba(255,255,255,.05);
  padding: 30px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .8rem;
  color: #444;
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: #555; }
.footer-links a:hover { color: #f0a500; }

/* =Loading / Infinite Scroll
-------------------------------------------------------------- */
.load-more-wrap { text-align: center; padding: 20px 0 30px; }
.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: rgba(240,165,0,.1);
  color: #f0a500;
  border: 1px solid rgba(240,165,0,.25);
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}
.load-more-btn:hover {
  background: rgba(240,165,0,.2);
  border-color: rgba(240,165,0,.5);
  color: #ffd166;
}
.loading-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(240,165,0,.3);
  border-top-color: #f0a500;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-more-btn.loading .loading-spinner { display: inline-block; }
.load-more-btn.loading .btn-text { opacity: .6; }

/* =Lightbox
-------------------------------------------------------------- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.95);
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s;
  user-select: none;
}
.lightbox-nav:hover { background: rgba(255,255,255,.2); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.6);
  font-size: .85rem;
}

/* =Responsive
-------------------------------------------------------------- */
@media (max-width: 1200px) {
  .img-grid { columns: 3; }
}
@media (max-width: 900px) {
  .content-area { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .img-grid { columns: 3; }
}
@media (max-width: 640px) {
  .img-grid { columns: 2; column-gap: 10px; }
  .img-grid .grid-item { margin-bottom: 10px; }
  .site-logo { font-size: 1.1rem; }
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .post-nav { grid-template-columns: 1fr; }
  .single-header h1 { font-size: 1.2rem; }
  .page-header { padding: 14px 16px; }
}
@media (max-width: 400px) {
  .img-grid { columns: 1; }
}

/* =Utility
-------------------------------------------------------------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.mt20 { margin-top: 20px; }
.mb20 { margin-bottom: 20px; }

/* Mobile nav open */
.main-nav.mobile-open { display: block; position: absolute; top: 60px; left: 0; right: 0; background: #14141c; border-bottom: 1px solid rgba(255,255,255,.06); padding: 10px; z-index: 998; }
.main-nav.mobile-open ul { flex-direction: column; }
.main-nav.mobile-open a { padding: 10px 14px; }
.main-nav.mobile-open li ul { position: static; box-shadow: none; border: none; background: rgba(255,255,255,.03); margin-top: 4px; }

/* =Icons (inline SVG via CSS)
-------------------------------------------------------------- */
.icon { display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 12px; vertical-align: middle; }
.icon-eye::before    { content: ''; display: block; width: 12px; height: 12px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center/contain no-repeat; }
.icon-heart::before  { content: ''; display: block; width: 12px; height: 12px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center/contain no-repeat; }
.icon-comment::before { content: ''; display: block; width: 12px; height: 12px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4-.01-18z'/%3E%3C/svg%3E") center/contain no-repeat; }
.icon-crown::before  { content: ''; display: block; width: 14px; height: 14px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm14 3c0 .6-.4 1-1 1H6c-.6 0-1-.4-1-1v-1h14v1z'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm14 3c0 .6-.4 1-1 1H6c-.6 0-1-.4-1-1v-1h14v1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.icon-tag::before    { content: ''; display: block; width: 12px; height: 12px; background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 01-1.41.59H2a2 2 0 01-2-2V6a2 2 0 01.59-1.41l7.17-7.17a2 2 0 012.82 0l5.66 5.66a2 2 0 010 2.82z'/%3E%3Cline x1='8' y1='13' x2='14' y2='13'/%3E%3C/svg%3E") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 01-1.41.59H2a2 2 0 01-2-2V6a2 2 0 01.59-1.41l7.17-7.17a2 2 0 012.82 0l5.66 5.66a2 2 0 010 2.82z'/%3E%3Cline x1='8' y1='13' x2='14' y2='13'/%3E%3C/svg%3E") center/contain no-repeat; }