/* Super Member SPA 全局樣式 */
/* Updated: 2025-12-09 */

/* ==================== 全局樣式 ==================== */
html {
    min-height: 100%;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #AFD6C2;
    background-image: linear-gradient(to bottom, #ffffff 0, #AFD6C2 510px);
    background-repeat: no-repeat;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

#app {
    min-height: 100vh;
}

/* ==================== App Layout ==================== */
.app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.app-main {
    flex: 1;
    padding: 1.5rem;
    padding-top: calc(56px + 1.5rem);
    min-height: calc(100vh - 56px);
}

/* ==================== App Header ==================== */
.app-header {
    padding: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #AFD6C2 !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(74, 124, 89, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 2rem;
    height: 100%;
}

.header-left .btn-back {
    background: transparent;
    color: #4a7c59;
    border: 2px solid #4a7c59;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.header-left .btn-back:hover {
    background: #4a7c59;
    color: white;
}

.header-left .page-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e35;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 2rem;
    height: 100%;
}

.header-right .user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #2c3e35;
    font-weight: 600;
    font-size: 1.05rem;
}

.header-right .btn-logout {
    background: #4a7c59;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.header-right .btn-logout:hover {
    background: #3d6a4a;
}

/* ==================== 登入頁面 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #AFD6C2 0%, #8BC4A9 100%);
    position: relative;
    overflow: hidden;
}

.login-page .bg-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.login-page .shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.login-page .shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
}

.login-page .shape-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    right: -50px;
}

.login-page .shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 10%;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.system-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e35;
    margin-bottom: 5px;
}

.system-desc {
    color: #4a5568;
    font-size: 0.9rem;
}

.login-form .form-floating {
    margin-bottom: 1rem;
}

.login-form .form-control {
    border-radius: 10px;
    border: 2px solid #e8e8e8;
    padding: 1rem;
    transition: all 0.3s;
}

.login-form .form-control:focus {
    border-color: #AFD6C2;
    box-shadow: 0 0 0 3px rgba(175, 214, 194, 0.25);
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #6b7280;
    z-index: 5;
}

.caps-lock-warning {
    position: absolute;
    bottom: -25px;
    left: 0;
    font-size: 0.8rem;
    color: #dc3545;
}

.btn-login {
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, #4a7c59 0%, #5a9a6a 100%);
    border: none;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 124, 89, 0.3);
}

.login-result {
    text-align: center;
    padding: 30px 0;
}

.success-icon {
    font-size: 4rem;
    color: #28a745;
    animation: bounceIn 0.5s;
}

.error-icon {
    font-size: 4rem;
    color: #dc3545;
    animation: shake 0.5s;
}

.redirect-hint {
    color: #5a6672;
    font-size: 0.9rem;
    margin-top: 10px;
}

.copyright {
    text-align: center;
    margin-top: 30px;
    color: #5a6672;
    font-size: 0.8rem;
}

.copyright .version {
    margin-top: 5px;
}

/* ==================== 首頁 ==================== */
.home-page {
    min-height: calc(100vh - 56px - 3rem);
}

.home-page .home-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 搜尋區塊 */
.search-section {
    max-width: 1200px;
    margin: 0 auto 2.5rem;
}

.search-card {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.search-card .card-body {
    padding: 0;
}

.search-content {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 60px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 0.5rem;
}

.search-card .card-title {
    color: #2c3e50;
    font-weight: 600;
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding: 0 1.5rem 0 2rem;
}

.search-card .card-title i {
    margin-right: 0.5rem;
    font-size: 1.25rem;
    color: #4a7c59;
}

.search-form-area {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
}

.search-input-group {
    flex: 1;
    position: relative;
}

.search-input-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 1rem;
}

.search-card .form-control {
    border: none;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: #f8f9fa;
    font-size: 0.95rem;
    height: 44px;
    border-radius: 50px;
    color: #2c3e50;
}

.search-card .form-control:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
    background: white;
}

.search-card .btn-primary {
    background: linear-gradient(135deg, #4a7c59 0%, #3d6849 100%);
    border: none;
    border-radius: 50px;
    padding: 0 1.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 10px rgba(74, 124, 89, 0.25);
}

.search-card .btn-primary:hover {
    background: linear-gradient(135deg, #3d6849 0%, #2f5339 100%);
    transform: translateY(-1px);
}

.search-result {
    padding-right: 1.5rem;
}

.search-card .alert {
    background: transparent;
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.85rem;
    margin: 0;
}

.search-card .alert i {
    margin-right: 0.4rem;
}

.search-card .alert-success {
    color: #28a745;
    background: rgba(40, 167, 69, 0.08);
}

.search-card .alert-danger {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
}

.search-card .alert-clickable {
    cursor: pointer;
    transition: all 0.3s;
}

.search-card .alert-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.click-hint {
    margin-left: 10px;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* 會員搜尋結果 */
.member-search-results {
    max-width: 800px;
    margin: 0 auto;
}
.member-result-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.member-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}
.member-result-header:hover {
    background: rgba(175, 214, 194, 0.15);
}
.member-result-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.member-result-info i {
    color: #4a7c59;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.member-result-id {
    color: #888;
    font-size: 0.9rem;
}
.member-result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.member-result-detail {
    border-top: 1px solid #f0f0f0;
    padding: 0.5rem 1.25rem;
}
.shop-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f8f8f8;
}
.shop-entry:last-child {
    border-bottom: none;
}
.shop-entry-left {
    min-width: 0;
}
.shop-name-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.shop-name-row i {
    color: #4a7c59;
}
.shop-detail-row {
    margin-top: 0.25rem;
    padding-left: 1.4rem;
    font-size: 0.85rem;
    color: #888;
    display: flex;
    gap: 1rem;
}
.shop-detail-row i {
    margin-right: 0.2rem;
}
.shop-no-permission {
    opacity: 0.5;
}
.shop-manage-link {
    padding-top: 0.5rem;
    margin-top: 0.3rem;
    border-top: 1px solid #eee;
    text-align: right;
}

@media (max-width: 575px) {
    .member-result-info strong {
        font-size: 0.95rem;
    }
    .member-result-id {
        font-size: 0.8rem;
    }
    .member-result-header {
        padding: 0.6rem 1rem;
    }
    .member-result-detail {
        padding: 0.4rem 1rem;
    }
    .shop-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
}

/* 功能卡片網格 */
.function-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* 功能卡片 */
.function-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.function-card-placeholder {
    min-height: 180px;
}

.function-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.6s ease;
}

.function-card:hover::before {
    transform: scale(1);
}

.function-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.function-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: saturate(1.2);
}

.function-name {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 淺綠色 - 會員清單、新增會員 */
.function-card-teal {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}
.function-card-teal .function-icon { color: #5a9a6a; }
.function-card-teal .function-name { color: #3c763d; }
.function-card-teal:hover { background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%); }

/* 深綠色 - 會員審核 */
.function-card-teal-dark {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}
.function-card-teal-dark .function-icon { color: #4a7c59; }
.function-card-teal-dark .function-name { color: #3c763d; }

/* 青綠色 - 會員申請、申請進度 */
.function-card-cyan {
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
}
.function-card-cyan .function-icon { color: #00897b; }
.function-card-cyan .function-name { color: #00695c; }
.function-card-cyan:hover { background: linear-gradient(135deg, #b2dfdb 0%, #80cbc4 100%); }

/* 綠色 - 客戶管理 */
.function-card-green {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}
.function-card-green .function-icon { color: #5CB85C; }
.function-card-green .function-name { color: #3c763d; }
.function-card-green:hover { background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%); }

/* 橙色 - 系統功能 */
.function-card-orange {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}
.function-card-orange .function-icon { color: #F0AD4E; }
.function-card-orange .function-name { color: #8a6d3b; }
.function-card-orange:hover { background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%); }

/* 深橙色 - 管理者設定、系統設定 */
.function-card-orange-dark {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);
}
.function-card-orange-dark .function-icon { color: #EC971F; }
.function-card-orange-dark .function-name { color: #8a6d3b; }
.function-card-orange-dark:hover { background: linear-gradient(135deg, #ffcc80 0%, #ffb74d 100%); }

/* 響應式 */
@media (max-width: 767px) {
    .home-page .home-content {
        padding: 1rem 1.25rem;
    }

    .search-content {
        flex-direction: column;
        padding: 1.5rem;
        border-radius: 16px;
    }

    .search-card .card-title {
        margin-bottom: 1rem;
        padding: 0;
    }

    .search-form-area {
        flex-direction: column;
        width: 100%;
        padding: 0;
    }

    .search-input-group {
        width: 100%;
    }

    .search-card .form-control {
        font-size: 16px;
        height: 48px;
        border-radius: 12px;
    }

    .search-card .btn-primary {
        width: 100%;
        margin-top: 0.75rem;
        height: 48px;
        border-radius: 12px;
        justify-content: center;
    }

    .search-result {
        margin-top: 1rem;
        padding: 0;
        width: 100%;
    }

    .search-card .alert {
        width: 100%;
        justify-content: center;
        border-radius: 12px;
    }

    .function-card {
        padding: 1.5rem;
    }

    .function-icon {
        width: 60px;
        height: 60px;
        font-size: 2.5rem;
    }

    .function-name {
        font-size: 1.15rem;
    }
}

@media (max-width: 575px) {
    .home-page .home-content {
        padding: 0.75rem 1rem;
    }

    .function-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .function-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .function-name {
        font-size: 1rem;
    }
}

/* ==================== 資料容器 ==================== */
.data-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 20px;
}

@media (max-width: 767px) {
    .data-container {
        padding: 1rem;
        border-radius: 15px;
    }
}

@media (max-width: 575px) {
    .data-container {
        padding: 0.75rem 1rem;
        border-radius: 12px;
        overflow-x: hidden;
    }
}

/* ==================== 狀態標籤 ==================== */
.status-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.status-tabs .tab {
    padding: 8px 20px;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e8e8e8;
}

.status-tabs .tab:hover {
    border-color: #AFD6C2;
}

.status-tabs .tab.active {
    background: #AFD6C2;
    border-color: #AFD6C2;
    color: #2c3e35;
    font-weight: 600;
}

/* ==================== 搜尋區塊 ==================== */
.search-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-row .searchSelect {
    width: 200px;
    border-radius: 10px;
}

.search-row .searchInput {
    flex: 1;
    min-width: 200px;
    border-radius: 10px;
}

.search-row .searchButton {
    border-radius: 10px;
    padding: 8px 25px;
}

.date-toggle-row {
    margin-top: 10px;
}

.date-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.date-label {
    font-weight: 600;
    color: #666;
}

.dateInput {
    width: 150px;
    border-radius: 10px;
}

.dateSeparator {
    color: #6b7280;
}

.clearButton {
    border-radius: 10px;
}

/* ==================== 表格樣式 ==================== */
.table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 0;
}

.stickyHeader {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
}

.tableTitle th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    border: none;
    padding: 15px;
}

.tableRow td {
    padding: 12px 15px;
    vertical-align: middle;
    border-color: #f0f0f0;
}

.listTrClick {
    cursor: pointer;
    transition: background 0.3s;
}

.listTrClick:hover {
    background: #f8f9fa;
}

.imageThumb {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
}

/* ==================== 手機版卡片 ==================== */
.desktop-view {
    display: block;
}

table.desktop-view {
    display: table;
    width: 100%;
}

.table-responsive .desktop-view {
    display: table;
    width: 100%;
}

.mobile-view {
    display: none;
}

@media (max-width: 767px) {
    .desktop-view {
        display: none !important;
    }

    .mobile-view {
        display: block !important;
    }

    .mobile-view.member-cards {
        display: flex !important;
    }

    .app-main {
        padding: 0.75rem 1rem;
        padding-top: calc(56px + 0.75rem);
    }

    .header-left,
    .header-right {
        padding: 0 1rem;
    }

    .header-left .page-title {
        font-size: 1.05rem;
    }

    .search-row {
        flex-direction: column;
    }

    .search-row .searchSelect,
    .search-row .searchInput {
        width: 100%;
    }

    .date-row {
        flex-direction: column;
        align-items: stretch;
    }

    .dateInput {
        width: 100%;
    }
}

.member-cards {
    display: flex;
    flex-direction: column;
    gap: 16px !important;
}

.member-card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}

.member-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-avatar .avatar-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-placeholder {
    font-size: 2rem;
}

.card-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    overflow: hidden;
}

.card-details .detail-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.member-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.member-status {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-blacklist {
    background: #f8d7da;
    color: #721c24;
}

.status-difficult {
    background: #ffeeba;
    color: #856404;
}

.card-details {
    display: flex;
    gap: 15px;
    margin-top: 5px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 0.85rem;
}

.card-arrow {
    color: #9ca3af;
}

/* ==================== 空狀態 ==================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #6b7280;
}

.empty-icon {
    font-size: 4rem;
}

.empty-text {
    font-size: 1.1rem;
    margin: 20px 0 10px;
}

.empty-hint {
    font-size: 0.9rem;
}

/* ==================== 載入動畫 ==================== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #AFD6C2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 15px;
    color: #666;
}

/* ==================== 分頁 ==================== */
.pagination-section {
    margin-top: 20px;
    background: white;
    border-radius: 15px;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.data-info {
    color: #666;
    font-size: 0.9rem;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.page-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: #AFD6C2;
}

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

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    width: 35px;
    height: 35px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.page-number:hover:not(:disabled) {
    background: #AFD6C2;
}

.page-number.active {
    background: #4a7c59;
    color: white;
}

.page-dots {
    padding: 0 5px;
    color: #6b7280;
}

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

.page-size-select {
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.page-jumper {
    display: flex;
    gap: 5px;
}

.jump-input {
    width: 60px;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.jump-btn {
    padding: 5px 15px;
    border: none;
    background: #4a7c59;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.jump-btn:hover {
    background: #3d6a4a;
}

/* ==================== 圖片上傳 ==================== */
.image-upload-area {
    width: 150px;
    height: 150px;
    border: 2px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}

.image-upload-area:hover {
    border-color: #AFD6C2;
}

.upload-placeholder {
    text-align: center;
    color: #6b7280;
}

.upload-placeholder i {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

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

/* ==================== 過渡動畫 ==================== */
.fade-enter-active {
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.fade-leave-active {
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.fade-enter-from {
    opacity: 0;
    transform: translateY(8px);
}
.fade-leave-to {
    opacity: 0;
    transform: translateY(-4px);
}

.zoom-enter-active {
    animation: zoomIn 0.3s ease;
}

.zoom-leave-active {
    animation: zoomOut 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* ==================== Toast 訊息 ==================== */
.toast-container {
    z-index: 9999;
}

.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.custom-toast.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.custom-toast.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.custom-toast.warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #333;
}

.custom-toast.info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ==================== 卡片樣式增強 ==================== */
.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 15px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 15px 20px;
}

/* ==================== Nav Tabs 樣式 ==================== */
.nav-tabs {
    border-bottom: 2px solid #e8e8e8;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: #666;
    padding: 10px 20px;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #4a7c59;
}

.nav-tabs .nav-link.active {
    border-color: transparent;
    border-bottom-color: #4a7c59;
    color: #4a7c59;
    background: transparent;
    font-weight: 600;
}

/* ==================== List Group 樣式 ==================== */
.list-group {
    border-radius: 15px;
    overflow: hidden;
}

.list-group-item {
    border-color: #e8e8e8;
    padding: 15px 20px;
    transition: all 0.3s;
}

.list-group-item:first-child {
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.list-group-item:last-child {
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
}

.list-group-item-action:hover {
    background: #f8f9fa;
}

/* ==================== 表單控制項樣式 ==================== */
.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.form-select {
    border-radius: 10px;
    border: 2px solid #e8e8e8;
    padding: 10px 15px;
    transition: all 0.3s;
}

.form-select:focus {
    border-color: #AFD6C2;
    box-shadow: 0 0 0 3px rgba(175, 214, 194, 0.25);
}

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

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.25);
}

/* ==================== Alert 樣式 ==================== */
.alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.alert-warning {
    background: #fff3e0;
    color: #ef6c00;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
}

/* ==================== Badge 樣式 ==================== */
.badge {
    padding: 5px 10px;
    font-weight: 500;
    border-radius: 20px;
}

/* ==================== 表格增強 ==================== */
.table-bordered {
    border-radius: 10px;
    overflow: hidden;
}

.table-bordered > :not(caption) > * > * {
    border-color: #e8e8e8;
}

.table-secondary {
    background: #f8f9fa !important;
}

.table th {
    font-weight: 600;
    background: #f8f9fa;
}

/* ==================== 按鈕增強 ==================== */
.btn-group {
    border-radius: 10px;
    overflow: hidden;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* ==================== 圖片縮圖 ==================== */
.img-thumbnail {
    border-radius: 10px;
    border: 2px solid #e8e8e8;
}

/* ==================== 日期區塊手機樣式 ==================== */
@media (max-width: 767px) {
    .status-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 5px;
    }

    .status-tabs .tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .pagination-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .page-controls {
        order: -1;
    }

    .page-options {
        width: 100%;
        justify-content: space-between;
    }
}

/* ==================== SPA 頁面特定樣式 ==================== */
.member-list-page,
.member-create-page,
.member-edit-page,
.member-info-page,
.member-manage-page,
.member-signup-page,
.shop-list-page,
.shop-edit-page,
.shop-info-page,
.permission-page,
.permission-group-page,
.setting-page,
.log-page {
    min-height: calc(100vh - 56px - 3rem);
}

/* 確保所有頁面的 article 佔滿空間 */
.app-main article {
    min-height: calc(100vh - 56px - 3rem);
}

/* ==================== 狀態標籤修正 ==================== */
.status-denied {
    background: #ffcdd2;
    color: #c62828;
}

/* ==================== 權限群組設定頁面 ==================== */
.permission-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.permission-tabs .tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
    color: #666;
    font-weight: 500;
}

.permission-tabs .tab-item:hover {
    background: #e9ecef;
}

.permission-tabs .tab-item.active {
    background: linear-gradient(135deg, #4a7c59 0%, #5d9a6d 100%);
    color: white;
}

.permission-tabs .tab-item i {
    font-size: 1.1rem;
}

.permission-tabs .tab-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.permission-tabs .tab-item.active .tab-count {
    background: rgba(255, 255, 255, 0.2);
}

.permission-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 767px) {
    .permission-tabs {
        flex-direction: column;
    }

    .permission-content {
        grid-template-columns: 1fr;
    }
}

.permission-section {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.permission-section .section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

.permission-section .section-header.enabled {
    background: linear-gradient(135deg, #4a7c59 0%, #5d9a6d 100%);
    color: white;
}

.permission-section .section-header.available {
    background: #f8f9fa;
    color: #666;
    border-bottom: 1px solid #e8e8e8;
}

.permission-section .section-body {
    padding: 15px;
}

.permission-section .item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.permission-section .permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.2s;
}

.permission-section .permission-item.enabled {
    background: #e8f5e9;
    border-left: 3px solid #4a7c59;
}

.permission-section .permission-item:hover {
    transform: translateX(3px);
}

.permission-section .item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.permission-section .item-name {
    font-weight: 500;
    color: #333;
}

.permission-section .item-sub {
    font-size: 0.8rem;
    color: #6b7280;
}

.permission-section .btn-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.permission-section .btn-action.add {
    background: #4a7c59;
    color: white;
}

.permission-section .btn-action.add:hover {
    background: #3d6a4a;
    transform: scale(1.1);
}

.permission-section .btn-action.remove {
    background: #dc3545;
    color: white;
}

.permission-section .btn-action.remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

.permission-section .badge-locked {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    color: #6b7280;
    font-size: 0.85rem;
}

.permission-section .btn-locked {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1rem;
}

.permission-section .empty-hint {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

.permission-section .badge-all {
    display: inline-block;
    background: #ffc107;
    color: #333;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 5px;
}

/* ==================== 首頁功能卡片優化 ==================== */
.home-page .function-grid {
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 767px) {
    .function-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

.home-page .function-card {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: none;
    position: relative;
    overflow: hidden;
}

.home-page .function-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: all 0.3s;
}

.home-page .function-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.home-page .function-card-teal::before {
    background: linear-gradient(90deg, #20c997, #38d9a9);
}

.home-page .function-card-purple::before {
    background: linear-gradient(90deg, #6f42c1, #9775d4);
}

.home-page .function-card-gray::before {
    background: linear-gradient(90deg, #6c757d, #868e96);
}

.home-page .function-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.home-page .function-card-teal .function-icon {
    background: linear-gradient(135deg, #e6fcf5 0%, #c3fae8 100%);
    color: #0ca678;
}

.home-page .function-card-purple .function-icon {
    background: linear-gradient(135deg, #f3f0ff 0%, #e5dbff 100%);
    color: #7950f2;
}

.home-page .function-card-gray .function-icon {
    background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
    color: #495057;
}

.home-page .function-name {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

/* ==================== 手機版修正（< 575px）==================== */
@media (max-width: 575px) {
    /* ===== 全域 col-md-* 強制單欄 ===== */
    .col-md-2, .col-md-3, .col-md-4,
    .col-md-5, .col-md-6, .col-md-7,
    .col-md-8, .col-md-9, .col-md-10 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* 搜尋列 */
    .search-row .searchSelect,
    .search-row .searchInput {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* 日期輸入 */
    .dateInput {
        width: 100% !important;
    }

    /* 表格 */
    .table {
        font-size: 0.85rem;
    }
    .table td, .table th {
        padding: 8px 10px;
    }
    .table th[width], .table td[width] {
        width: auto !important;
    }

    /* flex 容器自動換行（排除 tab 列和橫向捲動容器） */
    .d-flex.gap-3, .d-flex.gap-4 {
        gap: 8px !important;
    }
    .d-flex:not(.flex-nowrap):not(.status-tabs):not(.tab-nav) {
        flex-wrap: wrap !important;
    }

    /* tab 列：橫向可捲動 */
    .status-tabs,
    .tab-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-width: 100%;
    }
    .status-tabs::-webkit-scrollbar,
    .tab-nav::-webkit-scrollbar {
        display: none;
    }
    .status-tabs .tab {
        flex-shrink: 0;
        padding: 6px 14px;
        font-size: 0.8rem;
    }
    .tab-nav .tab-button {
        flex-shrink: 0;
        min-width: 0;
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    /* 間距調整（僅針對特定容器） */
    .py-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .g-3, .g-4 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 0.5rem;
    }

    /* 卡片式頁面（設定、詳情、編輯）間距縮小 */
    .setting-page .card,
    .member-info-page .card,
    .member-edit-page .card,
    .member-create-page .card,
    .member-signup-page .card {
        margin-bottom: 0.5rem;
    }
    .setting-page .card-body,
    .member-edit-page .card-body {
        padding: 0.75rem !important;
    }
    .card-header { padding: 0.5rem 0.75rem; }
    .card-header h5, .card-header h6 { font-size: 0.9rem; margin: 0; }

    /* 搜尋區塊間距 */
    .search-section { margin-bottom: 0.5rem !important; }

    /* 表單間距 */
    .form-label { margin-bottom: 0.2rem; font-size: 0.85rem; }
    .form-control, .form-select { font-size: 0.9rem; padding: 0.4rem 0.6rem; }

    /* 會員卡片列表 — 保持正常間距 */
    .member-cards { gap: 10px; }

    /* 權限列表 */
    .permission-content {
        grid-template-columns: 1fr !important;
    }
    .permission-content .section-body {
        max-height: min(300px, 50vh) !important;
    }
    .permission-tabs {
        flex-direction: row !important;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        gap: 6px;
        padding: 8px;
    }
    .permission-tabs .tab-item {
        flex-shrink: 0;
        font-size: 0.85rem;
        padding: 8px 12px;
        white-space: nowrap;
    }
    .permission-tabs .tab-item span:not(.tab-count) {
        display: none;
    }
    .permission-tabs .tab-item i {
        margin: 0;
    }

    /* 會員照片區 */
    .member-info-page .card-body .d-flex.gap-3 {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .member-info-page table td:first-child {
        width: 35% !important;
        font-size: 0.85rem;
    }

    /* 圖片預覽 */
    .img-thumbnail, .preview-image {
        max-width: 100% !important;
    }

    /* 標題列 */
    .d-flex.justify-content-between {
        gap: 8px;
    }

    /* 操作紀錄 — 兩欄 */
    .log-page .row .col-md-3,
    .log-page .row .col-md-2 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 8px;
    }

    /* 店家列表搜尋 — 按鈕並排 */
    .shop-list-page .col-md-2,
    .shop-list-page .col-md-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    /* Header 間距 */
    .header-left {
        gap: 8px;
        padding: 0 1rem;
    }
    .header-right {
        gap: 0.5rem;
        padding: 0 1rem;
    }
    .header-left .page-title {
        font-size: 0.95rem;
        gap: 0.35rem;
    }
    .header-left .btn-back {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    .header-right .user-info span {
        display: none;
    }
    .header-right .btn-logout {
        padding: 5px 12px;
        font-size: 0.8rem;
    }

    /* 首頁功能卡片 */
    .function-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .function-card {
        padding: 1rem !important;
        border-radius: 14px !important;
        min-height: 110px;
    }
    .function-icon {
        width: 42px !important;
        height: 42px !important;
        font-size: 1.4rem !important;
        margin-bottom: 0.5rem !important;
    }
    .function-name {
        font-size: 0.85rem !important;
    }

    /* 首頁搜尋區 */
    .search-section {
        margin-bottom: 0.5rem !important;
    }
    .search-card {
        border-radius: 12px !important;
    }
    .search-card .card-body {
        padding: 0.5rem !important;
    }
    .search-content {
        padding: 0.75rem !important;
        border-radius: 12px !important;
    }
    .search-card .card-title {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
        padding: 0 0.5rem !important;
    }
    .search-form-area {
        padding: 0 !important;
    }
    .search-result {
        padding: 0 !important;
        margin: 0 !important;
    }
    .search-card .btn-primary {
        margin-top: 0.4rem !important;
        height: 42px !important;
    }

    /* 圖片放大 overlay */
    .zoom-overlay-enter img {
        max-width: 95% !important;
        max-height: 80% !important;
    }
}

/* ==================== 全局動畫效果 ==================== */

/* --- 卡片入場動畫 --- */
.card {
    animation: cardFadeUp 0.35s ease both;
}
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }

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

/* --- 按鈕互動效果 --- */
.btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:not(:disabled):active {
    transform: scale(0.96);
}
.btn-primary:not(:disabled):hover,
.btn-success:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
}
.btn-danger:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}
.btn-warning:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* --- 表格列動畫 --- */
.table tbody tr {
    transition: background-color 0.2s ease;
}
.table tbody tr:hover {
    background-color: rgba(175, 214, 194, 0.1);
}

/* --- 輸入框聚焦效果 --- */
.form-control,
.form-select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus,
.form-select:focus {
    border-color: #4a7c59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.15);
}

/* --- Badge 出現動畫 --- */
.badge {
    transition: all 0.2s ease;
}

/* --- Spinner 載入動畫增強 --- */
.spinner-border {
    animation: spin 0.8s linear infinite, fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- 圖片懸停效果 --- */
.img-thumbnail {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.img-thumbnail:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* --- 圖片放大 overlay 動畫 --- */
.zoom-overlay-enter {
    animation: overlayFadeIn 0.3s ease;
}
.zoom-overlay-enter img {
    animation: zoomImageIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomImageIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Toast 通知增強 --- */
.custom-toast {
    backdrop-filter: blur(8px);
}
.custom-toast.success {
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.custom-toast.danger {
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), pulse 0.6s ease 0.4s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* --- 權限 tab / 設定 tab 切換動畫 --- */
.permission-tabs .tab-item,
.setting-tabs .tab-item {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.permission-tabs .tab-item:hover,
.setting-tabs .tab-item:hover {
    transform: translateY(-2px);
}
.permission-tabs .tab-item:active,
.setting-tabs .tab-item:active {
    transform: scale(0.97);
}

/* --- 列表項目交錯入場 --- */
.permission-item,
.field-item {
    animation: listItemSlide 0.3s ease both;
}
.permission-item:nth-child(1) { animation-delay: 0s; }
.permission-item:nth-child(2) { animation-delay: 0.03s; }
.permission-item:nth-child(3) { animation-delay: 0.06s; }
.permission-item:nth-child(4) { animation-delay: 0.09s; }
.permission-item:nth-child(5) { animation-delay: 0.12s; }
.permission-item:nth-child(n+6) { animation-delay: 0.15s; }

@keyframes listItemSlide {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- 首頁功能卡片彈跳效果 --- */
.home-page .function-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.home-page .function-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 25px rgba(74, 124, 89, 0.2);
}
.home-page .function-card:active {
    transform: translateY(-2px) scale(0.98);
}
.home-page .function-icon {
    transition: transform 0.3s ease;
}
.home-page .function-card:hover .function-icon {
    transform: scale(1.1);
}

/* --- 空狀態動畫 --- */
.empty-state i,
.empty-hint {
    animation: gentleBounce 2s ease-in-out infinite;
}

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

/* --- 頁面載入中 spinner 入場 --- */
.text-center .spinner-border {
    animation: spin 0.8s linear infinite, scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(360deg);
    }
}

/* --- 減少動畫偏好 --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
