* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', Meiryo, メイリオ, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }
        
        @media (max-width: 768px) {
            body {
                padding: 10px;
            }
        }
        
        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: white;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            overflow: hidden;
        }
        
        .header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            text-align: center;
        }
        
        .header h1 {
            font-size: 28px;
            margin-bottom: 10px;
        }
        
        .header p {
            font-size: 14px;
            opacity: 0.9;
        }
        
        @media (max-width: 768px) {
            .header h1 {
                font-size: 20px;
            }
            
            .header p {
                font-size: 12px;
            }
        }
        
        .student-info {
            padding: 20px 30px;
            background: #f8f9fa;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            align-items: center;
        }
        
        .student-info input {
            padding: 10px 15px;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            width: 300px;
            max-width: 100%;
        }
        
        .student-info .input-narrow {
            width: 160px;
        }
        
        @media (max-width: 768px) {
            .student-info {
                padding: 15px;
                flex-direction: column;
                align-items: flex-start;
            }
            
            .student-info input,
            .student-info .field-narrow,
            .student-info .input-narrow {
                width: 100%;
            }
        }
        
        .main-content {
            display: grid;
            grid-template-columns: 1fr 450px;
            gap: 0;
            min-height: 600px;
        }
        
        .chart-section-bottom {
            display: none; /* PC表示では非表示 */
        }
        
        @media (max-width: 1024px) {
            .main-content {
                grid-template-columns: 1fr;
            }
            
            .chart-section {
                display: none; /* スマホ表示では上部チャートを非表示 */
            }
            
            /* スマホ表示時に下部にもチャートを表示 */
            .chart-section-bottom {
                display: block !important;
                background: #f8f9fa;
                padding: 30px;
                border-top: 2px solid #e0e0e0;
                margin-top: 20px;
            }
        }
        
        .questions-section {
            padding: 30px;
            overflow-y: auto;
            max-height: 800px;
        }
        
        @media (max-width: 768px) {
            .questions-section {
                padding: 15px;
                max-height: none;
            }
        }
        
        .chart-section {
            background: #f8f9fa;
            padding: 30px;
            border-left: 1px solid #e0e0e0;
            position: sticky;
            top: 0;
            height: fit-content;
            max-height: 800px;
            overflow-y: auto;
        }
        
        @media (max-width: 768px) {
            .chart-section {
                padding: 20px 15px;
            }
        }
        
        .category {
            margin-bottom: 30px;
            padding: 20px;
            background: #fff;
            border-radius: 12px;
            border: 2px solid #e0e0e0;
        }
        
        @media (max-width: 768px) {
            .category {
                padding: 15px;
                margin-bottom: 20px;
            }
        }
        
        .category-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 15px 20px;
            margin: -20px -20px 20px -20px;
            border-radius: 10px 10px 0 0;
            font-weight: bold;
            font-size: 18px;
        }
        
        @media (max-width: 768px) {
            .category-header {
                padding: 12px 15px;
                margin: -15px -15px 15px -15px;
                font-size: 16px;
            }
        }
        
        .ability {
            margin-bottom: 25px;
            padding: 15px;
            background: #f9f9f9;
            border-radius: 8px;
        }
        
        .ability-title {
            font-weight: bold;
            font-size: 16px;
            margin-bottom: 5px;
            color: #667eea;
        }
        
        .ability-definition {
            font-size: 13px;
            color: #666;
            margin-bottom: 15px;
            padding-left: 10px;
            border-left: 3px solid #667eea;
        }
        
        .question {
            margin-bottom: 15px;
            padding: 12px;
            background: white;
            border-radius: 6px;
            border: 1px solid #e0e0e0;
        }
        
        .question-text {
            font-size: 14px;
            margin-bottom: 10px;
            color: #333;
        }
        
        .rating-buttons {
            display: flex;
            gap: 8px;
            justify-content: flex-start;
            flex-wrap: wrap;
        }
        
        .rating-btn {
            width: 45px;
            height: 45px;
            border: 2px solid #ddd;
            background: white;
            border-radius: 50%;
            cursor: pointer;
            font-weight: bold;
            font-size: 16px;
            transition: all 0.3s ease;
            touch-action: manipulation; /* タッチ操作の最適化 */
        }
        
        @media (max-width: 768px) {
            .rating-btn {
                width: 50px;
                height: 50px;
                font-size: 18px;
            }
        }
        
        @media (max-width: 480px) {
            .rating-buttons {
                justify-content: space-between;
            }
            
            .rating-btn {
                width: 55px;
                height: 55px;
                font-size: 20px;
            }
        }
        
        .rating-btn:hover {
            transform: scale(1.1);
            border-color: #667eea;
        }
        
        .rating-btn.selected {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-color: #667eea;
            transform: scale(1.15);
        }
        
        .chart-container {
            position: relative;
            height: 400px;
            margin-bottom: 20px;
        }
        
        .chart-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 15px;
            text-align: center;
            color: #333;
        }
        
        .stats {
            margin-top: 20px;
            padding: 15px;
            background: white;
            border-radius: 8px;
            border: 2px solid #667eea;
        }
        
        .stat-item {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            font-size: 14px;
            border-bottom: 1px solid #f0f0f0;
        }
        
        .stat-item:last-child {
            border-bottom: none;
        }
        
        .stat-value {
            font-weight: bold;
            color: #667eea;
        }
        
        .free-input-section {
            margin-top: 30px;
            padding: 25px;
            background: #f0f4ff;
            border-radius: 12px;
            border: 2px solid #667eea;
        }
        
        .completion-message {
            margin-bottom: 20px;
            padding: 15px;
            background: #fff3cd; /* 初期状態は警告色 */
            border-radius: 8px;
            text-align: center;
            transition: background 0.3s ease; /* 背景色の変化をスムーズに */
        }
        
        @media (max-width: 768px) {
            .completion-message {
                margin: 0 0 20px 0;
            }
        }
        
        .free-input-title {
            font-size: 18px;
            font-weight: bold;
            margin-bottom: 15px;
            color: #333;
        }
        
        .free-input {
            width: 100%;
            min-height: 150px;
            padding: 15px;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-size: 14px;
            font-family: inherit;
            resize: vertical;
        }
        
        .free-input:focus {
            outline: none;
            border-color: #667eea;
        }
        
        .submit-button-container {
            margin-top: 20px;
            text-align: center;
        }
        
        .submit-button {
            padding: 15px 40px;
            font-size: 18px;
            font-weight: bold;
            color: white;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        }
        
        .submit-button:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
        }
        
        .submit-button:active:not(:disabled) {
            transform: translateY(0);
        }
        
        .submit-button:disabled {
            background: #ccc;
            cursor: not-allowed;
            box-shadow: none;
        }
        
        .submit-success {
            display: none;
            margin-top: 20px;
            padding: 20px;
            background: #e8f5e9;
            border-radius: 12px;
            text-align: center;
            border: 2px solid #4caf50;
        }
        
        .progress-bar {
            height: 8px;
            background: #e0e0e0;
            border-radius: 4px;
            margin: 20px 0;
            overflow: hidden;
        }
        
        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            border-radius: 4px;
            transition: width 0.3s ease;
            width: 0%;
        }
        
        .rating-legend {
            margin-top: 15px;
            padding: 15px;
            background: #fff3cd;
            border-radius: 8px;
            font-size: 12px;
            line-height: 1.6;
        }
        
        .rating-legend-title {
            font-weight: bold;
            margin-bottom: 8px;
            color: #856404;
        }
        
        .rating-legend-top {
            display: none; /* PC表示では非表示（左側セクション内に表示） */
        }
        
        @media (max-width: 1024px) {
            .rating-legend-top {
                display: block;
                margin: 0 15px 20px 15px;
                padding: 15px;
                background: #fff3cd;
                border-radius: 8px;
                font-size: 13px;
                line-height: 1.6;
            }
        }
        
        .rating-legend-left {
            margin-bottom: 20px;
            padding: 15px;
            background: #fff3cd;
            border-radius: 8px;
            font-size: 13px;
            line-height: 1.6;
        }
        
        @media (max-width: 1024px) {
            .rating-legend-left {
                display: none; /* スマホでは上部のみ表示 */
            }

/* ==== identify.html / quiz.html 追加分 ==== */
.identify-card {
    padding: 30px;
}

@media (max-width: 768px) {
    .identify-card {
        padding: 20px;
    }
}

.identify-field {
    margin-bottom: 18px;
}

.identify-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.identify-field .optional-badge {
    color: #999;
    font-weight: normal;
    font-size: 12px;
    margin-left: 4px;
}

.identify-field .required-badge {
    color: #d32f2f;
    margin-left: 2px;
}

.identify-field input[type="text"],
.identify-field input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

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

.password-field-wrap {
    position: relative;
}

.password-field-wrap input {
    padding-right: 60px !important;
}

.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #667eea;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    padding: 6px 8px;
}

.identify-hint {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

.identify-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}

.identify-btn {
    padding: 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: transform 0.1s, opacity 0.2s;
}

.identify-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.identify-btn:not(:disabled):active {
    transform: scale(0.98);
}

.identify-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.identify-btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.identify-error-box {
    display: none;
    margin-top: 14px;
    padding: 12px 15px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
}

.identify-status-box {
    margin: 30px;
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}

.identify-status-box.closed-before {
    background: #fff3cd;
    color: #856404;
}

.school-name-banner {
    margin: 0 30px 20px 30px;
    padding: 12px 18px;
    background: #eef1ff;
    border: 2px solid #667eea;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    color: #4a4a8a;
    font-size: 15px;
}

@media (max-width: 768px) {
    .school-name-banner,
    .identify-status-box {
        margin: 0 15px 15px 15px;
    }
}

/* quiz.html 用の学生情報サマリーバー */
.student-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 15px 30px;
    background: #f8f9fc;
    border-bottom: 2px solid #eee;
    font-size: 14px;
}

@media (max-width: 768px) {
    .student-summary-bar {
        padding: 12px 15px;
        gap: 8px 14px;
        font-size: 12px;
    }
}

.student-summary-bar .summary-item {
    color: #333;
}

.student-summary-bar .summary-item strong {
    color: #667eea;
    margin-right: 4px;
}

.edit-info-link {
    margin-left: auto;
    font-size: 12px;
}

.edit-info-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.edit-info-link a:hover {
    text-decoration: underline;
}

.editing-mode-banner {
    margin: 0 30px 15px 30px;
    padding: 10px 15px;
    background: #fff3cd;
    color: #856404;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .editing-mode-banner {
        margin: 0 15px 15px 15px;
    }
}
