/* =========================================================
   Starvault V6 · 预览悬浮栏、点赞、主页页签与历史导航
   ========================================================= */

.history-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.history-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}

.history-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-strong);
  color: var(--ink);
}

.auth-history-nav {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 120;
  padding: 3px;
  border: 1px solid var(--glass-border);
  border-radius: 13px;
  background: var(--glass-strong);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-history-nav .history-button {
  border-color: transparent;
  background: transparent;
}

.share-header .history-nav {
  margin-right: 2px;
}

/* ---- 主页页签 ---- */
.profile-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 8px;
  border-bottom: 1px solid var(--border);
}

.profile-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.profile-tab:hover {
  color: var(--ink);
}

.profile-tab.is-active {
  border-color: var(--primary);
  color: var(--ink);
}

.profile-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
}

.profile-tab.is-active span {
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.profile-tab-meta {
  margin: 0 2px 12px;
  color: var(--muted);
  font-size: 11px;
}

.author-works-panel #authorWorks .feed-author {
  display: none;
}

.author-works-panel #authorWorks .feed-foot {
  justify-content: flex-end;
}

.author-works-panel #authorLikes .feed-author {
  display: flex;
}

.author-works-panel #authorLikes .feed-foot {
  justify-content: space-between;
}

/* ---- 点赞 ---- */
.feed-stats {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.feed-like,
.like-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

.feed-like {
  padding: 0;
}

.feed-like svg {
  width: 12px;
  height: 12px;
}

.feed-like:hover,
.like-button:hover {
  color: var(--danger);
}

.feed-like.is-liked,
.like-button.is-liked {
  color: var(--danger);
}

.feed-like.is-liked svg,
.like-button.is-liked svg {
  fill: currentColor;
}

.like-button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 10.5px;
}

.like-button svg {
  width: 14px;
  height: 14px;
}

.like-button.is-liked {
  border-color: color-mix(in srgb, var(--danger) 26%, transparent);
  background: var(--danger-soft);
}

.detail-like-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.detail-like-row .work-meta {
  margin: 0;
}

/* ---- 照片预览：原比例铺满 + 右下悬浮标题栏 ---- */
.detail-dialog .detail-content {
  display: block;
  grid-template-columns: none;
  max-height: 92vh;
  overflow: auto;
  background: var(--surface-solid);
}

.detail-dialog .detail-media {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  max-height: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.detail-dialog .detail-media img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  margin: 0;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
}

.detail-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 54px 20px 16px;
  background: linear-gradient(to top, rgba(7, 12, 10, .72), rgba(7, 12, 10, 0) 72%);
  color: #fff;
  pointer-events: none;
}

.detail-caption h2 {
  max-width: 78%;
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.28;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .55);
  pointer-events: auto;
}

.detail-expand {
  flex: 0 0 auto;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
  pointer-events: auto;
}

.detail-expand:hover {
  text-decoration: underline;
}

.detail-panel {
  border-top: 1px solid var(--border);
}

.detail-panel[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .history-button {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }

  .detail-dialog .detail-media img {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .profile-tab {
    padding: 7px 8px 9px;
    font-size: 11px;
  }

  .detail-caption {
    padding: 38px 14px 12px;
  }

  .detail-caption h2 {
    font-size: 17px;
  }

  .detail-expand {
    font-size: 11px;
  }

  .auth-history-nav {
    top: 12px;
    left: 12px;
  }
}

.feed-stats .feed-like {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

@media (max-width: 480px) {
  .header-top .brand-copy {
    display: none;
  }

  .header-top .brand {
    gap: 0;
  }

  .history-button {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .header-tools {
    gap: 4px;
  }

  .user-copy strong {
    max-width: 46px;
  }
}
