    :root {
      --bg-primary: #0a0e17;
      --bg-surface: #121929;
      --bg-card: #1b253b;
      --bg-card-hover: #23304d;
      --border-color: #2b3a5c;
      --border-focus: #3b82f6;

      --accent-blue: #3b82f6;
      --accent-blue-hover: #2563eb;
      --status-in: #10b981;
      /* 在證物室 */
      --status-out: #f59e0b;
      /* 鑑識中 / 領回 */
      --status-alert: #f87171;
      /* 在外面警示 (調整為珊瑚紅，對比度 6.27:1 通過 WCAG 2.1 AA) */
      --status-new: #8b5cf6;
      /* 新收案 */

      --text-main: #f8fafc;
      --text-muted: #94a3b8;
      --text-dim: #8899ac;
      /* 次要/時間文字 (調亮至 5.0:1 通過 WCAG 2.1 AA) */

      --radius-sm: 8px;
      --radius-md: 14px;
      --radius-lg: 20px;
      --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
    }

    html, body {
      overscroll-behavior-y: contain;
    }

    body {
      font-family: 'Noto Sans TC', sans-serif;
      background: var(--bg-primary);
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      padding-bottom: 0;
      padding-left: env(safe-area-inset-left, 0px);
      padding-right: env(safe-area-inset-right, 0px);
    }

    /* 手機版專屬頂部 Header (避開 iPhone 瀏海與動態島狀態列) */
    .mobile-header {
      background: rgba(18, 25, 41, 0.96);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--border-color);
      padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
      padding-bottom: 12px;
      padding-left: max(16px, env(safe-area-inset-left, 0px));
      padding-right: max(16px, env(safe-area-inset-right, 0px));
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: sticky;
      top: 0;
      z-index: 90;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .brand-icon {
      width: 38px;
      height: 38px;
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
      background: #ffffff;
      border: 1px solid rgba(255, 255, 255, 0.15);
      flex-shrink: 0;
    }

    .brand-icon img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .brand-title {
      font-weight: 800;
      font-size: 1.05rem;
      letter-spacing: 0.5px;
    }

    .header-user-badge {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 999px;
      padding: 5px 12px;
      font-size: 0.8rem;
    }

    .user-indicator {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--status-in);
      box-shadow: 0 0 8px var(--status-in);
      flex-shrink: 0;
    }

    .btn-logout {
      background: none;
      border: none;
      color: var(--status-alert);
      font-weight: 700;
      font-size: 0.75rem;
      cursor: pointer;
      margin-left: 4px;
      padding: 2px 4px;
    }

    /* 頁面整體結構容器 */
    .app-layout {
      display: flex;
      flex-direction: column;
      flex: 1;
      width: 100%;
    }

    .desktop-only {
      display: none !important;
    }

    .mobile-only {
      display: block;
    }

    span.mobile-only {
      display: inline-block;
    }

    /* ========================================================
       手機版版面樣式 (< 768px)：
       - 導覽頁籤固定於螢幕最下方 (Bottom Navigation Bar)
       - 主內容區底部留白避讓下方功能列與 iPhone Home Indicator
       ======================================================== */
    @media (max-width: 767px) {

      /* 手機版通知顯示移至頂部導覽列正下方，避開 iPhone 瀏海與頂部按鈕，絕不被遮蔽 */
      #toast-container {
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 68px) !important;
        bottom: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 32px) !important;
        max-width: 480px !important;
        z-index: 10020 !important;
        pointer-events: none !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 8px !important;
      }

      /* 需求 3：手機版不顯示卡片勾選方塊按鈕，使清單與個人案件版面更乾淨清爽 */
      .card-check-indicator {
        display: none !important;
      }

      .mobile-only {
        display: block !important;
      }

      span.mobile-only {
        display: inline-block !important;
      }

      .desktop-only {
        display: none !important;
      }

      .sidebar {
        display: contents;
      }

      .tabs-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        display: flex;
        justify-content: space-around;
        background: rgba(18, 25, 41, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border-color);
        padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px)) 12px;
        gap: 6px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
      }

      .tab-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 4px;
        background: transparent;
        border: none;
        border-radius: var(--radius-sm);
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.2s ease;
      }

      .tab-btn .tab-icon {
        font-size: 1.25rem;
        line-height: 1;
      }

      .tab-btn .tab-label {
        font-size: 0.72rem;
        font-weight: 700;
      }

      .tab-btn.active {
        color: var(--accent-blue);
        background: rgba(59, 130, 246, 0.12);
      }

      .main-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        width: 100%;
      }

      main {
        flex: 1;
        max-width: 640px;
        width: 100%;
        margin: 0 auto;
        padding: 16px 16px calc(88px + env(safe-area-inset-bottom, 0px)) 16px;
        display: flex;
        flex-direction: column;
        gap: 16px;
      }
    }

    /* ========================================================
       電腦版版面樣式 (>= 768px)：
       - 導覽列移到左側垂直側邊欄 (Left Sidebar)
       - 主內容區居中並擴展寬度
       ======================================================== */
    @media (min-width: 768px) {
      .mobile-header {
        display: none !important;
      }

      .mobile-only {
        display: none !important;
      }

      .desktop-only {
        display: flex !important;
      }

      span.desktop-only {
        display: inline-flex !important;
      }

      .app-layout {
        flex-direction: row;
        min-height: 100vh;
      }

      .sidebar {
        width: 260px;
        min-width: 260px;
        background: var(--bg-surface);
        border-right: 1px solid var(--border-color);
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        position: sticky;
        top: 0;
        height: 100vh;
        z-index: 50;
        padding: 24px 16px;
      }

      .sidebar-brand {
        display: flex;
        align-items: center;
        gap: 12px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 16px;
      }

      .tabs-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
        border: none;
        background: transparent;
        padding: 0;
        box-shadow: none;
        flex: 1;
      }

      .tab-btn {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 14px;
        padding: 12px 18px;
        font-size: 0.95rem;
        font-weight: 700;
        border-radius: var(--radius-md);
        border: 1px solid transparent;
        background: transparent;
        color: var(--text-muted);
        transition: all 0.2s;
        cursor: pointer;
        width: 100%;
        text-align: left;
      }

      .tab-btn .tab-icon {
        font-size: 1.25rem;
        line-height: 1;
      }

      .tab-btn .tab-label {
        font-size: 0.92rem;
        font-weight: 700;
      }

      .tab-btn:hover {
        background: var(--bg-card-hover);
        color: var(--text-main);
      }

      .tab-btn.active {
        background: var(--accent-blue);
        color: #ffffff;
        box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
      }

      .sidebar-footer {
        padding-top: 16px;
        border-top: 1px solid var(--border-color);
      }

      .main-wrapper {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        overflow-y: auto;
      }

      main {
        max-width: 860px;
        width: 100%;
        margin: 0 auto;
        padding: 32px 24px 60px 24px;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 16px;
      }
    }

    .tab-content {
      display: none;
      flex-direction: column;
      gap: 16px;
    }

    .tab-content.active {
      display: flex;
    }

    .card {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      padding: 18px;
      box-shadow: var(--shadow);
    }

    /* 相機視窗與掃描成功特效 */
    .camera-box {
      position: relative;
      background: #000;
      border-radius: var(--radius-md);
      overflow: hidden;
      aspect-ratio: 1 / 1;
      max-height: 320px;
      margin: 0 auto;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px solid var(--border-color);
      transition: border-color 0.2s;
    }

    .camera-box.scan-success-border {
      border-color: var(--status-in) !important;
      box-shadow: 0 0 25px rgba(16, 185, 129, 0.7);
    }

    .camera-box.scan-error-border {
      border-color: #ef4444 !important;
      box-shadow: 0 0 25px rgba(239, 68, 68, 0.85), inset 0 0 15px rgba(239, 68, 68, 0.45);
    }

    #reader {
      width: 100% !important;
      height: 100% !important;
      border: none !important;
    }

    #reader video {
      object-fit: cover !important;
      border-radius: var(--radius-md);
    }

    .laser-line {
      position: absolute;
      left: 10%;
      right: 10%;
      height: 2px;
      background: #38bdf8;
      box-shadow: 0 0 10px #38bdf8, 0 0 20px #38bdf8;
      animation: laserMove 2.2s infinite ease-in-out;
      pointer-events: none;
      z-index: 10;
    }

    @keyframes laserMove {
      0% {
        top: 12%;
        opacity: 0.2;
      }

      50% {
        top: 88%;
        opacity: 1;
      }

      100% {
        top: 12%;
        opacity: 0.2;
      }
    }

    /* 掃描成功全螢幕瞬間閃綠光反饋 */
    .scan-flash-overlay {
      position: absolute;
      inset: 0;
      background: rgba(16, 185, 129, 0.5);
      border: 5px solid #10b981;
      border-radius: var(--radius-md);
      opacity: 0;
      pointer-events: none;
      z-index: 30;
    }

    .scan-flash-overlay.active {
      animation: flashAnim 0.5s ease-out forwards;
    }

    @keyframes flashAnim {
      0% {
        opacity: 1;
      }

      50% {
        opacity: 0.6;
      }

      100% {
        opacity: 0;
      }
    }

    /* 掃描即時辨識成功提示條 */
    .scan-notify-banner {
      display: none;
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.25));
      border: 1.5px solid var(--status-in);
      border-radius: var(--radius-md);
      padding: 12px 14px;
      align-items: center;
      gap: 10px;
      animation: bounceIn 0.3s ease-out;
    }

    @keyframes bounceIn {
      from {
        transform: scale(0.95);
        opacity: 0;
      }

      to {
        transform: scale(1);
        opacity: 1;
      }
    }

    .scanner-ctrls {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 12px;
    }

    .btn {
      padding: 10px 16px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-color);
      background: var(--bg-card);
      color: var(--text-main);
      font-weight: 700;
      font-size: 0.88rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: all 0.15s ease;
    }

    .btn:hover:not(:disabled) {
      background: var(--bg-card-hover);
      border-color: var(--border-focus);
    }

    .btn-primary {
      background: linear-gradient(135deg, #2563eb, #1d4ed8);
      border-color: #3b82f6;
      color: #fff;
    }

    .btn-success {
      background: linear-gradient(135deg, #059669, #047857);
      border-color: #10b981;
      color: #fff;
    }

    /* 掃描狀態面板 (狀態機核心) */
    .status-panel {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      position: relative;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      padding: 4px 12px;
      border-radius: 999px;
      font-size: 0.82rem;
      font-weight: 800;
      letter-spacing: 0.3px;
    }

    .badge-room {
      background: rgba(16, 185, 129, 0.15);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.4);
    }

    .badge-outside {
      background: rgba(239, 68, 68, 0.15);
      color: #f87171;
      border: 1px solid rgba(239, 68, 68, 0.4);
    }

    .badge-new {
      background: rgba(139, 92, 246, 0.15);
      color: #c084fc;
      border: 1px solid rgba(139, 92, 246, 0.4);
    }

    .badge-wait {
      background: rgba(148, 163, 184, 0.15);
      color: #94a3b8;
      border: 1px solid rgba(148, 163, 184, 0.3);
    }

    /* 狀態 C：領取人醒目警示盒 */
    .taker-alert-box {
      background: rgba(239, 68, 68, 0.12);
      border: 1.5px solid rgba(239, 68, 68, 0.5);
      border-radius: var(--radius-md);
      padding: 14px;
      display: flex;
      align-items: flex-start;
      gap: 10px;
      box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
    }

    .taker-alert-box .alert-icon {
      font-size: 1.5rem;
      line-height: 1;
    }

    .taker-alert-title {
      font-size: 0.98rem;
      font-weight: 800;
      color: #fca5a5;
    }

    .taker-alert-desc {
      font-size: 0.86rem;
      color: #f1f5f9;
      margin-top: 4px;
      line-height: 1.4;
    }

    /* 動態動作按鈕區 */
    .action-options-box {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .dynamic-action-btn {
      padding: 16px 14px;
      border-radius: var(--radius-md);
      border: 2px solid var(--border-color);
      background: var(--bg-card);
      color: #fff;
      font-size: 1.05rem;
      font-weight: 800;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      transition: all 0.2s ease;
    }

    .dynamic-action-btn:hover {
      background: var(--bg-card-hover);
    }

    .dynamic-action-btn.selected {
      box-shadow: 0 0 18px rgba(59, 130, 246, 0.5);
    }

    .dynamic-action-btn.btn-action-new.selected {
      border-color: var(--status-new);
      background: rgba(139, 92, 246, 0.25);
      color: #d8b4fe;
    }

    .dynamic-action-btn.btn-action-lab.selected {
      border-color: #f59e0b;
      background: rgba(245, 158, 11, 0.25);
      color: #fcd34d;
    }

    .dynamic-action-btn.btn-action-take.selected {
      border-color: #06b6d4;
      background: rgba(6, 182, 212, 0.25);
      color: #67e8f9;
    }

    .dynamic-action-btn.btn-action-in.selected {
      border-color: var(--status-in);
      background: rgba(16, 185, 129, 0.25);
      color: #6ee7b7;
    }

    .form-control {
      width: 100%;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      color: #fff;
      padding: 12px 14px;
      font-size: 0.95rem;
      outline: none;
      font-family: inherit;
    }

    .form-control:focus {
      border-color: var(--border-focus);
    }

    /* 案件清單單位按鈕篩選 (隊 / 分隊 / 個人 單選) */
    .unit-filter-container {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 12px;
    }

    .unit-filter-btn-group {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      background: var(--bg-card);
      border: 1.5px solid var(--border-color);
      border-radius: var(--radius-sm);
      padding: 4px;
      gap: 6px;
    }

    .unit-filter-btn {
      padding: 9px 10px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-size: 0.95rem;
      font-weight: 800;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex;
      align-items: center;
      justify-content: center;
      letter-spacing: 1px;
    }

    .unit-filter-btn:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.05);
    }

    .unit-filter-btn.active {
      background: var(--accent-blue) !important;
      color: #ffffff !important;
      box-shadow: 0 0 14px rgba(59, 130, 246, 0.5);
    }

    /* 個人案件子頁籤切換群組 (鑑識案件 / 領出案件) */
    .my-cases-subtabs-group {
      display: grid;
      grid-template-columns: 1fr 1fr;
      background: var(--bg-card);
      border: 1.5px solid var(--border-color);
      border-radius: var(--radius-sm);
      padding: 4px;
      gap: 6px;
      margin-bottom: 12px;
    }

    .my-cases-subtab-btn {
      padding: 9px 12px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-size: 0.92rem;
      font-weight: 800;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .my-cases-subtab-btn:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.05);
    }

    .my-cases-subtab-btn.active {
      background: var(--accent-blue) !important;
      color: #ffffff !important;
      box-shadow: 0 0 14px rgba(59, 130, 246, 0.5);
    }

    /* 鑑識案件狀態細項篩選 (採證中 / 待領取) */
    .forensic-filter-group {
      display: grid;
      grid-template-columns: 1fr 1fr;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      padding: 3px;
      gap: 6px;
      margin-bottom: 10px;
    }

    .forensic-filter-btn {
      padding: 7px 10px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text-muted);
      font-size: 0.85rem;
      font-weight: 700;
      border-radius: 5px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .forensic-filter-btn:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.05);
    }

    .forensic-filter-btn.active {
      color: #ffffff !important;
      font-weight: 800;
    }

    .forensic-filter-btn.active#btn-filter-forensic-progress {
      background: #dc2626 !important;
      border-color: #ef4444 !important;
      box-shadow: 0 0 12px rgba(220, 38, 38, 0.4);
    }

    .forensic-filter-btn.active#btn-filter-forensic-pending {
      background: #059669 !important;
      border-color: #10b981 !important;
      box-shadow: 0 0 12px rgba(5, 150, 105, 0.4);
    }


    .unit-filter-indicator {
      font-size: 0.78rem;
      color: var(--text-dim);
      padding-left: 4px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .select-all-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 12px;
      background: rgba(59, 130, 246, 0.08);
      border: 1px solid rgba(59, 130, 246, 0.22);
      border-radius: var(--radius-sm);
      margin-bottom: 12px;
    }

    .cases-scroll-container {
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-height: clamp(380px, 62vh, 680px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      padding-right: 6px;
      padding-bottom: 70px;
      scrollbar-width: thin;
      scrollbar-color: var(--accent-blue) rgba(255, 255, 255, 0.08);
    }

    .cases-scroll-container::-webkit-scrollbar {
      width: 6px;
    }

    .cases-scroll-container::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 4px;
    }

    .cases-scroll-container::-webkit-scrollbar-thumb {
      background: var(--accent-blue);
      border-radius: 4px;
    }

    .cases-scroll-container::-webkit-scrollbar-thumb:hover {
      background: #60a5fa;
    }

    body.theme-light .cases-scroll-container {
      scrollbar-color: var(--accent-blue) rgba(0, 0, 0, 0.06);
    }

    body.theme-light .cases-scroll-container::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.05);
    }

    body.theme-light .cases-scroll-container::-webkit-scrollbar-thumb {
      background: var(--accent-blue);
    }

    /* 卡片點選亮起與多選效果 */
    .case-card-item {
      background: var(--bg-card);
      border: 1.5px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 12px 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      user-select: none;
      transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      position: relative;
    }

    .case-card-item:hover {
      background: var(--bg-card-hover);
      border-color: rgba(59, 130, 246, 0.45);
      transform: translateY(-1px);
    }

    .case-card-item.selected {
      background: rgba(59, 130, 246, 0.18) !important;
      border-color: #3b82f6 !important;
      box-shadow: 0 0 16px rgba(59, 130, 246, 0.5), inset 0 0 0 1.5px #3b82f6 !important;
      transform: translateY(-1px);
    }

    .case-card-item.outside {
      border-left: 5px solid var(--status-alert);
    }

    .case-card-item.inroom {
      border-left: 5px solid var(--status-in);
    }

    .card-check-indicator {
      width: 22px;
      height: 22px;
      border-radius: 6px;
      border: 2px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 900;
      color: transparent;
      flex-shrink: 0;
      background: rgba(0, 0, 0, 0.25);
      transition: all 0.2s ease;
    }

    .case-card-item.selected .card-check-indicator {
      background: var(--accent-blue);
      border-color: var(--accent-blue);
      color: #fff;
      box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    }

    /* 全選按鈕專屬核取方框 (未選為方框，全選為打勾) */
    .select-all-box {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 17px;
      height: 17px;
      border-radius: 4px;
      border: 1.8px solid currentColor;
      font-size: 11px;
      font-weight: 900;
      line-height: 1;
      vertical-align: middle;
      transition: all 0.2s ease;
      background: rgba(0, 0, 0, 0.2);
      color: transparent;
      flex-shrink: 0;
    }

    .select-all-box.checked {
      background: var(--accent-blue);
      border-color: var(--accent-blue);
      color: #ffffff;
      box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
    }

    /* 案件卡片標籤 (深色模式預設) */
    .case-tag-agency {
      background: rgba(245, 158, 11, 0.16);
      color: #fde68a;
      border: 1px solid rgba(245, 158, 11, 0.45);
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 0.76rem;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }

    .case-tag-agency .case-tag-officer-name {
      color: #fbbf24;
      font-weight: 700;
    }

    .case-tag-officer {
      background: rgba(245, 158, 11, 0.18);
      color: #fde68a;
      border: 1px solid rgba(245, 158, 11, 0.45);
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 0.76rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }

    .case-tag-officer b {
      color: #fbbf24;
      font-weight: 700;
    }

    .case-tag-reason {
      background: rgba(129, 140, 248, 0.18);
      color: #e0e7ff;
      border: 1px solid rgba(129, 140, 248, 0.45);
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 0.76rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }

    .case-tag-reason b {
      color: #c7d2fe;
      font-weight: 700;
    }

    .case-tag-subteam {
      background: rgba(59, 130, 246, 0.18);
      color: #93c5fd;
      border: 1px solid rgba(59, 130, 246, 0.3);
      padding: 1.5px 6px;
      border-radius: 4px;
      font-size: 0.72rem;
      font-weight: 500;
    }

    .case-tag-devices {
      background: rgba(16, 185, 129, 0.18);
      color: #6ee7b7;
      border: 1px solid rgba(16, 185, 129, 0.3);
      padding: 1.5px 6px;
      border-radius: 4px;
      font-size: 0.72rem;
      font-weight: 500;
    }

    .case-tag-note {
      background: rgba(255, 255, 255, 0.08);
      color: #cbd5e1;
      border: 1px solid rgba(255, 255, 255, 0.18);
      padding: 1.5px 6px;
      border-radius: 4px;
      font-size: 0.72rem;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      gap: 3px;
      max-width: 200px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* 頂部精簡圓形圖示按鈕 */
    .btn-icon-circle {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      color: var(--text-main);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.9rem;
      cursor: pointer;
      transition: all 0.2s ease;
      flex-shrink: 0;
      padding: 0;
      overflow: hidden;
    }

    .btn-icon-circle:hover {
      background: var(--bg-card-hover);
      border-color: var(--border-focus);
    }

    .btn-icon-circle:active {
      transform: scale(0.92);
    }

    /* 底部浮動狀態變更操作列 (支援可收合精簡模式，案件多時可向上延伸直到接近 Header 再滑動) */
    .batch-floating-bar {
      position: fixed;
      bottom: calc(70px + env(safe-area-inset-bottom, 0px));
      left: 50%;
      transform: translateX(-50%) translateY(140%);
      width: calc(100% - 24px);
      max-width: 600px;
      /* 向上延伸高度上限：直到接近手機頂部 Header (保留安全間距約 65px~70px) */
      max-height: calc(100vh - 75px - 65px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
      background: rgba(18, 25, 41, 0.98);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1.5px solid var(--accent-blue);
      border-radius: var(--radius-md);
      padding: 10px 14px;
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 24px rgba(59, 130, 246, 0.35);
      z-index: 990;
      display: flex;
      flex-direction: column;
      gap: 6px;
      transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
      opacity: 0;
      pointer-events: none;
      box-sizing: border-box;
    }

    .batch-floating-bar.active {
      transform: translateX(-50%) translateY(0);
      opacity: 1;
      pointer-events: auto;
    }

    @media (min-width: 768px) {
      .batch-floating-bar {
        bottom: 24px;
        left: calc(50% + 130px);
        max-height: calc(100vh - 48px);
      }
    }

    /* 頂部精簡列樣式 */
    .batch-bar-compact-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      gap: 8px;
    }

    .btn-toggle-batch {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 5px 10px;
      font-size: 0.78rem;
      font-weight: 700;
      background: rgba(59, 130, 246, 0.15);
      border: 1px solid var(--accent-blue);
      color: #93c5fd;
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .btn-toggle-batch:hover {
      background: rgba(59, 130, 246, 0.28);
    }

    /* 展開式面板 */
    .batch-expanded-panel {
      display: flex;
      flex-direction: column;
      gap: 8px;
      border-top: 1px solid var(--border-color);
      padding-top: 8px;
      margin-top: 4px;
      animation: fadeInFast 0.2s ease;
      min-height: 0;
      overflow: hidden;
      flex: 1 1 auto;
    }

    @keyframes fadeInFast {
      from {
        opacity: 0;
        transform: translateY(-4px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* 整批快速切換工具列 */
    .batch-quick-actions-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 6px;
      padding: 5px 8px;
      background: rgba(0, 0, 0, 0.3);
      border-radius: var(--radius-sm);
      border: 1px solid rgba(255, 255, 255, 0.06);
    }

    .btn-quick-action {
      padding: 3px 10px;
      border-radius: 999px;
      font-size: 0.78rem;
      font-weight: 800;
      cursor: pointer;
      border: 1px solid transparent;
      transition: transform 0.15s, opacity 0.15s;
    }

    .btn-quick-action:active {
      transform: scale(0.92);
    }

    /* 浮動列中的選取案件及動作 List 樣式 (自適應高度：案件多時延伸至接近 Header 再滑動) */
    .batch-items-container {
      display: flex;
      flex-direction: column;
      gap: 6px;
      /* 依案件筆數自動增高，最多可延伸至離頂部 Header 約 60px 的安全距離再滾動 */
      max-height: calc(100vh - 270px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding-right: 4px;
    }

    @media (min-width: 768px) {
      .batch-items-container {
        max-height: calc(100vh - 230px);
      }
    }

    .batch-item-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(0, 0, 0, 0.3);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      padding: 6px 10px;
      gap: 8px;
    }

    .batch-item-id {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 800;
      font-size: 0.92rem;
      color: var(--text-main);
    }

    .batch-action-tag {
      padding: 4px 12px;
      border-radius: 999px;
      font-size: 0.82rem;
      font-weight: 800;
      cursor: pointer;
      border: 1.5px solid transparent;
      transition: all 0.18s ease;
      user-select: none;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    /* 動作標籤顏色樣式 */
    .batch-action-tag.tag-入庫,
    .btn-quick-action.tag-入庫,
    .batch-action-tag.tag-放入,
    .batch-action-tag.tag-放回 {
      background: rgba(16, 185, 129, 0.2);
      border-color: var(--status-in);
      color: #34d399;
    }

    .batch-action-tag.tag-鑑識,
    .btn-quick-action.tag-鑑識 {
      background: rgba(245, 158, 11, 0.2);
      border-color: var(--status-out);
      color: #fbbf24;
    }

    .batch-action-tag.tag-發還,
    .btn-quick-action.tag-發還,
    .batch-action-tag.tag-領回 {
      background: rgba(59, 130, 246, 0.2);
      border-color: var(--accent-blue);
      color: #60a5fa;
    }

    .batch-action-tag.tag-新收案,
    .btn-quick-action.tag-新收案 {
      background: rgba(139, 92, 246, 0.2);
      border-color: var(--status-new);
      color: #c084fc;
    }

    .batch-action-tag:active {
      transform: scale(0.93);
    }

    .batch-item-remove-btn {
      background: none;
      border: none;
      color: var(--text-dim);
      font-size: 0.85rem;
      cursor: pointer;
      padding: 2px 4px;
      line-height: 1;
      border-radius: 4px;
      transition: color 0.15s;
    }

    .batch-item-remove-btn:hover {
      color: var(--status-alert);
    }

    /* 相機未授權提示覆蓋層 */
    .camera-unauthorized-overlay {
      position: absolute;
      inset: 0;
      background: rgba(10, 14, 23, 0.94);
      backdrop-filter: blur(8px);
      z-index: 25;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 24px;
      text-align: center;
      border-radius: var(--radius-md);
      cursor: pointer;
    }

    .camera-unauthorized-overlay.active {
      display: flex;
    }

    .camera-unauth-icon {
      font-size: 2.8rem;
      filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.6));
    }

    .camera-unauth-title {
      font-size: 1.15rem;
      font-weight: 800;
      color: #fca5a5;
    }

    .camera-unauth-btn {
      background: linear-gradient(135deg, #3b82f6, #1d4ed8);
      color: #fff;
      padding: 10px 24px;
      border-radius: 999px;
      font-size: 0.95rem;
      font-weight: 800;
      box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45);
      transition: all 0.2s ease;
    }

    .camera-unauth-btn:hover {
      transform: scale(1.05);
    }

    .camera-unauth-tip {
      font-size: 0.78rem;
      color: var(--text-dim);
      max-width: 260px;
      line-height: 1.4;
    }

    .spin {
      animation: ptrSpin 0.75s linear infinite;
    }

    @keyframes ptrSpin {
      100% {
        transform: rotate(360deg);
      }
    }

    /* 強制全螢幕登入閘道 Modal */
    #login-gate-modal {
      position: fixed;
      inset: 0;
      background: rgba(10, 14, 23, 0.98);
      backdrop-filter: blur(16px);
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .login-card {
      background: var(--bg-surface);
      border: 1.5px solid var(--border-color);
      border-radius: var(--radius-lg);
      max-width: 440px;
      width: 100%;
      padding: 28px 24px;
      display: flex;
      flex-direction: column;
      gap: 18px;
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
      text-align: center;
    }

    .login-badge-icon {
      width: 58px;
      height: 58px;
      background: linear-gradient(135deg, #f38020, #faad3f);
      border-radius: 16px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 30px;
      box-shadow: 0 0 20px rgba(243, 128, 32, 0.5);
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.85);
      backdrop-filter: blur(8px);
      z-index: 100;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }

    .modal {
      background: var(--bg-surface);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      max-width: 480px;
      width: 100%;
      padding: 22px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    /* PWA 安裝教學彈窗與專屬元件樣式 */
    .pwa-guide-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(4, 7, 13, 0.88);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      z-index: 10001;
      /* 高於登入閘道 (9999) */
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
    }

    .pwa-guide-modal {
      background: var(--bg-surface);
      border: 1.5px solid var(--border-color);
      border-radius: var(--radius-lg);
      max-width: 520px;
      width: 100%;
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
      overflow: hidden;
      animation: pwaFadeInUp 0.3s ease-out;
    }

    @keyframes pwaFadeInUp {
      from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
      }

      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .pwa-guide-header {
      padding: 18px 20px 14px 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      background: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(18, 25, 41, 0.6) 100%);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }

    .pwa-guide-icon-badge {
      width: 44px;
      height: 44px;
      border-radius: 12px;
      background: linear-gradient(135deg, #0284c7, #2563eb);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
      border: 1px solid rgba(147, 197, 253, 0.3);
      flex-shrink: 0;
    }

    .pwa-guide-title {
      font-size: 1.15rem;
      font-weight: 900;
      color: var(--text-main);
      margin-bottom: 5px;
      letter-spacing: -0.01em;
    }

    .pwa-guide-badges {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .pwa-pill-cyan {
      font-size: 0.72rem;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(56, 189, 248, 0.14);
      color: #38bdf8;
      border: 1px solid rgba(56, 189, 248, 0.3);
    }

    .pwa-pill-emerald {
      font-size: 0.72rem;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(16, 185, 129, 0.14);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .pwa-pill-purple {
      font-size: 0.72rem;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 999px;
      background: rgba(139, 92, 246, 0.14);
      color: #a78bfa;
      border: 1px solid rgba(139, 92, 246, 0.3);
    }

    .pwa-guide-close-btn {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.2s ease;
      flex-shrink: 0;
    }

    .pwa-guide-close-btn:hover {
      background: rgba(239, 68, 68, 0.15);
      border-color: rgba(239, 68, 68, 0.3);
      color: #fca5a5;
    }

    .pwa-guide-body {
      padding: 16px 20px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 14px;
      -webkit-overflow-scrolling: touch;
    }

    .pwa-guide-footer {
      padding: 14px 20px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      background: linear-gradient(180deg, rgba(18, 25, 41, 0.85) 0%, rgba(10, 14, 23, 0.95) 100%);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .pwa-footer-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }

    .pwa-dismiss-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 0.82rem;
      color: var(--text-muted);
      cursor: pointer;
      user-select: none;
      padding: 6px 10px;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.06);
      transition: all 0.2s ease;
    }

    .pwa-dismiss-label:hover {
      color: var(--text-main);
      background: rgba(255, 255, 255, 0.07);
      border-color: rgba(255, 255, 255, 0.12);
    }

    .pwa-checkbox {
      accent-color: #3b82f6;
      width: 16px;
      height: 16px;
      cursor: pointer;
    }

    .pwa-btn-submit {
      padding: 10px 24px;
      font-weight: 800;
      font-size: 0.92rem;
      background: linear-gradient(135deg, #2563eb, #1d4ed8);
      color: #ffffff;
      border: 1px solid rgba(147, 197, 253, 0.35);
      border-radius: 10px;
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .pwa-btn-submit:hover {
      background: linear-gradient(135deg, #3b82f6, #2563eb);
      box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
      transform: translateY(-1px);
    }

    .pwa-feature-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }

    @media (max-width: 480px) {
      .pwa-feature-grid {
        grid-template-columns: 1fr;
      }
    }

    .pwa-feature-item {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      padding: 10px 8px;
      text-align: center;
      transition: all 0.2s ease;
    }

    .pwa-feat-blue {
      background: rgba(56, 189, 248, 0.05);
      border-color: rgba(56, 189, 248, 0.22);
    }

    .pwa-feat-blue .pwa-feat-icon-box {
      color: #38bdf8;
      margin-bottom: 2px;
    }

    .pwa-feat-blue .pwa-feat-title {
      font-weight: 800;
      font-size: 0.82rem;
      color: #38bdf8;
    }

    .pwa-feat-emerald {
      background: rgba(16, 185, 129, 0.05);
      border-color: rgba(16, 185, 129, 0.22);
    }

    .pwa-feat-emerald .pwa-feat-icon-box {
      color: #34d399;
      margin-bottom: 2px;
    }

    .pwa-feat-emerald .pwa-feat-title {
      font-weight: 800;
      font-size: 0.82rem;
      color: #34d399;
    }

    .pwa-feat-purple {
      background: rgba(139, 92, 246, 0.05);
      border-color: rgba(139, 92, 246, 0.22);
    }

    .pwa-feat-purple .pwa-feat-icon-box {
      color: #a78bfa;
      margin-bottom: 2px;
    }

    .pwa-feat-purple .pwa-feat-title {
      font-weight: 800;
      font-size: 0.82rem;
      color: #a78bfa;
    }

    .pwa-feat-sub {
      font-size: 0.72rem;
      color: var(--text-dim);
      margin-top: 2px;
    }

    .pwa-platform-tabs {
      display: flex;
      background: var(--bg-primary);
      border-radius: var(--radius-sm);
      padding: 4px;
      gap: 4px;
      border: 1px solid var(--border-color);
    }

    .pwa-platform-tab-btn {
      flex: 1;
      padding: 8px 4px;
      border-radius: 6px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-size: 0.82rem;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      transition: all 0.2s;
    }

    .pwa-platform-tab-btn.active {
      background: var(--accent-blue);
      color: #ffffff;
      box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    }

    .pwa-keynote-box {
      background: rgba(37, 99, 235, 0.09);
      border: 1px solid rgba(59, 130, 246, 0.28);
      border-radius: var(--radius-sm);
      padding: 9px 12px;
      font-size: 0.8rem;
      color: #93c5fd;
      line-height: 1.5;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .pwa-keynote-tag {
      display: inline-block;
      font-size: 0.72rem;
      font-weight: 800;
      padding: 2px 7px;
      border-radius: 4px;
      background: #2563eb;
      color: #ffffff;
      line-height: 1.2;
    }

    .pwa-step-card {
      background: rgba(27, 37, 59, 0.6);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 12px 14px;
      display: flex;
      align-items: flex-start;
      gap: 12px;
      line-height: 1.5;
    }

    .pwa-step-num {
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: rgba(59, 130, 246, 0.18);
      color: #60a5fa;
      border: 1.5px solid rgba(59, 130, 246, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 900;
      font-size: 0.82rem;
      flex-shrink: 0;
      margin-top: 1px;
    }

    .pwa-action-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      border-radius: 8px;
      padding: 5px 12px;
      font-weight: 700;
      font-size: 0.82rem;
    }

    .pwa-action-badge-blue {
      background: rgba(14, 165, 233, 0.12);
      border: 1px solid rgba(56, 189, 248, 0.35);
      color: #38bdf8;
    }

    .pwa-action-badge-green {
      background: rgba(16, 185, 129, 0.12);
      border: 1px solid rgba(52, 211, 153, 0.35);
      color: #34d399;
    }

    .header-pwa-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 5px 12px;
      border-radius: 20px;
      background: linear-gradient(135deg, #0284c7, #2563eb);
      color: #ffffff;
      font-size: 0.8rem;
      font-weight: 800;
      border: 1px solid rgba(147, 197, 253, 0.3);
      cursor: pointer;
      box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
      transition: transform 0.15s, box-shadow 0.15s;
    }

    .header-pwa-badge:hover {
      transform: scale(1.04);
      box-shadow: 0 0 16px rgba(37, 99, 235, 0.65);
    }

    /* 頂部訊息按鈕 (高可見度、現代膠囊藥丸設計) */
    .header-msg-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 13px;
      border-radius: 20px;
      background: linear-gradient(135deg, rgba(56, 189, 248, 0.18) 0%, rgba(99, 102, 241, 0.22) 100%);
      border: 1px solid rgba(56, 189, 248, 0.45);
      color: #f0f9ff;
      font-size: 0.82rem;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 0 14px rgba(56, 189, 248, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
      transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      position: relative;
      flex-shrink: 0;
      user-select: none;
    }

    .header-msg-btn:hover {
      background: linear-gradient(135deg, rgba(56, 189, 248, 0.3) 0%, rgba(99, 102, 241, 0.38) 100%);
      border-color: rgba(56, 189, 248, 0.75);
      box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
      color: #ffffff;
      transform: translateY(-1px);
    }

    .header-msg-btn:active {
      transform: scale(0.95);
    }

    /* 當有未讀訊息時的呼吸警示光環 */
    .header-msg-btn.has-unread {
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.28) 0%, rgba(249, 115, 22, 0.28) 100%);
      border-color: rgba(239, 68, 68, 0.75);
      color: #ffffff;
      animation: msgPulseGlow 2s infinite ease-in-out;
    }

    @keyframes msgPulseGlow {

      0%,
      100% {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
      }

      50% {
        box-shadow: 0 0 24px rgba(239, 68, 68, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.45);
      }
    }

    .header-msg-btn .msg-btn-icon {
      font-size: 1.05rem;
      line-height: 1;
      display: inline-block;
      transition: transform 0.2s;
    }

    .header-msg-btn:hover .msg-btn-icon {
      transform: scale(1.15) rotate(-5deg);
    }

    .header-msg-btn .msg-btn-label {
      line-height: 1;
      font-weight: 700;
      letter-spacing: 0.02em;
    }

    @media (max-width: 380px) {
      .header-msg-btn {
        padding: 5px 8px;
        gap: 3px;
      }
    }

    .header-msg-btn.header-msg-btn-icononly {
      width: 36px;
      height: 36px;
      padding: 0;
      justify-content: center;
      border-radius: 50%;
    }

    .mobile-header .header-user-badge {
      cursor: pointer;
      user-select: none;
      transition: all 0.2s ease;
    }

    .mobile-header .header-user-badge:hover {
      background: var(--bg-card-hover);
      border-color: var(--border-focus);
    }

    .mobile-header .header-user-badge:active {
      transform: scale(0.96);
    }

    /* 頂部訊息中心紅點與項目樣式 */
    .header-unread-badge {
      position: absolute;
      top: -5px;
      right: -5px;
      background: linear-gradient(135deg, #ef4444, #dc2626);
      color: #ffffff;
      font-size: 0.68rem;
      font-weight: 900;
      min-width: 18px;
      height: 18px;
      border-radius: 999px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 4px;
      box-shadow: 0 0 10px rgba(239, 68, 68, 0.85);
      border: 2px solid #0f172a;
      line-height: 1;
      pointer-events: none;
      animation: badgePulse 2.2s infinite;
    }

    @keyframes badgePulse {

      0%,
      100% {
        transform: scale(1);
      }

      50% {
        transform: scale(1.18);
      }
    }

    /* ========================================== */
    /* 推播訊息中心 (全新現代頂級玻璃擬態設計)   */
    /* ========================================== */
    .msg-center-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(6, 10, 18, 0.78);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      z-index: 10003;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
      animation: msgFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes msgFadeIn {
      from {
        opacity: 0;
      }

      to {
        opacity: 1;
      }
    }

    .msg-center-dialog {
      background: linear-gradient(175deg, #151d30 0%, #0d1424 100%);
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.1);
      border-radius: 20px;
      width: 100%;
      max-width: 520px;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      animation: msgScaleUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes msgScaleUp {
      from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
      }

      to {
        opacity: 1;
        transform: scale(1) translateY(0);
      }
    }

    .msg-center-header {
      padding: 16px 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(22, 32, 53, 0.6);
      backdrop-filter: blur(12px);
    }

    .msg-header-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .msg-header-icon-box {
      width: 40px;
      height: 40px;
      border-radius: 12px;
      background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(99, 102, 241, 0.2));
      border: 1px solid rgba(56, 189, 248, 0.3);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      box-shadow: 0 4px 14px rgba(56, 189, 248, 0.15);
      flex-shrink: 0;
    }

    .msg-header-title {
      font-size: 1.15rem;
      font-weight: 800;
      color: #f8fafc;
      letter-spacing: -0.01em;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .msg-header-unread-tag {
      font-size: 0.72rem;
      font-weight: 700;
      background: rgba(239, 68, 68, 0.2);
      color: #fca5a5;
      border: 1px solid rgba(239, 68, 68, 0.35);
      padding: 2px 8px;
      border-radius: 999px;
      line-height: 1.2;
    }

    .msg-header-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .msg-btn-readall {
      background: rgba(255, 255, 255, 0.06);
      border: 1px solid rgba(255, 255, 255, 0.12);
      color: #cbd5e1;
      font-size: 0.78rem;
      font-weight: 700;
      padding: 5px 12px;
      border-radius: 999px;
      cursor: pointer;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .msg-btn-readall:hover {
      background: rgba(56, 189, 248, 0.15);
      border-color: rgba(56, 189, 248, 0.4);
      color: #38bdf8;
    }

    .msg-btn-close {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.08);
      color: #94a3b8;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.95rem;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .msg-btn-close:hover {
      background: rgba(255, 255, 255, 0.14);
      color: #ffffff;
      transform: scale(1.05);
    }

    .msg-center-body {
      padding: 16px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-height: 60vh;
      -webkit-overflow-scrolling: touch;
    }

    .msg-center-body::-webkit-scrollbar {
      width: 6px;
    }

    .msg-center-body::-webkit-scrollbar-track {
      background: transparent;
    }

    .msg-center-body::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.12);
      border-radius: 999px;
    }

    #message-center-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: 100%;
    }

    .tab-btn#desktop-btn-open-msg-center.has-unread {
      color: #38bdf8;
      border-color: rgba(56, 189, 248, 0.35);
      background: rgba(56, 189, 248, 0.08);
    }

    .msg-item-card {
      border-radius: 12px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      transition: all 0.2s ease;
      cursor: pointer;
      position: relative;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.07);
    }

    .msg-item-card:hover {
      transform: translateY(-1px);
      background: rgba(255, 255, 255, 0.05);
    }

    .msg-item-card.unread {
      background: linear-gradient(135deg, rgba(30, 48, 78, 0.75) 0%, rgba(18, 29, 50, 0.85) 100%);
      border: 1px solid rgba(56, 189, 248, 0.35);
      box-shadow: 0 4px 18px -4px rgba(14, 165, 233, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .msg-item-card.unread:hover {
      border-color: rgba(56, 189, 248, 0.55);
      box-shadow: 0 6px 22px -4px rgba(14, 165, 233, 0.25);
    }

    .msg-card-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .msg-card-title-group {
      display: flex;
      align-items: center;
      gap: 8px;
      overflow: hidden;
      flex: 1;
    }

    .msg-card-status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #38bdf8;
      box-shadow: 0 0 8px #38bdf8;
      flex-shrink: 0;
    }

    .msg-card-title {
      font-size: 0.94rem;
      font-weight: 700;
      color: #f1f5f9;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .msg-item-card.read .msg-card-title {
      color: #94a3b8;
      font-weight: 600;
    }

    .msg-card-time-col {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      line-height: 1.25;
      font-family: 'JetBrains Mono', monospace;
      flex-shrink: 0;
      text-align: right;
    }

    .msg-card-time-date {
      font-size: 0.70rem;
      color: #64748b;
      font-weight: 500;
      letter-spacing: -0.2px;
    }

    .msg-card-time-time {
      font-size: 0.74rem;
      color: #94a3b8;
      font-weight: 700;
      letter-spacing: -0.2px;
    }

    .msg-item-card.unread .msg-card-time-date {
      color: #38bdf8;
      opacity: 0.85;
    }

    .msg-item-card.unread .msg-card-time-time {
      color: #7dd3fc;
    }

    .msg-card-delete-btn {
      background: transparent;
      border: none;
      color: var(--text-dim);
      font-size: 0.85rem;
      cursor: pointer;
      min-width: 44px;
      min-height: 44px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      border-radius: 6px;
      line-height: 1;
      transition: all 0.15s;
    }

    .msg-card-delete-btn:hover {
      color: #ef4444;
      background: rgba(239, 68, 68, 0.15);
    }

    /* 靜音切換開關樣式 */
    .sound-slider:before {
      position: absolute;
      content: "";
      height: 20px;
      width: 20px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      transition: .3s;
      border-radius: 50%;
    }

    input:checked+.sound-slider {
      background-color: var(--accent-blue) !important;
    }

    input:checked+.sound-slider:before {
      transform: translateX(20px);
    }

    .msg-card-body {
      font-size: 0.86rem;
      color: #94a3b8;
      line-height: 1.55;
      word-break: break-word;
      white-space: pre-line;
    }

    .msg-item-card.unread .msg-card-body {
      color: #e2e8f0;
    }

    .msg-center-footer {
      padding: 12px 20px;
      border-top: 1px solid rgba(255, 255, 255, 0.06);
      background: rgba(14, 20, 34, 0.85);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .msg-footer-stats {
      font-size: 0.82rem;
      color: #64748b;
    }

    .msg-footer-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .msg-btn-clear {
      background: transparent;
      border: 1px solid rgba(239, 68, 68, 0.25);
      color: #f87171;
      padding: 6px 14px;
      font-size: 0.8rem;
      font-weight: 600;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .msg-btn-clear:hover {
      background: rgba(239, 68, 68, 0.12);
      border-color: #ef4444;
      color: #fca5a5;
    }

    .msg-btn-confirm {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #ffffff;
      padding: 6px 18px;
      font-size: 0.82rem;
      font-weight: 700;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .msg-btn-confirm:hover {
      background: rgba(255, 255, 255, 0.18);
    }

    /* 亮色模式相容 */
    body.theme-light .msg-center-backdrop {
      background: rgba(15, 23, 42, 0.45);
    }

    body.theme-light .msg-center-dialog {
      background: linear-gradient(175deg, #ffffff 0%, #f8fafc 100%);
      border: 1px solid #e2e8f0;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }

    body.theme-light .msg-center-header {
      background: rgba(248, 250, 252, 0.95);
      border-bottom: 1px solid #e2e8f0;
    }

    body.theme-light .msg-header-title {
      color: #0f172a;
    }

    body.theme-light .msg-btn-readall {
      background: #f1f5f9;
      border-color: #cbd5e1;
      color: #334155;
    }

    body.theme-light .msg-btn-close {
      background: #f1f5f9;
      border-color: #e2e8f0;
      color: #64748b;
    }

    body.theme-light .msg-item-card {
      background: #ffffff;
      border: 1px solid #e2e8f0;
    }

    body.theme-light .msg-item-card.unread {
      background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
      border: 1px solid #93c5fd;
      box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
    }

    body.theme-light .msg-item-card.unread .msg-card-title {
      color: #1e3a8a;
    }

    body.theme-light .msg-item-card.unread .msg-card-body {
      color: #334155;
    }

    body.theme-light .msg-center-footer {
      background: #f8fafc;
      border-top: 1px solid #e2e8f0;
    }

    body.theme-light .msg-btn-confirm {
      background: #2563eb;
      border-color: #1d4ed8;
      color: #ffffff;
    }

    body.theme-light .header-msg-btn {
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(99, 102, 241, 0.14) 100%);
      border-color: rgba(59, 130, 246, 0.45);
      color: #1d4ed8;
      box-shadow: 0 2px 10px rgba(59, 130, 246, 0.15);
    }

    body.theme-light .header-msg-btn:hover {
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.22) 0%, rgba(99, 102, 241, 0.25) 100%);
      border-color: #2563eb;
      color: #1e40af;
    }

    body.theme-light .header-msg-btn.has-unread {
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.18) 0%, rgba(249, 115, 22, 0.18) 100%);
      border-color: #ef4444;
      color: #b91c1c;
    }

    body.theme-light .header-unread-badge {
      border-color: #ffffff;
    }

    /* PWA 彈窗白天亮色模式相容 */
    body.theme-light .pwa-guide-backdrop {
      background: rgba(15, 23, 42, 0.5);
    }

    body.theme-light .pwa-guide-modal {
      background: #ffffff;
      border-color: #cbd5e1;
      box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    }

    body.theme-light .pwa-guide-header {
      background: #f8fafc;
      border-bottom-color: #e2e8f0;
    }

    body.theme-light .pwa-guide-footer {
      background: #f8fafc;
      border-top-color: #e2e8f0;
    }

    body.theme-light .pwa-guide-close-btn {
      background: #f1f5f9;
      border-color: #e2e8f0;
      color: #475569;
    }

    body.theme-light .pwa-guide-close-btn:hover {
      background: #fee2e2;
      border-color: #fca5a5;
      color: #dc2626;
    }

    body.theme-light .pwa-step-card {
      background: #f8fafc;
      border-color: #e2e8f0;
    }

    body.theme-light .pwa-dismiss-label {
      background: #f1f5f9;
      border-color: #e2e8f0;
      color: #475569;
    }

    body.theme-light .pwa-dismiss-label:hover {
      background: #e2e8f0;
      color: #0f172a;
    }

    body.theme-light .pwa-keynote-box {
      background: #eff6ff;
      border-color: #bfdbfe;
      color: #1e40af;
    }

    body.theme-light .pwa-action-badge-blue {
      background: #eff6ff;
      border-color: #93c5fd;
      color: #0284c7;
    }

    body.theme-light .pwa-action-badge-green {
      background: #ecfdf5;
      border-color: #a7f3d0;
      color: #059669;
    }

    #toast-container {
      position: fixed;
      top: calc(24px + env(safe-area-inset-top, 0px));
      bottom: auto;
      left: 50%;
      transform: translateX(-50%);
      z-index: 10020;
      pointer-events: none;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      width: calc(100% - 32px);
      max-width: 520px;
    }

    .toast {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 11px 22px;
      border-radius: 999px;
      font-size: 0.92rem;
      font-weight: 700;
      background: rgba(18, 25, 41, 0.97);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1.5px solid rgba(59, 130, 246, 0.45);
      color: #fff;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 16px rgba(59, 130, 246, 0.3);
      pointer-events: auto;
      animation: toastSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      max-width: 100%;
      word-break: break-word;
      text-align: center;
    }

    .toast-icon {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
      display: inline-block;
      vertical-align: middle;
    }

    .toast.toast-error {
      background: rgba(28, 14, 18, 0.97);
      border-color: rgba(239, 68, 68, 0.65);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 16px rgba(239, 68, 68, 0.35);
      color: #fca5a5;
    }

    .toast.toast-warning {
      background: rgba(30, 22, 10, 0.97);
      border-color: rgba(245, 158, 11, 0.7);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 16px rgba(245, 158, 11, 0.35);
      color: #fcd34d;
    }

    .toast.toast-success {
      background: rgba(10, 28, 20, 0.97);
      border-color: rgba(16, 185, 129, 0.65);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 16px rgba(16, 185, 129, 0.35);
      color: #6ee7b7;
    }

    body.theme-light .toast {
      background: rgba(255, 255, 255, 0.98);
      color: #0f172a;
      box-shadow: 0 8px 26px rgba(0, 0, 0, 0.15), 0 0 14px rgba(59, 130, 246, 0.22);
      border-color: rgba(59, 130, 246, 0.4);
    }
    body.theme-light .toast.toast-error {
      background: #fef2f2;
      border-color: #fca5a5;
      color: #b91c1c;
    }
    body.theme-light .toast.toast-warning {
      background: #fffbeb;
      border-color: #fcd34d;
      color: #b45309;
    }
    body.theme-light .toast.toast-success {
      background: #f0fdf4;
      border-color: #86efac;
      color: #15803d;
    }

    @keyframes toastSlideDown {
      0% {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
      }

      100% {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    /* 白天亮色模式樣式 (預設：選項 A 現代極簡精準風 - Slate Tactical Navy) */
    body.theme-light {
      --bg-primary: #f8fafc;
      --bg-surface: #ffffff;
      --bg-card: #ffffff;
      --bg-card-hover: #f1f5f9;
      --border-color: #cbd5e1;
      --border-focus: #2563eb;
      --accent-blue: #1d4ed8;
      --accent-blue-hover: #1e40af;
      --text-main: #0f172a;
      /* 13.5:1 超高對比度文字 */
      --text-muted: #334155;
      --text-dim: #64748b;
      --shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
      --radius-sm: 6px;
      --radius-md: 10px;
    }


    /* === 手動輸入錯誤 Shake 動畫與提示卡片 === */
    @keyframes inputShake {

      0%,
      100% {
        transform: translateX(0);
      }

      20%,
      60% {
        transform: translateX(-6px);
      }

      40%,
      80% {
        transform: translateX(6px);
      }
    }

    .input-error {
      border-color: #ef4444 !important;
      box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
      animation: inputShake 0.35s ease-in-out;
    }

    .input-error-tip {
      background: rgba(239, 68, 68, 0.12);
      border: 1.5px solid rgba(239, 68, 68, 0.4);
      color: #f87171;
      border-radius: var(--radius-sm);
      padding: 10px 12px;
      font-size: 0.8rem;
      animation: fadeInItem 0.2s ease-out;
    }

    body.theme-light .input-error-tip {
      background: #fef2f2;
      border-color: #fca5a5;
      color: #991b1b;
    }

    .mono-code {
      font-family: 'JetBrains Mono', monospace;
      background: rgba(0, 0, 0, 0.3);
      padding: 1px 5px;
      border-radius: 4px;
      font-weight: 800;
    }

    body.theme-light .mono-code {
      background: #fee2e2;
      color: #991b1b;
    }

    /* === 待啟用下一步提示與帳號切換按鈕 === */
    .pending-next-step-hint {
      background: rgba(0, 0, 0, 0.25);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 6px;
      padding: 10px 12px;
      font-size: 0.78rem;
      color: #cbd5e1;
      line-height: 1.5;
    }

    body.theme-light .pending-next-step-hint {
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      color: #1e40af;
    }

    .btn-switch-pending-account {
      background: none;
      border: none;
      color: #94a3b8;
      font-size: 0.75rem;
      text-decoration: underline;
      cursor: pointer;
      padding: 2px 4px;
      transition: color 0.18s;
    }

    body.theme-light .btn-switch-pending-account {
      color: #2563eb;
      font-weight: 700;
    }

    body.theme-light .btn-switch-pending-account:hover {
      color: #1d4ed8;
    }

    /* === 全選按鈕 Option A 高對比樣式 === */
    .btn-select-all {
      padding: 5px 12px;
      font-size: 0.82rem;
      font-weight: 800;
      background: rgba(59, 130, 246, 0.15);
      border: 1px solid var(--accent-blue);
      color: #60a5fa;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: all 0.2s;
    }

    body.theme-light .btn-select-all {
      background: #eff6ff !important;
      border: 1.5px solid #2563eb !important;
      color: #1d4ed8 !important;
    }

    body.theme-light .btn-select-all:hover {
      background: #dbeafe !important;
      color: #1e40af !important;
    }

    body.theme-light .batch-action-hint-text {
      color: #334155 !important;
      font-weight: 600;
    }

    body.theme-light .font-scale-btn.active {
      background: #2563eb !important;
      color: #ffffff !important;
      border-color: #1d4ed8 !important;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35) !important;
    }

    /* === 語意狀態文字 (適應日夜色彩) === */
    .status-text-success {
      color: #10b981;
      font-weight: 700;
    }

    .status-text-warning {
      color: #f59e0b;
      font-weight: 700;
    }

    .status-text-danger {
      color: #ef4444;
      font-weight: 700;
    }

    .status-text-info {
      color: #38bdf8;
      font-weight: 700;
    }

    body.theme-light .status-text-success {
      color: #15803d !important;
    }

    body.theme-light .status-text-warning {
      color: #b45309 !important;
    }

    body.theme-light .status-text-danger {
      color: #b91c1c !important;
    }

    body.theme-light .status-text-info {
      color: #1d4ed8 !important;
    }

    /* 鑑識天數 0~1 天白天高對比 */
    body.theme-light .badge-forensic-day-fresh {
      background: #f0f9ff !important;
      color: #0369a1 !important;
      border-color: #bae6fd !important;
    }

    /* 預設案號統計標籤樣式 (深淺色自動適配) */
    .batch-count-num {
      color: #60a5fa;
      font-size: 1.15rem;
      font-family: 'JetBrains Mono', monospace;
      font-weight: 900;
    }

    /* 白天亮色浮動操作列 (Option A 高對比戰術白底與超清晰按鈕排版) */
    body.theme-light .batch-floating-bar {
      background: rgba(255, 255, 255, 0.98);
      border: 1.5px solid #2563eb;
      box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(37, 99, 235, 0.2);
      color: #0f172a;
    }

    body.theme-light .batch-bar-compact-row {
      color: #0f172a;
    }

    body.theme-light .batch-count-num {
      color: #1d4ed8 !important;
      font-weight: 900;
    }

    body.theme-light .btn-toggle-batch {
      background: #eff6ff;
      border: 1.5px solid #3b82f6;
      color: #1d4ed8;
      font-weight: 800;
    }

    body.theme-light .btn-toggle-batch:hover {
      background: #dbeafe;
      color: #1e40af;
      border-color: #1d4ed8;
    }

    body.theme-light .btn-batch-cancel {
      background: #f1f5f9;
      border: 1.5px solid #cbd5e1;
      color: #334155;
      font-weight: 800;
    }

    body.theme-light .btn-batch-cancel:hover {
      background: #fee2e2;
      border-color: #fca5a5;
      color: #dc2626;
    }

    body.theme-light #btn-quick-submit-batch {
      background: linear-gradient(135deg, #2563eb, #1d4ed8);
      color: #ffffff;
      border: 1px solid #1e40af;
      font-weight: 800;
      box-shadow: 0 3px 10px rgba(29, 78, 216, 0.35);
    }

    body.theme-light #btn-quick-submit-batch:hover {
      background: linear-gradient(135deg, #1d4ed8, #1e40af);
    }

    body.theme-light .batch-expanded-panel {
      border-top: 1px solid #e2e8f0;
    }

    body.theme-light .batch-quick-actions-bar {
      background: #f8fafc;
      border: 1px solid #cbd5e1;
      color: #0f172a;
    }

    body.theme-light .batch-item-row {
      background: #ffffff;
      border-color: #cbd5e1;
      color: #0f172a;
    }

    body.theme-light .batch-item-row:hover {
      background: #f8fafc;
      border-color: #94a3b8;
    }

    body.theme-light .batch-action-tag.tag-入庫,
    body.theme-light .btn-quick-action.tag-入庫,
    body.theme-light .batch-action-tag.tag-放入,
    body.theme-light .batch-action-tag.tag-放回 {
      background: #ecfdf5;
      border-color: #a7f3d0;
      color: #065f46;
      font-weight: 800;
    }

    body.theme-light .batch-action-tag.tag-鑑識,
    body.theme-light .btn-quick-action.tag-鑑識 {
      background: #fffbeb;
      border-color: #fde68a;
      color: #92400e;
      font-weight: 800;
    }

    body.theme-light .batch-action-tag.tag-發還,
    body.theme-light .btn-quick-action.tag-發還,
    body.theme-light .batch-action-tag.tag-領回 {
      background: #eff6ff;
      border-color: #bfdbfe;
      color: #1e40af;
      font-weight: 800;
    }

    body.theme-light .batch-action-tag.tag-新收案,
    body.theme-light .btn-quick-action.tag-新收案 {
      background: #f5f3ff;
      border-color: #ddd6fe;
      color: #5b21b6;
      font-weight: 800;
    }

    body.theme-light header,
    body.theme-light .mobile-header {
      background: rgba(255, 255, 255, 0.96);
      border-bottom-color: #e2e8f0;
    }

    body.theme-light .sidebar {
      background: #ffffff;
      border-right-color: #e2e8f0;
    }

    body.theme-light .sidebar-brand {
      border-bottom-color: #e2e8f0;
    }

    body.theme-light .sidebar-footer {
      border-top-color: #e2e8f0;
    }

    body.theme-light .tabs-nav {
      background: rgba(255, 255, 255, 0.96);
      border-top-color: #e2e8f0;
      box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    }

    body.theme-light .tab-btn {
      color: #64748b;
    }

    @media (max-width: 767px) {
      body.theme-light .tab-btn.active {
        color: #2563eb;
        background: rgba(37, 99, 235, 0.1);
      }
    }

    @media (min-width: 768px) {
      body.theme-light .tab-btn:hover {
        background: #f1f5f9;
        color: #0f172a;
      }

      body.theme-light .tab-btn.active {
        background: #2563eb;
        color: #ffffff;
      }
    }

    body.theme-light .card {
      background: #ffffff;
      border-color: #cbd5e1;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    }

    body.theme-light .subtab-btn {
      background: #f1f5f9;
      border-color: #cbd5e1;
      color: #475569;
    }

    body.theme-light .subtab-btn.active {
      background: #2563eb;
      border-color: #2563eb;
      color: #ffffff;
    }

    .case-card-id {
      font-family: 'JetBrains Mono', monospace;
      font-size: 1.05rem;
      font-weight: 800;
      color: #ffffff;
    }

    .case-card-handler {
      color: var(--text-main);
      font-weight: 600;
    }

    body.theme-light .case-card-id {
      color: #0f172a !important;
    }

    body.theme-light .case-card-handler {
      color: #0f172a !important;
    }

    body.theme-light .form-control {
      background: #ffffff;
      color: #0f172a;
      border-color: #cbd5e1;
    }

    body.theme-light .form-control:focus {
      border-color: #2563eb;
    }

    body.theme-light .btn {
      background: #f1f5f9;
      color: #0f172a;
      border-color: #cbd5e1;
    }

    body.theme-light .btn-primary {
      background: linear-gradient(135deg, #2563eb, #1d4ed8);
      color: #ffffff;
    }

    body.theme-light .staged-item-card {
      background: #ffffff;
      border-color: #cbd5e1;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    body.theme-light .staged-case-id {
      color: #0f172a;
    }

    body.theme-light .badge-new {
      background: rgba(124, 58, 237, 0.12);
      color: #7c3aed;
      border-color: rgba(124, 58, 237, 0.3);
    }

    body.theme-light .taker-alert-box {
      background: rgba(239, 68, 68, 0.08);
      border-color: rgba(239, 68, 68, 0.4);
    }

    body.theme-light .taker-alert-title {
      color: #dc2626;
    }

    body.theme-light .taker-alert-desc {
      color: #1e293b;
    }

    body.theme-light .case-card-item {
      background: #ffffff;
      border: 1.5px solid #cbd5e1;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    body.theme-light .case-card-item:hover {
      border-color: #94a3b8;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    }

    body.theme-light .card-check-indicator {
      background: #ffffff;
      border-color: #94a3b8;
    }

    body.theme-light .case-card-item.selected .card-check-indicator {
      background: #2563eb;
      border-color: #2563eb;
      color: #ffffff;
    }

    body.theme-light .select-all-box {
      background: #ffffff;
      border-color: #64748b;
    }

    body.theme-light .select-all-box.checked {
      background: #2563eb;
      border-color: #2563eb;
      color: #ffffff;
    }

    /* 白天亮色模式卡片標籤 (送驗單位與承辦人混合標籤，高對比琥珀金，超清晰醒目) */
    body.theme-light .case-tag-agency {
      background: #fef3c7;
      color: #92400e;
      /* 深琥珀棕 */
      border: 1.5px solid #f59e0b;
      font-weight: 600;
      font-size: 0.78rem;
      box-shadow: 0 1px 2px rgba(245, 158, 11, 0.15);
    }

    body.theme-light .case-tag-agency .case-tag-officer-name {
      color: #78350f;
      font-weight: 800;
    }

    /* 承辦人特別強化標籤 (暖琥珀橘黃高對比) */
    body.theme-light .case-tag-officer {
      background: #fef3c7;
      color: #92400e;
      /* 深琥珀棕 */
      border: 1.5px solid #f59e0b;
      font-weight: 700;
      font-size: 0.78rem;
      box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
    }

    body.theme-light .case-tag-officer b {
      color: #78350f;
      font-weight: 800;
    }

    /* 案由特別強化標籤 (鮮明靛紫高對比) */
    body.theme-light .case-tag-reason {
      background: #ede9fe;
      color: #4338ca;
      /* 鮮明深靛紫 */
      border: 1.5px solid #818cf8;
      font-weight: 700;
      font-size: 0.78rem;
      box-shadow: 0 1px 3px rgba(99, 102, 241, 0.2);
    }

    body.theme-light .case-tag-reason b {
      color: #312e81;
      font-weight: 800;
    }

    body.theme-light .case-tag-subteam {
      background: #eff6ff;
      color: #1d4ed8;
      /* 經典科技藍 */
      border: 1px solid #93c5fd;
      font-weight: 600;
    }

    body.theme-light .case-tag-devices {
      background: #ecfdf5;
      color: #047857;
      /* 翡翠綠 */
      border: 1px solid #6ee7b7;
      font-weight: 600;
    }

    body.theme-light .case-tag-note {
      background: #f8fafc;
      color: #334155;
      border: 1px solid #cbd5e1;
      font-weight: 600;
    }

    body.theme-light .badge-progress-wait {
      background: #d1fae5 !important;
      color: #065f46 !important;
      border: 1px solid #34d399 !important;
      font-weight: 700 !important;
    }

    body.theme-light .badge-progress-forensic {
      background: #fee2e2 !important;
      color: #991b1b !important;
      border: 1px solid #f87171 !important;
      font-weight: 700 !important;
    }

    body.theme-light .badge-progress-received {
      background: #e0f2fe !important;
      color: #075985 !important;
      border: 1px solid #38bdf8 !important;
      font-weight: 700 !important;
    }

    body.theme-light .badge-progress-returned {
      background: #f1f5f9 !important;
      color: #334155 !important;
      border: 1px solid #94a3b8 !important;
      font-weight: 700 !important;
    }

    body.theme-light .login-card {
      background: #ffffff;
      color: #0f172a;
    }

    body.theme-light .unit-filter-btn-group {
      background: #f1f5f9;
      border-color: #cbd5e1;
    }

    body.theme-light .unit-filter-btn {
      color: #475569;
    }

    body.theme-light .unit-filter-btn.active {
      background: #2563eb !important;
      color: #ffffff !important;
    }

    body.theme-light .batch-item-row {
      background: #f8fafc;
      border-color: #cbd5e1;
    }

    /* 輸入模式切換標籤 (鏡頭掃描 / 手動輸入) */
    .input-mode-tabs {
      display: flex;
      background: var(--bg-card);
      border-radius: var(--radius-sm);
      padding: 4px;
      gap: 6px;
      margin-bottom: 12px;
      border: 1px solid var(--border-color);
    }

    .input-mode-btn {
      flex: 1;
      padding: 9px 14px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-weight: 700;
      font-size: 0.88rem;
      cursor: pointer;
      border-radius: 6px;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .input-mode-btn.active {
      background: var(--accent-blue);
      color: #fff;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    }

    /* 待登記清單 (Staged List) 樣式 */
    .staged-list-container {
      display: flex;
      flex-direction: column;
      gap: 10px;
      max-height: clamp(320px, 52vh, 540px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      padding-right: 4px;
      scrollbar-width: thin;
      scrollbar-color: var(--accent-blue) rgba(255, 255, 255, 0.08);
    }

    .staged-list-container::-webkit-scrollbar,
    #warning-modal-list::-webkit-scrollbar {
      width: 6px;
    }

    .staged-list-container::-webkit-scrollbar-track,
    #warning-modal-list::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 4px;
    }

    .staged-list-container::-webkit-scrollbar-thumb,
    #warning-modal-list::-webkit-scrollbar-thumb {
      background: var(--accent-blue);
      border-radius: 4px;
    }

    .staged-list-container::-webkit-scrollbar-thumb:hover,
    #warning-modal-list::-webkit-scrollbar-thumb:hover {
      background: #60a5fa;
    }

    body.theme-light .staged-list-container,
    body.theme-light #warning-modal-list {
      scrollbar-color: var(--accent-blue) rgba(0, 0, 0, 0.06);
    }

    body.theme-light .staged-list-container::-webkit-scrollbar-track,
    body.theme-light #warning-modal-list::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.05);
    }

    .staged-item-card {
      background: var(--bg-surface);
      border: 1.5px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      transition: border-color 0.2s, box-shadow 0.2s;
      animation: fadeInItem 0.25s ease-out;
    }

    .staged-item-card.staged-item-card-simple {
      padding: 10px 14px;
      gap: 0;
    }

    @keyframes fadeInItem {
      from {
        opacity: 0;
        transform: translateY(-6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .staged-item-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .staged-case-id {
      font-family: 'JetBrains Mono', monospace;
      font-size: 1.15rem;
      font-weight: 800;
      color: #fff;
    }

    .btn-remove-item {
      background: none;
      border: 1px solid transparent;
      color: var(--text-dim);
      font-size: 1.15rem;
      cursor: pointer;
      min-width: 38px;
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      line-height: 1;
      border-radius: var(--radius-sm);
      transition: all 0.15s;
    }

    .btn-remove-item:hover {
      color: var(--status-alert);
      background: rgba(239, 68, 68, 0.12);
      border-color: rgba(239, 68, 68, 0.25);
    }

    .btn-remove-item:active {
      transform: scale(0.92);
    }

    body.theme-light .btn-remove-item:hover {
      background: #fee2e2;
      color: #dc2626;
      border-color: #fca5a5;
    }

    .action-pills-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .action-pill {
      padding: 7px 14px;
      border-radius: 999px;
      border: 1.5px solid var(--border-color);
      background: var(--bg-card);
      color: var(--text-muted);
      font-size: 0.84rem;
      font-weight: 700;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s ease;
    }

    .action-pill:hover {
      border-color: var(--accent-blue);
      color: var(--text-main);
    }

    .action-pill.active {
      background: var(--accent-blue);
      border-color: var(--accent-blue);
      color: #fff;
      box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    }

    .action-pill.active-in {
      background: var(--status-in);
      border-color: var(--status-in);
      color: #fff;
      box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    }

    .action-pill.active-out {
      background: var(--status-out);
      border-color: var(--status-out);
      color: #fff;
      box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
    }

    .action-pill.active-new {
      background: var(--status-new);
      border-color: var(--status-new);
      color: #fff;
      box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
    }

    .action-pill.active-return {
      background: var(--status-new);
      border-color: var(--status-new);
      color: #fff;
      box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
    }

    /* 待登記清單整批設定動作列樣式 */
    .staged-batch-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 12px;
      padding: 9px 12px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px dashed var(--border-color);
      border-radius: var(--radius-md);
      flex-wrap: wrap;
    }

    .staged-batch-label {
      font-size: 0.82rem;
      font-weight: 700;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .staged-batch-btn-group {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .btn-batch-action {
      padding: 5px 12px;
      font-size: 0.8rem;
      font-weight: 700;
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      cursor: pointer;
      transition: all var(--transition-fast);
      border: 1px solid transparent;
      background: transparent;
    }

    .btn-batch-action.in {
      background: rgba(16, 185, 129, 0.12);
      border-color: rgba(16, 185, 129, 0.4);
      color: #34d399;
    }

    .btn-batch-action.in:hover {
      background: var(--status-in);
      color: #fff;
      box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    }

    .btn-batch-action.forensic {
      background: rgba(245, 158, 11, 0.12);
      border-color: rgba(245, 158, 11, 0.4);
      color: #fbbf24;
    }

    .btn-batch-action.forensic:hover {
      background: var(--status-out);
      color: #fff;
      box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
    }

    .btn-batch-action.return {
      background: rgba(139, 92, 246, 0.12);
      border-color: rgba(139, 92, 246, 0.4);
      color: #a78bfa;
    }

    .btn-batch-action.return:hover {
      background: var(--status-new);
      color: #fff;
      box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
    }

    /* 設定頁面樣式 */
    .theme-selector-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .theme-option-card {
      border: 1.5px solid var(--border-color);
      border-radius: var(--radius-sm);
      padding: 9px 12px;
      cursor: pointer;
      background: var(--bg-card);
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.2s ease;
      min-height: 42px;
    }

    .theme-option-card:hover {
      border-color: var(--border-focus);
    }

    .theme-option-card.active {
      border-color: var(--accent-blue);
      box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
      background: rgba(37, 99, 235, 0.14);
    }

    .theme-option-icon {
      font-size: 1.25rem;
      line-height: 1;
    }

    .theme-option-title {
      font-weight: 700;
      font-size: 0.88rem;
    }

    .font-scale-group {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
    }

    .font-scale-btn {
      padding: 12px 6px;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      background: var(--bg-card);
      color: var(--text-main);
      font-weight: 700;
      font-size: 0.85rem;
      cursor: pointer;
      text-align: center;
      transition: all 0.2s ease;
      line-height: 1.3;
    }

    .font-scale-btn:hover {
      border-color: var(--border-focus);
    }

    .font-scale-btn.active {
      background: var(--accent-blue);
      border-color: var(--accent-blue);
      color: #fff;
      box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    }

    /* ==========================================================================
       SVG 圖示全域標準尺寸與精準佈局適配 (完美支援字體縮放、流暢居中與各情境自適應)
       ========================================================================== */
    .app-icon {
      width: 1.15em;
      height: 1.15em;
      display: inline-block;
      vertical-align: -0.18em;
      flex-shrink: 0;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
      fill: none;
      box-sizing: content-box;
      pointer-events: none;
    }

    /* 在 Flex / Inline-Flex 容器中，圖示應完全居中對齊，不偏下 */
    .btn,
    .tab-btn,
    .action-pill,
    .badge,
    .case-tag-note,
    .case-tag-agency,
    .case-tag-reason,
    .device-count-badge,
    .btn-quick-action,
    .my-cases-subtab-btn,
    .forensic-filter-btn,
    .btn-icon-circle,
    h1,
    h2,
    h3,
    h4 {
      /* 確保圖示與容器內文字垂直居中 */
    }

    .btn .app-icon,
    .tab-btn .app-icon,
    .action-pill .app-icon,
    .badge .app-icon,
    .case-tag-note .app-icon,
    .case-tag-agency .app-icon,
    .case-tag-reason .app-icon,
    .device-count-badge .app-icon,
    .btn-quick-action .app-icon,
    .my-cases-subtab-btn .app-icon,
    .forensic-filter-btn .app-icon,
    h1 .app-icon,
    h2 .app-icon,
    h3 .app-icon {
      vertical-align: middle;
    }

    /* 按鈕內包裹圖示的 span 保持 inline-flex 居中 */
    .btn span:has(> .app-icon),
    .my-cases-subtab-btn span:has(> .app-icon),
    .forensic-filter-btn span:has(> .app-icon),
    .tab-scanner-mode-btn span:has(> .app-icon) {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      vertical-align: middle;
    }

    /* 旋轉動畫 (用於載入中或重新同步) */
    .spin-inline {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      animation: appIconSpin 0.9s linear infinite;
      vertical-align: middle;
      line-height: 1;
    }

    @keyframes appIconSpin {
      from {
        transform: rotate(0deg);
      }

      to {
        transform: rotate(360deg);
      }
    }

    /* 1. 導覽頁籤 (手機底部直式 vs 電腦左側橫式) */
    .tab-btn .tab-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      flex-shrink: 0;
      line-height: 1;
    }

    /* 手機版直式排列：圖示置中於按鈕上方 */
    @media (max-width: 768px) {
      .tab-btn .tab-icon {
        margin: 0 auto;
      }
    }

    /* 電腦版橫式排列：圖示靠左，絕不可用 margin: 0 auto 撐開排版 */
    @media (min-width: 769px) {
      .tab-btn .tab-icon {
        margin: 0;
      }
    }

    .tab-btn .tab-icon .app-icon {
      width: 20px;
      height: 20px;
      stroke-width: 2.2;
    }

    /* 2. 頂部按鈕列 (通知按鈕、重新整理按鈕、PWA 安裝標章) */
    .btn-icon-circle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      touch-action: manipulation;
      user-select: none;
      -webkit-user-select: none;
    }

    .btn-icon-circle .app-icon,
    #header-refresh-icon svg,
    #desktop-refresh-icon svg {
      width: 20px;
      height: 20px;
      margin: 0 !important;
      display: block;
    }

    #header-refresh-icon,
    #desktop-refresh-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
    }

    /* 雲端資料下載：更新時不旋轉，改為箭頭持續向下串流動畫 */
    #header-refresh-icon.spin,
    #desktop-refresh-icon.spin {
      animation: none !important;
    }

    #header-refresh-icon.spin .cloud-arrow-down-group,
    #desktop-refresh-icon.spin .cloud-arrow-down-group {
      animation: cloudArrowStreamDown 0.85s cubic-bezier(0.4, 0, 0.2, 1) infinite;
      will-change: transform, opacity;
    }

    @keyframes cloudArrowStreamDown {
      0% {
        transform: translateY(-2.5px);
        opacity: 0;
      }

      25% {
        opacity: 1;
      }

      75% {
        opacity: 1;
      }

      100% {
        transform: translateY(2.8px);
        opacity: 0;
      }
    }

    /* 畫面往下滑 (Pull to Refresh) 視覺反饋指示器：定位於螢幕最頂部下拉區 */
    .pull-to-refresh-indicator {
      position: fixed;
      top: calc(env(safe-area-inset-top, 0px) + 8px);
      left: 0;
      right: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      pointer-events: none;
      z-index: 10018;
      transform: translateY(-80px) scale(0.9);
      opacity: 0;
      transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease;
      will-change: transform, opacity;
    }

    .pull-to-refresh-indicator.pulling {
      transition: none;
    }

    .pull-to-refresh-indicator.refreshing {
      transform: translateY(12px) scale(1) !important;
      opacity: 1 !important;
      transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease;
    }

    .pull-refresh-pill {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      background: rgba(18, 25, 41, 0.98);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border: 1.5px solid rgba(59, 130, 246, 0.6);
      border-radius: 999px;
      padding: 8px 20px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(59, 130, 246, 0.45);
      transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    }

    .pull-to-refresh-indicator.ready .pull-refresh-pill {
      border-color: rgba(16, 185, 129, 0.8);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 22px rgba(16, 185, 129, 0.5);
      transform: scale(1.04);
    }

    .pull-refresh-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.2s ease;
    }

    .pull-refresh-icon svg {
      width: 19px;
      height: 19px;
      display: block;
    }

    .pull-to-refresh-indicator.ready .pull-refresh-icon {
      transform: scale(1.15);
    }

    .pull-to-refresh-indicator.refreshing .pull-refresh-icon .cloud-arrow-down-group {
      animation: cloudArrowStreamDown 0.85s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    }

    .pull-refresh-text {
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--text-main);
      white-space: nowrap;
    }

    body.theme-light .pull-refresh-pill {
      background: rgba(255, 255, 255, 0.98);
      border-color: rgba(37, 99, 235, 0.6);
      box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18), 0 0 16px rgba(37, 99, 235, 0.3);
    }

    body.theme-light .pull-refresh-text {
      color: #0f172a;
    }

    .text-primary {
      color: var(--accent-blue, #3b82f6) !important;
    }

    .header-msg-btn .msg-btn-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .header-msg-btn .msg-btn-icon .app-icon {
      width: 19px;
      height: 19px;
    }

    .header-pwa-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .header-pwa-badge .app-icon {
      width: 16px;
      height: 16px;
      stroke-width: 2.4;
    }

    /* 3. 登入防護卡與相機授權大圖示 */
    .login-badge-icon .app-icon {
      width: 32px;
      height: 32px;
      color: #ffffff;
      stroke-width: 2.2;
    }

    .camera-unauth-icon .app-icon {
      width: 52px;
      height: 52px;
      color: #ef4444;
    }

    /* 4. 標題與段落圖示 (如 <h3> 待登記清單、個人案件、登入帳號、主題外觀等) */
    h3 .app-icon {
      width: 1.25em;
      height: 1.25em;
      stroke-width: 2.2;
      vertical-align: -0.15em;
      color: var(--accent-blue);
    }

    /* 5. 一般按鈕與操作列按鈕 */
    .btn .app-icon {
      width: 1.15em;
      height: 1.15em;
      margin-right: 4px;
      vertical-align: middle;
    }

    .action-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .action-pill .app-icon {
      width: 1.1em;
      height: 1.1em;
      stroke-width: 2.2;
    }

    .batch-action-tag .app-icon,
    .btn-quick-action .app-icon {
      width: 1.05em;
      height: 1.05em;
      margin-right: 3px;
      vertical-align: middle;
    }

    .my-cases-subtab-btn .app-icon,
    .forensic-filter-btn .app-icon {
      width: 1.1em;
      height: 1.1em;
      margin-right: 4px;
      vertical-align: middle;
    }

    /* 6. 案件卡片內的標籤與資訊欄 (自適應文字大小，不再縮成 12px 模糊小點) */
    .case-tag-note,
    .case-tag-agency,
    .case-tag-reason,
    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      vertical-align: middle;
    }

    .case-tag-note .app-icon,
    .case-tag-agency .app-icon,
    .case-tag-reason .app-icon,
    .badge .app-icon {
      width: 1.1em;
      height: 1.1em;
      stroke-width: 2.1;
      vertical-align: middle;
    }

    /* 扣押物品 (手機/電腦/其他) 數量標籤：圖示清晰可辨識 */
    .device-count-badge {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      vertical-align: middle;
      padding: 2px 5px;
      border-radius: 4px;
      font-size: 0.76rem;
      font-weight: 700;
      line-height: 1.2;
    }

    .device-count-badge .app-icon {
      width: 1.1em;
      height: 1.1em;
      stroke-width: 2.2;
      vertical-align: middle;
    }

    .case-tag-devices {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      vertical-align: middle;
    }

    /* 7. 卡片勾選框與全選方框 (Check indicator) */
    .card-check-indicator {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .card-check-indicator .app-icon {
      width: 14px;
      height: 14px;
      stroke-width: 3.2;
      color: #ffffff;
      margin: auto;
    }

    .select-all-box {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .select-all-box .app-icon {
      width: 12px;
      height: 12px;
      stroke-width: 3.2;
      margin: auto;
    }

    /* 8. 清除與刪除按鈕 */
    .btn-remove-item .app-icon {
      width: 18px;
      height: 18px;
    }

    .batch-item-remove-btn .app-icon,
    .msg-card-delete-btn .app-icon {
      width: 14px;
      height: 14px;
    }

    /* 9. 狀態圓點 (FCM 綁定狀態指示燈) */
    .status-dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-right: 6px;
      vertical-align: middle;
      flex-shrink: 0;
    }

    .status-dot.dot-green {
      background: #10b981;
      box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
    }

    .status-dot.dot-red {
      background: #ef4444;
      box-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
    }

    .status-dot.dot-yellow {
      background: #f59e0b;
      box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
    }

    /* 10. 主題選擇器與外觀按鈕 */
    .theme-option-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .theme-option-icon .app-icon {
      width: 18px;
      height: 18px;
    }

    /* 11. 對話框確認圖示與空狀態大圖示 */
    #confirm-modal-icon .app-icon {
      width: 36px;
      height: 36px;
      color: #38bdf8;
    }

    .pwa-feature-item .app-icon {
      width: 22px;
      height: 22px;
    }

    .msg-btn-readall .app-icon,
    .msg-btn-clear .app-icon {
      width: 14px;
      height: 14px;
    }

    .msg-btn-close .app-icon {
      width: 16px;
      height: 16px;
    }

    /* 12. 底部浮動操作列圖示 */
    .batch-floating-bar .app-icon {
      vertical-align: middle;
    }

    .batch-count-icon {
      width: 1.25em;
      height: 1.25em;
      vertical-align: middle;
      color: #60a5fa;
    }