/* 详情页专用样式 */

/* ── Hero ─────────────────────────────────────── */
/* 与主页 hero-carousel 一致：整屏高度 + 最小高度，便于与轮播区裁切方式统一 */
.detail-hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--bg-card);
}

.detail-hero-img-wrap {
  position: absolute;
  inset: 0;
}

.detail-hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.6s var(--ease-out);
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(20, 18, 14, 0.92) 0%,
    rgba(20, 18, 14, 0.5) 45%,
    rgba(20, 18, 14, 0.1) 100%
  );
}

.detail-hero-body {
  position: relative;
  z-index: 1;
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 5vw, 4rem) clamp(2rem, 5vw, 3.5rem);
  max-width: 54rem;
  width: 100%;
  animation: fade-up 0.9s var(--ease-out) both;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(247, 245, 240, 0.6);
  margin-bottom: 0.85rem;
  letter-spacing: 0.04em;
}

.detail-breadcrumb a {
  color: rgba(247, 245, 240, 0.65);
  text-decoration: none;
  transition: color 0.2s;
}

.detail-breadcrumb a:hover {
  color: rgba(247, 245, 240, 0.95);
}

.detail-title {
  margin: 0 0 0.6rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: #f7f5f0;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-era {
  font-size: 0.85rem;
  color: rgba(247, 245, 240, 0.7);
  font-style: italic;
}

.detail-world-badge {
  padding: 0.2rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(212, 168, 75, 0.25);
  border: 1px solid rgba(212, 168, 75, 0.5);
  border-radius: 999px;
  color: var(--gold);
}

.detail-intro {
  margin: 0 0 1rem;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  color: rgba(247, 245, 240, 0.82);
  line-height: 1.7;
  max-width: 40em;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.detail-tags span {
  padding: 0.28rem 0.7rem;
  font-size: 0.75rem;
  background: rgba(247, 245, 240, 0.12);
  border: 1px solid rgba(247, 245, 240, 0.2);
  border-radius: 999px;
  color: rgba(247, 245, 240, 0.75);
}

/* ── 操作工具栏 ─────────────────────────────────── */
.detail-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem clamp(1.5rem, 5vw, 4rem);
  background: var(--bg-card);
  border-bottom: 1px solid rgba(26, 26, 26, 0.06);
  position: sticky;
  top: var(--header-h);
  z-index: 8;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg-paper);
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.toolbar-btn:hover {
  background: var(--bg-paper);
  border-color: rgba(26, 26, 26, 0.22);
}

.toolbar-fav.is-fav {
  color: var(--c-palace);
  border-color: rgba(194, 58, 43, 0.3);
  background: rgba(194, 58, 43, 0.06);
}

.toolbar-icon {
  font-size: 1rem;
  line-height: 1;
}

.toolbar-label {
  font-weight: 500;
}

/* ── 内容主体 ─────────────────────────────────── */
.detail-body {
  max-width: 54rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
  display: grid;
  gap: 3rem;
}

.detail-section-head {
  margin-bottom: 1.75rem;
}

.detail-section-head h2 {
  margin: 0 0 0.4rem;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  letter-spacing: 0.05em;
}

.detail-region {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0;
}

/* ── 详细介绍 ─────────────────────────────────── */
.detail-desc-list {
  display: grid;
  gap: 1.5rem;
}

.desc-block {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  border: 1px solid rgba(26, 26, 26, 0.05);
  box-shadow: 0 2px 12px rgba(26, 26, 26, 0.04);
  animation: fade-up 0.6s var(--ease-out) both;
}

.desc-block:nth-child(1) { animation-delay: 0.05s; }
.desc-block:nth-child(2) { animation-delay: 0.13s; }
.desc-block:nth-child(3) { animation-delay: 0.21s; }

.desc-block h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.desc-block p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.78;
}

/* ── 构件解析 ─────────────────────────────────── */
.detail-structure-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: clamp(2rem, 5vw, 3rem);
  border: 1px solid rgba(26, 26, 26, 0.05);
}

.detail-section-title-alone {
  margin: 0 0 1.75rem;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  letter-spacing: 0.05em;
  text-align: center;
}

.struct-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}

.struct-card {
  background: var(--bg-paper);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  border-left: 3px solid var(--ink-muted);
  transition: border-color 0.2s, transform 0.2s;
  cursor: default;
}

.struct-card:hover {
  border-left-color: var(--gold);
  transform: translateX(4px);
}

.struct-card dt {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.struct-card dd {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.65;
}

.struct-card .struct-meaning {
  font-size: 0.85rem;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.struct-card .struct-detail {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ── 历史故事 ─────────────────────────────────── */
.detail-history-section {
  padding: 0;
}

.history-card {
  background: linear-gradient(135deg, rgba(194, 58, 43, 0.05), rgba(212, 168, 75, 0.05));
  border-radius: 16px;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border: 1px solid rgba(194, 58, 43, 0.12);
}

.history-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.history-icon {
  font-size: 1.1rem;
  color: var(--c-palace);
}

.history-card-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  letter-spacing: 0.05em;
}

.history-text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.8;
}

/* ── 相关案例 ─────────────────────────────────── */
.detail-related {
  padding-bottom: 2rem;
}

.detail-related h2 {
  margin: 0 0 1.25rem;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  letter-spacing: 0.05em;
  text-align: center;
}

.related-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid rgba(26, 26, 26, 0.06);
  text-decoration: none;
  color: var(--ink);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.related-card:hover {
  background: var(--bg-paper);
  border-color: rgba(26, 26, 26, 0.14);
  transform: translateX(4px);
}

.related-img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-paper);
}

.related-info {
  flex: 1;
  min-width: 0;
}

.related-name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 0.15rem;
}

.related-arrow {
  color: var(--ink-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.related-card:hover .related-arrow {
  transform: translateX(3px);
  color: var(--ink);
}

/* ── 响应式 ─────────────────────────────────── */
@media (min-width: 640px) {
  .struct-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .site-nav {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  .mobile-nav {
    display: none !important;
  }
}

@media (min-width: 1100px) {
  .detail-body {
    max-width: 60rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-hero-body,
  .desc-block,
  .struct-card,
  .related-card .related-arrow {
    animation: none !important;
    transition: none !important;
  }

  .desc-block:hover,
  .struct-card:hover,
  .related-card:hover {
    transform: none;
  }
}
