:root {
    --bg: #fbfaf7;
    --panel: rgba(255, 255, 255, 0.82);
    --text-color: #171717;
    --secondary-text-color: #706d66;
    --border-color: #d8d2c8;
    --border-soft: rgba(216, 210, 200, 0.55);
    --accent-color: #171717;
    --surface-color: #f5f1ea;
    --shadow-color: rgba(23, 23, 23, 0.04);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 12px;
}

body {
    margin: 0;
    font-family: var(--font-sans, "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    font-weight: 500;
    background: #fff;
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

strong,
b,
th {
    font-weight: 500 !important;
}

a {
    color: inherit;
}

.shell {
    width: min(1320px, calc(100vw - 48px));
    margin: 0 auto;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-soft);
}

.header-shell {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    width: min(1180px, calc(100vw - 48px));
    margin: 0 auto;
    gap: 12px 24px;
    padding: clamp(14px, 2vw, 20px) 0;
}

.logo {
    text-decoration: none;
    font-size: 1.22rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px clamp(14px, 1.8vw, 24px);
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav {
    margin-left: auto;
    max-width: min(100%, 720px);
}

.main-nav a {
    display: inline-block;
    position: relative;
    text-decoration: none;
    color: var(--secondary-text-color);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    padding-bottom: 2px;
    transition: color 0.2s ease;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.main-nav a.is-active,
.main-nav a:hover {
    color: var(--text-color);
}

.main-nav a.nav-current {
    color: var(--text-color);
}

.main-nav a.is-active::after,
.main-nav a:hover::after,
.main-nav a.nav-current::after {
    opacity: 1;
}

.main-nav a.nav-disabled {
    color: var(--secondary-text-color);
    opacity: 0.55;
    pointer-events: none;
}

.main-nav a.nav-disabled::after {
    opacity: 0;
}

.post-layout {
    padding: 36px 0 72px;
}

.toc-panel {
    position: sticky;
    top: 92px;
    align-self: start;
}

.toc-label {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-color);
}

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

.toc-item {
    border-top: 1px solid var(--border-soft);
}

.toc-item:last-child {
    border-bottom: 1px solid var(--border-soft);
}

.toc-item a {
    display: block;
    padding: 10px 0;
    color: var(--secondary-text-color);
    font-size: 1.02rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.toc-item a:hover {
    color: var(--text-color);
}

.post-page {
    min-width: 0;
    max-width: 1120px;
    margin: 0 auto;
}

.post-section {
    padding: 0 0 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    scroll-margin-top: 92px;
}

.post-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

h1 {
    margin: 0 auto 18px;
    width: 100%;
    max-width: none;
    font-size: clamp(2.45rem, 3.6vw, 3.7rem);
    line-height: 1;
    letter-spacing: -0.06em;
    font-weight: 500;
    text-align: center;
}

.article-meta {
    margin: 0 auto 20px;
    color: var(--secondary-text-color);
    text-align: center;
}

.article-authors {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.article-author-link {
    text-decoration-line: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
    transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.article-author-link:hover,
.article-author-link:focus-visible {
    color: var(--text-color);
    text-decoration-color: currentColor;
}

.article-affiliations,
.article-supporting {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.55;
}

.article-supporting {
    margin-top: 8px;
}

h2.section-title {
    margin: 0 0 14px;
    padding-top: 0;
    border-top: none;
    font-size: 2.12rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 500;
    text-align: left;
    color: var(--text-color);
}

.centered-title {
    text-align: center !important;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
    justify-content: center;
}

.tag {
    padding: 7px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background-color: transparent;
    color: var(--secondary-text-color);
    font-size: 1rem;
    font-weight: 500;
}

.hero-figure {
    margin: 28px 0 0;
    text-align: center;
}

.hero-figure img {
    display: block;
    width: min(70%, 602px);
    height: auto;
    margin: 0 auto;
    box-shadow: 0 18px 32px var(--shadow-color);
}

.figure-caption {
    margin: 10px 0 0;
    color: var(--secondary-text-color);
    font-size: 0.92rem;
}

.methodology {
    background-color: var(--surface-color);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 28px;
    margin: 30px 0 20px;
    text-align: left;
    color: var(--text-color);
}

.methodology h3 {
    margin: 0 0 14px;
    color: var(--text-color);
    font-size: 1.34rem;
    font-weight: 500;
    text-align: center;
}

.methodology p {
    margin: 0;
    font-size: 1.14rem;
    line-height: 1.9;
}

.abstract-card {
    background-color: rgba(245, 241, 234, 0.36);
}

.abstract-card p {
    font-family: var(--font-serif);
    text-align: justify;
    text-align-last: left;
}

.case-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 28px;
    align-items: stretch;
}

.case-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.case-card {
    background-color: transparent;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 20px;
    height: 100%;
    box-sizing: border-box;
    text-align: left;
    transition: border-color 0.2s ease;
}

.case-card-link:hover .case-card,
.case-card-link:focus-visible .case-card {
    border-color: var(--border-color);
}

.case-card h3 {
    margin: 0 0 10px;
    font-size: 1.24rem;
    font-weight: 500;
    color: var(--text-color);
}

.case-card p {
    margin: 0;
    color: var(--secondary-text-color);
    text-align: left;
    font-size: 1.08rem;
    line-height: 1.8;
}

.section-intro {
    max-width: none;
    margin: 0 0 22px;
    color: var(--secondary-text-color);
    text-align: left;
    font-size: 1.12rem;
    line-height: 1.85;
}

.legend-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 24px 0 0;
}

.legend-table {
    width: 100%;
    border-collapse: collapse;
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: none;
    font-size: 1.06rem;
    line-height: 1.75;
}

.legend-table th,
.legend-table td {
    padding: 12px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
}

.legend-table th:nth-child(2),
.legend-table td:nth-child(2) {
    padding-left: 24px;
}

.legend-table thead tr {
    background-color: var(--surface-color);
}

.legend-table tr:last-child td {
    border-bottom: none;
}

.sample-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    margin: 26px 0 0;
}

.sample-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 7px 12px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background-color: white;
    color: var(--secondary-text-color);
    text-decoration: none;
    font-size: 0.88rem;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.sample-chip:hover {
    border-color: var(--text-color);
    color: var(--text-color);
}

.demo-section {
    background-color: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 28px;
    margin: 28px 0 20px;
}

.sample-card {
    background-color: white;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.sample-card:last-child {
    margin-bottom: 0;
}

.sample-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.sample-card-header h3 {
    margin: 0;
    width: 100%;
    font-size: 1.22rem;
    font-weight: 500;
    color: var(--text-color);
    text-align: center;
}

.sample-row-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
}

.sample-groups-layout {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 16px;
    width: max-content;
    align-items: stretch;
}

.sample-reference-slot {
    display: flex;
    align-items: stretch;
}

.sample-method-group {
    background-color: #fbfbfb;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.sample-method-group-title {
    margin: 0 0 12px;
    color: var(--text-color);
    font-size: 1.08rem;
    font-weight: 500;
    text-align: center;
}

.sample-method-group-grid {
    display: grid;
    gap: 14px;
    flex: 1;
    align-content: start;
}

.sample-method-group-grid.cols-1 {
    grid-template-columns: repeat(1, minmax(255px, 1fr));
}

.sample-method-group-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(255px, 1fr));
}

.sample-method-group-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(255px, 1fr));
}

.sample-row {
    display: grid;
    gap: 14px;
    width: max-content;
}

.sample-row.cols-5 {
    grid-template-columns: repeat(5, minmax(255px, 1fr));
}

.sample-row.cols-7 {
    grid-template-columns: repeat(7, minmax(255px, 1fr));
}

.sample-item {
    width: 255px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.audio-player {
    width: 100%;
    margin-bottom: 12px;
}

.spectrogram-preview {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 243 / 129;
    margin: 0 0 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    object-fit: contain;
    background: #111;
}

.sample-label {
    margin: 0;
    width: 100%;
    font-size: 0.98rem;
    color: var(--secondary-text-color);
    line-height: 1.55;
    text-align: center;
}

.sample-label strong {
    color: var(--text-color);
    font-weight: 500;
}

.reference-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 22px;
    max-width: none;
    margin: 0;
    text-align: left;
}

.reference-card p {
    margin: 0;
    color: var(--secondary-text-color);
    text-align: left;
}

.main-footer {
    padding: 0 0 32px;
}

.copyright {
    margin: 0;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
    color: var(--secondary-text-color);
    font-size: 0.95rem;
}

code {
    font-family: var(--font-mono, "SFMono-Regular", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace);
    font-size: 0.92em;
}

@media (max-width: 1200px) {
    .sample-method-group-grid.cols-1 {
        grid-template-columns: repeat(1, minmax(240px, 1fr));
    }

    .sample-method-group-grid.cols-2 {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }

    .sample-method-group-grid.cols-3 {
        grid-template-columns: repeat(3, minmax(240px, 1fr));
    }

    .sample-row.cols-5 {
        grid-template-columns: repeat(5, minmax(240px, 1fr));
    }

    .sample-row.cols-7 {
        grid-template-columns: repeat(7, minmax(240px, 1fr));
    }

    .sample-item {
        width: 240px;
    }
}

@media (max-width: 960px) {
    .post-layout {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 36px 0 56px;
    }

    .toc-panel {
        position: static;
        background-color: rgba(255, 255, 255, 0.6);
        border: 1px solid var(--border-soft);
        border-radius: 10px;
        padding: 18px;
    }

    .toc-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 16px;
    }

    .case-overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .shell {
        width: min(100vw - 32px, 1320px);
    }

    .header-shell {
        width: min(100vw - 32px, 1180px);
    }

    .header-shell {
        align-items: flex-start;
    }

    .main-nav {
        margin-left: 0;
        width: 100%;
        max-width: none;
    }

    .main-nav ul {
        justify-content: flex-start;
        gap: 10px 16px;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2.section-title {
        font-size: 1.65rem;
    }

    .demo-section {
        padding: 18px;
    }

    .hero-figure img {
        width: 100%;
    }

    .sample-card {
        padding: 16px;
    }

    .sample-groups-layout {
        gap: 14px;
    }

    .sample-method-group {
        padding: 12px;
    }

    .sample-method-group-grid.cols-1 {
        grid-template-columns: repeat(1, minmax(225px, 1fr));
    }

    .sample-method-group-grid.cols-2 {
        grid-template-columns: repeat(2, minmax(225px, 1fr));
    }

    .sample-method-group-grid.cols-3 {
        grid-template-columns: repeat(3, minmax(225px, 1fr));
    }

    .sample-row.cols-5 {
        grid-template-columns: repeat(5, minmax(225px, 1fr));
    }

    .sample-row.cols-7 {
        grid-template-columns: repeat(7, minmax(225px, 1fr));
    }

    .sample-item {
        width: 225px;
    }

    .legend-table {
        font-size: 0.96rem;
    }

    .legend-table th,
    .legend-table td {
        padding: 10px 14px;
    }

    .legend-table th:nth-child(2),
    .legend-table td:nth-child(2) {
        padding-left: 16px;
    }
}

@media (max-width: 560px) {
    .toc-list {
        grid-template-columns: 1fr;
    }
}
