@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&display=swap');

/* 全体設定 */
body {
    font-family: "Noto Sans JP", sans-serif;
    background: #f5f7fb;
    color: #333;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    margin-top: 4rem;
}


/* タイトル */
h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
}

/* セクションタイトル */
h2 {
    margin-top: 30px;
    color: #34495e;
    border-left: 5px solid #4a90e2;
    padding-left: 10px;
}

h3 {
    border-bottom: 2px solid black;
}

/* ボタン */
.navigate {
    padding: 15px 35px;
    background: #ff5700;
    border-radius: 9999px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    cursor: pointer;
}

/* リスト */
ul.subject-container {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

/* 各科目カード */
li a {
    display: block;
    background: white;
    padding: 15px;
    text-align: center;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: 0.2s;
}

/* ホバー */
li a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    background: #4a90e2;
    color: white;
}

.nowrap {
    white-space: nowrap;
}

.select-container {
    position: relative;
    width: 200px;
}

.select-container select {
    width: 100%;
    padding: 10px;
    appearance: none;
    /* removes default arrow */
    border: 1px solid #ccc;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

/* custom arrow */
.select-container::after {
    content: "▼";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.description {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.workspace {
    background-color: white;
    padding: 10px;
}

/* 例文テスト */
table {
    width: 100%;
    border-collapse: collapse;
    /* 枠線を重ねて1本にする */
}

tr {
    height: 100px;
    break-inside: avoid;
    page-break-inside: avoid;
}

th,
td {
    border: 1px solid #ccc;
    /* セル内の線は細く */
    text-align: left;
}

th {
    background-color: #f4f4f4;
}

.s_num {
    width: 5%;
    text-align: center;
    vertical-align: center;
}

.s_main {
    vertical-align: top;
}

.sample_container {
    border-bottom: 1px solid #ccc;
    padding: 10px;
}

.workspace {
    display: none;
}

.download-note {
    margin-top: 20px;
    color: #666;
}

/* スマホ対応 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 22px;
    }
}

/* 印刷時 */
@media print {
    body> :not(.workspace) {
        display: none !important;
    }

    .workspace,
    .workspace * {
        visibility: visible;
    }

    .workspace {
        display: block;
        position: static;
        top: auto;
        left: auto;
    }
}

@page {
    size: A4;
    margin: 5mm;
}

/* 化学式テスト印刷 */
.chemical-print-sheet {
    box-sizing: border-box;
    padding: 0;
    font-size: 12.5px;
    line-height: 1.1;
}

.chemical-print-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6mm;
    border-bottom: 1px solid #222;
    margin-bottom: 2mm;
    padding-bottom: 1mm;
}

.chemical-print-header h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
}

.chemical-name {
    flex: 0 0 42mm;
    border-bottom: 1px solid #222;
    padding-bottom: 1mm;
    font-size: 12px;
}

.chemical-print-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4mm;
}

.chemical-print-column:first-child {
    padding-right: 4mm;
    border-right: 1px solid #888;
}

.chemical-print-column h2 {
    margin: 0 0 1.5mm;
    border-left: 3px solid #222;
    padding-left: 2mm;
    color: #111;
    font-size: 12.5px;
    line-height: 1.15;
}

.chemical-questions {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 0.25mm;
}

.chemical-question {
    display: grid;
    grid-template-columns: 5mm minmax(31mm, 1fr) minmax(23mm, 32mm);
    align-items: center;
    gap: 1.5mm;
    min-height: 8.75mm;
    break-inside: avoid;
    page-break-inside: avoid;
}

.chemical-num {
    text-align: right;
    font-size: 10px;
}

.chemical-prompt {
    overflow-wrap: anywhere;
}

.chemical-prompt sub,
.chemical-prompt sup {
    font-size: 70%;
    line-height: 0;
}

.chemical-answer {
    display: block;
    height: 7.25mm;
    border-bottom: 1px solid #222;
}

.name-answer {
    min-width: 28mm;
}

@media print {
    body {
        margin: 0;
        padding: 0;
        background: #fff;
        line-height: 1.1;
    }

    .workspace {
        box-sizing: border-box;
        width: 100%;
        padding: 0;
        background: #fff;
    }
}