body.stack-page {
    margin: 0;
    padding-top: var(--header-compact-height, 70px);
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #111827);
    font-family: 'Pretendard', var(--font-family-sans, sans-serif);
    -webkit-font-smoothing: antialiased;
    word-break: keep-all;
}

.stack-page .article-hero,
.stack-page .category-bar,
.stack-page .stats-bar,
.stack-page main,
.stack-page main * { box-sizing: border-box; }

.stack-page [hidden] { display: none !important; }
.stack-page .stack-skip {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100010;
    padding: 12px 20px;
    color: #fff;
    background: var(--color-primary-dark, #1d4ed8);
    transform: translateY(-180%);
}
.stack-page .stack-skip:focus { transform: translateY(0); }
.stack-page #main-content { scroll-margin-top: 120px; }
.stack-page :is(a, button, select):focus-visible {
    outline: 3px solid var(--color-primary, #3b82f6);
    outline-offset: 4px;
}

.stack-page .article-hero {
    position: relative;
    height: 48vh;
    min-height: 360px;
    max-height: 520px;
    overflow: hidden;
    background: var(--bg-dark, #111827);
}
.stack-page .hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.stack-page .article-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,.5) 50%, rgba(0,0,0,.2));
}
.stack-page .hero-content {
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    max-width: 1140px;
    margin: 0 auto;
    padding: var(--space-12, 48px) var(--space-6, 24px);
}
.stack-page .hero-breadcrumb { margin: 0 0 var(--space-4, 16px); font-size: var(--text-xs, 12px); }
.stack-page .hero-breadcrumb a { color: #e5e7eb; text-decoration: none; }
.stack-page .hero-category {
    display: inline-block;
    margin-bottom: var(--space-4, 16px);
    padding-bottom: var(--space-2, 8px);
    border-bottom: 1px solid #9ca3af;
    color: #e5e7eb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}
.stack-page .hero-title { margin: 0 0 var(--space-4, 16px); color: #fff; font-size: 38px; font-weight: 900; line-height: 1.3; }
.stack-page .hero-desc { max-width: 560px; margin: 0; color: #f3f4f6; font-size: var(--text-base, 16px); line-height: 1.7; }
.stack-page .category-bar { border-block: 1px solid var(--border-light, #e5e7eb); }
.stack-page .category-bar-inner { display: flex; justify-content: center; padding: 0 var(--space-6, 24px); }
.stack-page .category-bar a {
    display: block;
    padding: var(--space-4, 16px) var(--space-6, 24px);
    border-bottom: 2px solid var(--text-primary, #111827);
    color: var(--text-primary, #111827);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.stack-page .stats-bar { display: flex; justify-content: center; gap: var(--space-12, 48px); padding: 36px 24px; border-bottom: 1px solid var(--border-light, #e5e7eb); }
.stack-page .stat-item { text-align: center; }
.stack-page .stat-num { margin-bottom: 6px; font-size: 32px; font-weight: 900; line-height: 1; }
.stack-page .stat-label { color: var(--text-secondary, #4b5563); font-size: var(--text-xs, 12px); font-weight: 600; letter-spacing: .7px; }
.stack-page .wrap { max-width: 1140px; margin: 0 auto; padding-inline: var(--space-6, 24px); }
.stack-page .stack-controls { padding-top: var(--space-10, 40px); }
.stack-page .filter-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-4, 16px); margin-bottom: var(--space-5, 20px); }
.stack-page .filter-heading h2 { margin: 0; font-size: var(--text-lg, 18px); font-weight: 700; }
.stack-page .filter-heading label { display: flex; align-items: center; gap: 10px; color: var(--text-secondary, #4b5563); font-size: 13px; }
.stack-page .filter-heading select { min-height: 44px; padding: 8px 30px 8px 12px; border: 1px solid var(--border-medium, #d1d5db); border-radius: 0; background: var(--bg-primary, #fff); color: var(--text-primary, #111827); font: inherit; }
.stack-page .filter-buttons { display: flex; flex-wrap: wrap; gap: var(--space-2, 8px); }
.stack-page .filter-buttons button {
    min-height: 44px;
    padding: 9px 15px;
    border: 1px solid var(--border-medium, #d1d5db);
    border-radius: 0;
    background: var(--bg-primary, #fff);
    color: var(--text-secondary, #4b5563);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition-fast, 150ms ease);
}
.stack-page .filter-buttons button:hover { border-color: var(--text-primary, #111827); }
.stack-page .filter-buttons button[aria-pressed="true"] { border-color: var(--text-primary, #111827); color: var(--bg-primary, #fff); background: var(--text-primary, #111827); }
.stack-page .filter-result { min-height: 21px; margin: var(--space-4, 16px) 0 0; color: var(--text-secondary, #4b5563); font-size: 13px; }
.stack-page .stack-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: var(--space-5, 20px) 0; margin-top: var(--space-6, 24px); border-block: 1px solid var(--border-light, #e5e7eb); color: var(--text-secondary, #4b5563); font-size: 12px; }
.stack-page .stack-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.stack-page .stack-legend p { flex-basis: 100%; margin: 4px 0 0; line-height: 1.7; }
.stack-page .state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-gray-500, #6b7280); }
.stack-page .state-dot.current { background: var(--color-primary-dark, #1d4ed8); }
.stack-page .state-dot.learning { background: var(--color-secondary-dark, #7c3aed); }
.stack-page .state-dot.planned { background: var(--color-accent-dark, #d97706); }
.stack-page .category-section { padding: 56px 0 0; scroll-margin-top: 96px; }
.stack-page .section-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: var(--space-8, 32px); padding-bottom: var(--space-5, 20px); border-bottom: 2px solid var(--text-primary, #111827); }
.stack-page .section-label { margin-bottom: var(--space-2, 8px); color: var(--text-secondary, #4b5563); font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; }
.stack-page .section-title { margin: 0; font-size: var(--text-2xl, 24px); font-weight: 900; line-height: 1.3; }
.stack-page .section-count { flex-shrink: 0; padding-bottom: 2px; color: var(--text-secondary, #4b5563); font-size: 12px; }
.stack-page .tech-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4, 16px); }
.stack-page .tech-card { position: relative; min-width: 0; padding: 18px; border: 1px solid var(--border-light, #e5e7eb); background: var(--bg-primary, #fff); transition: border-color var(--transition-fast, 150ms ease), box-shadow var(--transition-fast, 150ms ease); }
.stack-page .tech-card:hover { border-color: var(--border-dark, #9ca3af); box-shadow: var(--shadow-sm); }
.stack-page .tech-card-body { min-width: 0; }
.stack-page .tech-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.stack-page .tech-logo { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 12px; border: 1px solid #e5e7eb; border-radius: var(--radius-lg, 8px); background: #fff; }
.stack-page .tech-logo img { display: block; width: 36px; height: 36px; object-fit: contain; }
.stack-page .tech-logo.logo-pair { width: 86px; gap: 4px; }
.stack-page .tech-state { position: absolute; top: 22px; right: 18px; flex-shrink: 0; color: var(--text-secondary, #4b5563); font-size: 11px; font-weight: 600; white-space: nowrap; }
.stack-page .tech-state.current { color: var(--color-primary-dark, #1d4ed8); }
.stack-page .tech-state.learning { color: var(--color-secondary-dark, #7c3aed); }
.stack-page .tech-title-row { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.stack-page .tech-name { min-width: 0; margin: 0; font-size: var(--text-lg, 18px); font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.stack-page .tech-level { color: var(--text-secondary, #4b5563); font-size: 11px; }
.stack-page .tech-desc { margin: 6px 0 10px; color: var(--text-secondary, #4b5563); font-size: 13px; line-height: 1.7; }
.stack-page .tech-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-page .tech-tags span { max-width: 100%; padding: 4px 8px; border: 1px solid var(--border-light, #e5e7eb); color: var(--text-secondary, #4b5563); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.stack-page .ad-block { max-width: 728px; min-height: 90px; margin: var(--space-10, 40px) auto; text-align: center; }
.stack-page .stack-empty { padding: var(--space-16, 64px) 0; text-align: center; color: var(--text-secondary, #4b5563); line-height: 1.8; }

[data-theme="dark"] .stack-page .tech-state.current { color: var(--color-primary-light, #60a5fa); }
[data-theme="dark"] .stack-page .tech-state.learning { color: var(--color-secondary-light, #a78bfa); }

@media (max-width: 1023px) {
    .stack-page .tech-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .stack-page .tech-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 12px; padding: 10px 12px; }
    .stack-page .tech-logo { width: 44px; height: 44px; margin: 0; padding: 2px; border: 0; }
    .stack-page .tech-logo img { width: 40px; height: 40px; }
    .stack-page .tech-logo.logo-pair { flex-direction: column; width: 44px; height: 86px; gap: 2px; }
    .stack-page .tech-state { position: static; font-size: 10px; }
    .stack-page .tech-name { font-size: 15px; line-height: 1.4; }
    .stack-page .tech-level { font-size: 10px; }
    .stack-page .tech-desc { margin: 4px 0 6px; overflow: hidden; color: var(--text-secondary, #4b5563); font-size: 12px; line-height: 1.5; white-space: nowrap; text-overflow: ellipsis; }
    .stack-page .tech-tags { flex-wrap: nowrap; gap: 4px; overflow: hidden; }
    .stack-page .tech-tags span { flex-shrink: 0; max-width: calc(50% - 4px); padding: 1px 6px; overflow: hidden; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
    .stack-page .tech-tags.is-condensed .tech-tag { max-width: calc((100% - 40px) / 2); }
    .stack-page .tech-tags .tech-tags-more { max-width: none; }
    .stack-page .category-section { padding-top: 22px; }
    .stack-page .section-header { margin-bottom: 12px; padding-bottom: 12px; }
}
@media (max-width: 599px) {
    .stack-page .hero-content { padding: var(--space-8, 32px) var(--space-6, 24px); }
    .stack-page .hero-title { font-size: 30px; }
    .stack-page .hero-desc { font-size: 14px; }
    .stack-page .stats-bar { gap: var(--space-6, 24px); padding: 28px 16px; }
    .stack-page .stat-num { font-size: 28px; }
    .stack-page .stat-label { font-size: 10px; letter-spacing: 0; }
    .stack-page .wrap { padding-inline: var(--space-5, 20px); }
    .stack-page .filter-buttons { gap: 6px; }
    .stack-page .filter-buttons button { padding-inline: 12px; }
    .stack-page .tech-grid { grid-template-columns: minmax(0, 1fr); }
    .stack-page .section-title { font-size: 21px; }
}


.stack-page .tech-card-meta { display: flex; align-items: center; gap: 8px; }
.stack-page .tech-card-meta .tech-tags { flex: 1; min-width: 0; }
.stack-page .tech-evidence { display: flex; flex-shrink: 0; align-items: center; gap: 4px; height: 18px; }
.stack-page .tech-evidence a { display: inline-flex; align-items: center; min-height: 24px; margin-block: -3px; padding-inline: 2px; color: var(--text-secondary, #4b5563); font-size: 11px; line-height: 18px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.stack-page .tech-evidence a:hover { color: var(--color-primary-dark, #1d4ed8); }
[data-theme="dark"] .stack-page .tech-evidence a:hover { color: var(--color-primary-light, #60a5fa); }
@media (max-width: 1023px) {
    .stack-page .tech-evidence a { font-size: 10px; }
}
