@import url('/mo_data/css/module/pagination.css');

/* 全站基本樣式 - 升級為深色玻璃擬態風格 (Glassmorphism) */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary-blue: #4da3ff;
    --primary-dark: #1e4b8a;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f7fbff;
    --text-muted: rgba(247, 251, 255, 0.7);
    --bg-dark: #060b13;

    /* 背景漸層變數 */
    --bg-gradient-1: rgba(18, 61, 110, 0.25);
    --bg-gradient-2: rgba(51, 153, 255, 0.15);
    --bg-grid: rgba(255, 255, 255, 0.03);

    /* 導覽列與卡片 */
    --nav-bg-1: rgba(10, 23, 43, 0.9); /* 調高一點，增加辨識度 */
    --nav-bg-2: rgba(18, 61, 110, 0.9);
    --card-bg: rgba(255, 255, 255, 0.04);
    --highlight-yellow: #ffd86b;

    /* 更新日誌標籤變數 */
    --tag-date-bg: linear-gradient(135deg, #1e4b8a, #0d2a54);
    --tag-tips-bg: linear-gradient(135deg, #2d7a31, #1b4d1e);
    --tag-text-color: #ffffff;

    /* 分隔線變數 */
    --border-separator: rgba(255, 255, 255, 0.05);

    /* 清除按鈕變數 */
    --tag-clear-bg: rgba(255, 216, 107, 0.1);
    --tag-clear-border: rgba(255, 216, 107, 0.3);

    /* 導覽列互動變數 */
    --nav-hover-bg: rgba(255, 255, 255, 0.1);

    /* 彈窗標題顏色 */
    --modal-title-color: #ffd86b;

    /* 表格名稱/標題文字顏色 */
    --table-title-text: #ffd86b;

    /* 自定義變色文字顏色 */
    --custom-colored-text: #00ffff;
    }

    /* 強制覆蓋所有頁面的淺色主題 */
    [data-theme="light"] {
    --primary-blue: #0066cc !important;
    --primary-dark: #004080 !important;
    --glass-bg: rgba(255, 255, 255, 0.6) !important; /* 稍微回正 */
    --glass-border: rgba(0, 0, 0, 0.1) !important;
    --text-main: #1a202c !important;
    --text-muted: rgba(26, 32, 44, 0.85) !important;
    --bg-dark: #eef2f7 !important;

    /* 強化淺色背景的紋理，讓玻璃模糊更有感 */
    --bg-gradient-1: rgba(0, 102, 204, 0.15) !important;
    --bg-gradient-2: rgba(255, 255, 255, 0.8) !important;
    --bg-grid: rgba(0, 102, 204, 0.06) !important;

    --nav-bg-1: rgba(255, 255, 255, 0.9) !important; /* 顯著回正，確保下拉選單易讀 */
    --nav-bg-2: rgba(245, 247, 250, 0.9) !important;
    --card-bg: rgba(255, 255, 255, 0.5) !important;
    --highlight-yellow: #c05621 !important;

    /* 淺色標籤風格 - 柔和一點 */
    --tag-date-bg: linear-gradient(135deg, #4d94ff, #0052cc);
    --tag-tips-bg: linear-gradient(135deg, #48bb78, #2f855a);

    /* 淺色分隔線 - 使用深色透明度 */
    --border-separator: rgba(0, 0, 0, 0.08);

    /* 淺色清除按鈕 - 提高飽和度 */
    --tag-clear-bg: rgba(192, 86, 33, 0.1);
    --tag-clear-border: rgba(192, 86, 33, 0.4);

    /* 淺色導覽列互動 - 使用明顯的淺藍色背景 */
    --nav-hover-bg: rgba(0, 102, 204, 0.08);

    /* 彈窗標題顏色 - 淺色模式下使用較深的藍色或橘色 */
    --modal-title-color: #0066cc !important;

    /* 表格名稱/標題文字顏色 - 淺色模式 */
    --table-title-text: #c05621 !important;

    /* 自定義變色文字顏色 - 淺色模式下使用較深的青藍色 */
    --custom-colored-text: #008b8b !important;
    }


/* --- 提示按鈕 (Hint Button) --- */
.hint-target-wrapper {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    position: relative !important;
    z-index: 1990 !important;
}

.dynamic-hint.hint-btn {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    position: relative !important;
    margin-left: auto !important; /* 自動推到最右邊 */
    flex-shrink: 0 !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
}

.dynamic-hint .hint-circle {
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    background: var(--primary-blue) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    font-size: 15px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    transition: all 0.2s ease !important;
}

.dynamic-hint.hint-btn:hover .hint-circle {
    transform: scale(1.1) !important;
    background: #fff !important;
    color: var(--primary-blue) !important;
}

.dynamic-hint .hint-tooltip {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important; /* 按鈕在右邊，所以提示框對齊右邊 */
    left: auto !important;
    transform: translateY(12px) !important; /* 向下偏移 */
    background: var(--nav-bg-1) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    color: var(--text-main) !important;
    padding: 15px 20px !important;
    border-radius: 15px !important;
    white-space: pre-wrap !important;
    min-width: 250px !important;
    max-width: 350px !important;

    z-index: 9999 !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6) !important;
    border: 1px solid var(--glass-border) !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    text-align: left !important;
    
    /* --- 修改重點：預設完全隱藏 (不要用 opacity: 0) --- */
    display: none !important; 
}

.dynamic-hint .hint-tooltip.show {
    /* --- 修改重點：加上 show 時顯示，並執行你的淡入動畫 --- */
    display: block !important;
    animation: fadeInHintLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes fadeInHintLeft {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(12px); }
}

/* 響應式調整 */
@media (max-width: 768px) {
    .hint-tooltip {
        left: auto;
        right: -10px;
        transform: translateY(10px);
    }
    @keyframes fadeInHint {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(10px); }
    }
}

/* 表格主名稱欄位樣式 */
.table-title-cell {
    color: var(--table-title-text) !important;
    font-weight: bold !important;
}


body {
    background-color: var(--bg-dark);
    /* 現代深邃藍漸層背景 */
    background-image: 
        radial-gradient(circle at 20% 30%, var(--bg-gradient-1) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, var(--bg-gradient-2) 0%, transparent 45%),
        /* 科技感點狀格線 */
        radial-gradient(var(--bg-grid) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 30px 30px;
    background-attachment: fixed;
    margin: 0;
    -webkit-text-size-adjust: 100%;
    /* 頂部留出導覽列高度 */
    padding: 80px 40px 30px 40px;
    font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 廣告橫幅樣式 */
.ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 23, 43, 0.95);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 廣告內容容器 */
.ad-content {
    width: 100%;
    max-width: 1200px;
    padding: 15px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: height 0.4s ease, opacity 0.3s ease;
}

.ad-content img {
    max-height: 90px;
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ad-tag {
    position: absolute;
    top: 5px;
    left: 10px;
    background: var(--tag-tips-bg);
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

/* 切換按鈕 */
.ad-toggle-btn {
    position: absolute;
    top: -36px;
    right: 20px;
    width: 40px;
    height: 36px;
    background: rgba(10, 23, 43, 0.95);
    border: 1px solid var(--glass-border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: var(--primary-blue);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    font-size: 18px;
    transition: 0.3s;
}

.ad-toggle-btn:hover {
    color: #fff;
    background: var(--primary-dark);
}

/* 收合狀態 */
.ad-banner.minimized {
    transform: translateY(100%);
}

.ad-banner.minimized .ad-toggle-btn {
    color: var(--highlight-yellow);
}

/* 手機版調整 */
@media (max-width: 768px) {
    .ad-content { padding: 10px; }
    .ad-content img { max-height: 60px; }
    .ad-toggle-btn { right: 10px; width: 36px; height: 32px; top: -32px; }
}

/* 回到頂部按鈕 */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

#backToTop:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 12px 25px rgba(77, 163, 255, 0.3);
}

/* ✅ 內容與側邊欄總容器 */
#content-wrapper {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start;
    justify-content: center;
    max-width: 1440px;
    width: 100% !important;
    margin: 30px auto 0 auto !important; /* 👈 第一個數字改成 30px 或 40px */
    padding: 0;
    gap: 30px;
}
/* === 新增：鎖定更新日誌與側邊欄的寬度 === */
#changelog {
    flex: 1 1 0% !important;     /* 讓左側更新日誌自動填滿剩餘空間 */
    min-width: 0 !important;      /* 防止內文過長時強制撐開容器 */
    max-width: 650px !important;
}

#sidebar-container {
    width: 400px !important;      /* 固定右側欄位寬度為 360px */
    flex-shrink: 0 !important;    /* 鎖定寬度，不允許被縮小 */
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* ✅ 核心玻璃擬態區塊 (主內容、更新日誌、側邊欄) */
#content, 
#changelog, 
.sidebar {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border) !important;
    border-radius: 24px !important;
    padding: 35px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25) !important;
    transition: all 0.4s ease !important;
}

#content:hover, 
#changelog:hover, 
.sidebar:hover {
    transform: none !important; /* 🚫 關閉四大區塊的上移浮動 */
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(77, 163, 255, 0.3) !important;
    box-shadow: 0 20px 45px rgba(77, 163, 255, 0.1) !important;
}

/* 1. 增加 transition 動畫（讓位移變平滑） */
.changelog-list li, 
.sidebar-list li {
    display: flex;
    align-items: flex-start;
    padding: 16px 8px !important;
    border-bottom: 1px solid var(--border-separator);
    font-size: 0.98rem !important;
    color: var(--text-muted);
    line-height: 1.7 !important;
    border-radius: 8px; /* 加上圓角 */
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease; /* 👈 補上這行動畫 */
}

/* 2. 新增單行 (li) 的 hover 浮動效果 */
.changelog-list li:hover, 
.sidebar-list li:hover {
    transform: translateY(-3px); /* 向上浮動 3px */
    background-color: rgba(255, 255, 255, 0.06); /* 稍微打亮背景 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* 加上輕微陰影增強浮動立體感 */
}

/* 標題樣式升級 */
#changelog h2, 
.sidebar h2 {
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(77, 163, 255, 0.3);
    padding-bottom: 12px;
    color: var(--primary-blue);
    letter-spacing: 0.05em;
    text-shadow: 0 0 15px rgba(77, 163, 255, 0.2);
}

/* 列表樣式調整 */
.changelog-list, 
.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-list li, 
.sidebar-list li {
    display: flex;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-separator);
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.changelog-list li:last-child, 
.sidebar-list li:last-child {
    border-bottom: none;
}

/* 日期與標籤樣式 - 支援主題切換 */
.changelog-list .date, 
.sidebar-list .date,
.sidebar-list .date2 {
    flex-shrink: 0;
    width: auto !important;
    background: rgba(30, 75, 138, 0.3) !important;
    color: #90caf9 !important;
    font-family: "JetBrains Mono", "Courier New", monospace;
    font-weight: 500 !important;
    font-size: 0.82rem !important;
    padding: 3px 14px !important;
    border-radius: 9999px !important;
    text-align: center;
    margin-right: 18px !important;
    border: 1px solid rgba(144, 202, 249, 0.3) !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.sidebar-list .date2 {
    background: var(--tag-date-bg);
    opacity: 0.9;
    text-decoration: none;
    display: inline-block;
}

.sidebar-list .date2:hover {
    color: var(--highlight-yellow) !important;
    border-color: var(--tag-clear-border);
    opacity: 1;
}

.changelog-list .tips, 
.sidebar-list .tips {
    flex-shrink: 0;
    width: auto !important;
    background: rgba(46, 125, 50, 0.25) !important;
    color: #81c784 !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    padding: 3px 14px !important;
    border-radius: 9999px !important;
    text-align: center;
    margin-right: 20px;
    border: 1px solid rgba(129, 199, 132, 0.3) !important;
}

/* 分頁按鈕樣式升級 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-separator);
}

.pagination-container button {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    margin: 0 5px;
}

.pagination-container button:hover:not(:disabled) {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.pagination-container button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 特別資訊提示框 */
.Information {
    background: var(--tag-clear-bg);
    border: 1px solid var(--tag-clear-border);
    color: var(--highlight-yellow);
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 14px;
    backdrop-filter: blur(5px);
}

/* 自定義變色文字 ^&...&^ */
.colored-text {
    color: var(--custom-colored-text) !important;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
    display: inline !important;
    line-height: inherit !important; /* 繼承父層行高，避免獨立計算導致重疊 */
    white-space: normal !important;
}

/* ==========================================
   官方限時活動區塊（支援日/夜間模式）
   ========================================== */

/* 清除限時官方活動列表的背景色與框線 */
#events-list li {
    background-color: transparent !important;
    background: none !important;
    border: none !important;
    border-bottom: 1px solid var(--border-separator) !important; /* 只保留底部微弱分隔線 */
    border-radius: 0 !important;
    padding: 12px 4px !important;
}

/* 確保滑過時是微微打亮，而不是顯現整塊底色 */
#events-list li:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border-radius: 8px !important;
}

/* 日期標籤：深色底白字，不論日夜間都能清晰顯示 */
#events-list .date {
  flex-shrink: 0;
  background-color: #1d3557;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  white-space: nowrap;
}

/* 活動標題連結：文字顏色繼承主要文字色彩 (var(--text-color)) */
#events-list .event-title,
#events-list a {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  
  /* 關鍵點：跟隨主題的文字顏色，沒設定變數則使用預設 currentColor */
  color: var(--text-color, currentColor) !important; 
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* 文字過長自動加 ... */
  display: block;
  flex: 1;
}

#events-list a:hover {
  color: #e63946 !important; /* 滑過時的強調色 */
  text-decoration: underline;
}

/* 活動倒數警示標籤 */
.badge-warning {
  background-color: #f39c12; /* 醒目橘黃色 */
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-urgent {
  background-color: #e74c3c; /* 緊急紅色 */
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  animation: pulse 1.5s infinite; /* 增加發光/呼吸動態效果 */
}

/* 急迫標籤呼吸燈動畫 (可選) */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* 即將到來標籤 (藍色或藍綠色系) */
.badge-upcoming {
  background-color: #3498db; /* 清爽藍色 */
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 讓側邊欄活動列表的標題超出時顯示 ... */
#events-list .event-title {
  display: inline-block;
  max-width: 180px;        /* 依據側邊欄實際寬度調整 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* ------------------------------------------
   如果你的白天/黑夜是用 Class (如 .light-theme / .dark-theme) 控制
   也可以直接顯式指定以下樣式：
   ------------------------------------------ */

/* 白天 / 淺色模式 */
body.light-theme #events-list li,
[data-theme="light"] #events-list li {
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

body.light-theme #events-list a,
[data-theme="light"] #events-list a {
  color: #212529 !important; /* 淺色模式下採用深色字 */
}

/* 黑夜 / 深色模式 */
body.dark-theme #events-list li,
[data-theme="dark"] #events-list li {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

body.dark-theme #events-list a,
[data-theme="dark"] #events-list a {
  color: #f8f9fa !important; /* 深色模式下採用亮色字 */
}
#events-list a:hover {
  color: #ffb703 !important; /* 加 !important 確保強制蓋過預設顏色 */
  text-decoration: underline;
}
/* === 手機版響應式佈局 === */
@media (max-width: 1024px) {
    #content-wrapper {
        flex-direction: column !important;
        align-items: stretch;
        padding: 0 10px;
    }
    
    #sidebar-container {
        width: 100% !important;
        flex: none !important;
    }
}

@media (max-width: 768px) {
    body {
        padding: 90px 15px 30px 15px !important;
    }

    #content, 
    #changelog, 
    .sidebar {
        padding: 25px 20px !important;
        border-radius: 20px !important;
    }

    .changelog-list .date, 
    .sidebar-list .date,
    .changelog-list .tips, 
    .sidebar-list .tips {
        width: 80px;
        font-size: 0.75rem;
        margin-right: 12px;
    }
}

/* === 淺色模式專用細節修正 === */
[data-theme="light"] .changelog-list .date,
[data-theme="light"] .sidebar-list .date,
[data-theme="light"] .sidebar-list .date2 {
    background: #e3f2fd !important;      /* 柔和清爽的淺藍底 */
    color: #1565c0 !important;           /* 深藍字，提高對比與閱讀性 */
    border: 1px solid #bbdefb !important;
}

[data-theme="light"] .changelog-list .tips,
[data-theme="light"] .sidebar-list .tips {
    background: #e8f5e9 !important;      /* 柔和淺綠底 */
    color: #2e7d32 !important;           /* 深綠字 */
    border: 1px solid #c8e6c9 !important;
}

/* 徹底清除淺色模式下右下角活動區塊的底色 */
[data-theme="light"] #events-list li {
    background-color: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] #events-list li:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
}
