/* UAMATH Common Styles */

body {
    font-family: 'Malgun Gothic', sans-serif;
    padding: 40px;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #333;
    padding-bottom: 10px;
}

.problem {
    margin-bottom: 100px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    page-break-inside: avoid;
}

.answer-line {
    float: right;
    margin-top: 10px;
    font-weight: bold;
    font-size: 1.1rem;
}

.problem::after {
    content: "";
    display: table;
    clear: both;
}

.problem-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}

.test-header {
    width: 100%;
    margin-bottom: 30px;
}

.header-top {
    display: flex;
    justify-content: flex-end;
    border-top: 2px solid #000;
    padding-top: 5px;
}

.header-logo {
    height: 30px;
}

.main-title {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 900;
    margin: 15px 0 5px 0;
    letter-spacing: 12px;
}

.info-bar {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    flex: 1;
}

.info-left,
.info-right {
    background: #fff;
    color: #888;
    font-size: 1.1rem;
}

.info-center {
    flex: 2;
    background: #6283d1;
    color: #fff;
    font-weight: bold;
    font-size: 1.6rem;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
}

.user-info {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-bottom: 2px solid #000;
    font-size: 1.2rem;
}

.info-field {
    flex: 1;
    text-align: center;
}

.simple-header {
    display: none;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 10px;
    overflow: hidden;
    height: 40px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    background: #fff;
}

.simple-left {
    padding: 0 20px;
    color: #888;
    flex: 1;
    white-space: nowrap;
    font-size: 80%;
}

sup {
    vertical-align: baseline;
    position: relative;
    top: -0.4em;
    font-size: 0.8em;
}

sub {
    vertical-align: baseline;
    position: relative;
    top: 0.4em;
    font-size: 0.8em;
}

.simple-center {
    background: #6283d1;
    color: #fff;
    font-weight: bold;
    flex: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.simple-right {
    padding: 0 20px;
    color: #888;
    flex: 1;
    text-align: right;
    white-space: nowrap;
    font-size: 80%;
}

.fixed-logo {
    display: none;
}

.footer {
    margin-top: 30px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9em;
}

.choices {
    margin: 10px 0;
}

.choice-item {
    margin-right: 15px;
    display: inline-block;
}

.geometry-container {
    text-align: center;
    margin: 15px 0;
}

.answer-key {
    margin-top: 50px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

@media print {
    @page {
        margin-top: 60px;
        /* 중요: 모든 페이지에서 본문이 시작될 물리적 여백 */
        margin-bottom: 50px;
        margin-left: 20mm;
        margin-right: 20mm;
    }

    .answer-key {
        break-before: page;
        margin-top: 0;
        border-left: none;
        padding-top: 20px;
    }

    .no-print {
        display: none;
    }

    body {
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
        max-width: none !important;
        margin: 0 !important;
    }

    /* 
       고정 헤더(fixed)는 인쇄 시 본문 영역 기준(top 150px 지점)으로 배치됩니다. 
       로고와 바를 여백 공간(0~150px)으로 올리기 위해 음수(-) top 값을 사용합니다.
    */
    .fixed-logo {
        display: block !important;
        position: fixed;
        top: 0px !important;
        /* 여백 내 상단 배치 */
        right: 0px;
        height: 35px;
        z-index: 9999;
    }

    .first-page-header {
        position: relative;
        z-index: 1000;
        background: #fff;
        margin-top: 90px;
        /* 반복 바를 가리기 위한 조정 */
        padding-top: 0px;
        margin-bottom: 20px;
    }

    .simple-header {
        display: flex !important;
        position: fixed;
        top: 40px !important;
        /* 로고 아래 바 배치 */
        left: 0px;
        right: 0px;
        z-index: 5000;
    }

    .info-center,
    .simple-center {
        background-color: #6283d1 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}