header {
  padding: 20px 40px;
  gap: 20px;
  z-index: 10;
}
.logo { font-size: 1.1rem; cursor: pointer; }

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: .88rem;
  font-family: 'JetBrains Mono', monospace;
  transition: color .15s;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.back-btn:hover { color: var(--accent); }

/* ── Main layout ── */
.container {
  max-width: 860px;
  margin: 48px auto;
  padding: 0 24px 80px;
}

/* ── Hero block ── */
.hero {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 40px;
  animation: fadeUp .3s ease both;
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

.hero-cover {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #141418;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-cover .no-img {
  font-size: 4rem;
  color: var(--border);
}

.hero-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

.detail-name {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid;
}
.badge-size  { color: var(--accent);  background: rgba(200,169,110,.08); border-color: rgba(200,169,110,.25); }
.badge-date  { color: var(--muted);   background: transparent;           border-color: var(--border); }

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tag {
  font-size: .75rem;
  color: var(--accent2);
  background: var(--tag-bg);
  border-radius: 4px;
  padding: 3px 9px;
  font-family: 'JetBrains Mono', monospace;
}
a.tag { text-decoration: none; }
a.tag:hover { background: #2a3e44; }

/* ── Download button ── */
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #0e0e10;
  font-weight: 700;
  font-size: .9rem;
  padding: 11px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: opacity .15s, transform .1s;
  margin-top: 4px;
  align-self: flex-start;
  font-family: 'Noto Serif SC', serif;
}
.dl-btn:hover { opacity: .85; transform: translateY(-1px); }

/* ── Description section ── */
.section {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-top: 8px;
  animation: fadeUp .35s ease .1s both;
}
.section-title {
  font-size: .72rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.desc-text {
  font-size: .97rem;
  line-height: 2;
  color: #c8c4bc;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── Link row ── */
.link-box {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp .4s ease .15s both;
}
.link-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}
.link-url {
  font-size: .82rem;
  color: var(--accent2);
  word-break: break-all;
  flex: 1;
  text-decoration: none;
}
.link-url:hover { text-decoration: underline; }
.copy-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: .72rem;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--accent2); color: var(--accent2); }

/* ── Raw text section ── */
.raw-text-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.raw-text-content {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  line-height: 1.8;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 320px;
  overflow-y: auto;
}
.raw-text-content::-webkit-scrollbar { width: 4px; }
.raw-text-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── 相关推荐 ── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.related-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-thumb {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #141418;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-thumb .no-img { font-size: 1.4rem; color: var(--border); }
.related-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.related-name {
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.related-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  color: var(--muted);
}

/* ── Loading / error ── */
#loading {
  text-align: center;
  padding: 100px 0;
  color: var(--muted);
  font-size: .95rem;
}

/* ══════════════════════════════════════════════════════
   响应式：手机端
══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  header {
    padding: 14px 16px;
    gap: 12px;
  }
  .logo { font-size: .95rem; }
  .back-btn { font-size: .8rem; }

  .container {
    margin: 24px auto;
    padding: 0 16px 60px;
  }

  /* 封面移到顶部居中，信息在下方 */
  .hero {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    text-align: center;
  }
  .hero-cover {
    width: 160px;
    height: 160px;
  }
  .hero-info {
    width: 100%;
    align-items: center;
  }
  .detail-name {
    font-size: 1.1rem;
    text-align: center;
  }
  .meta-row {
    justify-content: center;
  }
  .tags-row {
    justify-content: center;
  }
  .dl-btn {
    align-self: center;
    width: 100%;
    justify-content: center;
    padding: 13px 16px;
    font-size: .95rem;
  }

  .section { padding-top: 20px; }
  .desc-text { font-size: .9rem; line-height: 1.9; }

  .link-box {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
  }
  .link-url { flex: 1 1 100%; font-size: .78rem; }
  .copy-btn { width: 100%; text-align: center; padding: 8px; }
}
