:root {
  /* Premium Light Theme */
  --bg-color: #f8fafc;
  --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(255, 255, 255, 0.5);
  --text-main: #1e293b;
  --text-muted: #334155;
  --accent-color: #0284c7;
  --accent-hover: #0369a1;
  --accent-soft: rgba(2, 132, 199, 0.1);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max-width: 900px;
  --glass-blur: blur(16px);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Premium Dark Theme */
    --bg-color: #0f172a;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-bg: rgba(30, 41, 59, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #e2e8f0;
    --accent-color: #38bdf8;
    --accent-hover: #7dd3fc;
    --accent-soft: rgba(56, 189, 248, 0.15);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 25px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1.25rem; color: var(--text-muted); font-size: 1.05rem; }
a { color: var(--accent-color); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); }

/* Layout & Containers */
.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  padding: 4rem 0 2rem;
}

main {
  padding: 0 0 4rem;
}

/* UI Components */
.card, .hero {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero {
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0ea5e9, #8b5cf6, #ec4899);
}

.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-color);
  background: var(--accent-soft);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

.intro {
  font-size: 1.15rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

/* Lists and TOC */
.toc-group {
  margin-top: 2.5rem;
}

.toc-group h3 {
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.toc-list {
  list-style: none;
  display: grid;
  gap: 1rem;
}

.toc-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

@media (prefers-color-scheme: dark) {
  .toc-list li a {
    background: rgba(0, 0, 0, 0.2);
  }
}

.toc-list li a:hover {
  transform: translateY(-3px);
  border-color: var(--accent-color);
  box-shadow: var(--shadow-md);
  background: var(--card-bg);
}

.toc-list li a .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent-soft);
  color: var(--accent-color);
  border-radius: var(--radius-sm);
  margin-right: 1rem;
  flex-shrink: 0;
}

.toc-list li a .content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.toc-list li a .title {
  font-size: 1.05rem;
}

.toc-list li a .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.25rem;
}

.toc-list li a svg.arrow {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.toc-list li a:hover svg.arrow {
  transform: translateX(4px);
  color: var(--accent-color);
}

/* Guide Articles Content Styling */
.article-content {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 3rem 4rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.article-content h2 { border-bottom: 1px solid var(--card-border); padding-bottom: 0.75rem; margin-top: 2.5rem; }
.article-content h3 { margin-top: 2rem; color: var(--accent-color); }
.article-content h4 { margin-top: 1.5rem; font-size: 1.1rem; }

.article-content ul, .article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
  color: var(--text-muted);
}

.article-content li {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.article-content li strong, .article-content p strong {
  color: var(--text-main);
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
  display: block;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  background: var(--accent-soft);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-main);
}

.author-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

/* Prompt Copy Box */
.prompt-container {
  margin: 2rem 0;
  border-radius: var(--radius-md);
  background: var(--bg-color);
  border: 1px solid var(--card-border);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
  overflow: hidden;
  position: relative;
  text-align: left;
}

.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid var(--card-border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

@media (prefers-color-scheme: dark) {
  .prompt-header { background: rgba(255,255,255,0.02); }
}

.prompt-content {
  padding: 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-x: auto;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-copy:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.btn-copy svg { width: 14px; height: 14px; }

/* Footer & Nav */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  transform: translateX(-2px);
}

.btn-back svg { width: 18px; height: 18px; }

footer {
  padding: 0 1.5rem 3rem;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--card-border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero, .card, .article-content {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 640px) {
  .toc-list li a {
    align-items: flex-start;
  }
  .toc-list li a .icon {
    display: none;
  }
  .toc-list li a svg.arrow {
    display: none;
  }
}
