/* css styles */

@font-face {
  font-family: 'MyFont';
  src: url('fonts/GenWanMin2TW-R-sub.woff2?v=20260804a') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'MyFont';
  src: url('fonts/GenWanMin2TW-M-sub.woff2?v=20260804a') format('woff2');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'MyFont';
  src: url('fonts/GenWanMin2TW-SB-sub.woff2?v=20260804a') format('woff2');
  font-weight: 600;
  font-style: normal;
}


/* ── Adjustable base font size (controlled by font-size toggle) ── */
html { font-size: 16px; }
html[data-fontsize="small"]  { font-size: 13px; }
html[data-fontsize="medium"] { font-size: 16px; }
html[data-fontsize="large"]  { font-size: 19px; }

body {
    font-family: 'MyFont', 'Palatino Linotype', 'Palatino LT STD', 'Book Antiqua', Georgia, 'Songti TC', 'PMingLiU', 'Noto Serif TC', serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.8;
    color: #222222;
    background-color: #fcfbf9;
    margin: 0;
    padding: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 740px; 
    margin: 0 auto;
    padding: 40px 20px;
}


h1, h2, h3, h4 {
    font-family: 'MyFont', 'Palatino Linotype', 'Book Antiqua', Georgia, 'Songti TC', 'PMingLiU', 'Noto Serif TC', serif;
    color: #1a2a3a;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 {
    font-weight: 600; /* SB */
}

h2 {
    font-weight: 500; /* M */
}

h3, h4 {
    font-weight: 500; /* M */
}

/* navbar / site title */
.navbar-brand, .navbar-title, .navbar .nav-link {
    font-family: 'MyFont', 'Palatino Linotype', 'Book Antiqua', Georgia, 'Songti TC', 'PMingLiU', 'Noto Serif TC', serif;
    font-weight: 600;
}


h1 {
    font-size: 2.2rem;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-top: 0;
}

h2 {
    font-size: 1.6rem;
    font-weight: 500;
    margin-top: 1.8em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #e8e4de;
}

h3 {
    font-size: 1.25rem;
    font-weight: 500;
}

/* 內文與段落 */
p {
    margin-top: 0;
    margin-bottom: 1.25em;
}

a {
    color: #1a2a3a;
    text-decoration: none;
    border-bottom: 1px solid #1a2a3a; 
    transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
    color: #2c5282;
    border-bottom-color: #2c5282;
}


blockquote {
    margin: 1.5em 0;
    padding-left: 20px;
    border-left: 3px solid #1a2a3a;
    color: #555555;
    font-style: italic;
}

ul, ol {
    margin-top: 0;
    margin-bottom: 1.25em;
    padding-left: 25px;
}

li {
    margin-bottom: 0.3em;
}

ol.wip-list {
    padding-left: 2.6em;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    font-size: 0.95rem;
}

table th, table td {
    padding: 10px 12px;
    text-align: left;
}

table th {
    border-top: 2px solid #222;
    border-bottom: 1px solid #222;
    font-weight: 600;
    color: #1a2a3a;
}

table td {
    border-bottom: 1px solid #eee;
}

table tr:last-child td {
    border-bottom: 2px solid #222; 
}

code, pre {
    font-family: 'Courier New', Courier, monospace; 
    background-color: #f4f4f4;
    font-size: 0.9em;
}

code {
    padding: 2px 5px;
    border-radius: 3px;
}

pre {
    padding: 15px;
    overflow-x: auto;
    border: 1px solid #ddd;
    line-height: 1.5;
    margin: 1.5em 0;
}

.footnote, .meta {
    font-size: 0.85rem;
    color: #777777;
    line-height: 1.5;
}


/* Two-column about (≥992px = Quarto's trestles breakpoint):
   widen past the narrow article column so the prose gets a readable measure;
   the left column is pinned to the portrait width and the rest goes to the text */
@media (min-width: 992px) {
  div.quarto-about-trestles {
    grid-column: page-start / page-end !important;
    gap: 4em !important;
  }
  div.quarto-about-trestles > .about-entity {
    flex: 0 0 20em;
  }
  div.quarto-about-trestles > .about-contents {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* Stacked layout (<992px): modest gap between photo block and text */
@media (max-width: 991.98px) {
  div.quarto-about-trestles {
    gap: 1.25em !important;
  }
}

/* photo shrinks with its column (inline style sets width: 20em) */
div.quarto-about-trestles .about-entity .about-image {
  max-width: 100%;
  height: auto;
}

/* Desktop only: left column (photo + description) floats while scrolling.
   Must NOT apply below 992px — there the layout stacks and sticky would
   overlap the text (e.g. iPad portrait). */
@media (min-width: 992px) {
  .quarto-about-trestles .about-entity {
    position: sticky;
    top: 2rem;
    align-self: start;
  }
}

/* Reorder about-page left column: links first, description below */
.quarto-about-trestles .about-entity {
  display: flex;
  flex-direction: column;
}

.quarto-about-trestles .about-entity .about-image {
  order: 0;
}

.quarto-about-trestles .about-entity h1,
.quarto-about-trestles .about-entity .title {
  order: 1;
}

.quarto-about-trestles .about-links {
  order: 2;
  margin-bottom: 1em;
}

.quarto-about-trestles .about-entity .description {
  order: 3;
  font-size: 0.92rem;
  color: #444;
  line-height: 1.6;
}

/* 劉昱佑 subtitle — h1 size */
.quarto-about-trestles .about-entity .subtitle,
.quarto-about-trestles p.subtitle {
  font-family: 'MyFont', 'Palatino Linotype', 'Book Antiqua', Georgia, 'Songti TC', 'PMingLiU', 'Noto Serif TC', serif;
  font-weight: 600;
  font-size: 2rem;
  color: #1a2a3a;
  line-height: 1.3;
  margin-bottom: 0.2em;
}


/* ── Landing page ──────────────────────────────────── */
.landing {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8vh 6vw 6vh 6vw;
    box-sizing: border-box;
}

.landing-name {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 6vw;
}

@keyframes drop-in {
    from {
        opacity: 0;
        transform: translateY(-30rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-30rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 1;
        transform: translateX(500vw);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.landing-en {
    font-family: 'MyFont', 'Palatino Linotype', 'Book Antiqua', Georgia, 'Songti TC', 'PMingLiU', 'Noto Serif TC', serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 4.5rem);
    color: #1a2a3a;
    line-height: 1.0;
    letter-spacing: -0.01em;
    animation: drop-in 2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.landing-divider {
    width: 100%;
    height: 2px;
    background-color: #1a2a3a;
    margin: 2em 0;
    animation: slide-in-right 2s cubic-bezier(0.22, 1, 0.36, 1) both;
    overflow: hidden;
}

[data-theme="dark"] .landing-divider {
    background-color: #dde3ec;
}

.landing-name-block {
    width: fit-content;
}

.landing-name-block .landing-en,
.landing-name-block .landing-zh {
    white-space: nowrap;
}

.landing-zh {
    font-family: 'MyFont', 'Palatino Linotype', 'Book Antiqua', Georgia, 'Songti TC', 'PMingLiU', 'Noto Serif TC', serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 3.5vw, 3rem);
    color: #4a5568;
    line-height: 1.2;
    letter-spacing: 0.05em;
    animation: slide-in-left 2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.landing-topbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1em;
}

.lang-toggle,
.global-lang-toggle,
.navbar-icon-btn {
    background: none;
    border: 1px solid #c8c2ba;
    border-radius: 3px;
    font-family: 'MyFont', 'Palatino Linotype', Georgia, 'Songti TC', 'PMingLiU', 'Noto Serif TC', serif;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: #888;
    padding: 0 10px;
    height: 28px;
    line-height: 28px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
}

.lang-toggle:hover,
.global-lang-toggle:hover,
.navbar-icon-btn:hover {
    color: #1a2a3a;
    border-color: #1a2a3a;
}

/* Button group: pushed to the far right, immediately left of search */
.navbar-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    order: 90;
    margin-left: auto;
    margin-right: 0.75em;
}
#quarto-search { order: 91; }

/* Keep nav links left-aligned, brand at far left */
.navbar-brand-container.mx-auto { margin-left: 0 !important; }
.navbar-nav.me-auto { margin-right: 0 !important; }

/* Uniform size for all three buttons in the group */
.navbar-btn-group .navbar-icon-btn {
    width: 36px;
    min-width: 36px;
    padding: 0;
    justify-content: center;
    font-weight: 600;
}

/* Mobile (<992px): Quarto gives the collapsing menu order:20, so the
   button group (order:90) gets pushed below the expanded menu. Lower its
   order so it stays in the top bar, immediately left of the search icon. */
@media (max-width: 991.98px) {
    .navbar-btn-group {
        order: 3;
        margin-left: auto;
        margin-right: 0.4em;
        gap: 0.35em;
    }
    .navbar #quarto-search {
        order: 4;
        margin-left: 0;
    }
    .navbar-btn-group .navbar-icon-btn {
        width: 32px;
        min-width: 32px;
    }
}


.landing-footer {
    border-top: 1px solid #e0dbd4;
    padding-top: 1.5em;
}

.landing-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em 1.8em;
}

.landing-nav a {
    font-family: 'MyFont', 'Palatino Linotype', 'Book Antiqua', Georgia, 'Songti TC', 'PMingLiU', 'Noto Serif TC', serif;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1a2a3a;
    border-bottom: none;
    text-decoration: none;
    transition: color 0.2s ease;
}

.landing-nav a:hover {
    color: #2c5282;
    border-bottom: none;
}

/* Bibliographic stats */
.bib-stats {
    display: flex;
    justify-content: space-between;
    margin: 0.5em 0 2.2em 0;
    padding: 1.4em 0 1.2em 0;
    border-top: 1px solid #e8e4de;
    border-bottom: 1px solid #e8e4de;
}

.bib-stat {
    text-align: center;
    flex: 1;
}

.bib-label {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 0.4em;
}

.bib-number {
    font-family: 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: #1a2a3a;
    line-height: 1;
}

.bib-stats-note {
    font-size: 0.82rem;
    color: #666;
    line-height: 1.5;
    margin: -1.7em 0 2.2em 0;
}

/* Citations-per-year bar chart */
.cite-chart {
    margin: -0.6em 0 2.4em 0;
}

.cite-chart-title {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #666;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 0.9em;
}

.cite-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.6em;
    padding-top: 1.6em;
}

.cite-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cite-bar-track {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.cite-bar-val {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: #1a2a3a;
    margin-bottom: 0.3em;
    line-height: 1;
}

.cite-bar {
    position: relative;
    width: 100%;
    max-width: 18px;
    height: 0;
    background: #4a4d54;
    border-radius: 0;
    transition: height 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.cite-bar-year {
    font-size: 0.78rem;
    color: #666;
    margin-top: 0.5em;
    letter-spacing: 0.02em;
}

/* Co-Authors list */
.coauthors-list {
    list-style: none;
    padding-left: 0;
}

/* Journal covers strip */
.journal-covers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.4em;
    margin: 1.8em 0 2.2em;
}

.journal-covers .cover-item {
    display: block;
    text-align: center;
    text-decoration: none;
    border-bottom: none !important;
}

.journal-covers img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border: 1px solid #e8e4de;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.journal-covers .cover-name {
    display: block;
    margin-top: 0.55em;
    font-size: 0.7rem;
    line-height: 1.4;
    color: #666;
}

.journal-covers .cover-item:hover img {
    transform: translateY(-4px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.14);
}

@media (max-width: 576px) {
    .journal-covers {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Co-author map */
.coauthor-map {
    position: relative;
    margin: 0.4em 0 1.6em;
}

.coauthor-map svg {
    display: block;
    width: 100%;
    height: auto;
}

.cmap-land {
    fill: #e8e4de;
}

.cmap-dot {
    fill: #2c5282;
    cursor: pointer;
    transition: r 0.15s ease, fill 0.15s ease;
}

.cmap-dot:hover {
    fill: #1f3a5f;
}

.cmap-tip {
    position: absolute;
    max-width: 300px;
    background: #2b2b2b;
    color: #fcfbf9;
    font-size: 0.78rem;
    line-height: 1.45;
    padding: 0.45em 0.7em;
    border-radius: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.cmap-tip.is-visible {
    opacity: 1;
}

.cmap-scroll-hint {
    display: none;
}

/* Mobile: keep the map large inside a horizontally scrollable window */
@media (max-width: 768px) {
    .coauthor-map {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .coauthor-map svg {
        width: 760px;
        max-width: none;
    }

    .cmap-scroll-hint {
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: #999;
        margin: -1em 0 1.6em;
    }
}

/* Note / 附註 */
.paper-note {
    font-size: 0.82rem;
    color: #666;
    line-height: 1.5;
    margin-top: 0.8em;
}

/* Paper entries in research page */
.paper-entry {
    display: grid;
    grid-template-columns: 155px 1fr;
    column-gap: 1.2em;
    align-items: start;
    margin-bottom: 1.1em;
    padding: 0.7em 0.9em 0.8em;
    border-bottom: 1px solid #e8e4de;
    border-radius: 6px;
    margin-left: -0.9em;
    margin-right: -0.9em;
    transition: background-color 0.2s ease;
}

/* al-folio-style hover highlight */
.paper-entry:hover {
    background-color: #f4f1ec;
}

/* Left column: journal-abbreviation tag, vertically centred (al-folio style) */
.paper-tag {
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6em;
}

/* desktop: badge spans the full column width, label centred */
.paper-tag > p {
    align-self: stretch;
    text-align: center;
}

/* anything after the badge (PlumX, even if its script wraps it)
   sits directly below the badge, horizontally centred */
.paper-tag > *:not(:first-child) {
    margin: 0 auto;
}

.paper-tag p {
    margin: 0;
}

.journal-badge,
.paper-tag p {
    display: inline-block;
    background-color: #2c5282;
    color: #fcfbf9;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.35;
    text-align: center;
    white-space: nowrap;
    padding: 4px 11px;
    border-radius: 999px;
}

/* Content sits in the right column */
.paper-title,
.paper-meta,
.paper-desc,
.paper-links,
.bibtex-box,
.abstract-box {
    grid-column: 2;
    min-width: 0; /* allow the column to shrink so long BibTeX lines scroll instead of overflowing */
}

/* Course / paper description */
.paper-desc {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 0.4em;
}

.paper-desc p {
    margin: 0;
}

/* PlumX plum-print widget: centred in the empty left-column area */
.paper-tag .plumx-plum-print-popup {
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    line-height: 1;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* PlumX's script may inject its own anchors/elements — make sure none
   of them inherit the global link underline */
.paper-tag a,
.paper-tag a span,
.paper-tag .plumx-plum-print-popup * {
    border-bottom: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

/* Inline code in descriptions: same type rules as the BibTeX box */
.paper-desc p code {
    background: none !important;
    padding: 0 !important;
    border-radius: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', ui-monospace,
        Menlo, Consolas, 'Courier New', monospace;
    font-weight: 500;
    font-size: 0.88em;
    color: #2d3a47;
}

/* Mobile: stack the tag above the content (al-folio behaviour) */
@media (max-width: 600px) {
    .paper-entry {
        grid-template-columns: 1fr;
        row-gap: 0.4em;
    }
    /* journal badge top-left, PlumX directly below it */
    .paper-tag {
        grid-column: 1;
        grid-row: auto;
        align-self: start;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }
    .paper-tag p {
        align-self: auto;
        width: auto;
    }
    .paper-tag > *:not(:first-child) {
        margin: 0;
    }
    .paper-title,
    .paper-meta,
    .paper-desc,
    .paper-links,
    .bibtex-box,
    .abstract-box {
        grid-column: 1;
    }
}

.paper-entry:last-child {
    border-bottom: none;
}

.paper-title {
    font-weight: 500;
    font-size: 1.02rem;
    color: #1a2a3a;
    margin-bottom: 0.2em;
    line-height: 1.4;
}

/* package name shown as code in a title: same style as inline code (e.g. ggplot2), just larger */
.paper-title code {
    font-size: 1.25rem;
}

.paper-meta {
    font-size: 0.92rem;
    color: #555;
    margin-bottom: 0.5em;
}

/* "Earlier version presented at ..." sub-note under a publication */
.paper-earlier {
    display: block;
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.25em;
}

/* Conference papers: auto reverse-numbered list (newest = highest number)
   with a hanging indent so wrapped lines align after the number ("數字後對齊") */
.conf-list {
    padding-left: 2.6em;
    margin-top: 0.6em;
}

.conf-list li {
    margin-bottom: 0.55em;
    line-height: 1.5;
    padding-left: 0.3em;
}

.paper-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-top: 0.4em;
}

.paper-btn {
    display: inline-block;
    font-size: 0.78rem;
    padding: 0 9px;
    line-height: 1.55;
    border: 1px solid #2c5282;
    border-radius: 3px;
    color: #2c5282 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #2c5282 !important;
    transition: background-color 0.2s ease, color 0.2s ease;
    letter-spacing: 0.02em;
}

.paper-btn:hover {
    background-color: #2c5282;
    color: #fcfbf9 !important;
    border-color: #2c5282 !important;
}

/* BibTeX toggle button (clickable span, no link underline) */
.bib-toggle,
.abs-toggle,
.media-toggle {
    cursor: pointer;
    border-bottom: 1px solid #2c5282 !important;
    user-select: none;
}

.bib-toggle.is-open,
.abs-toggle.is-open,
.media-toggle.is-open {
    background-color: #2c5282;
    color: #fcfbf9 !important;
}

/* Collapsible BibTeX box */
.bibtex-box {
    display: none;
    margin-top: 0.7em;
}

.bibtex-box.is-open {
    display: block;
    position: relative;
}

/* Index badges (SSCI / SCIE / ESCI / EconLit …) on the right of the button row */
/* The button row itself becomes a flex line so buttons and badges share
   identical height, baseline, and spacing. */
.paper-links p {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    align-items: center;
    width: 100%;
    margin: 0;
}

.idx-badges {
    margin-left: auto;
    display: inline-flex;
    gap: 0.4em;
    align-items: center;
}

.idx-badge {
    display: inline-block;
    font-size: 0.78rem;
    padding: 0 9px;
    line-height: 1.55;
    border: 1px solid #b0a99e;
    border-radius: 3px;
    color: #8a8174;
    letter-spacing: 0.02em;
}

/* ── Taiwan Crash Atlas (Extension page) ───────────────── */
.atlas-figure {
    margin: 0.6em 0 1.4em;
}

.atlas-figure a {
    display: block;
    border-bottom: none !important;
    box-shadow: none !important;
}

.atlas-figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid #e0dbd4;
    background-color: #0c0c0e;
    box-shadow: 0 6px 22px rgba(20, 20, 24, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.atlas-figure a:hover img {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(20, 20, 24, 0.28);
}

.atlas-features {
    margin: 1.1em 0 1.2em;
    padding-left: 1.2em;
}

.atlas-features li {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 0.45em;
    line-height: 1.55;
}

.atlas-features li strong {
    color: #1a2a3a;
    font-weight: 600;
}

.atlas-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin: 0.4em 0 0.8em;
}

.atlas-source {
    font-size: 0.82rem;
    color: #8a8174;
    margin-bottom: 0.4em;
}

[data-theme="dark"] .atlas-figure img {
    border-color: #2a3040;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .atlas-features li {
    color: #c7cedb;
}

[data-theme="dark"] .atlas-features li strong {
    color: #dde3ec;
}

[data-theme="dark"] .atlas-source {
    color: #8a95a8;
}

/* Abstract box (mirrors the BibTeX box behaviour) */
.abstract-box {
    display: none;
    margin-top: 0.7em;
}

.abstract-box.is-open {
    display: block;
}

.abstract-box p,
.abstract-box ul {
    background-color: #ffffff;
    border: 1px solid #e0dbd4;
    border-radius: 5px;
    margin: 0;
    padding: 1em 1.1em;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #4a4a4a;
    text-align: justify;
}

.abstract-box ul {
    padding-left: 2.3em;
    list-style: disc;
}

.abstract-box li {
    margin-bottom: 0.35em;
}

.abstract-box li:last-child {
    margin-bottom: 0;
}

/* One-click copy button — minimal ghost icon (Quarto style) */
.copy-bib {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #b0a99e;
    padding: 4px;
    cursor: pointer;
    opacity: 0.75;
    transition: color 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.copy-bib:hover {
    color: #555;
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
}

.copy-bib svg {
    width: 15px;
    height: 15px;
}

.copy-bib.copied {
    color: #2f7d4f;
    opacity: 1;
}

.bibtex-box pre {
    background-color: #ffffff;
    border: 1px solid #e0dbd4;
    border-radius: 5px;
    margin: 0;
    padding: 1em 1.1em;
    font-size: 0.82rem;
    line-height: 1.7;
    overflow-x: auto;
}

.bibtex-box code {
    background: none;
    padding: 0;
    white-space: pre;
    font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', ui-monospace,
        Menlo, Consolas, 'Courier New', monospace;
    font-weight: 500;
    color: #2d3a47;
}

/* BibTeX syntax tokens (al-folio palette) */
.bibtex-box .bk { color: #1f3a93; font-weight: 700; }  /* @article entry type */
.bibtex-box .bc { color: #9b1c31; font-weight: 700; }  /* citation key */
.bibtex-box .bf { color: #1f8a76; }                     /* field names */
.bibtex-box .bv { color: #c0395a; }                     /* field values */

/* ── Dark mode ─────────────────────────────────────── */
[data-theme="dark"] {
    --bg: #141824;
    --fg: #cdd4e0;
    --heading: #dde3ec;
    --link: #8fafc8;
    --border: #2a3040;
    --muted: #8a95a8;
}

[data-theme="dark"] body {
    background-color: #141824;
    color: #cdd4e0;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
    color: #dde3ec;
}

[data-theme="dark"] a {
    color: #8fafc8;
    border-bottom-color: #8fafc8;
}

[data-theme="dark"] a:hover {
    color: #b8d0e4;
    border-bottom-color: #b8d0e4;
}

[data-theme="dark"] blockquote {
    border-left-color: #8fafc8;
    color: #8a95a8;
}

[data-theme="dark"] table th {
    border-top-color: #8a95a8;
    border-bottom-color: #8a95a8;
    color: #dde3ec;
}

[data-theme="dark"] table td {
    border-bottom-color: #2a3040;
}

[data-theme="dark"] table tr:last-child td {
    border-bottom-color: #8a95a8;
}

[data-theme="dark"] .footnote,
[data-theme="dark"] .meta {
    color: #8a95a8;
}

/* About page */
[data-theme="dark"] .quarto-about-trestles .about-entity .description {
    color: #a8b4c4;
}

[data-theme="dark"] .quarto-about-trestles .about-entity .subtitle,
[data-theme="dark"] .quarto-about-trestles p.subtitle {
    color: #dde3ec;
}

/* Landing page */
[data-theme="dark"] .landing {
    background-color: #141824;
}

[data-theme="dark"] .landing-en {
    color: #dde3ec;
}

[data-theme="dark"] .landing-zh {
    color: #8a95a8;
}

[data-theme="dark"] .landing-footer {
    border-top-color: #2a3040;
}

[data-theme="dark"] .landing-nav a {
    color: #cdd4e0;
}

[data-theme="dark"] .landing-nav a:hover {
    color: #b8d0e4;
}

/* Bib stats */
[data-theme="dark"] .bib-stats {
    border-top-color: #2a3040;
    border-bottom-color: #2a3040;
}

[data-theme="dark"] .bib-label {
    color: #8a95a8;
}

[data-theme="dark"] .bib-number {
    color: #dde3ec;
}

[data-theme="dark"] .bib-stats-note {
    color: #8a95a8;
}

[data-theme="dark"] .cite-chart-title,
[data-theme="dark"] .cite-bar-year {
    color: #8a95a8;
}

[data-theme="dark"] .cite-bar-val {
    color: #dde3ec;
}

[data-theme="dark"] .cite-bar {
    background: #e6e9ef;
}

/* Journal covers strip */
[data-theme="dark"] .journal-covers img {
    border-color: #2a3040;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    filter: brightness(0.88);
}

[data-theme="dark"] .journal-covers .cover-item:hover img {
    filter: brightness(1);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .journal-covers .cover-name {
    color: #8a95a8;
}

/* Co-author map */
[data-theme="dark"] .cmap-land {
    fill: #252c3c;
}

[data-theme="dark"] .cmap-dot {
    fill: #f2c94c;
}

[data-theme="dark"] .cmap-dot:hover {
    fill: #ffe08a;
}

[data-theme="dark"] .cmap-tip {
    background: #e7edf5;
    color: #141824;
}

/* Paper entries */
[data-theme="dark"] .paper-entry {
    border-bottom-color: #2a3040;
}

[data-theme="dark"] .paper-entry:hover {
    background-color: #1b2130;
}

[data-theme="dark"] .bib-toggle,
[data-theme="dark"] .abs-toggle,
[data-theme="dark"] .media-toggle {
    border-bottom-color: #8fafc8 !important;
}

[data-theme="dark"] .bib-toggle.is-open,
[data-theme="dark"] .abs-toggle.is-open,
[data-theme="dark"] .media-toggle.is-open {
    background-color: #8fafc8;
    color: #141824 !important;
}

[data-theme="dark"] .idx-badge {
    color: #8a95a8;
    border-color: #4a5468;
}

[data-theme="dark"] .abstract-box p,
[data-theme="dark"] .abstract-box ul {
    background-color: #11151f;
    border-color: #2a3040;
    color: #b8c2d0;
}

[data-theme="dark"] .bibtex-box pre {
    background-color: #11151f;
    border-color: #2a3040;
}

[data-theme="dark"] .bibtex-box code {
    color: #b8c2d0;
}

[data-theme="dark"] .copy-bib {
    color: #6b7689;
}

[data-theme="dark"] .copy-bib:hover {
    color: #cdd4e0;
    background-color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .copy-bib.copied {
    color: #6fcf97;
}

[data-theme="dark"] .bibtex-box .bk { color: #8fa6f0; }
[data-theme="dark"] .bibtex-box .bc { color: #e08aa0; }
[data-theme="dark"] .bibtex-box .bf { color: #6fccb8; }
[data-theme="dark"] .bibtex-box .bv { color: #e0a4b4; }

[data-theme="dark"] .journal-badge,
[data-theme="dark"] .paper-tag p {
    background-color: #e7edf5;
    color: #141824;
}

[data-theme="dark"] .paper-title {
    color: #dde3ec;
}

[data-theme="dark"] .paper-earlier {
    color: #9aa3b2;
}

[data-theme="dark"] .paper-meta {
    color: #8a95a8;
}

[data-theme="dark"] .paper-desc {
    color: #c7cedb;
}

[data-theme="dark"] .paper-desc p code {
    background: none !important;
    color: #e08aa0;
}

[data-theme="dark"] .paper-note {
    color: #8a95a8;
}

[data-theme="dark"] .paper-btn {
    color: #8fafc8 !important;
    border-color: #8fafc8 !important;
    border-bottom: 1px solid #8fafc8 !important;
}

[data-theme="dark"] .paper-btn:hover {
    background-color: #8fafc8;
    color: #141824 !important;
    border-color: #8fafc8 !important;
}

/* Navbar buttons dark */
[data-theme="dark"] .global-lang-toggle,
[data-theme="dark"] .lang-toggle,
[data-theme="dark"] .navbar-icon-btn {
    color: #8a95a8;
    border-color: #2a3040;
}

[data-theme="dark"] .global-lang-toggle:hover,
[data-theme="dark"] .lang-toggle:hover,
[data-theme="dark"] .navbar-icon-btn:hover {
    color: #cdd4e0;
    border-color: #cdd4e0;
}

/* Navbar dark */
[data-theme="dark"] .navbar {
    background-color: #0e1219 !important;
}

[data-theme="dark"] .navbar-brand,
[data-theme="dark"] .navbar-title,
[data-theme="dark"] .navbar .nav-link {
    color: #dde3ec !important;
}

/* Quarto sidebar / TOC if present */
[data-theme="dark"] .quarto-secondary-nav,
[data-theme="dark"] .sidebar {
    background-color: #1a2030;
    color: #cdd4e0;
}

/* font subsetting（字型子集化） */
/* 工具是 pyftsubset（fonttools 附帶的） */
/* 收集所有頁面裡出現的字元 */
/* 用那些字元做子集，輸出新的 woff2 */

/* ── Site footer ───────────────────────────────────── */
.site-footer {
    margin-top: 4em;
    border-top: 1px solid #e0dbd4;
    background-color: #fcfbf9;
    font-family: 'MyFont', 'Palatino Linotype', 'Book Antiqua', Georgia, 'Songti TC', 'PMingLiU', 'Noto Serif TC', serif;
}

/* Landing page has its own footer — never show this one there */
body:has(.landing) .site-footer {
    display: none;
}

.site-footer-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.4em 1.6em 1.2em;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1.6em 2.2em;
    align-items: center;
}

/* Name + experience: far left, left-aligned */
.site-footer-about {
    text-align: left;
}

/* Pages + Elsewhere: paired columns on the right, right-aligned */
.site-footer-col {
    text-align: right;
}

.site-footer-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: #1a2a3a;
    margin: 0 0 0.45em;
}

.site-footer-id {
    font-size: 0.7rem;
    color: #777;
    line-height: 1.5;
    margin: 0.15em 0;
}

.site-footer-contact {
    margin-top: 0.7em;
}

.site-footer-id a {
    color: #555;
    border-bottom: none;
}

.site-footer-id a:hover {
    color: #2c5282;
}

.footer-heading {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 0.7em;
}

.site-footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
    align-items: flex-end;
}

.site-footer a {
    font-size: 0.74rem;
    color: #1a2a3a;
    text-decoration: none;
    border-bottom: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #2c5282;
    border-bottom: none;
}

.site-footer-legal {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.0em 1.6em 2.2em;
    border-top: 1px solid #ece8e1;
    text-align: center;
    font-size: 0.66rem;
    color: #888;
    line-height: 1.7;
}

.site-footer-legal a {
    font-size: inherit;
    color: #666;
    border-bottom: none;
}

.site-footer-legal a:hover {
    color: #2c5282;
}

/* ── Site footer · mobile ──────────────────────────── */
/* Must come AFTER the base rules above so it wins on source order */
@media (max-width: 600px) {
    .site-footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 1.6em 1.4em;
        align-items: start;
        padding: 2em 1.4em 1em;
    }
    /* About block spans the full width on top */
    .site-footer-about {
        grid-column: 1 / -1;
        text-align: left;
    }
    /* Pages + Elsewhere sit side by side below, left-aligned */
    .site-footer-col {
        text-align: left;
    }
    .site-footer-links {
        align-items: flex-start;
    }
    .site-footer-legal {
        padding: 1em 1.4em 1.8em;
    }
}

/* ── Site footer · dark mode ───────────────────────── */
[data-theme="dark"] .site-footer {
    background-color: #141824;
    border-top-color: #2a3040;
}

[data-theme="dark"] .site-footer-name {
    color: #dde3ec;
}

[data-theme="dark"] .site-footer-id {
    color: #8a95a8;
}

[data-theme="dark"] .site-footer-id a {
    color: #a8b4c4;
}

[data-theme="dark"] .site-footer-id a:hover {
    color: #8fafc8;
}

[data-theme="dark"] .footer-heading {
    color: #6b7689;
}

[data-theme="dark"] .site-footer a {
    color: #cdd4e0;
}

[data-theme="dark"] .site-footer a:hover {
    color: #8fafc8;
}

[data-theme="dark"] .site-footer-legal {
    color: #8a95a8;
    border-top-color: #2a3040;
}

[data-theme="dark"] .site-footer-legal a {
    color: #8fafc8;
}

[data-theme="dark"] .site-footer-legal a:hover {
    color: #b8d0e4;
}

/* ---- Interactive research topic network (VOSviewer embed) ---- */

.vos-embed {
    display: block;
    margin: 0 auto;
    border: 1px solid #ddd;
    background: #fff;
}

[data-theme="dark"] .vos-embed {
    border-color: #2a3040;
    background: #141824;
}
