/* 全局基礎設定 */
:root {
    --primary-color: #b71c1c; /* 深紅色 */
    --secondary-color: #f8d7da; /* 淡紅色 */
    --light-color: #fff5f5; /* 更淺的紅色 */
    --dark-text: #660000; /* 深色文字 */
    --btn-hover-color: #8b0000; /* 深紅色按鈕懸停 */
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* 按鈕 & 表單元素聚焦時的外框效果 */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color);
}

/* 美化按鈕（紅色系） */
.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    transition: all 0.3s ease-in-out;
}

    .btn:hover, .btn:focus {
        background-color: var(--btn-hover-color);
        color: white;
    }

/* 表格 & 清單樣式 */
.table {
    border-color: var(--primary-color);
}

    .table thead {
        background-color: var(--primary-color);
        color: white;
    }

.list-group-item {
    transition: all 0.3s ease-in-out;
}

/* 響應式設計（手機優化） */
@media (max-width: 768px) {
    /* 橫向滾動選單 */
    .list-group-horizontal-sm {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        white-space: nowrap;
        display: block;
        padding-bottom: 8px; /* 預留空間給滾動條 */
    }

    /* 表格自適應 */
    #tblData td, #tblData th {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    /* 按鈕縮小 */
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
    }
}

/* 確保頁面內容填滿視窗高度 */
body {
    margin-bottom: 60px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-top: 0;
    transition: margin-top 0.3s ease-in-out;
}

/* 美化 footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 15px 0;
    font-size: 14px;
    width: 100%;
    position: relative;
}

    /* Footer 內的鏈接樣式 */
    .footer a {
        color: var(--light-color);
        text-decoration: none;
        transition: color 0.3s ease-in-out;
    }

        .footer a:hover {
            color: white;
            text-decoration: underline;
        }

/* 響應式 Footer */
@media (max-width: 768px) {
    .footer {
        font-size: 12px;
        padding: 10px 0;
    }
}

/* 手機號碼輸入格式提示 */
input[type="tel"]::-webkit-input-placeholder {
    color: #999;
    font-size: 0.9em;
}

/* 密碼強度提示 */
#passwordHelp {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* 錯誤訊息加強顯示 */
.text-danger {
    font-size: 0.85rem;
    font-weight: 500;
}
.input-group-text {
    transition: all 0.3s ease;
}

.input-group:focus-within .input-group-text {
    background-color: #e3f2fd;
    border-color: #2196F3;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.amount-preview {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.user-info {
    border-left: 4px solid #28a745;
    transition: transform 0.3s ease;
}

    .user-info:hover {
        transform: translateX(10px);
    }
/* 加载动画样式 */
.screenshot-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.confirmation-card {
    position: relative; /* 确保水印定位 */
}

/* 加载动画样式 */
.spinner-border {
    vertical-align: middle;
}

#submitBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.screenshot-helper {
    position: fixed;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
}
/* 行動裝置 (手機) 隱藏 */
@media (max-width: 767px) and (hover: none) {
    #hiddenInput {
        display: none !important;
    }
}
.header-hidden {
    position: absolute;
    top: -100%;
    transition: top 0.3s ease-in-out;
}


/* 新增品牌容器 */
.brand-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-left: 75px; /* 預留logo空間 */
    min-height: 60px; /* 最小高度保持导航栏高度 */
}

/* 文字部分定位 */
.brand-text {
    display: flex;
    flex-direction: column;
    margin-left: 5px; /* 文字與logo間距 */
}

/* Logo样式调整 */
.brand-logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: calc(1.2em + 0.9em); /* 主標題+店名高度 */
    width: 70px;
    height: auto;
    object-fit: contain;
}

/* 主標題文字樣式 */
.main-title {
    color: #ff4444;
    font-weight: 700;
    line-height: 1.2em;
    white-space: nowrap;
}

/* "鮮"字特殊樣式 */
.highlight {
    color: #4CAF50 !important;
    display: inline-block;
    margin: 0 2px;
}

/* 店名顯示控制 */
.store-name {
    font-size: 0.8em;
    color: #666;
    line-height: 0.9em;
    margin-top: 2px;
}

@media (max-width: 992px) {
    .brand-container {
        padding-left: 75px; /* 缩小logo预留空间 */
    }

    .brand-logo {
        height: calc(1em + 0.8em); /* 调整移动端高度 */
    }

    .main-title {
        white-space: normal; /* 允许换行 */
        font-size: 1.1em;
    }
}

@media (max-width: 576px) {
    .brand-container {
        padding-left: 60px;
    }

    .brand-logo {
        height: 50px; /* 固定移动端logo高度 */
    }

    .brand-text {
        margin-left: 10px;
    }
}

main {
    margin-top: 60px; /* 與 header 高度一致 */
    transition: margin-top 0.3s ease; /* 與 header 動畫同步 */
}
/* 平板隱藏狀態時恢復正常間距 */
#mainHeader.header-collapsed + .container main {
    margin-top: 0;
}

/* 手機版調整 */
@media (max-width: 767px) {
    main {
        margin-top: 50px; /* 手機版 header 較矮時可調整 */
    }
}

/* 增加內容區域最小高度防止空白 */
/*.container {
    min-height: calc(100vh - 120px);
    padding-top: 20px;
}
*/
/* 優化平板模式下的間距 */
@media (max-width: 1366px) {
    .container main {
        margin-top: 80px !important;
    }
}
/* 增加內容區域最小高度防止空白 */
/*.container {
    min-height: calc(100vh - 120px);
    padding-top: 20px;
}*/
.form-label {
    color: #495057;
    font-weight: 600;
}
label {
    color: #495057; /* 深灰色，讓文字看得更清楚 */
    font-weight: 600;
}

/* 优化后的键盘样式 begin*/
.virtual-keyboard {
    position: relative;
    transform-origin: top center;
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.virtual-keyboard .btn {
    font-size: 1.2rem;
    padding: 15px;
    min-width: 60px;
    margin: 2px;
}

/* 手机版适配 */
@media (max-width: 768px) {
    .virtual-keyboard {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        border-radius: 15px 15px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

        .virtual-keyboard.active {
            transform: translateY(0);
        }

        .virtual-keyboard .btn {
            padding: 12px;
            font-size: 1.1rem;
        }
}
/* 退格键图标优化 */
#backspace i {
    font-size: 1.5rem;
    vertical-align: middle;
}
/* 优化后的键盘样式 end*/