/* ==========================================================================
   Auto Work Log - Mobile Theme (Dark Mode + Glassmorphism)
   僅在寬度 < 768px (手機端) 生效，桌面端保持原始 SB Admin 2 樣式
   ========================================================================== */

@media (max-width: 767px) {

    /* ========== 全域變數 ========== */
    :root {
        --bg-primary: #0D1117;
        --bg-secondary: #161B22;
        --bg-card: #1C2128;
        --bg-input: #21262D;
        --color-accent: #58A6FF;
        --color-accent-hover: #79C0FF;
        --color-success: #3FB950;
        --color-warning: #D29922;
        --color-danger: #F85149;
        --color-text: #E6EDF3;
        --color-text-secondary: #8B949E;
        --color-border: #30363D;
        --radius: 12px;
        --radius-sm: 8px;
        --font-size-base: 16px;
        /* Bottom Sheet 動畫/高度變數 */
        --bottom-nav-h: 60px;
    }

    body.mobile-theme {
        margin: 0;
        padding: 0;
        background: var(--bg-primary);
        color: var(--color-text);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
        font-size: var(--font-size-base);
        line-height: 1.5;
        min-height: 100vh;
    }

    /* ========== 基礎重置 ========== */
    body {
        margin: 0;
        padding: 0;
        background: var(--bg-primary);
        color: var(--color-text);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
        font-size: var(--font-size-base);
        line-height: 1.5;
        min-height: 100vh;
    }

    /* 確保所有元素使用 border-box */
    *,
    *:before,
    *:after {
        box-sizing: border-box;
    }

    /* ========== 登入頁面專用樣式 ========== */
    body.login-page {
        /* 工地主題深色背景 + 漸層 + SVG 裝飾圖案 */
        background:
            linear-gradient(180deg,
                rgba(13, 17, 23, 0.85) 0%,
                rgba(13, 17, 23, 0.70) 40%,
                rgba(13, 17, 23, 0.90) 100%),
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 800'%3E%3Crect fill='%231a1a2e' width='400' height='800'/%3E%3Ccircle cx='80' cy='200' r='120' fill='%23162447' opacity='0.5'/%3E%3Ccircle cx='320' cy='600' r='150' fill='%231f4068' opacity='0.4'/%3E%3Ccircle cx='60' cy='100' r='70' fill='none' stroke='%23ffffff' stroke-width='1.5' opacity='0.2'/%3E%3Ccircle cx='340' cy='480' r='90' fill='none' stroke='%23ffffff' stroke-width='1.5' opacity='0.15'/%3E%3Ccircle cx='200' cy='300' r='50' fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.12'/%3E%3Ccircle cx='30' cy='650' r='60' fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.1'/%3E%3Ccircle cx='370' cy='150' r='40' fill='none' stroke='%23ffffff' stroke-width='1.5' opacity='0.18'/%3E%3Cpath d='M0 250 Q100 220 200 260 T400 240' fill='none' stroke='%23ffffff' stroke-width='1.5' opacity='0.2'/%3E%3Cpath d='M0 380 Q150 350 300 390 T400 370' fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.15'/%3E%3Cpath d='M0 520 Q80 490 180 530 T400 510' fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.12'/%3E%3Cpath d='M0 680 Q200 650 300 690 T400 670' fill='none' stroke='%23ffffff' stroke-width='1.5' opacity='0.18'/%3E%3Cpath d='M0 130 Q120 100 250 140 T400 120' fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.1'/%3E%3Crect x='170' y='140' width='20' height='20' rx='2' fill='none' stroke='%23ffffff' stroke-width='1.5' opacity='0.22' transform='rotate(45 180 150)'/%3E%3Crect x='310' y='320' width='14' height='14' rx='1' fill='none' stroke='%23ffffff' stroke-width='1.5' opacity='0.18' transform='rotate(45 317 327)'/%3E%3Crect x='50' y='450' width='18' height='18' rx='2' fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.15' transform='rotate(45 59 459)'/%3E%3Crect x='250' y='580' width='12' height='12' rx='1' fill='none' stroke='%23ffffff' stroke-width='1.5' opacity='0.2' transform='rotate(45 256 586)'/%3E%3Crect x='120' y='720' width='16' height='16' rx='2' fill='none' stroke='%23ffffff' stroke-width='1' opacity='0.16' transform='rotate(45 128 728)'/%3E%3C/svg%3E");
        background-color: #0D1117;
        background-size: cover;
        background-position: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 100vh;
    }

    /* 語言切換 — 右上角 🌐 按鈕 */
    .lang-top-right {
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 100;
    }

    .lang-globe-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        color: var(--color-text);
        font-size: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }

    /* 下拉選單 */
    .lang-dropdown {
        position: absolute;
        top: 48px;
        right: 0;
        background: rgba(22, 27, 34, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-sm);
        min-width: 160px;
        display: none;
        overflow: hidden;
    }

    .lang-dropdown.open {
        display: block;
    }

    .lang-dropdown a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        color: var(--color-text);
        text-decoration: none;
        font-size: 14px;
        transition: background 0.2s;
    }

    .lang-dropdown a:hover,
    .lang-dropdown a.active {
        background: rgba(88, 166, 255, 0.15);
    }

    /* 主內容區 */
    .login-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 24px;
        width: 100%;
        max-width: 400px;
    }

    /* 系統標題 */
    .system-title {
        text-align: center;
        margin-bottom: 32px;
    }

    .system-title .app-icon {
        width: 64px;
        height: 64px;
        background: linear-gradient(135deg, #58A6FF, #3B82F6);
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        font-weight: 800;
        color: #fff;
        margin: 0 auto 12px;
        box-shadow: 0 8px 32px rgba(88, 166, 255, 0.3);
    }

    .system-title h1 {
        font-size: 24px;
        font-weight: 700;
        color: var(--color-text);
        letter-spacing: 1px;
        margin: 0;
    }

    .system-title .subtitle {
        font-size: 13px;
        color: var(--color-text-secondary);
        margin-top: 4px;
    }

    /* 國旗語言列 */
    .flag-row {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-bottom: 24px;
    }

    .flag-btn {
        width: 44px;
        height: 34px;
        border: 2px solid transparent;
        border-radius: 6px;
        cursor: pointer;
        font-size: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.06);
        transition: all 0.2s;
    }

    .flag-btn.active {
        border-color: var(--color-accent);
        background: rgba(88, 166, 255, 0.15);
        box-shadow: 0 0 12px rgba(88, 166, 255, 0.2);
    }

    /* 毛玻璃登入卡片 */
    .login-card {
        width: 100%;
        background: rgba(22, 27, 34, 0.65);
        backdrop-filter: blur(24px) saturate(150%);
        -webkit-backdrop-filter: blur(24px) saturate(150%);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: var(--radius);
        padding: 28px 24px;
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    /* 輸入框 */
    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: var(--color-text-secondary);
        margin-bottom: 6px;
    }

    .form-group .input-wrapper {
        position: relative;
    }

    .form-group .input-icon {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--color-text-secondary);
        font-size: 16px;
    }

    .form-group input {
        width: 100%;
        height: 50px;
        padding: 0 14px 0 42px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: var(--radius-sm);
        color: var(--color-text);
        font-size: 16px;
        outline: none;
        transition: all 0.2s;
        box-shadow: none;
    }

    .form-group input:focus {
        border-color: var(--color-accent);
        background: rgba(88, 166, 255, 0.06);
        box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
    }

    /* 錯誤訊息 */
    .error-message {
        color: var(--color-danger);
        font-size: 13px;
        margin-bottom: 12px;
        background: rgba(248, 81, 73, 0.1);
        border: 1px solid rgba(248, 81, 73, 0.4);
        border-radius: var(--radius-sm);
        padding: 8px 12px;
        display: none;
        /* JS 控制顯示 */
    }

    /* 記住我 + 忘記密碼 */
    .form-options {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        font-size: 13px;
    }

    .remember-me {
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        color: var(--color-text-secondary);
        margin-bottom: 0;
    }

    .remember-me input[type="checkbox"] {
        width: 18px;
        height: 18px;
        accent-color: var(--color-accent);
        margin: 0;
    }

    .forgot-password {
        color: var(--color-accent);
        text-decoration: none;
        cursor: pointer;
    }

    /* 登入按鈕 */
    .login-btn {
        width: 100%;
        height: 50px;
        background: linear-gradient(135deg, #58A6FF, #3B82F6);
        border: none;
        border-radius: var(--radius-sm);
        color: #fff;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s;
        letter-spacing: 1px;
        box-shadow: 0 4px 16px rgba(88, 166, 255, 0.3);
    }

    .version {
        text-align: center;
        margin-top: 32px;
        font-size: 11px;
        color: rgba(139, 148, 158, 0.5);
    }

    /* ========== 主畫面應用樣式 (Dashboard) ========== */

    /* 頂部導航列 */
    .top-bar {
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--color-border);
        padding: 12px 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .top-bar .logo {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .top-bar .logo-icon {
        width: 32px;
        height: 32px;
        background: var(--color-accent);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 14px;
        color: #fff;
    }

    .top-bar .logo-text {
        font-size: 15px;
        font-weight: 600;
        color: var(--color-text);
    }

    .top-bar .hamburger {
        width: 40px;
        height: 40px;
        background: none;
        border: 1px solid var(--color-border);
        border-radius: var(--radius-sm);
        color: var(--color-text);
        font-size: 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* ICON 宮格 — 3 欄等大排列 */
    .icon-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 16px;
        overflow: hidden;
    }

    .icon-tile {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 16px 4px 12px;
        background: var(--bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        cursor: pointer;
        text-decoration: none;
        box-sizing: border-box;
        overflow: hidden;
        min-width: 0;
    }

    .icon-tile:hover,
    .icon-tile:focus {
        text-decoration: none;
        background: var(--bg-input);
    }

    .icon-tile .tile-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        flex-shrink: 0;
    }

    .icon-tile .tile-label {
        font-size: 11px;
        font-weight: 500;
        color: var(--color-text-secondary);
        text-align: center;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        max-width: 100%;
    }

    /* ICON 色彩 */
    .tile-guide .tile-icon {
        background: rgba(88, 166, 255, 0.15);
        color: #58A6FF;
    }

    .tile-dashboard .tile-icon {
        background: rgba(63, 185, 80, 0.15);
        color: #3FB950;
    }

    .tile-datalist .tile-icon {
        background: rgba(210, 153, 34, 0.15);
        color: #D29922;
    }

    .tile-reports .tile-icon {
        background: rgba(188, 140, 255, 0.15);
        color: #BC8CFF;
    }

    .tile-users .tile-icon {
        background: rgba(255, 123, 114, 0.15);
        color: #FF7B72;
    }

    .tile-projects .tile-icon {
        background: rgba(63, 185, 80, 0.15);
        color: #3FB950;
    }

    .tile-activity .tile-icon {
        background: rgba(121, 192, 255, 0.15);
        color: #79C0FF;
    }

    .tile-projmgr .tile-icon {
        background: rgba(210, 153, 34, 0.15);
        color: #D29922;
    }

    .tile-form .tile-icon {
        background: rgba(255, 166, 87, 0.15);
        color: #FFA657;
    }

    .tile-export .tile-icon {
        background: rgba(188, 140, 255, 0.15);
        color: #BC8CFF;
    }

    .tile-pdf .tile-icon {
        background: rgba(121, 192, 255, 0.15);
        color: #79C0FF;
    }

    .tile-lang .tile-icon {
        background: rgba(88, 166, 255, 0.15);
        color: #58A6FF;
    }

    .tile-logout .tile-icon {
        background: rgba(248, 81, 73, 0.15);
        color: #F85149;
    }

    /* 底部導航列 */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-nav-h);
        background: var(--bg-secondary);
        border-top: 1px solid var(--color-border);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 9999;
    }

    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        text-decoration: none;
        color: var(--color-text-secondary);
        font-size: 10px;
        font-weight: 500;
        padding: 6px 12px;
        border-radius: var(--radius-sm);
    }

    .bottom-nav a:hover,
    .bottom-nav a:focus {
        text-decoration: none;
        color: var(--color-text);
    }

    .bottom-nav a.active {
        color: var(--color-accent);
    }

    .bottom-nav a .nav-icon {
        font-size: 20px;
    }

    /* 隱藏原始 Bootstrap 元素 */
    .navbar.navbar-default.navbar-static-top {
        display: none !important;
    }

    /* Modal (忘記密碼) */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 300;
        display: none;
        align-items: center;
        justify-content: center;
    }

    .modal-overlay.open {
        display: flex;
    }

    .modal-box {
        background: rgba(22, 27, 34, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        padding: 24px;
        max-width: 300px;
        text-align: center;
    }

    .modal-box .modal-icon {
        font-size: 40px;
        color: var(--color-accent);
        margin-bottom: 12px;
    }

    .modal-box .modal-title {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 8px;
    }

    .modal-box .modal-message {
        font-size: 14px;
        color: var(--color-text-secondary);
        margin-bottom: 20px;
        line-height: 1.5;
    }

    .modal-box .modal-btn {
        padding: 10px 32px;
        background: var(--color-accent);
        border: none;
        border-radius: var(--radius-sm);
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }

    /* 歡迎區 */
    .welcome-section {
        padding: 20px 16px 8px;
    }

    .welcome-section .greeting {
        font-size: 14px;
        color: var(--color-text-secondary);
    }

    .welcome-section .user-name {
        font-size: 22px;
        font-weight: 700;
        margin-top: 2px;
    }

    .welcome-section .role-badge {
        display: inline-block;
        margin-top: 6px;
        padding: 3px 10px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        background: rgba(88, 166, 255, 0.15);
        color: var(--color-accent);
        border: 1px solid rgba(88, 166, 255, 0.3);
    }

    /* 快速統計 */
    .stats-section {
        padding: 0 16px 16px;
    }

    .stats-section h3 {
        font-size: 14px;
        color: var(--color-text-secondary);
        margin-bottom: 10px;
        font-weight: 500;
    }

    .stats-row {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .stat-card {
        background: var(--bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        padding: 14px 10px;
        text-align: center;
    }

    .stat-card .stat-number {
        font-size: 24px;
        font-weight: 700;
        line-height: 1;
    }

    .stat-card .stat-label {
        font-size: 11px;
        color: var(--color-text-secondary);
        margin-top: 4px;
    }

    .stat-pending .stat-number {
        color: var(--color-warning);
    }

    .stat-approved .stat-number {
        color: var(--color-success);
    }

    .stat-total .stat-number {
        color: var(--color-accent);
    }

    /* 左側滑出抽屜 */
    .drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 200;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .drawer-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .drawer {
        position: fixed;
        top: 0;
        left: -280px;
        bottom: 0;
        width: 280px;
        background: var(--bg-secondary);
        z-index: 201;
        transition: left 0.3s ease;
        overflow-y: auto;
        border-right: 1px solid var(--color-border);
    }

    .drawer.open {
        left: 0;
    }

    .drawer-header {
        padding: 20px 16px;
        border-bottom: 1px solid var(--color-border);
    }

    .drawer-header .drawer-title {
        font-size: 18px;
        font-weight: 700;
    }

    .drawer-header .drawer-subtitle {
        font-size: 13px;
        color: var(--color-text-secondary);
        margin-top: 2px;
    }

    .drawer-menu {
        list-style: none;
        padding: 8px 0;
        margin: 0;
    }

    .drawer-menu li a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        color: var(--color-text);
        text-decoration: none;
        font-size: 15px;
        transition: background 0.2s;
    }

    .drawer-menu li a:active {
        background: var(--bg-card);
    }

    .drawer-menu li a:hover {
        background: var(--bg-card);
        text-decoration: none;
    }

    .drawer-menu li a .fa {
        width: 24px;
        text-align: center;
        color: var(--color-text-secondary);
        font-size: 16px;
    }

    .drawer-divider {
        height: 1px;
        background: var(--color-border);
        margin: 8px 16px;
    }

    /* ==========================================================================
       使用說明頁面 guide-page 樣式
       ========================================================================== */

    body.guide-page {
        min-height: 100vh;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
        font-size: 15px;
        color: var(--color-text);
        background: var(--bg-primary);
        max-width: 412px;
        margin: 0 auto;
        padding-bottom: 80px;
    }

    /* 通用區塊卡片 */
    .section-card {
        margin: 12px 16px;
        background: var(--bg-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius);
        backdrop-filter: blur(10px);
        overflow: hidden;
    }

    .section-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 16px;
        border-bottom: 1px solid var(--color-border);
        font-size: 15px;
        font-weight: 600;
    }

    .section-header i {
        font-size: 16px;
        opacity: 0.8;
    }

    .section-body {
        padding: 16px;
        font-size: 14px;
        line-height: 1.7;
        color: #C5CCD3;
    }

    /* 角色卡片 — 垂直列表 */
    .role-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 16px;
    }

    .role-card {
        display: flex;
        align-items: flex-start;
        gap: 14px;
        padding: 14px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--color-border);
        border-radius: 10px;
    }

    .role-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        flex-shrink: 0;
    }

    .role-info {
        flex: 1;
        min-width: 0;
    }

    .role-name {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 4px;
    }

    .role-desc {
        font-size: 12px;
        color: #C5CCD3;
        line-height: 1.5;
    }

    /* 權限對照 — badge 卡片 */
    .perm-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }

    .perm-item {
        padding: 12px 14px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--color-border);
        border-radius: 10px;
    }

    .perm-feat {
        font-size: 13px;
        font-weight: 600;
        margin-bottom: 8px;
        color: var(--color-text);
    }

    .perm-roles {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }

    .perm-badge {
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 6px;
        font-weight: 500;
    }

    .perm-yes {
        background: rgba(63, 185, 80, 0.15);
        color: #3FB950;
    }

    .perm-no {
        background: rgba(248, 81, 73, 0.1);
        color: #F85149;
    }

    .perm-sim {
        background: rgba(88, 166, 255, 0.15);
        color: #58A6FF;
    }

    /* Dashboard 功能列表 */
    .feature-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 16px;
    }

    .feature-item {
        display: flex;
        align-items: flex-start;
        gap: 14px;
        padding: 14px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--color-border);
        border-radius: 10px;
    }

    .feature-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        flex-shrink: 0;
    }

    .feature-title {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 4px;
    }

    .feature-desc {
        font-size: 12px;
        color: #C5CCD3;
        line-height: 1.5;
    }

    /* 操作流程 — 垂直時間軸 */
    .flow-timeline {
        padding: 16px 16px 16px 32px;
        position: relative;
    }

    .flow-timeline::before {
        content: '';
        position: absolute;
        left: 27px;
        top: 16px;
        bottom: 16px;
        width: 2px;
        background: var(--color-border);
    }

    .flow-step {
        position: relative;
        padding: 0 0 24px 28px;
    }

    .flow-step:last-child {
        padding-bottom: 0;
    }

    .flow-dot {
        position: absolute;
        left: -14px;
        top: 2px;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 700;
        color: #fff;
    }

    .flow-label {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 4px;
    }

    .flow-desc {
        font-size: 12px;
        color: #C5CCD3;
        line-height: 1.4;
    }

    /* FAQ 手風琴 */
    .faq-list {
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .faq-item {
        border: 1px solid var(--color-border);
        border-radius: 10px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.03);
    }

    .faq-q {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        gap: 10px;
    }

    .faq-q i.chevron {
        font-size: 12px;
        opacity: 0.5;
        transition: transform 0.2s;
        flex-shrink: 0;
    }

    .faq-q.open i.chevron {
        transform: rotate(180deg);
    }

    .faq-a {
        padding: 0 14px 14px;
        font-size: 13px;
        color: #C5CCD3;
        line-height: 1.6;
        display: none;
    }

    .faq-a.open {
        display: block;
    }

    /* ==========================================================================
       總覽面板頁面 dashboard-page 樣式
       ========================================================================== */

    body.dashboard-page {
        min-height: 100vh;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
        font-size: 15px;
        color: var(--color-text);
        background: var(--bg-primary);
        max-width: 412px;
        margin: 0 auto;
        padding-bottom: 80px;
    }

    /* 返回按鈕 */
    .dashboard-page .back-btn {
        color: var(--color-accent);
        text-decoration: none;
        font-size: 18px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dashboard-page .top-bar-title {
        font-weight: 700;
        font-size: 16px;
        flex: 1;
        text-align: center;
    }

    /* 角色資訊列 */
    .db-role-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 16px;
        padding: 12px 14px;
        background: var(--bg-secondary);
        border-radius: var(--radius);
        border: 1px solid var(--color-border);
    }

    .db-role-avatar {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: linear-gradient(135deg, #58a6ff, #bc8cff);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 15px;
        color: #fff;
        flex-shrink: 0;
    }

    .db-role-info {
        flex: 1;
    }

    .db-role-name {
        font-size: 14px;
        font-weight: 600;
    }

    .db-role-level {
        font-size: 11px;
        color: var(--color-text-secondary);
    }

    /* 區塊標題 */
    .db-section-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 20px 0 12px;
        font-size: 15px;
        font-weight: 600;
    }

    .db-section-header:first-child {
        margin-top: 0;
    }

    .db-sec-icon {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
    }

    /* KPI 垂直堆疊卡片 */
    .db-kpi-stack {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .db-kpi-card {
        background: var(--bg-secondary);
        border-radius: var(--radius);
        padding: 14px 16px;
        border: 1px solid var(--color-border);
        display: flex;
        align-items: center;
        gap: 14px;
        transition: transform 0.15s;
        text-decoration: none;
        color: var(--color-text);
        width: 100%;
    }

    .db-kpi-card:hover,
    .db-kpi-card:focus {
        text-decoration: none;
        color: var(--color-text);
    }

    .db-kpi-card:active {
        transform: scale(0.98);
    }

    .db-kpi-icon {
        font-size: 22px;
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        flex-shrink: 0;
    }

    .db-kpi-body {
        flex: 1;
    }

    .db-kpi-num {
        font-size: 28px;
        font-weight: 800;
        line-height: 1;
    }

    .db-kpi-label {
        font-size: 12px;
        color: var(--color-text-secondary);
        margin-top: 4px;
    }

    .db-kpi-action {
        color: #484f58;
        font-size: 16px;
        flex-shrink: 0;
    }

    /* KPI 顏色 */
    .kpi-red .db-kpi-icon {
        background: rgba(248, 81, 73, 0.15);
    }

    .kpi-red .db-kpi-num {
        color: var(--color-danger);
    }

    .kpi-green .db-kpi-icon {
        background: rgba(63, 185, 80, 0.15);
    }

    .kpi-green .db-kpi-num {
        color: var(--color-success);
    }

    .kpi-blue .db-kpi-icon {
        background: rgba(88, 166, 255, 0.15);
    }

    .kpi-blue .db-kpi-num {
        color: var(--color-accent);
    }

    .kpi-yellow .db-kpi-icon {
        background: rgba(210, 153, 34, 0.15);
    }

    .kpi-yellow .db-kpi-num {
        color: var(--color-warning);
    }

    .kpi-purple .db-kpi-icon {
        background: rgba(188, 140, 255, 0.15);
    }

    .kpi-purple .db-kpi-num {
        color: #bc8cff;
    }

    /* NOTE: 進行中（Lv3 專用） — 藍綠色 */
    .kpi-teal .db-kpi-icon {
        background: rgba(45, 212, 191, 0.15);
    }

    .kpi-teal .db-kpi-num {
        color: #2dd4bf;
    }

    /* NOTE: 被退件（Lv3 專用） — 橘色 */
    .kpi-orange .db-kpi-icon {
        background: rgba(251, 146, 60, 0.15);
    }

    .kpi-orange .db-kpi-num {
        color: #fb923c;
    }

    /* ===== Phase 2：簽核管理版 (Approval Board) ===== */

    /* NOTE: 退件提示橫幅 */
    .ab-reject-banner {
        background: linear-gradient(135deg, rgba(248, 81, 73, 0.15), rgba(251, 146, 60, 0.15));
        border: 1px solid rgba(248, 81, 73, 0.3);
        border-radius: 12px;
        padding: 12px 16px;
        margin-bottom: 16px;
        color: #fb923c;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        animation: bannerPulse 2s ease-in-out infinite;
    }

    .ab-reject-banner:active {
        transform: scale(0.98);
    }

    @keyframes bannerPulse {

        0%,
        100% {
            opacity: 1;
        }

        50% {
            opacity: 0.8;
        }
    }

    /* NOTE: 專案區塊 */
    .ab-project-block {
        background: rgba(22, 27, 34, 0.8);
        border: 1px solid #30363D;
        border-radius: 12px;
        padding: 12px;
        margin-bottom: 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .ab-project-name {
        font-size: 14px;
        font-weight: 600;
        color: #E6EDF3;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* NOTE: 矩陣表格 */
    .ab-table {
        width: 100%;
    }

    .ab-row {
        display: flex;
        border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    }

    .ab-row:last-child {
        border-bottom: none;
    }

    .ab-header {
        background: rgba(88, 166, 255, 0.08);
        border-radius: 6px 6px 0 0;
        font-weight: 600;
        font-size: 12px;
        color: #8B949E;
        text-transform: uppercase;
    }

    .ab-cell {
        flex: 1;
        text-align: center;
        padding: 8px 4px;
        font-size: 16px;
        min-width: 0;
    }

    .ab-date-cell {
        flex: 1.5;
        text-align: left;
        font-size: 13px;
        color: #8B949E;
        font-weight: 500;
    }

    .ab-header .ab-date-cell {
        font-size: 12px;
    }

    /* NOTE: 狀態樣式 */
    .ab-approved {
        opacity: 0.9;
    }

    .ab-rejected {
        cursor: pointer;
        transition: transform 0.15s ease;
    }

    .ab-rejected:active {
        transform: scale(1.3);
    }

    .ab-pending {
        color: #8B949E;
        font-size: 14px;
    }

    .ab-none {
        color: #484F58;
        font-size: 12px;
    }

    /* NOTE: Bottom Sheet — 退件理由彈窗 */
    .rr-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 300;
        display: none;
    }

    .rr-overlay.open {
        display: block;
    }

    .rr-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 301;
        background: #161B22;
        border-top: 1px solid #30363D;
        border-radius: 16px 16px 0 0;
        max-height: 60vh;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    .rr-sheet.open {
        transform: translateY(0);
    }

    .rr-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid #30363D;
    }

    .rr-title {
        font-size: 15px;
        font-weight: 600;
        color: #E6EDF3;
    }

    .rr-close {
        background: rgba(139, 148, 158, 0.15);
        border: none;
        color: #8B949E;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        cursor: pointer;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .rr-body {
        padding: 12px 20px 24px;
        overflow-y: auto;
    }

    .rr-item {
        background: rgba(48, 54, 61, 0.4);
        border: 1px solid #30363D;
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 10px;
    }

    .rr-meta {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
        font-size: 12px;
        color: #8B949E;
    }

    .rr-user {
        color: #fb923c;
        font-weight: 500;
    }

    .rr-reason {
        font-size: 14px;
        color: #E6EDF3;
        line-height: 1.5;
    }

    /* NOTE: KPI 待補件的 chevron 旋轉動畫 */
    .db-kpi-card .db-kpi-action i {
        transition: transform 0.3s ease;
    }

    .db-kpi-card[onclick] {
        cursor: pointer;
    }

    /* NOTE: KPI 待補件下拉清單 — 展開/收合 */
    .db-kpi-dropdown {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, padding 0.35s ease, margin 0.35s ease;
        background: rgba(22, 27, 34, 0.85);
        border-radius: 10px;
        margin: 0 0 0 0;
        padding: 0 12px;
    }

    .db-kpi-dropdown.open {
        max-height: 500px;
        padding: 8px 12px;
        margin: -4px 0 8px 0;
        border: 1px solid rgba(210, 153, 34, 0.25);
    }

    .db-kpi-dropdown-empty {
        padding: 12px 0;
        text-align: center;
        color: var(--color-text-secondary);
        font-size: 13px;
    }

    .db-kpi-dropdown-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        color: #E6EDF3;
        text-decoration: none;
        font-size: 13px;
        border-radius: 6px;
        transition: background 0.2s;
    }

    .db-kpi-dropdown-item:last-child {
        border-bottom: none;
    }

    .db-kpi-dropdown-item:hover,
    .db-kpi-dropdown-item:active {
        background: rgba(210, 153, 34, 0.12);
        text-decoration: none;
        color: #E6EDF3;
    }

    .db-kpi-dd-project {
        display: flex;
        align-items: center;
        gap: 6px;
        color: #E6EDF3;
        font-weight: 500;
    }

    .db-kpi-dd-project i {
        color: var(--color-warning);
        font-size: 12px;
    }

    .db-kpi-dd-date {
        display: flex;
        align-items: center;
        gap: 4px;
        color: var(--color-text-secondary);
        font-size: 12px;
        white-space: nowrap;
    }

    .db-kpi-dd-date i {
        font-size: 11px;
    }

    /* 簽核進度清單 */
    .db-approval-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .db-approval-item {
        background: var(--bg-secondary);
        border-radius: 10px;
        padding: 12px 14px;
        border: 1px solid var(--color-border);
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .db-approval-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .db-approval-dot.pending {
        background: var(--color-warning);
    }

    .db-approval-dot.done {
        background: var(--color-success);
    }

    .db-approval-info {
        flex: 1;
    }

    .db-approval-proj {
        font-size: 13px;
        font-weight: 600;
    }

    .db-approval-date {
        font-size: 11px;
        color: var(--color-text-secondary);
    }

    .db-approval-badge {
        font-size: 10px;
        padding: 3px 8px;
        border-radius: 10px;
        font-weight: 600;
        flex-shrink: 0;
    }

    .badge-pending {
        background: rgba(210, 153, 34, 0.2);
        color: var(--color-warning);
    }

    .badge-done {
        background: rgba(63, 185, 80, 0.2);
        color: var(--color-success);
    }

    /* 空狀態提示 */
    .db-empty-msg {
        text-align: center;
        padding: 24px 16px;
        color: var(--color-text-secondary);
        font-size: 14px;
    }

    .db-empty-msg i {
        font-size: 24px;
        display: block;
        margin-bottom: 8px;
        opacity: 0.5;
    }

    /* 30 天日曆網格（7 欄） */
    .db-cal-header {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
        margin-bottom: 4px;
    }

    .db-cal-header-cell {
        text-align: center;
        font-size: 10px;
        color: var(--color-text-secondary);
        font-weight: 600;
        padding: 4px 0;
    }

    .db-cal-strip {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }

    .db-cal-day {
        text-align: center;
        border-radius: 8px;
        padding: 4px 2px;
        border: 1px solid var(--color-border);
        background: var(--bg-secondary);
    }

    /* NOTE: 30 天模式隱藏每格的星期文字，由頂部標頭統一顯示 */
    .db-cal-weekday {
        display: none;
    }

    .db-cal-date {
        font-size: 13px;
        font-weight: 700;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
    }

    /* NOTE: 空白佔位格（月初非週一的填充） */
    .db-cal-placeholder {
        visibility: hidden;
    }

    .cal-completed .db-cal-date {
        background: var(--color-success);
        color: #fff;
    }

    .cal-pending .db-cal-date {
        background: var(--color-warning);
        color: #fff;
    }

    .cal-empty .db-cal-date {
        background: var(--bg-input);
        color: var(--color-text-secondary);
    }

    .cal-weekend .db-cal-date {
        background: var(--bg-secondary);
        color: #484f58;
    }

    .cal-today {
        border-color: var(--color-accent) !important;
    }

    .db-cal-legend {
        display: flex;
        gap: 12px;
        margin-top: 10px;
        justify-content: center;
    }

    .db-cal-legend span {
        font-size: 11px;
        color: var(--color-text-secondary);
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .db-cal-legend .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        display: inline-block;
    }

    /* 專案概覽 — 可折疊清單 */
    .db-proj-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .db-proj-item {
        background: var(--bg-secondary);
        border-radius: 10px;
        border: 1px solid var(--color-border);
        overflow: hidden;
    }

    .db-proj-header {
        padding: 14px;
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
    }

    .db-proj-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: rgba(88, 166, 255, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--color-accent);
        font-size: 14px;
        flex-shrink: 0;
    }

    .db-proj-info {
        flex: 1;
    }

    .db-proj-name {
        font-size: 14px;
        font-weight: 600;
    }

    .db-proj-rate-mini {
        font-size: 11px;
        color: var(--color-text-secondary);
        margin-top: 2px;
    }

    .db-proj-chevron {
        color: #484f58;
        font-size: 12px;
        flex-shrink: 0;
        transition: transform 0.2s;
    }

    .db-proj-item.open .db-proj-chevron {
        transform: rotate(90deg);
    }

    .db-proj-body {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-top: 1px solid transparent;
    }

    .db-proj-item.open .db-proj-body {
        max-height: 220px;
        border-top-color: var(--color-border);
    }

    .db-proj-body-inner {
        padding: 12px 14px;
    }

    .db-proj-detail {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        font-size: 13px;
    }

    .db-proj-detail-label {
        color: var(--color-text-secondary);
    }

    .db-proj-detail-value {
        font-weight: 600;
    }

    .db-proj-progress {
        height: 6px;
        background: var(--bg-input);
        border-radius: 3px;
        overflow: hidden;
        margin-top: 8px;
    }

    .db-proj-progress-fill {
        height: 100%;
        border-radius: 3px;
    }

    /* ==========================================================================
       檢視報表頁面 reports-page 樣式
       ========================================================================== */

    body.reports-page {
        min-height: 100vh;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
        font-size: 15px;
        color: var(--color-text);
        background: var(--bg-primary);
        max-width: 412px;
        margin: 0 auto;
        padding-bottom: 80px;
    }

    /* 報表數量標籤 */
    .rpt-count {
        margin-left: auto;
        font-size: 12px;
        color: var(--color-text-secondary);
        background: rgba(255, 255, 255, 0.06);
        padding: 3px 10px;
        border-radius: 12px;
    }

    /* 篩選列 */
    .rpt-filter-bar {
        padding: 12px 16px;
        background: rgba(22, 27, 34, 0.6);
        border-bottom: 1px solid var(--color-border);
    }

    .rpt-filter-wrap {
        position: relative;
    }

    .rpt-filter-select {
        width: 100%;
        padding: 10px 36px 10px 14px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--color-border);
        border-radius: 10px;
        color: var(--color-text);
        font-size: 14px;
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
    }

    .rpt-filter-select option {
        background: #161B22;
        color: #E6EDF3;
    }

    .rpt-filter-chevron {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        color: var(--color-text-secondary);
        pointer-events: none;
    }

    /* 報表緊湊列表 */
    .rpt-list {
        padding: 0 16px;
    }

    .rpt-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 0;
        border-bottom: 1px solid rgba(48, 54, 61, 0.6);
        cursor: pointer;
    }

    .rpt-item:last-child {
        border-bottom: none;
    }

    .rpt-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: rgba(217, 83, 79, 0.15);
        color: #d9534f;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 17px;
        flex-shrink: 0;
    }

    .rpt-info {
        flex: 1;
        min-width: 0;
    }

    .rpt-name {
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .rpt-meta {
        font-size: 11px;
        color: var(--color-text-secondary);
        margin-top: 3px;
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .rpt-meta span {
        display: flex;
        align-items: center;
        gap: 3px;
    }

    .rpt-dl-btn {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        border: 1px solid var(--color-border);
        background: transparent;
        color: var(--color-accent);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        cursor: pointer;
        flex-shrink: 0;
        transition: background 0.2s, border-color 0.2s;
    }

    .rpt-dl-btn:active,
    .rpt-dl-btn.active {
        background: rgba(88, 166, 255, 0.12);
        border-color: var(--color-accent);
    }

    /* 下載面板 — 點擊展開 */
    .rpt-dl-panel {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-bottom: 1px solid rgba(48, 54, 61, 0.6);
    }

    .rpt-dl-panel.open {
        max-height: 200px;
    }

    .rpt-dl-inner {
        padding: 8px 0 14px 52px;
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }

    .rpt-dl-lang-btn {
        font-size: 11px;
        padding: 6px 12px;
        border-radius: 8px;
        border: none;
        cursor: pointer;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        text-decoration: none;
        color: #fff;
        transition: opacity 0.15s;
    }

    .rpt-dl-lang-btn:active {
        opacity: 0.7;
    }

    /* 空狀態 */
    .rpt-empty {
        text-align: center;
        padding: 60px 32px;
        color: var(--color-text-secondary);
    }

    .rpt-empty i {
        font-size: 48px;
        opacity: 0.3;
        display: block;
        margin-bottom: 16px;
    }

    .rpt-empty p {
        font-size: 14px;
        line-height: 1.6;
    }

    /* ==========================================================================
       施工日誌頁面 datalist-page 樣式
       ========================================================================== */

    body.datalist-page {
        min-height: 100vh;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
        font-size: 15px;
        color: var(--color-text);
        background: var(--bg-primary);
        max-width: 412px;
        margin: 0 auto;
        padding-bottom: 80px;
    }

    /* 返回 + 編輯按鈕 */
    .datalist-page .back-btn {
        color: var(--color-accent);
        text-decoration: none;
        font-size: 18px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .datalist-page .page-title {
        font-weight: 700;
        font-size: 16px;
        flex: 1;
        text-align: center;
    }

    .datalist-page .action-icon {
        color: var(--color-text-secondary);
        font-size: 16px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        cursor: pointer;
        transition: background 0.2s, color 0.2s;
    }

    /* NOTE: 編輯模式啟用時，頂部按鈕高亮 */
    .datalist-page .action-icon.editing {
        background: rgba(88, 166, 255, 0.2);
        color: var(--color-accent);
    }

    /* ========== 篩選列 ========== */
    .dl-filter-sticky {
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--color-border);
        padding: 10px 16px;
        display: flex;
        gap: 8px;
        position: sticky;
        top: 49px;
        z-index: 89;
    }

    .dl-filter-sticky select,
    .dl-filter-sticky input {
        flex: 1;
        background: var(--bg-input);
        color: var(--color-text);
        border: 1px solid var(--color-border);
        border-radius: 8px;
        padding: 8px 10px;
        font-size: 12px;
        font-family: inherit;
    }

    .dl-filter-btn {
        background: var(--color-accent);
        color: #fff;
        border: 0;
        border-radius: 8px;
        padding: 0 14px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
    }

    /* ========== 編輯模式指示條 ========== */
    .dl-edit-banner {
        display: none;
        background: rgba(88, 166, 255, 0.12);
        color: var(--color-accent);
        text-align: center;
        padding: 8px 16px;
        font-size: 12px;
        font-weight: 600;
        border-bottom: 1px solid rgba(88, 166, 255, 0.2);
    }

    body.edit-mode .dl-edit-banner {
        display: block;
    }

    /* ========== 頁面內容區 ========== */
    .dl-page-body {
        padding: 0 16px 16px;
    }

    body.edit-mode .dl-page-body {
        padding-bottom: 100px;
    }

    /* ========== 日期顏色標註列表 ========== */
    .dl-date-tags-wrap {
        display: flex;
        gap: 6px;
        padding: 8px 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .dl-date-tags-wrap::-webkit-scrollbar {
        display: none;
    }

    .dl-date-tag {
        flex-shrink: 0;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
        transition: transform 0.15s;
    }

    .dl-date-tag:active {
        transform: scale(0.95);
    }

    /* NOTE: 有紀錄但尚未完成簽核 — 黃色 */
    .dl-date-pending {
        background: rgba(230, 180, 30, 0.25);
        color: #e6b41e;
        border: 1px solid rgba(230, 180, 30, 0.4);
    }

    /* NOTE: 三級簽核完成，已產生報表 — 綠色 */
    .dl-date-done {
        background: rgba(63, 185, 80, 0.25);
        color: #3fb950;
        border: 1px solid rgba(63, 185, 80, 0.4);
    }

    /* NOTE: 當前選中的日期 — 加粗邊框 */
    .dl-date-active {
        border-width: 2px;
        box-shadow: 0 0 6px rgba(255, 255, 255, 0.15);
    }

    .dl-date-pending.dl-date-active {
        border-color: #e6b41e;
    }

    .dl-date-done.dl-date-active {
        border-color: #3fb950;
    }

    /* ========== Section 區塊 ========== */
    .dl-section {
        margin-top: 20px;
    }

    .dl-section-header {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 15px;
        font-weight: 700;
        margin-bottom: 12px;
    }

    .dl-count-badge {
        font-size: 10px;
        padding: 2px 8px;
        border-radius: 10px;
        font-weight: 600;
        margin-left: 6px;
    }

    .dl-section-body {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* ========== 基本資訊列 ========== */
    .dl-info-row {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        background: var(--bg-card);
        border: 1px solid var(--color-border);
        border-radius: 10px;
        overflow: hidden;
    }

    .dl-info-label {
        font-size: 11px;
        color: var(--color-text-secondary);
        width: 56px;
        flex-shrink: 0;
    }

    .dl-info-value {
        flex: 1;
        font-size: 13px;
        min-width: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    /* NOTE: 天氣標籤 */
    .dl-weather-tag {
        flex: 1;
        text-align: center;
        font-size: 11px;
        padding: 2px 6px;
        border-radius: 6px;
    }

    .dl-weather-am {
        background: rgba(210, 153, 34, 0.15);
        color: #d29922;
    }

    .dl-weather-pm {
        background: rgba(88, 166, 255, 0.15);
        color: #58a6ff;
    }

    /* ========== 工種/機具卡片 ========== */
    .dl-worker-card {
        background: var(--bg-card);
        border: 1px solid var(--color-border);
        border-radius: 10px;
        padding: 12px 14px;
        transition: border-color 0.2s;
    }

    .dl-wc-top {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .dl-wc-name {
        font-weight: 600;
        font-size: 14px;
        flex: 1;
    }

    .dl-wc-badge {
        font-size: 11px;
        padding: 2px 8px;
        border-radius: 10px;
        font-weight: 600;
    }

    .dl-wc-badge-worker {
        background: rgba(63, 185, 80, 0.15);
        color: #3fb950;
    }

    .dl-wc-badge-tool {
        background: rgba(210, 168, 255, 0.15);
        color: #d2a8ff;
    }

    .dl-wc-meta {
        display: flex;
        gap: 16px;
        margin-top: 6px;
        color: var(--color-text-secondary);
        font-size: 12px;
    }

    .dl-wc-meta i {
        margin-right: 4px;
        opacity: 0.6;
    }

    /* NOTE: 刪除按鈕 */
    .dl-wc-del-btn {
        display: none;
        width: 28px;
        height: 28px;
        border-radius: 6px;
        border: 0;
        font-size: 12px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        background: rgba(240, 78, 78, 0.12);
        color: var(--color-danger);
        transition: background 0.2s;
    }

    body.edit-mode .dl-wc-del-btn {
        display: flex;
    }

    /* NOTE: 編輯模式切換 — view/edit 內容 */
    .edit-only {
        display: none !important;
    }

    body.edit-mode .edit-only {
        display: flex !important;
    }

    body.edit-mode .view-only {
        display: none !important;
    }

    /* NOTE: 卡片 inline 編輯區 */
    .dl-wc-edit-row {
        display: none;
        flex-direction: column;
        gap: 6px;
        margin-top: 8px;
    }

    body.edit-mode .dl-wc-edit-row {
        display: flex;
    }

    body.edit-mode .dl-wc-meta {
        display: none;
    }

    body.edit-mode .dl-wc-name,
    body.edit-mode .dl-wc-badge {
        display: none;
    }

    .dl-wc-edit-field {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .dl-wc-edit-field label {
        font-size: 11px;
        color: var(--color-text-secondary);
        width: 48px;
        flex-shrink: 0;
    }

    .dl-wc-edit-field input,
    .dl-wc-edit-field select {
        flex: 1;
        background: var(--bg-primary);
        border: 1px solid var(--color-border);
        color: var(--color-text);
        padding: 7px 10px;
        border-radius: 6px;
        font-size: 12px;
        font-family: inherit;
    }

    .dl-wc-edit-field input:focus,
    .dl-wc-edit-field select:focus {
        outline: none;
        border-color: var(--color-accent);
    }

    /* ========== 基本資訊 inline 編輯 ========== */
    .dl-info-edit {
        flex: 1;
        background: var(--bg-primary);
        border: 1px solid var(--color-border);
        color: var(--color-text);
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 13px;
        font-family: inherit;
    }

    .dl-info-edit:focus {
        outline: none;
        border-color: var(--color-accent);
    }

    .dl-weather-select {
        width: calc(50% - 3px);
        flex: none;
        min-width: 0;
        box-sizing: border-box;
        background: var(--bg-primary);
        border: 1px solid var(--color-border);
        color: var(--color-text);
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 12px;
        font-family: inherit;
    }

    .dl-weather-edit-row {
        display: flex;
        gap: 6px;
        flex: 1;
    }

    /* ========== Section 新增按鈕 ========== */
    .dl-section-add-btn {
        display: none;
        width: 100%;
        padding: 10px;
        border-radius: 10px;
        border: 1.5px dashed var(--color-border);
        background: transparent;
        color: var(--color-accent);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: border-color 0.2s, background 0.2s;
    }

    body.edit-mode .dl-section-add-btn {
        display: flex;
    }

    .dl-section-add-btn:active {
        background: rgba(88, 166, 255, 0.08);
        border-color: var(--color-accent);
    }

    /* ========== 施工報告 ========== */
    .dl-report-text {
        background: var(--bg-card);
        padding: 14px;
        border-radius: 10px;
        border: 1px solid var(--color-border);
        font-size: 13px;
        color: var(--color-text-secondary);
        line-height: 1.6;
    }

    .dl-report-edit {
        display: none;
        width: 100%;
        min-height: 100px;
        background: var(--bg-primary);
        border: 1px solid var(--color-border);
        color: var(--color-text);
        padding: 12px;
        border-radius: 10px;
        font-size: 13px;
        font-family: inherit;
        resize: vertical;
        line-height: 1.6;
    }

    .dl-report-edit:focus {
        outline: none;
        border-color: var(--color-accent);
    }

    body.edit-mode .dl-report-text {
        display: none;
    }

    body.edit-mode .dl-report-edit {
        display: block;
    }

    /* ========== 施工圖 — 2 列網格 ========== */
    .dl-photo-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .dl-photo-thumb {
        position: relative;
        background: var(--bg-card);
        border: 1px solid var(--color-border);
        border-radius: 10px;
        overflow: hidden;
        cursor: pointer;
    }

    .dl-thumb-img {
        width: 100%;
        aspect-ratio: 4/3;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-input);
    }

    .dl-thumb-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .dl-thumb-cap {
        padding: 6px 8px;
        font-size: 11px;
        color: var(--color-text-secondary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dl-thumb-cap-edit {
        display: none;
        width: 100%;
        background: var(--bg-primary);
        border: none;
        border-top: 1px solid var(--color-border);
        color: var(--color-text);
        padding: 6px 8px;
        font-size: 11px;
        font-family: inherit;
    }

    body.edit-mode .dl-thumb-cap {
        display: none;
    }

    body.edit-mode .dl-thumb-cap-edit {
        display: block;
    }

    .dl-visibility-dot {
        position: absolute;
        top: 6px;
        right: 6px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 9px;
        color: #fff;
    }

    .dl-vis-on {
        background: var(--color-success);
    }

    .dl-vis-off {
        background: var(--color-danger);
        opacity: 0.7;
    }

    .dl-photo-add-btn {
        display: none;
        aspect-ratio: 4/3;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 6px;
        border: 1.5px dashed var(--color-border);
        border-radius: 10px;
        background: transparent;
        color: var(--color-accent);
        font-size: 12px;
        cursor: pointer;
    }

    body.edit-mode .dl-photo-add-btn {
        display: flex;
    }

    .dl-photo-hint {
        font-size: 11px;
        color: var(--color-text-secondary);
        margin-top: 8px;
        text-align: center;
    }

    /* ========== Lightbox ========== */
    .dl-lightbox-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.92);
        z-index: 200;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .dl-lightbox-overlay.open {
        display: flex;
    }

    .dl-lightbox-close {
        position: absolute;
        top: 16px;
        right: 16px;
        background: transparent;
        border: 0;
        color: #fff;
        font-size: 24px;
        cursor: pointer;
        z-index: 201;
    }

    .dl-lightbox-img {
        width: 90%;
        max-height: 60vh;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    .dl-lightbox-img img {
        max-width: 100%;
        max-height: 100%;
        border-radius: 10px;
    }

    .dl-img-counter {
        position: absolute;
        top: 10px;
        left: 10px;
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
        padding: 3px 10px;
        border-radius: 12px;
        font-size: 11px;
    }

    .dl-lightbox-meta {
        width: 90%;
        margin-top: 16px;
    }

    .dl-lightbox-meta input {
        width: 100%;
        background: var(--bg-input);
        border: 1px solid var(--color-border);
        color: var(--color-text);
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 14px;
        font-family: inherit;
    }

    .dl-lightbox-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 12px;
    }

    .dl-toggle-row {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #fff;
        font-size: 13px;
    }

    .dl-toggle-switch {
        width: 42px;
        height: 24px;
        border-radius: 12px;
        background: #484f58;
        position: relative;
        cursor: pointer;
        transition: background 0.2s;
    }

    .dl-toggle-switch::after {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #fff;
        transition: left 0.2s;
    }

    .dl-toggle-switch.on {
        background: var(--color-success);
    }

    .dl-toggle-switch.on::after {
        left: 20px;
    }

    .dl-btn-delete-photo {
        background: rgba(240, 78, 78, 0.15);
        color: var(--color-danger);
        border: 0;
        padding: 8px 14px;
        border-radius: 8px;
        font-size: 12px;
        cursor: pointer;
    }

    .dl-lightbox-nav {
        display: flex;
        gap: 12px;
        margin-top: 16px;
    }

    .dl-lightbox-nav button {
        flex: 1;
        background: var(--bg-input);
        color: var(--color-text-secondary);
        border: 0;
        padding: 12px;
        border-radius: 10px;
        font-size: 13px;
        cursor: pointer;
    }

    /* ========== 簽核 Timeline ========== */
    .dl-sign-timeline {
        position: relative;
        padding-left: 22px;
    }

    .dl-sign-timeline::before {
        content: '';
        position: absolute;
        left: 12px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: var(--color-border);
    }

    .dl-sign-step {
        position: relative;
        margin-bottom: 18px;
        display: flex;
        gap: 12px;
        align-items: flex-start;
    }

    .dl-sign-step:last-child {
        margin-bottom: 0;
    }

    .dl-sign-dot {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 10px;
        flex-shrink: 0;
        position: relative;
        z-index: 1;
    }

    .dl-dot-done {
        background: var(--color-success);
        color: #fff;
    }

    .dl-dot-current {
        background: var(--color-warning);
        color: #000;
    }

    .dl-dot-pending {
        background: var(--bg-input);
        color: var(--color-text-secondary);
    }

    .dl-sign-info {
        flex: 1;
    }

    .dl-sign-role {
        font-weight: 600;
        font-size: 13px;
    }

    .dl-sign-name {
        font-size: 12px;
        color: var(--color-text-secondary);
    }

    .dl-sign-time {
        font-size: 11px;
        color: var(--color-text-secondary);
        margin-top: 2px;
    }

    .dl-sign-actions {
        display: flex;
        gap: 8px;
        margin-top: 16px;
    }

    .dl-sign-actions button {
        flex: 1;
        padding: 12px;
        border-radius: 10px;
        border: 0;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }

    .dl-btn-approve {
        background: var(--color-success);
        color: #fff;
    }

    .dl-btn-reject {
        background: rgba(240, 78, 78, 0.12);
        color: var(--color-danger);
    }

    .dl-btn-pdf {
        background: var(--color-accent);
        color: #fff;
    }

    /* ========== 退簽核 Bottom Sheet ========== */
    .dl-sheet-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 190;
    }

    .dl-sheet-overlay.open {
        display: block;
    }

    .dl-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--color-border);
        border-radius: 16px 16px 0 0;
        padding: 20px 16px 32px;
        z-index: 191;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .dl-sheet-overlay.open .dl-sheet {
        transform: translateY(0);
    }

    .dl-sheet-title {
        font-size: 16px;
        font-weight: 700;
        text-align: center;
        margin-bottom: 16px;
        color: var(--color-danger);
    }

    .dl-sheet textarea {
        width: 100%;
        min-height: 80px;
        background: var(--bg-primary);
        border: 1px solid var(--color-border);
        color: var(--color-text);
        padding: 12px;
        border-radius: 10px;
        font-size: 14px;
        font-family: inherit;
        resize: vertical;
    }

    .dl-sheet textarea:focus {
        outline: none;
        border-color: var(--color-accent);
    }

    .dl-sheet-btns {
        display: flex;
        gap: 10px;
        margin-top: 16px;
    }

    .dl-sheet-btns button {
        flex: 1;
        padding: 14px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        border: 0;
    }

    .dl-sheet-btns .dl-btn-cancel {
        background: var(--bg-input);
        color: var(--color-text-secondary);
    }

    .dl-sheet-btns .dl-btn-confirm-reject {
        background: var(--color-danger);
        color: #fff;
    }

    /* ========== 底部儲存列 ========== */
    .dl-save-bar {
        display: none;
        position: fixed;
        bottom: 60px;
        left: 0;
        right: 0;
        max-width: 412px;
        margin: 0 auto;
        padding: 12px 16px;
        background: var(--bg-secondary);
        border-top: 1px solid var(--color-border);
        gap: 10px;
        z-index: 100;
    }

    body.edit-mode .dl-save-bar {
        display: flex;
    }

    .dl-btn-save {
        flex: 1;
        padding: 12px;
        border-radius: 10px;
        border: 0;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }

    .dl-btn-save-draft {
        background: var(--bg-input);
        color: var(--color-text);
    }

    .dl-btn-save-submit {
        background: var(--color-accent);
        color: #fff;
    }

    /* ========== Toast 提示 ========== */
    .dl-toast {
        position: fixed;
        bottom: 130px;
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        background: rgba(22, 27, 34, 0.95);
        color: #fff;
        padding: 10px 24px;
        border-radius: 20px;
        font-size: 13px;
        max-width: 80%;
        text-align: center;
        z-index: 300;
        opacity: 0;
        transition: opacity 0.3s, transform 0.3s;
        pointer-events: none;
    }

    .dl-toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    /* ========== Lightbox 照片儲存按鈕 ========== */
    .dl-btn-save-photo {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 6px 14px;
        border-radius: 8px;
        border: 1px solid #58a6ff;
        background: rgba(88, 166, 255, 0.12);
        color: #58a6ff;
        font-size: 13px;
        font-family: inherit;
        cursor: pointer;
    }

    .dl-btn-save-photo:active {
        background: rgba(88, 166, 255, 0.25);
    }

    .dl-btn-delete-photo {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 6px 14px;
        border-radius: 8px;
        border: 1px solid var(--color-danger);
        background: rgba(248, 81, 73, 0.12);
        color: var(--color-danger);
        font-size: 13px;
        font-family: inherit;
        cursor: pointer;
    }

    .dl-btn-delete-photo:active {
        background: rgba(248, 81, 73, 0.25);
    }

    /* ========== 照片上傳 Modal ========== */
    .dl-photo-modal-overlay {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 3000;
        background: rgba(0, 0, 0, 0.6);
        justify-content: center;
        align-items: center;
    }

    .dl-photo-modal-overlay.open {
        display: flex;
    }

    .dl-photo-modal {
        background: var(--bg-card);
        border: 1px solid var(--color-border);
        border-radius: 16px;
        padding: 24px 20px;
        width: 85%;
        max-width: 320px;
        text-align: center;
        animation: modalPopIn 0.25s ease-out;
    }

    @keyframes modalPopIn {
        from {
            opacity: 0;
            transform: scale(0.85);
        }

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

    .dl-photo-modal-title {
        font-size: 17px;
        font-weight: 600;
        margin-bottom: 20px;
        color: var(--color-text);
    }

    .dl-photo-modal-body {
        display: flex;
        gap: 12px;
        margin-bottom: 16px;
    }

    .dl-photo-modal-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 20px 10px;
        background: var(--bg-primary);
        border: 1.5px solid var(--color-border);
        border-radius: 12px;
        color: var(--color-text);
        font-size: 13px;
        font-family: inherit;
        cursor: pointer;
        transition: border-color 0.2s, background 0.2s;
    }

    .dl-photo-modal-btn:active {
        border-color: var(--color-accent);
        background: rgba(88, 166, 255, 0.08);
    }

    .dl-photo-modal-cancel {
        width: 100%;
        padding: 10px;
        border: none;
        border-radius: 10px;
        background: transparent;
        color: var(--color-text-secondary);
        font-size: 14px;
        font-family: inherit;
        cursor: pointer;
    }

    .dl-photo-modal-cancel:active {
        background: rgba(255, 255, 255, 0.05);
    }

    /* ========== 上傳中 Loading ========== */
    .dl-upload-loading {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 3100;
        background: rgba(0, 0, 0, 0.6);
        justify-content: center;
        align-items: center;
    }

    .dl-upload-loading.open {
        display: flex;
    }

    .dl-upload-loading-box {
        background: var(--bg-card);
        border: 1px solid var(--color-border);
        border-radius: 14px;
        padding: 30px 40px;
        text-align: center;
        color: var(--color-text);
    }
}