/* ============================================================
   CiCC Platform v4.0.0 — SINGLE POST (VIP PRO UI/UX)
   Glassmorphism · AI gradient · 3D hover · animated SVG · counters
   Target: "wow" on every device/OS. Cross-link 4-site block.
   ============================================================ */

/* === HERO — animated AI mesh background === */
.post-single .page-header {
  position: relative;
  padding: calc(var(--header-height, 80px) + 72px) 0 64px;
  background:
    radial-gradient(1200px 600px at 15% 0%, rgba(124,58,237,.35), transparent 60%),
    radial-gradient(1000px 500px at 85% 10%, rgba(59,130,246,.35), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #1e3a8a 100%);
  color: #fff;
  text-align: center;
  overflow: hidden;
}
/* animated floating orb layer */
.post-single .page-header::before {
  content: "";
  position: absolute; inset: -40% -10% auto -10%;
  height: 80%;
  background:
    radial-gradient(closest-side, rgba(168,85,247,.25), transparent) 20% 30%/40% 60% no-repeat,
    radial-gradient(closest-side, rgba(59,130,246,.22), transparent) 70% 20%/50% 70% no-repeat;
  animation: heroFloat 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes heroFloat { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-3%,2%,0) scale(1.08); } }

.post-single .page-header .section-tag {
  position: relative; z-index: 2;
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 6px 16px; border-radius: 999px;
  font-size: 13px; letter-spacing: .14em; font-weight: 600;
}
.post-single .page-header h1 {
  position: relative; z-index: 2;
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 800; color: #fff; margin: 18px auto 14px;
  max-width: 860px; line-height: 1.18;
  text-shadow: 0 4px 24px rgba(0,0,0,.45);
  animation: fadeInUp .7s ease both;
}
.post-single .meta-bar {
  position: relative; z-index: 2;
  display: flex; justify-content: center; align-items: center; gap: 16px;
  color: rgba(255,255,255,.85); font-size: 14px; flex-wrap: wrap; margin: 0;
  animation: fadeInUp .9s ease both;
}
.post-single .meta-bar time { display: inline-flex; align-items: center; gap: 6px; }
.post-single .meta-bar .cat-badge {
  background: rgba(255,255,255,.16); color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  padding: 4px 14px; border-radius: 999px; backdrop-filter: blur(6px);
}

/* === LAYOUT: TOC + CONTENT === */
.post-single .section { padding: clamp(40px, 5vw, 72px) 0; }
.post-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* === TOC sticky glass === */
.post-toc {
  position: sticky; top: calc(var(--header-height, 80px) + 24px);
  align-self: start;
}
.post-toc nav {
  background: rgba(30,41,59,.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 18px; padding: 22px;
  box-shadow: 0 20px 40px -24px rgba(0,0,0,.5);
}
.post-toc nav h4 {
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-primary); margin: 0 0 14px;
}
.post-toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.post-toc a {
  font-size: 13.5px; color: var(--text-secondary); text-decoration: none;
  padding: 7px 12px; border-radius: 10px; display: block;
  border-left: 2px solid transparent;
  transition: all .25s ease;
}
.post-toc a:hover { color: var(--primary-light); background: rgba(59,130,246,.10); }
.post-toc a.active {
  color: #fff; background: linear-gradient(90deg, rgba(124,58,237,.32), rgba(59,130,246,.18));
  border-left-color: var(--color-ai-light, #a855f7); font-weight: 600;
}

/* === CONTENT flow === */
.post-content {
  max-width: 780px; margin: 0 auto;
  font-size: 17px; line-height: 1.85; color: var(--text-secondary);
}
.post-content > *:first-child { margin-top: 0; }
.post-content h2 {
  font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; color: var(--text-primary);
  margin: 44px 0 18px; line-height: 1.3;
  scroll-margin-top: calc(var(--header-height, 80px) + 24px);
}
.post-content h2::after {
  content: ""; display: block; width: 56px; height: 4px; margin-top: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
}
.post-content h3 {
  font-size: clamp(18px, 2.1vw, 22px); font-weight: 700; color: var(--text-primary);
  margin: 32px 0 14px; scroll-margin-top: calc(var(--header-height, 80px) + 24px);
}
.post-content h4 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin: 24px 0 12px; }
.post-content p { margin-bottom: 20px; }
.post-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(59,130,246,.4); }
.post-content a:hover { color: var(--primary-light); text-decoration-color: var(--primary-light); }
.post-content ul, .post-content ol { padding-left: 26px; margin: 16px 0 20px; }
.post-content li { margin-bottom: 10px; line-height: 1.8; }
.post-content ul li::marker { color: var(--color-ai-light, #a855f7); }
.post-content blockquote {
  border-left: 4px solid var(--color-ai, #7c3aed); margin: 28px 0; padding: 20px 24px;
  background: rgba(124,58,237,.08); border-radius: 0 14px 14px 0; font-style: italic;
  color: var(--text-primary);
}
.post-content img {
  width: 100%; height: auto; border-radius: 16px; margin: 28px 0;
  box-shadow: 0 24px 48px -24px rgba(0,0,0,.5);
}
.post-content table {
  width: 100%; border-collapse: collapse; margin: 28px 0; font-size: 15px;
  border-radius: 14px; overflow: hidden; box-shadow: 0 12px 30px -18px rgba(0,0,0,.5);
}
.post-content th { background: linear-gradient(135deg, #1e1b4b, #1e3a8a); color: #fff; padding: 14px 16px; text-align: left; font-weight: 700; }
.post-content td { padding: 13px 16px; border-top: 1px solid var(--border-color); }
.post-content tbody tr:nth-child(even) { background: rgba(148,163,184,.06); }

/* === CROSS-LINK 4 SITE === */
.post-crosslink { padding: clamp(48px, 6vw, 80px) 0; }
.crosslink-head { text-align: center; margin-bottom: 36px; }
.crosslink-head .section-tag {
  display: inline-block; background: rgba(124,58,237,.14); color: var(--color-ai-light, #a855f7);
  border: 1px solid rgba(168,85,247,.3); padding: 6px 16px; border-radius: 999px;
  font-size: 13px; letter-spacing: .12em; font-weight: 600;
}
.crosslink-head h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 800; color: var(--text-primary); margin: 14px 0 8px; }
.crosslink-head p { color: var(--text-secondary); font-size: 16px; }
.crosslink-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.cross-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px; border-radius: 18px; text-decoration: none;
  background: rgba(30,41,59,.5);
  border: 1px solid rgba(148,163,184,.16);
  backdrop-filter: blur(10px);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, border-color .35s;
}
.cross-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 30px 60px -24px rgba(124,58,237,.5);
  border-color: var(--cc, #7c3aed);
}
.cross-icon {
  flex: 0 0 56px; width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--cc, #7c3aed), color-mix(in srgb, var(--cc, #7c3aed) 55%, #3b82f6));
  box-shadow: 0 10px 24px -10px var(--cc, #7c3aed);
}
.cross-icon svg { width: 28px; height: 28px; }
.cross-body h3 { font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
.cross-body p { font-size: 13.5px; color: var(--text-secondary); margin: 0 0 6px; line-height: 1.5; }
.cross-cta { font-size: 13px; font-weight: 600; color: var(--cc, #7c3aed); }

/* === RELATED === */
.post-related { margin-top: 8px; }
.post-related .section-header { text-align: center; margin-bottom: 40px; }
.post-related .related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.post-related .rel-card {
  display: flex; gap: 14px; text-decoration: none; padding: 14px; border-radius: 16px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s;
}
.post-related .rel-card:hover { transform: translateY(-6px); box-shadow: 0 24px 48px -20px rgba(59,130,246,.4); border-color: transparent; }
.post-related .rel-thumb { width: 76px; height: 60px; flex: 0 0 76px; border-radius: 10px; overflow: hidden; }
.post-related .rel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-related .rel-info h4 { font-size: 15px; font-weight: 600; margin: 0 0 4px; color: var(--text-primary); }
.post-related .rel-info .rel-meta { font-size: 12px; color: var(--text-secondary); }

/* === VIDEO GRID === */
.cicc-video-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px; margin: 28px 0;
}
.cicc-video {
  position: relative; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.5);
  border: 1px solid rgba(148,163,184,.16);
  background: linear-gradient(135deg, #1e1b4b, #1e3a8a);
}
.cicc-video iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

@media (max-width: 992px) {
  .post-layout { grid-template-columns: 1fr; gap: 28px; }
  .post-toc { position: static; }
  .post-toc nav { max-width: none; }
}
@media (max-width: 768px) {
  .post-content { font-size: 16px; }
  .crosslink-grid { grid-template-columns: 1fr; }
  .cross-card { padding: 16px; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  .post-single .page-header::before,
  .post-single .page-header h1,
  .post-single .meta-bar { animation: none !important; }
  .cross-card, .post-card, .post-related .rel-card { transition: none !important; }
  .cross-card:hover, .post-card:hover, .post-related .rel-card:hover { transform: none; }
}
