/* ============================================================
   hexo-theme-insta · Instagram 风格
   字体层级 / 留白 / 圆角均对标 Instagram 网页版
   ============================================================ */
:root {
  --bg: #fafafa;
  --card: #ffffff;
  --text: #262626;
  --text-2: #737373;
  --text-3: #a8a8a8;
  --border: #dbdbdb;
  --link: #00376b;
  --blue: #0095f6;
  --blue-dark: #1877f2;
  --stage: #0d0d0d;
  --nav-h: 60px;
  --feed-w: 470px;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] {
  --bg: #000000;
  --card: #0a0a0a;
  --text: #f5f5f5;
  --text-2: #a8a8a8;
  --text-3: #6e6e6e;
  --border: #363636;
  --link: #e0f1ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.25s ease, color 0.25s ease;
}
img { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: rgba(0, 149, 246, 0.25); }

/* ---------- 顶部导航 ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: 975px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-icon svg { width: 28px; height: 28px; display: block; }
.brand-name {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.topnav-actions { display: flex; align-items: center; gap: 6px; }
/* 导航栏搜索（Instagram 式居中搜索框） */
.nav-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  margin: 0 8px;
}
.nav-search-btn {
  display: inline-flex;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--text-3);
}
.nav-search-btn svg { width: 16px; height: 16px; display: block; }
.nav-search input {
  border: 0;
  background: transparent;
  outline: 0;
  font-size: 14px;
  width: 170px;
  color: var(--text);
}
.nav-search input::placeholder { color: var(--text-3); }
.nav-search input::-webkit-search-cancel-button { cursor: pointer; }
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text);
  transition: background 0.15s ease, transform 0.15s ease;
}
.nav-icon:hover { background: rgba(128, 128, 128, 0.12); }
.nav-icon:active { transform: scale(0.92); }
.nav-icon svg { width: 24px; height: 24px; display: block; }
.nav-icon.active { color: var(--text); }
.nav-icon.active svg { stroke-width: 2.6; }
.theme-toggle .ic-moon { display: none; }
[data-theme="dark"] .theme-toggle .ic-sun { display: none; }
[data-theme="dark"] .theme-toggle .ic-moon { display: block; }

/* ---------- 主体 ---------- */
.main {
  max-width: 975px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  min-height: calc(100vh - var(--nav-h) - 80px);
}

/* ---------- 信息流 ---------- */
.feed {
  max-width: var(--feed-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.card-head-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.username { font-weight: 600; font-size: 13.5px; }
.location { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.location { text-decoration: none; }
a.location:hover { text-decoration: underline; }
.card-more {
  margin-left: auto;
  color: var(--text);
  padding: 6px;
  border-radius: 50%;
  display: inline-flex;
}
.card-more:hover { background: rgba(128, 128, 128, 0.12); }
.card-more svg { width: 20px; height: 20px; display: block; }

.card-media { position: relative; background: var(--stage); }
.card-link { display: block; position: relative; }
.card-media img { width: 100%; height: auto; display: block; }
.media-placeholder {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  background: var(--bg);
}
.media-placeholder svg { width: 48px; height: 48px; }
.media-placeholder.large svg { width: 72px; height: 72px; }
.album-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
  display: inline-flex;
}
.album-badge svg { width: 22px; height: 22px; display: block; }

.card-body { padding: 12px 14px 14px; }
.caption { font-size: 14px; margin-bottom: 8px; word-break: break-word; }
.caption .username { margin-right: 6px; }
.more-link { color: var(--link); }
.more-link:hover { text-decoration: underline; }

/* 正文按钮（{% btn %}）：普通超链接样式不受影响 */
.content-btn { display: inline-block; padding: 7px 18px; margin: 6px 8px 6px 0; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1.4; text-decoration: none; }
.content-btn:hover { filter: brightness(0.95); text-decoration: none; }
.content-btn.btn-blue { background: #e3f0fd; color: #1565c0; }
.content-btn.btn-green { background: #e0f2e3; color: #1e7e34; }
.content-btn.btn-pink { background: #fce4ec; color: #c2185b; }
.content-btn.btn-orange { background: #fff0e0; color: #b26a00; }
.content-btn.btn-purple { background: #ede7f6; color: #5e35b1; }
.content-btn.btn-gray { background: #f0f0f0; color: #616161; }
.content-btn svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--text-3); }
.meta-time { color: var(--text-3); }
.meta-time:hover { text-decoration: underline; }
.meta-tags a { color: var(--link); font-weight: 500; }
.meta-tags a:hover { text-decoration: underline; }

/* 无限滚动 */
.feed-sentinel { height: 1px; }
.feed-loading { text-align: center; padding: 24px 0; }
.spinner {
  display: inline-block;
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--text-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.feed-end { text-align: center; color: var(--text-3); font-size: 13px; padding: 24px 0; }

/* ---------- 轮播 ---------- */
.carousel { position: relative; overflow: hidden; background: var(--stage); }
.carousel-track { display: flex; transition: transform 0.35s ease; }
.carousel-slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
.carousel-slide img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #262626;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 2;
}
.carousel:hover .carousel-btn { opacity: 1; }
.carousel-btn:hover { transform: translateY(-50%) scale(1.08); }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel-btn svg { width: 20px; height: 20px; }
.carousel-btn[hidden] { display: none; }
.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 2;
}
.carousel-dots .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: background 0.2s ease;
}
.carousel-dots .dot.active { background: #fff; }
.carousel-counter {
  position: absolute;
  top: 12px;
  right: 14px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  z-index: 2;
}
@media (hover: none) {
  .carousel-btn { opacity: 1; }
}

/* ---------- 作品详情 ---------- */
.detail {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 935px;
  margin: 0 auto;
}
.detail-media {
  flex: 1 1 0;
  min-width: 0;
  background: var(--stage);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-media .carousel { width: 100%; align-self: stretch; }
.detail-media .carousel-slide { min-height: 420px; }
.detail-img { max-width: 100%; max-height: 85vh; object-fit: contain; display: block; }
.lightbox-open {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #262626;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
}
.detail-media:hover .lightbox-open { opacity: 1; }
.lightbox-open svg { width: 18px; height: 18px; }
@media (hover: none) { .lightbox-open { opacity: 1; } }

.detail-side {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 85vh;
  overflow-y: auto;
}
.detail-head { padding: 0; }
.detail-title { font-size: 18px; font-weight: 700; line-height: 1.35; }
.detail-caption { font-size: 14px; word-break: break-word; }
.detail-caption .username { margin-right: 6px; }
.detail-content { font-size: 14px; color: var(--text); word-break: break-word; }
.detail-content img { border-radius: 6px; margin: 8px 0; }
.detail-meta { font-size: 12.5px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 4px 10px; }

.exif { border-top: 1px solid var(--border); padding-top: 12px; }
.exif h3 { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.6px; }
.exif-idx { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-3); }
.exif-list { display: flex; flex-direction: column; }
.exif-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.exif-row:last-child { border-bottom: none; }
.exif-row dt { color: var(--text-2); flex-shrink: 0; }
.exif-row dd { text-align: right; font-weight: 500; word-break: break-word; }

.detail-actions { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center; }
.detail-actions .content-btn { margin: 0; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--blue);
  color: #fff !important;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: var(--radius);
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary svg { width: 18px; height: 18px; }
.download-note { font-size: 12px; color: var(--text-3); text-align: center; }

/* ---------- 相关推荐 ---------- */
.related {
  max-width: 935px;
  margin: 28px auto 0;
}
.related h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-2);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lightbox.show { opacity: 1; }
.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}
.lightbox-close {
  position: absolute;
  top: 18px; right: 22px;
  color: #fff;
  padding: 8px;
  border-radius: 50%;
  display: inline-flex;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.15); }
.lightbox-close svg { width: 26px; height: 26px; }
.lightbox .carousel-btn { opacity: 1; }
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  color: #fff;
  font-size: 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

/* ---------- 发现 / 浏览页 ---------- */
.browse-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.browse-intro { color: var(--text-2); margin-bottom: 18px; font-size: 14px; }
.filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 22px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-group { display: flex; align-items: baseline; gap: 12px; }
.filter-label {
  flex-shrink: 0;
  width: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--text-3); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.filters-reset {
  align-self: flex-start;
  font-size: 13px;
  color: var(--blue);
  font-weight: 600;
}
.filters-reset:hover { text-decoration: underline; }

.browse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.grid-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--stage);
  display: block;
}
.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  font-size: 13px;
  font-weight: 600;
}
.grid-item:hover .grid-overlay { opacity: 1; }
.grid-item:hover img { transform: scale(1.04); }
.grid-overlay .g-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.grid-overlay .g-meta { font-weight: 400; font-size: 12px; opacity: 0.9; }
/* 详情页图片悬停 caption（底部渐变条，不遮挡操作按钮） */
.detail-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 16px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.detail-media:hover .detail-overlay { opacity: 1; }
.detail-overlay .g-title {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.grid-item .album-badge { top: 8px; right: 8px; }
.grid-item .album-badge svg { width: 20px; height: 20px; }
.browse-empty { text-align: center; color: var(--text-3); padding: 48px 0; }
/* 发现页搜索框 */
.browse-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
}
.browse-search-icon { display: inline-flex; color: var(--text-3); flex: none; }
.browse-search-icon svg { width: 18px; height: 18px; display: block; }
.browse-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: 0;
  font-size: 15px;
  color: var(--text);
}
.browse-search input::placeholder { color: var(--text-3); }

/* ---------- 列表页 / 归档 / 静态页 ---------- */
.list-title { font-size: 22px; font-weight: 700; max-width: var(--feed-w); margin: 0 auto 20px; }
.archive { max-width: 640px; margin: 0 auto; }
.archive-year h2 { font-size: 18px; margin: 22px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.archive-list { list-style: none; }
.archive-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.archive-list time { color: var(--text-3); font-size: 12.5px; flex-shrink: 0; width: 48px; }
.archive-list a { color: var(--text); font-weight: 500; }
.archive-list a:hover { text-decoration: underline; }
.archive-loc { margin-left: auto; color: var(--text-3); font-size: 12.5px; }
.static-page { max-width: 640px; margin: 0 auto; }
.page-title { font-size: 24px; margin-bottom: 16px; }
.page-content { font-size: 15px; line-height: 1.75; }
.page-content p { margin-bottom: 1em; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner {
  max-width: 975px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-3);
}
.footer-dot { opacity: 0.6; }

/* ---------- 响应式 ---------- */
@media (max-width: 935px) {
  .detail { flex-direction: column; }
  .detail-side {
    width: auto;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: none;
  }
  .detail-media .carousel-slide { min-height: 300px; }
}
@media (max-width: 735px) {
  .main { padding: 0 0 40px; }
  .feed { gap: 0; max-width: none; }
  .post-card { border: none; border-radius: 0; border-bottom: 1px solid var(--border); box-shadow: none; }
  .detail { border: none; border-radius: 0; }
  .browse { padding: 16px 12px 0; }
  .list-title { padding: 16px 16px 0; }
  .archive, .static-page { padding: 0 16px; }
  .topnav-inner { padding: 0 12px; }
  .brand-name { font-size: 17px; }
  .nav-search { margin: 0 4px; padding: 5px 8px; }
  .nav-search input { display: none; }
  .nav-search-btn svg { width: 20px; height: 20px; }
  .browse-grid { gap: 3px; }
  .related { padding: 0 12px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .feed-end { padding: 20px 0; }
}
