:root {
    --primary-color: #00BCD4;
    --secondary-color: #4CAF50;
    --primary-dark: #008BA3;
    --text-color: #212121;
    --link-color: #004D40;
    --background-color: #E0F7FA;
    --menu-bg-color: #f0f4f8; 
    --hover-color: #00796B;
    --cancel-button-background-color: #D3E0EA; 
    --cancel-button-hovercolor: #B0C4DE; 
    --danger-button-background-color:#D93025;
    --danger-button-border-color:#D93025;
    --danger-button-hovercolor: #B02117;
    --button-hover-color: #388E3C;
    --input-border-color: #B2EBF2;
    --overlay-bg-color: rgba(0, 0, 0, 0.55);
    --prompt-bg-color: #ffffff; 
    --prompt-title-color: var(--text-color);
    --prompt-subtext-color: #555;
    --prompt-button-color: var(--primary-color);
    --prompt-button-hover: var(--hover-color);
    --prompt-close-color: #888;
    --white: #FFFFFF;
    --logo-color1: #8BC34A;
    --logo-color2: #03A9F4;
    --logo-color3: #E91E63;
    --logo-color4: #FBC02D;
    --logo-color5: #FF5722;
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.4s ease;
}
h1, h2, h3 {
    color: var(--primary-dark);
}
h4, h5, h6 {
    color: var(--secondary-color);
}

h1 {
    font-size: clamp(24px, 4vw, 36px); 
    line-height: 1.3;
    margin: 0.5em 0 0.5em 0;
    font-weight: 600;
}

h2 {
    font-size: clamp(18px, 3vw, 28px);
    line-height: 1.4;
    margin: 0.5em 0 0.5em 0;
}

p {
    color: var(--text-color);

}
a {
    color: var(--link-color);
    text-decoration: none;
}
a:hover {
    color: var(--hover-color);
    text-decoration: none;
}


input[type="text"], input[type="email"], textarea {
    border: 1px solid var(--input-border-color);
    background-color: var(--white);
    color: var(--text-color);
    padding: 10px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}
input[type="password"] {
    border: 1px solid var(--input-border-color);
    background-color: var(--white);
    color: var(--text-color);
    padding: 10px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}
ul, ol {
    /* color: var(--text-color); */
    margin-bottom: 1em;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
}
table, th, td {
    border: 1px solid var(--input-border-color);
}
th, td {
    padding: 10px;
    text-align: left;
}
th {
    background-color: var(--primary-color);
    color: var(--white);
}
tr:nth-child(even) {
    background-color: var(--background-color);
}

.pointer {
    cursor: pointer;
}
.hidden {
    display: none;
}

@media (max-width: 768px) {
    html {
        overflow-x: hidden; 
        overflow-y: scroll; 
        -ms-overflow-style: none;  
        scrollbar-width: none;  
    }
    html::-webkit-scrollbar {
        display: none; 
    }
    html, body {
        width: 100%;
        position: relative;
    }   
}

.center-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px); /* 扣除 header/footer */
    text-align: center;
}

.message-box {
    background: var(--white);
    border: 1px solid var(--input-border-color);
    border-radius: 12px;
    padding: 32px 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-width: 480px;
    width: 90%;
}


header {
    text-align: center;
    width: 100%; 
    position: fixed; 
    top: 0; 
    z-index: 1000; 
}

.header-container {
    display: flex;
    background-color: var(--background-color);
    color: var(--text-color);
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 5px 2%;
    width: 96%;
    transition: top 0.3s ease; 
}

.upper-header {
    width: 100%;
    height: auto;
    background-color: white;
    text-align: left;
    margin-bottom: 4px;
    border-bottom: 2px solid;
    border-image: linear-gradient(to right, 
    var(--logo-color1), var(--logo-color2), var(--logo-color3), var(--logo-color4), var(--logo-color5)) 1;
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}   
.upper-header-content {
    display: flex;
    justify-content:space-between;

}   
.upper-header-content > div:first-child {
    display: flex;
    align-items: center; 
    flex: 1;  
}
.upper-header-content > div:nth-child(2) {
    flex: 0 1 auto; 
    text-align: left; 
}
.show-upper-header {
    display: block;
    opacity: 1 ;
    visibility: visible;
}

.header-shadow {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); 
}
header .left-content {
    flex-basis: 15%;
}
header .center-content {
    flex-basis: 70%;
    display: flex;
    justify-content: center; 
    align-items: center; 
}
header .right-content {
    flex-basis: 15%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap:15px;
}
.header-link {
    flex: 1;  
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none; 
    color: inherit; 
}
header .header-title {
    margin: 0;
    font-size: 2em;
    font-weight: bold;
    flex: 1;
    text-align: left;
}
header .menu-icon {
    display: none;
}
header nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 2;
    flex-wrap: nowrap;
}
header nav a {
    color: var(--text-color);
    margin: 0 8px;
    text-decoration: none;
    font-size: 1.2em;
}
header nav a:hover {
    text-decoration: none;
    color: var(--hover-color);
}
#navbar button { 
    font-size: 1.2em;
    padding: 5px 16px;
}





.nav-cta {
    background-image: linear-gradient(92.88deg, var(--primary-color) 9.16%, var(--button-hover-color) 64.72%);
    background-size: 350% auto;
    background-position: left center;
    border-radius: 5px;
    color: var(--white);
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background-position 0.2s ease-in-out, box-shadow 0.3s ease;
    display: inline-flex;
    font-weight:bold;
    align-items: center;
    justify-content: center;
}

.nav-cta:hover {
    background-color: var(--button-hover-color);
    box-shadow: rgba(0, 121, 107, 0.5) 0 1px 30px;
    transition-duration: 0.1s;
    background-image: linear-gradient(45deg, var(--primary-color) 0%, var(--secondary-color) 10%, var(--white) 51%, var(--secondary-color) 90%, var(--primary-color) 100%);
    background-position: right center; 
    transition: background-position 0.2s ease-in-out; 
    color: var(--white);
    box-shadow: rgba(0, 121, 107, 0.5) 0 1px 30px;
}

.nav-cta.hover-effect {
    background-color: var(--button-hover-color);
    background-image: linear-gradient(45deg, var(--primary-color) 0%, var(--secondary-color) 10%, var(--white) 51%, var(--secondary-color) 90%, var(--primary-color) 100%);
    background-position: right center; 
    color: var(--white);
    box-shadow: rgba(0, 121, 107, 0.5) 0 1px 10px;
    transition: background-position 0.2s ease-in-out, box-shadow 0.3s ease;
}



.dropdown-menu {
    display: none;
    position: absolute;
    top: 40px; 
    right: 20px;
    background-color: var(--secondary-color);
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    flex-direction: column;
    border-radius: 5px;
}
.dropdown-menu a {
    color: var(--white);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 1em;
    border-bottom: 1px solid #3e8e41;
}
.dropdown-menu a:last-child {
    border-bottom: none;
}
.dropdown-menu a:hover {
    background-color: #3e8e41;
}



@media (max-width: 768px) {
    header {
        position:fixed;
        padding:  0;
        z-index: 1000;
    }
    .upper-header {
        position: relative;
    }
    .header-container {
        position: relative;
        margin: 0;
        padding: 2px 3% 2px 1%;
        display: flex;
        flex-direction: row;
        align-items: center;
        transition: top 0.2s; 
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    header .header-title {
        font-size: 1.3em;
    }
    header .student-info {
        font-size: 10px;
    }
    header nav {
        display: none;
    }
    .dropdown-menu {
        top: 36px; 
        right: 0;
    }
    .dropdown-menu a {
        padding: 8px 12px;
        font-size: 0.7em;
    }
    #navbar {
        display: none;
    }

}





#mobile-navbar {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 45px;
    background-color: var(--background-color);
    color: var(--text-color);
    justify-content: space-around;
    align-items: center;
    padding: 0;
    box-shadow: 0px -1px 5px rgba(0, 0, 0, 0.1);
    transition: bottom 0.2s; 
    z-index: 1000;
}
#mobile-navbar a {
    color: var(--text-color);
    width: 9vw;
    height:100%;
    text-decoration: none;
    text-align: center;
}

#mobile-navbar .bottom-nav-icon {
    width: 24px;
    height:24px;
}
#mobile-navbar a span {
    display: block;
    font-size: 0.5em;
}
#mobile-navbar i {
    font-size: 1.1em;
    margin-top: 10px;
}
#mobile-navbar a.active {
    color: #007bff;
    border-top: 1.5px solid #007bff;
}


#mobile-navbar .bottom-nav-icon {
    width: 24px;
    height: auto;
    margin: 7px 0 -5px 0;
    /* color: var(--text-color);  */
}

#mobile-navbar a.active .bottom-nav-icon {
    color: #007bff; 
}

#mobile-navbar .bottom-nav-test {
    background-image: linear-gradient(92.88deg, var(--primary-color) 9.16%, var(--button-hover-color) 64.72%);
    border-radius: 8px;
    color: var(--white);
    font-weight: 600;
    box-shadow: rgba(0, 0, 0, 0.25) 0 3px 8px;
    margin: 0 0 -3px 0;
    padding: 0 0.6rem;
    transition: all 0.2s ease-in-out;
}
#mobile-navbar .bottom-nav-test svg {
    margin-top: 4px;
}
#mobile-navbar .bottom-nav-test .nav-icon {
    color: var(--white);
}
#mobile-navbar .nav-test span {
    color: var(--white);
}
@media (max-width: 768px) {   
    #mobile-navbar {
        display: flex;
    }
}   



.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--white);
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    align-items: center;
    justify-content: center;
    text-align: center;
    display: none; 
    z-index: 1004;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.back-to-top:hover {
    opacity: 0.8;
    transform: translateY(-5px); 
}
@media (max-width: 768px) {    
    .back-to-top {
        bottom: 12vw;
        right: 4vw;
        width: 8vw;
        height: 8vw;
        font-size: 4vw;
    }
}



main {
    margin: 65px auto 0 auto;
    width: 100%;
    flex: 1;
    max-width: 1200px; 
}
.section-container {
    margin: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    min-height:600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.section-lv1 {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #e6f7ff;
    border-left: 4px solid #1890ff;
    border-radius: 4px;
}
.section-lv2 {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #ffffff;
    border-left: 4px solid #52c41a;
    border-radius: 4px;
}
.section-lv3 {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f6ffed;
    border-left: 4px solid #faad14;
    border-radius: 4px;
}

button, a.button {
    background-color: var(--secondary-color);
    border: none;
    border-radius: 5px;
    color: var(--white);
    padding: 0.5em 1em;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
button.bigger {
    font-size: 1.1em;
    padding: 7px 13px;
    border-radius: 7px;
}
@media (max-width: 768px) {
    button {
        font-size: 0.7em;
        border-radius: 3px;
        padding:  0.5em 0.6em;
        cursor: pointer;
        font-weight: bold;
        transition: background-color 0.3s ease;
    }
}


button:hover {
    background-color: var(--button-hover-color);
}

.menu-button {
    text-align: center;
    background-color: var(--primary-color);
    color: var(--white);

}

.menu-button.small {
    padding: 6px 8px;
    font-size: 0.9rem;
}
.menu-button:hover {
    background-color: var(--button-hover-color);
}

.cancel-button, a.button {
    background-color: var(--cancel-button-background-color); 
    color: var(--text-color); 
    border: 1px solid var(--input-border-color); 
}
.cancel-button.small {
    padding: 6px 8px;
    font-size: 0.9rem;
}
.cancel-button:hover {
    background-color: var(--cancel-button-hovercolor); 
    color: var(--white); 
}

.danger-button {
    background-color: var(--danger-button-background-color); /* e.g. #d93025 */
    color: var(--white);
    border: 1px solid var(--danger-button-border-color); /* 可用 same as background 或較深 */
    transition: background-color 0.3s ease;
}
.danger-button:hover {
    background-color: var(--danger-button-hovercolor); /* e.g. #b02117 */
    color: var(--white);
}
.danger-button.small {
    padding: 6px 8px;
    font-size: 0.9rem;
}
@media (max-width: 768px) {
    .danger-button.small{
        font-size: 0.7em;
        padding:  0.5em 0.6em;
    }
}
.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 14px;
    color: var(--prompt-close-color);
    cursor: pointer;
}







footer {
    background-color: var(--text-color);
    width: 100%;
    max-width: 1200px;
    margin:auto;
    color: var(--white);
    padding: 10px 0;
    text-align: center;
    font-size: 0.9em;
}
footer .footer-container {
    background-color: #66BB6A;
    display: flex; 
    flex-direction:column;
    justify-content: center;
}
footer h4 {
    color: var(--primary-dark); 
    margin: 0.4em 0;
}
footer p {
    margin: 0;
    color:white;
}
footer .footer-top {
    max-width: 1200px;
    padding: 2px 0;
    display: flex;
    flex-direction: row; 
    justify-content: space-around;
    text-align: center;
}
footer .footer-top .footer-flex {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
}
@media (max-width: 768px) {
    footer .footer-top .footer-flex {
        flex-direction: column;
        justify-content: flex-start;  
    }
}
footer .footer-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}
footer .footer-logo-title {
    display: flex;
    justify-content: flex-start; 
    align-items: center; 
    margin-bottom: 10px;
}
footer .footer-logo {
    margin-right: 10px;
}
footer .footer-title {
    font-size: 1.2em;
    font-weight: bold;
}
footer .footer-description {
    margin: 2px auto 10px 5px;
    font-size: 0.7em;
    text-align: left;
}
footer .footer-top ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
}
footer .footer-top ul li {
    margin: 3px 5px;
}
footer .footer-top ul li a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9em;
}
footer .footer-top ul li a:hover {
    text-decoration: underline;
}
footer .footer-top ul li.social-media {
    display: flex;
    justify-content: center;
    gap: 10px;
}
footer .footer-top ul li.social-media a {
    font-size: 1.2em;
}
footer .footer-middle {
    background-color: #66BB6A;
    text-align: center;
    padding: 5px 0;
    font-size:14px;
}
footer .footer-bottom {
    background-color: var(--text-color);
    text-align: center;
    margin-top: 4px;
    font-size:10px;
}
footer .footer-bottom a {
    color: #ccc;
    text-decoration: none;
    margin: 0 5px;
}
footer .footer-bottom a:hover {
    text-decoration: underline;
}
footer .footer-bottom p {
    color: #ccc;
    margin:3px auto;
}
@media (max-width: 768px) {
    footer .footer-top ul {
        flex-direction: column;
        align-items: center;
    }
    footer .footer-top ul li {
        margin: 5px 0;
    }
    footer .footer-bottom  {
        padding-bottom:  15px;
    }
    footer .footer-bottom a {
        font-size: 1em;
        margin: 0 3px;
    }
    footer p {
        font-size: 1.1em;
    }
}
footer .footer-top .footer-topics{
    font-size: 13px;         
    line-height: 1.45;
    column-count: 2;
    -webkit-column-count: 2;
    column-gap: 28px;
    -webkit-column-gap: 28px;
    margin-top: 6px;
}

footer .footer-top .footer-topics .topics-group{
    break-inside: avoid;       
    -webkit-column-break-inside: avoid;
    margin: 0 0 10px 0;
    padding: 0;
}

footer .footer-top .footer-topics .topics-title{
    font-size: 10px;
    color: var(--primary-dark); 
    text-transform: uppercase;
    letter-spacing: .02em;
    opacity: .9;
    margin: 4px 0 2px;
    text-align:left;
}

footer .footer-top .footer-topics .topics-list{
    list-style: none;
    padding: 0;
    margin: 0 0 6px 0;
    text-align:left;
}

footer .footer-top .footer-topics .topics-list li{
    font-size: 9px;
    margin: 1px 0;
}

footer .footer-top .footer-topics .topics-list a{
    text-decoration: none;
    border-bottom: 1px dotted rgba(255,255,255,.35); 
}
footer .footer-top .footer-topics .topics-list a:hover{
    text-decoration: underline;
}

@media (max-width: 768px){
    footer .footer-top .footer-topics{
        column-count: 1;
        -webkit-column-count: 1;
        font-size: 12.5px;
    }
    footer .footer-top .footer-topics .topics-title{
        margin-top: 8px;
        
    }
    footer .footer-top .footer-topics .topics-list li {
        margin-left: 0;
    }
}




.fixed-button-layer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

#fixed-button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #007bff;
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#fixed-button:hover {
    background-color: #0056b3;
}






.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    /*display: flex;*/
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    background: white;
    display: flex;
    flex-direction: column;
    gap:5px;
    margin: 1.5em;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 300px;
    max-width: 90%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}






@media (max-width: 768px) {
    .action-button {
        padding: 8px 12px;
        border-radius: 5px;
        cursor: pointer;
        font-weight: bold;
        font-size: 0.9em;
        transition: background-color 0.3s ease, transform 0.3s ease;
        text-align: center;
    }
    
    .action-button:hover {
        background-color: #FF6347; 
        transform: translateY(-2px); 
    }
    .section-lv3 {    
        padding: 8px;
    }

    main {
        height: calc(100vh - 60px);
    }
    .container {
        padding: 0 10px;
    }
    #fixed-button {
        padding: 8px 16px;
        font-size: 14px;
    }
}



.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 37%, #f0f0f0 63%);
    animation: loading 1.2s infinite;
    background-size: 400% 100%;
    height: 1.2em;
    border-radius: 4px;
    margin: 8px 0;
}
  
@keyframes loading {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

.locked-section {
    color: #888;
    text-align: center;
    font-style: italic;
    padding: 10px;
}

.coming-soon-box {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 1em;
    background-color: #f3f3f3;
    border-left: 4px solid #aaa;
    font-style: italic;
    font-size: 0.95em;
    color: #555;
    border-radius: 4px;
}




/* --- Paper Tabs --- */
.paper-tab-row {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
}

.paper-tab-btn {
    flex: 1;
    padding: 0.6rem;
    border-radius: 6px;
    background-color: var(--input-border-color);
    color: var(--primary-color);
    user-select: none;
    transition: all 0.2s ease-in-out;
}

.paper-tab-btn:hover {
    background-color: var(--input-border-color);
    color: var(--primary-color);
}

.paper-tab-btn.active {
    background-color: var(--primary-color);
    color: var(--white);

    
}

.dropdown-selected {
    display: flex;
    justify-content: center;
    padding: 0.6rem 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #f9f9f9;
    cursor: pointer;
    user-select: none;
}


.level-select-dropdown {
    position: relative;
    width:100%;
    user-select: none;
    min-width: 150px;
}
.level-select-selected {
    background-color: #f0f0f0;
    padding: 8px 12px;
    width: 200px;
    border: 1px solid #ccc;
    cursor: pointer;
    border-radius: 6px;
}
.level-select-options {
    position: absolute;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    width:85%;
    gap: 8px;               
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 99;
    overflow-x: hidden;               
    padding: 10px;
}
.level-select-options-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    width: 100%;
    display: none;
}
.level-select {
    height: 34px;
    aspect-ratio: 3 / 2;
    /* aspect-ratio: 7 / 2;    */
    font-size: 1.3em;        
    margin: 0;           
    position: relative;   
    border-radius: 6px;            
    /* border-radius: 9999px; */
    background: linear-gradient(145deg, #e0e0e0, #f5f5f5); 
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.3s, transform 0.3s;
    box-shadow:
        inset 1px 1px 3px rgba(255,255,255,0.5),
        inset -1px -1px 3px rgba(0,0,0,0.1),
        0 2px 5px rgba(0,0,0,0.15);
}
.level-select span {
    display: inline-flex;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: calc(0.7em);
    font-weight: bold;
    color: white;
}
.level-select.level-1 {
    background: linear-gradient(145deg, #64b5f6, #bbdefb);
    background: linear-gradient(145deg, #42a5f5, #aecdf1);
}
.level-select.level-2 {
    background: linear-gradient(145deg, #66bb6a, #c8e6c9);
    background: linear-gradient(145deg, #43a047, #b3d9b8);
}
.level-select.level-3 {
    background: linear-gradient(145deg, #9575cd, #d1c4e9);
    background: linear-gradient(145deg, #7e57c2, #c2b0e2);
}
.level-select.level-4 {
    background: linear-gradient(145deg, #ffd54f, #fff8e1);
    background: linear-gradient(145deg, #fbc02d, #f0e6b8);
    box-shadow:
        0 0 10px rgba(255, 193, 7, 0.6),
        0 0 20px rgba(255, 193, 7, 0.4) inset;
    animation: legendaryPulse 2s infinite ease-in-out;
}
.level-select.level-5 {
    background: linear-gradient(145deg, #f06292, #f8bbd0);
    background: linear-gradient(145deg, #e91e63, #e8a6b8);
    box-shadow:
        0 0 10px rgba(244, 143, 177, 0.6),
        0 0 20px rgba(244, 143, 177, 0.3) inset;
    animation: mythicGlow 1.5s infinite alternate ease-in-out;
}
.level-select span i {
    font-size: 0.6em;     
}
.level-select:hover {
    filter: brightness(1.1); 
    box-shadow:
        0 0 10px rgba(0, 0, 0, 0.2),
        inset 0 0 10px rgba(255, 255, 255, 0.3); 
    transform: translateY(-2px); 
    transition: all 0.3s ease;
}

.level-select.level-5:hover {
    box-shadow: 0 0 25px rgba(244, 143, 177, 0.9), 0 0 35px rgba(244, 143, 177, 0.6) inset;
    border-color: #d81b60; /* 深啲既pink，突顯 */
    background: linear-gradient(145deg, #f48fb1, #fce4ec); /* 少少色差，hover有變化 */
}
@keyframes legendaryPulse {
    0% { box-shadow: 0 0 8px rgba(255, 193, 7, 0.4); }
    50% { box-shadow: 0 0 18px rgba(255, 193, 7, 0.7); }
    100% { box-shadow: 0 0 8px rgba(255, 193, 7, 0.4); }
}

@keyframes mythicGlow {
    0% { box-shadow: 0 0 10px rgba(244, 143, 177, 0.5), 0 0 20px rgba(244, 143, 177, 0.3) inset; }
    50% { box-shadow: 0 0 20px rgba(244, 143, 177, 0.8), 0 0 30px rgba(244, 143, 177, 0.5) inset; }
    100% { box-shadow: 0 0 10px rgba(244, 143, 177, 0.5), 0 0 20px rgba(244, 143, 177, 0.3) inset; }
}
.level-select.level-selected {
    position: relative;
    z-index: 1;
    filter: brightness(1.15) saturate(1.1); /* 提亮顏色 */
    box-shadow:
        0 0 12px rgba(255, 255, 255, 0.7), /* 外圍白光 */
        0 0 20px rgba(0, 0, 0, 0.2);       /* 微陰影，保持立體感 */
    transform: scale(1.03); /* 輕微放大，突顯選中 */
    transition: all 0.25s ease-in-out;
}





.prompt-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: var(--overlay-bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 12000;
}

.prompt-content {
    background: var(--prompt-bg-color);
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(-30px); 
    transition: transform 0.4s ease, opacity 0.4s ease;
}
.prompt-content.show {
    transform: translate(0, 0); 
    opacity: 1;
}
.prompt-image {
    width: 256px;
    height: 256px;
}

.prompt-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--prompt-title-color);
    margin-bottom: 12px;
}

.prompt-message {
    font-size: 15px;
    color: var(--prompt-subtext-color);
    margin-bottom: 24px;
    line-height: 1.6;
}

.prompt-button {
    background-color: var(--prompt-button-color);
    color: var(--white);
    font-weight: bold;
    font-size: 15px;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.prompt-button:hover {
    background-color: var(--prompt-button-hover);
}


/*
.test-option-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 1rem;
    box-sizing: border-box;
}
.test-option {
    width: clamp(200px, 96%, 400px);
    margin: 2%;
}


.test-option-container {
    position:relative;
    background: var(--white);
    border-radius: 8px;
    padding: 4rem 1.5rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.test-option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: flex-start;
}

.test-option-row select {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    min-width: 220px;
    flex: 1 1;
}





/* Responsive */
@media (max-width: 768px) {
    .test-option-container {
        padding: 4rem 1rem 1rem;
    }

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

    .start-test-btn {
        text-align: center;
    }
}




.user-type-label {
    font-size: 0.75em;
    font-weight: 600;
    color: #2a9d8f; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.MathJax {
    font-size: 1.9em; /* 或你需要的大小 */
}




































:root{
    --glass-bg: rgba(255,255,255,.72);
    --glass-brd: rgba(255,255,255,.45);
    --overlay: rgba(9,18,24,.35);
    --muted:          /* slate-600 */
    --chip: rgba(255,255,255,.6);
    --chip-brd: rgba(15,118,110,.25); /* teal-ish */
    --chip-on: #0d9488;          /* teal-600 */
    --pill-bg: rgba(255,255,255,.75);
}
.testopt-overlay{
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    background: rgba(9,18,24,.35);
    backdrop-filter: blur(7px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    box-sizing: border-box;
    overflow: hidden;      
}


.testopt-modal{
    width: clamp(200px, 94%, 400px);
    margin: 0 2%;
    background: rgba(255,255,255,.59);
    border: 1px solid rgba(255,255,255,.45);;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(2,6,23,.35);
    padding: 1rem;
    color: #0f172a; 
    position: relative;
}
.test-option-container {
    position:relative;
    background: var(--white);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.testopt-close{
    position:absolute; top:14px; right:14px;
    width:36px; height:36px; border-radius:50%;
    border:0; background: rgba(255,255,255,.7);
    box-shadow: 0 1px 2px rgba(2,6,23,.1);
    font-size:18px; line-height:36px; cursor:pointer;
}
.testopt-title{
    margin: 2px 0 5px; letter-spacing:.2px;
}
  
  /* ===== Sections ===== */
.testopt-section-head{ font-weight: 700; margin-bottom: 8px; }
  
.testopt-grid{
    display:grid; grid-template-columns: 1fr auto; gap: 12px;
}
.testopt-card{
    background: rgba(255,255,255,.55);
    border: 1px solid rgba(148,163,184,.35);
    border-radius: 16px;
    margin-bottom: 14px;
    padding: 12px;
}
.testopt-card-title{
    font-weight:700; margin-bottom:8px;
}
.testopt-card-right{
    display:flex; flex-direction:column; justify-content:center; align-items:flex-start;
}
  
/* ===== Chips (Board) ===== */
.testopt-row{ display:flex; gap:10px; flex-wrap:wrap; }
.testopt-chip{ position:relative; display:inline-block; }
.testopt-chip input{ position:absolute; inset:0; opacity:0; }
.testopt-chip .chip-body{
    display:flex; align-items:center; gap:8px;
    padding:10px 14px; border-radius:12px;
    background: var(--chip);
    border:1px solid transparent;
    user-select:none; cursor:pointer; font-weight:600;
    box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
}
.testopt-chip input:checked + .chip-body{
    background: rgba(13,148,136,.12);
    border-color: var(--chip-brd);
    color: var(--chip-on);
}
.chip-check{ width:1.2em; height:1.2em; display:inline-grid; place-items:center; }
  
  /* ===== Pills (Paper / Tier) ===== */
.testopt-pill{ position:relative; }
.testopt-pill input{ position:absolute; inset:0; opacity:0; }
.testopt-pill span{
    display:inline-block; padding:9px 14px; border-radius:12px;
    background: var(--pill-bg); border:1px solid var(--pill-brd);
    font-weight:600; cursor:pointer; user-select:none;
}
.testopt-pill input:checked + span{
    background: rgba(124,92,250,.15);
    border-color: rgba(124,92,250,.35);
    color:  #7c5cfa;
}
  
  /* ===== Time badge ===== */
.testopt-time{
    padding:8px 12px; border-radius:12px;
    background: rgba(15,23,42,.06);
    font-weight:700; letter-spacing:.2px;
}
  
  /* ===== Level scale (numbers + lock) ===== */
.testopt-level-scale{
    display:flex; gap:18px; align-items:center; margin-bottom:8px; padding:0 2px;
    color: #475569;    font-weight:700;
}
.testopt-level-scale span{ position:relative; display:inline-flex; align-items:center; gap:6px; }
.estopt-level-scale .is-active{ color: #7c5cfa; }
.testopt-level-scale .is-locked{ opacity:.6; }
.icon-lock{ width:14px; height:14px; fill: currentColor; opacity:.8; }
  
/* ===== Range ===== */
.testopt-range-wrap{
    position:relative; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.testopt-range{
    -webkit-appearance: none; appearance: none; width:100%;
    height:10px; border-radius:999px; outline:none;
    background: linear-gradient(90deg,  #7c5cfa 0%,  #7c5cfa 50%, rgba(15,23,42,.15) 50%);
}
.testopt-range::-webkit-slider-thumb{
    -webkit-appearance:none; appearance:none;
    width:22px; height:22px; border-radius:50%;
    background:#fff; border:2px solid #7c5cfa;
    box-shadow: 0 4px 12px rgba(124,92,250,.35);
    cursor:pointer;
}
.testopt-range::-moz-range-thumb{
    width:22px; height:22px; border-radius:50%;
    background:#fff; border:2px solid #7c5cfa;
    box-shadow: 0 4px 12px rgba(124,92,250,.35);
    cursor:pointer;
}
.testopt-range-badge{
    min-width:34px; height:28px; padding:0 10px;
    display:inline-grid; place-items:center;
    border-radius:999px; font-weight:700; color:#fff;
    background: #7c5cfa;
}
.testopt-time-note{
    margin-left:auto; font-weight:600; color: #475569;   
}
.testopt-start{
    font-size: 1.1rem;
    text-align: center;
    padding: 0.5em 1.3em
}
.testopt-start-btn {
    font-size: 1.1rem;
    width:100%
}
.testopt-level-row{
    display:flex; gap:10px; flex-wrap:wrap; width:100%;
}
  
.testopt-badge{
    display:inline-flex; align-items:center; justify-content:center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 800;
    font-size: 10px;
    letter-spacing: .08em;
    line-height: 1;
    border: 1px solid currentColor;
    user-select: none;
    vertical-align: middle;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.testopt-badge.beta{
    color: #6d5dfc;            
    background: rgba(109,93,252,.12);
}
.testopt-badge.alpha{
    color: #ff7a1a;
    background: rgba(255,122,26,.14);
}
/* Trigger（單一顯示） */
.testopt-time-trigger{
    display:inline-flex; align-items:center; gap:8px;
    padding:9px 14px; border-radius:12px;
    background: var(--pill-bg, #fff);
    border:1px solid var(--pill-brd, rgba(148,163,184,.35));
    font-weight:600; cursor:pointer; user-select:none;
    position:relative; box-shadow: inset 0 0 0 1px rgba(15,23,42,.06);
    color:#0f172a;
}
.testopt-time-trigger:focus{ outline:2px solid rgba(124,92,250,.35); outline-offset:2px; }
.testopt-time-trigger[aria-expanded="true"]{
    background: rgba(124,92,250,.12);
    border-color: rgba(124,92,250,.35);
    color:#7c5cfa;
}
.testopt-time-trigger-caret{ opacity:.7 }

.testopt-time-panel{
    position:absolute; 
    z-index:50;
    margin-top:8px;
    min-width:180px; 
    width:max-content;
    background: rgba(255,255,255,.85);
    border:1px solid rgba(148,163,184,.35);
    border-radius:14px;
    box-shadow: 0 20px 60px rgba(2,6,23,.25);
    padding:6px;
    backdrop-filter: blur(6px);
    display:none;          
    right:0;           
    transform: translateX(-40px) translateY(-4px);
}
.testopt-time-panel.is-open{ display:block; }
.testopt-time-option{
    width:100%; text-align:left;
    border:0; background:transparent; cursor:pointer;
    font-weight:600; color:#0f172a;
    border-radius:10px; padding:10px 12px;
}
.testopt-time-option:hover{
    background: linear-gradient(145deg, rgba(124,92,250,.10), rgba(124,92,250,.18));
}
.testopt-time-option[aria-selected="true"]{
    background: rgba(124,92,250,.15);
    color:#7c5cfa;
}
  