/**
 * 项目详情页样式：新版视觉（面包屑 + 左图右文 + 底部项目介绍区）
 * 小白解说：按设计图 02 走 —— 左边 55% 放大图和缩略图，右边 45% 放信息，
 * 橙色副标题、渐变主按钮、描边次按钮，底部再来一段“项目介绍”长文。
 */

html[data-theme="dark"] {
  --detail-bg: linear-gradient(180deg, rgba(18, 22, 42, 0.92) 0%, rgba(13, 17, 32, 0.96) 100%);
  --detail-shadow: 0 28px 70px rgba(2, 4, 14, 0.5);
  --tagline-hot: #f5b04e;
  --intro-figure-border: rgba(255, 255, 255, 0.12);
  --status-online: #4ade80;
  --status-dev: #fbbf24;
}

html[data-theme="light"] {
  --detail-bg: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  --detail-shadow: 0 24px 60px rgba(30, 45, 100, 0.09);
  --tagline-hot: #d98b10;
  --intro-figure-border: rgba(38, 54, 110, 0.12);
  --status-online: #16a34a;
  --status-dev: #d97706;
}

.detail-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 24px 56px;
}

.detail-shell {
  position: relative;
  padding: 26px 30px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--detail-bg);
  box-shadow: var(--detail-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: reveal-up 0.45s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ------------------------------ 面包屑 ------------------------------ */
.detail-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 12.5px;
}

.detail-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.detail-breadcrumb a:hover {
  color: var(--accent);
}

.detail-breadcrumb .icon {
  width: 13px;
  height: 13px;
  color: var(--faint);
}

.crumb-current {
  color: var(--text-strong);
  font-weight: 550;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------ 主布局：左图右文 ------------------------------ */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

/* ------------------------------ 左侧图集 ------------------------------ */
.gallery {
  min-width: 0;
}

.gallery-main {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cover-fallback);
  box-shadow: 0 18px 44px rgba(3, 6, 20, 0.32);
}

.gallery-main img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-main:hover img {
  transform: scale(1.025);
}

.gallery-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--accent);
  font-size: 12.5px;
  opacity: 0.85;
}

.gallery-placeholder .icon {
  width: 34px;
  height: 34px;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.gallery-thumb {
  position: relative;
  flex: 0 0 92px;
  width: 92px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cover-fallback);
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* 选中态：紫色描边 + 柔光，和整体蓝紫渐变呼应 */
.gallery-thumb.active {
  opacity: 1;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}

/* ------------------------------ 右侧信息 ------------------------------ */
.detail-info {
  min-width: 0;
  padding-top: 6px;
}

/* 分类标签：一条渐变竖线 + 分类名的“| 核心项目 —”式标签 */
.detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--tone, var(--accent-2));
}

.detail-badge::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #4f7dff, #8b5cf6);
}

.detail-badge::after {
  content: "—";
  color: var(--faint);
  letter-spacing: 0;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: clamp(28px, 3.2vw, 38px);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text-strong);
  word-break: break-word;
}

/* 重点项目金星 */
.detail-star {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(242, 193, 78, 0.14);
  border: 1px solid rgba(242, 193, 78, 0.4);
  color: var(--gold, #f2c14e);
}

html[data-theme="light"] .detail-star {
  color: #d9a520;
}

.detail-star .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

/* 橙色副标题 */
.detail-tagline {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--tagline-hot);
  font-weight: 550;
}

/* 标签胶囊 + 状态点 */
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.detail-meta li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--panel);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.detail-meta .icon {
  width: 13px;
  height: 13px;
  color: var(--faint);
}

/* 状态那一个胶囊：带呼吸点 */
.detail-meta li.is-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.detail-meta li.is-online {
  color: var(--status-online);
  border-color: color-mix(in srgb, var(--status-online) 35%, transparent);
  background: color-mix(in srgb, var(--status-online) 8%, transparent);
}

.detail-meta li.is-dev {
  color: var(--status-dev);
  border-color: color-mix(in srgb, var(--status-dev) 35%, transparent);
  background: color-mix(in srgb, var(--status-dev) 8%, transparent);
}

/* ------------------------------ 操作按钮 ------------------------------ */
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.action-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-btn .action-glyph {
  display: flex;
  flex-shrink: 0;
}

.action-btn .action-glyph .icon {
  width: 17px;
  height: 17px;
}

.action-btn .action-glyph .brand-svg {
  width: 17px;
  height: 17px;
}

.action-btn .action-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-arrow {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.55;
  transition: transform 0.2s ease;
}

.action-btn:hover .action-arrow {
  transform: translateX(2px);
}

.action-arrow .icon {
  width: 14px;
  height: 14px;
}

/* 主按钮：蓝紫渐变实心 + 外发光 */
.action-btn.primary {
  background: linear-gradient(135deg, #4f7dff 0%, #6d64ff 52%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(93, 100, 255, 0.35);
}

.action-btn.primary .action-arrow {
  border-color: rgba(255, 255, 255, 0.45);
  opacity: 0.9;
}

.action-btn.primary:hover {
  box-shadow: 0 16px 34px rgba(93, 100, 255, 0.45);
}

/* 次按钮：透明底描边 */
.action-btn.ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-strong);
}

.action-btn.ghost:hover {
  background: var(--panel);
  border-color: var(--accent);
}

.action-btn.ghost .brand-svg path {
  fill: currentColor;
}

/* ------------------------------ 项目介绍区 ------------------------------ */
.detail-intro {
  margin-top: 46px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}

.intro-head {
  margin-bottom: 24px;
}

.intro-eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.intro-title-line {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.intro-title-line h2 {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: 0.5px;
  color: var(--text-strong);
  white-space: nowrap;
}

.title-rule {
  width: 88px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #4f7dff, #8b5cf6 70%, transparent);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.intro-text {
  font-size: 13.5px;
  line-height: 2.05;
  color: var(--muted);
  white-space: pre-line;
  word-break: break-word;
}

.intro-figure {
  position: relative;
  min-height: 220px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--intro-figure-border);
  background: var(--cover-fallback);
  box-shadow: 0 18px 40px rgba(3, 6, 20, 0.26);
}

.intro-figure::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28), transparent 68%);
  filter: blur(6px);
  z-index: 1;
  pointer-events: none;
}

.intro-figure img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

/* ------------------------------ 加载 & 找不到 ------------------------------ */
.detail-loading {
  padding: 20px 0;
}

.loading-card {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
}

.loading-line {
  height: 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--panel), var(--panel-2), var(--panel));
  background-size: 200% 100%;
  animation: loading-shine 1.4s infinite linear;
}

.loading-line.w-40 {
  width: 40%;
}

.loading-line.w-70 {
  width: 70%;
}

@keyframes loading-shine {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 80px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--panel);
}

.detail-empty .btn {
  margin-top: 14px;
}

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 960px) {
  .detail-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .detail-shell {
    padding: 20px 22px 26px;
  }

  .detail-main {
    padding: 22px 20px 44px;
  }
}

@media (max-width: 560px) {
  .detail-main {
    padding: 16px 12px 36px;
  }

  .detail-shell {
    padding: 16px 16px 22px;
    border-radius: 20px;
  }

  .detail-actions {
    flex-direction: column;
  }

  .detail-title {
    font-size: 26px;
  }

  .gallery-thumb {
    flex-basis: 72px;
    width: 72px;
    height: 46px;
  }

  .detail-meta {
    gap: 8px;
  }
}
