/* 編輯圖示顏色調整 */
.edit-icon {
    color: var(--Gray-800) !important;
}
.edit-icon svg {
    color: inherit !important;
    fill: none;
}
/* 黑色邊框表單 */
.form-black-border {
    border: 1px solid #222;
}

/* styles.css - 共用樣式 */
/* ===== Toast 訊息 ===== */
.toast-message {
    white-space: pre-wrap;
}

/* ===== Alert Icon 樣式 ===== */
.confirm-modal-content .alert-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.confirm-modal-content .alert-icon-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
}

.confirm-modal-content .alert-icon-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.confirm-modal-content .alert-icon-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

.confirm-modal-content .alert-icon-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

.confirm-modal-content .alert-icon svg {
    width: 28px;
    height: 28px;
}

.status-completed {
    color: var(--Yellow-500);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 18px; /* 128.571% */
    letter-spacing: 0.4px;
}


.milestone-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 51px;
    height: 19px;
    background-color: var(--Blue-500-Primary);
    color: var(--White);
    padding: 0 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
    bottom: -11px;
    margin-left: 12px;
    position: relative;
    z-index: 1;
}

.milestone-label.pending {
    background-color: var(--Gray-500);
}

.status-pending{
    color: var(--Gray-500);
    font-family: "PingFang TC";
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 18px; /* 128.571% */
    letter-spacing: 0.4px;
}

.milestone-info-date {
    font-size: 12px;
    color: var(--Gray-500);
    line-height: 1.4;
    font-family: Poppins;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.milestone-info-status {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

/* 禁止雙擊放大（PWA） */
*,
*::before,
*::after {
    touch-action: manipulation;
}

:root {
    /* ===== App Layout ===== */
    --app-shell-max-width: 430px;

    /* ===== Black 系列 ===== */
    --Black-500: #141314;
    --Black: #000000;
    --White: #ffffff;
    --bg: #fcfcfc;
    --announcements: #f8efe4;
    --neutral-800: #242424;
    --neutral-700: #424242;
    --primary-black: #222222;

    /* ===== Blue 系列 ===== */
    --Blue-100-bg: #e5e9ee;
    --Blue-500-Primary: #17324f;
    --Blue-650-Deep: #1b3044;
    --Blue-purchase-check: #022d5a;

    /* ===== Yellow/Orange 系列 ===== */
    --Yellow-500: #cb6f00;
    --Yellow-notification-title: #C36B00;
    --Yellow-notification: #EEE6DB;

    /* ===== Grays 系列 ===== */
    --Gray-100: #ffffff;
    --Gray-200: #fafafd;
    --Gray-300: #e6e6e6;
    --Gray-400: #c4c4c4;
    --Gray-500: #a5a5a5;
    --Gray-600: #777;
    --Gray-700: #555555;
    --Gray-800: #383538;
    --Gray-900: #222222;
    --Gray-desc: #5c5c5c;

    /* ===== Red 系列 ===== */
    --Red-500: #ec2f2f;
    --Red-600: #fc5555;

    --header-border: #f3f3f3;
}

@media (min-width: 768px) {
    :root {
        --app-shell-max-width: 640px;
    }
}

@media (min-width: 1200px) {
    :root {
        --app-shell-max-width: 860px;
    }
}

/* ===== Typography ===== */
/* Body Text / Medium */
.text-body-medium {
    font-family: "Inter", sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 17px;
}

/* 基本樣式 */
html,
body {
    overscroll-behavior-y: none;
}

html {
    /* 防止 iOS 自動調整文字尺寸導致聚焦時放大 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background-color: var(--bg);
    font-family: "Inter", "Noto Sans TC", sans-serif;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-x pan-y;
}

/* 統一 App 外層殼層寬度（Tailwind max-w-[430px]） */
.max-w-\[430px\] {
    max-width: var(--app-shell-max-width) !important;
}

.app-shell {
    width: 100%;
    max-width: var(--app-shell-max-width);
    min-height: 100svh;
    margin: 0 auto;
}

/* 禁止整個 PWA 縮放和雙擊放大 */
* {
    touch-action: pan-x pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: text;
}

.font-serif {
    font-family: "Playfair Display", serif;
}

/* 頁面進入動畫 */
.page {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 隱藏滾動條但保留功能 */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="date"],
textarea,
select {
    font-size: 14px !important;
    color: var(--Gray-800);
    height: 40px;
}

/* 防止 date input 在 iPhone 上超出容器 */
input[type="date"] {
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-height: 38px;
    /* 防止空值時變扁 */
}

/* ===== API Toast 通知 ===== */
.api-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 14px 24px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

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

/* 成功／失敗 Toast：與 account-settings「新增成功」同版型（灰底、緊湊橫列） */
.api-toast.api-toast-success,
.api-toast.api-toast-error {
    border-radius: 4px;
    background: #e9edf2;
    color: #17324f;
    width: auto;
    min-width: 112px;
    min-height: 40px;
    padding: 0 14px;
    justify-content: center;
    padding: 8px 6.5px 8px 7.5px;
    gap: 8px;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: 13px;
    font-weight: 500;
}

.api-toast.api-toast-success.show,
.api-toast.api-toast-error.show {
    opacity: 1;
}

.api-toast.api-toast-success .toast-message{
    color: #17324f;
}

.api-toast.api-toast-error .toast-message {
    color:var(--Red-600);
}

.api-toast.api-toast-success .toast-icon {
    width: 15px;
    height: 12px;
}

.api-toast.api-toast-success .toast-icon path {
    fill: #17324f;
}

.api-toast.api-toast-error .toast-icon {
    width: 18px;
    height: 18px;
    color: var(--Red-600);
}

.api-toast.api-toast-error .toast-icon path {
    stroke: var(--Red-600);
}

.api-toast-info {
    background: linear-gradient(135deg,
            rgba(13, 45, 116, 0.95) 0%,
            rgba(30, 64, 175, 0.95) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Toast 圖標與文字 */
.toast-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast-message {
    letter-spacing: 0.3px;
}



.toast-spinner {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
}

.spinner-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    animation: spin 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

/* 共用旋轉動畫 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 載入中脈衝光暈效果 */
.api-toast-info::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 17px;
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.5),
            rgba(147, 51, 234, 0.5));
    z-index: -1;
    animation: toast-pulse 2s ease-in-out infinite;
}

@keyframes toast-pulse {

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

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

/* ===== 按鈕 Loading 狀態 ===== */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.api-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== 警告 Toast ===== */
.api-toast-warning {
    background: linear-gradient(135deg,
            rgba(245, 158, 11, 0.95) 0%,
            rgba(217, 119, 6, 0.95) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== 全頁 Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-overlay-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid #e5e7eb;
    border-top-color: #0d2d74;
    animation: spin 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.loading-overlay-text {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* ===== 統一按鈕 Loading 狀態 ===== */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-loading>* {
    visibility: hidden;
}

/* ===== Pull-to-Refresh Spinner ===== */
.ptr-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e5e5;
    border-top-color: #666;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===== 確認對話框 ===== */
.confirm-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.confirm-dialog-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.confirm-dialog-overlay.show .confirm-dialog {
    transform: scale(1);
}

.confirm-dialog-title {
    font-size: 14px;
    color: var(--Gray-800);
    line-height: 1.5;
    margin-bottom: 8px;
    height: 120px;
    overflow-y: auto;
    resize: none;
    /* 固定高度並可滾動 */
}

.confirm-dialog-message {
    font-size: 14px;
    color: #71717a;
    margin-bottom: 20px;
    line-height: 1.5;
}

.confirm-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-dialog-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.confirm-dialog-btn-cancel {
    background: #f4f4f5;
    color: #71717a;
}

.confirm-dialog-btn-cancel:hover {
    background: #e4e4e7;
}

.confirm-dialog-btn-confirm {
    background: #0d2d74;
    color: white;
}

.confirm-dialog-btn-confirm:hover {
    background: #0a2460;
}

.confirm-dialog-btn-danger {
    background: #ef4444;
    color: white;
}

.confirm-dialog-btn-danger:hover {
    background: #dc2626;
}

/* ===== Alert 對話框圖標 ===== */
.alert-dialog {
    text-align: center;
}

.alert-dialog .confirm-dialog-title {
    margin-top: 8px;
}

.alert-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
}

.alert-icon svg {
    width: 28px;
    height: 28px;
}

.alert-icon-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
}

.alert-icon-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.alert-icon-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

.alert-icon-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

/* ===== 公告區塊 ===== */
.announcement-section {
    margin: 0 20px 16px;
}

.announcement-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 3px;
    padding: 2px 3px 2px 0;
}

.announcement-list::-webkit-scrollbar {
    display: none;
}

.announcement-item {
    padding: 12px 24px;
    height: 113px;
    width: calc(100% - 11px);
    flex-shrink: 0;
    box-sizing: border-box;
    scroll-snap-align: start;
    background-color: var(--announcements, #fff8e7);
    position: relative;
    overflow: hidden;
    /* border-radius: 12px; */
}

.announcement-item:not(:last-child) {
    border-right: none;
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.announcement-tag {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: var(--White);
    margin-right: 8px;
    background-color: var(--Yellow-500);
}

.announcement-tag.published {
    background-color: var(--Gray-600) !important;
}

.announcement-title {
    font-size: 16px;
    width: 320px;
    font-weight: 600;
    color: var(--Yellow-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.announcement-desc {
    font-size: 14px;
    line-height: 1.2;
    width: 320px;
    color: var(--Gray-700);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.announcement-date {
    padding-top: 20px;
    font-size: 14px;
    color: var(--Gray-500);
    position: absolute;
    bottom: 11px;
}

/* ===== Avatar ===== */
.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--White);
    font-weight: 600;
    font-size: 12px;
    border: 2px solid var(--White);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 載入中與空狀態 */
/* ===== Skeleton Shimmer Loading ===== */
@keyframes skeleton-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--Gray-100, #f4f4f5) 25%,
        var(--Gray-200, #e4e4e7) 50%,
        var(--Gray-100, #f4f4f5) 75%
    );
    background-size: 1200px 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
    display: block;
}

/* 卡片型骨架（取代 milestone-wrapper 佔位） */
.skeleton-card {
    height: 68px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 8px;
}
.skeleton-card:last-child { margin-bottom: 0; }

/* 文字型骨架（取代內聯文字佔位） */
.skeleton-line {
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
}

/* 舊類名保留相容 */
.loading-skeleton {
    height: 68px;
    border-radius: 12px;
    width: 100%;
    background: linear-gradient(
        90deg,
        var(--Gray-100, #f4f4f5) 25%,
        var(--Gray-200, #e4e4e7) 50%,
        var(--Gray-100, #f4f4f5) 75%
    );
    background-size: 1200px 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    width: 100%;
    text-align: center;
}

/* ===== 確認 Modal（刪除、取消等確認對話框）===== - 未顯示時強制隱藏 */
.confirm-modal:not(.show) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.confirm-modal.show {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.confirm-modal-content {
    background: var(--White);
    border-radius: 16px;
    padding: 24px;
    width: calc(100% - 48px);
    max-width: 320px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.confirm-modal.show .confirm-modal-content {
    transform: scale(1);
}

.confirm-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--Gray-900);
    margin-bottom: 8px;
}

.confirm-modal-desc {
    font-size: 14px;
    color: var(--Gray-desc);
    margin-bottom: 24px;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
}

.confirm-modal-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-modal-btn.cancel {
    background: var(--White);
    color: var(--Gray-700);
    border: 1px solid #000000;
}

.confirm-modal-btn.confirm {
    background: var(--Blue-500-Primary);
    color: var(--White);
    border: none;
}

.confirm-modal-btn.delete {
    background: var(--Red-500);
    color: var(--White);
    border: none;
}

.confirm-modal-btn:hover {
    opacity: 0.9;
}

/* ===== 共用 Modal 樣式（新增/編輯表單）===== - 未顯示時強制隱藏 */
.modal-overlay:not(.show) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.modal-content {
    background: var(--White);
    width: 100%;
    max-width: var(--app-shell-max-width);
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.modal-body {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
    background: var(--bg);
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    background-color: var(--bg);
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--Neutral-200, #F3F3F3);
    justify-content: space-between;
    padding: 16px 24px;
    flex-shrink: 0;
}

.modal-back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    color: var(--Gray-600);
    transition: background 0.2s;
    margin-left: -8px;
}

.modal-back-btn:hover {
    background: var(--Gray-100);
}

.modal-title {
    font-size: 20px;
    font-weight: 300;
    color: var(--Black-500);
}

.modal-spacer {
    width: 36px;
}

/* ===== 共用表單樣式 ===== */
.form-group {
    margin-bottom: 10px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--Gray-700);
    margin-top: 16px;

}

.form-label .required {
    color: var(--Red-600);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--Gray-300);
    border-radius: 20px;
    font-size: 16px;
    color: var(--Gray-900);
    outline: none;
    background: var(--White);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

input[type="text"].form-input {
    border-radius: 9999px;
}


.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--Blue-500-Primary);
}

.form-input::placeholder,
.form-textarea::placeholder,
.ss-native-display::placeholder {
    color: var(--Gray-500);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ===== 共用按鈕樣式 ===== */
.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--Blue-500-Primary);
    color: var(--White);
    font-size: 16px;
    font-weight: 600;
    height: 48px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 24px;
    margin-bottom: calc(30px + env(safe-area-inset-bottom))
}

.submit-btn:hover {
    opacity: 1;
}

/* ===== Footer System (base + modifiers) ===== */
.footer-base {
    width: 100%;
    box-sizing: border-box;
    background: var(--White);
}

.footer-safe-12 {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.footer-safe-16 {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* 與 .footer-fixed 併用時：底部外距改併入 padding，margin 區才有與 footer 相同的底色 */
.footer-fixed.footer-safe-16 {
    padding-bottom: calc(34px + 16px + env(safe-area-inset-bottom));
}

.footer-fixed.footer-safe-12 {
    padding-bottom: calc(34px + 12px + env(safe-area-inset-bottom));
}

.footer-modal {
    background: var(--White);
    padding: 16px 24px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    flex-shrink: 0;
    margin-top: 0;
}

.footer-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    padding-top: 16px;
    padding-left: max(
        20px,
        calc((100vw - var(--app-shell-max-width)) / 2 + 20px)
    );
    padding-right: max(
        20px,
        calc((100vw - var(--app-shell-max-width)) / 2 + 20px)
    );
    /* 勿用 padding 縮寫，否則會蓋掉 .footer-safe-* 的 padding-bottom（含 safe area） */
}

.footer-sticky {
    position: sticky;
    bottom: 0;
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.footer-with-top-border {
    border-top: 1px solid var(--Gray-300);
}

.modal-step-footer .submit-btn {
    margin-top: 0;
}

/* 固定底部按鈕容器 - 常駐畫面底部 */

.add-btn-container {
    z-index: 40;
}

.add-btn {
    width: 358px;
    max-width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 1;
    padding: 12px 10px;
    background: var(--Blue-500-Primary);
    color: var(--White);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-sizing: border-box;
    margin: 0 auto;
}

.add-btn:hover {
    opacity: 0.9;
}

.add-btn-outline {
    background: var(--White);
    color: var(--Gray-900);
    border: 1px solid var(--Blue-500-Primary);
}

.add-btn-primary {
    background: var(--Blue-500-Primary);
    color: var(--White);
    border: none;
}

.add-card-dashed {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 5px;
    height: 68px;
    background-color: var(--bg);
    border: 1px dashed var(--Gray-500);
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-card-dashed:hover {
    border-color: var(--Gray-400);
    background-color: var(--Gray-50);
}

.add-card-dashed span {
    font-size: 15px;
    color: var(--Gray-500);
    font-weight: 500;
}

/* ===== 設定頁面共用 Header ===== */
.settings-header,
.page-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 內嵌 SVG 預設 opacity:1（utility 如 .opacity-0 仍較高優先權可覆寫） */
svg {
    opacity: 1;
}

.view-more.disabled a,
.view-more.disabled a,
.view-more.disabled a svg {
    color: #a5a5a5 !important;
}

.modal-back-btn>svg,
.back-btn>svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #383538;
    cursor: pointer;
}

.settings-header .header-right-btn,
.page-header .header-right-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    opacity: 1;
    color: #383538;
}

.settings-header .header-right-btn svg,
.page-header .header-right-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #383538;
    opacity: 1;
}

.settings-header .header-right-btn svg path,
.page-header .header-right-btn svg path {
    fill: #383538;
}

.settings-header .header-right-btn svg path[fill="none"],
.page-header .header-right-btn svg path[fill="none"] {
    fill: none;
}

.settings-header .header-right-btn svg path[stroke],
.page-header .header-right-btn svg path[stroke] {
    stroke: #383538;
}

.settings-header .header-right-btn img,
.page-header .header-right-btn img {
    width: 20px;
    height: 20px;
    display: block;
}

.header-title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px; 
    letter-spacing: 0.4px;
    color: var(--Gray-900);
}

/* ===== Tab 按鈕樣式 ===== */
.tabs-container {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px;
    background: var(--bg);
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: 30px;    
    border: 1px solid #FAFAFA;
    background: #FFF;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.tab-btn.active {
    background-color: var(--Blue-500-Primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(23, 50, 79, 0.3);
}

.tab-btn:not(.active) {
    background-color: #fff;
    color: var(--Blue-500-Primary);
    border-radius: 30px;
    border: 1px solid #FAFAFA;
    background: #FFF;
    box-shadow: 4px 12px 20px 0 rgba(135, 144, 170, 0.09);
}

/* ===== Purchase Check 樣式 ===== */
.purchase-check {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--Gray-400);
    background: rgba(2, 45, 90, 0.1);
    padding: 3px;
    border-radius: 4px;
}

.purchase-check.checked{
    border: 1px solid #222 !important;
    color: var(--Blue-purchase-check);
    background: rgba(2, 45, 90, 0.1);
}

/* ===== Checkbox Group 樣式 ===== */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    cursor: pointer;
}

.checkbox-group .check-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--Gray-400);
    background: rgba(2, 45, 90, 0.1);
    padding: 3px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-group .check-icon.checked {
    color: var(--Blue-purchase-check);
}

.checkbox-group label {
    font-size: 14px;
    color: var(--Gray-700);
    cursor: pointer;
}

/* 隱藏 Number Input 的 Spin Buttons */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ===== Searchable Select Combobox ===== */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select.ss-native-select .ss-native-display {
    width: 100%;
    display: block;
    padding-right: 24px;
    font-size: 14px;
    color: var(--Gray-900);
}

.searchable-select.ss-native-select.disabled .ss-input-wrap {
    background: var(--Gray-200);
    color: var(--Gray-500);
    cursor: not-allowed;
}

.searchable-select.ss-native-select.disabled .ss-arrow {
    color: var(--Gray-400);
}

.ss-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 40px;
    padding: 0 16px;
    border: 1px solid var(--Gray-300);
    border-radius: 999px;
    font-size: 16px;
    color: var(--Gray-900);
    background: var(--White);
    cursor: pointer;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.ss-input-wrap:focus-within {
    border-color: var(--Blue-500-Primary);
}

.ss-input {
    width: 100%;
    padding: 0 24px 0 0;
    border: none;
    outline: none;
    font-size: 16px;
    line-height: 1.5;
    color: var(--Gray-900);
    background: transparent;
    cursor: text;
}

.ss-input::placeholder {
    color: var(--Gray-800);
}

.ss-arrow {
    flex-shrink: 0;
    position: static;        /* 覆蓋原本的 absolute */
    transform: rotate(0deg); /* 覆蓋原本含 translate 的 transform */
    transition: transform 0.2s ease;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-800);
    margin-left: 8px;
    pointer-events: none;
}

.ss-arrow svg {
    display: block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.searchable-select.open .ss-arrow {
    transform: rotate(180deg); 
}

.ss-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--Gray-200);
    border-radius: 0 0 20px 20px;

    background: var(--White);
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.10);
    z-index: 9999;
    max-height: 200px;
    overflow-y: auto;
}

.searchable-select.open .ss-dropdown {
    display: block;
}

.ss-option {
    padding: 12px 16px;
    font-size: 15px;
    color: var(--Gray-700);
    cursor: pointer;
    transition: background 0.15s;
    margin-left: 4px;
}

@media (hover: hover) {
    .ss-option:hover {
        background-color: var(--Blue-100-bg);
    }
}
 
.ss-option.selected,
.ss-option.highlighted {
    background-color: var(--Blue-100-bg);
}
.modal-body .searchable-select.open .ss-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    margin-bottom: 8px;
}


.ss-option.highlighted {
    background: var(--Blue-100-bg, #eff6ff);
}


/* 隱藏捲軸但保留滾動行為 */
.hide-scrollbar {
    overflow-y: auto; /* 保留垂直滾動 */
    -webkit-overflow-scrolling: touch; /* iOS 慢速滾動體驗 */

    /* 隱藏不同瀏覽器的捲軸 */
    -ms-overflow-style: none; /* IE 10+ / Edge */
    scrollbar-width: none; /* Firefox */
}
.hide-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
.ss-multi-wrap::-webkit-scrollbar {
    display: none;            /* ← 隱藏 scrollbar（Chrome/Safari） */
}

.ss-option.disabled {
    color: var(--Gray-400);
    cursor: not-allowed;
}

.ss-empty {
    padding: 12px 16px;
    font-size: 14px;
    color: #9ca3af;
}

/* Multi-select tag variant */
.ss-multi-wrap {
    cursor: text;
    border-radius: 999px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
    overflow: auto; 
    gap: 0;
    
}

.ss-multi-wrap .ss-arrow {
    position: sticky;
    right: 0;
    flex-shrink: 0;
    margin-left: 0;
    padding-left: 4px;
}

.ss-multi-wrap .ss-input {
    flex: 0 0 auto;           /* ← 不壓縮，保持輸入框寬度 */
    flex: 1;
}

.ss-tags-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    scrollbar-width: none;
    align-items: center;
    -webkit-overflow-scrolling: touch;
}
.ss-tags-scroll::-webkit-scrollbar {
    display: none;
}


.ss-multi-wrappu-wrap{
    padding: 10px 15px 10px 12px;
    height: 40px;
    padding: 10px 15px 10px 12px;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.ss-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 8px;
    font-size: 12px;
    color: var(--Gray-700);
    white-space: nowrap;
    display: flex;
    padding: 2px 8px 2px 12px;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
    background: #F2F2F2;
}

.ss-tag.pending-remove {
    border-color: var(--Gray-900, #1f2937);
}

.ss-tag-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--Gray-700);
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.ss-option[data-selected="true"] {
    position: relative;

}

.ss-option[data-selected="true"]::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 12px;
    width: 24px;
    height: 24px;
    background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'><path d='M9.9998 13.6L15.8998 7.70005C16.0831 7.51672 16.3165 7.42505 16.5998 7.42505C16.8831 7.42505 17.1165 7.51672 17.2998 7.70005C17.4831 7.88338 17.5748 8.11671 17.5748 8.40005C17.5748 8.68338 17.4831 8.91672 17.2998 9.10005L10.6998 15.7C10.4998 15.9 10.2665 16 9.9998 16C9.73314 16 9.4998 15.9 9.2998 15.7L6.6998 13.1C6.51647 12.9167 6.4248 12.6834 6.4248 12.4C6.4248 12.1167 6.51647 11.8834 6.6998 11.7C6.88314 11.5167 7.11647 11.425 7.3998 11.425C7.68314 11.425 7.91647 11.5167 8.0998 11.7L9.9998 13.6Z' fill='%2317324F'/></svg>") no-repeat center center;
    background-size: contain;
    transform: translateY(-50%);
    pointer-events: none;
}
/* ===== Add More Dashed Button ===== */
.add-more-btn {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--White);
    border: 1px dashed var(--Gray-500);
    height: 48px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-size: 15px;
    color: var(--Gray-500);
    font-weight: 500;
}

.add-more-btn:hover {
    border-color: var(--Gray-400);
    background-color: var(--Gray-50);
}

.additional-group-card {
    border-left: 3px solid var(--Orange-500, #f97316);
    cursor: pointer;
}

.additional-group-title {
    color: var(--Orange-500, #f97316);
}

.stage-amount-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--Blue-500-Primary);
}

.additional-review-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--Gray-900);
    margin-bottom: 16px;
}

.additional-review-body {
    display: flex;
    flex-direction: column;
}

.additional-review-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.additional-review-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--White);
    padding: 16px 20px;
    border-radius: 4px;
    border: 1px solid #F4F4F4;
    background: #FFF;

    /* down */
    box-shadow: 0 4px 20px 0 rgba(151, 160, 178, 0.17);
}

.additional-review-card-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.additional-review-card-title {
    
    font-weight: 600;
    color: var(--Gray-800);
    word-break: break-word;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 18px; /* 128.571% */
    letter-spacing: 0.4px;
}

.additional-review-card-desc {
    color: var(--Gray-600);
    margin-top: 4px;
    word-break: break-word;
    font-size: 12px;
    font-style: normal;
    font-weight: 300;
    overflow: hidden;
    line-height: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.additional-review-card-amount {
    color: var(--Blue-500-Primary);
    font-family: Poppins;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 110%; /* 17.6px */
}

.additional-review-footer {
    margin-top: auto;
    padding-top: 24px;
}

.additional-review-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
}

.additional-review-total-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--Gray-500);
    font-size: 14px;
}

.additional-review-total-amount {
    font-size: 28px;
    font-weight: 700;
    color: var(--Gray-900);
    white-space: nowrap;
}

/* ===== Category Row ===== */
.category-row {
    padding: 16px 0;
    font-size: 15px;
    color: var(--Gray-700);
    border-bottom: 1px solid var(--Gray-200);
    cursor: pointer;
}

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

.category-row:active {
    background-color: var(--Gray-100);
}

/* ===== Calendar / Date Picker ===== */
.form-label {
    display: block;
    font-size: 14px;
    color: var(--Gray-700);
    margin-bottom: 3px;
}
.form-label:first-of-type {
  margin-top: 0;   /* 或是你想要的任意值 */
}

.date-picker-trigger.active {
    border-color: var(--Blue-500-Primary);
}

.date-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--Gray-300);
    border-radius: 20px;
    cursor: pointer;
    background: var(--White);
    transition: border-color 0.2s;
}

.date-picker-value {
    font-size: 15px;
    color: var(--Gray-900);
}

.date-picker-value.placeholder {
    color: var(--Gray-400);
}

.date-picker-icon {
    color: var(--neutral-800);
}

.date-picker-trigger.ss-input-wrap .date-picker-value {
    padding-right: 24px;
}

.calendar-selects .searchable-select.ss-native-select {
    min-width: 84px;
}

.calendar-selects .searchable-select.ss-native-select .ss-input-wrap {
    padding: 4px 8px;
    padding-right: 28px;
    min-height: 32px;
    border-radius: 8px;
    font-size: 14px;
}

.calendar-selects .searchable-select.ss-native-select .ss-native-display {
    font-size: 14px;
    line-height: 1.4;
    padding-right: 20px;
}

.calendar-selects .searchable-select.ss-native-select .ss-dropdown {
    border-radius: 12px;
    max-height: 240px;
    z-index: 2200;
}

.date-picker-trigger.active .ss-arrow {
    transform: translate(0, -50%) rotate(180deg);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.calendar-nav {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: var(--Gray-800);
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.calendar-nav:hover {
    background: rgba(22, 32, 54, 0.08);
    color: var(--Gray-900);
}

.calendar-selects {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-select {
    border: 1px solid var(--Gray-300);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--Gray-900);
    background: var(--White);
    cursor: pointer;
    outline: none;
    min-width: 80.317px;
    max-width: 103.939px;
    height: 33.072px;
    text-align: center;
}

.calendar-select:focus {
    border-color: var(--Blue-500-Primary);
}

.calendar-day.disabled {
    color: var(--Gray-300);
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Date Picker Modal Overlay ── */
.dp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.dp-overlay.show {
    display: flex;
}

.dp-overlay-bg {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.60);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.dp-overlay > .calendar-dropdown {
    position: relative !important;
    display: block !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 1;
    width: min(320px, calc(100vw - 32px));
    background: var(--White);
    border-radius: 18px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.26);
    padding: 20px;
}

body.dp-open {
    overflow: hidden;
}

.calendar-dropdown.show {
    display: block;
}

.calendar-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--White);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    margin-top: 8px;
    padding: 16px;
}

/* Weekday header row */

.calendar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--Gray-900);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}

.calendar-weekday {
    font-size: 12px;
    font-weight: 600;
    color: #677082;
    padding: 8px 0;
}

/* Day grid */

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #26303f;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.calendar-day.today {
    border: 1px solid #1f2937;
}

.calendar-day.selected {
    background: #1f2430;
    color: var(--White);
}

.calendar-day.in-range {
    background: rgba(34, 34, 34, 0.15);
    border-radius: 0 !important;
}

.calendar-day.range-start.in-range {
    border-top-left-radius: 50%;
    border-bottom-left-radius: 50%;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.calendar-day.range-end.in-range {
    border-radius: 50% !important;
}

.calendar-day.selected.in-range {
    background: #1f2430;
    color: var(--White);
}

.calendar-day.range-start,
.calendar-day.range-end {
    background: #1f2430;
    color: var(--White);
    border-radius: 50%;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.other-month {
    color: var(--Gray-400);
}

.calendar-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.calendar-btn {
    flex: 1;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-align: center;
}

.calendar-btn.secondary {
    background: var(--White);
    border: 1px solid #000;
    color: var(--Blue-500-Primary);
    font-style: normal;
    font-weight: 500;
    line-height: 24px; /* 171.429% */
    letter-spacing: 0.4px;
}

.calendar-btn.primary {
    background: #173d67;
    color: var(--White);
}

/* ===== Purchase Section & Item ===== */
.purchase-section {
    border: 1px solid #f4f4f4;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--White);
}

.purchase-item {
    height: 68px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--White);
    position: relative;
}

.purchase-item::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background-color: #f4f4f4;
}

.purchase-item:last-child::after {
    display: none;
}

.purchase-item-content {
    flex: 1;
}

.item-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--Black-500);
    margin-bottom: 4px;
}

.item-spec {
    font-size: 13px;
    color: var(--Gray-600);
}

/* ===== Milestone Section (shared) ===== */
.milestone-section {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 16px;
}


.milestone-wrapper:last-child {
    
    margin-bottom: 0;
}

.milestone-item {
    height: 68px;
    padding: 16px 16px 12px;
    background-color: var(--White);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: min-height 0.35s ease;
}

.milestone-content {
    flex: 1;
    min-width: 0;
}

.milestone-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--neutral-800);
}

.milestone-subtitle {
    font-size: 14px;
    color: var(--Gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* 無內容也保留一行高度，避免列表高低不一 */
    min-height: 22px;
    max-height: 22px;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.35s ease, margin 0.35s ease;
    margin-top: 2px;
    box-sizing: border-box;
}

.milestone-subtitle.show {
    max-height: 40px;
    opacity: 1;
}

.milestone-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: 12px;
}

.milestone-action-btn {
    cursor: pointer;
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.milestone-action-btn img {
    width: 20px;
    height: 20px;
}

.milestone-action-btn svg {
    color: #383538;
    flex-shrink: 0;
}

.milestone-action-btn svg path {
    fill: #383538;
}

.milestone-action-btn svg path[fill="none"],
.milestone-action-btn svg [fill="none"] {
    fill: none;
}

.milestone-action-btn svg path[stroke],
.milestone-action-btn svg line,
.milestone-action-btn svg polyline {
    stroke: #383538;
}

.milestone-action-btn--muted svg {
    opacity: 1;
}

.milestone-action-btn--muted svg path {
    fill: rgba(56, 53, 56, 0.35);
}

/* milestone-action-btn trash（垃圾桶）專用顏色 */
.milestone-action-btn.trash svg {
    color: var(--Red-500);
}

.milestone-action-btn.trash svg path {
    fill: var(--Red-500);
}

.milestone-action-btn.trash svg path[fill="none"],
.milestone-action-btn.trash svg [fill="none"] {
    fill: none;
}

.milestone-action-btn.trash svg path[stroke],
.milestone-action-btn.trash svg line,
.milestone-action-btn.trash svg polyline {
    stroke: var(--Red-500);
}

/* ===== Category Label Badge ===== */
.category-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 51px;
    height: 19px;
    background-color: var(--Blue-500-Primary);
    color: var(--White);
    padding: 0 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    bottom: -11px;
    margin-left: 12px;
    position: relative;
    z-index: 1;
}

/* ===== 刪除模式通用元件 ===== */
.delete-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: transparent;
    background: rgba(2, 45, 90, 0.08);
    padding: 3px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

 
.delete-checkbox:not(.checked) svg {
    display: none;
}
 

.delete-checkbox:not(.checked) svg {
    display: none;
}

.delete-checkbox.checked {
    color: var(--Blue-purchase-check);
    background: rgba(2, 45, 90, 0.15);
}

.delete-checkbox--dimmed {
    opacity: 1;
}

.delete-checkbox--dimmed.checked {
    color: rgba(2, 45, 90, 0.5);
}

.delete-checkbox--dimmed:not(.checked) {
    background: rgba(2, 45, 90, 0.05);
}

.multi-item-row-remove-btn {
    opacity: 1;
    color: rgba(56, 53, 56, 0.5);
    transition: color 0.2s;
}

.multi-item-row-remove-btn:hover {
    color: #383538;
}

.announcement-delete-btn {
    opacity: 1;
    color: rgba(56, 53, 56, 0.45);
    transition: color 0.2s;
}

.announcement-delete-btn:hover {
    color: #383538;
}

.delete-selected-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--Red-500);
    color: var(--White);
    border: none;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.delete-selected-btn:hover {
    opacity: 0.9;
}

.delete-selected-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.delete-cancel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 14px;
    background: var(--White);
    color: var(--Gray-900);
    border: 1px solid var(--Gray-300);
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.delete-cancel-btn:hover {
    opacity: 0.9;
}

.delete-cancel-btn ~ .delete-selected-btn {
    width: auto;
    flex: 1;
}

.remove-photo-btn .preview-action-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--White);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.remove-photo-btn .preview-action-circle img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

/* ===== Shared Lightbox Counter ===== */
#shared-lightbox-counter {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 80vw;
    z-index: 2050;
    pointer-events: none;
}

/* ===== 拖曳排序共用樣式 ===== */
.dragging {
    opacity: 0.7 !important;
    transform: scale(1.02) !important;
    z-index: 100 !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.photo-preview-item.drag-over,
.edit-photo-item.drag-over {
    border: 2px dashed var(--Blue-500-Primary) !important;
}

.milestone-wrapper.drag-over .milestone-item {
    border: 2px dashed var(--Blue-500-Primary) !important;
}

body.dragging-active {
    overscroll-behavior-y: contain;
    touch-action: none;
}

/* ===== 編輯重點工程頁面 ===== - 未顯示時強制隱藏 */
.edit-overlay:not(.show) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.edit-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 200;
    flex-direction: column;
}

.edit-overlay.show {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.edit-overlay .page-header {
    position: sticky;
    top: 0;
    z-index: 201;
}

.edit-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 120px;
    max-width: var(--app-shell-max-width);
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.edit-section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--Black-500);
    margin-top: 16px;
    margin-bottom: 4px;
}

.edit-section-desc {
    font-size: 14px;
    color: var(--Gray-600);
    margin-bottom: 20px;
}

/* 工程狀態文字區 */
.edit-status-textarea {
    width: 100%;
    min-height: 160px;
    padding: 14px 16px;
    border: 1px solid var(--Gray-300);
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--Gray-900);
    background: var(--White);
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.edit-status-textarea:focus {
    border-color: var(--Blue-500-Primary);
}

.edit-status-textarea::placeholder {
    color: var(--Gray-400);
}

/* 照片上傳區 */
.edit-photo-upload-area {
    border: 1.5px dashed var(--Gray-300);
    border-radius: 12px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    background: var(--Gray-200);
    transition:
        border-color 0.2s,
        background 0.2s;
    min-height: 100px;
}

.edit-photo-upload-area:hover {
    border-color: var(--Gray-400);
    background: var(--Gray-100);
}

.edit-photo-upload-area span {
    font-size: 13px;
    color: var(--Gray-400);
}

/* 照片預覽列表 */
.edit-photo-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-top: 12px;
    padding-bottom: 4px;
}

.edit-photo-grid::-webkit-scrollbar {
    display: none;
}

.edit-photo-item {
    position: relative;
    height: 100px;
    width: 130px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--Gray-100);
}

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

.edit-photo-item .remove-photo-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 50%;
    padding: 0;
    z-index: 10;
}

.edit-photo-item:hover .remove-photo-btn,
.edit-photo-item:active .remove-photo-btn {
    opacity: 1;
}

.edit-photo-item .remove-photo-btn .trash-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-photo-item .remove-photo-btn .trash-circle img {
    width: 18px;
    height: 18px;
    filter: brightness(10);
}

/* 固定底部儲存發布按鈕 */
.edit-footer {
    z-index: 202;
}

.edit-save-btn {
    width: 100%;
    padding: 14px;
    background: var(--Blue-500-Primary);
    color: var(--White);
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.edit-save-btn:hover {
    opacity: 0.9;
}

.edit-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 詳細頁 (檢視模式) - 未顯示時強制隱藏，避免跑版 */
.detail-overlay:not(.show) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 1000;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
}

.detail-overlay.show {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.detail-overlay-inner {
    width: 100%;
    max-width: var(--app-shell-max-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    overflow-x: hidden;
}

.detail-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--Gray-200);
}

.detail-carousel {
    position: relative;
    width: calc(100% - 32px);
    margin: 0 16px;
    overflow: hidden;
    background: var(--Gray-200);
    aspect-ratio: 4/3;
    border-radius: 20px;
}

.detail-carousel-track {
    display: flex;
    transition: transform 0.3s ease;
    height: 100%;
}

.detail-carousel-track img {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    object-fit: cover;
    outline: none;
    border: none;
}

.detail-carousel-track img:focus,
.detail-carousel-track img:active {
    outline: none;
}

.detail-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
}

.detail-carousel-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--Gray-500);
    transition: background 0.2s;
    cursor: pointer;
}

.detail-carousel-dots .dot.active {
    background: var(--Yellow-500);
}

.detail-body {
    padding: 20px 30px;
    flex: 1;
}

.detail-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--Gray-900);
    margin-bottom: 10px;
    line-height: 1.3;
}

.detail-date {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--Gray-500);
    margin-bottom: 16px;
}

.detail-content {
    font-size: 15px;
    color: var(--Gray-700);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== Purchase Settings Page ===== */
.ps-content {
    padding: 16px 20px 48px;
    flex: 1;
}

/* 管理員從設定進入、尚無採購範本時的空狀態版面 */
.ps-content.ps-content--settings-empty {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    justify-content: center;
    padding-bottom: 100px;
}
/* #category-list{
    border: 1px solid #F4F4F4;
    
} */

.ps-content.ps-content--settings-empty #category-list {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 200px;
}

.ps-header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 1;
    color: #383538;
    transition: opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.ps-header-icon-btn svg path {
    fill: #383538;
}

.ps-category-heading {
    font-size: 16px;
    margin-top:24px;
    font-weight: 700;
    color: var(--Black-500);
}


.ps-items-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ps-item-card {
    position: relative; /* 關鍵 */
    border-radius: 4px;
    padding: 12px 16px;
    height: 67px;
    background: var(--White);
    display: flex;
    align-items: center;
    gap: 5px;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

/* 中間那條線 */
body.view-settings .ps-item-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 16px;   /* 控制左邊留白 */
    right: 16px;  /* 控制右邊留白 */
    height: 1.5px;
    background: var(--Blue-100-bg);
}

.ps-item-card:last-child::after {
    display: none;
}

.ps-item-card--filled {
    box-shadow: 0 2px 8px rgba(13, 45, 116, 0.08);
}

.ps-item-card--template {
    /* background: var(--Gray-500); */
    border: 1px dashed var(--Gray-500);
}

.ps-item-card--template .ps-item-name,
.ps-item-card--template .ps-item-spec {
    opacity: 1;
}

/* Settings View Overrides */
.view-settings .ps-items-group {
    gap: 0;
    border-radius: 12px;
    background: var(--White);
    border: 1px solid var(--Gray-200);
    overflow: hidden;
}

.view-settings .ps-item-card--template {
    background: #ffffff !important;
    position: relative;
    border-radius: 0;
    border: 2px dashed #ccc;
}

.view-settings .ps-item-card--template+.ps-item-card--template::before {
    content: "";
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--Gray-200);
}

.view-settings .ps-item-card--template .ps-item-name,
.view-settings .ps-item-card--template .ps-item-spec {
    opacity: 1;
}

.view-settings .ps-item-card--template .ps-item-edit-btn {
    opacity: 1;
}

.view-settings .ps-item-card--template:active {
    background: #ffffff !important;
}

.view-settings .ps-item-card--filled {
    margin: 8px 0;
    border-radius: 12px;
}

/* 
.index-purchase-wrap {
    /* padding: 0 20px 24px; */
} */

.ps-item-card:active {
    background: var(--Gray-50);
}

.ps-item-card-body {
    flex: 1;
    min-width: 0;
}

.ps-item-name,
.ps-item-name-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--Black-500);
    margin-bottom: 3px;
    min-width: 0;
}

/* .ps-item-name-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    color: var(--Gray-800);
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    letter-spacing: 0.4px;
} */

.ps-item-name--row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.ps-item-name--row .ps-item-name-text {
    flex: 1 1 0%;
}

.ps-item-name--row .announcement-tag {
    flex-shrink: 0;
}

.ps-item-spec {
    font-size: 13px;
    color: var(--Gray-600);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    font-weight: 300;
    line-height: normal;
    text-overflow: ellipsis;
}

.ps-item-edit-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 1;
    color: #383538;
    -webkit-tap-highlight-color: transparent;
}

.ps-item-edit-btn img {
    width: 20px;
    height: 20px;
}

.ps-item-edit-btn svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: #383538;
}

.ps-item-edit-btn svg path {
    fill: #383538;
}

.ps-item-edit-btn:hover {
    opacity: 1;
    background-color: rgba(56, 53, 56, 0.06);
    border-radius: 8px;
}

.ps-item-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.ps-item-thumb-wrap {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.ps-item-thumb-wrap .ps-item-thumb {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 0;
}

.ps-item-thumb-search {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    pointer-events: none;
}

.ps-item-thumb-search img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

/* 縮圖載入中骨架（覆蓋整個 thumb-wrap） */
.ps-item-thumb-skeleton {
    position: absolute;
    inset: 0;
    border-radius: 0; /* 由父層 overflow:hidden 裁切 */
}

.ps-add-card {
    border: 1.5px dashed var(--Gray-300);
    border-radius: 5px;
    padding: 18px 16px;
    /* background: var(--White); */
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 15px;
    color: var(--Gray-400);
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

.ps-add-card:active {
    background: var(--Gray-50);
}

.ps-delete-bar {
    border-top: 1px solid var(--Gray-100);
    z-index: 50;
}

.ps-delete-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background: #ef4444;
    color: var(--White);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ps-delete-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Photo upload styles (purchase-settings / shared) */
.ps-photo-upload-area {
    border: 1.5px solid var(--Gray-300);
    border-radius: 12px;
    padding: 24px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    background: var(--White);
    transition:
        border-color 0.2s,
        background 0.2s;
    height: 140px;
    min-height: 100px;
    box-sizing: border-box;
}

.ps-photo-upload-area:hover {
    border-color: var(--Gray-400);
    background: var(--Gray-100);
}

.ps-photo-upload-area span {
    font-size: 13px;
    color: var(--Gray-400);
}

.ps-photo-upload-area.has-image {
    padding: 0;
    height: 140px;
    min-height: 140px;
    overflow: hidden;
}

.ps-photo-upload-preview-wrap {
    padding: 0;
    margin: 0 auto;
}

.ps-photo-upload-area.has-image .ps-photo-upload-preview-wrap {
    width: 109px;
    height: 109px;
    max-width: 109px;
    max-height: 109px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--Gray-100);
    position: relative;
    top: 0;
    left: 0;
    border-radius: 8px;
    padding: 0;
    margin: 0 auto;
}

.ps-photo-upload-preview {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    display: block;
}

.ps-photo-preview-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 12px;
}

.ps-photo-preview-grid::-webkit-scrollbar {
    display: none;
}

.ps-photo-preview-item {
    position: relative;
    height: 109px;
    width: 109px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    top: 5.5px;
    left: 118px;
}

.ps-photo-upload-area.has-image .ps-photo-preview-item {
    top: 0;
    left: 0;
    margin: 0;
}

.ps-photo-preview-item>img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ps-photo-preview-item .remove-photo-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s;
    border-radius: 50%;
    padding: 0;
    z-index: 10;
}

.ps-photo-preview-item .remove-photo-btn .preview-action-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-photo-preview-item .remove-photo-btn .preview-action-circle img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.ps-photo-preview-item .remove-photo-btn .trash-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-photo-preview-item .remove-photo-btn .trash-circle img {
    width: 18px;
    height: 18px;
    filter: brightness(10);
}

/* ===== Purchase View (enduser / pv-*) ===== */

/* 實線卡片群組 */
.pv-items-group {
    display: flex;
    flex-direction: column;
    background: var(--White);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--Gray-200);
}

/* 每張項目卡 */
.pv-item-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--White);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

.pv-item-card:active {
    background: var(--Gray-50);
}

/* 卡片之間的分隔線 */
.pv-item-card+.pv-item-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 52px;
    right: 16px;
    height: 1px;
    background: var(--Gray-200);
}

/* 勾選框（樣式參考 delete-checkbox） */
.pv-checkbox {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    padding: 3px;
    border-radius: 4px;
    color: transparent;
    background: rgba(2, 45, 90, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pv-checkbox.checked {
    color: var(--Blue-purchase-check);
    background: rgba(2, 45, 90, 0.15);
}

/* 內容區 */
.pv-item-body {
    flex: 1;
    min-width: 0;
}

.pv-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--Black-500);
    margin-bottom: 3px;
}

.pv-item-name.checked {
    text-decoration-color: var(--Gray-400);
}

.pv-item-spec {
    font-size: 13px;
    color: var(--Gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 縮圖 */
.pv-item-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--Gray-100);
}

/* 通知按鈕（懸浮，右下角） */
.pv-notify-fab {
    position: fixed;
    right: 20px;
    bottom: calc(24px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 20px;
    border-radius: 20px;
    background: var(--Blue-500-Primary);
    color: var(--White);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(23, 50, 79, 0.35);
    transition:
        opacity 0.2s,
        transform 0.2s;
    z-index: 50;
    -webkit-tap-highlight-color: transparent;
}

.pv-notify-fab:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pv-notify-fab.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

/* 通知送出後的成功狀態 */
.pv-notify-fab.sent {
    background: #10b981;
}

/* 空狀態 */
.pv-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--Gray-400);
    font-size: 14px;
}

.section-edit-link {
    font-size: 14px;
    color: var(--Gray-800);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 2px;
    text-decoration: none;
}
