﻿/* 全站共用頁尾
   ---------------------------------------------------------------
   兩層結構：
     上層 .foot_Org     機關（本站營運單位），主角，字級大、亮度高。
     下層 .foot_Vendor  系統廠商版權 / 瀏覽建議 / 版本號，配角，小而暗。

   版面結構參照普立陽官網頁尾（品牌靠左、資訊置中、版本靠右），
   但配色改用本站的深石牆＋金字，避免亮藍色塊接在深色頁面下方
   造成的色彩落差。

   文字全部來自 web.config 的 appSettings，本檔只負責外觀。
   需要頁尾的頁面 <link> 本檔即可（母版請用 ~/Styles/site-footer.css，
   相對路徑會以內容頁為基準解析而 404）。 */


/* ── 置底 ────────────────────────────────────
   內容短的頁面要讓頁尾貼在視窗底部，內容超過一螢時則接在內容之後。

   做法：body 至少一個視窗高的垂直 flex，頁尾用 margin-top: auto
   吃掉剩下的空間。

   為何不用 position: sticky + top: 100vh（上一版的做法）：
     • sticky 只能在自己的容器內移動。有些頁面的標記不平衷（例如
       wfm_MemberStart.aspx 外層表格的 td/tr/table 沒關），頁尾會被瀏覽器
       吸進一個儲存格裡，那個容器只有內容高，貼底從根本上就不可能。
       （那些標記已修正，但 flex 不依賴頁尾的嵌套深度這麼敏感。）
     • sticky 版還得搭配頁尾自己的 margin-top: 18px，而那 18px 會加在
       100vh 之上：內容高度接近一螢的頁面（帳號啟用頁實測 656 + 175
       = 831 > 820）會多出十几 px 的捲軸，頁尾也就沒真的貼底。
       margin-top: auto 在長頁時自動歸零，不會側漏高度。

   body 的直接子元素會成為 flex 項目：全站這些子元素都是 <form>、
   <div class="page"> 之類的區塊元素，本來就是滿寬的區塊；
   LoadingOverlay 是 display:none / position:fixed，不參與 flex 排版。 */

html
{
    min-height: 100%;
}

body
{
    min-height: 100vh;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
}


/* ── 外框 ──────────────────────────────────────────────────── */

.siteFoot
{
    clear: both;
    /* auto：內容短時吃掉剩下的空間（頁尾因此貼在視窗底），
       內容長時自動歸零。頁尾自己的 padding 與上緘金線已經足以
       跟上方內容分開，不需要再固定留 18px。 */
    margin-top: auto;
    -ms-flex: none;
    flex: none;
    padding: 14px 20px 16px;
    background: #211a12;
    /* 上緣金線：與站內牌匾按鈕、標題列的金色同一組 */
    border-top: 1px solid #6b5334;
    box-shadow: 0 -1px 0 rgba(200, 163, 90, .35) inset;
    color: #cfc6b4;
    font-size: 12px;
    line-height: 1.85;
    text-align: center;
}

.foot_Inner
{
    /* 與 .page 容器同寬（1000px），讓頁尾文字與上方內容對齊；
       底色則維持滿版，形成橫跨整頁的結尾色帶。 */
    max-width: 1000px;
    margin: 0 auto;
}


/* ── 資料處理中的遮罩 ─────────────────────────────────────────
   標記與行為在 Controls/SiteFooter.ascx（那裡有說明為什麼由頁尾投放）。
   樣式放在本檔的理由：這是每個有頁尾的頁面都已在 head 載入的樣式表，
   不必再多一支檔案、也不必靠程式把 link 塞進 Page.Header。

   遮罩會蓋住整頁並吃掉點擊，順帶擋掉重複送出。 */

.siteLoading
{
    display: none;
}

.siteLoading.is_on
{
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(20, 14, 6, .62);
}

.siteLoading .ld_Box
{
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 86%;
    padding: 16px 26px;
    border: 1px solid #6b5334;
    border-radius: 6px;
    background: #241c14;
    box-shadow: 0 6px 26px rgba(0, 0, 0, .55);
    color: #f0d9a8;
    font-size: 15px;
    line-height: 1.8;
    text-align: left;
}

.siteLoading .ld_Spin
{
    flex: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(232, 213, 168, .28);
    border-top-color: #e8d5a8;
    border-radius: 50%;
    animation: ld_Spin 0.9s linear infinite;
}

@keyframes ld_Spin
{
    to { transform: rotate(360deg); }
}

/* 轉圈本身也是動態效果；關閉後訊息照常顯示 */
@media (prefers-reduced-motion: reduce)
{
    .siteLoading .ld_Spin
    {
        animation: none;
    }
}

@media (max-width: 768px)
{
    .siteLoading .ld_Box
    {
        padding: 14px 18px;
        font-size: 14px;
    }
}


/* ── 管理員的返回入口 ─────────────────────────────────────────
   只有管理員登入中、且人在前台時才會輸出（見 SiteFooter.ascx.cs）。
   一般訪客與會員的頁尾完全沒有這一段。

   樣式刻意與頁尾其他文字區隔（金框、較亮），因為它是「可以按的東西」
   而不是資訊；但仍收在頁尾內，不干擾前台的瀏覽。 */

.foot_Admin
{
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(107, 83, 52, .55);
    text-align: center;
}

a.foot_AdminLink:link,
a.foot_AdminLink:visited
{
    display: inline-block;
    padding: 5px 18px;
    border: 1px solid #6b5334;
    border-radius: 14px;
    background: rgba(200, 163, 90, .12);
    color: #f0d9a8;
    font-size: 13px;
    letter-spacing: 2px;
    text-decoration: none;
}

a.foot_AdminLink:hover,
a.foot_AdminLink:active
{
    background: rgba(200, 163, 90, .28);
    color: #ffeec4;
    text-decoration: none;
}

a.foot_AdminLink:focus-visible
{
    outline: 2px solid #e8b96a;
    outline-offset: 2px;
}

@media (max-width: 768px)
{
    /* 觸控目標高度 */
    a.foot_AdminLink:link
    {
        min-height: 34px;
        line-height: 24px;
        padding: 8px 20px;
    }
}


/* ── 上層：機關（本站營運單位）─────────────────────────────
   字級與亮度都高於下方的廠商列，讓使用者一眼看到的是營運單位，
   而不是系統廠商。web.config 的 OrgName 沒設定時整塊不會輸出。 */

.foot_Org
{
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(107, 83, 52, .55);
    text-align: center;
}

.foot_OrgName
{
    margin: 0 0 2px;
    padding: 0;
    font-family: "標楷體", "DFKai-SB", "BiauKai", serif;
    font-size: 19px;
    letter-spacing: 3px;
    color: #f0d9a8;
}

.foot_OrgContact
{
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: #ded4bf;
}


/* ── 下層：系統廠商 ───────────────────────────────────────── */

.foot_Vendor
{
    display: table;
    width: 100%;
}

.foot_Brand,
.foot_Info,
.foot_Ver
{
    display: table-cell;
    vertical-align: middle;
}

.foot_Brand
{
    width: 190px;
    text-align: left;
    white-space: nowrap;
}

.foot_Logo
{
    max-height: 42px;
    max-width: 180px;
    border: 0;
    vertical-align: middle;
}

/* 廠商名稱是串在版權文字裡的行內連結，跟著周圍字大小，
   只用金色與微粗體認出來，不再當成單獨的品牌欄。 */
.foot_Company
{
    font-weight: bold;
    white-space: nowrap;
}

.foot_Info
{
    text-align: center;
}

.foot_Copy,
.foot_Contact,
.foot_Note
{
    margin: 0;
    padding: 0;
}

.foot_Copy
{
    color: #ded4bf;
}

.foot_Note
{
    color: #9d9483;
    font-size: 11px;
}

.foot_Ver
{
    width: 120px;
    text-align: right;
    /* 與 .siteFoot 底色相同：一般瀏覽看不見，工程師反白選取即可讀版本號 */
    color: #211a12;
    font-size: 11px;
    white-space: nowrap;
}

/* 有機關區時，廠商列整體退成配角 */
.foot_Org + .foot_Vendor
{
    font-size: 11px;
    color: #9d9483;
}

.foot_Org + .foot_Vendor .foot_Copy
{
    color: #a89f8d;
}


/* ── 聯絡資訊的共用元件 ───────────────────────────────────── */

/* 「標籤：值」視為一體，不讓窄螢幕把它拆到兩行 */
.foot_Item
{
    white-space: nowrap;
}

.foot_Item.foot_Wrap
{
    white-space: normal;   /* 地址很長，允許自行換行 */
}

.foot_Sep
{
    color: #6b5334;
    padding: 0 2px;
}

/* .main a:link 之類的既有規則是 (0,1,1)，單一類別 (0,1,0) 會輸，
   因此頁尾的連結一律寫成 a.xxx:link (0,1,2)。 */
a.foot_OrgLink:link,
a.foot_OrgLink:visited
{
    color: #f0d9a8;
    text-decoration: none;
}

a.foot_OrgLink:hover,
a.foot_OrgLink:active
{
    color: #ffeec4;
    text-decoration: none;
}

a.foot_Company:link,
a.foot_Company:visited
{
    color: #e8b96a;
    text-decoration: none;
}

a.foot_Company:hover,
a.foot_Company:active
{
    color: #f7dca3;
    text-decoration: none;
}

a.foot_Link:link,
a.foot_Link:visited
{
    color: #e8b96a;
    text-decoration: none;
}

a.foot_Link:hover,
a.foot_Link:active
{
    color: #f7dca3;
    text-decoration: underline;
}


/* ── 行動裝置 ─────────────────────────────────────────────── */

@media (max-width: 768px)
{
    /* 窄螢幕改成上下堆疊：table-cell 在手機上會擠成三個窄欄 */
    .foot_Vendor,
    .foot_Brand,
    .foot_Info,
    .foot_Ver
    {
        display: block;
        width: auto;
        text-align: center;
        white-space: normal;
    }

    .siteFoot
    {
        padding: 12px 12px 14px;
        line-height: 1.9;
    }

    .foot_OrgName
    {
        font-size: 17px;
    }

    .foot_Brand
    {
        margin-bottom: 6px;
    }

    .foot_Ver
    {
        margin-top: 6px;
    }

    /* 電話與信箱在手機上是實際會點的連結，撐到 44px 觸控標準 */
    a.foot_Link:link
    {
        display: inline-block;
        min-height: 26px;
        line-height: 26px;
        padding: 9px 4px;
    }
}
