/*
Theme Name: Hello Elementor Child
Template: hello-elementor
Version: 1.5
*/

/* ========== 1. 菜单 Menu ========== */
@media (min-width: 1025px) {
    .hfe-nav-menu, .hfe-nav-menu__layout-horizontal, .hfe-nav-menu .menu-item-has-children,
    .hfe-nav-menu .parent, .elementor-section, .elementor-container, .elementor-column-wrap, .elementor-widget-wrap {
        overflow: visible !important;
    }
    .hfe-nav-menu .sub-menu {
        position: fixed !important;
        left: 0 !important;
        top: 132px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        background: #666666 !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
        border-radius: 0 !important;
        padding: 6px 0 !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        gap: 0 !important;
        z-index: 99999 !important;
        overflow: visible !important;
    }
    .hfe-nav-menu .sub-menu li {
        white-space: nowrap !important;
        list-style: none !important;
        border-bottom: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .hfe-nav-menu .sub-menu a.hfe-sub-menu-item {
        padding: 3px 28px !important;
        font-size: 15px !important;
        color: #ffffff !important;
        border-bottom: none !important;
        display: inline-block !important;
        transition: background 0.2s, color 0.2s;
    }
    .hfe-nav-menu .sub-menu a.hfe-sub-menu-item:hover {
        background: rgba(255, 255, 255, 0.15) !important;
        color: #F3CC73 !important;
    }
    .hfe-nav-menu .sub-menu li:not(:last-child) a.hfe-sub-menu-item {
        border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    }
    body.admin-bar .hfe-nav-menu .sub-menu {
        top: calc(138px + 32px) !important;
    }
}

/* ========== 2. Header 吸顶 ========== */
#masthead {
    position: sticky !important;
    top: 0 !important;
    z-index: 99990 !important;
    background: #3C3F45 !important;
    width: 100% !important;
}
body.admin-bar #masthead { top: 32px !important; }
@media (max-width: 782px) { body.admin-bar #masthead { top: 46px !important; } }
#masthead .elementor-section { position: relative !important; }
@media (min-width: 1025px) {
    .hfe-nav-menu .sub-menu { top: 132px !important; }
    body.admin-bar .hfe-nav-menu .sub-menu { top: calc(138px + 32px) !important; }
}
body { padding-top: 0 !important; }

/* ========== 3. CF7 订阅表单 ========== */
.cf7-three-columns { display: flex; flex-wrap: wrap; gap: 28px 24px; }
.cf7-three-columns > p { flex: 1 1 0; min-width: 0; margin: 0; }
.cf7-three-columns br { display: none; }
.cf7-three-columns label { display: block; width: 100%; margin: 0; line-height: 1.5; }
.cf7-three-columns .wpcf7-form-control-wrap { display: block; margin-top: 10px; }
.cf7-three-columns input.wpcf7-text, .cf7-three-columns input.wpcf7-email { width: 100%; box-sizing: border-box; }
@media (max-width: 1024px) { .cf7-three-columns > p { flex: 1 1 calc(50% - 12px); } }
@media (max-width: 767px) { .cf7-three-columns { gap: 20px; } .cf7-three-columns > p { flex: 1 1 100%; } }
.cf7-three-columns + p { margin-top: 28px; }
.cf7-three-columns ~ p { margin-bottom: 16px; }
.cf7-three-columns ~ p .wpcf7-list-item { margin-left: 0 !important; }
.cf7-three-columns ~ p .wpcf7-list-item-label { display: inline; vertical-align: middle; }
.cf7-three-columns ~ p input[type="checkbox"] { vertical-align: middle; margin-right: 8px; margin-left: 0; }

/* ==========================================================
   4. CPD/活動 講座網格
   ========================================================== */
.cpd-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }
.cpd-title { font-size: 30px !important; font-weight: 700 !important; color: #34373C !important; letter-spacing: .5px; margin: 0; padding-bottom: 14px; border-bottom: 3px solid #F3CC73; line-height: 1.2; }
.cpd-count { font-size: 14px; color: #8a8f98; background: #f4f5f7; padding: 6px 14px; border-radius: 999px; }
.cpd-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)) !important; gap: 52px !important; width: 100% !important; }
@media (min-width: 769px) and (max-width: 1200px) { .cpd-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 24px !important; } }
@media (max-width: 767px) {
    .cpd-grid { grid-template-columns: 1fr !important; gap: 20px !important; overflow-x: hidden !important; }
    .cpd-card { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; }
    .cpd-card-body { width: 100% !important; box-sizing: border-box !important; padding: 16px 18px 18px !important; }
    .cpd-card-title { font-size: 17px !important; word-break: break-word !important; overflow-wrap: break-word !important; white-space: normal !important; }
    .cpd-card-media { width: 100% !important; height: 180px !important; }
    .cpd-card-media img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
}
.cpd-card { background: #fff; border: 1px solid #ececec; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.04); transition: box-shadow .3s ease; }
.cpd-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.cpd-card.is-expired { opacity: 1; border-color: #ececec; background: #fff; }
.cpd-card.is-expired .cpd-card-media img { filter: none; opacity: 1; }
.cpd-card.is-expired .cpd-card-title a { color: #34373C; }
.cpd-card.is-expired .cpd-card-meta { color: #34373C; }
.cpd-card-media { display: block; height: 220px; overflow: hidden; background: #f5f5f5; }
.cpd-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpd-card:hover .cpd-card-media img { transform: none; }
.cpd-card-body { padding: 22px 24px 24px; }
.cpd-card .cpd-card-title { font-size: 23px !important; font-weight: 700 !important; line-height: 1.4 !important; margin: 0 0 16px !important; letter-spacing: .2px !important; color: #34373C !important; }
.cpd-card .cpd-card-title a { color: #34373C !important; text-decoration: none !important; font-size: inherit !important; font-weight: inherit !important; }
.cpd-card .cpd-card-title a:hover { color: #d4a44a !important; }
@media (max-width: 767px) { .cpd-card .cpd-card-title { font-size: 18px !important; } }
.cpd-card-meta { list-style: none; margin: 0 0 20px; padding: 0; color: #34373C; font-size: 15px; line-height: 1.6; }
.cpd-card-meta li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.cpd-card-meta svg { width: 18px; height: 18px; flex: 0 0 18px; color: #000; stroke: #000; margin-top: 3px; }
.cpd-card-btn { display: block; text-align: center; padding: 11px 20px; border-radius: 10px; font-size: 14px; font-weight: 600; letter-spacing: .3px; text-decoration: none; color: #34373C; background: linear-gradient(135deg, #F3CC73 0%, #e6b85a 100%); transition: all .3s ease; }
.cpd-card-btn:hover { background: linear-gradient(135deg, #e6b85a 0%, #d4a44a 100%); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(243,204,115,.4); }
.cpd-card.is-expired .cpd-card-btn { background: transparent; color: #8a8f98; border: none; padding: 0; font-size: 14px; font-weight: 500; border-radius: 0; box-shadow: none; transform: none; pointer-events: none; cursor: default; width: auto; display: inline-block; text-align: left; }
.cpd-empty { text-align: center; padding: 70px 20px; background: #f8f9fa; border-radius: 16px; }
.cpd-empty-icon { font-size: 48px; }
.cpd-empty h2 { color: #555; margin: 14px 0 8px; font-size: 20px; }
.cpd-empty p { color: #8a8f98; margin: 0; }
.cpd-pagination { margin-top: 44px; text-align: center; }
.cpd-pagination ul { list-style: none; display: inline-flex; gap: 8px; padding: 0; margin: 0; }
.cpd-pagination a, .cpd-pagination span { display: inline-block; min-width: 38px; padding: 8px 12px; border-radius: 8px; border: 1px solid #e5e5e5; color: #34373C; text-decoration: none; font-size: 14px; transition: all .2s; }
.cpd-pagination a:hover { border-color: #F3CC73; background: #fff8e8; }
.cpd-pagination .current { background: #F3CC73; border-color: #F3CC73; color: #34373C; font-weight: 600; }

/* Elementor 短代碼相容性修復 */
.elementor-widget-shortcode .elementor-widget-container { margin-bottom: 0 !important; }
.elementor-widget-shortcode { width: 100% !important; }
.elementor-shortcode > div:first-child { margin-top: 0 !important; }
.page-id-4860 .elementor-column-wrap, .page-id-4860 .elementor-widget-wrap { padding-left: 0 !important; padding-right: 0 !important; }
.page-id-4860 .elementor-widget-shortcode, .page-id-4860 .elementor-shortcode { width: 100% !important; max-width: 100% !important; }
.page-id-4860 .elementor-element-0dccacb, .page-id-4860 .elementor-element-0dccacb .elementor-widget-container { margin-bottom: 0 !important; }

/* ==========================================================
   5. 單篇活動頁面佈局
   ========================================================== */
.cii-single-wrap { max-width: 1300px; margin: 0 auto; padding: 40px 20px 70px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
.cii-single-title { font-size: 28px !important; font-weight: 700 !important; line-height: 1.4 !important; color: #34373C !important; font-family: inherit !important; margin: 0 0 24px !important; padding-bottom: 16px !important; border-bottom: 3px solid #F3CC73 !important; }
.cii-single-thumb { margin: 0 0 28px; overflow: hidden; }
.cii-single-thumb img { width: 100%; height: auto; display: block; }
.cii-single-content { font-size: 16px; line-height: 1.85; color: #333; }
.cii-single-content h2, .cii-single-content h3 { color: #34373C; margin-top: 1.6em; }
.cii-single-content a { color: #b8912f; }
.cii-single-form { margin-top: 40px; }
.cii-single-form-title { font-size: 22px; font-weight: 700; color: #34373C; margin: 0 0 16px; padding-left: 12px; border-left: 4px solid #F3CC73; }
.cii-form-inner { background: #f8f9fa; border: 1px solid #ececec; border-radius: 12px; padding: 22px 24px; }
.cii-single-side { position: sticky; top: 120px; }
.cii-side-title { font-size: 20px; font-weight: 700; color: #34373C; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 2px solid #F3CC73; }
.cii-latest-list { display: flex; flex-direction: column; gap: 16px; }
.cii-latest-item { display: flex; gap: 12px; text-decoration: none; color: inherit; padding-bottom: 16px; border-bottom: 1px solid #eee; }
.cii-latest-item:last-child { border-bottom: none; padding-bottom: 0; }
.cii-latest-thumb { flex: 0 0 96px; width: 96px; height: 68px; border-radius: 8px; overflow: hidden; }
.cii-latest-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cii-latest-body { display: flex; flex-direction: column; gap: 6px; }
.cii-latest-title { font-size: 15px; font-weight: 600; color: #34373C; line-height: 1.4; }
.cii-latest-item:hover .cii-latest-title { color: #d4a44a; }
.cii-latest-date { font-size: 13px; color: #8a8f98; }
@media (max-width: 1024px) { .cii-single-wrap { grid-template-columns: 1fr; gap: 36px; } .cii-single-side { position: static; } }
@media (max-width: 767px) { .cii-single-title { font-size: 24px !important; } .cii-single-wrap { padding: 26px 16px 50px; } }

/* ==========================================================
   6. CF7 活動報名表單美化
   ========================================================== */
.cii-form-inner .wpcf7 { margin: 0; }
.cii-form-inner .wpcf7 p { margin-bottom: 15px !important; }
.cii-form-inner .wpcf7 label { display: block; font-weight: 600; color: #34373C; margin-bottom: 8px; font-size: 15px; }
.cii-form-inner .wpcf7 input[type="text"], .cii-form-inner .wpcf7 input[type="email"], .cii-form-inner .wpcf7 input[type="tel"], .cii-form-inner .wpcf7 select, .cii-form-inner .wpcf7 textarea { width: 100% !important; padding: 12px 15px !important; border: 1px solid #ddd !important; border-radius: 8px !important; font-size: 15px !important; background: #fff !important; box-sizing: border-box; transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.cii-form-inner .wpcf7 input:focus, .cii-form-inner .wpcf7 select:focus, .cii-form-inner .wpcf7 textarea:focus { border-color: #F3CC73 !important; outline: none !important; box-shadow: 0 0 0 3px rgba(243, 204, 115, 0.3) !important; }
.cii-form-inner .wpcf7 input[type="submit"] { width: 100% !important; background: linear-gradient(135deg, #F3CC73 0%, #e6b85a 100%) !important; color: #34373C !important; padding: 14px 20px !important; border: none !important; border-radius: 8px !important; font-size: 16px !important; font-weight: 700 !important; cursor: pointer !important; transition: all 0.3s ease !important; margin-top: 10px; }
.cii-form-inner .wpcf7 input[type="submit"]:hover { background: linear-gradient(135deg, #e6b85a 0%, #d4a44a 100%) !important; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(243, 204, 115, 0.4); }
.cii-form-inner .wpcf7 .wpcf7-required, .cii-form-inner .wpcf7 span.wpcf7-form-control-wrap + span { color: #dc3232; }

/* ==========================================================
   7. 活動日程列表頁（舊版樣式保留，供舊列表使用）
   ========================================================== */
.page-template-page-event-calendar div[style*="opacity: 0.6"] { opacity: 1 !important; }
.page-template-page-event-calendar h2[style*="color: #999"] { color: #34373C !important; border-left-color: #F3CC73 !important; }
.page-template-page-event-calendar h2 span[style*="background: #e0e0e0"] { display: none !important; }
.page-template-page-event-calendar div[style*="background: #f8f9fa"] { background: #ffffff !important; box-shadow: 0 2px 10px rgba(0,0,0,.04) !important; border: 1px solid #ececec !important; }
.page-template-page-event-calendar div[style*="opacity: 0.6"] a[style*="color: #999"] { color: #34373C !important; }
.page-template-page-event-calendar div[style*="opacity: 0.6"] a[style*="color: #999"]:hover { color: #d4a44a !important; }
.page-template-page-event-calendar div[style*="opacity: 0.6"] span[style*="color: #999"] { color: #8a8f98 !important; }
.page-template-page-event-calendar a[style*="background: #ccc"] { background: transparent !important; color: #8a8f98 !important; border: 1px solid #dcdcdc !important; }
.page-template-page-event-calendar div[style*="border-bottom: 1px solid #eee"] { border-bottom-color: #f0f0f0 !important; }


/* ==========================================================
   8. Header 終極微調（只修復問題，絕不破壞原本排版）
   ========================================================== */

/* 1. 暴力破解主題的 48px 限制：讓所有語言的 Logo 都回到 189px */
header#masthead img[src$=".svg"],
header#masthead .elementor-widget-image img {
    width: 189px !important;
    max-width: 189px !important;
    min-width: 189px !important;
    height: auto !important;
    display: block !important;
}

/* 2. 針對「登入 | 註冊 | 繁简EN」的精準對齊 */
/* 這裡只抓 #header-1，不動外面的 Column 寬度，讓 Elementor 自己排版 */
#header-1 {
    width: 100% !important;
}
#header-1 > .elementor-widget-wrap {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
}
#header-1 .elementor-widget-button,
#header-1 .elementor-widget-navigation-menu {
    width: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
}
#header-1 .elementor-widget-container {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}
#header-1 .elementor-button {
    white-space: nowrap !important;
    padding: 0 !important;
    background: transparent !important;
    font-size: 14px !important;
}

/* 分隔線：登入 | 註冊 */
#header-1 .elementor-widget-button + .elementor-widget-button {
    border-left: 1px solid rgba(255, 255, 255, 0.35) !important;
    margin-left: 12px !important;
    padding-left: 12px !important;
    height: 14px !important;
}
/* 分隔線：註冊 | 繁简EN */
#header-1 .elementor-widget-button + .elementor-widget-navigation-menu {
    border-left: 1px solid rgba(255, 255, 255, 0.35) !important;
    margin-left: 12px !important;
    padding-left: 12px !important;
    height: 14px !important;
}

/* 語言選單內部 */
#header-1 .hfe-nav-menu {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}
#header-1 .hfe-nav-menu > li {
    display: flex !important;
    align-items: center !important;
    list-style: none !important;
}
#header-1 a.hfe-menu-item {
    padding: 0 4px !important;
    white-space: nowrap !important;
}
#header-1 .hfe-nav-menu > li + li {
    border-left: 1px solid rgba(255, 255, 255, 0.35) !important;
    margin-left: 6px !important;
    padding-left: 6px !important;
    height: 12px !important;
}
#header-1 .hfe-nav-menu > li.current-lang > a.hfe-menu-item {
    color: #F3CC73 !important;
    font-weight: 700 !important;
    pointer-events: none !important;
}

/* ==========================================================
   9. 手機版專屬（恢復你最滿意的狀態）
   ========================================================== */
@media (max-width: 767px) {
    /* 手機版 Logo 大小 */
    header#masthead img[src$=".svg"],
    header#masthead .elementor-widget-image img {
        max-width: 120px !important;
        min-width: 120px !important;
    }
    
    /* 手機版登入列字體與間距微調 */
    #header-1 .elementor-button,
    #header-1 a.hfe-menu-item {
        font-size: 12px !important; 
    }
    #header-1 .elementor-widget-button + .elementor-widget-button,
    #header-1 .elementor-widget-button + .elementor-widget-navigation-menu {
        margin-left: 6px !important;
        padding-left: 6px !important;
    }
    #header-1 .hfe-nav-menu > li + li {
        margin-left: 4px !important;
        padding-left: 4px !important;
    }
}

/* ==========================================================
   CII 資格認證篩選器與分頁樣式（CII 綠色主題版 + 電腦單行顯示）
   ========================================================== */

/* --- 篩選器外層背景 (加入淺綠色主題感) --- */
.cii-filter-wrap {
  font-size: 15px !important;
  margin-bottom: 30px !important;
  background: #f4f7f2 !important; /* 淺綠色背景 */
  padding: 24px 28px !important;
  border-radius: 12px !important;
  border: 1px solid #dce6d5 !important; /* 淺綠色邊框 */
  box-shadow: 0 4px 15px rgba(169, 196, 127, 0.08) !important; /* 綠色微陰影 */
  transition: all 0.3s ease !important;
}

/* --- 電腦版：強制在同一行顯示 --- */
.cii-filter-row.cii-row-primary {
  display: flex !important;
  flex-wrap: nowrap !important; /* 強制不換行 */
  align-items: flex-end !important;
  gap: 15px !important;
}

/* --- 標籤文字 --- */
.cii-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  font-weight: 600 !important;
  color: #3a4b2e !important; /* 深綠色標籤文字 */
  flex: 1 1 0% !important; /* 平均分配寬度 */
  min-width: 0 !important; /* 允許壓縮 */
  font-size: 14px !important;
  margin: 0 !important;
}

.cii-field.cii-field-wide { 
  flex: 2 1 0% !important; /* 認證選單佔兩倍寬度 */
}

/* --- 下拉選單與輸入框美化 (白底，與淺綠背景形成對比) --- */
.cii-field select,
.cii-field input {
  width: 100% !important;
  box-sizing: border-box !important;
  height: 44px !important;
  padding: 0 14px !important;
  border: 1px solid #c9d6c1 !important; /* 輸入框邊框微綠 */
  border-radius: 8px !important;
  background-color: #ffffff !important; /* 純白背景 */
  font-size: 14px !important;
  color: #333 !important;
  line-height: 44px !important;
  transition: all 0.3s ease !important;
  box-shadow: none !important;
  text-overflow: ellipsis !important;
}

.cii-field select:focus,
.cii-field input:focus {
  border-color: #A9C47F !important;
  background-color: #fff !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(169, 196, 127, 0.25) !important;
}

/* 下拉選單箭頭 */
.cii-field select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 36px !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.4 0.6 6 5.2 10.6 0.6 12 2 6 8 0 2z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px 8px !important;
}

/* --- 搜尋框與按鈕 --- */
.cii-field .cii-search-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.cii-field .cii-search-wrap input {
  padding-right: 44px !important;
}

.cii-field .cii-search-wrap .cii-search-btn {
  position: absolute !important;
  right: 5px !important;
  top: 5px !important;
  bottom: 5px !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 6px !important;
  background: #A9C47F !important; /* CII 綠色 */
  color: #fff !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 2 !important;
  transition: background 0.2s !important;
}

.cii-field .cii-search-wrap .cii-search-btn:hover {
  background: #93AD68 !important; /* 深綠色 */
}

.cii-field .cii-search-wrap .cii-search-btn svg {
  width: 16px !important;
  height: 16px !important;
  stroke: #fff !important; /* 白色圖標 */
  pointer-events: none !important;
}

/* --- 單元列表區 --- */
.cii-count {
  margin-bottom: 16px !important;
  color: #666 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.cii-unit {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 10px 16px !important;
  background: #fff !important;
  border: 1px solid #f0f0f0 !important;
  border-radius: 10px !important;
  padding: 16px 20px !important;
  margin-bottom: 12px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.02) !important;
}


.cii-unit:hover {
  border-color: #A9C47F !important; /* 保留綠色邊框 */
  background-color: #f4f7f2 !important; /* 背景稍微加深 (淺綠色) */
}

.cii-unit-code {
  font-weight: 700 !important;
  color: #34373C !important;
  background: #f4f5f7 !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  min-width: 60px !important;
  text-align: center !important;
}

.cii-unit-name {
  color: #34373C !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  flex: 1 1 auto !important;
  line-height: 1.5 !important;
}

.cii-unit-name:hover { 
  color: #83A354 !important; /* 深綠色 */
}

.cii-unit-meta {
  color: #888 !important;
  font-size: 13px !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
  white-space: nowrap !important;
  background: #fdfdfd !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  border: 1px solid #f0f0f0 !important;
}

.cii-credit-num {
  color: #A9C47F !important;
  font-size: 15px !important;
}

/* --- 分頁器美化 --- */
.cii-pagination {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 40px !important;
  margin-bottom: 20px !important;
  flex-wrap: wrap !important;
}

.cii-page-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 40px !important;
  height: 40px !important;
  padding: 0 14px !important;
  border: 1px solid #eaeaea !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #34373C !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
}

.cii-page-btn:hover:not(:disabled) {
  border-color: #A9C47F !important;
  background: #F2F7EC !important; /* 淺綠色背景 */
  color: #83A354 !important;
}

.cii-page-btn.active {
  background: #A9C47F !important;
  border-color: #A9C47F !important;
  color: #fff !important;
  cursor: default !important;
  box-shadow: none !important;
}

.cii-page-btn:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  background: #fafafa !important;
}

.cii-page-info {
  margin-left: 15px !important;
  font-size: 14px !important;
  color: #888 !important;
}

/* --- 認證詳情頁面美化 --- */
.qual-detail h2 {
  font-size: 22px !important;
  color: #34373C !important;
  margin-bottom: 20px !important;
  line-height: 1.4 !important;
  font-weight: 700 !important;
}

.qual-intro {
  line-height: 1.9 !important;
  color: #555 !important;
  margin-bottom: 30px !important;
  font-size: 16px !important;
  background: #fafafa !important;
  padding: 20px !important;
  border-left: 4px solid #A9C47F !important; /* 綠色左邊框 */
}

.qual-accordion {
  border-top: 1px solid #eaeaea !important;
  margin-bottom: 30px !important;
}

.qual-item {
  border-bottom: 1px solid #eaeaea !important;
}

.qual-item-title {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 18px 0 !important;
  cursor: pointer !important;
  font-weight: 700 !important;
  color: #34373C !important;
  font-size: 17px !important;
  transition: color 0.2s !important;
}

.qual-item-title:hover { color: #83A354 !important; }
.qual-item.open .qual-item-title { color: #83A354 !important; }

.qual-item-body {
  display: none !important;
  padding: 0 0 20px 0 !important;
  line-height: 1.9 !important;
  color: #555 !important;
  font-size: 15px !important;
}

.qual-item.open .qual-item-body { display: block !important; }

.qual-units h3 {
  font-size: 20px !important;
  margin: 30px 0 15px !important;
  color: #34373C !important;
  font-weight: 700 !important;
  border-left: 4px solid #A9C47F !important; /* 綠色左邊框 */
  padding-left: 12px !important;
}

.qual-unit-row {
  display: flex !important;
  align-items: center !important;
  border-bottom: 1px solid #f0f0f0 !important;
  padding: 14px 0 !important;
}

.qual-unit-code {
  width: 80px !important;
  font-weight: 700 !important;
  color: #34373C !important;
  flex: 0 0 auto !important;
}

.qual-unit-name {
  flex: 1 !important;
  color: #555 !important;
  font-size: 15px !important;
}

.qual-unit-grade {
  width: 90px !important;
  color: #888 !important;
  font-size: 14px !important;
  flex: 0 0 auto !important;
}

.qual-unit-credit {
  width: 80px !important;
  text-align: right !important;
  color: #A9C47F !important;
  font-weight: 700 !important;
  font-size: 20px !important;
  flex: 0 0 auto !important;
}

/* --- 響應式調整 (平板與手機才換行) --- */
@media (max-width: 1024px) {
  .cii-filter-row.cii-row-primary {
    flex-wrap: wrap !important; /* 平板允許換行 */
  }
  .cii-field, .cii-field.cii-field-wide { 
    flex: 1 1 calc(50% - 10px) !important; 
    min-width: 0 !important; 
  }
}

@media (max-width: 767px) {
  .cii-filter-wrap { padding: 20px !important; }
  .cii-field, .cii-field.cii-field-wide { 
    flex: 1 1 100% !important; 
  }
  .cii-unit { 
    display: block !important; 
    padding: 16px !important;
  }
  .cii-unit-code {
    display: inline-block !important;
    margin-bottom: 8px !important;
  }
  .cii-unit-meta { 
    display: inline-block !important; 
    margin-left: 0 !important; 
    margin-top: 10px !important; 
    white-space: normal !important; 
  }
  .qual-unit-row { 
    flex-wrap: wrap !important; 
    gap: 6px 10px !important; 
  }
  .qual-unit-code { width: auto !important; }
  .qual-unit-grade { width: auto !important; }
  .qual-unit-credit { 
    width: auto !important; 
    margin-left: auto !important; 
    font-size: 18px !important; 
  }
  .cii-pagination {
    gap: 4px !important;
  }
  .cii-page-btn {
    min-width: 34px !important;
    height: 34px !important;
    padding: 0 10px !important;
    font-size: 13px !important;
  }
  .cii-page-info {
    width: 100% !important;
    text-align: center !important;
    margin: 10px 0 0 0 !important;
  }
}

/* ==========================================================
   10. 活動日程月曆（紫色主題優化版）
   ========================================================== */
.cii-calendar-wrap {
    max-width: 1100px;
    margin: 20px auto 40px;
    padding: 0 20px;
}

/* 強制覆蓋 Elementor 的全域標題設定 */
h1.cii-calendar-title,
.elementor-kit-9 .cii-calendar-title {
    font-size: 24px !important;
    font-family: inherit !important;
    color: #34373C !important;
    margin: 0 0 24px !important;
    border-bottom: 3px solid #5b4e63 !important;
    padding-bottom: 12px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    letter-spacing: normal !important;
}

.cii-calendar-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 900px) {
    .cii-calendar-layout {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        align-items: start;
    }
}

/* --- 月曆面板主體 --- */
.cii-calendar-panel {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(91, 78, 99, 0.05);
}

/* --- 頂部切換月份 --- */
.cii-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 10px;
}

/* 強制覆蓋 Elementor 的全域 H2 設定 */
h2.cii-calendar-month,
#ciiMonthLabel,
.elementor-kit-9 .cii-calendar-month {
    font-size: 18px !important;
    font-family: inherit !important;
    color: #34373C !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: center;
    flex: 1;
    margin: 0 !important;
    letter-spacing: normal !important;
}

.cii-cal-nav {
    border: 1px solid #eee !important;
    background: #f8f9fa !important;
    color: #5b4e63 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s;
    flex: 0 0 36px !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.cii-cal-nav:hover {
    background: #5b4e63 !important;
    border-color: #5b4e63 !important;
    color: #fff !important;
}

/* --- 星期標題與網格 --- */
.cii-calendar-weekdays,
.cii-calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 6px !important;
}

.cii-calendar-weekdays {
    margin-bottom: 8px !important;
}

.cii-calendar-weekdays span {
    text-align: center;
    font-size: 14px;
    color: #8a8f98;
    font-weight: 600;
}

/* --- 日期格子 --- */
.cii-cal-day {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    border: 1px solid #dfc5c566 !important;
    background: #f8f9fa !important;
    color: #34373C !important;
    font-size: 15px;
    font-family: inherit !important;
    cursor: default;
    transition: all 0.2s ease;
    padding: 0 !important;
    min-width: 0;
    line-height: 1 !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.cii-cal-day.is-empty {
    visibility: hidden;
    background: transparent !important;
    pointer-events: none;
}

/* 有活動的日期 */
.cii-cal-day.has-events {
    cursor: pointer;
    color: #34373C !important;
    background: #cac4eb !important;
    border-color: #d2b9ff !important;
}

.cii-cal-day.has-events:hover {
    background: #f4f0f7 !important;
}

/* 被選中的日期 */
.cii-cal-day.is-selected {
    background: #523a7c !important;
    color: #fff !important;
    border-color: #523a7c !important;
}

/* 今天（如果沒被選中） */
.cii-cal-day.is-today:not(.is-selected) {
    border-color: #8a7b94 !important;
    color: #5b4e63 !important;
    background: #faf8fb !important;
}

/* --- 日期下方小圓點 --- */
.cii-day-dots {
    display: flex;
    gap: 3px;
    margin-top: 5px;
    height: 6px;
    justify-content: center;
    flex-wrap: nowrap;
}

.cii-day-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: block;
    flex: 0 0 6px;
}

.cii-dot-open  { background: #a58bb5; }
.cii-dot-multi { background: #5b4e63; }
.cii-dot-ended { background: #ccc; }

/* --- 隱藏圖例 --- */
.cii-calendar-legend {
    display: none !important;
}

/* --- 右側當日活動面板 --- */
.cii-events-panel {
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 16px;
    padding: 24px 28px;
    min-height: 300px;
}

.cii-events-date {
    font-size: 16px !important;
    color: #34373C !important;
    margin: 0 0 16px !important;
    padding-left: 12px !important;
    border-left: 4px solid #5b4e63 !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
    letter-spacing: normal !important;
}

/* 活動列表外層 */
.cii-event-list {
    display: flex;
    flex-direction: column;
}

/* 單個活動（移除框線，改為底線分隔） */
.cii-event-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px 0 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
    transition: all 0.2s;
}

/* 如果沒有標籤，讓內容佔滿 100% 寬度 */
.cii-event-item:not(:has(.cii-event-badge)) .cii-event-info {
    flex: 1 1 100% !important;
}

.cii-event-item:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.cii-event-item:hover {
    background: transparent !important;
}

/* 活動資訊區塊 */
.cii-event-info {
    flex: 1 1 auto;
    min-width: 0;
}

/* 活動標題（字體放大） */
.cii-event-title {
    font-size: 20px !important; /* 從 15px 改為 17px */
    color: #34373C;
    text-decoration: none;
    font-weight: 600 !important;
    display: block;
    letter-spacing: 0 !important;
    line-height: 1.5;
    word-break: break-word;
    transition: color 0.2s;
}

.cii-event-title:hover {
    color: #5b4e63;
}

.cii-event-item.is-ended .cii-event-title {
    color: #34373C;
}

/* 地點與日期資訊（字體放大） */
.cii-event-meta {
    font-size: 14px !important; /* 從 13px 改為 14px */
    color: #5b4e63 !important;
    margin-top: 8px !important;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 確保 emoji 圖標大小適中，不會跟著字體爆開 */
.cii-event-meta img.emoji {
    width: 1.1em !important;
    height: 1.1em !important;
    margin: 0 !important;
    vertical-align: -0.15em;
}

/* 右側狀態標籤（稍微放大） */
.cii-event-badge {
    font-size: 13px !important;
    font-weight: 600;
    padding: 6px 14px !important;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    flex: 0 0 auto;
    transition: all 0.2s;
}

.cii-event-badge.open {
    background: #5b4e63;
    color: #fff;
}

.cii-event-badge.open:hover {
    background: #483d4e;
}

.cii-event-badge.ended {
    display: none !important; /* 雙重保險，就算 JS 沒拿掉，CSS 也會隱藏 */
}

/* 即將推出專屬樣式 */
.cii-empty.cii-upcoming {
    font-size: 16px !important;
    font-weight: 600;
    color: #5b4e63 !important;
    padding: 50px 0 !important;
    letter-spacing: 1px;
    text-align: center;
}

/* --- 手機版優化 --- */
@media (max-width: 767px) {
    .cii-calendar-wrap { padding: 0 16px; }
    h1.cii-calendar-title { font-size: 22px !important; margin-bottom: 20px !important; }
    .cii-calendar-panel { padding: 16px; border-radius: 12px; }
    h2.cii-calendar-month, #ciiMonthLabel { font-size: 16px !important; }
    .cii-cal-nav { width: 32px !important; height: 32px !important; flex-basis: 32px !important; font-size: 18px !important; }
    .cii-calendar-weekdays span { font-size: 12px; }
    .cii-calendar-grid { gap: 4px !important; }
    .cii-cal-day { font-size: 14px; border-radius: 8px !important; }
    .cii-day-dots i { width: 4px; height: 4px; flex-basis: 4px; }
    .cii-events-panel { padding: 16px; border-radius: 12px; }
    .cii-event-item { padding: 16px 0 !important; }
    .cii-events-date { font-size: 16px !important; } 
    .cii-event-title { font-size: 16px !important; } /* 手機版標題 16px */
    .cii-event-meta { font-size: 13px !important; }  /* 手機版資訊 13px */
}