* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", "MS PGothic", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* ログインページ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
    color: #333;
}

.login-box h2 {
    font-size: 18px;
    margin-bottom: 16px;
    text-align: center;
    color: #666;
    font-weight: normal;
}

.login-hint {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 24px;
    padding: 12px;
    background: #f7f8fc;
    border-radius: 4px;
    text-align: center;
}

.quiz-login-page {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
}

.quiz-login-page .login-box h1 {
    color: #2e7d32;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* チェックボックスやラジオボタンは全幅にしない */
.form-group input[type="checkbox"],
.form-group input[type="radio"] {
    width: auto;
    padding: 0;
}

.error-message {
    background-color: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background-color: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.3s;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.btn-primary:hover {
    background-color: #5568d3;
    color: #fff;
}

/* 管理画面 */
.admin-page {
    min-height: 100vh;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* サイドバー */
.sidebar {
    width: 200px;
    background-color: #2c3e50;
    color: #fff;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
}

.sidebar-header h1 {
    font-size: 20px;
    margin-bottom: 10px;
}

.logout-link {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.logout-link:hover {
    background-color: #34495e;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-heading {
    font-size: 14px;
    font-weight: bold;
    padding: 10px 20px;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: background-color 0.3s;
}

.nav-menu a:hover {
    background-color: #34495e;
}

.nav-menu a.active {
    background-color: #3498db;
    color: #fff;
}

/* ステータス表示の色（受講中/終了/入金） */
.status-taking { color: #28a745; font-weight: bold; }
.status-finished { color: #6f42c1; font-weight: bold; }
.status-paid { color: #007bff; font-weight: bold; }
.status-unpaid { color: #dc3545; font-weight: bold; }
.status-insufficient { color: #fd7e14; font-weight: bold; }
.status-overpayment { color: #6c757d; font-weight: bold; }
.curriculum-achieved { color: #28a745; font-weight: bold; }
.curriculum-not-achieved { color: #dc3545; font-weight: bold; }

/* 試験結果エクスポート: N1～N5 の CSV/クイズ 有無（◯青 / ✕黒） */
.exam-ok { color: #0066cc; font-weight: bold; }
.exam-ng { color: #000; }
.exam-sep { color: #ccc; margin: 0 2px; }
.exam-level-col { white-space: nowrap; text-align: center; }
.exam-level-cell { text-align: center; white-space: nowrap; }

/* メインコンテンツ */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-x: auto;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
}

.content-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.content-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* フィルターセクション */
.filter-section {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-item {
    display: flex;
    align-items: center;
}

.filter-item-nationalities {
    flex: 1 1 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.filter-group-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.nationality-checkboxes {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 10px 16px;
    width: 100%;
    max-width: 540px;
}

.nationality-checkboxes .checkbox-label {
    font-size: 13px;
    white-space: nowrap;
    min-width: 0;
}

.filter-note {
    font-size: 13px;
    color: #666;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 300px;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    margin-right: 15px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 16px;
    background-color: #95a5a6;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    margin-left: 10px;
    transition: background-color 0.3s;
    white-space: nowrap;
    box-sizing: border-box;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    color: #fff;
}

/* フィルター内の検索・リセットボタンの高さを揃える */
.filter-form .btn-primary,
.filter-form .btn-secondary {
    height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1.2;
    box-sizing: border-box;
}
.filter-form .btn-primary {
    width: auto;
}

/* テーブル（レコードが多いときも横スクロールバーが画面内に収まるよう、縦方向に最大高を設けてスクロール） */
.table-container {
    background: #fff;
    border-radius: 8px;
    max-height: 70vh;
    overflow: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.data-table thead {
    background-color: #34495e;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}

.data-table th a {
    color: #fff;
    text-decoration: none;
}

.data-table tbody tr {
    border-bottom: 1px solid #eee;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

.data-table td {
    padding: 12px 15px;
    font-size: 14px;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* ソートボタン */
.sort-btn {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 5px;
    text-decoration: none;
    color: #ecf0f1;
    font-size: 12px;
    transition: color 0.3s;
}

.sort-btn:hover {
    color: #fff;
}

.sort-btn.active {
    color: #3498db;
    font-weight: bold;
}

/* 詳細ボタン */
.btn-detail {
    display: inline-block;
    padding: 6px 12px;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}

.btn-detail:hover {
    background-color: #2980b9;
    color: #fff;
}

/* 削除ボタン（他の操作ボタンと同様・白文字） */
.btn-danger-text {
    color: #fff;
}

.btn-danger-text:hover {
    color: #fff;
}

.admin-page button.btn-primary,
.admin-page button.btn-secondary,
.admin-page button.btn-detail,
.admin-page button.btn-danger-text,
.admin-page button.btn-sort-arrow {
    border: none;
    box-shadow: none;
}

.quiz-list-actions {
    min-width: 280px;
}

.quiz-list-action-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.quiz-inline-form,
.quiz-add-set-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.quiz-set-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 12px;
}

.quiz-set-checkbox-item {
    display: block;
    padding: 8px 10px;
    background: #f9f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.quiz-sort-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-sort-arrow {
    min-width: 32px;
    padding: 4px 8px;
    font-weight: bold;
}

.btn-sort-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.quiz-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.quiz-modal[hidden] {
    display: none !important;
}

.quiz-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.quiz-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.quiz-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.quiz-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.quiz-modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.quiz-modal-body {
    padding: 20px;
}

.quiz-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

body.quiz-modal-open {
    overflow: hidden;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background-color: #95a5a6;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.btn-back:hover {
    background-color: #7f8c8d;
}

/* メッセージ */
.message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* フォーム */
.student-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.form-group .required {
    color: #e74c3c;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group .form-readonly {
    padding: 8px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    font-size: 14px;
    background: #f5f5f5;
    color: #333;
    min-height: 20px;
}

.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: 1;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .content-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .btn-back {
        margin-left: 0;
        margin-top: 0;
    }
}

/* 申込フォームページ */
.apply-page {
    background-color: #f5f5f5;
    min-height: 100vh;
    padding: 40px 20px;
}

.apply-container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.apply-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #667eea;
}

.apply-header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.apply-subtitle {
    color: #666;
    font-size: 16px;
}

/* 自動入力ボタン */
.btn-auto-fill {
    padding: 8px 16px;
    background-color: #f39c12;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-auto-fill:hover {
    background-color: #e67e22;
}

/* エラーボックス */
.error-box {
    background-color: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #fcc;
}

.error-message {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

/* 申込フォーム */
.apply-form .form-section {
    margin-bottom: 40px;
}

.apply-form .section-title {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.apply-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.apply-form .form-group {
    display: flex;
    flex-direction: column;
}

.apply-form .form-group.full-width {
    grid-column: 1 / -1;
}

.apply-form .form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.apply-form .form-group .required {
    color: #e74c3c;
}

.apply-form .form-group input,
.apply-form .form-group select,
.apply-form .form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.apply-form .form-group input:focus,
.apply-form .form-group select:focus,
.apply-form .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.apply-form .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 利用規約ページ */
.terms-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 30px;
    line-height: 1.8;
}

.terms-content h2 {
    font-size: 18px;
    color: #2c3e50;
    margin-top: 20px;
    margin-bottom: 10px;
}

.terms-content h2:first-child {
    margin-top: 0;
}

.terms-content p {
    margin-bottom: 15px;
    color: #555;
}

.terms-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.terms-content li {
    margin-bottom: 5px;
    color: #555;
}

.terms-form {
    margin-top: 30px;
}

.agree-checkbox {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

.agree-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
}

.agree-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* 確認画面 */
.confirm-content {
    margin-bottom: 30px;
}

.confirm-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.confirm-list {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px 20px;
    margin-top: 15px;
}

.confirm-list dt {
    font-weight: bold;
    color: #555;
    padding: 8px 0;
}

.confirm-list dd {
    color: #333;
    padding: 8px 0;
    margin: 0;
}

/* 完了画面 */
.complete-content {
    text-align: center;
    padding: 40px 20px;
}

.complete-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background-color: #27ae60;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    font-weight: bold;
}

.complete-title {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.complete-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.8;
}

.student-no-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px;
    border-radius: 8px;
    margin: 40px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.student-no-label {
    font-size: 18px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.student-no-value {
    font-size: 48px;
    font-weight: bold;
    letter-spacing: 4px;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.student-no-note {
    font-size: 14px;
    margin-top: 20px;
    opacity: 0.9;
    line-height: 1.6;
}

.complete-info {
    text-align: left;
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.complete-info h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.complete-info ol {
    margin-left: 20px;
    line-height: 2;
    color: #555;
}

.complete-info li {
    margin-bottom: 10px;
}

.info-note {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 14px;
    text-align: center;
}

/* ヒアリングURL表示 */
.hearing-url-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hearing-url-box h2 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.hearing-url-box > p {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

.hearing-url-container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    border: 2px dashed #667eea;
}

.hearing-url-label {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.hearing-url-value {
    background: #fff;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    word-break: break-all;
}

.hearing-url-link {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
}

.hearing-url-link:hover {
    text-decoration: underline;
}

.hearing-url-note {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 10px;
}

/* 読み取り専用セクション */
.readonly-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 30px;
}

.student-no-display {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
    letter-spacing: 2px;
    text-align: center;
}

/* レスポンシブ（申込フォーム） */
@media (max-width: 768px) {
    .apply-container {
        padding: 20px;
    }

    .apply-form .form-grid {
        grid-template-columns: 1fr;
    }

    .apply-form .form-group.full-width {
        grid-column: 1;
    }

    .confirm-list {
        grid-template-columns: 1fr;
    }

    .confirm-list dt {
        border-bottom: 1px solid #ddd;
        padding-bottom: 5px;
        margin-bottom: 5px;
    }

    .student-no-value {
        font-size: 36px;
        letter-spacing: 2px;
    }

    .complete-info {
        padding: 20px;
    }
}

/* 問題回答（受講生） */
.quiz-page {
    background: #eef1f8;
    min-height: 100vh;
}

.quiz-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #667eea;
}

.quiz-header h1 {
    font-size: 24px;
    color: #333;
}

.quiz-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.quiz-tab {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    color: #555;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s;
}

.quiz-tab:hover {
    border-color: #667eea;
    color: #667eea;
}

.quiz-tab.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.quiz-info-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quiz-info-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #667eea;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.quiz-dl {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px 16px;
}

.quiz-dl dt {
    font-weight: bold;
    color: #666;
}

.quiz-dl dd {
    margin: 0;
}

.quiz-select-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quiz-select-list li {
    margin-bottom: 8px;
}

.quiz-select-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f9f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.quiz-select-item:hover {
    background: #eef1ff;
    border-color: #667eea;
}

.quiz-select-item span {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

.quiz-question-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quiz-question-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #667eea;
}

.quiz-question-text {
    font-size: 16px;
    margin-bottom: 16px;
    line-height: 1.8;
}

.quiz-question-text p {
    margin: 0 0 0.75em;
}

.quiz-question-text p:last-child {
    margin-bottom: 0;
}

.quiz-question-text ruby rt {
    font-size: 0.55em;
}

.quiz-media-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 12px;
}

.quiz-media-audio {
    width: 100%;
    max-width: 480px;
}

.quiz-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-choice-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #f9f9fb;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.quiz-choice-label:hover {
    background: #eef1ff;
    border-color: #667eea;
}

.quiz-choice-label input {
    margin-top: 4px;
    flex-shrink: 0;
}

.quiz-result-summary {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quiz-result-summary h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.quiz-score {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 4px;
}

.quiz-score-rate {
    font-size: 18px;
    color: #888;
}

.quiz-pass-result {
    font-size: 52px;
    font-weight: bold;
    margin: 8px 0 20px;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

/* 試験結果: 合格＝赤、不合格＝青 */
.quiz-pass-result.quiz-pass-ok {
    color: #d32f2f;
}

.quiz-pass-result.quiz-pass-ng {
    color: #1565c0;
}

.quiz-pass-badge.quiz-pass-ok {
    color: #2e7d32;
}

.quiz-pass-badge.quiz-pass-ng {
    color: #c62828;
}

.quiz-pass-badge {
    display: inline-block;
    font-weight: bold;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.quiz-pass-badge.quiz-pass-ok {
    background: #e8f5e9;
}

.quiz-pass-badge.quiz-pass-ng {
    background: #ffebee;
}

.quiz-pass-criteria-note {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

.quiz-wrong-card {
    border-left: 4px solid #e53935;
}

.quiz-wrong-answer {
    color: #c62828;
    margin: 8px 0;
}

.quiz-correct-answer {
    color: #2e7d32;
    margin: 8px 0;
}

.quiz-perfect {
    font-size: 18px;
    color: #2e7d32;
    text-align: center;
    padding: 24px;
}

.quiz-notes-text {
    line-height: 1.8;
}

.quiz-question-notes {
    margin-top: 12px;
    padding: 12px;
    background: #f7f8fc;
    border-radius: 4px;
    line-height: 1.7;
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .quiz-dl {
        grid-template-columns: 1fr;
    }

    .quiz-dl dt {
        margin-top: 8px;
    }

    .quiz-select-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
