*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

p {
    line-height: 1.6;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

header {
    padding: 20px;
    text-align: center;
    font-size: 1.4em;
    line-height: 1.5em;
    border-bottom: 1px solid #ccc;
}

.group-title {
    font-size: 1.4em;
    font-weight: bold;
}

.banner {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
}

.banner img {
    width: 100%;
    height: auto;
    display: block;
}

.banner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: clamp(1.2rem, 4vw, 2.2rem);
    font-weight: bold;
    text-shadow: 1px 1px 5px #000;
    pointer-events: none;
    text-align: center;
    max-width: 90vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

nav {
    display: flex;
    flex-wrap: wrap;
    background-color: #e0e0e0;
}

nav a {
    flex: 1 1 100%;
    padding: 12px 0;
    text-align: center;
    font-size: 1em;
    text-decoration: none;
    color: black;
    background-color: #ccc;
    border-bottom: 1px solid #bbb;
}

@media (min-width: 400px) {
    nav a {
        flex: 1;
        border-right: 1px solid #bbb;
        border-bottom: none;
    }

    nav a:last-child {
        border-right: none;
    }
}

nav a:hover {
    background-color: #bbb;
}

.content {
    padding: 20px clamp(20px, calc(10px + 2.5vw), 30px) 40px;
}

h2 {
    margin-top: 40px;
    font-size: 1.2em;
}
div.content > h2:first-child {
    margin-top: 16px;
}

ul {
    padding-left: 20px;
}

ul li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.staff-list {
    margin-top: 20px;
}

.staff-card {
    border-bottom: 1px solid #ccc;
    padding: 12px 0;
    font-size: 1em;
    line-height: 1.6;
}

.staff-card a {
    text-decoration: none;
    color: #0066cc;
    font-weight: bold;
}

.staff-card a:hover {
    text-decoration: underline;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.table-container table {
    border-collapse: collapse;
    width: 100%;
    min-width: 600px;
}

col.col-year {
    width: 10%;
}

col.col-math {
    width: 30%;
}

col.col-physics {
    width: 35%;
}

col.col-lab {
    width: 25%;
}

.subj-mark {
    vertical-align: super;
    font-size: 0.6em;
    -webkit-user-select: none;
    user-select: none;
}

.subj-mark::before {
    content: "\feff";
}

.subj-comp {
    color: #B35136;
}

.subj-comp-elect {
    color: #5859B0;
}

.subj-basic {
    color: #147A6E;
}

/* .subject-major {
    color: inherit;
} */

.subj-legend {
    display: flex;
    flex-wrap: wrap;
    row-gap: 0.3rem;
    column-gap: 1.5rem;
}

.subj-legend div {
    display: flex;
}

.subj-legend dt {
    margin: 0;
    display: flex;
}

.subj-legend dd {
    margin: 0;
    margin-left: 0.25rem;
}

.table-container table th, .table-container table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
}

.table-container table th[scope="col"] {
    background-color: #f0f0f0;
}

.table-container table ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-container table ul li {
    margin: 0;
    margin-top: 8px;
    line-height: 1.4;
}

.table-container table ul li:first-child {
    margin-top: 0;
}

.staff {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    margin-top: 16px;
}

.staff img {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.staff-summary {
    flex: 1;
    min-width: 200px;
}

.staff-name {
    font-size: 1.2em;
    font-weight: bold;
}

.staff-title {
    color: #666;
    margin-top: 4px;
}

.homepage-link {
    margin-top: 8px;
    display: inline-block;
    font-size: 0.95em;
    color: #006400;
}

.staff-info {
    margin-top: 30px;
}

.info-block {
    margin-bottom: 15px;
}

.info-label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    color: #444;
}

.info-content {
    padding-left: 10px;
}

@media (max-width: 400px) {
    .staff {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .staff img {
        margin-bottom: 10px;
    }

    .staff-summary {
        text-align: center;
    }

    .info-content {
        padding-left: 0;
    }
}