:root {
    font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft YaHei UI", "Microsoft YaHei", SimHei, sans-serif;
    color: #000;
    background: #fff;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    background: #fff;
}

[hidden] { display: none !important; }

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(145deg, #edf8fc, #ffffff 55%, #e7f4f9);
}

.login-card {
    width: min(420px, 100%);
    padding: 34px 36px 28px;
    border: 1px solid #d5e3e9;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 20px 55px rgba(35, 76, 94, .14);
}

.login-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.login-brand img { width: 58px; height: 60px; object-fit: contain; }
.login-brand p { margin: 0 0 4px; color: #1d2c33; font-size: 16px; font-weight: 700; }
.login-brand h1 { display: block; width: auto; margin: 0; color: #1775a4; font-size: 23px; line-height: 1.4; text-align: left; }
.login-form { display: grid; gap: 17px; }
.login-form label span { display: block; margin-bottom: 7px; color: #354851; font-size: 13px; font-weight: 700; }
.login-form input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #c8d6dc; border-radius: 6px; color: #17252c; background: #fff; font: inherit; font-size: 14px; }
.login-form input:focus { outline: 2px solid rgba(23, 117, 164, .18); border-color: #1775a4; }
.login-form button { height: 44px; border: 0; border-radius: 6px; color: #fff; background: #1775a4; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.login-form button:hover { background: #12658d; }
.login-error { min-height: 18px; margin: -6px 0 -5px; color: #c12d3b; font-size: 12px; }
.login-tip { margin: 20px 0 0; color: #7c8a90; font-size: 11px; text-align: center; }

.page-shell {
    width: 810px;
    max-width: calc(100% - 32px);
    margin: 35px auto 0;
}

.school-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 810px;
    height: 106px;
    max-width: 100%;
    padding-right: 170px;
    margin-bottom: 10px;
}

.school-logo {
    width: 75px;
    height: 76.675px;
    object-fit: contain;
}

h1 {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 300px;
    margin: 0;
    font-size: 24px;
    line-height: 38px;
    font-weight: 700;
    text-align: center;
}

.record-wrap {
    position: relative;
    width: 742px;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
}

.record-table {
    position: relative;
    z-index: 1;
    width: 100%;
    border: 1px outset #000;
    border-collapse: collapse;
    table-layout: fixed;
    color: #000;
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    text-align: center;
    background-color: transparent;
    background-image: url("https://zzx.ouchn.edu.cn/graduation/images/bg1.jpg");
    background-size: auto;
    background-position: 0 0;
    background-repeat: no-repeat;
    background-origin: padding-box;
    background-clip: border-box;
}

.record-table tr:nth-child(-n + 3) {
    height: 45.6px;
}

.record-table tr:nth-child(4),
.record-table tr:nth-child(5) {
    height: 29.2px;
}

.record-table tr:nth-child(6) {
    height: 47.6px;
}

.record-table th, .record-table td {
    height: inherit;
    padding: 5px;
    border: 1px inset #000;
    color: #000;
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    vertical-align: middle;
    text-align: center;
    overflow-wrap: normal;
}

.record-table th {
    font-weight: 400;
    white-space: normal;
}

.col-label-a {
    width: 15%;
}

.col-value-a {
    width: 21.5%;
}

.col-label-b {
    width: 17.3%;
}

.col-value-b {
    width: 15%;
}

.col-label-c {
    width: 15%;
}

.col-photo {
    width: 16.2%;
}

.photo-cell {
    position: relative;
    padding: 0 !important;
    background: #71c9f1;
}

.portrait-sprite {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background-size: 300% 300%;
    background-repeat: no-repeat;
}

.portrait-sticker-mask {
    position: absolute;
    z-index: 2;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.portrait-sticker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 130%;
    height: auto;
    object-fit: contain;
    transform: translate(-50%, -50%);
}

.demo-stamp {
    position: absolute;
    z-index: 3;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%) rotate(-16deg);
    color: rgba(183, 12, 25, .14);
    font-size: 42px;
    font-weight: 900;
    white-space: nowrap;
    pointer-events: none;
}

.demo-notice {
    width: 742px;
    max-width: 100%;
    margin: 14px 0 0;
    color: #a1232e;
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

.generator-panel {
    width: 742px;
    max-width: 100%;
    margin: 32px 0 48px;
    padding: 24px;
    border: 1px solid #d9e2e7;
    border-radius: 10px;
    background: #f8fbfc;
    box-shadow: 0 8px 28px rgba(28, 66, 82, .08);
}

.generator-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.generator-heading .eyebrow {
    margin: 0 0 4px;
    color: #1775a4;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
}

.generator-heading h2 { margin: 0; font-size: 21px; }
.generator-heading > p { margin: 0; color: #6b7a82; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid label > span { display: block; margin-bottom: 7px; color: #36464f; font-size: 13px; font-weight: 700; }
.form-grid input, .form-grid select { width: 100%; min-width: 0; height: 40px; padding: 0 11px; border: 1px solid #cbd7dd; border-radius: 6px; color: #17252c; background: #fff; font: inherit; font-size: 14px; }
.form-grid input:focus, .form-grid select:focus { outline: 2px solid rgba(23,117,164,.2); border-color: #1775a4; }
.portrait-upload-field > label { display: block; margin-bottom: 7px; color: #36464f; font-size: 13px; font-weight: 700; }
.portrait-upload-controls { display: flex; gap: 8px; }
.portrait-upload-controls input { flex: 1; min-width: 0; height: 40px; padding: 5px; }
.portrait-upload-controls input::file-selector-button { margin-right: 8px; padding: 5px 9px; border: 1px solid #cbd7dd; border-radius: 4px; background: #f4f8fa; cursor: pointer; }
.portrait-upload-controls button { padding: 0 10px; border: 1px solid #cbd7dd; border-radius: 6px; color: #52646d; background: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.portrait-upload-field small { display: block; margin-top: 5px; color: #6b7a82; font-size: 12px; }
.mask-toggle-field .mask-toggle-control { display: flex; align-items: center; gap: 9px; height: 40px; margin: 0; padding: 0 11px; border: 1px solid #cbd7dd; border-radius: 6px; color: #17252c; background: #fff; font-size: 14px; font-weight: 400; cursor: pointer; }
.mask-toggle-field input { width: 16px; min-width: 16px; height: 16px; margin: 0; padding: 0; accent-color: #1775a4; }
.generate-button { width: 100%; margin-top: 20px; padding: 11px 16px; border: 0; border-radius: 6px; color: #fff; background: #1775a4; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.generate-button:hover { background: #12658d; }
.generate-button:focus-visible { outline: 3px solid rgba(23,117,164,.3); outline-offset: 2px; }
.logout-button { width: 100%; margin-top: 10px; padding: 10px 16px; border: 1px solid #c8d6dc; border-radius: 6px; color: #52646d; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.logout-button:hover { color: #a3222f; border-color: #d9a8ae; background: #fff8f8; }
.logout-button:focus-visible { outline: 3px solid rgba(163,34,47,.18); outline-offset: 2px; }

@media (max-width: 760px) {
    .page-shell {
        max-width: calc(100% - 20px);
        margin-top: 22px;
    }

    .school-header {
        height: auto;
        justify-content: flex-start;
        gap: 12px;
        padding-right: 0;
        margin-bottom: 16px;
    }

    .school-logo {
        width: 58px;
        height: auto;
    }

    h1 {
        width: auto;
        margin: 8px 0;
        font-size: clamp(18px, 4.7vw, 22px);
        line-height: 1.55;
    }

    .record-wrap {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .record-table {
        min-width: 742px;
    }

    .demo-stamp {
        position: fixed;
        font-size: 30px;
    }

    .demo-notice {
        font-size: 11px;
    }

    .generator-panel { padding: 18px; }
    .generator-heading { display: block; }
    .generator-heading > p { margin-top: 6px; }
    .form-grid { grid-template-columns: 1fr; gap: 13px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
    .page-shell {
        margin-top: 28px;
    }

    .demo-notice {
        display: none;
    }

    .demo-stamp {
        color: rgba(183, 12, 25, .18);
    }
}
