.article-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.article-head-card,
.article-content,
.toc-card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.article-head-card {
  overflow: hidden;
}

.article-hero {
  padding: 40px;
}

.article-kicker {
  margin: 0 0 14px;
  color: #0f766e;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.article-title {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.05;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  color: #64748b;
  font-size: 0.98rem;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tag:hover,
.tag:focus-visible {
  background: rgba(15, 118, 110, 0.2);
  color: #0b5954;
}

.article-cover-card {
  border-top: 1px solid var(--line);
}

.article-cover {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}

.article-layout.no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

.article-content {
  min-width: 0;
  padding: 36px 40px;
  font-size: 1.05rem;
  line-height: 1.9;
}

.article-content > :first-child {
  margin-top: 0;
  padding-top: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  scroll-margin-top: 18px;
  line-height: 1.25;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin-top: 2.2em;
}

.article-content a {
  color: var(--accent);
}

.article-content iframe {
  display: block;
  width: min(100%, 100%);
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 1.5rem 0;
  border: 0;
  border-radius: 18px;
}

.article-content p:has(> iframe:only-child) {
  margin: 1.5rem 0;
}

.article-content p:has(> iframe:only-child) iframe {
  margin: 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
}

.article-content th,
.article-content td {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
}

.related-articles-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.related-article-item {
  min-width: 0;
}

.related-article-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: #1e293b;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.related-article-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.related-article-thumb--placeholder {
  background: linear-gradient(145deg, #ecf6f4 0%, #fff3d7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.related-article-thumb--placeholder span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.2);
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 0.9rem;
}

.related-article-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px;
}

.related-article-link:hover {
  color: #0f766e;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.related-article-name {
  display: block;
  font-weight: 600;
  line-height: 1.45;
}

.related-article-date {
  display: block;
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.84rem;
  color: #64748b;
}

.article-toc {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
}

.toc-card {
  padding: 24px 22px;
}

.toc-title {
  margin-bottom: 16px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f766e;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item + .toc-item {
  margin-top: 10px;
}

.toc-item {
  position: relative;
}

.toc-item a {
  display: block;
  position: relative;
  color: #94a3b8;
  text-decoration: none;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.toc-item a:hover {
  color: #111827;
}

.toc-item a.is-active {
  color: #111827;
}

.toc-item:has(> a.is-active)::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -12px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #111827;
  pointer-events: none;
}

.toc-level-1 {
  font-weight: 700;
}

.toc-level-3 {
  padding-left: 14px;
}

.toc-level-4,
.toc-level-5,
.toc-level-6 {
  padding-left: 28px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Section and Card (detail page override) */
.section {
  margin-top: 48px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

@media (max-width: 960px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .article-shell {
    width: min(100% - 20px, 100%);
    padding: 20px 0 40px;
  }

  .article-head-card,
  .article-content,
  .toc-card,
  .card {
    border-radius: 18px;
  }

  .article-hero,
  .article-content,
  .toc-card,
  .card {
    padding: 20px 16px;
  }

  .article-content iframe {
    border-radius: 14px;
  }
}
