﻿/* ============================================================
   mobile.css — CMS 手機版響應式樣式
   所有樣式皆包在 @media (max-width: 768px) 內
   桌面版 (>768px) 完全不受影響
   ============================================================ */

@media (max-width: 768px) {

    /* ========== A) 登入頁 ========== */

    /* 隱藏左側 LOGO 視覺區 */
    .SignInL {
        display: none !important;
    }

    /* 右側登入區佔滿螢幕 */
    .SignInR {
        width: 100% !important;
        margin-left: 0 !important;
        min-height: 100vh;
    }

    /* 表單容器自適應 */
    .PageSign .DataSI {
        width: 90% !important;
        max-width: 400px;
        padding: 0 15px;
    }

    /* 標題縮小 */
    .PageSign .DataSI h2 {
        font-size: 20px;
    }

    /* 輸入框放大至 touch-friendly */
    .PageSign .AdmPw .F-frame {
        font-size: 16px !important;
        padding: 14px 12px !important;
    }

    /* 驗證碼區域垂直排列 */
    .PageSign .PIN > div:first-child {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .PageSign .PIN .F-PIN {
        width: 100% !important;
        font-size: 16px !important;
        padding: 12px !important;
    }

    .PageSign .PIN button {
        width: 100% !important;
        padding: 12px !important;
        font-size: 15px;
        min-height: 44px;
    }

    /* 登入按鈕放大 */
    .PageSign .SignBtn .btn {
        width: 100%;
        padding: 14px !important;
        font-size: 16px !important;
        min-height: 48px;
    }

    /* 註冊連結區 */
    .PageSign .Registered {
        position: static !important;
        text-align: center;
        padding: 15px 0;
    }

    /* 公告按鈕 */
    .inform {
        position: static !important;
        text-align: center;
        padding: 5px 0;
    }

    .Announcement {
        min-width: 44px;
        min-height: 44px;
    }


    /* ========== B) Layout 頂部導覽列 ========== */

    /* 右側內容區域佔滿寬度 */
    .contentR {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* 頂部選單佔滿寬度 */
    .top-menu {
        width: 100% !important;
    }

    /* 通知圖示 touch-friendly 但不過大 */
    .top-menu .topR li a .fa {
        font-size: 16px;
        padding: 8px;
        min-width: 36px;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* 通知 badge 縮小避免重疊 */
    .top-menu .topR li span {
        font-size: 9px;
        width: 16px;
        height: 16px;
        line-height: 16px;
        top: -2px;
        left: 16px;
    }

    /* 隱藏計時器和使用者名稱節省空間 */
    .top-menu .topR .Timing {
        display: none !important;
    }

    .top-menu .topR li.p-name {
        display: none !important;
    }

    /* 手機版隱藏 TOTP 盾牌提醒（改由桌面版提示） */
    .top-menu .topR li.totp-reminder {
        display: none !important;
    }

    /* topR 間距縮小，允許橫向捲動防溢出 */
    .top-menu .topR {
        margin-right: 4px;
        overflow-x: auto;
        flex-shrink: 1;
    }

    .top-menu .topR li {
        margin-left: 2px;
        flex-shrink: 0;
    }

    /* 漢堡選單 touch 大小 */
    .toggle-menu {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }

    /* 側邊選單展開時不推擠內容 */
    #sideMenu.open ~ .contentR {
        margin-left: 0 !important;
        width: 100% !important;
    }

    #sideMenu {
        z-index: 10000;
    }

    /* 側邊選單遮罩 */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 9999;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* 漢堡按鈕展開時不移位 */
    .toggle-menu.open {
        left: auto !important;
    }


    /* ========== C) 查詢區 ========== */

    .Inquire {
        padding: 0 15px !important;
    }

    .Inquire ul {
        flex-wrap: wrap !important;
        gap: 8px;
    }

    .Inquire ul li {
        width: calc(50% - 12px) !important;
        margin-left: 0 !important;
    }

    .Inquire ul li:first-child {
        margin-left: 0 !important;
    }

    /* 搜尋按鈕 */
    .Inquire .li-btn-fa {
        width: auto !important;
    }

    .Inquire ul li select,
    .Inquire ul li input {
        font-size: 14px;
        padding: 10px 8px !important;
    }

    /* 主題區手機版 */
    .theme {
        padding: 0 15px !important;
        flex-wrap: wrap;
        height: auto !important;
        min-height: 50px;
        gap: 8px;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .theme h3 {
        font-size: 16px !important;
    }

    .theme nav ul li a {
        font-size: 12px;
        padding: 5px 10px;
    }


    /* ========== D) 表格 → 卡片式 ========== */

    /* 隱藏「向右捲動」提示 */
    .p-service-hero__scroll {
        display: none !important;
    }

    /* 資料區不需水平捲動 */
    .scroll_R {
        overflow-x: visible !important;
    }

    .data {
        overflow-x: visible !important;
    }

    .data.scrollbar_horizontal {
        overflow-x: visible !important;
    }

    .data table {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* 隱藏表頭 */
    .data thead {
        display: none;
    }

    /* 每列變為獨立卡片 */
    .data tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        margin: 12px 15px;
        padding: 12px 15px;
    }

    .data tbody tr:nth-child(odd) {
        background: #fff;
    }

    /* 每個儲存格變為 block */
    .data tbody td {
        display: block;
        text-align: left !important;
        padding: 6px 0 !important;
        max-width: none !important;
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        padding-left: 0 !important;
        word-break: break-word;
    }

    .data tbody td:last-child {
        border-bottom: none;
        padding-right: 0 !important;
    }

    .data tbody td:first-child {
        padding-left: 0 !important;
    }

    /* 隱藏空白的 td */
    .data tbody td:empty {
        display: none;
    }

    /* data-label 偽元素顯示欄位名 */
    .data tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        font-weight: bold;
        color: #999;
        text-transform: uppercase;
        margin-bottom: 2px;
    }

    /* 功能欄（編輯/刪除）放在卡片頂部、靠右 */
    .data tbody td[data-label="功能"] {
        text-align: right;
        border-bottom: 1px solid #eee;
        padding-bottom: 8px !important;
        margin-bottom: 4px;
    }

    .data tbody td[data-label="功能"]::before {
        display: none;
    }

    /* 表格內的圖示與連結在手機上放大 */
    .data tbody .fa {
        font-size: 18px !important;
    }

    .data tbody .fa-2 {
        font-size: 20px !important;
    }

    .data tbody a .fa-pencil-square-o,
    .data tbody a .fa-trash {
        padding: 8px;
        min-width: 36px;
        min-height: 36px;
    }


    /* ========== E) 表單頁（編輯/詳情） ========== */

    /* fieldset 垂直排列 */
    .fill fieldset {
        display: flex !important;
        flex-direction: column !important;
        padding: 10px 15px !important;
    }

    .fill fieldset > label {
        width: 100% !important;
        text-align: left !important;
        margin-bottom: 4px;
    }

    .fill fieldset > div {
        width: 100% !important;
    }

    .fill fieldset > div input,
    .fill fieldset > div select,
    .fill fieldset > div textarea {
        width: 100% !important;
    }

    /* 按鈕保證 touch-friendly */
    .btn {
        min-height: 44px;
        font-size: 14px !important;
    }

    /* 分頁區域 */
    .page {
        padding: 15px !important;
        text-align: center !important;
    }

    .page ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page a {
        min-width: 36px;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* 內容區 padding 調整 */
    article {
        padding: 15px 0 !important;
        padding-top: 70px !important;
    }

    article .articleBc {
        padding-bottom: 30px;
        border-radius: 0;
    }

    /* footer */
    footer {
        font-size: 11px;
    }

    footer p {
        padding: 0 10px;
    }

    /* 登出按鈕 touch 大小 */
    .top-menu .topR li.logout a .fa {
        font-size: 22px;
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
    }
}
