

/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft JhengHei", sans-serif;
    line-height: 1.6;
    background-color: #F8F9FA;  
    color: #333333;  
    overflow-y: auto;
    height: 100vh;
}

/* 浮動容器樣式 */
.floating-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #264653;  
    box-shadow: 0 2px 5px rgba(38, 70, 83, 0.2); 
    z-index: 1000;
}

/* 頂部標題樣式 */
header {
    padding: 8px 15px;
    margin-bottom: 0;
}

h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
    color: white;  
    text-align: center; 
}

h2 {
    font-size: 1.1em;
    color: #F8F9FA;  
    margin: 0; 
    text-align: left;
}
/* 回次導航樣式 */
.section-nav {
    margin: 5px 0;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.round-numbers {
    display: flex;
    align-items: center; 
    gap: 20px;
    margin-bottom: 0; 
    margin-right: 15px;
}

.round-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #D1D5DB;  
    color: #333333;  
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.round-number.active {
    background-color: #2A9D8F;  
    color: white;
}

.announcement {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0;
    text-align: left;
    padding-left: 0px;
    width: 100%;
}

/* 題目導航樣式 */
.question-nav {
    margin: 5px 0;
    padding: 5px 15px;
    display: flex;
    align-items: flex-start; 
    flex-wrap: nowrap; 
}

.question-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    margin: 5px 0 ; 
    flex: 1; 
}

.question-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #D1D5DB;  
    color: #333333;  
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.question-number:hover {
    background-color: #D1D8CF;
}

.question-number.active,
.question-number.completed {
    background-color: #3C8C7C;
    color: white;
}

/* 主內容區域 */
.container {
    margin-top: 160px;
    min-height: calc(100vh - 230px);
    max-width: 100%; 
    width: 100%; 
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;  
    overflow-y: auto;
    position: relative;
    box-sizing: border-box; 
}

.content-area {
    padding-bottom: 120px; 
    position: relative;
    width: 100%; 
    max-width: 1200px; 
    margin: 0 auto; 
}

/* 題目容器樣式 */
.question-container {
    background-color: white;
    padding: 20px;  
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin: auto auto auto auto;
    max-width: 100%;
    width: 100%;
    font-size: 1.1em;
    line-height: 1.6;
    box-sizing: border-box;
}

.question-content {
    margin: 20px 0;
    font-size: 1.1em;  
    line-height: 1.6;  
}

.stem-text, .question-text {
    margin-top: 15px;
    margin-bottom: 15px;
    font-size: 1.1em;  
    line-height: 1.6;  
    color: #333;       
    letter-spacing: 0.02em; 
}

.stem-image {
    margin: 15px 0;
    text-align: center;
}

.stem-image img {
    max-width: 60%;
    height: auto;
    border-radius: 8px;
    /*box-shadow: 0 2px 4px rgba(0,0,0,0.1);*/
}

.content-image {
    margin: 15px 0;
    text-align: center;
}

.content-image img {
    max-width: 60%;
    height: auto;
    border-radius: 8px;
    /*box-shadow: 0 2px 4px rgba(0,0,0,0.1);*/
}

.option img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    /*box-shadow: 0 1px 3px rgba(0,0,0,0.1);*/
    text-align: left;
}


/* 正確/錯誤答案樣式 */
.question-number.correct {
    background-color: #2A9D8F !important;  
    color: white !important;
}

.question-number.incorrect {
    background-color: #E76F51 !important;  
    color: white !important;
}

/* 選項樣式 */
.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.option {
    border: 1px solid #D1D8CF;
}

.option:hover {
    background-color: #E9ECE6;
}

.option.selected {
    background-color: #EFF6E0;
    border-color: #2A9D8F;
}

/* 配合題樣式 */
.matching-group {
    display: inline-block;
    margin: 0 4px;
}

.matching-option {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.matching-option:hover {
    background-color: #e3f2fd;
}

.matching-option.selected {
    background-color: #2196F3;
    color: white;
    border-color: #2196F3;
}

/* 多選題特定樣式 */
.multi-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.multi-option input[type="checkbox"] {
    width: 20px;  
    height: 20px; 
    min-width: 20px;  
    min-height: 20px; 
    margin: 0;    
    padding: 0;  
    -webkit-appearance: none; 
    -moz-appearance: none;
    appearance: none;
    border: 2px solid #2A9D8F;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    vertical-align: middle; 
}

.multi-option input[type="checkbox"]:checked {
    background-color: #2A9D8F;
    position: relative;
}

.multi-option input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.multi-choice-hint {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

/* 填充題計算欄位樣式 */
.fill-input.calculation-field {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
}

/* 按鈕樣式 */
.control-panel {
    display: flex;
    justify-content: space-between;  
    gap: 15px;  
    max-width: 800px;
    margin: 20px auto;
    padding: 10px 25px;
    background-color: #f5f5f5;
    position: sticky;
    bottom: 70px;
    z-index: 999;
}

/* 最後一題按鈕樣式 */
.control-panel.last-question {
    justify-content: center;  
}

/* 按鈕樣式 */
button {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
    min-width: 100px;
}

#prev-btn, #next-btn {
    background-color: #264653;  
    color: white;
}

#submit-btn {
    background-color: #E9C46A;  
    color: #264653;
    font-weight: bold;
}

button:hover {
    opacity: 0.9;
}

/* 結果面板樣式 */
#result-panel {
    max-width: 600px;
    margin: 100px auto 20px;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.result-content {
    text-align: center;
}

.result-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

.score-circle {
    display: inline-block;
    background: #264653;  
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: bold;
}

.level-container {
    margin: 25px 0;
}

.level-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2A9D8F;  
    text-shadow: 1px 1px 2px rgba(38, 70, 83, 0.1);  
}

.level-badge {
    display: inline-block;
    background: #F8F9FA;
    color: #264653;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 15px 0;
}

.score-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 25px 0;
    color: #666;
}

.time-separator {
    width: 1px;
    height: 20px;
    background: #ddd;
}

.score-detail, .completion-detail {
    font-size: 1.1rem;
    text-align: left;
}

.message-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.message {
    color: #444;
    line-height: 1.6;
    text-align: left;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

primary-btn {
    flex: 1;
    max-width: 200px;
    background: #2A9D8F;  
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.primary-btn:hover {
    background: #264653;
}

/* 分享按鈕容器樣式 */
.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* 個別分享按鈕樣式 */
.share-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Facebook 按鈕 */
.share-fb:hover {
    background: #f0f2f5;
    border-color: #1877F2;
}

/* Instagram 按鈕 */
.share-ig:hover {
    background: #fafafa;
    border-color: #E4405F;
}

/* Threads 按鈕 */
.share-threads:hover {
    background: #fafafa;
    border-color: #000000;
}

.share-btn .share-icon {
    width: 24px;
    height: 24px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.share-btn span {
    flex-grow: 1;
    text-align: left;
    font-size: 1rem;
}

/* 底部導覽列樣式 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #264653;  
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px;
    width: 25%;
    transition: color 0.3s ease;
}

.nav-item svg {
    margin-bottom: 4px;
    transition: stroke 0.3s ease;
}

.nav-item:hover {
    color: #3C8C7C;
}

.nav-item:hover svg {
    stroke: #2c6ecf;
}

.nav-item.active {
    color: #2A9D8F   !important;
}

.nav-item.active svg {
    stroke: #2A9D8F   !important;
}

/* 數學符號樣式 */
sup, sub {
    font-size: 0.7em;
    line-height: 0;
    position: relative;
}

sup {
    vertical-align: super;
}

sub {
    vertical-align: sub;
}



/* 確保SVG在高DPI屏幕上也能平滑顯示 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .share-btn .share-icon {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}

#question-stem {
    display: block; 
    visibility: visible; 
    color: #333; 
    font-size: 1.2em; 
    line-height: 1.6; 
    margin-top: 70px; 
}
/* 浮動視窗樣式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 15% auto;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    text-align: center;
    
}

.close-modal {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal h4 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    color: #333;
}

.welcome-page {
    padding: 20px;
    text-align: center;
}

.welcome-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(38, 70, 83, 0.1);  
}

.welcome-title {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #264653;  
    text-align: center;
}

.welcome-description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
    padding: 0 15px;
}

.welcome-paragraph {
    margin-bottom: 20px;
    padding: 0 5%;
    text-align: center;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
    padding: 0 10%;
}

.feature-item {
    text-align: left;
    padding: 10px 15px;
    background-color: #EFF6E0;  
    border-left: 4px solid #2A9D8F;  
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.feature-item:hover {
    transform: translateX(5px);
    background-color: #E9ECE6;
}

.welcome-paragraph.cta {
    margin-top: 25px;
    font-size: 1.2em;
    color: #2A9D8F;  
}

.welcome-cta {
    font-size: 1.1rem;
    color: #1a8cd8;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.welcome-cta::after {
    content: "↓";
    font-family: system-ui;
    display: inline-block;
}

.welcome-cta:hover::after {
    animation: bounce 0.5s ease-in-out infinite;
}

/* 卡片懸浮效果 */
/*.welcome-text {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.welcome-text:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
*/
.coming-soon-page {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100% - 140px);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.coming-soon-content {
    text-align: center;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    position: absolute;
    left: 50%;
    top: 45%; 
    transform: translate(-50%, -50%);
    animation: fadeIn 0.5s ease-out;
}

.coming-soon-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.coming-soon-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #264653, #2A9D8F);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.coming-soon-description {
    font-size: 1.1rem;
    color: #000000;
    margin-bottom: 2rem;
}

.loading-bar {
    width: 80%;
    max-width: 300px;
    height: 4px;
    background-color: #c0c0c0;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

.loading-progress {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, #264653, #2A9D8F);
    border-radius: 2px;
    animation: loading 2s ease-in-out infinite;
}

.coming-soon-date {
    font-size: 0.9rem;
    color: #666;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(400%);
    }
}

.blank-box {
    display: inline-block;
    min-width: 60px;
    padding: 2px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 4px;
    position: relative;
}

.blank-box.selected {
    border-color: #3C8C7C;
    background-color: #E9ECE6;
}

.blank-box.filled {
    background-color: #f8f9fa;
}

.blank-text {
    display: inline-block;
    min-height: 1.2em;
}

.blank-hint {
    color: #999;
    font-size: 0.9em;
}

.option-group {
    margin: 15px 0;
    transition: opacity 0.3s ease;
}

.option-group.dimmed {
    opacity: 0.3;
}

.option-group-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.option-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.option-button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-button:hover {
    background-color: #E9ECE6;
}

.option-button.selected {
    background-color: #2A9D8F;
    color: white;
    border-color: #2A9D8F;
}

/* 配合題底線樣式 */
.blank-underline {
    display: inline-block;
    position: relative;
    min-width: 60px;
    height: 1.5em;
    margin: 0 4px;
    padding-right: 15px; 
    text-align: center;
}

.blank-underline::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    border-bottom: 1px solid #666;
}

.blank-underline.selected {
    border-color: #3C8C7C;
    background-color: #E9ECE6;
}

.blank-underline.filled {
    background-color: #f8f9fa;
}

/* 空格的序號 */
.blank-number {
    position: absolute;
    right: -10px;  
    top: -1px;   
    font-size: 0.8em;
    color: #666;
    background-color: #f8f9fa;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 選項區域標題 */
.option-group-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

/* 修改選項組標籤 */
.option-group-label::before {
    content: '選項';
}


/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        margin-top: 140px; 
        padding: 10px;
    }
    
    h1 {
        font-size: 1.3em;
    }
    
    h2 {
        font-size: 1em;
    }
    
    .question-container {
        padding: 20px 15px;
        margin: 50px auto; 
    }
    
    .control-panel button {
        padding: 10px 20px;
        font-size: 1em;
    }
    
    .nav-item span {
        font-size: 0.8rem;
    }
    
    .nav-item svg {
        width: 20px;
        height: 20px;
    }
    
    #result-panel {
        margin: 100px 15px 20px; 
        padding: 20px;
    }
    
    .result-header {
        text-align: center;
        margin-bottom: 25px;
    }

    .result-title {
        font-size: 1.5rem;
    }

    .level-display {
        font-size: 2rem;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    .score-circle {
        font-size: 1.1rem;
        padding: 12px 20px;
    }
    
    .score-info {
        flex-direction: row; 
        font-size: 0.9rem;
    }
    
    .action-buttons {
        flex-direction: row; 
        gap: 10px;
    }
    
    .primary-btn {
        padding: 10px 15px;
        font-size: 1rem;
    }

    .modal-content {
        width: 95%;  
        max-height: 85vh;  
        margin-top: 100; 
        padding: 50px;
    }

    .stem-image img {
        max-width: 100%;  
    }

    .stem-text, .question-text {
        font-size: 1.1em;    
        line-height: 1.5;    
        padding: 0 10px;      
        margin-top: 20px;     
        margin-bottom: 20px;
    }
    .welcome-content {
        padding: 15px 12px;
        border-radius: 10px;
    }
    
    .welcome-title {
        font-size: 1.4em;
        margin-bottom: 15px;
        text-align: left;
        padding-left: 5px;
    }
    
    .welcome-description {
        text-align: left;
        padding: .10px;
    }
    
    .welcome-paragraph {
        text-align: left;
        font-size: 1em;
        margin-bottom: 15px;
        padding: 0 5px;
    }
    
    .welcome-paragraph.cta {
        text-align: center; 
        margin-top: 20px;
    }
    
    .feature-list {
        padding: 0 5px;
        margin: 15px 0;
    }
    
    .feature-item {
        padding: 8px 10px;
        border-radius: 4px;
    }
}