body {
    font-family: 'Arial', '微軟正黑體', 'Microsoft JhengHei', sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    color: #333;
}
.tab-container {
    display: flex;
    background-color: #0056b3; /* 深藍色背景 */
}
.tab-button {
    background-color: #0056b3; /* 預設標籤背景 */
    color: #b3d7ff; /* 預設標籤文字顏色 (較淡的藍色) */
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s, color 0.3s;
    flex-grow: 1;
    text-align: center;
    border-bottom: 3px solid transparent; /* 預留底部邊框空間 */
}
.tab-button:hover {
    background-color: #004080; /* 滑鼠懸停時背景加深 */
    color: #ffffff; /* 滑鼠懸停時文字變白 */
}
.tab-button.active {
    background-color: #ffffff; /* Active 標籤背景變白 */
    color: #0056b3; /* Active 標籤文字變深藍 */
    font-weight: bold;
    border-bottom: 3px solid #ffc107; /* Active 標籤底部有黃色實線 */
}
.content-section {
    display: none;
    padding: 25px;
    animation: fadeIn 0.5s;
}
.content-section.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.container {
    max-width: 800px;
    margin: 20px auto;
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}
h1, h2, h3 {
    color: #0056b3;
    text-align: center;
}
.problem-card, .problem-page {
    background-color: #e9f5ff;
    border: 1px solid #b3d7ff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
}
.question, .s3-question-main {
    font-size: 1.2em;
    margin-bottom: 15px;
}
mark {
    background-color: #fff380;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-weight: bold;
}

.structured-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #ffffff;
    border: 1px dashed #007bff;
    border-radius: 4px;
    justify-content: center;
}
.structured-input-container input[type="text"],
.structured-input-container select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.1em;
    box-sizing: border-box;
}
.structured-input-container input[type="text"] {
    min-width: 60px; flex-grow: 1; max-width: 150px; text-align: center;
}
.structured-input-container select {
    min-width: 70px; font-weight: bold;
}

button.action-btn {
    background-color: #28a745; color: white; padding: 10px 18px;
    border: none; border-radius: 4px; cursor: pointer; font-size: 1em; margin-right: 10px;
}
button.action-btn:hover { background-color: #218838; }
button.nav-btn {
    background-color: #007bff; color: white; padding: 10px 18px;
    border: none; border-radius: 4px; cursor: pointer; font-size: 1em;
}
button.nav-btn:hover { background-color: #0056b3; }
button:disabled { background-color: #ccc; cursor: not-allowed; }

.feedback {
    margin-top: 10px; font-weight: bold; padding: 10px; border-radius: 4px;
}
.feedback.correct {
    color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb;
}
.feedback.incorrect {
    color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb;
}
.progress {
    text-align: center; margin-bottom: 20px; font-size: 0.9em; color: #555;
}
.explanation, .s3-step-explanation {
    font-size: 0.95em; /* 稍微加大解釋文字 */
    color: #333; /* 深一點的顏色，更易讀 */
    margin-top: 10px; /* 和上方元素間距 */
    background-color: #f8f9fa; /* 更淡的背景 */
    padding: 12px; /* 內邊距加大 */
    border-radius: 4px;
    border-left: 4px solid #007bff; /* 左側藍色提示線 */
}
.info-table {
    width: 100%; border-collapse: collapse; margin-bottom: 15px;
}
.info-table th, .info-table td {
    border: 1px solid #ddd; padding: 8px; text-align: left;
}
.info-table th { background-color: #e9f5ff; color: #0056b3; }

/* Section 3 Specific Styles */
.s3-options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* 自適應列數 */
    gap: 10px;
    margin-bottom: 15px;
}
.s3-option-button {
    background-color: #6c757d; /* 灰色選項按鈕 */
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    text-align: center;
    transition: background-color 0.3s;
}
.s3-option-button:hover {
    background-color: #5a6268; /* 滑鼠懸停時加深 */
}
.s3-option-button.selected { /* 用戶選擇後的樣式，非正確答案 */
    background-color: #007bff; /* 藍色 */
}
.s3-step-by-step {
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: #f8f9fa;
}
.s3-step-by-step h4 {
    margin-top: 0;
    color: #0056b3;
    font-size: 1.1em;
}
.s3-step-explanation-item {
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 3px;
    border-left: 3px solid;
}
.s3-step-explanation-item.is-solution {
    border-left-color: #28a745; /* 綠色表示此選項是解 */
    background-color: #e6ffed;
}
.s3-step-explanation-item.not-solution {
    border-left-color: #dc3545; /* 紅色表示此選項不是解 */
    background-color: #ffebee;
}

/* ... (保留所有原有的 CSS 規則) ... */

/* Section 3 Number Line Styles */
.s3-number-line-display {
    margin: 30px auto 25px auto; /* 上下邊距，左右自動 */
    padding: 0 15px; /* 左右內邊距，防止數字貼邊 */
    max-width: 90%; /* 最大寬度，避免在寬螢幕上過長 */
    height: 60px; /* 數線圖區域高度 */
    position: relative;
    box-sizing: border-box;
}

.s3-number-line-axis {
    position: absolute;
    top: 25px; /* 主軸線的垂直位置 */
    left: 0;
    right: 0;
    height: 3px; /* 主軸線粗細 */
    background-color: #555; /* 主軸線顏色 */
    border-radius: 2px;
}

/* 軸線兩端的箭頭 (可選) */
.s3-number-line-axis::before,
.s3-number-line-axis::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}
.s3-number-line-axis::before { /* 左箭頭 */
    left: -2px; /* 稍微調整位置，使其看起來連接到線上 */
    border-right: 8px solid #555;
}
.s3-number-line-axis::after { /* 右箭頭 */
    right: -2px; /* 稍微調整位置 */
    border-left: 8px solid #555;
}


.s3-number-line-ticks-container {
    position: absolute;
    top: 25px; /* 與軸線對齊 */
    left: 5%; /* 讓刻度從軸線的5%開始，到95%結束，給箭頭留空間 */
    right: 5%;
    height: 100%;
}

.s3-number-line-tick {
    position: absolute;
    transform: translateX(-50%); /* 使刻度線中心對準其 left 值 */
    width: 2px; /* 刻度線寬度 */
    height: 10px; /* 刻度線高度 */
    background-color: #333; /* 刻度線顏色 */
    top: -4px; /* 相對於 ticks-container 的頂部向上偏移，使其跨在軸線上 */
}

.s3-number-line-tick-label {
    position: absolute;
    top: 15px; /* 數字標籤在刻度線下方 */
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85em;
    color: #333;
    white-space: nowrap; /* 防止數字換行 */
}


/* ... (其他 CSS) ... */

/* ... (其他 CSS) ... */

.s3-transposition-hint {
    margin-top: 15px;
    padding: 10px;
    background-color: #f0f8ff;
    border: 1px solid #cce5ff;
    border-left: 4px solid #007bff;
    border-radius: 4px;
    font-size: 0.9em;
    /* cursor: pointer; /* 移除點擊指針 */
}
.s3-transposition-hint h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #0056b3;
}
/* 修改 s3-hint-step 樣式，使其直接可見 */
.s3-transposition-hint p.s3-hint-step { 
    margin-top: 0;
    margin-bottom: 8px;
    line-height: 1.7;
    padding: 5px;
    background-color: #fff;
    border: 1px dashed #b8daff;
    border-radius: 3px;
    opacity: 1; /* 直接可見 */
    transform: translateY(0); /* 無需動畫偏移 */
    /* transition: opacity 0.4s ease-out, transform 0.4s ease-out; */ /* 移除動畫 */
}
/* .s3-transposition-hint p.s3-hint-step.visible { */ /* .visible class 不再需要 */
    /* opacity: 1; */
    /* transform: translateY(0); */
/* } */

.s3-transposition-hint code {
    background-color: #e9ecef;
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 2em; 
}