:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --primary: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent-emerald: #059669;
  --accent-emerald-bg: #ecfdf5;
  --accent-amber: #d97706;
  --accent-amber-bg: #fffbeb;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

[data-theme='dark'] {
  --bg: #0b0f19;
  --surface: #111827;
  --surface-alt: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #1f2937;
  --primary: #60a5fa;
  --primary-soft: rgba(59, 130, 246, 0.14);
  --accent-emerald: #34d399;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-amber: #fbbf24;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.72;
  word-break: keep-all;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none !important;
}

.brand-badge {
  background: #1d4ed8;
  color: #fff;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.brand-text {
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}

.main-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-switcher {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-alt);
}

.lang-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none !important;
}

.lang-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.theme-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-size: 0.95rem;
}

/* Hero Banner & Post Grid */
.hero-banner {
  padding: 2.5rem 0 1.75rem;
}

.hero-banner h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.hero-banner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2.25rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.section-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.badge-company {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
}

.post-card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.18rem;
  line-height: 1.4;
}

.post-card h3 a {
  color: var(--text);
}

.post-card p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* Article Detail */
.article-container {
  max-width: 820px;
  margin: 2.25rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.25rem;
  box-shadow: var(--shadow);
}

.article-header h1 {
  font-size: 2rem;
  line-height: 1.32;
  margin: 0.5rem 0 1rem;
  letter-spacing: -0.02em;
}

.article-hero-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.25rem 0;
  border: 1px solid var(--border);
}

/* 3줄 핵심 요약 박스 (KeyTakeaways) */
.takeaways-box {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 1.15rem 1.35rem;
  margin: 1.5rem 0;
}

.takeaways-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.02rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.takeaways-list {
  margin: 0;
  padding-left: 1.25rem;
}

.takeaways-list li {
  margin-bottom: 0.35rem;
  font-weight: 500;
}

/* 에디터 인사이트 박스 (EditorInsight - E-E-A-T) */
.editor-insight-box {
  background: var(--accent-emerald-bg);
  border: 1px solid var(--accent-emerald);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
  margin: 2rem 0;
}

.editor-insight-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-emerald);
}

.editor-badge {
  background: var(--accent-emerald);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.editor-insight-text {
  margin: 0;
  font-size: 0.98rem;
}

/* 독자 반응 · 공유 · 의견 보내기 바 (ArticleActionBar) */
.article-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  margin: 1.5rem 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}

.action-bar-left,
.action-bar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

.action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.action-btn.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.helpful-badge {
  display: none;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.25);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
}

.action-btn.is-active .helpful-badge {
  display: inline-block;
}

/* 마크다운 본문 및 비교표(Table) 스타일 */
.article-content h2 {
  margin-top: 2.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.45rem;
}

.article-content h3 {
  margin-top: 1.6rem;
  font-size: 1.2rem;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.94rem;
  overflow-x: auto;
  display: block;
}

.article-content th,
.article-content td {
  border: 1px solid var(--border);
  padding: 0.7rem 0.9rem;
  text-align: left;
}

.article-content th {
  background: var(--surface-alt);
  font-weight: 700;
}

/* 쿠팡파트너스 박스 (CoupangBox) */
.coupang-box {
  background: var(--accent-amber-bg);
  border: 1px solid var(--accent-amber);
  border-radius: 12px;
  padding: 1.35rem;
  margin: 2rem 0;
}

.coupang-header {
  font-size: 1.05rem;
  margin-bottom: 0.9rem;
}

.coupang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.coupang-item-name {
  font-weight: 700;
}

.coupang-item-summary {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.coupang-cta-btn {
  background: #e11d48;
  color: #fff !important;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-decoration: none !important;
}

.coupang-disclosure {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 내부 링크 추천 박스 (RelatedPosts) */
.related-posts-box {
  background: var(--surface-alt);
  border-radius: 12px;
  padding: 1.35rem;
  margin-top: 2.25rem;
}

.related-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.related-list {
  margin: 0;
  padding-left: 1.2rem;
}

.related-list li {
  margin-bottom: 0.45rem;
}

.related-company {
  font-weight: 700;
  margin-right: 0.35rem;
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding: 2.5rem 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

@media (max-width: 640px) {
  .article-container {
    padding: 1.35rem;
  }
  .article-header h1 {
    font-size: 1.55rem;
  }
}
