* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang HK", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
    color: #1f2933;
    background: #f7f7f7;
}

a {
    text-decoration: none;
}

/* =========================
   手機前台：電商會員中心風格
========================= */

body:not(.admin-body) {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 198, 87, .38), transparent 28%),
        radial-gradient(circle at 88% 15%, rgba(255, 124, 92, .26), transparent 26%),
        linear-gradient(180deg, #fff7ea 0%, #fff0dd 44%, #f6f7fb 44%, #f6f7fb 100%);
    position: relative;
}

/* 背景動態光，不影響排版 */
body:not(.admin-body)::before {
    content: "";
    position: fixed;
    inset: -40%;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(115deg, transparent 42%, rgba(255,255,255,.55) 50%, transparent 58%),
        radial-gradient(circle, rgba(255, 170, 60, .14) 0 2px, transparent 3px);
    background-size: 260px 260px, 38px 38px;
    animation: shopBg 20s linear infinite;
}

@keyframes shopBg {
    from {
        transform: translate3d(-80px, -60px, 0);
    }
    to {
        transform: translate3d(120px, 120px, 0);
    }
}

/* 右上角電商圖標背景，不參與排版 */
body:not(.admin-body)::after {
    content: "🛍️";
    position: fixed;
    top: 105px;
    right: -8px;
    z-index: 0;
    font-size: 72px;
    opacity: .12;
    pointer-events: none;
    animation: bagFloat 4.8s ease-in-out infinite;
}

@keyframes bagFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-14px);
    }
}

/* 主手機容器，固定居中 */
.mobile-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 30px 18px 42px;
}

/* 頂部 LOGO 區 */
.logo-box {
    width: 100%;
    text-align: center;
    padding: 24px 0 24px;
    color: #2a1a0a;
}

.logo-box::before {
    content: "香港電商會員";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 16px;
    margin-bottom: 15px;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    color: #a15c00;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(245, 158, 11, .12);
}

.logo-img,
.logo-fallback {
    display: inline-flex;
    width: 102px;
    height: 102px;
    border-radius: 30px;
    align-items: center;
    justify-content: center;
    object-fit: cover;
    box-shadow:
        0 20px 42px rgba(177, 99, 16, .20),
        0 0 0 6px rgba(255,255,255,.55),
        inset 0 1px 0 rgba(255,255,255,.7);
    animation: logoFloat 3.8s ease-in-out infinite;
}

.logo-fallback {
    background: linear-gradient(145deg, #ffe28a 0%, #ffc34d 52%, #f97316 100%);
    color: #3a2200;
    font-size: 36px;
    font-weight: 950;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-7px);
    }
}

.site-title {
    margin-top: 17px;
    font-size: 24px;
    font-weight: 950;
    letter-spacing: 1px;
    color: #2a1a0a;
}

/* 登录卡片 / 内容卡片 */
.login-card,
.card {
    width: 100%;
    position: relative;
    z-index: 3;
    background: rgba(255,255,255,.94);
    border-radius: 28px;
    padding: 22px;
    margin: 0 0 16px;
    border: 1px solid rgba(255,255,255,.75);
    box-shadow:
        0 20px 48px rgba(177, 99, 16, .13),
        0 8px 24px rgba(17, 24, 39, .07);
    overflow: hidden;
    animation: cardUp .45s ease both;
}

@keyframes cardUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card::before {
    content: "🎁 會員福利登入";
    display: inline-flex;
    margin-bottom: 16px;
    padding: 8px 13px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff7a45, #ffbd59);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(249, 115, 22, .22);
}

/* 表单 */
.form-line {
    margin-bottom: 14px;
}

.input {
    width: 100%;
    height: 54px;
    border: 1px solid rgba(245, 158, 11, .18);
    background: #fff8ef;
    border-radius: 17px;
    padding: 0 16px;
    font-size: 16px;
    color: #2a1f18;
    outline: none;
    box-shadow: inset 0 2px 5px rgba(120, 53, 15, .04);
    transition: .2s ease;
}

.input:focus {
    background: #fff;
    border-color: rgba(249, 115, 22, .55);
    box-shadow: 0 0 0 4px rgba(251, 146, 60, .15);
}

.input::placeholder {
    color: #a78363;
}

.textarea {
    height: 92px;
    padding-top: 14px;
    resize: none;
}

/* 按钮 */
.btn {
    width: auto;
    border: none;
    border-radius: 17px;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 950;
    cursor: pointer;
    transition: .2s ease;
}

.btn:active {
    transform: scale(.98);
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #ff8a3d 0%, #ffd36c 55%, #f59e0b 100%);
    color: #3a2200;
    box-shadow:
        0 12px 26px rgba(245, 158, 11, .32),
        inset 0 1px 0 rgba(255,255,255,.55);
}

.btn-green {
    background: linear-gradient(135deg, #10a56d, #3de39a);
    color: #fff;
    box-shadow: 0 12px 26px rgba(16, 185, 129, .26);
}

.btn-red {
    background: linear-gradient(135deg, #ef4444, #fb7185);
    color: #fff;
}

.btn-dark {
    background: #2a1f18;
    color: #fff;
}

.btn-light {
    background: #fff2df;
    color: #8a4b00;
}

.w100 {
    width: 100%;
}

.mt10 {
    margin-top: 10px;
}

.small {
    color: #a07858;
    font-size: 13px;
    line-height: 1.6;
}

.center {
    text-align: center;
}

/* 余额区 */
.between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.label {
    color: #a07858;
    font-size: 13px;
    margin-bottom: 5px;
    font-weight: 700;
}

.balance {
    font-size: 30px;
    font-weight: 950;
    color: #2a1f18;
    letter-spacing: -.5px;
}

.progress {
    margin-top: 15px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff3d9, #ffe5ae);
    color: #7a4200;
    font-size: 14px;
    line-height: 1.7;
    border: 1px solid rgba(245, 158, 11, .18);
}

/* 用户资料 */
.field {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px dashed rgba(180, 128, 78, .22);
}

.field:last-child {
    border-bottom: none;
}

.value {
    text-align: right;
    font-weight: 900;
    color: #352316;
    max-width: 60%;
    word-break: break-all;
}

.status {
    color: #ff0000;
}

/* 客服聊天 */
.service-card h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #2a1f18;
}

.service-card h3::before {
    content: "💬 ";
}

.msg-list {
    max-height: 420px;
    overflow-y: auto;
    padding: 8px 2px;
}

.msg {
    max-width: 82%;
    margin-bottom: 12px;
    padding: 12px 13px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
}

.msg img {
    display: block;
    max-width: 100%;
    border-radius: 14px;
    margin-top: 8px;
}

.msg-user {
    margin-left: auto;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #14532d;
    border-bottom-right-radius: 5px;
}

.msg-admin {
    margin-right: auto;
    background: linear-gradient(135deg, #fff4dd, #ffe3ad);
    color: #5b3500;
    border-bottom-left-radius: 5px;
}

.msg-time {
    margin-top: 6px;
    color: #9a7151;
    font-size: 11px;
}

.msg-form {
    margin-top: 12px;
}

.send-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.upload-btn {
    flex: 1;
    border-radius: 16px;
    background: #fff2df;
    color: #8a4b00;
    padding: 13px 16px;
    text-align: center;
    font-weight: 950;
    cursor: pointer;
}

.upload-btn::before {
    content: "📷 ";
}

.upload-btn input {
    display: none;
}

.send-row .btn {
    min-width: 110px;
}

/* 公告弹窗 */
.modal-mask {
    position: fixed;
    z-index: 99;
    inset: 0;
    background: rgba(64, 32, 8, .54);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal-mask.hide {
    display: none;
}

.modal {
    width: 100%;
    max-width: 390px;
    background: #fff;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 28px 80px rgba(120, 53, 15, .32);
}

.modal-title {
    text-align: center;
    font-size: 21px;
    font-weight: 950;
    color: #2a1f18;
    margin-bottom: 14px;
}

.modal-title::before {
    content: "📢 ";
}

.modal-body {
    line-height: 1.75;
    color: #6b4b35;
    margin-bottom: 18px;
}

.red-text {
    color: #dc2626;
}

/* 提示条 */
.flash {
    position: relative;
    z-index: 10;
    max-width: 430px;
    margin: 12px auto 0;
    background: rgba(255, 246, 220, .96);
    color: #7a4200;
    border: 1px solid rgba(245, 158, 11, .25);
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 14px;
    box-shadow: 0 12px 28px rgba(245, 158, 11, .13);
}

/* 退出按钮 */
.topbar {
    position: relative;
    z-index: 5;
    max-width: 430px;
    margin: 0 auto;
    padding: 12px 18px 0;
    display: flex;
    justify-content: space-between;
}

.logout {
    color: #8a4b00;
    font-size: 14px;
    font-weight: 900;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(245, 158, 11, .22);
    padding: 8px 13px;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(245, 158, 11, .12);
}

/* 手機適配 */
@media (max-width: 480px) {
    .mobile-wrap {
        max-width: 100%;
        padding-left: 18px;
        padding-right: 18px;
    }

    .login-card,
    .card {
        border-radius: 26px;
        padding: 21px;
    }

    .site-title {
        font-size: 23px;
    }
}

/* =========================
   後台樣式
========================= */

.admin-body {
    background: #f4f6fa;
}

.admin-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #101827;
    color: #fff;
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav a {
    color: #fff;
    margin-left: 14px;
    font-size: 14px;
}

.admin-wrap {
    max-width: 1180px;
    margin: 22px auto 60px;
    padding: 0 14px;
}

.admin-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 8px 28px rgba(16, 24, 39, .08);
}

.admin-card h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

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

.full {
    grid-column: 1 / -1;
}

.admin-input {
    width: 100%;
    border: 1px solid #dce2ea;
    border-radius: 12px;
    padding: 11px 12px;
    background: #fbfcfe;
    outline: none;
}

textarea.admin-input {
    min-height: 82px;
    resize: vertical;
}

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

.pill {
    display: inline-block;
    background: #f1f4f8;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    margin-left: 8px;
    color: #4b5563;
}

summary {
    cursor: pointer;
}

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

    .admin-nav {
        display: block;
    }

    .admin-nav div {
        margin-top: 10px;
    }

    .admin-nav a {
        margin-left: 0;
        margin-right: 12px;
        display: inline-block;
        margin-bottom: 6px;
    }
}
/* ===============================
   修正電商首頁裝飾：去掉文字標籤和大袋子
   加在 style.css 最下面
================================ */

/* 去掉上面的「香港電商會員」 */
body:not(.admin-body) .logo-box::before {
    display: none !important;
    content: none !important;
}

/* 去掉背景右邊那個大袋子 */
body:not(.admin-body)::after {
    display: none !important;
    content: none !important;
}

/* 讓頂部空間更自然 */
body:not(.admin-body) .logo-box {
    padding-top: 34px !important;
    padding-bottom: 22px !important;
}

/* 背景改成更乾淨的電商暖色 */
body:not(.admin-body) {
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 206, 100, .42), transparent 26%),
        radial-gradient(circle at 88% 12%, rgba(255, 132, 92, .25), transparent 25%),
        radial-gradient(circle at 18% 68%, rgba(255, 177, 74, .18), transparent 26%),
        linear-gradient(180deg, #fff6e8 0%, #fff0df 43%, #f7f8fb 43%, #f7f8fb 100%) !important;
}

/* 增加左側優惠券元素 */
body:not(.admin-body) .mobile-wrap::before {
    content: "🛍️" !important;
    position: absolute;
    z-index: 1;
    width: 54px;
    height: 54px;
    padding: 0 12px;
    border-radius: 999px;
    color: #9a4b00;
    font-size: 35px;
    font-weight: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-5deg);
    animation: decoFloatA 4.2s ease-in-out infinite;
    pointer-events: none;
}

/* 增加右側購物金元素 */
body:not(.admin-body) .mobile-wrap::after {
    content: "🛒" !important;
    position: absolute;
    right: 18px;
    top: 154px;
    z-index: 1;
    min-width: 96px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    color: #c2410c;
    font-size: 35px;
    font-weight: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(5deg);
    animation: decoFloatB 4.8s ease-in-out infinite;
    pointer-events: none;
}

/* LOGO 後面加淡淡電商圖標，不會擋字 */
body:not(.admin-body) .logo-box::after {
    content: "🛒   🎁   ⭐";
    position: absolute;
    left: 50%;
    top: 15px;
    z-index: -1;
    transform: translateX(-50%);
    width: 100%;
    color: rgba(198, 112, 16, .16);
    font-size: 30px;
    letter-spacing: 18px;
    white-space: nowrap;
    animation: iconSoftMove 5s ease-in-out infinite;
    pointer-events: none;
}

/* 登入卡片上方標籤改小一點，更像電商會員入口 */
body:not(.admin-body) .login-card::before {
    content: "👤️ 會員登入" !important;
    margin-bottom: 16px !important;
    background: linear-gradient(135deg, #ff8a3d, #ffc45f) !important;
}

/* 再加一個淡淡的折扣角標，不影響排版 */
body:not(.admin-body) .login-card::after {
    content: "VIP";
    position: absolute;
    right: 18px;
    top: 18px;
    width: 42px;
    height: 42px;
    border-radius: 15px;
    background: linear-gradient(135deg, #fff0c2, #ffb547);
    color: #7a3f00;
    font-size: 13px;
    font-weight: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(245, 158, 11, .18);
    transform: rotate(8deg);
    pointer-events: none;
}

@keyframes decoFloatA {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-10px) rotate(3deg);
    }
}

@keyframes decoFloatB {
    0%, 100% {
        transform: translateY(0) rotate(5deg);
    }
    50% {
        transform: translateY(-12px) rotate(-3deg);
    }
}

@keyframes iconSoftMove {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: .55;
    }
    50% {
        transform: translateX(-50%) translateY(-8px);
        opacity: .85;
    }
}

/* 手機小屏幕避免裝飾靠邊太多 */
@media (max-width: 420px) {
    body:not(.admin-body) .mobile-wrap::before {
        left: 14px;
        top: 112px;
    }

    body:not(.admin-body) .mobile-wrap::after {
        right: 14px;
        top: 152px;
    }

    body:not(.admin-body) .logo-box::after {
        font-size: 26px;
        letter-spacing: 14px;
    }
}
/* WhatsApp 線上客服按鈕 */
body:not(.admin-body) .ws-service-btn {
    width: 100%;
    height: 52px;
    margin: 4px 0 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 950;
    box-shadow: 0 12px 26px rgba(34, 197, 94, .28);
}

body:not(.admin-body) .ws-service-btn:active {
    transform: scale(.98);
}

body:not(.admin-body) .ws-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}
/* 客服標題 + WhatsApp 按鈕同一排 */
body:not(.admin-body) .service-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

body:not(.admin-body) .service-title-row h3 {
    margin: 0 !important;
    font-size: 20px;
    font-weight: 950;
    color: #2a1f18;
    white-space: nowrap;
}

body:not(.admin-body) .ws-service-btn {
    width: auto !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 950;
    box-shadow: 0 10px 22px rgba(34, 197, 94, .24);
    white-space: nowrap;
}

body:not(.admin-body) .ws-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}