
/*google fonts 思源黑體*/
@import url(https://fonts.googleapis.com/earlyaccess/notosanstc.css);
/*font-family: ‘Noto Sans TC’, sans-serif;*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}
:root {
  --white: #fff;
  --black: #000;
  --navy: #022836;
  --orange: #FF4628;
  --grey: #F5f5f5;
  --gold: #c2a859;
  --goose: #ffe8c5;
  --darkbrown: #1d110e;
  --timeline-gradient: rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0) 100%;
	--gap: 4vw;          /* 左右間距 */
  --img-radius: 12px;  /* 圖圓角 */
  --img-shadow: 0 8px 20px rgba(0,0,0,.12);
  --txt-width: 32rem;  /* 文字區塊寬度 */
  --z-img: 1;
  --z-text: 2;
}

body {
  font-family: "Noto Serif TC", sans-serif;
    color: var(--navy);
    background-color:  var(--orange);
	position: relative;
	font-display: swap;
}

/*--          # Back to top button          --*/
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 996;
  background: var(--orange);
  width: 40px;
  height: 40px;
  border-radius: 50px;
  transition: all 0.4s;
}

.back-to-top i {
  font-size: 2rem;
  color: #fff;
  line-height: 0;
}

.back-to-top:hover {
  background: var(--purple);
  color: #fff;
}

.back-to-top.active {
  visibility: visible;
  opacity: 1;
}

/* Container for responsive layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Responsive utilities */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    padding: 0 15px;
    flex: 1;
}

/* Media Queries for RWD */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    html {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }

    .row {
        margin: 0 -10px;
    }

    .col {
        padding: 0 10px;
    }
}

/* Basic styling */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 0.5em;
    font-weight: 600;
}

p {
    margin-bottom: 1em;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* Header Styles */
header {
    position: relative;
    background: url(/images/ai_books/parner/hero-bg.png);
    background-position: center top;
    background-size: 100%;
    height: 480px;
    overflow: hidden;
    transition: height 0.3s ease;
}
@media (max-width: 576px) {
    header {
    
    background-position: center center;
    background-size: cover;
    overflow: hidden;
    transition: height 0.3s ease;
}
}
header.nav-fixed {
    height: 560px;
    /* 640px - 80px (nav height) */
}

/* Logo 站名區塊 */
.logo-section {
    height: 160px;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.logo {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    color:  var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.main-title {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

/* 導覽列 */
.nav-section {
    height: 80px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-section.fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(2, 40, 54, 0.8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease;
    /* keep smooth in case layout shifts */
    white-space: nowrap;
}

.nav-logo img {
    height: 35px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 10px;
    margin-left: auto;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0;
    height: 2px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu li a:hover::after {
    width: 70%;
}

/* 若未來需要，啟用 active 狀態底線 */
.nav-menu li a.active::after {
    width: 70%;
}

/* 訊息看板列 */
.banner-section {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-content {
    text-align: center;
    color: white;
}

.banner-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.banner-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin: 0 auto;
}

@media (max-width: 576px) {
    .banner-content {
    width: 90%;
    color: white;
}
}

/* 主內容區塊 */
.main-content {
}

.content-section {
    padding: 0 20px;
}

/* # Sections General */
section {
  padding:40px 0;
  overflow: hidden;
	/* background:linear-gradient(to bottom, #ecebeb, #d9d9d9); */
}

.section-title {
	margin: 0px auto;
	padding: 20px 0;
	text-align: center;
	/* background:linear-gradient(to bottom, #d9d9d9 0%, #ecebeb 20%,rgba(217,217,217,0) 100%); */
}

.section-title h2 {
  font-family: "Noto Serif TC", sans-serif;
	color: var(--navy);
  font-size: 2.8rem;
  font-weight: 700;
  padding: 0;
  margin: 0;
  letter-spacing: .1rem;
  text-transform: uppercase;
}
.section-title p {

  font-family: "Noto Serif TC", sans-serif;
  font-size: 1.25rem;
}

@media (max-width: 768px) {
    .section-title h2 {
        font-size: 2.2rem;
        letter-spacing: .05rem;
    }
    .section-title p {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .section-title h2 {
        font-size: 1.9rem;
    }
    .section-title p {
        font-size: 1rem;
    }
}

.ai-guide {
    background: #FF6B53;
} 

/* Explore 區塊的響應式布局 */
.explore-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.explore-text {
    flex: 1;
    width: 80%;
    margin: 0 10%;
    font-family: "Noto Serif TC", sans-serif;
    font-size: 1.25rem;
    line-height: 2rem;
}

.explore-text h2 {
    margin-bottom: 0.5em;
}

.explore-text p {
    margin-bottom: 0;
}

.instant-chat {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-left: 8px;        /* 與文字間距 */
    padding: 4px 10px;

    background-color: var(--white);
    color: var(--navy);

    font-size: 1rem;
    line-height: 1.2;

    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;     /* 不換行 */
}

@media (max-width: 768px) {
    .explore-text {
        width: 100%;
        margin: 0;
        font-size: 1.25rem;
        line-height: 1.8rem;
    }
}

/* 書籍瀑布流樣式 */
.books-grid {
    column-count: 1;
    column-gap: 20px;
    margin-top: 20px;
}

.book-item {
    break-inside: avoid;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
}

.book-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}



.book-cover {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid #eee;
}

.book-info {
    padding: 15px;
}

.book-title {
    font-family: "Noto Serif TC", sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--navy);
}

.book-author {
    font-family: "Noto Serif TC", sans-serif;
    margin-bottom: 0px;
}

.book-publisher {
    font-size: 0.8rem;
    color: #888;
}

.ai-book {
    background-color: var(--grey);
}
.ai-book .section-title {
    width: 80%;
}
/* .ai-book .books-grid {
    column-count: 4;
    column-gap: 20px;
    margin-top: 20px;
} */

 /* AI BOOK 改用 Grid 橫向排列 */
.ai-book .books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    column-gap: 20px;   /* 左右間距 */
    row-gap: 0px;      /* 上下間距（重點） */

    column-count: unset;
}

.ai-book .books-grid .book-item  {
    background-color: #FFF;
    padding-bottom: 8px;     /* 卡片下緣呼吸空間 */
    border-radius: 6px;
}

.ai-book .books-grid .book-item img {
    padding: 15px 0;
}
.ai-book .books-grid .book-item .book-info {
    text-align: center;
}
.ai-book .books-grid .book-item .book-title {
    min-height: 6rem;
    font-weight: 700;
}
.ai-book .books-grid .book-item .book-title span {
    font-size: 1rem;
    display: block;
    font-weight: 300;
}
.ai-book .books-grid .book-item .book-author {
    font-size: 1rem;
}

.ai-book .btn-link {
    background-color: #B9C8D7;
    width: 300px;
    color: var(--navy);
    text-decoration: none;
    border-radius: 0;
}
.ai-book .btn-link:hover {
    background-color: var(--navy);
    color: var(--white);
}
/* 探索項目的 Flex 布局 */
.books-grid.explore-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    column-count: unset;
    column-gap: unset;
}

.books-grid.explore-grid .book-item {
    flex: 0 0 auto;
    width: calc(80% );
    min-width: 200px;
    margin-bottom: 0;
}

/* Explore 區塊六個 book-item 不同底色 */
.books-grid.explore-grid .book-item:nth-child(1) {
    background-color: #FFEDEA;
}
.books-grid.explore-grid .book-item:nth-child(2) {
    background-color: #FFDAD4;
}
.books-grid.explore-grid .book-item:nth-child(3) {
    background-color: #FFCFC7;
}
.books-grid.explore-grid .book-item:nth-child(4) {
    background-color: #FFC4BA;
}
.books-grid.explore-grid .book-item:nth-child(5) {
    background-color: #FFB8AD;
}
.books-grid.explore-grid .book-item:nth-child(6) {
    background-color: #FFAEA0;
}
.books-grid.explore-grid .book-item:nth-child(7) {
    background-color: #FFA393;
}
.books-grid.explore-grid .book-item:nth-child(8) {
    background-color: #FF9986;
}
.books-grid.explore-grid .book-item:nth-child(9) {
    background-color: #FF8F79;
}
.books-grid.explore-grid .book-item:nth-child(10) {
    background-color: #FF856C;
}
.books-grid.explore-grid .book-item:nth-child(11) {
    background-color: #FF7B5F;
}
.books-grid.explore-grid .book-item:nth-child(12) {
    background-color: #FF7152;
}


@media (max-width: 1024px) {
    .ai-book .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ai-book .books-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .ai-book .books-grid {
        grid-template-columns: 1fr;
    }
    .books-grid.explore-grid .book-item {
    flex: 0 0 auto;
    width: calc(96% );
    min-width: 200px;
    margin-bottom: 0;
}
}
@media (max-width: 768px) {
    .ai-book .section-title {
        width: 80%;
        text-align: center;
    }
    .ai-book .section-title p {
        font-size: 1.25rem;
    }
}

/* AI 導引對話框樣式 */
.ai-guider-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.ai-guider-overlay.show {
    display: flex;
}

.ai-guider {
    position: relative;
    width: 800px;
    height: 600px;
    max-width: 100%;
    max-height: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: aiGuiderFadeIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.ai-guider-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: none;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.2s ease;
}

.ai-guider-close:hover {
    background: #ff3742;
    transform: scale(1.1);
}

.ai-guider-content {
    padding: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Chatbot 主要區域樣式 */
.chatbot-main {
    flex: 1;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f1f3f4 100%);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    /* 確保高度填滿父容器 */
    min-height: 0;
    /* 確保 flex 容器能正確縮小 */
    overflow: hidden;
    /* 防止內容溢出 */
}

/* chatbot 對話區域 - 填滿剩餘空間 */
#chatbot-conversations {
    flex: 1;
    /* 填滿剩餘空間 */
    margin: 16px;
    /* 外邊距 */
    padding: 24px;
    /* 內邊距 */
    border: 1px solid rgba(148, 163, 184, 0.2);
    /* 更淡的邊框 */
    border-radius: 16px;
    /* 更大的圓角 */
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%),
        radial-gradient(circle at 20% 20%, rgba(52, 152, 219, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(156, 163, 175, 0.02) 0%, transparent 50%);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.04),
        0 1px 4px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    /* 更細緻的陰影 */
    overflow-y: auto;
    /* 垂直滾動 */
    overflow-x: hidden;
    /* 隱藏水平滾動 */
    position: relative;
    backdrop-filter: blur(10px);
    /* 背景模糊效果 */
    min-height: 0;
    /* 確保 flex 容器能正確縮小 */
    max-height: 100%;
    /* 限制最大高度 */
}

/* 對話區域的質感裝飾 */
#chatbot-conversations::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(52, 152, 219, 0.1) 25%,
            rgba(52, 152, 219, 0.3) 50%,
            rgba(52, 152, 219, 0.1) 75%,
            transparent 100%);
    border-radius: 16px 16px 0 0;
}

/* chatbot 輸入列 - 固定在底部 */
#chatbot-talk {
    flex: 0 0 84px;
    /* 固定高度 84px */
    width: 100%;
    /* 寬度 100% */
    display: flex;
    /* flex 佈局 */
    align-items: center;
    /* 垂直置中 */
    padding: 16px 20px;
    /* 內邊距 */
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    /* 更淡的頂部邊框 */
    gap: 12px;
    /* 左右元件間隔 */
    position: relative;
    backdrop-filter: blur(8px);
}

/* 輸入列的裝飾線 */
#chatbot-talk::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(52, 152, 219, 0.2) 50%,
            transparent 100%);
}

/* 輸入文字框 */
.chat-input {
    flex: 1;
    /* 佔用剩餘空間 */
    height: 42px;
    padding: 8px 16px;
    border: 1px solid #d1d9e0;
    border-radius: 21px;
    /* 圓角輸入框 */
    background: #ffffff;
    font-size: 14px;
    color: #2c3e50;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    resize: none;
    /* 禁止調整大小 */
}

.chat-input:focus {
    border-color: #3498db;
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(52, 152, 219, 0.15);
}

.chat-input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

.chat-input:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* 發送按鈕 */
.chat-send-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    /* 圓形按鈕 */
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.chat-send-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.chat-send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.4);
}

.chat-send-btn:disabled {
    background: #95a5a6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.chat-send-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 2px 6px rgba(149, 165, 166, 0.3) !important;
}

/* 語音輸入按鈕 */
.chat-voice-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    /* 圓形按鈕 */
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
    margin-left: 8px;
}

.chat-voice-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
    transform: translateY(-1px);
}

.chat-voice-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.4);
}

.chat-voice-btn:disabled {
    background: #95a5a6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.chat-voice-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 2px 6px rgba(149, 165, 166, 0.3) !important;
}

/* 語音輸入按鈕聆聽狀態 */
.chat-voice-btn.listening {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important;
    animation: pulse 1.5s infinite;
}

/* 語音回覆切換按鈕 */
.voice-reply-toggle {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(155, 89, 182, 0.3);
    margin-left: 8px;
    position: relative;
}

.voice-reply-toggle:hover {
    background: linear-gradient(135deg, #8e44ad 0%, #7d3c98 100%);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.4);
    transform: translateY(-1px);
}

.voice-reply-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(155, 89, 182, 0.4);
}

/* 語音回覆開啟狀態 */
.voice-reply-toggle.active {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%) !important;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
}

.voice-reply-toggle.active:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%) !important;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

/* 切換指示器 */
.toggle-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #e74c3c;
    border: 2px solid white;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.voice-reply-toggle.active .toggle-indicator {
    background: #27ae60;
}

/* TTS 模式切換按鈕 */
.tts-mode-toggle {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
    margin-left: 8px;
    position: relative;
}

.tts-mode-toggle:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    transform: translateY(-1px);
}

.tts-mode-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.4);
}

/* OpenAI TTS 模式 */
.tts-mode-toggle.openai {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%) !important;
    box-shadow: 0 2px 6px rgba(230, 126, 34, 0.3);
}

.tts-mode-toggle.openai:hover {
    background: linear-gradient(135deg, #d35400 0%, #ba4a00 100%) !important;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

/* TTS 模式指示器 */
.tts-mode-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: white;
    color: #2c3e50;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

@keyframes pulse {
    0% {
        box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
    }

    50% {
        box-shadow: 0 4px 16px rgba(39, 174, 96, 0.6);
    }

    100% {
        box-shadow: 0 2px 6px rgba(39, 174, 96, 0.3);
    }
}

/* 聊天訊息樣式 */
.chat-message {
    margin-bottom: 16px;
    display: flex;
    width: 100%;
    clear: both;
    flex-shrink: 0;
    /* 防止訊息被壓縮 */
}

.chat-message-user {
    justify-content: flex-end;
    /* 靠右對齊 */
}

.chat-message-ai {
    justify-content: flex-start;
    /* 靠左對齊 */
}

.chat-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    /* 強制長單字換行 */
    overflow-wrap: break-word;
    /* 確保內容換行 */
    position: relative;
    flex-shrink: 0;
    /* 防止內容被壓縮 */
}

/* 用戶訊息樣式 */
.chat-message-user .chat-message-content {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-bottom-right-radius: 6px;
    /* 右下角小圓角 */
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* AI 回答樣式 */
.chat-message-ai .chat-message-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #2c3e50;
    border-bottom-left-radius: 6px;
    /* 左下角小圓角 */
    border: 1px solid rgba(52, 152, 219, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 聊天訊息的 hover 效果 */
.chat-message-content:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

.chat-message-user .chat-message-content:hover {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.chat-message-ai .chat-message-content:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* 對話區域滾動條樣式 */
#chatbot-conversations::-webkit-scrollbar {
    width: 8px;
}

#chatbot-conversations::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    margin: 4px 0;
}

#chatbot-conversations::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.4);
    border-radius: 4px;
    min-height: 30px;
}

#chatbot-conversations::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.6);
}

#chatbot-conversations::-webkit-scrollbar-thumb:active {
    background: rgba(52, 152, 219, 0.8);
}

/* 正在輸入指示器樣式 */
.typing-indicator {
    opacity: 0.7;
}

.typing-content {
    background: linear-gradient(135deg, #f0f1f2 0%, #e0e2e4 100%) !important;
    padding: 16px 20px !important;
}

.typing-dots {
    display: inline-block;
    font-size: 18px;
    font-weight: bold;
    color: #6c757d;
}

.typing-dots span {
    animation: typing 1.4s infinite ease-in-out;
    opacity: 0;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        opacity: 0;
    }

    30% {
        opacity: 1;
    }
}

@keyframes aiGuiderFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ai-video {
    background-color: #B9C8D7;
}
.ai-video .section-title {
	margin: 0px auto;
	padding: 0px 0;
    width: 90%;
	text-align: left;
}
.ai-video .section-title h2 {
  font-family: "Noto Serif TC", sans-serif;
	color: var(--navy);
  font-size: 2.8rem;
  font-weight: 700;
  padding: 0;
  margin: 0 0 10px 0;
  letter-spacing: .1rem;
  text-transform: uppercase;
}
.ai-video .section-title h3 {
    font-family: "Noto Serif TC", sans-serif;
    color: var(--navy);
    background-color: #D1DAE3;
    padding: 4px 10px;
    margin-top:20px 0 20px 0;
    display: inline-block;
}

/* YouTube / iframe 響應式容器 */
.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 960px;          /* 桌機最大寬度，可視需要調整 */
    margin: 20px auto 0;            /* 置中 */
    padding-top: 56.25%;       /* 16:9 比例 */
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;        /* 與整體設計一致 */
}

@media (max-width: 768px) {
    .ai-video .section-title {
        width: 100%;
        text-align: center;
    }
    .ai-video .section-title h2 {
        font-size: 2.2rem;
    }
}

.ai-intro {
    background-color: #F1F4F7;
}
.ai-intro .section-title {
	margin: 0px auto;
	padding: 0px 0;
    width: 90%;
	text-align: left;
}

.ai-intro .section-title h2 {
  font-family: "Noto Serif TC", sans-serif;
	color: var(--orange);
  font-size: 2.8rem;
  font-weight: 700;
  padding: 0;
  margin: 0 0 10px 0;
  letter-spacing: .1rem;
  text-transform: uppercase;
}
.ai-intro .section-title h3 {
    display: inline-block;
    color: var(--white);
    background-color: #FF3F34;
    padding: 4px 10px;
    margin-top:20px 0 0 0;
}
.ai-intro .section-title p {
color: var(--navy);
}

@media (max-width: 768px) {
    .ai-intro .section-title p {
        font-size: 1.25rem;
        line-height: 2rem;
    }
}

.ai-core {
    background-color: #FFF;
}
.ai-core .item {
    text-align: center;
    padding: 10px;
  font-family: "Noto Serif TC", sans-serif;
}
.ai-core .item img {
    width: 80%;
}
.ai-core .item h3 {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--orange);
}
.ai-core .item h3 span {
 font-size: 1.8rem;
}
.ai-core .item p {
    font-size: 1.375rem;

}

.feedback {
    background-color: #9AA9AF;
}
.feedback .section-title {
	margin: 0px auto;
	padding: 0px 0;
    width: 90%;
	text-align: left;
}

.feedback .section-title h2 {
  font-family: "Noto Serif TC", sans-serif;
	color: var(--navy);
  font-size: 2.8rem;
  font-weight: 700;
  padding: 0;
  margin: 0 0 10px 0;
  letter-spacing: .1rem;
  text-transform: uppercase;
}
.feedback .section-title h3 {
    display: inline-block;
    color: var(--white);
    background-color: #20424E;
    padding: 4px 10px;
    margin-top:20px 0 0 0;
}
.feedback .section-title p {

}
.feedback-iframe {
    background-color: #677E86;
}

@media (max-width: 768px) {
    .feedback .section-title {
        width: 100%;
        text-align: center;
    }
}

.cta-a {
    background-color: #35535E;
}
.cta-a h2 {
    color: #A5DEFE;
}
/* Footer 區塊 */
footer {
    background: #022836;
    color: white;
    overflow: auto;
}
.copyright {
    float: left;
    padding: 20px 0 0 40px;
    background-color: #193C48;
    width: 65%;
}
#footer .copyright {
  font-size: 0.9375rem;
  line-height: 1.6rem;
}
#footer .copyright a {
  color: #FFF;
  text-decoration: underline;
}
.footer-links {
    float: right;
    width: 35%;
    padding: 60px 40px 0 0;
    text-align: right;
}
#footer .footer-links a {
  color: #FFF;
  opacity: 1;
  font-size: 1.5rem;
  transition: 0.3s;
  display: inline-block;
  line-height: 1;
	margin: 0 0 0 10px;
}

#footer .footer-links a:hover {
  opacity: 0.6;
}
#footer .footer-links img {
	width: 160px;
  margin-bottom: 10px;
	display: inline-block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .3));
}

@media (max-width: 768px) {
    .copyright,
    .footer-links {
        float: none;
        width: 100%;
        padding: 20px;
    }

    .footer-links {
        padding-top: 10px;
        text-align: center;
    }
}

/* 響應式調整 */
@media (max-width: 768px) {
    header {
        height: 480px;
    }

    header.nav-fixed {
        height: 400px;
        /* 480px - 80px (nav height) */
    }

    .logo-section {
        height: 120px;
    }

    .logo {
        top: 15px;
        right: 20px;
        font-size: 1rem;
    }

    .main-title {
        font-size: 2rem;
    }

    .banner-section {
        /* height: 280px; */
    }

    .banner-title {
        font-size: 2rem;
    }

    .nav-logo {
        font-size: 1.1rem;
        margin-right: 20px;
    }

    .nav-menu {
        gap: 15px;
    }

    .nav-menu li a {
        padding: 8px 12px;
        font-size: 1.125rem;
    }

    /* Mobile 版本的 explore 布局 */
    .explore-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .instant-chat {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
    }

    /* Mobile 版本的 AI 導引對話框 */
    .ai-guider-overlay {
        padding: 0;
    }

    .ai-guider {
        width: 100%;
        height: 100%;
        border-radius: 0;
        animation: aiGuiderSlideUp 0.3s ease-out;
    }

    .ai-guider-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .ai-guider-content {
        padding: 50px 20px 20px 20px;
    }
}

@media (max-width: 576px) {
    .instant-chat {
        font-size: 0.95rem;
        padding: 6px 12px;
    }
}

@keyframes aiGuiderSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 576px) {
    .nav-container {
        flex-direction: column;
        align-items: center;
    }
    .nav-logo {
        margin: 50px 0 6px 0;
    }
    .nav-logo img {
        height: 30px;
    }
    .nav-menu {
        width: 100%;
        justify-content: center;
    }
    .logo {
        top: 10px;
        right: 15px;
        font-size: 0.9rem;
    }

    .main-title {
        font-size: 1.5rem;
        padding: 0 15px;
        text-align: center;
    }

    .nav-logo {
    }

    .nav-menu {
        gap: 10px;
    }

    .nav-menu li a {
        padding: 6px 2px;
        font-size: 1.25rem;
    }

    .banner-title {
        font-size: 1.6rem;
    }

    .banner-subtitle {
        font-size: 1.5rem;
    }
}
/* nav-menu 手機 RWD 強化 */
@media (max-width: 576px) {
    .nav-menu {
        flex-wrap: wrap;
        /* justify-content: center;
        gap: 6px 12px; */
    }

    .nav-menu li a {
        /* min-width: 72px; */
        text-align: center;
        padding: 6px 8px;
    }
    .nav-menu li a::after {
        bottom: 0;
        height: 2px;
    }
}