html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
    background-color: #FFFBF7; /* 改為極淡的暖米色，比純白更溫馨 */
    color: #4A4A4A; /* 深灰代替純黑，更柔和 */
    -webkit-font-smoothing: antialiased;
    font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

/* === 1. Banner 容器 === */
.hero-image-container {
    border-radius: 0 0 24px 24px; /* 底部圓角，像一張卡片 */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.05);
}

/* === 2. 套餐卡片 (Package Card) - 可愛圓潤風 === */
.plan-card {
    border: 2px solid #F3F4F6;
    background: #FFF;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* 彈跳效果 */
    position: relative;
    overflow: hidden;
    border-radius: 20px; /* 大圓角 */
}

/* 未選中時的懸停 */
.plan-radio:not(:checked) + .plan-card:hover {
    border-color: #FED7AA; /* 淡橘色 */
    background: #FFF7ED;
}

/* ★ 選中狀態：橘色邊框 + 輕微上浮 ★ */
.plan-radio:checked + .plan-card {
    border: 2px solid #F97316; /* 品牌橘 */
    background-color: #FFF;
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.15);
    transform: translateY(-4px);
}

/* 選中時的可愛勾勾 */
.plan-radio:checked + .plan-card::before {
    content: '●'; /* 簡單的點綴 */
    position: absolute;
    top: 8px;
    right: 12px;
    color: #F97316;
    font-size: 8px;
    z-index: 2;
}

/* === 3. 規格選擇 (SKU) === */
/* 圖片選項：圓形或大圓角 */
.sku-img-card {
    border: 2px solid #F3F4F6;
    transition: all 0.2s;
    border-radius: 16px;
}
.sku-radio:checked + .sku-img-card {
    border-color: #F97316 !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1) !important;
    transform: scale(1.05) rotate(-2deg); /* 選中時俏皮歪一下 */
}

/* 文字選項：軟糖按鈕風格 */
.sku-text-pill {
    background: #F3F4F6;
    border: 1px solid transparent;
    color: #666;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 99px; /* 膠囊狀 */
}
.sku-radio:checked + .sku-text-pill {
    background-color: #FFF7ED;
    border-color: #F97316;
    color: #F97316;
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.1);
    font-weight: 700;
}

/* === 4. 配送方式 (Delivery) === */
.delivery-card {
    border: 2px solid #F3F4F6;
    background: #FFF;
    border-radius: 16px;
}
.delivery-radio:checked + .delivery-card {
    border-color: #F97316;
    background-color: #FFF7ED;
}
.delivery-radio:checked + .delivery-card .icon {
    color: #F97316;
}
.delivery-radio:checked + .delivery-card .label {
    color: #F97316;
    font-weight: bold;
}

/* === 輸入框 (PUPU Style) - 圓潤灰底 === */
.apple-input {
    background: #F9FAFB;
    border: 2px solid transparent;
    border-radius: 12px; /* 圓角 */
    padding: 12px 16px;
    transition: all 0.3s;
    font-size: 15px;
}
.apple-input:focus {
    background: #FFF;
    border-color: #F97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.05);
    outline: none;
}
.apple-input::placeholder {
    color: #9CA3AF;
}

/* === 按鈕 (橘色果凍漸層) === */
.btn-shimmer {
    background: linear-gradient(135deg, #FB923C, #EA580C);
    color: white;
    position: relative;
    overflow: hidden;
    border-radius: 99px; /* 全圓角 */
    transition: transform 0.1s;
}
.btn-shimmer:active {
    transform: scale(0.96);
}
.btn-shimmer::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}
@keyframes shine {
    0% { left: -100%; } 20% { left: 200%; } 100% { left: 200%; }
}

/* === 頭像與其他 === */
.avatar-item {
    border: 2px solid #FFF;
    width: 28px; height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
        /* === Q-Mio 啾咪風格：手帳貼紙風 (CSS Override) === */

        /* 1. 背景：奶黃色方格紙 */
        body {
            background-color: #FFFBEB !important;
            background-image:
                linear-gradient(#FFE4E6 1px, transparent 1px),
                linear-gradient(90deg, #FFE4E6 1px, transparent 1px);
            background-size: 20px 20px;
            background-position: center center;
        }

        /* 2. 套餐卡片：圓圓的便利貼 */
        .plan-card {
            border: 3px solid #FFF !important; /* 白邊 */
            outline: 2px solid #FFC4D6 !important; /* 粉框 */
            border-radius: 24px !important;
            background: #FFF !important;
            box-shadow: 6px 6px 0px 0px #FFDEE9 !important; /* 硬陰影 */
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
            position: relative;
            overflow: visible !important;
        }
        .plan-radio:checked + .plan-card {
            background-color: #FFF0F5 !important;
            outline-color: #FF6B95 !important;
            box-shadow: 2px 2px 0px 0px #FF6B95 !important; /* 按壓效果 */
            transform: translate(2px, 2px);
        }
        .plan-radio:checked + .plan-card::before {
            content: '💖' !important;
            font-size: 18px !important;
            position: absolute !important;
            top: -10px !important;
            right: -5px !important;
            z-index: 10;
            filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
        }

        /* === 3. SKU 圖片選項 (重點適配) === */
        .sku-img-card {
            width: 120px !important;  /* 固定寬度 */
            height: 120px !important; /* 固定高度 */
            border-radius: 50% !important; /* 強制正圓 */
            border: 3px solid #FFF !important;
            box-shadow: 0 0 0 2px #FFC4D6 !important; /* 預設粉圈 */
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
            overflow: hidden !important;
            margin: 0 auto 6px auto !important; /* 居中 */
            background: #FFF;
        }
        .sku-img-card img {
            object-fit: cover !important;
            width: 100% !important;
            height: 100% !important;
        }
        /* 選中狀態：紫色光圈 + 放大 */
        .sku-radio:checked + .sku-img-card {
            box-shadow: 0 0 0 3px #A855F7 !important;
            transform: scale(1.1) !important;
            z-index: 10;
        }

        /* 圖片下方的文字標籤 */
        .sku-radio + .sku-img-card + span {
            font-size: 11px !important;
            font-weight: 700 !important;
            color: #888 !important;
            background: #FFF;
            padding: 2px 8px;
            border-radius: 12px;
            border: 1px solid transparent;
            transition: all 0.2s;
            max-width: 80px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            display: block;
            margin: 0 auto;
        }
        /* 選中文字變色 */
        .sku-radio:checked + .sku-img-card + span {
            color: #A855F7 !important;
            background: #F3E8FF !important;
            border-color: #A855F7 !important;
            box-shadow: 0 2px 0 rgba(168, 85, 247, 0.2);
        }

        /* 4. SKU 純文字選項 */
        .sku-text-pill {
            border-radius: 99px !important;
            background-color: #FFF !important;
            border: 2px solid #FFC4D6 !important;
            color: #FF6B95 !important;
            font-weight: 800 !important;
            box-shadow: 2px 2px 0px #FFC4D6 !important;
        }
        .sku-radio:checked + .sku-text-pill {
            background-image: linear-gradient(90deg, #FF6B95, #A855F7) !important;
            color: white !important;
            border-color: transparent !important;
            box-shadow: inset 0 2px 5px rgba(0,0,0,0.1) !important;
            transform: translateY(1px);
        }

        /* === 5. 配送方式 (可愛化大升級) === */
        .delivery-card {
            border: 3px solid #FFF !important; /* 白邊 */
            background: #FFF !important;
            border-radius: 20px !important;
            box-shadow: 0 4px 0 #FFC4D6 !important; /* 立體底座 */
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: auto !important; /* 自適應高度 */
            padding: 12px 4px !important;
        }

        /* 選中狀態：糖果漸層 + 雙層邊框 */
        .delivery-radio:checked + .delivery-card {
            background-image: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 100%) !important;
            border-color: #FFF !important;
            box-shadow: 0 0 0 3px #FF6B95, 0 6px 0 #FF6B95 !important; /* 外圈 + 深色底座 */
            transform: translateY(-2px);
        }

        .delivery-radio:checked + .delivery-card .icon {
            color: #FFF !important;
            filter: drop-shadow(0 2px 0 rgba(0,0,0,0.2));
            transform: scale(1.1);
        }

        .delivery-radio:checked + .delivery-card .label {
            color: #FFF !important;
            font-weight: 900 !important;
            text-shadow: 0 1px 0 rgba(0,0,0,0.1);
        }

        /* 6. 輸入框 */
        .apple-input {
            border-radius: 20px !important;
            background-color: #FFF !important;
            border: 3px solid #FFE4E6 !important;
            padding-left: 1.2rem !important;
            font-weight: bold !important;
            color: #555 !important;
        }
        .apple-input:focus {
            border-color: #FF6B95 !important;
            box-shadow: 0 0 0 4px rgba(255, 107, 149, 0.1) !important;
        }

        /* 7. 按鈕：Q彈果凍 */
        .btn-jelly {
            background-image: linear-gradient(90deg, #FF6B95 0%, #A855F7 100%) !important;
            box-shadow: 0 6px 0px 0px #C026D3, 0 10px 10px rgba(0,0,0,0.1) !important;
            border-radius: 99px !important;
            transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .btn-jelly:active {
            transform: translateY(4px);
            box-shadow: 0 2px 0px 0px #C026D3, 0 2px 5px rgba(0,0,0,0.1) !important;
        }

        /* 隱藏滾動條 */
        .hide-scrollbar::-webkit-scrollbar { display: none; }
        body {
            background-color: #FFFBEB;
            background-image:
                linear-gradient(#FFE4E6 1px, transparent 1px),
                linear-gradient(90deg, #FFE4E6 1px, transparent 1px);
            background-size: 24px 24px;
        }

        /* 隱藏滾動條但保留功能 */
        .hide-scrollbar::-webkit-scrollbar { display: none; }
        .hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

        /* 商品卡片：貼紙風 */
        .product-card {
            background: #FFF;
            border: 3px solid #FFF;
            border-radius: 24px;
            box-shadow: 4px 4px 0px 0px #FFC4D6;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }
        .product-card:hover {
            transform: translate(-2px, -2px);
            box-shadow: 6px 6px 0px 0px #FF6B95;
            z-index: 10;
        }

        /* 分類按鈕：圓形貼紙 */
        .cat-btn {
            background: #FFF;
            border: 2px solid #FFF;
            box-shadow: 0 4px 0 #FFC4D6;
            transition: transform 0.1s;
        }
        .cat-btn:active {
            transform: translateY(4px);
            box-shadow: 0 0 0 #FFC4D6;
        }

.detail-img img{
    width: 100% !important;
}

@media (max-width: 768px) {
    .p-6 {
        padding: 0 !important;
    }
}

/* 新增的滚动相关样式 */
#success-modal {
    /* 确保模态框本身可以滚动 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
}

#success-modal > div:first-child {
    /* 限制最大高度，在手机上变为可滚动 */
    max-height: 90vh; /* 视口高度的90% */
    overflow-y: auto; /* 内容溢出时滚动 */
    overflow-x: hidden; /* 防止水平滚动 */

    /* 调整内边距，确保内容有足够空间 */
    padding: 1.5rem !important;
}

/* 针对小屏幕的优化 */
@media (max-width: 640px) {
    #success-modal {
        padding: 0 !important; /* 移除外层padding */
        align-items: flex-start; /* 顶部对齐，不是居中 */
        padding-top: 20px !important; /* 顶部留点空间 */
    }

    #success-modal > div:first-child {
        max-height: calc(100vh - 40px); /* 减去顶部空间 */
        margin: 20px auto; /* 确保有边距 */
        padding: 1.25rem !important; /* 手机端稍小的内边距 */
    }
}

/* 针对非常小的屏幕（如iPhone SE） */
@media (max-width: 375px) {
    #success-modal > div:first-child {
        padding: 1rem !important; /* 更小的内边距 */
        max-width: 340px !important; /* 稍小的最大宽度 */
    }
}

/* 确保Canvas不影响滚动 */
#confetti-canvas {
    position: fixed !important; /* 改为fixed，不随内容滚动 */
    z-index: 110;
}

.line-wrap {
    white-space: normal !important;
    word-break: break-all !important;
    line-height: 1.2 !important;
    overflow: visible !important;
    text-overflow: clip !important;
}
