:root {
  --bg-dark: #090d16;
  --card-bg: #0f172a;
  --card-soft: rgba(30, 41, 59, 0.55);
  --card-border: rgba(172, 124, 251, 0.16);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-purple: #ac7cfb;
  --accent-indigo: #6366f1;
  --accent-blue: #38bdf8;
  --primary: #5440d6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.75;
}

h1, h2, h3, p, li, a, th, td { overflow-wrap: break-word; }
a { color: var(--accent-blue); }

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.65rem 1.25rem;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
}

.brand-icon { width: 24px; height: 24px; display: block; }
.nav-links { display: flex; align-items: center; gap: 0.5rem; }
.nav-links a {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: #fff; background: rgba(172, 124, 251, 0.14); }
.btn-calc {
  padding: 0.45rem 1.1rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-purple), var(--primary));
  box-shadow: 0 4px 14px rgba(84, 64, 214, 0.35);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.container { width: 100%; max-width: 960px; margin: 2.25rem auto 4rem; padding: 0 1.5rem; }
.breadcrumbs { margin-bottom: 1.2rem; color: var(--text-muted); font-size: 0.87rem; }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-purple); }
.breadcrumbs span { padding: 0 0.45rem; }

.hero-card {
  padding: 2.75rem 2.25rem;
  margin-bottom: 1.75rem;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.88));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.eyebrow { margin-bottom: 0.65rem; color: var(--accent-purple); font-size: 0.82rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.hero-title { margin-bottom: 0.95rem; color: #fff; font-size: clamp(2rem, 5vw, 2.65rem); font-weight: 900; line-height: 1.2; letter-spacing: -0.04em; }
.hero-desc { max-width: 760px; color: #cbd5e1; font-size: 1.05rem; line-height: 1.75; }
.updated { display: inline-block; margin-top: 1rem; color: var(--text-muted); font-size: 0.8rem; }

.toc, .article-section {
  padding: 1.8rem 2rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--card-bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
}
.toc h2, .article-section h2 {
  padding-bottom: 0.7rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(172, 124, 251, 0.12);
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.35;
}
.article-section h3 { margin: 1.35rem 0 0.55rem; color: #fff; font-size: 1.1rem; }
.article-section p { margin-bottom: 0.95rem; color: #cbd5e1; font-size: 0.97rem; }
.article-section p:last-child { margin-bottom: 0; }
.article-section ul, .article-section ol { margin: 0.8rem 0 1.1rem; padding-left: 1.5rem; color: #cbd5e1; }
.article-section li { margin-bottom: 0.55rem; padding-left: 0.2rem; }
.toc ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.45rem 1rem; list-style: none; }
.toc a { display: block; padding: 0.3rem 0; text-decoration: none; font-size: 0.9rem; }

.callout {
  padding: 1rem 1.25rem;
  margin: 1.15rem 0;
  border-left: 4px solid var(--accent-purple);
  border-radius: 0 10px 10px 0;
  background: rgba(84, 64, 214, 0.13);
}
.callout.warning { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.callout strong { display: block; margin-bottom: 0.25rem; color: #fff; }
.callout p { margin: 0; color: #e2e8f0; font-size: 0.93rem; }

.formula, .example-flow {
  padding: 1rem 1.2rem;
  margin: 1rem 0;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 10px;
  background: rgba(2, 132, 199, 0.08);
  color: #e0f2fe;
  font-size: 0.95rem;
}
.example-flow strong { color: #fff; }

.table-wrap { width: 100%; margin: 1.15rem 0; overflow-x: auto; border: 1px solid var(--card-border); border-radius: 10px; }
table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.91rem; }
th, td { padding: 0.8rem 1rem; border-bottom: 1px solid rgba(172, 124, 251, 0.1); text-align: left; vertical-align: top; }
th { background: rgba(30, 41, 59, 0.78); color: #fff; }
td { color: #cbd5e1; }
tr:last-child td { border-bottom: 0; }

.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.guide-link {
  display: block;
  padding: 1.15rem;
  border: 1px solid rgba(172, 124, 251, 0.16);
  border-radius: 12px;
  background: var(--card-soft);
  color: inherit;
  text-decoration: none;
}
.guide-link:hover { border-color: rgba(172, 124, 251, 0.5); transform: translateY(-1px); }
.guide-link strong { display: block; margin-bottom: 0.35rem; color: #fff; }
.guide-link span { color: var(--text-muted); font-size: 0.88rem; line-height: 1.55; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }
.text-link { display: inline-flex; align-items: center; padding: 0.55rem 0.9rem; border: 1px solid var(--card-border); border-radius: 8px; text-decoration: none; font-weight: 700; }

.footer { padding: 2.25rem 1.5rem; margin-top: auto; border-top: 1px solid rgba(172, 124, 251, 0.1); text-align: center; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.footer-links a:hover { color: var(--accent-purple); }
.footer p { color: #64748b; font-size: 0.8rem; }

@media (max-width: 760px) {
  .header { padding: 0.6rem 0.8rem; }
  .header-inner { flex-wrap: wrap; gap: 0.55rem; }
  .nav-links { order: 3; width: 100%; }
  .nav-links a { flex: 1 1 0; padding: 0.38rem 0.15rem; text-align: center; font-size: 0.78rem; background: rgba(30, 41, 59, 0.45); }
  .btn-calc { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
  .container { margin-top: 1.25rem; padding: 0 0.75rem; }
  .hero-card { padding: 1.75rem 1rem; }
  .hero-title { font-size: 1.7rem; }
  .hero-desc { font-size: 0.93rem; }
  .toc, .article-section { padding: 1.25rem 1rem; }
  .toc h2, .article-section h2 { font-size: 1.2rem; }
  .guide-grid { grid-template-columns: 1fr; }
}
