 main {
    margin: 65px auto 0 auto;
}
.menu-item.number { background-color: #f7d6d6; }
.menu-item.number:hover { background-color: #f9c2c2; }

.menu-item.algebra { background-color: #d8f1f5; }
.menu-item.algebra:hover { background-color: #d1ecf1; }

.menu-item.ratio { background-color: #e6f7e6; }
.menu-item.ratio:hover { background-color: #d4edda; }

.menu-item.geometry { background-color:  #fff4cc; }
.menu-item.geometry:hover { background-color: #ffeeba; }

.menu-item.probability { background-color: #ffdbb3; }
.menu-item.probability:hover { background-color: #ffcc99; }

.menu-item.statistics { background-color: #d6ccf2; }
.menu-item.statistics:hover { background-color: #e2d8fa; }

.menu-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.5vw;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    padding: clamp(20px, 2.5vw, 30px) clamp(10px, 1vw, 30px);
    margin: 0.6vw;
    border: 0.1vw solid #ddd;
    border-radius: 1vw;
    width: min(480px,46%);
    font-size: clamp(14px, 1.4vw, 20px);
    transition: background-color 0.3s, width 0.3s ease, height 0.3s ease;
}
.menu-item .left-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 35%; 
}

.menu-item .left-content i {
    margin-bottom: 1vw;
    font-size: clamp(40px, 4vw, 70px);
}

.menu-item .left-content .menu-title {
    font-size: clamp(20px, 2vw, 40px);
}

.menu-item .right-content {
    width: 60%; 
}
.right-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.right-content ul li {
    font-size: clamp(12px, 1.2vw, 18px);
    padding: 0.5vw 0;
}
.show-all-topics {
    text-align: right;
}
.menu-item .sub-topics.full-list {
    display: none;
}
.menu-item.active .sub-topics.full-list {
    display: block;
}

@media (max-width: 768px) {
    /* .sub-topics {
        display: none;
    } */

    .menu-item {
        /* flex-direction: column; */
        width: 100%;
        margin: 2vw;
        padding: 3vw 2vw;
    }
    
    .menu-item.active  {
        width: 100%;
    }

    /* .left-content {
        width: 100%;
        justify-content: center;
    } */
    .right-content {
        width: 100%;
        margin-top: 1vw;
        margin-left: 1vw;
    }

    .left-content i {
        font-size: 5vw;
    }

    .menu-title {
        font-size: 5vw;
    }
    /* .menu-item .show-all-topics {
        display: none;
    } */
    
}

.topic-dropdown {
    position: absolute;
    top: 0;
    left: 0;
    background: white;
    
    border: 1px solid #ccc;
    z-index: 999;
    min-width: 150px;
}
.topic-dropdown {
    position: absolute;
    top: 0;
    left: 0;
    background: white;
    color: var(--primary-dark);
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 999;
    min-width: 160px;
    padding: 6px 0;
    font-family: system-ui, sans-serif;
    animation: fadeInDropdown 0.2s ease;
}

.topic-option {
    padding: 6px 12px;
    cursor: pointer;
}

.topic-option:hover {
    background-color: #f2f8ff;
}

.topic-option.selected {
    font-weight: bold;
    background-color: #e6f0ff;
}


/* .topic-link-card {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 5px 0;
    transition: background-color 0.2s, box-shadow 0.2s;
}
.topic-link-card a {
    color: #000;
    text-decoration: none;
    font-weight: 500;
    display: block;
}
.topic-link-card:hover {
    background-color: #f9f9f9;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
}
.topic-link-card a:hover {
    color: #007BFF;
} */








.rev-wrapper {
    width: 97%;
    max-width: 1150px;
    margin: 0 auto;
}
.rev-breadcrumb {
    margin-top: 1rem;
    color: #555;
}
.rev-breadcrumb h1{
    font-size: 1em;
    display: inline;
}
.rev-breadcrumb a {
    text-decoration: none;
    color: #0077cc;
}
.rev-breadcrumb .clickable {
    cursor: pointer;
}
.rev-breadcrumb .select {
    font-size: 0.95rem;
    padding: 2px 6px;
    margin-left: 3px;
}
.rev-breadcrumb .hidden {
    display: none;
}




.rev-popup {
    display: flex;
    flex-direction: column;
    height: 70vh;
    margin: 0.5em auto; 
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    border: 1px solid #ddd;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease;
}
.rev-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6em;
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid #ddd;
    background: #f0f0f0;
}
.rev-popup-header h2 {
    margin: 0;
}
#subtopicSelect {
    position: absolute;
    top: 100%;
    left: 0;
    width: max-content;
    min-width: 300px;
    background: #fff;
    z-index: 999;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-height: 500px;
    overflow-y: auto;
}
@media (max-width: 768px) {
    #subtopicSelect {
        max-height: 350px;
    }
}
#subtopicSelect.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
#subtopicSelect:not(.hidden) {
    opacity: 1;
    visibility: visible;
}
#subtopicSelect.select {
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    appearance: none; /* 清除原生樣式 */
    transition: opacity 0.2s ease, visibility 0.2s ease;
    max-width: 100%;
}
.rev-popup-close-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: black;
}
.rev-popup-images {
    margin: 1em 0;
}
.rev-popup-images img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0.5em;
}
.breadcrumb-subtopic .select {
    padding: 6px 10px;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: white;
    color: #333;
    appearance: none; /* 🔸移除系統樣式 (Chrome/Firefox/Edge) */
    -webkit-appearance: none; /* 🔸Safari */
    background-image: url("/icons/arrow-down.svg");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px; /* 為咗顯示箭咀 */
}

#revPopupTitle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

#revPopupTitle select {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    font-size: 1rem;
}
#revPopup .select {
    border: 1px solid #ccc;
    background: #fff;
    padding: 0;
    margin-top: -12px;
    border-radius: 4px;
    width: 100%;
}
#revTitleText {
    white-space: nowrap;       
    overflow: hidden;         
    text-overflow: ellipsis;   
    max-width: 100%;           
}

.selector-options {
    list-style: none;
    padding: 0;
    margin: 0;
    
    overflow-y: auto;
    color: var(--primary-dark);
}
.selector-options li {
    padding: 6px 10px;
    cursor: pointer;
}
.selector-options li:hover,
.selector-options li.selected {
    background-color: #e2f0ff;
}






.important-formula {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f8f8;
    border-left: 4px solid #4CAF50;
    padding: 7px 15px;
    margin: 10px auto;
    width: 92%;
    text-align: center;
    font-size: 1.1em;
    font-family: 'Georgia', serif;
    border-radius: 5px;
}
.important-formula .left-container{
    display: flex;
    flex-direction: column;

}
.important-formula .left-container p {
    text-align: left;
    margin: 0;
}
.important-formula .latex {
    text-align: center;
    width: 86%;
}
.important-formula .nav-cta {
    font-size: 0.7em;
}





.section-title {
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: -8px;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.section-title:nth-child(1) {
    z-index: 30;
}
.section-title:nth-child(2) {
    z-index: 20;
}
.section-title:nth-child(3) {
    z-index: 10;
}
.section-title.title-examples {
  background-color: #B3E5FC;
}


.section-title.title-practices {
  background-color: #DCEDC8; 
}
.section-title.title-generate-questions {
  background-color: #F8BBD0; 
}

.section-body {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
    min-height: 0;  
}

.section-body.active {
    background: #fff;
}

.section-title.push-to-bottom {
  margin-top: auto;
}

.block-text {
    font-size:18px;
    margin-bottom: 10px;
}

.example-text {
    font-size:18px;
    margin-bottom: 5px;
}
.practice-item.correct {
    background-color: #d4edda; 
    border: 1px solid #28a745;
}

.practice-item.wrong {
    background-color: #f8d7da; 
    border: 1px solid #dc3545;
}
.practice-input  input{
    margin:3px;
    width:97%;
}

.practice-line {
    display: flex;
    align-items: center;
    gap: 6px; 
    flex-wrap: nowrap;
}

.practice-prefix,
.practice-suffix {
    font-size: 1rem;
    white-space: nowrap;
}

.practice-input input {
    width: 120px; 
    padding: 4px 8px;
    font-size: 1rem;
}

.practice-tab-btn.active-tab {
    background-color: var(--link-color);
    color: #fff;
 
}





.rev-nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5em auto;
    width:100%;
    gap: 1em;
}
.rev-nav-btn {
    flex: 1;
    text-align: center;
    padding: 0.8em 1em;
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
}

@media (max-width: 768px) {
    .rev-nav-btn {
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: clamp(0.3rem, 3vw, 1rem);
    }
}
.rev-nav-btn:hover {
    background: #ececec;
}

.rev-prev {
    justify-content: flex-start;
}

.rev-next {
    justify-content: flex-end;
}


.side-menu {
    position: fixed;
    top: 0;
    left: -270px;
    width: 220px;
    height: 100%;
    background-color: var(--background-color);
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 9852  ;
    padding: 5px 10px 20px 10px;
}
.side-menu.active {
    left: 0;
}
.side-menu-content {

    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    margin-bottom:14px;
}
.side-menu-item {
    cursor: pointer;
    padding: 10px;
    background: #ffffff;
    border-radius: 4px;
}
.side-menu-item:hover {
    background: #e0e0ff;
}
.side-menu-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 7vh;
}
.side-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 9550;
}
.side-overlay.active {
    opacity: 1;
    pointer-events: auto;
}