/* Shanjun GEO Theme - Custom Styles */
/* Base styles are inline in the layout template via Tailwind CSS CDN */

/* 案例卡片边框颜色 */
.border-black { border-color: #000 !important; }
.border-red-200 { border-color: rgb(254 202 202) !important; }
.border-slate-200 { border-color: rgb(226 232 240) !important; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Selection */
::selection { background: rgba(99, 102, 241, 0.2); }

/* Page loader */
#page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: #f8fafc;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}
#page-loader.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
#page-loader .loader-bar {
  width: 200px; height: 3px; background: #e2e8f0; border-radius: 2px; overflow: hidden; margin-top: 24px;
}
#page-loader .loader-bar-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px; transition: width 0.3s;
}

/* Scroll progress */
#scroll-progress {
  position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 9998;
  background: transparent; pointer-events: none;
}
#scroll-progress .bar {
  height: 100%; width: 0%; transform-origin: left;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
  transform: scaleX(0); transition: transform 0.1s linear;
}

/* Back to top */
#back-to-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 9997;
  width: 48px; height: 48px; border-radius: 50%;
  background: white; color: #6366f1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  opacity: 0; visibility: hidden; transform: translateY(16px);
  transition: all 0.3s;
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { background: #6366f1; color: white; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(99,102,241,0.3); }

/* Mobile CTA */
#mobile-cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9996;
  background: white; border-top: 1px solid #e2e8f0;
  padding: 12px 16px; display: none;
}
#mobile-cta.show { display: block; }

/* Cursor glow (desktop only) */
#cursor-glow {
  position: fixed; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
  pointer-events: none; z-index: 9990;
  transform: translate(-50%, -50%);
  transition: left 0.15s ease-out, top 0.15s ease-out;
}

/* Toast notification */
.site-toast {
  position: fixed; top: 100px; right: 24px; z-index: 10000;
  padding: 14px 24px; border-radius: 12px;
  background: #1e293b; color: white; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transform: translateX(120%); transition: transform 0.3s;
}
.site-toast.show { transform: translateX(0); }

/* Fade in animation */
.fade-section {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-section.visible {
  opacity: 1; transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .fade-section { opacity: 1; transform: none; }
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Input error state */
.input-error { border-color: #ef4444 !important; }
.input-success { border-color: #22c55e !important; }

/* Video card */
.video-card .play-icon {
  transition: transform 0.3s;
}
.video-card:hover .play-icon {
  transform: scale(1.1);
}

/* Page nav */
.page-nav-btn.active {
  background: #6366f1 !important;
  color: white !important;
}

/* Modal */
#consult-modal {
  position: fixed; inset: 0; z-index: 10001;
  display: none; align-items: center; justify-content: center;
}
#consult-modal.open { display: flex; }
#consult-modal .modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
#consult-modal .modal-content {
  position: relative; z-index: 1;
  background: white; border-radius: 24px; padding: 32px;
  max-width: 480px; width: 90%; max-height: 90vh; overflow-y: auto;
}

/* ───────────────────────────────────
   Article Content — Immersive Typography
   ─────────────────────────────────── */
.article-content {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Serif SC", Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.92;
  color: #1a1a2e;
  word-break: break-word;
}

/* Headings — Clear hierarchy with accent accents */
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 {
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 0.6em;
}

.article-content h1 { font-size: 1.8rem; margin-top: 2em; padding-bottom: 0.35em; border-bottom: 2px solid #e2e8f0; }
.article-content h2 { font-size: 1.5rem; margin-top: 2em; padding-left: 0.75em; border-left: 4px solid #6366f1; }
.article-content h3 { font-size: 1.25rem; margin-top: 1.8em; }
.article-content h4 { font-size: 1.1rem; margin-top: 1.5em; color: #334155; }
.article-content h5 { font-size: 1rem; margin-top: 1.3em; }
.article-content h6 { font-size: 0.95rem; margin-top: 1.3em; color: #475569; }

/* First heading after body shouldn't have huge top margin */
.article-content > h1:first-child,
.article-content > h2:first-child,
.article-content > h3:first-child { margin-top: 0; }

/* Paragraphs — Comfortable reading rhythm */
.article-content p {
  margin-bottom: 1.25em;
  color: #334155;
}

/* Inline formatting */
.article-content strong { color: #0f172a; font-weight: 600; }
.article-content em { font-style: italic; color: #475569; }
.article-content del, .article-content s { color: #94a3b8; text-decoration: line-through; }

/* Links */
.article-content a {
  color: #4f46e5;
  text-decoration: none;
  border-bottom: 1.5px solid rgba(99, 102, 241, 0.3);
  transition: border-color 0.2s, color 0.2s;
}
.article-content a:hover {
  color: #3730a3;
  border-bottom-color: #6366f1;
}

/* Horizontal rule */
.article-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, #e2e8f0, #cbd5e1, #e2e8f0);
  margin: 2.5em 0;
}

/* Images — Centered, rounded, with subtle shadow */
.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.8em auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Lists — Clean spacing */
.article-content ul, .article-content ol {
  padding-left: 1.8em;
  margin-bottom: 1.25em;
  color: #334155;
}
.article-content li { margin-bottom: 0.5em; }
.article-content ul ul, .article-content ol ol,
.article-content ul ol, .article-content ol ul { margin-top: 0.4em; margin-bottom: 0.4em; }

/* Blockquote — Elegant pull-quote style */
.article-content blockquote {
  border-left: 4px solid #818cf8;
  margin: 1.8em 0;
  padding: 1.2em 1.6em;
  background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 100%);
  border-radius: 0 10px 10px 0;
  color: #4338ca;
  font-style: italic;
}
.article-content blockquote p { margin-bottom: 0.5em; color: inherit; }
.article-content blockquote p:last-child { margin-bottom: 0; }

/* Inline code */
.article-content code {
  background: #f1f5f9;
  color: #db2777;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  border: 1px solid #e2e8f0;
}

/* Code blocks — Dark terminal style */
.article-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.4em 1.6em;
  border-radius: 14px;
  overflow-x: auto;
  margin: 1.8em 0;
  line-height: 1.65;
  font-size: 0.92rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255,255,255,0.05);
}
.article-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
  border-radius: 0;
}

/* ── Tables ── */
.article-content .article-table-wrap {
  overflow-x: auto;
  margin: 1.8em 0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.article-content table,
.article-content .article-table-wrap .article-table,
.article-content .article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.6;
}
.article-content th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
  padding: 0.85em 1.1em;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  font-size: 0.88em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.article-content td {
  padding: 0.75em 1.1em;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.article-content tr:last-child td { border-bottom: none; }
.article-content tr:hover td { background: #f8fafc; }

/* GFM Task lists */
.article-content input[type="checkbox"] {
  margin-right: 0.5em;
  accent-color: #6366f1;
  transform: scale(1.1);
}

/* Sup / Sub */
.article-content sup { font-size: 0.75em; vertical-align: super; }
.article-content sub { font-size: 0.75em; vertical-align: sub; }

/* Responsive tweaks */
@media (max-width: 640px) {
  .article-content {
    font-size: 1rem;
    line-height: 1.8;
  }
  .article-content h2 { font-size: 1.3rem; }
  .article-content h3 { font-size: 1.15rem; }
  .article-content pre { padding: 1em; border-radius: 10px; font-size: 0.82rem; }
}
