@font-face {
    font-family: "GuruQiuWan";
    src: url("../fonts/r.ttf?v=20261113007") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-color: #A67B5B;
    --primary-deep: #8F684C;
    --brand-brown: #7A5A45;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --scrollbar-width: 0px;
    --bs-primary: #A67B5B;
    --bs-primary-rgb: 166, 123, 91;
    --bs-link-color: #8F684C;
    --bs-link-hover-color: #6E5140;
    --bs-focus-ring-color: rgba(166, 123, 91, 0.28);
}

/* Modal 打開時防止背景跳動 - 完整修復 */
html {
    overflow-y: scroll;
    /* 永遠顯示滾動條，避免跳動 */
}

html,
body {
    font-family: "GuruQiuWan", "Microsoft JhengHei", "PingFang TC", sans-serif;
    background: linear-gradient(165deg, #FFF8F2 0%, #F6E6D6 58%, #E6DDD6 100%);
    min-height: 100vh;
}

body {
    position: relative;
    z-index: 0;
}

body.modal-open {
    overflow: hidden !important;
    padding-right: 0 !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

.modal-backdrop {
    position: fixed;
}

.modal {
    padding-right: 0 !important;
    overflow-y: scroll;
    /* Modal 內部滾動 */
}

.modal-dialog {
    margin-right: auto;
    margin-left: auto;
}

.section-view {
    display: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.active-view {
    display: block;
}

.site-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.site-logo-nav {
    height: 48px;
}

.site-logo-splash {
    height: 64px;
    margin: 0 auto 1rem;
}

.site-logo-auth {
    height: 64px;
    margin: 0 auto;
}

.site-logo-footer {
    height: 52px;
    margin: 0 auto .75rem;
}

.site-footer {
    margin-top: 3rem;
    padding: 1.25rem 0 1.75rem;
}

.site-footer-copy {
    color: #6E5140;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.site-paws {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.site-paw,
.splash-paw,
.footer-paw,
.auth-paw {
    display: block;
    width: 56px;
    height: auto;
    user-select: none;
    pointer-events: none;
}

.site-paw {
    position: absolute;
    opacity: 0.55;
}

.site-paw-a {
    top: 96px;
    right: max(12px, calc((100% - 960px) / 2 - 78px));
    width: 52px;
    transform: rotate(16deg);
}

.site-paw-b {
    bottom: 72px;
    left: max(12px, calc((100% - 960px) / 2 - 64px));
    width: 36px;
    opacity: 0.4;
    transform: rotate(-18deg);
}

.splash-paw {
    width: 34px;
    margin: 0 auto 10px;
    transform: rotate(-12deg);
}

.footer-paw {
    width: 26px;
    margin: 0 auto 8px;
    transform: rotate(8deg);
}

.auth-card {
    position: relative;
}

.auth-paw {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    opacity: 0.85;
    transform: rotate(14deg);
    z-index: 1;
}

@media (max-width: 1280px) {
    .site-paw-a,
    .site-paw-b {
        display: none;
    }
}

/* 啟動中：遮罩蓋住內容，避免登入畫面閃現 */
.app-boot-splash {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(165deg, #FFF8F2 0%, #F6E6D6 58%, #E6DDD6 100%);
}

.app-boot-splash .text-white-50 {
    color: rgba(110, 81, 64, 0.72) !important;
}

.app-boot-splash .spinner-border {
    color: #A67B5B !important;
}

.app-boot-splash-inner {
    text-align: center;
}

html.app-ready .app-boot-splash,
body.app-ready .app-boot-splash {
    display: none !important;
}

html.app-booting:not(.app-ready) .section-view.active-view {
    /* 啟動完成前即使有 active-view 也不露出，避免登入閃爍 */
    visibility: hidden;
}

.card-request,
.card-service {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    /* Ensure relative positioning for absolute badge */
}

/* Request Card: Allow badge to hang off the corner */
.card-request,
.market-card,
.svc-card {
    position: relative;
    overflow: visible;
}

.new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ff4757);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: .04em;
    padding: 2px 8px;
    border-radius: 12px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(255, 71, 87, 0.4);
    animation: pulse-badge 2s infinite;
    pointer-events: none;
}

/* Adjust position specifically for Request Cards to avoid blocking status badge */
.card-request .new-badge {
    top: -10px;
    right: -10px;
}

.market-card .new-badge {
    top: 8px;
    right: 8px;
}

.svc-card .new-badge {
    top: 8px;
    left: 8px;
    right: auto;
}

@keyframes pulse-badge {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.card-request:hover,
.card-service:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.chat-box,
.quote-chat-box {
    height: 400px;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    box-sizing: border-box;
}

/* 聊天圖片預覽區 */
.chat-image-preview {
    padding: 8px;
    background: #f0f0f0;
    border-radius: 8px;
}

.chat-image-preview .btn-close {
    padding: 2px 4px;
    font-size: 8px;
}

/* 聊天訊息中的圖片：跟著氣泡（對話框寬度的百分比）縮放，不溢出。不含頭像 */
.chat-msg-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(220px, 46vw);
    object-fit: contain;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
    box-sizing: border-box;
}

.chat-image-preview {
    max-width: 100%;
}

.chat-image-preview .position-relative {
    max-width: 100%;
}

#feedbackMessagesContainer {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

#feedbackMessagesContainer .d-inline-block {
    max-width: 80%;
    box-sizing: border-box;
}

.chat-image-preview img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    box-sizing: border-box;
}

.chat-msg-image:hover {
    opacity: 0.92;
}

/* 圖片放大檢視 */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
}

.image-lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.msg-bubble {
    max-width: 75%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 新訊息滑入動畫 */
.msg-new {
    animation: slideInNew 0.4s ease-out;
}

@keyframes slideInNew {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

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

/* 輪詢狀態指示器 */
.polling-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    z-index: 1000;
    display: none;
    animation: fadeInIndicator 0.3s ease;
    transition: background 0.3s ease;
}

@keyframes fadeInIndicator {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.polling-indicator.active {
    display: flex;
    align-items: center;
    gap: 8px;
}

.polling-indicator.paused {
    background: rgba(255, 193, 7, 0.9);
    color: #000;
}

/* 快速模式 - 綠色 */
.polling-indicator.fast-mode {
    background: rgba(40, 167, 69, 0.9);
}

.polling-indicator.fast-mode .polling-dot {
    animation: fastPulse 0.5s infinite;
}

@keyframes fastPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.polling-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

.polling-indicator.paused .polling-dot {
    background: #dc3545;
    animation: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.msg-self {
    background: #F3E0CC;
    color: #5C4334;
    margin-left: auto;
    text-align: right;
}

.msg-other {
    background: #ffffff;
    border: 1px solid #E4D8CE;
}

.msg-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 5px;
}

.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar.bg-dark {
    background-color: #7A5A45 !important;
}

.navbar.navbar-dark {
    --bs-navbar-color: #FFF8F2;
    --bs-navbar-hover-color: #FFFFFF;
    --bs-navbar-active-color: #FFFFFF;
    --bs-navbar-disabled-color: rgba(255, 248, 242, 0.65);
}

.navbar.navbar-dark .navbar-nav .nav-link {
    color: #FFF8F2;
}

.navbar.navbar-dark .navbar-nav .nav-link:hover,
.navbar.navbar-dark .navbar-nav .nav-link:focus,
.navbar.navbar-dark .navbar-nav .nav-link.show,
.navbar.navbar-dark .navbar-nav .nav-link.active {
    color: #FFFFFF;
}

.navbar-top-tools {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-left: auto;
    order: 1;
}

.navbar-top-tools .navbar-toggler {
    margin: 0;
}

.nav-role-mode {
    display: inline-flex;
    align-items: center;
    padding: .32rem .65rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
}

.nav-role-mode[hidden] {
    display: none !important;
}

.nav-role-mode.is-provider {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border-color: rgba(110, 231, 183, 0.45);
}

.nav-role-mode.is-client {
    background: rgba(56, 189, 248, 0.18);
    color: #7dd3fc;
    border-color: rgba(125, 211, 252, 0.45);
}

@media (min-width: 992px) {
    .navbar > .container-fluid {
        flex-wrap: nowrap;
        align-items: center;
    }

    .navbar-brand.site-brand {
        display: flex;
        align-items: center;
        white-space: nowrap;
        flex-shrink: 0;
        margin-right: .75rem;
        padding-top: .35rem;
        padding-bottom: .35rem;
    }

    .navbar-top-tools {
        order: 2;
        margin-left: .5rem;
        flex-shrink: 0;
    }

    .navbar .navbar-collapse {
        order: 1;
        flex-grow: 1;
        min-width: 0;
    }

    #navLinks.navbar-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
        row-gap: .15rem;
    }

    #navLinks .nav-item {
        flex: 0 0 auto;
    }

    #navLinks .nav-link {
        white-space: nowrap;
        font-size: .95rem;
        padding: .45rem .5rem;
    }
}

@media (max-width: 991.98px) {
    .navbar-brand.site-brand {
        display: flex;
        align-items: center;
        margin-right: .5rem;
        max-width: calc(100% - 8.5rem);
        overflow: hidden;
        padding-top: .25rem;
        padding-bottom: .25rem;
    }

    .site-logo-nav {
        height: 40px;
    }

    .nav-role-mode {
        font-size: 11px;
        padding: .3rem .55rem;
    }
}

.content-wrapper {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/*
 * 前台內容寬度統一（含需求大廳、我的預約、專案、市場等）
 * 對齊 Bootstrap lg 容器 960px，避免筆電／寬螢幕把白底框拉滿整頁。
 */
.container.app-page,
.app-page.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}
@media (min-width: 992px) {
    .container.app-page,
    .app-page.container {
        max-width: 960px !important;
    }
}

.btn-custom {
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, #F8E7D6 0%, #EAD6C4 100%);
    color: #5C4334;
    border-radius: 15px 15px 0 0;
}

.modal-header .modal-title,
.modal-header .text-white {
    color: #5C4334 !important;
}

.modal-header .btn-close {
    filter: none;
    opacity: 0.55;
}

.form-control:focus,
.form-select:focus {
    border-color: #A67B5B;
    box-shadow: 0 0 0 0.2rem rgba(166, 123, 91, 0.25);
}

.table-hover tbody tr:hover {
    background-color: rgba(166, 123, 91, 0.05);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.quote-card {
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    overflow: visible;
}

.quote-card:hover {
    border-left-color: var(--success-color);
}

.quote-price-header {
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    border-bottom: 1px solid #6ee7b7;
    padding: 16px 18px;
}

.quote-price-header.is-pending {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom-color: #d1d5db;
}

.quote-price-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quote-price-block {
    min-width: 0;
}

.quote-price-label {
    display: block;
    margin-bottom: 4px;
    color: #047857;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.quote-price-header.is-pending .quote-price-label {
    color: #6b7280;
}

.quote-price-value {
    display: block;
    color: #9a3412;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.quote-price-header.is-pending .quote-price-value {
    color: #6b7280;
    font-size: 1.35rem;
    font-weight: 700;
}

.quote-price-profile-btn {
    flex-shrink: 0;
    white-space: nowrap;
    background: #fff;
}

.project-timeline {
    position: relative;
    padding-left: 30px;
}

.project-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
}

.scrollbar-custom::-webkit-scrollbar {
    width: 8px;
}

.scrollbar-custom::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.scrollbar-custom::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.scrollbar-custom::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 照片上傳區域 */
#reviewPhotoDropZone {
    transition: all 0.3s ease;
    border: 2px dashed #dee2e6;
}

#reviewPhotoDropZone:hover {
    border-color: #A67B5B;
    background: #FFF1E6 !important;
}

#reviewPhotoDropZone.border-primary {
    border-color: #A67B5B !important;
}

/* 驗收照片縮圖 */
.review-photo-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.review-photo-thumb {
    transition: transform 0.3s ease;
}

.review-photo-thumb:hover {
    transform: scale(1.02);
}

/* RWD 照片顯示 */
@media (max-width: 768px) {
    .review-photo-container img {
        max-height: 200px;
    }

    #reviewPhotoDropZone {
        min-height: 150px !important;
    }

    #reviewPhotoPreview img {
        max-height: 120px !important;
    }
}

@media (max-width: 576px) {
    .review-photo-container img {
        max-height: 150px;
    }
}

/* 照片 Modal */
#photoViewModal .modal-content {
    background: rgba(0, 0, 0, 0.9);
}

#photoViewModal .modal-body {
    padding: 20px;
}

#photoViewModal img {
    max-width: 100%;
    height: auto;
}

/* 頭像上傳樣式 */
.avatar-upload-container {
    display: flex;
    justify-content: center;
}

.avatar-preview-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 4px solid #A67B5B;
    box-shadow: 0 4px 15px rgba(166, 123, 91, 0.3);
    transition: all 0.3s ease;
}

.avatar-preview-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(166, 123, 91, 0.4);
}

.avatar-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
}

.avatar-preview-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.avatar-overlay i {
    font-size: 2rem;
    margin-bottom: 5px;
}

.avatar-overlay span {
    font-size: 0.85rem;
}

/* 小型頭像（用於列表顯示）*/
.person-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-width: 0;
    max-width: 100%;
    vertical-align: middle;
}
.person-chip img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #eef0f3;
    border: 1px solid #e4e7ec;
}
.person-chip .person-chip-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.person-chip.is-sm img { width: 24px; height: 24px; }
.person-chip.is-lg img { width: 40px; height: 40px; }

.person-chip-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.person-chip-link:hover .person-chip-name,
.person-chip-link:focus-visible .person-chip-name {
    text-decoration: underline;
}

.person-chip-link:focus-visible {
    outline: 2px solid #8F684C;
    outline-offset: 2px;
    border-radius: 999px;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dee2e6;
}

.avatar-md {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #A67B5B;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #A67B5B;
}

/* 預設頭像選擇器 */
.default-avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.default-avatar-item {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
}

.default-avatar-item:hover {
    border-color: #A67B5B;
    transform: scale(1.1);
}

.default-avatar-item.selected {
    border-color: #28a745;
}

/* 電話連結樣式 */
.phone-link {
    color: #A67B5B;
    transition: all 0.2s ease;
}

.phone-link:hover {
    color: #8F684C;
    text-decoration: underline !important;
}

.phone-link i {
    margin-right: 3px;
}

/* 驗證碼樣式 */
.captcha-img {
    width: 120px;
    height: 38px;
    border: 1px solid #ced4da;
    border-radius: 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
    background-color: #f5f5f5;
    object-fit: contain;
}

/* 驗證碼載入中狀態 */
.captcha-img[src=""],
.captcha-img:not([src]) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: captchaLoading 1.5s infinite;
}

@keyframes captchaLoading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.captcha-img:hover {
    opacity: 0.8;
}

/* 驗證碼容器 - 確保載入時不會跳動 */
.input-group .captcha-img {
    min-width: 120px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .avatar-preview-wrapper {
        width: 120px;
        height: 120px;
    }

    .default-avatar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 防止 Modal 打開時背景滾動與跳動 - 完整解決方案 */
body.modal-open-fixed {
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* top 會由 JavaScript 動態設定 */
}

/* 商家認證文件樣式 */
.verification-card {
    border-left: 4px solid #6c757d;
    transition: all 0.3s ease;
}

.verification-card.status-pending {
    border-left-color: #ffc107;
}

.verification-card.status-approved {
    border-left-color: #198754;
}

.verification-card.status-rejected {
    border-left-color: #dc3545;
}

.verification-preview {
    max-height: 150px;
    object-fit: contain;
    cursor: pointer;
}

/* 瀏覽次數樣式 */
.view-count-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* 帳號記憶下拉選單 */
.username-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
}

.username-dropdown .dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.username-dropdown .dropdown-item:hover {
    background: #FFF1E6;
}

.username-dropdown .dropdown-item .btn-close {
    opacity: 0.5;
    font-size: 0.6rem;
}

.username-dropdown .dropdown-item:hover .btn-close {
    opacity: 1;
}

.username-dropdown .username-text {
    font-weight: 500;
}

/* ==================== 服務市場類別篩選樣式 ==================== */

/* ==================== 商家作品集樣式 ==================== */

/* 橫向滑動作品集 */
.portfolio-slider {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 8px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.portfolio-slider::-webkit-scrollbar {
    height: 6px;
}

.portfolio-slider::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 3px;
}

.portfolio-slider::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 3px;
}

.portfolio-slider::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* 作品項目 */
.portfolio-item {
    flex: 0 0 auto;
    width: 180px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portfolio-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.portfolio-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.portfolio-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 作品集管理卡片 */
.portfolio-manage-card {
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.portfolio-manage-card:hover {
    border-color: #A67B5B;
    box-shadow: 0 4px 12px rgba(166, 123, 91, 0.2);
}

.portfolio-manage-card .card-img-top {
    transition: transform 0.2s ease;
}

.portfolio-manage-card:hover .card-img-top {
    transform: scale(1.02);
}

/* 作品上傳拖放區 */
#portfolioImagePreview {
    transition: all 0.3s ease;
    border: 2px dashed #dee2e6 !important;
}

#portfolioImagePreview:hover {
    border-color: #A67B5B !important;
    background: #FFF1E6 !important;
}

#portfolioImagePreview.dragover {
    border-color: #A67B5B !important;
    background: #e3f2fd !important;
}

/* RWD 調整 */
@media (max-width: 768px) {
    .portfolio-item {
        width: 150px;
    }

    .portfolio-item img {
        height: 120px;
    }

    .portfolio-title {
        font-size: 0.75rem;
        padding: 6px;
    }
}

@media (max-width: 576px) {
    .portfolio-item {
        width: 130px;
    }

    .portfolio-item img {
        height: 100px;
    }
}

/* 類別篩選容器 */
.category-filter-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
}

/* 類別標籤容器 */
.category-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* 類別標籤按鈕 */
.category-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-filter-tag:hover {
    border-color: #A67B5B;
    background: #FFF1E6;
    color: #A67B5B;
    transform: translateY(-1px);
}

.category-filter-tag:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(166, 123, 91, 0.25);
}

/* 已選擇狀態 */
.category-filter-tag.active {
    background: linear-gradient(135deg, #A67B5B 0%, #8F684C 100%);
    border-color: #A67B5B;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(166, 123, 91, 0.4);
}

.category-filter-tag.active:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4293 100%);
    border-color: #5a6fd6;
    color: #ffffff;
}

.category-filter-tag.active i {
    color: #ffffff;
}

/* 類別標籤圖示 */
.category-filter-tag i {
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

.category-filter-tag:hover i {
    transform: scale(1.1);
}

/* 類別計數徽章 */
#marketCategoryCount {
    font-size: 0.7rem;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
}

/* 服務數量標籤 */
.category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    background: #28a745;
    border-radius: 10px;
    margin-left: 4px;
}

.category-count.empty {
    background: #adb5bd;
    color: #6c757d;
}

/* 已選擇狀態的數量標籤 */
.category-filter-tag.active .category-count {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.category-filter-tag.active .category-count.empty {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

/* 停用狀態（無服務） */
.category-filter-tag.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    border-color: #dee2e6;
}

.category-filter-tag.disabled:hover {
    transform: none;
    border-color: #dee2e6;
    background: #f8f9fa;
    color: #495057;
}

/* RWD 調整 */
@media (max-width: 768px) {
    .category-filter-container {
        max-height: 150px;
        padding: 10px;
    }

    .category-filter-tag {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .category-filter-tags {
        gap: 6px;
    }
}

@media (max-width: 576px) {
    .category-filter-container {
        max-height: 120px;
    }

    .category-filter-tag {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .category-filter-tag i {
        font-size: 0.8rem;
    }
}

/* 深色模式支援（選用） */
@media (prefers-color-scheme: dark) {
    .category-filter-container {
        background: #2d3748;
    }

    .category-filter-tag {
        background: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .category-filter-tag:hover {
        background: #A67B5B;
        border-color: #A67B5B;
        color: #ffffff;
    }
}

/* 滾動條樣式 */
.category-filter-container::-webkit-scrollbar {
    width: 6px;
}

.category-filter-container::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 3px;
}

.category-filter-container::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 3px;
}

.category-filter-container::-webkit-scrollbar-thumb:hover {
    background: #868e96;
}

/* 載入動畫 */
.category-filter-container .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    margin-right: 8px;
}

/* 篩選結果高亮（類別在卡片上的顯示） */
.badge.bg-primary {
    animation: highlightPulse 0.5s ease;
}

@keyframes highlightPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* ==================== 特約廠商標籤 ==================== */
.avatar-wrapper,
.avatar-wrapper-sm,
.avatar-wrapper-lg {
    position: relative;
    display: inline-block;
    overflow: visible;
    /* 預留標籤空間，避免被外層 overflow:hidden / 圓角裁切 */
    padding-top: 10px;
    padding-right: 14px;
    margin-top: -10px;
    margin-right: -14px;
    vertical-align: top;
}

.featured-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
    z-index: 5;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* 大頭像的特約標籤 */
.avatar-wrapper-lg {
    padding-top: 12px;
    padding-right: 18px;
    margin-top: -12px;
    margin-right: -18px;
}

.avatar-wrapper-lg .featured-badge {
    font-size: 11px;
    padding: 3px 8px;
}

/* 小頭像的特約標籤 */
.avatar-wrapper-sm {
    padding-top: 8px;
    padding-right: 10px;
    margin-top: -8px;
    margin-right: -10px;
}

.avatar-wrapper-sm .featured-badge {
    font-size: 8px;
    padding: 1px 4px;
}

/* 特約廠商標籤動畫 */
.featured-badge {
    animation: featuredShine 3s ease-in-out infinite;
}

@keyframes featuredShine {

    0%,
    100% {
        box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
    }

    50% {
        box-shadow: 0 2px 12px rgba(255, 107, 53, 0.7);
    }
}

/* 特約廠商名牌（帳號資訊頁面） */
.featured-merchant-banner {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #f7931e, #ffcc00);
    background-size: 200% 200%;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 25px;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    animation: featuredBannerGlow 3s ease-in-out infinite, featuredBannerGradient 4s ease infinite;
}

.featured-merchant-banner i {
    color: #fff;
    margin: 0 5px;
    animation: featuredStarPulse 1.5s ease-in-out infinite;
}

@keyframes featuredBannerGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6);
        transform: scale(1.02);
    }
}

@keyframes featuredBannerGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes featuredStarPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* ==================== 商家專業類別牆 ==================== */

/* 專業類別編輯清單 */
.expertise-category-list {
    max-height: 400px;
    overflow-y: auto;
}

.expertise-category-group {
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.expertise-category-header {
    background: #f8f9fa;
    padding: 10px 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.expertise-category-header:hover {
    background: #e9ecef;
}

.expertise-category-header img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
}

.expertise-category-items {
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.expertise-item-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.expertise-item-check:hover {
    border-color: #ffc107;
    background: #fffbeb;
}

.expertise-item-check.checked {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.expertise-item-check input {
    display: none;
}

/* 專業類別牆（顯示用） */
.expertise-wall {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
    padding: 10px 0;
}

.expertise-ball {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 50%;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: default;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    padding: 8px;
    position: relative;
}

.expertise-ball:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.expertise-ball-num {
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.expertise-ball-name {
    font-size: 10px;
    font-weight: 500;
    margin-top: 2px;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 等級 1-3：基礎等級，無特效 */
.expertise-level-1,
.expertise-level-2,
.expertise-level-3 {
    /* 基礎樣式 */
}

/* 等級 4-5：中級，輕微光暈 */
.expertise-level-4,
.expertise-level-5 {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25), 0 0 10px rgba(255, 255, 255, 0.2);
}

/* 等級 6-7：高級，明顯光暈 */
.expertise-level-6,
.expertise-level-7 {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25), 0 0 15px rgba(255, 255, 255, 0.3);
}

/* 等級 8-9：菁英，脈動效果 */
.expertise-level-8,
.expertise-level-9 {
    animation: expertisePulse 2s ease-in-out infinite;
}

@keyframes expertisePulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25), 0 0 15px rgba(255, 255, 255, 0.3);
    }

    50% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 25px rgba(255, 255, 255, 0.5);
    }
}

/* 等級 10：傳奇宗師，金色光環 + 旋轉漸層邊框 */
.expertise-level-10 {
    animation: expertiseLegendary 3s ease-in-out infinite;
    position: relative;
}

.expertise-level-10::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ffd700, #ff6b35, #8e44ad, #3498db, #ffd700);
    background-size: 400% 400%;
    animation: expertiseRainbow 4s linear infinite;
    z-index: -1;
}

@keyframes expertiseLegendary {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(142, 68, 173, 0.5), 0 0 30px rgba(255, 215, 0, 0.4);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 6px 30px rgba(142, 68, 173, 0.7), 0 0 40px rgba(255, 215, 0, 0.6);
        transform: scale(1.05);
    }
}

@keyframes expertiseRainbow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 400% 50%;
    }
}

/* hover 時暫停動畫，放大效果 */
.expertise-ball:hover {
    animation-play-state: paused;
}

.expertise-level-10:hover {
    transform: scale(1.15) !important;
}

/* 成就說明表格顏色圓點 */
.expertise-color-dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.expertise-legendary-dot {
    animation: legendaryDotPulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(142, 68, 173, 0.5);
}

@keyframes legendaryDotPulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(142, 68, 173, 0.5), 0 0 10px rgba(255, 215, 0, 0.3);
    }

    50% {
        box-shadow: 0 0 10px rgba(142, 68, 173, 0.8), 0 0 20px rgba(255, 215, 0, 0.6);
    }
}

/* 聊天室鎖定遮罩 */
.chat-lock-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.9) 70%, rgba(255, 255, 255, 0) 100%);
    padding: 30px 15px 15px;
    z-index: 10;
}

.chat-lock-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 25px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.chat-lock-message i {
    font-size: 1.2em;
}

/* 媒合成功橫幅動畫 */
#mqMatchedBanner {
    animation: matchedPulse 2s ease-in-out infinite;
}

@keyframes matchedPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
}

/* 評價卡片樣式 */
.review-card {
    transition: box-shadow 0.2s;
}

.review-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 驗收成果按鈕 */
.review-card .btn-outline-success {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.review-card .btn-outline-success:hover {
    transform: translateY(-1px);
}

/* 收折圖示旋轉動畫 */
.collapse-icon {
    transition: transform 0.3s ease;
}

.collapse-icon.rotate-180 {
    transform: rotate(180deg);
}

/* 驗收成果圖片容器 */
.review-photo-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
}

.review-photo-wrapper img {
    transition: transform 0.2s, box-shadow 0.2s;
}

.review-photo-wrapper img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 問與答樣式 */
.qna-item {
    border-radius: 8px;
    overflow: hidden;
}

.qna-question {
    background: #f8f9fa;
}

.qna-answer {
    background: linear-gradient(135deg, #f0fff4 0%, #f8fff8 100%);
}

.qna-manage-item {
    transition: background 0.2s;
}

.qna-manage-item:hover {
    background: #f8f9fa;
}

/* 作品集 YouTube 標記 */
.portfolio-item {
    position: relative;
}

.portfolio-youtube-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 0, 0, 0.9);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.portfolio-youtube-badge i {
    margin: 0;
}

/* 全螢幕 Loading */
.fullscreen-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.fullscreen-loading-content {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.fullscreen-loading-content p {
    color: #666;
    font-size: 1.1rem;
}

/* 圖片預覽 Modal 最上層 */
#photoViewModal {
    z-index: 1070 !important;
}

#photoViewModal+.modal-backdrop {
    z-index: 1065 !important;
}

/* 通知未讀藍點 */
.notif-unread-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #A67B5B;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(166, 123, 91, 0.2);
}

/* 未讀通知項目背景 */
.notif-unread {
    background-color: rgba(166, 123, 91, 0.06) !important;
}

.notif-unread:hover {
    background-color: rgba(166, 123, 91, 0.12) !important;
}

/* 保留舊的 tile 樣式以防其他地方使用 */
.expertise-tile {
    display: none;
}

/* 預覽小標籤 */
.expertise-preview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.expertise-preview-tag {
    background: #fff3cd;
    color: #856404;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
}

/* 文字截斷 - 2行 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 需求卡片民眾統計 */
.card-request .badge {
    font-size: 0.75rem;
}

/* 服務市場卡片樣式 */
.card-service {
    border: 2px solid #b3d9f2 !important;
    border-radius: 12px !important;
    transition: all 0.2s ease;
}

.card-service:hover {
    border-color: #7ec8e3 !important;
    box-shadow: 0 4px 12px rgba(126, 200, 227, 0.25) !important;
    transform: translateY(-2px);
}

.card-service .card-img-top {
    border-radius: 10px 10px 0 0;
}

.card-service .card-footer {
    border-top: 1px solid #e8f4f8;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .35rem;
    padding: .65rem .75rem;
}

.card-service .card-footer .btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    font-size: .78rem;
    line-height: 1.2;
    padding: .4rem .35rem;
}

/* 需求大廳卡片樣式 */
.card-request {
    border: 2px solid #b3d9f2 !important;
    border-radius: 12px !important;
    transition: all 0.2s ease;
}

.card-request:hover {
    border-color: #7ec8e3 !important;
    box-shadow: 0 4px 12px rgba(126, 200, 227, 0.25) !important;
    transform: translateY(-2px);
}

/* 已過期需求卡片 */
.card-request.card-expired {
    border-color: #f5c6cb !important;
    background-color: #fdf7f7;
}

.card-request.card-expired:hover {
    border-color: #f1aeb5 !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15) !important;
}

/* ==================== 動態 Div 框架管理系統 ==================== */
.dynamic-frame {
    position: fixed; /* 改為 fitxed 以便在視窗中浮動 */
    box-shadow: 0 5px 25px rgba(0,0,0,0.2) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    background: white;
    transition: box-shadow 0.2s, z-index 0s; /* Z-Index 變更應立即生效 */
    border-radius: 8px;
    /* max-width: 90vw; */
    /* max-height: 90vh; */
    /* overflow: auto; */
    z-index: 1060; /* 預設層級 */
}

.active-frame {
    box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important;
    border-color: var(--primary-color) !important; 
     z-index: 1070; /* 確保在最上層 */
}

/* 讓 Modal 也能有清楚的層級感 */
.modal.active-frame .modal-content {
    box-shadow: 0 0 0 4px rgba(166, 123, 91, 0.25);
    border-color: #A67B5B;
}

.pwa-status-bar {
    background: #6c757d;
    color: #fff;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.pwa-update-bar {
    background: #A67B5B;
}

.project-page-head h2 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.project-page-lead {
    display: none;
    color: #6b7280;
    margin-bottom: 1rem;
}

.project-searchbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.project-searchbar-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    padding: 0 12px;
    min-height: 44px;
}

.project-searchbar-input input {
    border: 0;
    outline: 0;
    width: 100%;
    background: transparent;
}

.project-keyword-clear,
.project-filter-toggle {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 12px;
    min-height: 44px;
    padding: 0 14px;
    white-space: nowrap;
}

.project-keyword-clear {
    border: 0;
    min-height: 32px;
    padding: 0 4px;
    color: #6b7280;
}

.project-filter-panel {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
}

.project-filter-panel[hidden],
.project-tabs[hidden],
.project-table-wrap[hidden],
.project-card-list[hidden],
#projectListSkeleton[hidden],
#projEmpty[hidden],
#quoteEmpty[hidden] {
    display: none !important;
}

.project-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.project-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 12px;
    padding-bottom: 8px;
}

#projectTabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    overflow-x: auto;
    list-style: none;
}

#projectTabs .nav-item {
    flex: 1 0 auto;
    display: flex;
}

#projectTabs .nav-link {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 14px;
    padding: 8px 10px;
}

#projectTabs .nav-link.active {
    background: #A67B5B;
    color: #fff;
}

.review-calm {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #f8f7f4;
    border: 1px solid #eeeae3;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 14px;
}

.review-calm-score {
    min-width: 108px;
}

.review-calm-number {
    font-size: 2rem;
    line-height: 1;
    font-weight: 650;
    color: #1f2937;
}

.review-calm-stars {
    color: #d4a017;
    letter-spacing: 1px;
    margin: 4px 0;
    min-height: 1.2em;
}

.review-calm-score p,
.review-calm-side span,
.review-calm-dist > p span {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.review-calm-side {
    display: flex;
    flex: 1;
    gap: 10px;
}

.review-calm-side div {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
}

.review-calm-side strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 650;
    color: #1f2937;
}

.review-calm-dist {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.review-calm-dist > p {
    margin: 0 0 10px;
    font-weight: 600;
}

.review-dist-row {
    width: 100%;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 8px;
    align-items: center;
    border: 0;
    background: transparent;
    padding: 6px 0;
    min-height: 36px;
    text-align: left;
    color: #374151;
    font-size: 13px;
}

.review-dist-track {
    display: block;
    height: 8px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}

.review-dist-track span {
    display: block;
    height: 100%;
    background: #e7c98a;
    border-radius: 999px;
}

#tab-my-reviews .card {
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    box-shadow: none;
}

#tab-my-reviews .card-header {
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}

@media (max-width: 575.98px) {
    .review-calm {
        flex-direction: column;
        align-items: stretch;
    }
    #tab-my-reviews .input-group {
        width: 100% !important;
    }
    #tab-my-reviews .form-select-sm {
        width: 100% !important;
    }
}

#clientRequestTabs.project-tabs {
    margin-bottom: 4px;
}

.project-tabs button {
    border: 0;
    background: transparent;
    color: #4b5563;
    border-radius: 999px;
    padding: 8px 12px;
    white-space: nowrap;
    min-height: 40px;
}

.project-tabs button.is-active {
    background: #A67B5B;
    color: #fff;
}

.project-tabs [data-project-count] {
    font-size: 0.85em;
}

.project-tabs button.is-active [data-project-tab="todo"] ,
.project-tabs [data-project-count="todo"].is-hot {
    background: #f3f4f6;
    color: #111827;
    border-radius: 999px;
    padding: 0 6px;
}

.project-card-list {
    display: block;
}

.project-table-wrap {
    display: none;
}

.project-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.project-card-title,
.project-name-cell {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin: 8px 0 12px;
    word-break: break-word;
}

.project-name-main { display: block; }
.project-type-row { margin-top: .28rem; }
.project-card-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .55rem; }
.project-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: .35rem .55rem;
    border-radius: 999px;
    border: 1px solid transparent;
}
.project-type-badge.is-booking {
    background: #ecfdf3;
    color: #067647;
    border-color: #abefc6;
}
.project-type-badge.is-quote {
    background: #f8fafc;
    color: #475467;
    border-color: #d0d5dd;
}
.project-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #1f2937;
    white-space: nowrap;
}

.project-badge.is-info { background: #E7D3B0; color: #6B4E3C; }
.project-badge.is-progress { background: #15803d; color: #fff; }
.project-badge.is-todo { background: #ea580c; color: #fff; }
.project-badge.is-done { background: #0f766e; color: #fff; }
.project-badge.is-warn { background: #dc2626; color: #fff; }
.project-badge.is-muted { background: #9ca3af; color: #fff; }

.project-meta {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.project-meta div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.project-meta span {
    color: #6b7280;
    font-size: 13px;
}

.project-meta strong,
.project-amount-cell {
    font-weight: 600;
    white-space: nowrap;
}

.project-date-cell {
    min-width: 7.5rem;
    vertical-align: middle;
}

.project-date-main {
    font-weight: 600;
    white-space: nowrap;
}

.project-date-label {
    line-height: 1.2;
}

.project-progress {
    margin: 0 0 4px;
    font-weight: 600;
}

.project-hint,
.project-empty-sub {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
}

.project-primary-btn {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: #A67B5B;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-actions.is-compact {
    width: 9.5rem;
}

.project-actions.is-compact .project-primary-btn {
    width: 100%;
    min-width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 0 8px;
    font-size: 14px;
}

.project-secondary-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.project-secondary-btn {
    border: 0;
    background: transparent;
    color: #4b5563;
    min-height: 44px;
    padding: 0;
    white-space: nowrap;
}

.project-unread {
    display: inline-block;
    margin-left: 6px;
    background: #A67B5B;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    padding: 0 6px;
}

.project-primary-btn .project-unread {
    background: #fff;
    color: #111827;
}

.project-empty {
    text-align: center;
    padding: 32px 16px;
    color: #374151;
}

.project-skeleton-card {
    height: 148px;
    border-radius: 12px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
    background-size: 400% 100%;
    animation: projectShimmer 1.2s ease infinite;
}

@keyframes projectShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

@media (min-width: 769px) {
    .project-page-lead { display: block; }
    .project-table-wrap { display: block; }
    .project-card-list { display: none !important; }
    .project-actions.is-compact {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .project-table-wrap { display: none !important; }
    #view-projects .content-wrapper { overflow-x: hidden; }
}

.request-page-lead {
    color: #6b7280;
    margin: -8px 0 12px;
}

.client-request-board.row {
    display: block;
    margin: 16px 0 0;
    padding-top: 4px;
    /* 蓋掉 Bootstrap .row > * 的 gutter，避免標題黏在卡片角落 */
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
}
.client-request-board.row > * {
    width: auto;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
    margin-top: 0;
}

.request-section {
    margin: 0 0 22px;
}
.request-section:last-child {
    margin-bottom: 0;
}
.request-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
}
.request-section-head.is-todo {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-color: #fdba74;
}
.request-section-head.is-rest {
    background: linear-gradient(135deg, #f8fafc 0%, #FFE8D6 100%);
    border-color: #d0d5dd;
}
.request-section-head-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}
.request-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 1.05rem;
}
.request-section-head.is-todo .request-section-icon {
    background: #ea580c;
    color: #fff;
}
.request-section-head.is-rest .request-section-icon {
    background: #334155;
    color: #fff;
}
.request-section-title {
    font-size: 16px;
    font-weight: 800;
    color: #101828;
    letter-spacing: .01em;
    margin: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.request-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 .45rem;
    border-radius: 999px;
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}
.request-section-head.is-todo .request-section-count {
    background: #ea580c;
    color: #fff;
}
.request-section-head.is-rest .request-section-count {
    background: #334155;
    color: #fff;
}
.request-section-desc {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: #667085;
    line-height: 1.4;
}
.request-section.is-todo .request-card {
    border-color: #fdba74;
    box-shadow: 0 1px 2px rgba(234, 88, 12, .08);
}
.request-section-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.request-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.request-card-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #d7e6ec;
    overflow: hidden;
}

.request-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.request-card-cover.is-default {
    background: linear-gradient(145deg, #e8f1f4 0%, #c5d8e0 100%);
}

.request-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px;
}

.request-card-actions {
    margin-top: auto;
}

.request-card-top,
.request-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.request-card-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.request-category {
    display: inline-block;
    font-size: 12px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 4px 8px;
}
.request-inquiry-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: #6E5140;
    background: #FFE8D6;
    border-radius: 999px;
    padding: 4px 8px;
}
.request-card.is-inquiry {
    border-color: #F6C7A8;
}

.request-card-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin: 10px 0 6px;
    word-break: break-word;
}

.request-card-meta,
.request-hint,
.request-budget span {
    color: #6b7280;
    font-size: 13px;
}

.request-budget,
.request-quote {
    margin: 6px 0;
}

.request-quote.is-hot {
    color: #8F684C;
    font-weight: 600;
}

.request-primary-btn,
.request-text-btn {
    min-height: 44px;
    white-space: nowrap;
}

.request-primary-btn {
    width: 100%;
    margin-top: 8px;
    border: 0;
    border-radius: 10px;
    background: #A67B5B;
    color: #fff;
    font-weight: 600;
}

.request-text-btn {
    border: 0;
    background: transparent;
    color: #4b5563;
    padding: 0;
}

.request-detail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(17, 24, 39, .45);
}

.request-detail-backdrop[hidden] {
    display: none !important;
}

.request-detail-panel {
    position: fixed;
    z-index: 1050;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 24px));
    max-height: min(82vh, 720px);
    overflow: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    margin: 0;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
}

.request-detail-panel[hidden] {
    display: none !important;
}

.request-detail-head,
.request-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.request-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 12px 0;
}

.request-detail-grid div,
.request-detail-desc span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.request-detail-grid span,
.request-detail-desc span {
    color: #6b7280;
    font-size: 13px;
}

.request-detail-desc p {
    margin: 6px 0 0;
    white-space: normal;
    word-break: break-word;
}

.request-detail-actions .request-primary-btn {
    width: auto;
    min-width: 140px;
    padding: 0 16px;
}

.request-detail-photos {
    margin-top: 14px;
}

.request-detail-photos > span {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 13px;
}

.request-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.request-image-item {
    position: relative;
}

.request-image-thumb {
    width: 88px;
    height: 88px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    cursor: zoom-in;
}

.request-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.request-image-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    line-height: 22px;
    padding: 0;
}

.request-image-item.is-cover .request-image-thumb {
    outline: 2px solid #1f6f7a;
    outline-offset: 2px;
}

.request-image-cover-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    min-height: 30px;
    padding: 0 6px;
}

.request-image-item.is-cover .request-image-cover-btn {
    border-color: #1f6f7a;
    background: #ecfdf5;
    color: #115e59;
}

.request-cover-empty {
    grid-column: 1 / -1;
}

@media (min-width: 769px) {
    .request-detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 769px) {
    .client-request-board.row {
        display: block;
    }
    .client-request-board .request-card {
        margin-bottom: 0;
    }
    .request-section-grid {
        grid-template-columns: 1fr 1fr;
    }
    .request-empty {
        grid-column: 1 / -1;
    }
}

.market-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}

.market-chip {
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #374151;
    border-radius: 999px;
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
}

.market-filter-label {
    margin: 8px 0 6px;
    color: #6b7280;
    font-size: 13px;
}

.market-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.market-result-count {
    margin: 0 0 12px;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.provider-request-board.row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0;
    width: 100%;
    max-width: 100%;
}

.market-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    min-width: 0;
    overflow: hidden;
}

.market-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px;
    min-width: 0;
}

.market-card .request-card-cover {
    border-bottom: 1px solid #e5e7eb;
}

.market-card .new-badge {
    top: 12px;
    right: 12px;
}

.market-actions {
    margin-top: auto;
    padding-top: 8px;
}

.market-card .request-primary-btn {
    margin-top: 0;
}

.market-card.is-own {
    border-color: #F6C7A8;
}

.market-card .project-badge {
    flex-shrink: 0;
}

.market-category {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
}

.market-location,
.market-time,
.market-published,
.market-quote-submitted,
.market-hint {
    margin: 4px 0;
    color: #4b5563;
    font-size: 14px;
}

.market-quote-submitted {
    color: #0f766e;
    font-weight: 600;
}

.market-budget {
    margin: 6px 0;
    color: #111827;
    font-size: 17px;
    font-weight: 700;
}

.market-my-quote {
    margin: 4px 0;
    color: #0f766e;
    font-size: 16px;
    font-weight: 700;
}

.market-my-quote strong,
.market-my-quote-strong {
    color: #0f766e;
}

.market-urgency {
    margin: 6px 0;
    color: #c2410c;
    font-size: 14px;
    font-weight: 600;
}

.market-match {
    margin: 4px 0 0;
    color: #0f766e;
    font-size: 13px;
    font-weight: 600;
}

.market-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 8px 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    max-height: 3em;
}

.market-more,
.market-empty {
    grid-column: 1 / -1;
}

.market-more {
    min-height: 44px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 12px;
}

.market-skeleton {
    min-height: 220px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
    background-size: 400% 100%;
    animation: market-skeleton 1.2s ease infinite;
}

@keyframes market-skeleton {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

@media (max-width: 420px) {
    .market-filter-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .provider-request-board.row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1200px) {
    .provider-request-board.row {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.market-page-head h2 {
    margin-bottom: 4px;
}

.page-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.page-title > .bi {
    font-size: 1.25rem;
    line-height: 1;
    flex: 0 0 auto;
}

.page-title::after {
    content: "";
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    background: url("../brand/paw.png?v=20261113012") center / contain no-repeat;
}

.market-page-head .request-page-lead,
.project-page-head .project-page-lead,
.survey-center-head > p,
#view-my-bookings .content-wrapper > p,
#view-dashboard .request-page-lead,
.ops-header .ops-lead {
    margin-left: calc(1.25rem + 0.45rem);
}

.service-market-board.row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0;
    width: 100%;
}

.svc-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    /* 封面自行裁切；卡片本體可見，避免特約標籤被圓角裁掉 */
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    min-width: 0;
}

/* 卡片直接放在 Bootstrap .row 內時，抵銷 .row > * 的欄距 padding，封面才能貼齊卡片邊框 */
.row > .svc-card {
    padding-left: 0;
    padding-right: 0;
    margin-top: 0;
}

.svc-card.is-own {
    border-color: #F6C7A8;
}

.svc-media {
    position: relative;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
}

.svc-cover {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 170px;
    padding: 0;
    border: 0;
    background: #eef2f7;
    overflow: hidden;
}

.svc-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.svc-cover.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    font-size: 2rem;
}

.fav-mark {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: inline-block;
    vertical-align: -0.28em;
    pointer-events: none;
}

.nav-link .fav-mark {
    width: 1.15em;
    height: 1.15em;
    margin-right: 0.15rem;
}

.btn .fav-mark {
    margin-right: 0.3rem;
}

#toggleFavoriteBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

#toggleFavoriteBtn .fav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    background: #fff;
}

#toggleFavoriteBtn .fav-badge .fav-mark {
    width: 26px;
    height: 18px;
    margin: 0;
    flex: none;
    filter: none;
}

.page-title > .fav-mark {
    width: 1.7em;
    height: 1.15em;
    flex: 0 0 auto;
    vertical-align: middle;
}

.empty-state .fav-mark {
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    vertical-align: middle;
}

.fav-chip {
    border: 0;
    background: transparent;
    padding: 0;
    width: 44px;
    height: 44px;
    line-height: 0;
}

.fav-chip .fav-mark {
    width: 40px;
    height: 40px;
    vertical-align: top;
}

.svc-fav {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    line-height: 0;
}

.svc-fav .fav-mark {
    width: 46px;
    height: 46px;
    vertical-align: top;
}

.svc-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px 16px 16px;
    min-width: 0;
}

.svc-title {
    margin: 8px 0 4px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.svc-meta {
    margin: 0 0 8px;
    color: #6b7280;
    font-size: 13px;
}

.svc-price {
    margin: 0;
    color: #111827;
    font-size: 17px;
    font-weight: 700;
}

.svc-price-note {
    margin: 2px 0 8px;
    color: #9ca3af;
    font-size: 12px;
}

.svc-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 10px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    max-height: 3em;
}

.svc-detail-cover {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 220px;
    margin: 8px 0 12px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #eef2f7;
}

.svc-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.svc-detail-cover.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 2rem;
}

.svc-detail-merchant {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin: 12px 0;
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.svc-detail-other {
    margin: 12px 0;
}

.svc-detail-other > span {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 13px;
}

.svc-detail-other-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.svc-other-item {
    text-align: left;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 12px;
}

#promoSubnav button,
#view-provider-promotion .btn {
    min-height: 44px;
}
#promoSubnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
#promoSubnav button {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 999px;
    padding: 8px 14px;
}
#promoSubnav button.is-active {
    background: #A67B5B;
    color: #fff;
}

.service-recommend-head h3 {
    font-size: 1.15rem;
    margin: 0 0 .2rem;
}
.service-recommend-head p {
    color: #6b7280;
    margin: 0 0 .75rem;
}
.svc-rec-reason {
    color: #4b5563;
    font-size: 12px;
    margin: 0 0 6px;
}
.svc-vip-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #f5e6c8;
    color: #7a5b16;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}
.svc-rec-hide {
    min-height: 44px;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 13px;
}

.svc-other-head {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.svc-other-head strong {
    display: block;
    font-size: 14px;
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.svc-other-head .svc-trade {
    flex-shrink: 0;
    margin: 0;
}

.svc-other-item strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.svc-other-item > span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
}

.svc-other-price {
    color: #111827 !important;
    font-weight: 600;
    margin-top: 4px;
}

.svc-other-desc {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 4px;
}

.svc-guide-hint {
    white-space: nowrap;
    font-weight: 600;
}

.svc-guide-hint.is-miss {
    color: #c2410c;
}

.svc-guide-hint.is-done {
    color: #15803d;
}

.svc-heat {
    color: #64748b;
    font-size: 13px;
    margin: 0 0 8px;
}

.svc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0;
}

.svc-tags span,
.svc-chip-row label {
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    color: #334155;
    background: #fff;
}

.svc-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.svc-chip-row label {
    padding: 4px 10px;
    margin: 0;
}

.svc-extra-districts,
.svc-faq-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.svc-faq-editor {
    display: grid;
    gap: 10px;
}

.svc-faq-row {
    display: grid;
    gap: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.svc-faq-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #475569;
}

.svc-faq-field {
    display: grid;
    grid-template-columns: 1.8rem 1fr;
    gap: 8px;
    align-items: start;
    margin: 0;
}

.svc-faq-field > span {
    width: 1.8rem;
    height: 1.8rem;
    margin-top: 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: #1e293b;
    color: #fff;
}

.svc-faq-field:last-child > span {
    background: #dcfce7;
    color: #166534;
}

.svc-extra-districts {
    max-height: 140px;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
}

.svc-extra-districts label,
.svc-faq-grid input,
.svc-faq-grid textarea {
    font-size: 13px;
}

.svc-faq-grid {
    display: grid;
}

.svc-faq {
    display: grid;
    gap: 10px;
}

.svc-faq-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.svc-faq-q,
.svc-faq-a {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 10px;
}

.svc-faq-q {
    background: #f8fafc;
}

.svc-faq-a {
    border-top: 1px solid #eef2f7;
}

.svc-faq-q span,
.svc-faq-a span {
    flex: 0 0 auto;
    min-width: 1.6rem;
    height: 1.6rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.svc-faq-q span {
    background: #1e293b;
    color: #fff;
}

.svc-faq-a span {
    background: #dcfce7;
    color: #166534;
}

.svc-faq-q p,
.svc-faq-a p {
    margin: 2px 0 0;
    line-height: 1.5;
}

.svc-faq-q p {
    font-weight: 650;
    color: #0f172a;
}

.svc-faq-a p {
    color: #334155;
    font-weight: 400;
}

.svc-case-upload {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.svc-case-upload .form-control {
    width: 220px;
    max-width: 100%;
}

.svc-portfolio-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 8px;
}

.svc-portfolio-pick {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 4px;
    text-align: center;
    font-size: 12px;
}

.svc-portfolio-pick input {
    margin-bottom: 4px;
}

.svc-portfolio-pick img {
    width: 100%;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.svc-portfolio-pick.is-on {
    border-color: #15803d;
    background: #f0fdf4;
}

.svc-portfolio-label {
    margin: 8px 0 4px;
    font-size: 13px;
    color: #475569;
}

.svc-guide-grid {
    display: grid;
    gap: 10px;
}

.svc-completeness {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
}

.svc-completeness.is-good {
    border-color: #86efac;
    background: #f0fdf4;
}

.svc-completeness.is-warn {
    border-color: #fdba74;
    background: #fff7ed;
}

.svc-completeness-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.svc-completeness-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
}

.svc-completeness-list li {
    font-size: 13px;
    color: #6b7280;
}

.svc-completeness-list li.is-done {
    color: #15803d;
}

.svc-completeness-list li.is-miss {
    color: #c2410c;
}

.svc-desc-block {
    margin-top: 8px;
}

.svc-desc-block span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 2px;
}

.svc-desc-block p {
    margin: 0;
    color: #111827;
    font-size: 14px;
    line-height: 1.5;
}

.svc-detail-portfolio-list {
    min-height: 24px;
}

.svc-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.svc-portfolio-thumb {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e7eb;
}

.svc-portfolio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.svc-portfolio-yt {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

@media (max-width: 420px) {
    .svc-completeness-list,
    .svc-portfolio-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.svc-merchant {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.svc-merchant-main {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
}

.svc-merchant-main strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
}

.svc-merchant-main span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

.svc-merchant-link {
    flex-shrink: 0;
    font-size: 13px;
}

.svc-actions {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.svc-actions .request-primary-btn {
    margin-top: 0;
    order: -1;
}

.svc-skeleton {
    min-height: 320px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
    background-size: 400% 100%;
    animation: market-skeleton 1.2s ease infinite;
    border-radius: 14px;
}

@media (min-width: 769px) {
    .service-market-board.row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1200px) {
    .service-market-board.row {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.svc-trade {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
    padding: .1rem .45rem;
    border-radius: 999px;
    background: #eef6f1;
    color: #1f7a4d;
    font-size: .75rem;
    white-space: nowrap;
}

.svc-trade.is-quote {
    background: #FFE8D6;
    color: #3730a3;
}

.svc-trade.is-booking {
    background: #eef6f1;
    color: #1f7a4d;
}

.svc-tag-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    align-self: flex-start;
    max-width: 100%;
}

.svc-tag-row .market-category,
.svc-tag-row .svc-trade {
    margin: 0;
}
.svc-duration { margin: .25rem 0 0; color: #667085; font-size: .85rem; }
.booking-tabs, .booking-dash { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.booking-stat { min-width: 7rem; padding: .75rem; border: 1px solid #e6e8ec; border-radius: 12px; background: #fff; }
.booking-stat span { display: block; color: #667085; font-size: .8rem; }
.booking-card {
    padding: 1rem;
    margin-bottom: .75rem;
    border: 1px solid #e6e8ec;
    border-radius: 14px;
    background: #fff;
    max-width: 100%;
}
.booking-card-head {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .45rem;
    margin-bottom: .35rem;
}
.booking-card-head-main {
    min-width: 0;
    width: auto;
    max-width: 100%;
}
.booking-card-meta { color: #475467; font-size: .92rem; }
.booking-item-lines { margin-top: .35rem; padding: .55rem .7rem; border-radius: 10px; background: #f8fafc; }
.booking-item-lines .small { color: #344054; line-height: 1.45; }
.booking-card-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
.booking-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    justify-content: flex-start;
    width: auto;
    max-width: 100%;
    margin-left: 0;
}
.booking-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: .35rem .55rem;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.booking-tag.is-booking-status { background: #f8fafc; color: #475467; border-color: #d0d5dd; }
.booking-tag.is-project-type { background: #eff8ff; color: #175cd3; border-color: #b2ddff; }
.booking-tag.is-project-matched { background: #fef6ee; color: #b54708; border-color: #f9dbaf; }
.booking-tag.is-project-progress { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.booking-tag.is-project-completed { background: #fffaeb; color: #b54708; border-color: #fedf89; }
.booking-tag.is-project-verified { background: #f0fdf4; color: #166534; border-color: #86efac; }
.booking-tag.is-project-cancelled { background: #f2f4f7; color: #667085; border-color: #d0d5dd; }
.booking-tag.is-project-disputed { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.booking-tag.is-project-warn { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.booking-date-grid, .booking-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.booking-weekday-head {
    text-align: center;
    font-size: .78rem;
    font-weight: 700;
    color: #475467;
    padding: .2rem 0 .35rem;
    letter-spacing: .02em;
}
.booking-weekday-head.is-weekend {
    color: #d92d20;
}
.booking-date-pad { min-height: 0; }
.booking-date-loading {
    grid-column: 1 / -1;
    color: #667085;
    font-size: .9rem;
    padding: .75rem 0;
    text-align: center;
}
.booking-date {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 3.4rem;
    padding: .35rem .2rem 0;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.booking-date strong {
    display: block;
    line-height: 1.2;
    margin-bottom: .2rem;
}
.booking-date small {
    display: block;
    margin-top: auto;
    padding: .28rem .15rem;
    color: #667085;
    font-size: .7rem;
    line-height: 1.2;
}
.booking-date.has-one small {
    background: #f2f4f7;
    color: #344054;
}
.booking-date.has-multi {
    background: #A67B5B;
    border-color: #A67B5B;
    color: #fff;
    box-shadow: 0 0 0 2px #A67B5B;
}
.booking-date.has-multi strong {
    color: #fff;
}
.booking-date.has-multi small {
    background: #fff;
    color: #111827;
    font-weight: 800;
    font-size: .72rem;
}
.booking-date.is-full, .booking-date.is-closed, .booking-date.is-past, .booking-date.is-out_of_range { opacity: .45; }
.booking-date.is-low_capacity { border-color: #e6a23c; }
.booking-date.is-picked, .booking-date.is-available { border-color: #1f7a4d; }
.booking-slot-line { padding: .6rem 0; border-bottom: 1px solid #eef0f3; }
.booking-cal-nav {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    margin: 1rem 0;
}
.booking-cal-nav-row {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr) 5rem;
    align-items: center;
    gap: .5rem;
}
.booking-cal-nav-btn {
    width: 100%;
    min-height: 36px;
    white-space: nowrap;
    padding-left: .35rem;
    padding-right: .35rem;
}
.booking-cal-title {
    font-weight: 700;
    color: #101828;
    text-align: center;
    min-width: 0;
    line-height: 1.3;
    word-break: break-word;
}
.booking-cal-modes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem;
}
.booking-cal-legend {
    margin: 0 0 .75rem;
    padding: .65rem .8rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e4e7ec;
    color: #475467;
    font-size: .86rem;
}
.booking-slot-card {
    padding: .9rem 1rem;
    margin-bottom: .75rem;
    border: 1px solid #e6e8ec;
    border-radius: 14px;
    background: #fff;
}
.booking-slot-head {
    display: grid;
    gap: .35rem;
    margin-bottom: .7rem;
}
.booking-slot-head > div,
.booking-slot-booking-main > div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: baseline;
}
.booking-slot-k {
    color: #667085;
    font-size: .82rem;
    flex: 0 0 auto;
}
.booking-slot-cap-detail {
    display: flex !important;
    justify-content: flex-start !important;
    gap: .75rem;
    color: #667085;
    font-size: .8rem;
}
.booking-slot-list-label {
    font-size: .82rem;
    font-weight: 700;
    color: #344054;
    margin-bottom: .4rem;
}
.booking-slot-booking {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    justify-content: space-between;
    align-items: flex-end;
    padding: .7rem .75rem;
    border-radius: 10px;
    background: #f8fafc;
    margin-bottom: .45rem;
}
.booking-slot-booking-main {
    flex: 1 1 7rem;
    display: grid;
    gap: .25rem;
}
.booking-slot-empty {
    margin: 0;
    color: #98a2b3;
    font-size: .86rem;
}
.booking-field-help {
    padding: .85rem 1rem;
    border-radius: 12px;
    background: #f6f8fa;
    border: 1px solid #e8ecf0;
}
.booking-field-help p,
.booking-field-help ul {
    color: #5f6b7a;
}
.bk-schedule .form-label,
#bookingWizardBody .form-label {
    font-weight: 600;
    margin-bottom: .25rem;
}
.bk-schedule .form-text,
#bookingWizardBody .form-text {
    margin-top: .25rem;
    line-height: 1.4;
}
/* ===== PROVIDER 營運總覽 ===== */
#view-provider-analytics {
    width: 100%;
}
#view-provider-analytics .content-wrapper.ops-wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.ops-content {
    width: 100%;
    min-width: 0;
    display: block;
}
.ops-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1rem;
}
.ops-subnav button {
    border: 1px solid #d0d5dd;
    background: #fff;
    border-radius: 999px;
    padding: .45rem .9rem;
    font-weight: 600;
    color: #344054;
}
.ops-subnav button.is-active {
    background: #A67B5B;
    color: #fff;
    border-color: #A67B5B;
}
.ops-period-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    margin-bottom: 1rem;
}
.ops-period-presets,
.ops-mini-presets {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.ops-period-presets button,
.ops-mini-presets button {
    border: 1px solid #e4e7ec;
    background: #f8fafc;
    border-radius: 8px;
    padding: .35rem .65rem;
    font-size: .86rem;
}
.ops-period-presets button.is-active,
.ops-mini-presets button.is-active {
    background: #A67B5B;
    color: #fff;
    border-color: #A67B5B;
}
.ops-period-custom {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}
.ops-header h2 {
    margin: 0 0 .35rem;
    font-size: 1.45rem;
}
.ops-lead {
    color: #667085;
    margin: 0 0 1rem;
}
.ops-section {
    margin-bottom: 1.35rem;
    width: 100%;
    min-width: 0;
}
.ops-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 .65rem;
}
.ops-section-head {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}
.ops-section-head .ops-section-title { margin: 0; }
.ops-attention-grid,
.ops-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    width: 100%;
}
.ops-attn-card,
.ops-kpi {
    display: block;
    text-align: left;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 14px;
    padding: .9rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}
.ops-attn-card span,
.ops-kpi span {
    display: block;
    color: #667085;
    font-size: .82rem;
}
.ops-attn-card strong,
.ops-kpi strong {
    display: block;
    font-size: 1.55rem;
    margin: .2rem 0;
    color: #101828;
    word-break: break-word;
}
.ops-attn-card small {
    color: #98a2b3;
    font-size: .78rem;
}
.ops-attn-card em {
    display: block;
    margin-top: .45rem;
    font-style: normal;
    color: #175cd3;
    font-size: .82rem;
    font-weight: 600;
}
.ops-attn-card.is-warn {
    border-color: #f9dbaf;
    background: #fffaeb;
}
.ops-change { font-size: .8rem; }
.ops-change.is-up { color: #067647; }
.ops-change.is-down { color: #b42318; }
.ops-change.is-flat { color: #667085; }
.ops-note {
    color: #667085;
    font-size: .85rem;
    margin: .65rem 0 0;
}
.ops-link {
    border: 0;
    background: transparent;
    color: #175cd3;
    font-weight: 600;
    padding: 0;
}
.ops-schedule-list {
    display: grid;
    gap: .5rem;
}
.ops-schedule-item {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr) auto;
    gap: .6rem;
    align-items: center;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    padding: .7rem .8rem;
    background: #fff;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
}
.ops-pill {
    font-size: .75rem;
    background: #f2f4f7;
    border-radius: 999px;
    padding: .2rem .55rem;
    white-space: nowrap;
}
.ops-status-bars { display: grid; gap: .45rem; }
.ops-bar-row {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr) 2.2rem;
    gap: .45rem;
    align-items: center;
    font-size: .9rem;
}
.ops-bar-track {
    height: .55rem;
    background: #f2f4f7;
    border-radius: 999px;
    overflow: hidden;
}
.ops-bar-fill {
    height: 100%;
    background: #A67B5B;
    border-radius: 999px;
}
.ops-rate-line {
    margin: .55rem 0 0;
    color: #475467;
}
.ops-funnel {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 1rem;
    background: #fff;
}
.ops-funnel-arrow {
    color: #98a2b3;
    margin: .15rem 0;
}
.ops-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ops-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    font-size: .9rem;
}
.ops-table th,
.ops-table td {
    padding: .55rem .45rem;
    border-bottom: 1px solid #eef0f3;
    text-align: left;
    vertical-align: top;
}
.ops-insights { display: grid; gap: .55rem; }
.ops-insight {
    border-radius: 12px;
    padding: .8rem .9rem;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.ops-insight.is-critical {
    border-color: #fecdca;
    background: #fef3f2;
}
.ops-insight.is-important {
    border-color: #f9dbaf;
    background: #fffaeb;
}
.ops-insight.is-info {
    border-color: #b2ddff;
    background: #eff8ff;
}
.ops-insight p {
    margin: .25rem 0 0;
    color: #475467;
    font-size: .9rem;
}
.ops-empty,
.ops-error {
    padding: 1rem;
    border: 1px dashed #d0d5dd;
    border-radius: 12px;
    color: #667085;
    background: #fafafa;
    box-sizing: border-box;
    width: 100%;
}
.ops-skeleton {
    height: 96px;
    border-radius: 14px;
    margin-bottom: .75rem;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
    background-size: 400% 100%;
    animation: projectShimmer 1.2s ease infinite;
}
.ops-chart-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: .75rem;
    width: 100%;
    box-sizing: border-box;
}
.ops-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
}
.ops-split > * {
    min-width: 0;
    width: 100%;
}
.ops-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.ops-pager {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin-top: .75rem;
}
.ops-slot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ops-slot-list li {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .45rem 0;
    border-bottom: 1px solid #eef0f3;
}
.ops-kpi-grid.is-compact {
    grid-template-columns: 1fr;
}
.ops-kpi-grid.is-compact .ops-kpi strong {
    font-size: 1.25rem;
}

@media (min-width: 769px) {
    .ops-attention-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .ops-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .ops-kpi-grid.is-compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .ops-split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    #view-provider-analytics .content-wrapper.ops-wrap {
        padding: 16px;
    }
    .ops-content {
        display: flex;
        flex-direction: column;
    }
    .ops-attention-first { order: 1; }
    .ops-today-first-mobile { order: 2; }
    .ops-chart-section { order: 8; }
    .ops-schedule-item {
        grid-template-columns: 3.5rem minmax(0, 1fr);
    }
    .ops-schedule-item .ops-pill {
        grid-column: 2;
        justify-self: start;
    }
    .ops-bar-row {
        grid-template-columns: 4.5rem minmax(0, 1fr) 2rem;
        font-size: .82rem;
    }
}

.ad-sponsor-label {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #A67B5B;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

.ad-cover,
.ad-yt img,
.ad-yt-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    background: #F6EDE3;
}

.ad-yt {
    position: relative;
    display: block;
    width: 100%;
    margin: 8px 0;
    padding: 0;
    border: 0;
    background: transparent;
    min-height: 44px;
}

.ad-yt span {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    min-width: 72px;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(17, 24, 39, .88);
    color: #fff;
}

/* ==================== 問卷 Survey V1 ==================== */
.survey-center { max-width: 760px; }
.survey-center-head { margin-bottom: 1rem; }
.survey-center-head h2 { margin-bottom: .25rem; }
.survey-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; border-bottom: 1px solid #e5e7eb; }
.survey-tab {
    min-height: 44px;
    padding: .5rem 1rem;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #4b5563;
    font-weight: 600;
}
.survey-tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.survey-tab:focus-visible { outline: 3px solid rgba(166, 123, 91, .35); outline-offset: 2px; border-radius: 6px; }
.survey-tab-count:not(:empty) {
    display: inline-block;
    min-width: 1.4rem;
    padding: 0 .4rem;
    margin-left: .25rem;
    border-radius: 999px;
    background: #e7f0ff;
    color: var(--primary-color);
    font-size: .8rem;
}
.survey-center-list { display: grid; gap: .875rem; }
.survey-center-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .04);
}
.survey-center-main { min-width: 0; flex: 1; }
.survey-card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 .25rem; line-height: 1.4; }
.survey-card-title:focus { outline: none; }
.survey-card-desc {
    margin: 0 0 .375rem;
    color: #4b5563;
    font-size: .925rem;
    white-space: pre-line;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.survey-meta { margin: 0 0 .25rem; color: #6b7280; font-size: .85rem; }
.survey-invite-progress { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: #6b7280; margin-top: .375rem; }
.survey-invite-progress .progress { flex: 1; height: 6px; max-width: 220px; }
.survey-btn { min-height: 44px; padding-left: 1.125rem; padding-right: 1.125rem; border-radius: 12px; font-weight: 600; }
.survey-loading { padding: 1.5rem; text-align: center; color: #6b7280; }

/* Modal */
.survey-modal-dialog { max-width: 720px; }
.survey-modal .modal-content { border-radius: 20px; }
.survey-modal-header { align-items: flex-start; gap: .75rem; }
.survey-modal-heading { flex: 1; min-width: 0; }
.survey-modal-title { font-size: 1.05rem; font-weight: 700; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.survey-progress { margin-top: .5rem; }
.survey-progress-text { font-size: .8rem; color: #6b7280; margin-bottom: .25rem; }
.survey-progress-bar { height: 6px; }
.survey-modal-body { padding: 1.25rem 1.5rem; }
.survey-modal-footer {
    justify-content: space-between;
    gap: .5rem;
    padding: .75rem 1.25rem calc(.75rem + env(safe-area-inset-bottom, 0px));
}
.survey-modal-footer .survey-btn-main { margin-left: auto; min-width: 128px; }

.survey-welcome, .survey-done { text-align: center; padding: 1rem .5rem; }
.survey-welcome-icon, .survey-done-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: .5rem; }
.survey-done-icon { color: #198754; }
.survey-welcome-title { font-size: 1.25rem; font-weight: 700; }
.survey-welcome-desc { color: #4b5563; white-space: pre-line; }
.survey-resume-note { background: #eef6ff; color: #1e40af; border-radius: 12px; padding: .625rem .875rem; font-size: .9rem; }

.survey-page-head { margin-bottom: 1rem; }
.survey-page-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.survey-page-title:focus { outline: none; }
.survey-page-desc { color: #6b7280; margin: .25rem 0 0; white-space: pre-line; }

.survey-form { display: grid; gap: 1.25rem; }
.survey-q { border: 0; padding: 0; margin: 0; min-width: 0; }
.survey-q[hidden] { display: none !important; }
.survey-q-title { font-weight: 600; margin-bottom: .375rem; line-height: 1.5; }
.survey-q-num { color: #6b7280; }
.survey-req { color: #dc3545; margin-left: .2rem; }
.survey-optional { color: #9ca3af; font-weight: 400; font-size: .85rem; margin-left: .25rem; }
.survey-q-desc { color: #6b7280; font-size: .9rem; margin-bottom: .5rem; white-space: pre-line; }
.survey-hint { color: #6b7280; font-size: .8rem; margin-bottom: .375rem; }
.survey-q-error { color: #dc3545; font-size: .875rem; margin-top: .375rem; }
.survey-q-error:empty { display: none; }
.survey-q.has-error .survey-option,
.survey-q.has-error .survey-input { border-color: #dc3545; }
.survey-info { background: #f8fafc; border-radius: 14px; padding: .875rem 1rem; }
.survey-info-title { font-weight: 600; }
.survey-info-desc { color: #4b5563; white-space: pre-line; font-size: .925rem; }

.survey-options { display: grid; gap: .5rem; }
.survey-options-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.survey-options-scale { display: flex; flex-wrap: wrap; gap: .375rem; }
.survey-options-emoji { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.survey-option {
    display: flex;
    align-items: center;
    gap: .625rem;
    min-height: 48px;
    padding: .625rem .875rem;
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.survey-option:hover { border-color: #93c5fd; }
.survey-option .form-check-input { margin: 0; flex-shrink: 0; }
.survey-option:has(input:checked) { border-color: var(--primary-color); background: #eef5ff; }
.survey-option:has(input:focus-visible) { outline: 3px solid rgba(166, 123, 91, .35); outline-offset: 2px; }
.survey-option-num {
    justify-content: center;
    min-width: 48px;
    padding: .5rem .625rem;
    position: relative;
}
.survey-option-num .form-check-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.survey-option-num:has(input:checked) { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.survey-option-star span::before { content: "\2605"; margin-right: .2rem; color: #f59e0b; }
.survey-option-star:has(input:checked) span::before { color: #fff; }
.survey-option-emoji { justify-content: center; text-align: center; }
.survey-scale-labels { display: flex; justify-content: space-between; color: #6b7280; font-size: .8rem; margin-top: .375rem; gap: 1rem; }
.survey-input { min-height: 48px; border-radius: 12px; }
textarea.survey-input { min-height: 112px; }
.survey-input-short { max-width: 260px; }
.survey-count { text-align: right; color: #9ca3af; font-size: .8rem; margin-top: .25rem; }
.survey-save-status { min-height: 1.25rem; margin-top: .75rem; color: #6b7280; font-size: .8rem; text-align: right; }

/* 主動邀請 */
.survey-invite {
    position: relative;
    background: #fff;
    border: 1px solid #dbe7ff;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .10);
    padding: 1.125rem 1.25rem;
}
.survey-invite-inline { margin: 0 0 1.25rem; max-width: 760px; }
.survey-invite-close { position: absolute; top: .75rem; right: .75rem; width: 44px; height: 44px; padding: 0; background-size: .8rem; }
.survey-invite-body { padding-right: 2.5rem; }
.survey-invite-eyebrow { color: var(--primary-color); font-size: .8rem; font-weight: 600; margin-bottom: .25rem; }
.survey-invite-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; margin-top: .875rem; }
.survey-invite .survey-form { gap: 1rem; margin-top: .75rem; }
.survey-invite .survey-done { padding: .5rem 0; }
.survey-invite-floating, .survey-invite-sheet {
    position: fixed;
    z-index: 1045;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
}
.survey-invite-floating {
    right: 1.25rem;
    bottom: 1.25rem;
    width: min(380px, calc(100vw - 2rem));
    max-height: min(70vh, 640px);
    overflow-y: auto;
    transform: translateY(12px);
}
.survey-invite-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(24px);
}
.survey-invite-floating.is-open, .survey-invite-sheet.is-open { opacity: 1; transform: none; }

@media (max-width: 575.98px) {
    .survey-center-card { flex-direction: column; align-items: stretch; }
    .survey-center-card .survey-btn-main { width: 100%; }
    .survey-modal-body { padding: 1rem; }
    .survey-modal .modal-content { border-radius: 0; }
    .survey-modal-footer .survey-btn { flex: 1; }
    .survey-invite-footer .survey-btn { flex: 1; }
    .survey-option-num { min-width: 44px; flex: 1 0 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .survey-invite-floating, .survey-invite-sheet { transition: none; }
}

/* 品牌色：只覆寫 Bootstrap 元件顏色，不改尺寸與排列 */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #A67B5B;
    --bs-btn-border-color: #8F684C;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #91684C;
    --bs-btn-hover-border-color: #8F684C;
    --bs-btn-focus-shadow-rgb: 166, 123, 91;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #8F684C;
    --bs-btn-active-border-color: #6E5140;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #A67B5B;
    --bs-btn-disabled-border-color: #8F684C;
}

.btn-outline-primary {
    --bs-btn-color: #8F684C;
    --bs-btn-border-color: #A67B5B;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #A67B5B;
    --bs-btn-hover-border-color: #A67B5B;
    --bs-btn-focus-shadow-rgb: 166, 123, 91;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #91684C;
    --bs-btn-active-border-color: #91684C;
    --bs-btn-disabled-color: #A67B5B;
    --bs-btn-disabled-border-color: #A67B5B;
}

.btn-link {
    --bs-btn-color: #8F684C;
    --bs-btn-hover-color: #6E5140;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link,
.list-group-item.active,
.page-item.active .page-link,
.dropdown-item.active,
.dropdown-item:active {
    background-color: #A67B5B;
    border-color: #A67B5B;
    color: #fff;
}

.page-link {
    color: #8F684C;
}

.page-link:hover {
    color: #6E5140;
}

.form-check-input:checked {
    background-color: #A67B5B;
    border-color: #A67B5B;
}

.form-check-input:focus {
    border-color: #E2C2A6;
    box-shadow: 0 0 0 0.25rem rgba(166, 123, 91, 0.25);
}

.progress-bar {
    background-color: #A67B5B;
}
