:root {
    --mup-blue: #003a78;
    --mup-blue-2: #005aa7;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --line: rgba(15, 23, 42, 0.14);
    --line-soft: rgba(15, 23, 42, 0.08);
    --text: #0f172a;
    --muted: #475569;
    --accent: var(--mup-blue-2);
    --accent-soft: rgba(0, 90, 167, 0.08);
    --accent-strong: rgba(0, 58, 120, 0.12);
    --header-h: 72px;
    --logo-url: url('mup-logo.png');
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(0, 90, 167, 0.08) 0, transparent 22rem),
        linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
    padding-top: var(--header-h);
}

body::before {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: var(--header-h);
    background: var(--mup-blue);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.25);
    z-index: 1000;
}

.site-logo-link {
    position: fixed;
    top: 0;
    left: 0;
    width: 230px;
    height: var(--header-h);
    background: var(--logo-url) no-repeat 16px center / 180px auto;
    z-index: 1001;
}

.wrap {
    max-width: 980px;
    margin: 32px auto;
    padding: 0 16px 40px;
}

.hero,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.10);
}

.hero {
    padding: 22px 22px 18px;
    margin-bottom: 16px;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(2rem, 3.8vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.hero-title {
    position: relative;
    display: inline-block;
    margin: 0 0 10px;
    padding: 2px 0 0;
    color: #082847;
    text-wrap: balance;
}

.hero-title-link {
    color: inherit;
    text-decoration: none;
}

.hero-title-link:hover {
    text-decoration: underline;
}

.meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.55;
}

.panel {
    overflow: hidden;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 18px 22px;
    background: linear-gradient(180deg, rgba(0, 90, 167, 0.08) 0%, rgba(0, 58, 120, 0.03) 100%);
    border-bottom: 1px solid var(--line);
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 0.9rem;
    color: var(--muted);
    background: var(--accent-soft);
    border: 1px solid rgba(0, 90, 167, 0.20);
    border-radius: 999px;
    padding: 8px 12px;
}

.lang-switch a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    font-weight: 600;
}

.lang-switch a:hover {
    border-bottom-color: var(--accent);
}

.lang-switch strong {
    color: var(--text);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(0, 90, 167, 0.18);
    color: var(--mup-blue);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(0, 90, 167, 0.12);
}

.count {
    font-weight: bold;
    color: var(--accent);
}

.count a {
    color: inherit;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    background: var(--accent-soft);
    border: 1px solid rgba(0, 90, 167, 0.2);
    border-radius: 999px;
    padding: 8px 12px;
}

.back-link:hover {
    text-decoration: underline;
}

.back-link::before {
    content: "\2190";
    line-height: 1;
}

.detail-summary {
    padding: 20px 22px 8px;
    border-bottom: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgba(0, 90, 167, 0.03) 0%, rgba(0, 58, 120, 0.01) 100%);
}

.detail-summary strong {
    display: block;
    margin-bottom: 6px;
    color: #0b2540;
    font-size: 1.15rem;
    line-height: 1.35;
}

.detail-summary .subtle {
    margin-bottom: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 22px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line-soft);
}

th {
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(15, 23, 42, 0.025);
}

tr:hover td {
    background: rgba(0, 90, 167, 0.035);
}

.detail-doc-item + .detail-doc-item {
    margin-top: 8px;
}

.detail-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(0, 90, 167, 0.26);
    background: linear-gradient(180deg, rgba(0, 90, 167, 0.13) 0%, rgba(0, 90, 167, 0.07) 100%);
    color: #0b3c66;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s, background 0.12s;
}

.detail-doc-link::before {
    content: "PDF";
    display: inline-block;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(0, 58, 120, 0.12);
    color: #0a3255;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
}

.detail-doc-link:hover {
    transform: translateX(2px);
    border-color: rgba(0, 90, 167, 0.45);
    box-shadow: 0 6px 14px rgba(0, 58, 120, 0.12);
    background: linear-gradient(180deg, rgba(0, 90, 167, 0.18) 0%, rgba(0, 90, 167, 0.1) 100%);
}

.detail-doc-link-main {
    border-color: rgba(0, 58, 120, 0.38);
    background: linear-gradient(180deg, rgba(0, 58, 120, 0.2) 0%, rgba(0, 58, 120, 0.12) 100%);
}

.title-cell strong {
    display: block;
    margin-bottom: 6px;
    color: #0b2540;
    font-size: 1rem;
}

.subtle {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.error {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(185, 28, 28, 0.06);
    border: 1px solid rgba(185, 28, 28, 0.18);
    color: #8a1c1c;
    white-space: pre-wrap;
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.06);
}

.empty {
    padding: 28px 22px;
    color: var(--muted);
}

.mup-footer {
    margin-top: 26px;
    padding: 16px 0 22px;
    border-top: 1px solid var(--line-soft);
    color: rgba(15, 23, 42, 0.7);
    font-size: 0.92rem;
}

.mup-footer a {
    color: inherit;
    text-decoration: none;
}

.mup-footer a:hover {
    text-decoration: underline;
}

.mup-footer a {
    color: var(--mup-blue);
    text-decoration: none;
}

.mup-footer a:hover {
    text-decoration: underline;
}

/* ---- Thesis list cards ---- */

.thesis-list {
    display: flex;
    flex-direction: column;
}

.thesis-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line-soft);
    transition: background 0.12s;
}

.thesis-card:last-child {
    border-bottom: none;
}

.thesis-card:hover {
    background: var(--accent-soft);
}

.thesis-card-body {
    flex: 1;
    min-width: 0;
}

.thesis-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent-strong);
    color: var(--mup-blue);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 9px;
}

.thesis-title {
    font-size: 1.02rem;
    font-weight: 600;
    color: #0b2540;
    line-height: 1.35;
    margin-bottom: 8px;
}

.thesis-title a {
    color: inherit;
    text-decoration: none;
}

.thesis-title a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.thesis-meta {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 5px;
    line-height: 1.4;
}

.thesis-author {
    font-weight: 600;
    color: #2c3e50;
}

.thesis-meta-sep {
    margin: 0 5px;
    opacity: 0.4;
}

.thesis-dates {
    color: var(--muted);
    font-size: 0.82rem;
}

.thesis-dates strong {
    color: var(--text);
}

.thesis-card-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 4px;
}

.thesis-detail-link {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--accent-soft);
    border: 1px solid rgba(0, 90, 167, 0.20);
    color: var(--accent);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s;
}

.thesis-detail-link:hover {
    background: var(--accent-strong);
    border-color: rgba(0, 90, 167, 0.38);
}

/* ---- Pagination ---- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 18px 22px;
    border-top: 1px solid var(--line-soft);
}

.pag-btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 8px;
    background: var(--accent-soft);
    border: 1px solid rgba(0, 90, 167, 0.20);
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s;
    user-select: none;
}

.pag-btn:hover {
    background: var(--accent-strong);
    border-color: rgba(0, 90, 167, 0.38);
}

.pag-disabled {
    opacity: 0.30;
    cursor: default;
    pointer-events: none;
}

.pag-info {
    color: var(--muted);
    font-size: 0.9rem;
    min-width: 120px;
    text-align: center;
}

@media (max-width: 860px) {
    .hero-top {
        display: block;
    }

    .lang-switch {
        display: flex;
        justify-content: flex-start;
        margin-top: 8px;
        margin-bottom: 12px;
    }

    body::before {
        background:
            var(--mup-blue)
            var(--logo-url)
            no-repeat 12px center / 150px auto;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        padding: 12px 0;
        border-bottom: 1px solid var(--line-soft);
    }

    td {
        border: 0;
        padding: 8px 22px;
    }

    td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--muted);
    }
}
