*,*::before, *::after{
    margin: 0;
    box-sizing: border-box;
}
body {
    font-family: "Work Sans", "Noto Sans", sans-serif;
    margin: 0;
    background-color: #f5f5f5;
}

/* Header 樣式 */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* 讓左右元素有間距 */
    white-space: nowrap;
    border-bottom: 1px solid #f0f2f5;
    padding: 12px 40px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 1000;
    background-color: #ffffff;
}

.header-left-section {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #111418;
}

.logo-icon {
    width: 16px;
    height: 16px;
}

.logo-title {
    color: #111418;
    font-size: 18px;
    font-weight: 700;
    line-height: 28px;
    letter-spacing: -0.015em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 36px;
}

.nav-links a {
    color: #111418;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-decoration: none;
    padding: 5px 0; /* 增加點擊區域 */
}

.header-right-section {
    display: flex;
    flex: 1; 
    justify-content: flex-end; /* 靠右對齊 */
    align-items: center;
}

/* Profile Image 樣式 */
.profile-image {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    aspect-ratio: 1 / 1;
    border-radius: 9999px;
    width: 40px;
    height: 40px;
}

/* Hamburger Menu 樣式 */
.hamburger-menu {
    display: none; /* 預設隱藏 */
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    /* z-index 在手機版媒體查詢中設定 */
}

.hamburger-menu .bar {
    width: 25px;
    height: 3px;
    background-color: #111418; /* 改為純黑色，與叉叉顏色一致 */
    margin: 4px 0;
    transition: 0.4s;
}

/* Hamburger Animation - 重新啟用 */
.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* 新增：漢堡選單關閉按鈕樣式 */
.hamburger-menu-close {
    position: absolute;
    top: 25px; /* 調整位置 */
    right: 60px;;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1000; /* 確保在下拉選單的最上層 */
    display: none; /* 預設隱藏，只在手機版顯示 */
}

.hamburger-menu-close::before,
.hamburger-menu-close::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: #111418;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.hamburger-menu-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Dropdown Nav 樣式 */
.nav-dropdown {
    display: none; /* 預設隱藏 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    background-color: #ffffff;
    border-top: 1px solid #f0f2f5;
    flex-direction: column;

    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    overflow-y: auto; /* 如果內容過多可以滾動 */
}

.nav-dropdown.active {
    display: flex; 
}

.nav-dropdown a {
    padding: 15px 0; /* 增加點擊區域 */
    height: 100px;
    color: #111418;
    text-decoration: none;
    font-size: 20px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    margin-bottom: 20px;
    font-weight: 500;
}
/* 新增 hover 效果 */
.nav-dropdown a:hover {
    background-color: #f0f2f5; /* 淺灰色背景 */
}

/* 新增 active 效果 */
.nav-dropdown a:active {
    transform: scale(0.98); /* 點擊時縮小 */
}


.nav-dropdown a:last-child {
    border-bottom: none;
}


.search-block {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content:center;
    background-color: #ffffff;
    padding-top: 30px; 

}

.start-time-div,
.end-time-div,
.search-bar-div{
    display: flex;
    align-items: center;
}
.search-bar-title{
    font-size: 17px;
    color: #0000008c;
    font-weight: 470;
    padding-left: 6px;
    padding-right: 6px;
}
.search-bar {
    display: flex;
    align-items: center;
    width: 150px;
    height: 30px; /* !h-10 */
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    box-sizing: border-box; 
    padding: 0 10px; 
    border: none; 
    outline: none; 
    border-radius: 5px 0 0 5px;
    border: 1px solid #ddd;
}
.search_icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background-color: #FFFFFF;
    cursor: pointer;
    border-radius: 0 5px 5px 0 ;
    transition: background-color 0.3s ease;
    font-size: 20px;
    position: relative;
}
.search_icon::before {
    content: "🔍";
}
.search_icon:hover {
    transform: scale(1.05);
}
.search_icon:active {
    transform: scale(1);
    box-shadow: inset 0 0 10px 1px rgba(0, 0, 0, .2);
}
.start-time-title{
    font-size: 17px;
    color: #0000008c;
    font-weight: 480;
    text-align: left;
    padding-left: 6px;

}
.end-time-title{
    font-size: 17px;
    color: #0000008c;
    font-weight: 480;
    text-align: left;
    padding-left: 6px;

}
.start-time-calendar {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-left: 10px;
    height: 30px;
    font-size: 14px;
    font-weight: 480;
    color: #0000008c;
}
.end-time-calendar {
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-left: 10px;
    height: 30px;
    font-size: 14px;
    font-weight: 480;
    color: #0000008c;
}

.content-flex {
    display: block;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding-top: 50px;
    /* width: 100vw; */

}

.right-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 40px;
    background-color: white;

    /* padding-right: 15px; */

}
.tradingview-widget-container {
    padding-top: 30px;
    width: 60%;
    height: 1000px;
    min-width: 320px;
}
.block {
    display: flex;
    flex-direction: column; /* 垂直堆疊 */
    padding-top: 10px;
    padding-left: 10%;
    padding-right: 10%; 
    width: 95%;  
}


.publishAtDiv{
    font-size: 15px;
    color: #110f0fad;
    font-weight: 450;
    border-radius: 8px;
    position: relative;
    
}
/* .section {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
} */

.news-sesstion{
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding-top: 15px;
    padding-left: 15px;
    padding-right: 15px;
    cursor: pointer;
}
.news-sesstion:hover {
    background-color: #e0e0e012;
}
.news-sesstion:active{
    transform: scale(0.99);
}



.news-title{
    flex: none;
    font-size: 19px;
    color: #000000;
    font-weight: 500;
    text-align: left;
    margin-bottom: 10px;
    
}
.news-content{
    flex: none;
    font-size: 18px;
    color: #110f0fb5;
    font-weight: 500;
    text-align: left;
    margin-bottom: 10px;
    /* 新增以下屬性來實現多行截斷 */
    /* display: -webkit-box; /* 使用 Flexbox 模型 */
    /* -webkit-box-orient: vertical; 設定為垂直方向 */
    /* -webkit-line-clamp: 3; 設定顯示的最大行數，例如 3 行 */ 
    /* white-space: normal; 確保文字可以換行 */
    white-space: nowrap; /* 文本不換行 */
    overflow: hidden; /* 超出部分隱藏 */
    text-overflow: ellipsis; /* 在截斷處顯示省略號 */

}
.category{
    flex: none;
    font-size: 15px;
    color: grey;
    font-weight: 450;
    text-align: left;
    padding-top: 15px;
    margin-bottom: 10px;
    width:60px;
}
.source{
    flex: none;
    font-size: 15px;
    color: grey;
    font-weight: 450;
    text-align: left;
    padding-top: 5px;
    margin-bottom: 10px;
    width:60px;
}

.news-url{
    display: none;
}

.errorMessage{
    font-size: 25px;
    font-weight: 700;
    color: rgb(229, 6, 6);
    text-align: center;
    margin-top: 100px; 
    margin-bottom: 100px;  
}
#loading-indicator {
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    height: 200px; 
    width: 100vw;
    display: none; /* Make sure it is hidden initially, JavaScript will control its display */
    font-size: 20px; 
    font-weight: 700;
    color: rgba(221, 177, 44, 0.574);
    margin-top: 50px; 
    margin-bottom: 50px;
}


.spinner {
    border: 8px solid rgba(255, 255, 255, 0.3); 
    border-top: 8px solid rgba(221, 177, 44, 0.574); 
    border-radius: 50%; 
    width: 60px; 
    height: 60px; 
    animation: spin 1s linear infinite; 
    margin-bottom: 15px; 
}

/* Rotation animation definition */
@keyframes spin {
    0% { transform: rotate(0deg); } /* Start at 0 degrees */
    100% { transform: rotate(360deg); } /* Rotate 360 ​​degrees */
}
.footer {
    background-color: #f0f2f5; 
    padding: 20px 40px;
    text-align: center;
    border-top: 1px solid #e0e4e8; 
    margin-top: auto; 
}

.footer_text {
    color: #60748a; 
    font-size: 14px;
    line-height: 1.6;
    max-width: 960px; 
    margin: 0 auto; 
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}
.footer-link {
    display: inline-block;
    padding: 0 6px;
    background: none;
    color: #0056b3;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    border-radius: 0;
    margin: 0 2px;
    transition: color 0.2s;
    text-decoration: underline;
    box-shadow: none;
}
.footer-link:hover, .footer-link:focus {
    color: #333;
    background: none;
    text-decoration: underline;
    box-shadow: none;
}
.footer-link:active {
    color: #111418;
    background: none;
    text-decoration: underline;
    box-shadow: none;
}
/* 響應式調整 */
@media (max-width: 820px) {
    .main-header {
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center;
        padding: 12px 20px;
        flex-wrap: nowrap; 
        z-index: 100; /* 確保在手機版時 Header 也在下拉選單之下 */
    }

    .header-left-section {
        flex-direction: row; 
        justify-content: flex-start; 
        width: auto; 
        margin-bottom: 0; 
    }

    .nav-links {
        display: none; 
    }

    .header-right-section {
        flex: none; 
        width: auto; 
        margin-top: 0; 
        justify-content: flex-end; 
        gap: 0; 
    }

    .profile-image {
        display: none; 
    }

    .hamburger-menu {
        margin-right: 30px;
        display: flex; 
        z-index: 1001; /* 確保漢堡選單在 Header 之上 */
    }

    .nav-dropdown {
        display: none; 
        flex-direction: column;
        align-items: flex-start;
        padding: 60px 20px 10px 20px; /* 增加頂部 padding 給關閉按鈕留空間 */
    }
    .nav-dropdown.active {
        display: flex; 
    }
    .nav-dropdown a {
        width: 100%; 
        justify-content: flex-start;
        padding: 15px 20px;
    }

    /* 手機版顯示關閉按鈕 */
    .hamburger-menu-close {
        display: block; 
    }
    .start-time-div,
    .end-time-div,
    .analysis-type-div,
    .search-bar-div{
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    .analysis-type-select {
        width: 213px;
    }
    .search-bar{
        width: 170px;
    }
    .news-title{
        font-size: 17px;
    }
    .news-content{
        font-size: 16px;
    }
    .block {
        padding-left: 5%;
        padding-right: 5%; 
        width: 95%;  
    }

}

/* 針對更小的手機螢幕進行微調 */
@media (max-width: 480px) {
    .main-header {
        padding: 10px 15px; 
    }
    .nav-dropdown {
        padding: 50px 15px 5px 15px; /* 進一步調整 padding */
    }
    .start-time-div,
    .end-time-div,
    .analysis-type-div,
    .search-bar-div{
        width: 100%;
    }
}

