:root {
    --primary-color: #1a1a1a;
    --accent-color: #CFB378;
    /* Lexus Gold-ish */
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --cathay-color: #00c96a;
    --esun-color: #00b8d4;
    --taishin-color: #e60012;
    --uniopen-color: #9b7bff;
    --ubot-color: #00b900;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
}

html,
body {
    /* 避免行動裝置（特別是 iOS PWA）因細微超寬而可左右拖動 */
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-color);
    margin: 0;
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
    /* Space for bottom nav */
    -webkit-tap-highlight-color: transparent;
}

/* Header */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header-right {
    display: flex;
    align-items: center;
}

.header h5 {
    margin: 0;
    font-weight: 800;
    letter-spacing: 1px;
}

.header-app-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.10);
}

.header-share-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.header-share-btn:active {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(0.95);
}

body.dark-theme .header-share-btn:active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Bottom Navigation - Lexus Style */
.nav-bottom {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
    z-index: 1000;
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    isolation: isolate;
    overflow: hidden;
}

/* iOS-like liquid glass highlight */
#nav-highlight {
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;

    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);

    will-change: left, top, width, height;

    transition:
        left 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
        top 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
        width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
        height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#nav-highlight::before {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: inherit;
    background:
        radial-gradient(120% 160% at 28% 18%, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 60%),
        radial-gradient(120% 160% at 72% 85%, rgba(207, 179, 120, 0.22), rgba(207, 179, 120, 0) 62%);
    opacity: 0.95;
}

#nav-highlight::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow:
        inset 0 0 0 1px rgba(207, 179, 120, 0.18),
        inset 0 -10px 20px rgba(0, 0, 0, 0.06);
    opacity: 0.9;
}

.nav-item {
    text-align: center;
    color: #aaa;
    font-size: 0.75rem;
    cursor: pointer;
    flex: 1;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 800;
    transform: translateY(-2px);
}

.nav-item i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 6px;
    transition: color 0.3s;
}

/* Different colors for each nav item */
#nav-home i {
    color: #667eea;
}

#nav-home.active i {
    color: #667eea;
}

#nav-search i {
    color: #764ba2;
}

#nav-search.active i {
    color: #764ba2;
}

#nav-calculator i {
    color: #ff9a9e;
}

#nav-calculator.active i {
    color: #ff9a9e;
}

#nav-settings i {
    color: var(--accent-color);
}

#nav-settings.active i {
    color: var(--accent-color);
}

body.dark-theme #nav-home i {
    color: #8b9aff;
}

body.dark-theme #nav-home.active i {
    color: #8b9aff;
}

body.dark-theme #nav-search i {
    color: #a78bfa;
}

body.dark-theme #nav-search.active i {
    color: #a78bfa;
}

body.dark-theme #nav-calculator i {
    color: #ffb3b8;
}

body.dark-theme #nav-calculator.active i {
    color: #ffb3b8;
}

body.dark-theme #nav-settings i {
    color: var(--accent-color);
}

body.dark-theme #nav-settings.active i {
    color: var(--accent-color);
}

/* v7 Calculator Styles Ported */
.option-group h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.radio-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.radio-label {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    background: #fff;
    color: #555;
}

.radio-label:hover {
    background: #f0f0f0;
}

.cathay-section .radio-label.selected {
    border-color: var(--cathay-color);
    color: var(--cathay-color);
    background: #e8f5e9;
}

.esun-section .radio-label.selected {
    border-color: var(--esun-color);
    color: var(--esun-color);
    background: #e1f5fe;
}

.taishin-section .radio-label.selected {
    border-color: var(--taishin-color);
    color: var(--taishin-color);
    background: #ffebee;
}

.uniopen-section .radio-label.selected {
    border-color: var(--uniopen-color);
    color: var(--uniopen-color);
    background: #f3efff;
}

.hsbc-section .radio-label.selected {
    border-color: #db0011;
    color: #db0011;
    background: #fff0f0;
}

.ubot-section .radio-label.selected {
    border-color: var(--ubot-color);
    color: var(--ubot-color);
    background: #e8ffe8;
}

.custom-amount-miles-card .radio-label.selected {
    border-color: var(--custom-card-color, var(--accent-color));
    color: var(--custom-card-color, var(--accent-color));
    background: rgba(207, 179, 120, 0.15);
    background: color-mix(in srgb, var(--custom-card-color, var(--accent-color)) 15%, #fff);
}

/* Fix custom amount miles card width stability */
.custom-amount-miles-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.custom-amount-miles-card:hover {
    transform: none;
}

.custom-amount-miles-card .option-group {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.custom-amount-miles-card .radio-container {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.custom-amount-miles-card .radio-label {
    box-sizing: border-box;
    flex-shrink: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.radio-label input {
    display: none;
}

.rate-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    background-color: #ccc;
    margin-left: 8px;
}

.cathay-section .rate-badge.active {
    background-color: var(--cathay-color);
}

.esun-section .rate-badge.active {
    background-color: var(--esun-color);
}

.taishin-section .rate-badge.active {
    background-color: var(--taishin-color);
}

.uniopen-section .rate-badge.active {
    background-color: var(--uniopen-color);
}

.hsbc-section .rate-badge.active {
    background-color: #db0011;
}

.ubot-section .rate-badge.active {
    background-color: var(--ubot-color);
}

.rule-desc {
    font-size: 0.8rem;
    color: #888;
    margin-top: 5px;
    margin-bottom: 10px;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 800;
}

/* Match Status in Cards */
#cathayMatchStatus,
#esunMatchStatus,
#taishinMatchStatus,
#uniopenMatchStatus,
#hsbcMatchStatus,
#ubotMatchStatus {
    display: block;
    text-align: center;
    white-space: pre-line;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 4px;
}

#cathayMatchStatus:empty,
#esunMatchStatus:empty,
#taishinMatchStatus:empty,
#uniopenMatchStatus:empty,
#hsbcMatchStatus:empty,
#ubotMatchStatus:empty {
    display: none;
}

.cathay-section #cathayMatchStatus {
    color: var(--cathay-color);
    background-color: rgba(0, 201, 106, 0.1);
}

.esun-section #esunMatchStatus {
    color: var(--esun-color);
    background-color: rgba(0, 184, 212, 0.1);
}

.taishin-section #taishinMatchStatus {
    color: var(--taishin-color);
    background-color: rgba(230, 0, 18, 0.1);
}

.uniopen-section #uniopenMatchStatus {
    color: var(--uniopen-color);
    background-color: rgba(155, 123, 255, 0.12);
}

.hsbc-section #hsbcMatchStatus {
    color: #db0011;
    background-color: rgba(219, 0, 17, 0.1);
}

.ubot-section #ubotMatchStatus {
    color: var(--ubot-color);
    background-color: rgba(0, 185, 0, 0.1);
}

body.dark-theme .cathay-section #cathayMatchStatus {
    background-color: rgba(0, 201, 106, 0.15);
    color: #4ade80;
}

body.dark-theme .esun-section #esunMatchStatus {
    background-color: rgba(0, 184, 212, 0.15);
    color: #5eead4;
}

body.dark-theme .taishin-section #taishinMatchStatus {
    background-color: rgba(230, 0, 18, 0.15);
    color: #ff6b6b;
}

body.dark-theme .uniopen-section #uniopenMatchStatus {
    background-color: rgba(155, 123, 255, 0.18);
    color: #cbbcff;
}

body.dark-theme .hsbc-section #hsbcMatchStatus {
    background-color: rgba(219, 0, 17, 0.15);
    color: #ff7777;
}

body.dark-theme .ubot-section #ubotMatchStatus {
    background-color: rgba(0, 185, 0, 0.15);
    color: #66ff66;
}

.winner {
    border: 2px solid #ffd700 !important;
    position: relative;
    overflow: visible;
}

.winner::after {
    content: '👑 推薦';
    position: absolute;
    top: -12px;
    right: -5px;
    background: #ffd700;
    color: #000;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    z-index: 10;
    white-space: nowrap;
}


/* Sections */
.section-content {
    display: none;
    padding: 20px;
    animation: fadeIn 0.4s ease-out;
    /* 鎖住水平捲動：避免首頁「推薦碼」按鈕區塊可左右移動 */
    overflow-x: hidden;
}

.section-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card-custom {
    background: var(--card-bg);
    border-radius: 24px;
    border: none;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    margin-bottom: 20px;
    overflow: visible;
    position: relative;
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-header-custom {
    padding: 15px 20px;
    font-weight: 700;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.card-body-custom {
    padding: 20px;
}

/* Home Page Buttons */
.action-btn {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 16px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: var(--primary-color);
    transition: transform 0.2s;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
    color: white;
}

.btn-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-report {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
}

.btn-apply {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

/* Calculator Styles (Adapted) */
.input-group {
    margin-bottom: 15px;
}

.form-control-lg {
    border-radius: 15px;
    border: 1px solid #eee;
    background: #f9f9f9;
    padding: 15px;
}

.form-control-lg:focus {
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
    border-color: #ddd;
}

.result-card {
    border-left: 5px solid #ccc;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result-card.cathay {
    border-left-color: var(--cathay-color);
}

.result-card.esun {
    border-left-color: var(--esun-color);
}

.result-card.taishin {
    border-left-color: var(--taishin-color);
}

.badge-custom {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-official {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-community {
    background-color: #fff3e0;
    color: #f57c00;
}

/* Modal */
.modal-content {
    border-radius: 24px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 20px;
}

/* Floating Action Button for Report */
.fab {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 900;
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.fab:active {
    transform: scale(0.9);
}

/* Search Suggestions */
.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    background: #eee;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
}

.suggestion-chip:hover {
    background: #ddd;
}

/* Hide elements based on page type */
.hide-in-search,
.hide-in-calculator {
    display: block;
}

/* Dark theme */
body.dark-theme {
    --primary-color: #ffffff;
    --bg-color: #0f0f0f;
    --card-bg: #1e1e1e;
    --glass-bg: rgba(30, 30, 30, 0.95);
    --glass-border: rgba(255, 255, 255, 0.15);
    color: var(--primary-color);
}

/* Toast Customization */
.toast-custom {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid rgba(0, 0, 0, 0.05);
    max-width: 90%;
    width: 400px;
    margin: 0 auto;
    position: fixed;
    bottom: 80px;
    /* Above nav bar */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1060;
    /* Above FAB */
}

body.dark-theme .card-custom {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 10px 30px -5px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

body.dark-theme .card-custom:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 20px 40px -5px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.dark-theme .form-control,
body.dark-theme .form-select {
    background-color: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
    background-color: #2a2a2a;
    border-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(207, 179, 120, 0.2);
}

body.dark-theme .form-control::placeholder,
body.dark-theme input::placeholder {
    color: #888888;
}

body.dark-theme .nav-bottom {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
}

body.dark-theme #nav-highlight {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

body.dark-theme #nav-highlight::before {
    opacity: 0.3;
}

body.dark-theme #nav-highlight::after {
    opacity: 0.3;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

body.dark-theme .text-muted {
    color: #d0d0d0 !important;
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme h3,
body.dark-theme h4,
body.dark-theme h5,
body.dark-theme h6 {
    color: #ffffff;
}

body.dark-theme i,
body.dark-theme .fa-solid,
body.dark-theme .fa-regular {
    color: #ffffff;
}

body.dark-theme .header h5 i {
    color: var(--accent-color);
}

/* ===== Custom Mileage Settings Beautification ===== */

/* Primary Gradient Button (Add, Save, etc.) */
.btn-miles-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-miles-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(118, 75, 162, 0.4);
    color: white;
}

.btn-miles-primary:active {
    transform: scale(0.98);
}

/* Secondary Button (Export, Import, Cancel) */
.btn-miles-secondary {
    background: white;
    color: #555;
    border: 1px solid #eee;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.btn-miles-secondary:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #333;
}

.btn-miles-secondary:active {
    transform: scale(0.98);
}

body.dark-theme .btn-miles-secondary {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ddd;
}

body.dark-theme .btn-miles-secondary:hover {
    background: #333;
    color: #fff;
}

/* Icon Button (Edit, Delete, Remove) */
.btn-miles-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-miles-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-miles-icon:active {
    transform: scale(0.95);
}

.btn-miles-icon.edit {
    background: white;
    color: #667eea;
}

.btn-miles-icon.delete {
    background: white;
    color: #ff6b6b;
}

.btn-miles-icon.share {
    background: white;
    color: #2ea44f;
}

.btn-miles-icon.remove {
    background: #fff0f0;
    color: #ff6b6b;
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    box-shadow: none;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

body.dark-theme .btn-miles-icon.edit {
    background: #2a2a2a;
    color: #8b9aff;
}

body.dark-theme .btn-miles-icon.delete {
    background: #2a2a2a;
    color: #ff6b6b;
}

body.dark-theme .btn-miles-icon.share {
    background: #2a2a2a;
    color: #4ade80;
}

/* ===== Shared Custom Page ===== */
.shared-custom-entry-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.shared-custom-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    margin-bottom: 18px;
}

.shared-custom-search-icon {
    color: #6c757d;
    font-size: 1rem;
}

.shared-custom-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
}

.shared-custom-section {
    margin-bottom: 20px;
}

.shared-custom-section-title {
    font-weight: 700;
    color: #5b6777;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shared-custom-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shared-custom-item {
    border-radius: 18px;
    padding: 14px 16px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shared-custom-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.shared-custom-title {
    font-weight: 700;
    color: #343a40;
}

.shared-custom-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.shared-custom-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.shared-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shared-rating button {
    background: transparent;
    border: none;
    color: #f4c150;
    font-size: 1rem;
    padding: 0;
    cursor: pointer;
}

.shared-rating button.is-empty {
    color: #d0d4d9;
}

.shared-rating button:disabled {
    cursor: default;
    opacity: 0.6;
}

.shared-rating.display-only button {
    cursor: default;
}

.shared-rating.display-only button:hover {
    transform: none;
}

.shared-rating-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
}

.shared-rating-modal {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow: hidden;
}

.shared-rating-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.shared-rating-modal-title {
    font-weight: 700;
}

.shared-rating-modal-name {
    font-weight: 600;
    margin-bottom: 10px;
}

.shared-rating-modal-stars {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}

.shared-rating-modal-star {
    background: transparent;
    border: none;
    color: #d0d4d9;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.shared-rating-modal-star.is-empty {
    color: #d0d4d9;
}

.shared-rating-modal-star:not(.is-empty) {
    color: #f4c150;
}

.shared-rating-modal-hint {
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
}

.shared-rating-modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
    gap: 8px;
}

.shared-rating-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: none;
    background: #f1f3f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.shared-rating-modal-close-icon {
    position: relative;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.shared-rating-modal-close-icon::before,
.shared-rating-modal-close-icon::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 14px;
    background: #495057;
    border-radius: 2px;
    transition: transform 0.2s ease;
    transform-origin: center;
}

.shared-rating-modal-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.shared-rating-modal-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.shared-rating-modal-close:hover {
    background: #e9ecef;
    transform: rotate(90deg);
}

body.dark-theme .shared-rating-modal-close {
    background: #3a3a3a;
}

body.dark-theme .shared-rating-modal-close-icon::before,
body.dark-theme .shared-rating-modal-close-icon::after {
    background: #e9ecef;
}

body.dark-theme .shared-rating-modal {
    background: #2a2a2a;
    color: #f1f3f5;
}

/* Dark theme for shared rating stars */
body.dark-theme .shared-rating button {
    color: #FFD700 !important;
}

body.dark-theme .shared-rating button i {
    color: #FFD700 !important;
}

body.dark-theme .shared-rating button.is-empty {
    color: #4b5563 !important;
}

body.dark-theme .shared-rating button.is-empty i {
    color: #4b5563 !important;
}

.shared-custom-details {
    font-size: 0.88rem;
    color: #495057;
    line-height: 1.5;
}

.shared-custom-details.is-collapsed {
    display: none;
}

.shared-custom-toggle {
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.shared-custom-rate.is-disabled {
    opacity: 0.6;
}

.shared-sub-content {
    display: none;
}

.shared-sub-content.active {
    display: block;
}

.admin-tab.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.admin-shared-editor-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.admin-shared-editor-dialog {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    max-width: 720px;
    width: 100%;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

body.dark-theme .admin-shared-editor-dialog {
    background: #2a2a2a;
    color: #f1f3f5;
}

body.dark-theme .shared-custom-search {
    background: #2a2a2a;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

body.dark-theme .shared-custom-search-input {
    color: #f1f3f5;
}

body.dark-theme .shared-custom-item {
    background: #2a2a2a;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

body.dark-theme .shared-custom-title {
    color: #f1f3f5;
}

body.dark-theme .shared-custom-meta,
body.dark-theme .shared-custom-details {
    color: #cbd3da;
}

body.dark-theme .btn-miles-icon.remove {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.3);
}

/* Rounded Color Input */
.custom-miles-color-input {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 48px;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.custom-miles-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.custom-miles-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.custom-miles-color-input::-moz-color-swatch {
    border: none;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* List Item Styling */
.custom-miles-item {
    border: none !important;
    padding: 16px !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
    background: #fff !important;
    transition: transform 0.2s;
    margin-bottom: 12px;
}

body .custom-miles-item {
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    margin-bottom: 12px;
}

body.dark-theme .custom-miles-item {
    background: #1e1e1e !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
}

.custom-miles-item:hover {
    transform: translateY(-2px);
}

/* Custom Miles Item Header - Controls Right Aligned */
.custom-miles-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}

.custom-miles-item-header .custom-miles-item-name {
    display: flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 1;
}

.custom-miles-item-header .custom-miles-item-name .fw-bold {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-miles-item-header .custom-miles-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Form Actions */
.form-actions-container {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 16px;
    padding: 16px;
    margin-top: 16px;
}

body.dark-theme .form-actions-container {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .card-custom[onclick] {
    background: linear-gradient(145deg, #1e1e1e, #252525) !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 10px 30px -5px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Mobile Optimization for Mileage Buttons */
@media (max-width: 576px) {

    .btn-miles-primary,
    .btn-miles-secondary {
        padding: 6px 10px;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .btn-miles-primary i,
    .btn-miles-secondary i {
        font-size: 0.75rem;
    }

    .custom-miles-action-row {
        gap: 12px;
    }
}

body.dark-theme .card-custom[onclick]:hover {
    background: linear-gradient(145deg, #252525, #2a2a2a) !important;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 20px 40px -5px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.dark-theme .card-custom[onclick] h5 {
    color: #ffffff;
}

body.dark-theme .card-custom[onclick] .small.text-muted {
    color: #d0d0d0 !important;
}

body.dark-theme a.card-custom {
    background: linear-gradient(145deg, #1e1e1e, #252525) !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 10px 30px -5px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-theme a.card-custom:hover {
    background: linear-gradient(145deg, #252525, #2a2a2a) !important;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 20px 40px -5px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-title-text {
    color: #333;
}

body.dark-theme .card-title-text {
    color: #ffffff;
}

body.dark-theme a.card-custom .fw-bold {
    color: #ffffff;
}

body.dark-theme a.card-custom .text-muted {
    color: #d0d0d0 !important;
}

body.dark-theme h6.text-muted {
    color: #d0d0d0 !important;
}

/* Settings Page Styling */
.settings-section {
    padding: 24px 20px;
}

.settings-card {
    background: var(--card-bg);
    border-radius: 24px;
    border: none;
    box-shadow: var(--shadow-soft);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.settings-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ===== 哩程計算結果樣式 ===== */
/* ===== 哩程計算結果樣式 ===== */
.miles-result-card {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.miles-result-card:active {
    transform: scale(0.99);
}

.miles-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.miles-result-card .bank-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
    line-height: 1.2;
}

.miles-result-card .miles-label {
    font-size: 0.8rem;
    color: #888;
    margin-top: 2px;
}

.miles-value-container {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.miles-value-container .miles-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.miles-value-container .miles-unit {
    font-size: 0.85rem;
    font-weight: 500;
    color: #999;
    margin-left: 2px;
}

body.dark-theme .miles-result-card .bank-name {
    color: #f0f0f0;
}

body.dark-theme .miles-result-card .miles-label {
    color: #aaa;
}

body.dark-theme .miles-value-container .miles-value {
    color: #fff;
}

body.dark-theme .miles-value-container .miles-unit {
    color: #aaa;
}

/* ===== 設定頁分頁樣式 ===== */
.settings-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

.miles-sub-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.03);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.settings-tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.miles-sub-tab {
    flex: 1;
    padding: 10px 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.82rem;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    min-height: 36px;
}

.settings-tab:hover {
    background: rgba(0, 0, 0, 0.04);
}

.miles-sub-tab:hover {
    background: rgba(0, 0, 0, 0.04);
}

.settings-tab.active {
    background: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.miles-sub-tab.active {
    background: var(--card-bg);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-tab-content.active {
    display: block;
}

.miles-sub-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.miles-sub-content.active {
    display: block;
}

body.dark-theme .settings-tabs {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .miles-sub-tabs {
    background: rgba(255, 255, 255, 0.04);
}

body.dark-theme .settings-tab {
    color: #aaa;
}

body.dark-theme .miles-sub-tab {
    color: #aaa;
}

body.dark-theme .settings-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .miles-sub-tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

body.dark-theme .settings-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .miles-sub-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== 主題選擇開關按鈕 ===== */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50px;
    padding: 6px;
    position: relative;
    width: 220px;
}

.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    cursor: pointer;
    z-index: 2;
    border-radius: 40px;
    transition: all 0.3s ease;
}

.theme-option i {
    font-size: 1.5rem;
    color: #888;
    transition: all 0.3s ease;
}

.theme-option span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.theme-option.active i {
    color: #667eea;
}

.theme-option.active span {
    color: #333;
    font-weight: 600;
}

.theme-toggle-slider {
    position: absolute;
    top: 6px;
    left: 6px;
    width: calc(50% - 6px);
    height: calc(100% - 12px);
    background: linear-gradient(145deg, #667eea, #764ba2);
    border-radius: 40px;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.theme-toggle-slider.right {
    left: calc(50%);
}

.theme-option.active i,
.theme-option.active span {
    color: #fff;
}

/* 主題預覽卡片 */
.theme-preview-card {
    width: 120px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
}

.preview-header {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.preview-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.preview-item {
    height: 10px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

body.dark-theme .theme-toggle-wrapper {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .theme-option i {
    color: #888;
}

body.dark-theme .theme-option span {
    color: #aaa;
}

body.dark-theme .theme-option.active i,
body.dark-theme .theme-option.active span {
    color: #fff;
}

body.dark-theme .preview-item {
    background: rgba(255, 255, 255, 0.15);
}

/* Toast Customization */
/* Toast Customization */
.toast-custom {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    color: var(--primary-color);

    /* Layout Refinements */
    max-width: none !important;
    /* Override Bootstrap default */
    width: clamp(280px, 92vw, 560px);
    /* 讓彈出視窗隨螢幕/縮放自然伸縮，並避免 transform scale 造成置中飄移 */
    white-space: normal;
}

/* Update toast：允許內容在窄寬/縮放下換行，避免左右位移與溢出 */
#sw-update-toast>.d-flex {
    flex-wrap: wrap;
    gap: 10px;
}

#sw-update-toast .toast-body {
    flex: 1 1 220px;
    min-width: 0;
}

#sw-update-toast .btn-gradient-update,
#sw-update-toast .btn-close {
    flex: 0 0 auto;
}

.toast-custom .toast-body {
    font-weight: 600;
    font-size: clamp(0.85rem, 2.6vw, 0.95rem);
    padding: clamp(8px, 2.2vw, 10px) clamp(12px, 3vw, 16px);
}

.btn-gradient-update {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    padding: clamp(6px, 2vw, 7px) clamp(12px, 3.6vw, 16px);
    border-radius: 20px;
    font-weight: bold;
    font-size: clamp(0.8rem, 2.4vw, 0.85rem);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(56, 239, 125, 0.3);
    transition: all 0.2s;
}

.btn-gradient-update:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(56, 239, 125, 0.4);
    color: white;
}

.btn-gradient-update:active {
    transform: scale(0.95);
}

body.dark-theme .toast-custom {
    background: rgba(30, 30, 30, 0.85);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.settings-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.settings-title-row .settings-title {
    margin-bottom: 0;
}

.settings-export-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.export-format-toggle {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.03);
}

body.dark-theme .export-format-toggle {
    background: rgba(255, 255, 255, 0.06);
}

.export-format-toggle .form-check {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.export-textarea {
    width: 100%;
    min-height: 180px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    padding: 12px;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

body.dark-theme .export-textarea {
    background: #1f2327;
    border-color: #2a2f33;
    color: #e9ecef;
}

.export-custom-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.export-custom-item {
    border: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 10px 12px;
}

body.dark-theme .export-custom-item {
    border-color: #2a2f33;
    background: #1f2327;
    color: #e9ecef;
}

.settings-title i {
    color: var(--accent-color);
    font-size: 1.3rem;
}

.settings-group {
    margin-bottom: 24px;
}

.settings-group:last-child {
    margin-bottom: 0;
}

/* Beautiful Switches */
.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    border-radius: 2em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    transition: background-position .15s ease-in-out, background-color .3s ease-in-out;
    background-color: #e9ecef;
    /* Light gray for visibility against white */
    border-color: #dee2e6;
}

/* Dark Theme Support for Switches */
body.dark-theme .form-switch .form-check-input:not(:checked) {
    background-color: #495057;
    /* Darker gray for dark mode */
    border-color: #6c757d;
}

.form-switch .form-check-input:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.1);
}

.switch-cathay:checked {
    background-color: var(--cathay-color);
    border-color: var(--cathay-color);
}

.switch-esun:checked {
    background-color: var(--esun-color);
    border-color: var(--esun-color);
}

.switch-taishin:checked {
    background-color: var(--taishin-color);
    border-color: var(--taishin-color);
}

.switch-uniopen:checked {
    background-color: var(--uniopen-color);
    border-color: var(--uniopen-color);
}

/* Disabled radio label (used for Uniopen overseas -> icash pay locked to 'no') */
.radio-label.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.settings-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 10px;
    display: block;
}

.settings-select {
    border-radius: 16px;
    padding: 14px;
    border: 1px solid #eee;
    background-color: #f8f9fa;
    font-size: 1rem;
    transition: all 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.settings-input {
    border-radius: 16px;
    padding: 12px 14px;
    border: 1px solid #eee;
    background-color: #f8f9fa;
    font-size: 0.95rem;
    transition: all 0.2s;
    width: 100%;
}

.custom-miles-color-input {
    height: 44px;
    padding: 6px 10px;
}

.settings-select:focus {
    box-shadow: 0 0 0 4px rgba(207, 179, 120, 0.15);
    border-color: var(--accent-color);
    background-color: #fff;
    outline: none;
}

.settings-input:focus {
    box-shadow: 0 0 0 4px rgba(207, 179, 120, 0.15);
    border-color: var(--accent-color);
    background-color: #fff;
    outline: none;
}

.custom-miles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    width: 100%;
}

.custom-miles-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 10px;
    padding-left: 0;
}

.custom-miles-footer-actions {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 0;
}

.custom-miles-footer-actions .btn-miles-secondary {
    padding: 10px 18px;
    font-size: 0.95rem;
}

.custom-miles-action-row .btn-miles-primary {
    padding: 10px 18px;
    font-size: 0.95rem;
}

.custom-miles-item {
    padding: 0;
    border: none;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.custom-miles-item .d-flex {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.custom-miles-select {
    min-width: 220px;
    width: 100%;
    max-width: 100%;
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-miles-airlines {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-miles-airline-row {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 0.8fr auto;
    gap: 10px;
    align-items: center;
}

.custom-amount-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-amount-option-row {
    display: grid;
    grid-template-columns: 1.1fr 0.8fr 0.8fr auto;
    gap: 10px;
    align-items: center;
}

.custom-amount-display-name {
    font-weight: 700;
    color: #333;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
}

body.dark-theme .custom-amount-display-name {
    color: #f1f1f1;
    background: rgba(255, 255, 255, 0.08);
}

.custom-miles-icon {
    background: rgba(207, 179, 120, 0.12);
    color: var(--accent-color);
}

@media (max-width: 480px) {
    .custom-miles-airline-row {
        grid-template-columns: 1fr 1fr;
    }

    .custom-miles-airline-row .custom-miles-remove {
        grid-column: span 2;
        justify-self: end;
    }

    .custom-amount-option-row {
        grid-template-columns: 1fr 1fr;
    }

    .custom-amount-option-row .custom-amount-remove {
        grid-column: span 2;
        justify-self: end;
    }
}

.settings-inline-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
}

.settings-subgroup {
    margin-left: 22px;
    padding-left: 12px;
    border-left: 2px solid rgba(0, 201, 106, 0.15);
}

.settings-sub-label {
    font-size: 0.95rem;
    color: #4f4f4f;
}

.settings-plan-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-plan-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #555;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.settings-plan-option:hover {
    background: #f6f6f6;
    transform: translateY(-1px);
}

.settings-plan-option:disabled,
.settings-plan-option.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.settings-plan-option .settings-plan-check {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #d0d0d0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    background: #fff;
    transition: all 0.2s ease;
    font-size: 0.6rem;
}

.settings-plan-option .settings-plan-check i {
    color: transparent;
}

.settings-plan-option.active {
    border-color: var(--cathay-color);
    color: var(--cathay-color);
    background: rgba(0, 201, 106, 0.08);
}

.settings-plan-option.active .settings-plan-check {
    border-color: var(--cathay-color);
    background: var(--cathay-color);
    color: #fff;
}

.settings-plan-option.active .settings-plan-check i {
    color: #fff;
}

.settings-plan-option.esun-option.active {
    border-color: var(--esun-color);
    color: var(--esun-color);
    background: rgba(0, 184, 212, 0.08);
}

.settings-plan-option.esun-option.active .settings-plan-check {
    border-color: var(--esun-color);
    background: var(--esun-color);
    color: #fff;
}

.settings-plan-option.esun-autopay .settings-plan-text {
    white-space: nowrap;
    font-size: 0.78rem;
}

.settings-plan-option.esun-ebill .settings-plan-text {
    white-space: nowrap;
}

body.dark-theme .settings-sub-label {
    color: #cfcfcf;
}

body.dark-theme .settings-plan-option {
    background: #1f1f1f;
    border-color: rgba(255, 255, 255, 0.18);
    color: #e6e6e6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

body.dark-theme .settings-plan-option:hover {
    background: #2a2a2a;
}

body.dark-theme .settings-plan-option .settings-plan-check {
    background: #1f1f1f;
    border-color: rgba(255, 255, 255, 0.25);
}

body.dark-theme .settings-plan-option:not(.active) .settings-plan-check i {
    color: transparent;
}

body.dark-theme .settings-plan-option.active {
    border-color: var(--cathay-color);
    color: var(--cathay-color);
    background: rgba(0, 201, 106, 0.16);
}

body.dark-theme .settings-plan-option.active .settings-plan-check {
    border-color: var(--cathay-color);
    background: var(--cathay-color);
}

body.dark-theme .settings-plan-option.esun-option.active {
    border-color: var(--esun-color);
    color: var(--esun-color);
    background: rgba(0, 184, 212, 0.16);
}

body.dark-theme .settings-plan-option.esun-option.active .settings-plan-check {
    border-color: var(--esun-color);
    background: var(--esun-color);
}

.settings-btn {
    border-radius: 16px;
    padding: 14px 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px solid;
}

.settings-btn:last-child {
    margin-bottom: 0;
}

.settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.settings-btn-primary {
    background-color: transparent;
    border-color: var(--cathay-color);
    color: var(--cathay-color);
}

.settings-btn-primary:hover {
    background-color: var(--cathay-color);
    color: white;
}

.settings-btn-secondary {
    background-color: transparent;
    border-color: #6c757d;
    color: #6c757d;
}

.settings-btn-secondary:hover {
    background-color: #6c757d;
    color: white;
}

.settings-btn-info {
    background-color: transparent;
    border-color: #0dcaf0;
    color: #0dcaf0;
}

.settings-btn-info:hover {
    background-color: #0dcaf0;
    color: white;
}

.settings-btn-dark {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.settings-btn-dark:hover {
    background-color: var(--primary-color);
    color: white;
}

body.dark-theme .settings-label {
    color: var(--primary-color);
}

body.dark-theme .settings-select {
    background-color: #3a3a3a;
    border-color: #4a4a4a;
    color: var(--primary-color);
}

body.dark-theme .settings-input {
    background-color: #3a3a3a;
    border-color: #4a4a4a;
    color: var(--primary-color);
}

body.dark-theme .settings-select:focus {
    background-color: #3a3a3a;
    border-color: var(--accent-color);
}

body.dark-theme .settings-input:focus {
    background-color: #3a3a3a;
    border-color: var(--accent-color);
}

body.dark-theme .custom-miles-item {
    background-color: #1f1f1f;
    border-color: #2d2d2d;
}

body.dark-theme .header {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

body.dark-theme .radio-label {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

body.dark-theme .radio-label:hover {
    background: #333333;
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .radio-label.selected {
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

body.dark-theme .option-group h3 {
    color: #e0e0e0;
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.dark-theme .rule-desc {
    color: #d0d0d0;
}

body.dark-theme .result-value {
    color: #ffffff;
}

body.dark-theme .settings-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 10px 30px -5px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-theme .settings-select {
    background-color: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.15);
}

/* 免責聲明樣式 */
.disclaimer-content {
    color: #666;
    line-height: 1.6;
}

.disclaimer-content p {
    margin-bottom: 12px;
}

.disclaimer-content ul {
    margin-bottom: 12px;
    padding-left: 1.5rem;
}

.disclaimer-content li {
    margin-bottom: 6px;
}

.disclaimer-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

body.dark-theme .disclaimer-content {
    color: #d0d0d0;
}

body.dark-theme .disclaimer-content strong {
    color: #ffffff;
}

/* Admin 頁面樣式 */
.list-group-item {
    border: none;
    border-bottom: 1px solid #f0f0f0;
}

.list-group-item:last-child {
    border-bottom: none;
}

body.dark-theme .list-group-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* 免責聲明頁面驚嘆號圖標可點擊樣式 */
.settings-title i.fa-exclamation-triangle[onclick] {
    transition: all 0.2s ease;
}

.settings-title i.fa-exclamation-triangle[onclick]:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

/* 首頁圖示固定尺寸 */
.home-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0 !important;
}

.home-icon-wrapper i {
    font-size: 1.5rem;
}

/* 回報適用店家按鈕美化 */
#home-section .card-custom.p-2 {
    padding: 12px 16px !important;
}

/* 首頁立即辦卡卡片優化 */
.home-apply-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa) !important;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.home-apply-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.1);
}

/* 回報適用店家卡片優化 */
.home-report-card {
    background: linear-gradient(145deg, #f8f9ff, #f0f2ff) !important;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.home-report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
    background: linear-gradient(145deg, #f0f2ff, #e8ebff) !important;
}

body.dark-theme .home-apply-card {
    background: linear-gradient(145deg, #2a2a2a, #1f1f1f) !important;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .home-apply-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .home-report-card {
    background: linear-gradient(145deg, #2a2a3a, #1f1f2f) !important;
    border-color: rgba(102, 126, 234, 0.3);
}

body.dark-theme .home-report-card:hover {
    background: linear-gradient(145deg, #2f2f3f, #252535) !important;
    border-color: rgba(102, 126, 234, 0.4);
}

body.dark-theme .settings-select:focus {
    background-color: #2a2a2a;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(207, 179, 120, 0.2);
}

body.dark-theme .settings-label {
    color: #ffffff;
}

body.dark-theme .settings-title {
    color: #ffffff;
}

body.dark-theme .settings-title i {
    color: var(--accent-color);
}

/* Circle Button Styles (from Lexus) */
.circle-btn-container {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    margin-top: 20px;
    flex-wrap: nowrap;
    gap: 8px;
}

.circle-btn {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    width: 100%;
    flex: 1 1 0;
    max-width: 68px;
    min-width: 0;
    transition: transform 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.circle-btn:hover {
    transform: translateY(-2px);
}

.circle-btn-icon {
    width: 52px;
    height: 52px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--primary-color);
    /* Embossed Effect */
    box-shadow:
        0 6px 15px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.02);
    margin: 0 auto 6px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.circle-btn:hover .circle-btn-icon {
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.05);
    color: var(--accent-color);
}

.circle-btn-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: #555;
    text-align: center;
}

.circle-btn.is-active .circle-btn-icon {
    color: var(--accent-color);
    border-color: rgba(207, 179, 120, 0.5);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.05);
}

body.dark-theme .circle-btn.is-active .circle-btn-icon {
    color: var(--accent-color);
    border-color: rgba(207, 179, 120, 0.35);
}

body.dark-theme .circle-btn {
    color: var(--primary-color);
}

body.dark-theme .circle-btn-icon {
    background: var(--card-bg);
    color: var(--primary-color);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .circle-btn:hover .circle-btn-icon {
    color: var(--accent-color);
}

body.dark-theme .circle-btn-text {
    color: #ffffff;
}

body.dark-theme .circle-btn-icon {
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-theme .circle-btn:hover .circle-btn-icon {
    border-color: rgba(255, 255, 255, 0.18);
}

body.dark-theme .form-label {
    color: #ffffff;
}

body.dark-theme .option-group h3 {
    color: #e0e0e0;
}

body.dark-theme .small.text-muted {
    color: #d0d0d0 !important;
}

/* =========================================
   Onboarding Flow Styles
   ========================================= */
/* Fix: Ensure Cube Modal (opened from Onboarding) is on top of Onboarding (z-2000) */
#cubeModal,
#pxpayModal,
#icashModal,
#esunWalletModal,
#feebeeModal,
#cathaySecModal,
#momoModal,
#uniopenModal,
#cubeInfoModal,
#unicardInfoModal,
#taishinInfoModal,
#lineModal {
    z-index: 2050 !important;
}

/* Ensure backdrop also covers the onboarding (z-2000) */
.modal-backdrop {
    z-index: 2040 !important;
}

/* ... existing code ... */

.apply-btn-esunwallet {
    background: linear-gradient(135deg, #f1f8e9 0%, #fff 100%);
    border: 1px solid rgba(76, 175, 80, 0.2) !important;
}

.apply-btn-feebee {
    background: linear-gradient(135deg, #fffde7 0%, #fff 100%);
    border: 1px solid rgba(255, 193, 7, 0.2) !important;
}

/* Dark Theme Overrides */

/* ... existing code ... */

body.dark-theme .apply-btn-esunwallet .card-title-text {
    color: #e0e0e0 !important;
}

body.dark-theme .apply-btn-feebee {
    border: 1px solid rgba(255, 193, 7, 0.4) !important;
}

body.dark-theme .apply-btn-feebee .card-title-text {
    color: #e0e0e0 !important;
}

/* Ensure backdrop also covers the onboarding (z-2000) */
.modal-backdrop {
    z-index: 2040 !important;
}

#onboarding-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.onboarding-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.onboarding-content-wrapper {
    position: relative;
    width: 90%;
    max-width: 400px;
    height: 550px;
    background: var(--card-bg);
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2001;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    /* 讓手勢以垂直捲動為主，避免在 onboarding 內左右拖動 */
    touch-action: pan-y;
}

.onboarding-slide {
    flex: 1;
    padding: 32px 24px;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    animation: fadeInSlide 0.4s ease-out;
    /* iOS 上避免可斜向拖動造成水平位移 */
    touch-action: pan-y;
}

.onboarding-slide.active {
    display: flex;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.onboarding-nav {
    padding: 20px 24px;
    background: var(--card-bg);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    z-index: 2002;
}

/* Ensure right alignment of next button */
#onboardingNextBtn {
    justify-self: end;
    white-space: nowrap;
    /* 螢幕窄時自動縮字，避免換行壓到點點 */
    font-size: clamp(0.72rem, 2.8vw, 0.875rem);
}

.onboarding-dots-overlay {
    position: relative;
    z-index: 2001;
    /* above backdrop, below nav (inside card) */
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.onboarding-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.onboarding-dots .dot.active {
    background: rgba(207, 179, 120, 0.85);
    width: 24px;
    border-radius: 4px;
}

/* Dark Theme Overrides for Onboarding */
body.dark-theme .onboarding-content-wrapper {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1e1e1e;
}

/* =========================================
   New Button Styles (Info & Apply) - Theming
   ========================================= */

/* Info Grid Buttons */
.info-btn-custom {
    border: 0;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
    background: linear-gradient(145deg, #ffffff, #fffcf5);
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-btn-custom:active {
    transform: scale(0.98);
}

.info-btn-cube {
    border-bottom: none !important;
    background: linear-gradient(145deg, #ffffff, #f1f8e9) !important;
}

.info-btn-unicard {
    border-bottom: none !important;
    background: linear-gradient(145deg, #ffffff, #e0f7fa) !important;
}

.info-btn-richart {
    border-bottom: 3px solid #e60012 !important;
    background: linear-gradient(145deg, #ffffff, #ffebee);
}

/* Apply Card Buttons */
.apply-btn-custom {
    border: 0;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
    transition: transform 0.2s;
    /* 讓手勢以垂直捲動為主（避免斜向滑造成左右位移感） */
    touch-action: pan-y;
}

.apply-btn-custom:active {
    transform: scale(0.98);
}

.apply-btn-cube {
    background: linear-gradient(135deg, #fffcf5 0%, #fff 100%);
    border: 1px solid rgba(255, 153, 0, 0.2) !important;
}

.apply-btn-unicard {
    background: linear-gradient(135deg, #e0f7fa 0%, #fff 100%);
    border: 1px solid rgba(0, 184, 212, 0.2) !important;
}

/* Dark Theme Overrides */


body.dark-theme .info-btn-custom i {
    filter: brightness(1.2);
    /* Make icons pop more */
}

body.dark-theme .info-btn-custom .text-muted {
    color: #aeaeae !important;
}

body.dark-theme .apply-btn-custom {
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-theme .apply-btn-cube,
body.dark-theme .apply-btn-unicard,
body.dark-theme .apply-btn-esunwallet,
body.dark-theme .apply-btn-richart,
body.dark-theme .apply-btn-uniopen,
body.dark-theme .apply-btn-hsbc,
body.dark-theme .apply-btn-ubot,
body.dark-theme .apply-btn-feebee {
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%) !important;
}

body.dark-theme .apply-btn-cube {
    border: 1px solid rgba(255, 153, 0, 0.4) !important;
}

body.dark-theme .apply-btn-cube .card-title-text {
    color: #e0e0e0 !important;
}

body.dark-theme .apply-btn-unicard {
    border: 1px solid rgba(0, 184, 212, 0.4) !important;
}

body.dark-theme .apply-btn-unicard .card-title-text {
    color: #e0e0e0 !important;
}

.info-btn-richart {
    border-bottom: none !important;
    background: linear-gradient(145deg, #ffffff, #ffebee) !important;
}

.info-btn-uniopen {
    border-bottom: none !important;
    background: linear-gradient(145deg, #ffffff, #f3efff) !important;
}

/* Circular Card Info Buttons */
.info-btn-custom {
    aspect-ratio: 1/1;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    max-width: 80px;
    margin: 0 auto;
    transition: all 0.3s ease;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
}

.info-btn-custom:hover {
    transform: translateY(-3px);
}

.info-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.info-icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.info-text {
    font-size: 0.75rem;
    line-height: 1.1;
}

/* Apply Card Buttons */
.apply-btn-custom {
    border: 0;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
    transition: transform 0.2s;
}

.apply-btn-custom:active {
    transform: scale(0.98);
}

.apply-btn-cube {
    background: linear-gradient(135deg, #fffcf5 0%, #fff 100%);
    border: 1px solid rgba(255, 153, 0, 0.2) !important;
}

.apply-btn-unicard {
    background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
    border: 1px solid rgba(0, 102, 204, 0.2) !important;
}

.apply-btn-esunwallet {
    background: linear-gradient(135deg, #f1f8e9 0%, #fff 100%);
    border: 1px solid rgba(76, 175, 80, 0.2) !important;
}


/* Apply Card Buttons - Feebee */
.apply-btn-feebee {
    background: linear-gradient(135deg, #fffde7 0%, #fff 100%);
    border: 1px solid rgba(255, 193, 7, 0.2) !important;
}

/* Dark Theme Overrides */

/* =========================================
   UI Enhancements (Gradient Badges & Forms)
   ========================================= */

/* Gradient Badges */
.badge-gradient-cathay {
    background: linear-gradient(135deg, #00c96a 0%, #00a859 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 168, 89, 0.3);
}

.badge-gradient-esun {
    background: linear-gradient(135deg, #00b8d4 0%, #0097a7 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 151, 167, 0.3);
}

.badge-gradient-warning {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.badge-gradient-secondary {
    background: linear-gradient(135deg, #78909c 0%, #546e7a 100%);
    box-shadow: 0 2px 4px rgba(84, 110, 122, 0.3);
}

.badge-gradient-danger {
    background: linear-gradient(135deg, #FF5252 0%, #D32F2F 100%);
    box-shadow: 0 2px 4px rgba(211, 47, 47, 0.3);
}

/* Enhanced Modal Styling */
.modal-content.glass-effect {
    /* Existing glass-effect is good, let's enhance internal padding/spacing if needed */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header .btn-close {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    padding: 0.5rem;
    transition: all 0.2s;
}

.modal-header .btn-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.modal-body .form-control,
.modal-body .input-group-text {
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: rgba(255, 255, 255, 0.8);
}

.modal-body .form-control:focus {
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
    background-color: #fff;
}

/* Report Form Enhancements */
#report-section .card-custom {
    border-radius: 24px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

#report-section .form-label {
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

#report-section .form-control,
#report-section .form-select {
    border-radius: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    transition: all 0.3s ease;
}

#report-section .form-control:focus,
#report-section .form-select:focus {
    border-color: #888;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

#report-section button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
    transition: all 0.3s;
}

#report-section button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(118, 75, 162, 0.4);
}

/* Dark Theme Adjustments for New UI */
body.dark-theme .modal-header .btn-close {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .modal-header .btn-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .modal-body .form-control,
body.dark-theme .modal-body .input-group-text {
    background-color: #2d2d2d;
    border-color: #444;
    color: #fff;
}

body.dark-theme #report-section .card-custom {
    background: linear-gradient(145deg, #1e1e1e, #181818);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-theme #report-section .form-label {
    color: #ccc;
}

body.dark-theme #report-section .form-control,
body.dark-theme #report-section .form-select {
    background-color: #2d2d2d;
    border-color: #444;
    color: #fff;
}

body.dark-theme #report-section .form-control::placeholder {
    color: #888;
}

/* Dark Mode Info Buttons - Optimized with Gradients */
body.dark-theme .info-btn-custom {
    background: linear-gradient(145deg, #2d2d2d, #1e1e1e);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-theme .info-btn-cube {
    background: linear-gradient(145deg, rgba(0, 201, 106, 0.2), rgba(0, 201, 106, 0.05)) !important;
    border: 1px solid rgba(0, 201, 106, 0.3) !important;
    border-bottom: none !important;
}

body.dark-theme .info-btn-unicard {
    background: linear-gradient(145deg, rgba(0, 184, 212, 0.2), rgba(0, 184, 212, 0.05)) !important;
    border: 1px solid rgba(0, 184, 212, 0.3) !important;
    border-bottom: none !important;
}

body.dark-theme .info-btn-richart {
    background: linear-gradient(145deg, rgba(230, 0, 18, 0.2), rgba(230, 0, 18, 0.05)) !important;
    border: 1px solid rgba(230, 0, 18, 0.3) !important;
    border-bottom: none !important;
}

body.dark-theme .info-btn-uniopen {
    background: linear-gradient(145deg, rgba(155, 123, 255, 0.2), rgba(155, 123, 255, 0.05)) !important;
    border: 1px solid rgba(155, 123, 255, 0.3) !important;
    border-bottom: none !important;
}

body.dark-theme .info-btn-custom i {
    filter: brightness(1.2);
}

body.dark-theme .info-btn-custom .text-muted {
    color: #aeaeae !important;
}

body.dark-theme .apply-btn-custom {
    background: linear-gradient(135deg, #2d2d2d 0%, #1e1e1e 100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-theme .apply-btn-cube {
    border: 1px solid rgba(255, 153, 0, 0.4) !important;
}

body.dark-theme .apply-btn-cube .card-title-text {
    color: #e0e0e0 !important;
}

body.dark-theme .apply-btn-unicard {
    border: 1px solid rgba(0, 184, 212, 0.4) !important;
}

body.dark-theme .apply-btn-unicard .card-title-text {
    color: #e0e0e0 !important;
}

body.dark-theme .apply-btn-esunwallet {
    border: 1px solid rgba(76, 175, 80, 0.4) !important;
}

body.dark-theme .apply-btn-esunwallet .card-title-text {
    color: #e0e0e0 !important;
}

body.dark-theme .apply-btn-feebee {
    border: 1px solid rgba(255, 193, 7, 0.4) !important;
}

body.dark-theme .apply-btn-feebee .card-title-text {
    color: #e0e0e0 !important;
}

/* Onboarding 快速設定（Slide 2）在暗色模式下的文字顏色 */
body.dark-theme #slide-2 .settings-label {
    color: #ffffff !important;
}

body.dark-theme .onboarding-nav {
    background: #1e1e1e;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-theme .onboarding-dots .dot {
    background: #444;
}

body.dark-theme .onboarding-dots .dot.active {
    background: var(--accent-color);
}

/* =========================================
   Premium Info Link Buttons
   ========================================= */
.info-link-btn {
    border: none;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    color: white !important;
    text-decoration: none;
}

.info-link-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.info-link-btn:active {
    transform: scale(0.98);
}

.info-link-btn i {
    font-size: 1.2rem;
}

/* Gradients */
.btn-gradient-cathay {
    background: linear-gradient(135deg, #00c96a 0%, #00a859 100%);
}

.btn-gradient-cathay:hover {
    background: linear-gradient(135deg, #00e67a 0%, #00c96a 100%);
    box-shadow: 0 8px 20px rgba(0, 201, 106, 0.3);
}

.btn-gradient-esun {
    background: linear-gradient(135deg, #00b8d4 0%, #0097a7 100%);
}

.btn-gradient-esun:hover {
    background: linear-gradient(135deg, #26c6da 0%, #00b8d4 100%);
    box-shadow: 0 8px 20px rgba(0, 184, 212, 0.3);
}

.btn-gradient-taishin {
    background: linear-gradient(135deg, #e60012 0%, #b71c1c 100%);
}

.btn-gradient-taishin:hover {
    background: linear-gradient(135deg, #ff1a1a 0%, #e60012 100%);
    box-shadow: 0 8px 20px rgba(230, 0, 18, 0.3);
}

.btn-gradient-uniopen {
    background: linear-gradient(135deg, #9b7bff 0%, #6f4dff 100%);
}

.btn-gradient-uniopen:hover {
    background: linear-gradient(135deg, #b096ff 0%, #856aff 100%);
    box-shadow: 0 8px 20px rgba(155, 123, 255, 0.3);
}

.btn-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-gradient-primary:hover {
    background: linear-gradient(135deg, #798eea 0%, #895cb9 100%);
    box-shadow: 0 8px 20px rgba(118, 75, 162, 0.3);
}

.btn-gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-gradient-success:hover {
    box-shadow: 0 8px 20px rgba(56, 239, 125, 0.3);
}

.btn-gradient-warning {
    background: linear-gradient(135deg, #fce38a 0%, #f38181 100%);
    color: #555 !important;
}

.btn-gradient-warning:hover {
    box-shadow: 0 8px 20px rgba(243, 129, 129, 0.3);
}

.btn-gradient-secondary {
    background: linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%);
    color: #444 !important;
}

.btn-gradient-secondary:hover {
    background: linear-gradient(135deg, #e0eaf0 0%, #ecf3f7 100%);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* Dark Theme Adjustments */
body.dark-theme .btn-gradient-secondary {
    background: linear-gradient(135deg, #485563 0%, #29323c 100%);
    color: white !important;
}

body.dark-theme .btn-gradient-secondary:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* =========================================
   Dark Theme Modal Fixes
   ========================================= */
body.dark-theme {
    --glass-bg: rgba(30, 30, 30, 0.95);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #1e1e1e;
}

body.dark-theme .modal-content {
    background: var(--glass-bg);
    color: #fff;
    border: 1px solid var(--glass-border);
}

/* Fix for modal overlay/gray screen issues */
.modal-backdrop {
    /* Must be above onboarding (z-2000) so the gray screen covers onboarding slides */
    z-index: 2040 !important;
}

.modal {
    /* Must be above backdrop */
    z-index: 2050 !important;
}

body.dark-theme .modal-header,
body.dark-theme .modal-body,
body.dark-theme .modal-footer {
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .modal-title {
    color: #fff;
}

body.dark-theme .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

body.dark-theme .form-control {
    background-color: #2d2d2d;
    border-color: #444;
    color: #fff;
}

body.dark-theme .form-control:focus {
    background-color: #333;
    color: #fff;
}

body.dark-theme .input-group-text {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

/* Fix Text Color in Dark Mode for Onboarding Cards */
body.dark-theme .onboarding-slide .card-custom h5,
body.dark-theme .onboarding-slide .card-custom .fw-bold {
    color: #ffffff !important;
}

body.dark-theme .onboarding-slide .card-custom .text-muted {
    color: #e0e0e0 !important;
}

/* =========================================
   COMPREHENSIVE DARK MODE FIXES
   ========================================= */

/* Override inline style="color: #333" on card titles */
body.dark-theme .card-title-text {
    color: #ffffff !important;
}

/* Global Card Text Overrides for Dark Mode */
/* Force white for all headers and bold text inside custom cards */
body.dark-theme .card-custom h5,
body.dark-theme .card-custom h4,
body.dark-theme .card-custom h6,
body.dark-theme .card-custom .fw-bold {
    color: #ffffff !important;
}

/* Force light gray for muted text inside custom cards */
body.dark-theme .card-custom .text-muted {
    color: #d0d0d0 !important;
}

/* Specific fix for Home Apply Cards to ensure they look good */
body.dark-theme .home-apply-card .fw-bold {
    color: #ffffff !important;
}

/* Fix any potential issues in modals */
body.dark-theme .modal-title {
    color: #ffffff !important;
}

body.dark-theme .modal-body {
    color: #e0e0e0 !important;
}

/* Fix for inline background color in Cube Modal (and potentially others) */
body.dark-theme .modal-body .card-custom[style*="background-color"] {
    background-color: #252525 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* =========================================
   Modal Specific Color Refinements
   ========================================= */

/* 1. Cathay Securities: Deep Green text/icon in alert */
#cathaySecModal .alert-success {
    color: #006400 !important;
}

#cathaySecModal .alert-success i {
    color: #006400 !important;
}

/* 2. PxPay: Orange instead of Red */
#pxpayModal input.text-danger {
    color: #ff9800 !important;
    /* Material Orange */
}

#pxpayModal .btn-danger {
    background-color: #ff9800 !important;
    border-color: #f57c00 !important;
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%) !important;
    /* Matches badge-gradient-warning */
    color: #fff !important;
}

#pxpayModal .btn-danger:hover {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%) !important;
    box-shadow: 0 8px 20px rgba(255, 152, 0, 0.3);
}

/* 3. Cathay Cube: Dark Gift Icon */
#cubeModal .alert-info i.fa-gift {
    color: #333333 !important;
}

/* Ensure it stays dark in dark mode too */
/* =========================================
   New Home Apply Button Styles (PxPay, CathaySec, icash)
   ========================================= */
.apply-btn-pxpay {
    background: linear-gradient(135deg, #fff3e0 0%, #fff 100%);
    border: 1px solid rgba(255, 152, 0, 0.2) !important;
}

.apply-btn-cathaysec {
    background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
    border: 1px solid rgba(0, 201, 106, 0.2) !important;
}

.apply-btn-icash {
    background: linear-gradient(135deg, #ffebee 0%, #fff 100%);
    border: 1px solid rgba(230, 0, 18, 0.2) !important;
}

/* Dark Mode Overrides for New Buttons */
body.dark-theme .apply-btn-pxpay {
    border: 1px solid rgba(255, 152, 0, 0.4) !important;
}

body.dark-theme .apply-btn-pxpay .card-title-text {
    color: #e0e0e0 !important;
}

body.dark-theme .apply-btn-cathaysec {
    border: 1px solid rgba(0, 201, 106, 0.4) !important;
}

body.dark-theme .apply-btn-cathaysec .card-title-text {
    color: #e0e0e0 !important;
}

body.dark-theme .apply-btn-icash {
    border: 1px solid rgba(230, 0, 18, 0.4) !important;
}

body.dark-theme .apply-btn-icash .card-title-text {
    color: #e0e0e0 !important;
}

/* Momo Button - Pink Theme */
.apply-btn-momo {
    background: linear-gradient(135deg, #fce4ec 0%, #fff 100%);
    border: 1px solid rgba(213, 0, 109, 0.2) !important;
}

/* Dark Mode Overrides */
body.dark-theme .apply-btn-momo {
    border: 1px solid rgba(213, 0, 109, 0.4) !important;
}

body.dark-theme .apply-btn-momo .card-title-text {
    color: #e0e0e0 !important;
}

/* Momo Modal Specifics */
#momoModal input.text-danger {
    color: #d5006d !important;
    /* Pinkish-red */
}

#momoModal .btn-danger {
    background: linear-gradient(135deg, #ec407a 0%, #d81b60 100%) !important;
    border-color: #d81b60 !important;
}

#momoModal .btn-danger:hover {
    background: linear-gradient(135deg, #d81b60 0%, #ad1457 100%) !important;
    box-shadow: 0 8px 20px rgba(216, 27, 96, 0.3);
}

.badge-gradient-momo {
    background: linear-gradient(135deg, #e91e63 0%, #9c27b0 100%);
    color: #fff;
}

/* Uniopen Button - Orange to Purple Theme */
.apply-btn-uniopen {
    background: linear-gradient(135deg, #fff3e0 0%, #ece0fd 100%);
    border: 1px solid rgba(124, 77, 255, 0.2) !important;
}

.badge-gradient-uniopen {
    background: linear-gradient(135deg, #9b7bff 0%, #6f4dff 100%);
    color: #fff;
}

/* Dark Mode Overrides */
body.dark-theme .apply-btn-uniopen {
    border: 1px solid rgba(124, 77, 255, 0.4) !important;
}

body.dark-theme .apply-btn-uniopen .card-title-text {
    color: #e0e0e0 !important;
}

/* ===== 計算模式切換按鈕（開關風格） ===== */
.calc-mode-switcher {
    display: flex;
    position: relative;
    padding: 4px;
    background: linear-gradient(145deg, #e8eaed, #f0f2f5);
    border-radius: 14px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* 滑動指示器 - 位置和寬度由 JavaScript 動態控制 */
.calc-mode-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 33.33%;
    height: calc(100% - 8px);
    background: linear-gradient(145deg, #667eea, #764ba2);
    border-radius: 11px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.calc-mode-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: transparent;
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    font-size: 1rem;
}

.calc-mode-option:hover {
    background: rgba(0, 0, 0, 0.03);
}

.calc-mode-option:active {
    transform: scale(0.98);
}

/* 選中狀態不需要背景（由指示器提供） */
.calc-mode-option.selected {
    background: transparent;
}

.calc-mode-option.selected:hover {
    background: transparent;
}

/* 圖示顏色 - 未選中狀態 */
.calc-mode-option .icon-dollar {
    color: #48bb78;
    filter: drop-shadow(0 1px 2px rgba(72, 187, 120, 0.2));
    transition: all 0.3s ease;
}

.calc-mode-option .icon-star {
    color: #d4a012;
    filter: drop-shadow(0 1px 2px rgba(212, 160, 18, 0.2));
    transition: all 0.3s ease;
}

.calc-mode-option .icon-plane {
    color: #3182ce;
    filter: drop-shadow(0 1px 2px rgba(49, 130, 206, 0.2));
    transition: all 0.3s ease;
}

.calc-mode-option .icon-arrow {
    color: #9ca3af;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

/* 選中狀態圖示顏色 */
.calc-mode-option.selected .icon-dollar,
.calc-mode-option.selected .icon-arrow {
    color: #fff;
}

.calc-mode-option.selected .icon-star {
    color: #ffd54f;
    filter: drop-shadow(0 1px 3px rgba(255, 213, 79, 0.5));
}

.calc-mode-option.selected .icon-plane {
    color: #81d4fa;
    filter: drop-shadow(0 1px 3px rgba(129, 212, 250, 0.5));
}

/* 長按提示 Tooltip */
.calc-mode-option::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    padding: 8px 14px;
    background: linear-gradient(145deg, rgba(30, 30, 30, 0.95), rgba(20, 20, 20, 0.98));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.calc-mode-option::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    border: 6px solid transparent;
    border-top-color: rgba(30, 30, 30, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    pointer-events: none;
}

.calc-mode-option:hover::after,
.calc-mode-option:hover::before,
.calc-mode-option.show-tooltip::after,
.calc-mode-option.show-tooltip::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* ===== 暗色主題 ===== */
body.dark-theme .calc-mode-switcher {
    background: linear-gradient(145deg, #1a1a1a, #252525);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

body.dark-theme .calc-mode-indicator {
    background: linear-gradient(145deg, #667eea, #764ba2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

body.dark-theme .calc-mode-option:hover {
    background: rgba(255, 255, 255, 0.03);
}



body.dark-theme .calc-mode-option .icon-arrow {
    color: #6b7280;
}

body.dark-theme .calc-mode-option.selected .icon-arrow {
    color: #fff;
}

body.dark-theme .calc-mode-option::after {
    background: linear-gradient(145deg, rgba(50, 50, 50, 0.98), rgba(40, 40, 40, 1));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-theme .calc-mode-option::before {
    border-top-color: rgba(50, 50, 50, 0.98);
}

/* ===== 金額哩程轉換模式樣式 ===== */
.result-value-container {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.result-unit {
    font-size: 0.85em;
    font-weight: 600;
    opacity: 0.8;
}

.airline-name-display {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 500;
    margin-top: 2px;
}

body.dark-theme .airline-name-display {
    color: #ffd700;
}

/* PWA Prompt Styles */
/* PWA Prompt Styles - Redesigned */
.pwa-prompt-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 2000;
    animation: slideDown 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pwa-prompt-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 12px 16px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pwa-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pwa-text h6 {
    font-size: 0.95rem;
    margin: 0;
    color: var(--primary-color);
    line-height: 1.2;
}

.pwa-text small {
    font-size: 0.75rem;
    color: #666;
    display: block;
}

.pwa-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-pwa-install {
    background: var(--primary-color);
    color: var(--card-bg);
    /* Contrast text */
    border: none;
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: transform 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.btn-line-join {
    background: #06c755;
    color: #ffffff;
}

.btn-support-dev {
    background: linear-gradient(135deg, #ff8a00 0%, #ff5e62 100%);
    color: #ffffff;
}


.btn-pwa-install:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.btn-pwa-close {
    background: transparent;
    border: none;
    color: #999;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    transition: background 0.2s, color 0.2s;
}

.btn-pwa-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

body.dark-theme .pwa-prompt-content {
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.dark-theme .pwa-text small {
    color: #aaa;
}

body.dark-theme .btn-pwa-install {
    background: #ffffff;
    color: #000000;
}

body.dark-theme .btn-line-join {
    background: #06c755;
    color: #ffffff;
}

body.dark-theme .btn-support-dev {
    background: linear-gradient(135deg, #ff8a00 0%, #ff5e62 100%);
    color: #ffffff;
}


body.dark-theme .btn-pwa-close {
    color: #666;
}

body.dark-theme .btn-pwa-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* HSBC Live+ Switch Color */
.switch-hsbc:checked {
    background-color: #db0011 !important;
    border-color: #db0011 !important;
}

.switch-hsbc:focus {
    box-shadow: 0 0 0 0.25rem rgba(219, 0, 17, 0.25) !important;
}

/* HSBC Autopay Settings Layout */
.hsbc-autopay-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Database Edit Button */
.btn-edit-db {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    /* Red gradient for HSBC context */
    color: white !important;
    border: none;
    border-radius: 50px;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(255, 65, 108, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    letter-spacing: 0.5px;
    height: 24px;
    /* Force height to match standard bootstrap switch */
}

.btn-edit-db:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 65, 108, 0.4);
    color: white !important;
}

.btn-edit-db:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(255, 65, 108, 0.3);
}

.btn-edit-db i {
    font-size: 0.8rem;
}

/* Dark mode adjustment if needed */
body.dark-theme .btn-edit-db {
    box-shadow: 0 4px 12px rgba(255, 65, 108, 0.2);
}

body.calm-mode .btn-edit-db {
    background: linear-gradient(135deg, #b54650 0%, #8f3b44 100%);
    box-shadow: 0 3px 10px rgba(181, 70, 80, 0.25);
}

body.calm-mode .btn-edit-db:hover {
    box-shadow: 0 4px 12px rgba(181, 70, 80, 0.32);
}

body.dark-theme.calm-mode .btn-edit-db {
    box-shadow: 0 4px 12px rgba(181, 70, 80, 0.2);
}

/* Ubot (聯邦賴點卡) Switch - LINE Green */
.switch-ubot:checked {
    background-color: var(--ubot-color) !important;
    border-color: var(--ubot-color) !important;
}

.switch-ubot:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 185, 0, 0.25);
}

/* Homepage Info Button Icon Circles */
.info-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-size: 1rem;
}

.info-btn-custom {
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-btn-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-btn-custom:active {
    transform: translateY(0);
}

/* Info Modal Gradient Buttons */
.btn-gradient-hsbc {
    background: linear-gradient(135deg, #db0011 0%, #9e0000 100%);
    border: none;
    color: white !important;
    border-radius: 10px;
    padding: 12px 16px;
}

.btn-gradient-hsbc:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(219, 0, 17, 0.3);
}

.btn-gradient-ubot {
    background: linear-gradient(135deg, #00b900 0%, #008a00 100%);
    border: none;
    color: white !important;
    border-radius: 10px;
    padding: 12px 16px;
}

.btn-gradient-ubot:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 185, 0, 0.3);
}

/* Gradient Icon Styles */
.text-gradient-hsbc {
    background: linear-gradient(135deg, #db0011 0%, #9e0000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.text-gradient-ubot {
    background: linear-gradient(135deg, #00b900 0%, #008a00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.text-gradient-cathay {
    background: linear-gradient(135deg, #00c96a 0%, #009b52 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.text-gradient-esun {
    background: linear-gradient(135deg, #00b8d4 0%, #008ba3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.text-gradient-taishin {
    background: linear-gradient(135deg, #e60012 0%, #b3000e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.text-gradient-uniopen {
    background: linear-gradient(135deg, #9b7bff 0%, #7a5cd6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Homepage Button Background Gradients */
.info-btn-hsbc {
    background: linear-gradient(135deg, #ffffff 0%, #fff0f0 100%);
}

body.dark-theme .info-btn-hsbc {
    background: linear-gradient(145deg, #2a2a2a 0%, #2e1f24 100%) !important;
}

.info-btn-ubot {
    background: linear-gradient(135deg, #ffffff 0%, #f0fff0 100%);
}

/* Dark Mode - Info Button Icon Gradients (Brighter solid colors for visibility) */
body.dark-theme .text-gradient-cathay {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #4ade80 !important;
    background-clip: unset !important;
    color: #4ade80 !important;
}

body.dark-theme .text-gradient-esun {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #22d3ee !important;
    background-clip: unset !important;
    color: #22d3ee !important;
}

body.dark-theme .text-gradient-taishin {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #f87171 !important;
    background-clip: unset !important;
    color: #f87171 !important;
}

body.dark-theme .text-gradient-uniopen {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #a78bfa !important;
    background-clip: unset !important;
    color: #a78bfa !important;
}

body.dark-theme .text-gradient-hsbc {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #ef4444 !important;
    background-clip: unset !important;
    color: #ef4444 !important;
}

body.dark-theme .text-gradient-ubot {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #4ade80 !important;
    background-clip: unset !important;
    color: #4ade80 !important;
}

/* =========================================
   Social Media Buttons (Homepage)
   ========================================= */
.social-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.social-buttons-grid>a {
    display: block;
    height: 100%;
}

.social-btn {
    border: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 75px;
    height: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 6px !important;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1) !important;
}

.social-btn:active {
    transform: translateY(-1px);
}

.social-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.social-icon-wrapper {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.social-btn:hover .social-icon-wrapper {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-btn .small {
    color: #555;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* LINE Button - 保持彩色圖示，淺色背景 */
.social-btn-line {
    background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
}

.social-btn-line:hover {
    box-shadow: 0 6px 16px rgba(6, 199, 85, 0.15) !important;
}

/* Instagram Button */
.social-btn-instagram {
    background: linear-gradient(145deg, #ffffff 0%, #fef2f6 100%);
}

.social-btn-instagram:hover {
    box-shadow: 0 6px 16px rgba(225, 48, 108, 0.15) !important;
}

/* Threads Button */
.social-btn-threads {
    background: linear-gradient(145deg, #ffffff 0%, #f5f5f5 100%);
}

.social-btn-threads:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
}

/* Dark Mode */
body.dark-theme .social-btn {
    background: linear-gradient(145deg, #2a2a2a 0%, #242424 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .social-btn-line {
    background: linear-gradient(145deg, #2a2a2a 0%, #1f2e24 100%) !important;
}

body.dark-theme .social-btn-instagram {
    background: linear-gradient(145deg, #2a2a2a 0%, #2e1f24 100%) !important;
}

body.dark-theme .social-btn-threads {
    background: linear-gradient(145deg, #2a2a2a 0%, #262626 100%) !important;
}

body.dark-theme .social-btn .small {
    color: #bbb;
}

body.dark-theme .social-btn:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

/* =========================================
   Help Button & Tutorial Modal Styles
   ========================================= */

/* Help Button (Circle Question Mark) */
.help-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}

.help-btn:hover {
    transform: scale(1.1);
    color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.help-btn:active {
    transform: scale(1.05);
}

body.dark-theme .help-btn {
    background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
    color: #aaa;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

body.dark-theme .help-btn:hover {
    color: #a78bfa;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.25);
}

/* Help Tooltip Box */
.help-tooltip-box {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(145deg, #667eea, #764ba2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: tooltipPulse 2s ease-in-out infinite;
}

.help-tooltip-box::after {
    content: '';
    position: absolute;
    right: -13px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left: 10px solid #764ba2;
}

.help-tooltip-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}

.help-tooltip-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

@keyframes tooltipPulse {

    0%,
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    50% {
        opacity: 0.9;
        transform: translateY(-50%) scale(1.02);
    }
}

body.dark-theme .help-tooltip-box {
    background: linear-gradient(145deg, #8b5cf6, #6366f1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

body.dark-theme .help-tooltip-box::after {
    border-left-color: #6366f1;
}

/* Tutorial Step Cards */
.tutorial-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tutorial-step:last-child {
    margin-bottom: 0;
}

.tutorial-step-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.tutorial-step-content {
    flex: 1;
}

.tutorial-step-content h6 {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: #333;
}

.tutorial-step-content p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
}

.tutorial-tip {
    background: linear-gradient(145deg, #fff3cd, #fffbeb);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: #856404;
}

.tutorial-tip i {
    color: #ffc107;
    margin-right: 6px;
}

/* Cathay Switch */
.switch-cathay:checked {
    background-color: var(--cathay-color) !important;
    border-color: var(--cathay-color) !important;
}

.switch-cathay:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 201, 106, 0.25);
}

/* Esun Switch */
.switch-esun:checked {
    background-color: var(--esun-color) !important;
    border-color: var(--esun-color) !important;
}

.switch-esun:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 184, 212, 0.25);
}

/* Taishin Switch */
.switch-taishin:checked {
    background-color: var(--taishin-color) !important;
    border-color: var(--taishin-color) !important;
}

.switch-taishin:focus {
    box-shadow: 0 0 0 0.25rem rgba(230, 0, 18, 0.25);
}

/* HSBC Switch */
.switch-hsbc:checked {
    background-color: #db0011 !important;
    border-color: #db0011 !important;
}

.switch-hsbc:focus {
    box-shadow: 0 0 0 0.25rem rgba(219, 0, 17, 0.25);
}

/* OpenPoint Switch - Orange */
.switch-openpoint:checked {
    background-color: #ff6b00 !important;
    border-color: #ff6b00 !important;
}

.switch-openpoint:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 0, 0.25);
}

/* DBS Bank Switch - Red */
.switch-dbs:checked {
    background-color: #e2001a !important;
    border-color: #e2001a !important;
}

.switch-dbs:focus {
    box-shadow: 0 0 0 0.25rem rgba(226, 0, 26, 0.25);
}

/* Dark Mode for Tutorial */
body.dark-theme .tutorial-step {
    background: linear-gradient(145deg, #2a2a2a, #1e1e1e);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .tutorial-step-content h6 {
    color: #e0e0e0;
}

body.dark-theme .tutorial-step-content p {
    color: #aaa;
}

body.dark-theme .tutorial-tip {
    background: linear-gradient(145deg, #3d3520, #2a2510);
    border-color: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
}

body.dark-theme .tutorial-tip i {
    color: #ffd54f;
}

/* =========================================
   Calm Mode (Eye-friendly, reduced saturation)
   ========================================= */
body.calm-mode {
    --primary-color: #1f2328;
    --accent-color: #b59c6f;
    --bg-color: #f3f4f2;
    --card-bg: #fbfbfa;
    --cathay-color: #2f8a6d;
    --esun-color: #2f8a98;
    --taishin-color: #b54650;
    --uniopen-color: #7f6fb4;
    --ubot-color: #3b8a52;
    --glass-bg: rgba(252, 252, 250, 0.9);
    --glass-border: rgba(210, 210, 205, 0.6);
    --shadow-soft: 0 10px 28px -6px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 18px 36px -8px rgba(0, 0, 0, 0.12);
}

body.dark-theme.calm-mode {
    --primary-color: #f2f4f6;
    --bg-color: #111212;
    --card-bg: #1b1c1e;
    --glass-bg: rgba(24, 24, 24, 0.9);
    --glass-border: rgba(255, 255, 255, 0.08);
    --cathay-color: #6fb79d;
    --esun-color: #6fb0ba;
    --taishin-color: #d1848a;
    --uniopen-color: #9c8ed1;
    --ubot-color: #73b78a;
}

body.calm-mode .nav-bottom {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(210, 210, 205, 0.6);
    backdrop-filter: blur(22px) saturate(120%);
    -webkit-backdrop-filter: blur(22px) saturate(120%);
}

body.dark-theme.calm-mode .nav-bottom {
    background: rgba(24, 24, 24, 0.95);
    border-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
}

body.calm-mode #nav-highlight {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

body.calm-mode #nav-highlight::before,
body.calm-mode #nav-highlight::after {
    opacity: 0.6;
}

body.calm-mode .text-muted {
    color: #5f6b72 !important;
}

body.dark-theme.calm-mode .text-muted {
    color: #e6e8ea !important;
}

body.calm-mode #nav-home i,
body.calm-mode #nav-home.active i {
    color: #6f7da8;
}

body.calm-mode #nav-search i,
body.calm-mode #nav-search.active i {
    color: #7b6ea6;
}

body.calm-mode #nav-calculator i,
body.calm-mode #nav-calculator.active i {
    color: #b48f96;
}

body.calm-mode #nav-settings i,
body.calm-mode #nav-settings.active i {
    color: var(--accent-color);
}

body.dark-theme.calm-mode #nav-home i,
body.dark-theme.calm-mode #nav-home.active i {
    color: #9aa9d1;
}

body.dark-theme.calm-mode #nav-search i,
body.dark-theme.calm-mode #nav-search.active i {
    color: #a89ad0;
}

body.dark-theme.calm-mode #nav-calculator i,
body.dark-theme.calm-mode #nav-calculator.active i {
    color: #d1a6ad;
}

body.dark-theme.calm-mode #nav-settings i,
body.dark-theme.calm-mode #nav-settings.active i {
    color: var(--accent-color);
}

body.calm-mode .home-icon-wrapper,
body.calm-mode .social-icon-wrapper,
body.calm-mode .info-icon-circle {
    filter: saturate(0.65) brightness(0.98);
}

body.calm-mode .info-icon-circle.text-gradient-cathay,
body.calm-mode .info-icon-circle.text-gradient-esun,
body.calm-mode .info-icon-circle.text-gradient-taishin,
body.calm-mode .info-icon-circle.text-gradient-uniopen,
body.calm-mode .info-icon-circle.text-gradient-hsbc,
body.calm-mode .info-icon-circle.text-gradient-ubot {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: currentColor !important;
    background-clip: unset !important;
}

body.calm-mode .info-icon-circle.text-gradient-cathay {
    color: var(--cathay-color) !important;
}

body.calm-mode .info-icon-circle.text-gradient-esun {
    color: var(--esun-color) !important;
}

body.calm-mode .info-icon-circle.text-gradient-taishin {
    color: var(--taishin-color) !important;
}

body.calm-mode .info-icon-circle.text-gradient-uniopen {
    color: var(--uniopen-color) !important;
}

body.calm-mode .info-icon-circle.text-gradient-hsbc {
    color: #b54650 !important;
}

body.calm-mode .info-icon-circle.text-gradient-ubot {
    color: var(--ubot-color) !important;
}

body.calm-mode .home-apply-card {
    background: linear-gradient(145deg, #fbfbfa, #f1f2f3) !important;
    border-color: rgba(0, 0, 0, 0.06);
}

body.calm-mode .apply-btn-cube,
body.calm-mode .apply-btn-unicard,
body.calm-mode .apply-btn-esunwallet,
body.calm-mode .apply-btn-richart,
body.calm-mode .apply-btn-uniopen,
body.calm-mode .apply-btn-hsbc,
body.calm-mode .apply-btn-ubot,
body.calm-mode .apply-btn-feebee {
    background: linear-gradient(135deg, #f6f3ef 0%, #fbfbfa 100%) !important;
    border-color: rgba(150, 140, 120, 0.2) !important;
}

body.dark-theme.calm-mode .apply-btn-cube,
body.dark-theme.calm-mode .apply-btn-unicard,
body.dark-theme.calm-mode .apply-btn-esunwallet,
body.dark-theme.calm-mode .apply-btn-richart,
body.dark-theme.calm-mode .apply-btn-uniopen,
body.dark-theme.calm-mode .apply-btn-hsbc,
body.dark-theme.calm-mode .apply-btn-ubot,
body.dark-theme.calm-mode .apply-btn-feebee {
    background: linear-gradient(135deg, #242424 0%, #1b1b1b 100%) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.calm-mode .home-report-card {
    background: linear-gradient(145deg, #f6f7f9, #edf0f3) !important;
    border-color: rgba(120, 130, 150, 0.2);
}

body.calm-mode .home-report-card:hover {
    background: linear-gradient(145deg, #eef1f4, #e6e9ee) !important;
    box-shadow: 0 10px 25px rgba(120, 130, 150, 0.15);
}

body.calm-mode .social-btn {
    background: linear-gradient(145deg, #fbfbfa 0%, #f3f4f5 100%);
}

body.calm-mode .social-btn-line {
    background: linear-gradient(145deg, #fbfbfa 0%, #eef4f0 100%);
}

body.calm-mode .social-btn-instagram {
    background: linear-gradient(145deg, #fbfbfa 0%, #f4eef2 100%);
}

body.calm-mode .social-btn-threads {
    background: linear-gradient(145deg, #fbfbfa 0%, #f1f1f1 100%);
}

body.calm-mode .badge-gradient-cathay {
    background: linear-gradient(135deg, #2f8a6d 0%, #27745c 100%);
    box-shadow: 0 2px 4px rgba(39, 116, 92, 0.25);
}

body.calm-mode .badge-gradient-esun {
    background: linear-gradient(135deg, #2f8a98 0%, #256d79 100%);
    box-shadow: 0 2px 4px rgba(37, 109, 121, 0.25);
}

body.calm-mode .badge-gradient-warning {
    background: linear-gradient(135deg, #c9a86d 0%, #b38b5a 100%);
    box-shadow: 0 2px 4px rgba(179, 139, 90, 0.25);
}

body.calm-mode .badge-gradient-secondary {
    background: linear-gradient(135deg, #83939c 0%, #6a7b85 100%);
}

body.calm-mode .badge-gradient-danger {
    background: linear-gradient(135deg, #c26d6d 0%, #a85656 100%);
}

body.calm-mode .badge-gradient-uniopen {
    background: linear-gradient(135deg, #7f6fb4 0%, #675a9a 100%);
}

body.calm-mode .btn-gradient-cathay {
    background: linear-gradient(135deg, #2f8a6d 0%, #27745c 100%);
}

body.calm-mode .btn-gradient-cathay:hover {
    background: linear-gradient(135deg, #3a9a7a 0%, #2f8a6d 100%);
}

body.calm-mode .btn-gradient-esun {
    background: linear-gradient(135deg, #2f8a98 0%, #256d79 100%);
}

body.calm-mode .btn-gradient-esun:hover {
    background: linear-gradient(135deg, #3b9aa8 0%, #2f8a98 100%);
}

body.calm-mode .btn-gradient-taishin {
    background: linear-gradient(135deg, #b54650 0%, #8f3b44 100%);
}

body.calm-mode .btn-gradient-taishin:hover {
    background: linear-gradient(135deg, #c45a63 0%, #b54650 100%);
}

body.calm-mode .btn-gradient-uniopen {
    background: linear-gradient(135deg, #7f6fb4 0%, #675a9a 100%);
}

body.calm-mode .btn-gradient-uniopen:hover {
    background: linear-gradient(135deg, #8f80c6 0%, #7f6fb4 100%);
}

body.calm-mode .btn-gradient-primary {
    background: linear-gradient(135deg, #6f7da8 0%, #6a5e8a 100%);
}

body.calm-mode .btn-gradient-primary:hover {
    background: linear-gradient(135deg, #7d8ab5 0%, #75649a 100%);
}

body.calm-mode .btn-gradient-success {
    background: linear-gradient(135deg, #3b8a78 0%, #2f6f62 100%);
}

body.calm-mode .btn-gradient-warning {
    background: linear-gradient(135deg, #c9a86d 0%, #b38b5a 100%);
}

body.calm-mode .btn-gradient-secondary {
    background: linear-gradient(135deg, #cbd3d8 0%, #e3e8ec 100%);
}

body.dark-theme.calm-mode .btn-gradient-secondary {
    background: linear-gradient(135deg, #4b5661 0%, #323b44 100%);
}

body.calm-mode .btn-gradient-hsbc {
    background: linear-gradient(135deg, #b54650 0%, #8f3b44 100%);
}

body.calm-mode .btn-gradient-ubot {
    background: linear-gradient(135deg, #3b8a52 0%, #2f6f41 100%);
}

body.calm-mode .text-gradient-hsbc {
    background: linear-gradient(135deg, #b54650 0%, #8f3b44 100%);
}

body.calm-mode .info-btn-hsbc {
    background: linear-gradient(135deg, #ffffff 0%, #f6e9ea 100%);
}

body.calm-mode .hsbc-section .radio-label.selected {
    border-color: #b54650;
    color: #b54650;
}

body.calm-mode .hsbc-section .rate-badge.active {
    background-color: #b54650;
}

body.calm-mode .hsbc-section #hsbcMatchStatus {
    color: #b54650;
}

body.calm-mode .switch-hsbc:checked {
    background-color: #b54650 !important;
    border-color: #b54650 !important;
}

body.calm-mode .switch-hsbc:focus {
    box-shadow: 0 0 0 0.25rem rgba(181, 70, 80, 0.25);
}

body.calm-mode .text-gradient-ubot {
    background: linear-gradient(135deg, #3b8a52 0%, #2f6f41 100%);
}

body.calm-mode .text-gradient-cathay {
    background: linear-gradient(135deg, #2f8a6d 0%, #27745c 100%);
}

body.calm-mode .text-gradient-esun {
    background: linear-gradient(135deg, #2f8a98 0%, #256d79 100%);
}

body.calm-mode .text-gradient-taishin {
    background: linear-gradient(135deg, #b54650 0%, #8f3b44 100%);
}

body.calm-mode .text-gradient-uniopen {
    background: linear-gradient(135deg, #7f6fb4 0%, #675a9a 100%);
}

body.dark-theme.calm-mode .text-gradient-cathay {
    background: none !important;
    -webkit-text-fill-color: #8fbfa8 !important;
    background-clip: unset !important;
    color: #8fbfa8 !important;
}

body.dark-theme.calm-mode .text-gradient-esun {
    background: none !important;
    -webkit-text-fill-color: #8fb7c1 !important;
    background-clip: unset !important;
    color: #8fb7c1 !important;
}

body.dark-theme.calm-mode .text-gradient-taishin {
    background: none !important;
    -webkit-text-fill-color: #d29aa0 !important;
    background-clip: unset !important;
    color: #d29aa0 !important;
}

body.dark-theme.calm-mode .text-gradient-uniopen {
    background: none !important;
    -webkit-text-fill-color: #b3a6dc !important;
    background-clip: unset !important;
    color: #b3a6dc !important;
}

body.dark-theme.calm-mode .text-gradient-hsbc {
    background: none !important;
    -webkit-text-fill-color: #d29aa0 !important;
    background-clip: unset !important;
    color: #d29aa0 !important;
}

body.dark-theme.calm-mode .text-gradient-ubot {
    background: none !important;
    -webkit-text-fill-color: #9bc5ab !important;
    background-clip: unset !important;
    color: #9bc5ab !important;
}

/* =========================================
   Export Settings Modal Styles
   ========================================= */
.export-custom-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 8px;
}

/* Custom Scrollbar for list */
.export-custom-list::-webkit-scrollbar {
    width: 4px;
}

.export-custom-list::-webkit-scrollbar-track {
    background: transparent;
}

.export-custom-list::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 4px;
}

.export-custom-item {
    background: var(--card-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 12px 16px !important;
    /* Override bootstrap form-check padding */
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.export-custom-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-color: rgba(207, 179, 120, 0.3);
    /* Accent color hint */
}

/* Checkbox Styling */
.export-custom-item .form-check-input {
    width: 1.4em;
    height: 1.4em;
    margin-right: 14px;
    margin-left: 0 !important;
    /* Reset bootstrap form-check-input negative margin */
    float: none !important;
    /* Reset bootstrap float */
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.export-custom-item .form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    border-width: 0;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}

.export-custom-item .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(207, 179, 120, 0.15);
}

.export-custom-item .form-check-label {
    flex-grow: 1;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    user-select: none;
}

/* Modal Specifics */
#settingsExportModal .modal-header {
    border-bottom: none;
    padding: 24px 24px 0;
}

#settingsExportModal .modal-title {
    font-weight: 800;
    letter-spacing: 0.5px;
    width: 100%;
    text-align: center;
}

#settingsExportModal .modal-body {
    padding: 24px;
}

#settingsExportModal .text-muted {
    font-size: 0.85rem;
}

/* Section headers in export list */
.export-section-title {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 8px;
    margin-top: 16px;
    font-weight: 700;
    padding-left: 4px;
}

/* Dark Theme Adjustments */
body.dark-theme .export-custom-list::-webkit-scrollbar-thumb {
    background: #444;
}

body.dark-theme .export-custom-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

body.dark-theme .export-custom-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .export-custom-item .form-check-input {
    border-color: #555;
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-theme .export-custom-item .form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

body.dark-theme .export-section-title {
    color: #aaa;
}

/* Back Button styling fix */
#exportCustomBackBtn {
    background-color: #f0f0f0;
    color: #666 !important;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

#exportCustomBackBtn:hover {
    background-color: #e0e0e0;
    color: #333 !important;
}

body.dark-theme #exportCustomBackBtn {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e0e0e0 !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.dark-theme #exportCustomBackBtn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
}

/* ===== Shared Rating Hint Banner ===== */
.shared-rating-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff8e1 0%, #fffde7 100%);
    border: 1px solid rgba(207, 179, 120, 0.3);
    box-shadow: 0 4px 12px rgba(207, 179, 120, 0.15);
    animation: sharedHintSlideIn 0.4s ease-out;
}

.shared-rating-hint.is-hiding {
    animation: sharedHintSlideOut 0.3s ease-in forwards;
}

@keyframes sharedHintSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sharedHintSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.shared-rating-hint-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.shared-rating-hint-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 179, 0, 0.3);
}

.shared-rating-hint-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shared-rating-hint-text strong {
    font-size: 0.9rem;
    color: #5d4037;
}

.shared-rating-hint-text span {
    font-size: 0.8rem;
    color: #8d6e63;
}

.shared-rating-hint-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: #8d6e63;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.2s;
}

.shared-rating-hint-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #5d4037;
}

.shared-rating-hint-close:active {
    transform: scale(0.92);
}

/* Dark theme for shared rating hint */
body.dark-theme .shared-rating-hint {
    background: linear-gradient(135deg, rgba(207, 179, 120, 0.15) 0%, rgba(255, 215, 0, 0.1) 100%);
    border-color: rgba(207, 179, 120, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-theme .shared-rating-hint-icon {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

body.dark-theme .shared-rating-hint-text strong {
    color: #ffe082;
}

body.dark-theme .shared-rating-hint-text span {
    color: #d7ccc8;
}

body.dark-theme .shared-rating-hint-close {
    background: rgba(255, 255, 255, 0.08);
    color: #d7ccc8;
}

body.dark-theme .shared-rating-hint-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffe082;
}

/* ========================================
   使用教學頁面樣式 (Guide Page Styles)
   ======================================== */

.guide-card {
    padding: 1.5rem;
}

.guide-card>p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* 快速導覽 */
.guide-toc {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.guide-toc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 576px) {
    .guide-toc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.guide-toc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    font-size: 0.8rem;
    text-align: center;
}

.guide-toc-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.guide-toc-item i {
    font-size: 1.2rem;
    color: #667eea;
}

/* 區塊標題 */
.guide-section {
    margin-top: 2rem;
    scroll-margin-top: 80px;
}

.guide-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.guide-section-title i {
    color: #667eea;
}

/* 卡片介紹 */
.guide-card-item {
    background: #fff;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
}

.guide-card-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.guide-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.guide-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.guide-card-info h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.guide-card-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    margin-top: 2px;
}

.guide-card-body p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.guide-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-feature-list li {
    font-size: 0.85rem;
    color: #666;
    padding: 0.25rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.guide-feature-list li i {
    color: #00c96a;
    margin-top: 2px;
    flex-shrink: 0;
}

/* 內容框 */
.guide-content-box {
    background: #fafafa;
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.guide-content-box p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.guide-content-box img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Cube guide: shrink images for mobile safety */
#cube-lock .guide-content-box img,
#cube-coupon .guide-content-box img,
#cube-bonus .guide-content-box img {
    max-width: 240px;
    width: 100%;
}

@media (max-width: 576px) {
    #cube-lock .guide-content-box img,
    #cube-coupon .guide-content-box img,
    #cube-bonus .guide-content-box img {
        max-width: 200px;
    }
}

/* 步驟指引 */
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.guide-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.guide-step-content strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 2px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.guide-step-content span {
    font-size: 0.8rem;
    color: #888;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* 提示框 */
.guide-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.12) 0%, rgba(255, 152, 0, 0.08) 100%);
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.guide-tip i {
    color: #f59e0b;
    font-size: 1rem;
    margin-top: 2px;
}

.guide-tip span {
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.5;
}

/* 模式切換格線 */
.guide-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.guide-mode-item {
    text-align: center;
    padding: 1rem 0.5rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.guide-mode-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #667eea;
}

.guide-mode-item h6 {
    font-size: 0.8rem;
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.guide-mode-item p {
    font-size: 0.7rem;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

/* 銀行格線 */
.guide-bank-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.guide-bank-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.guide-bank-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.guide-bank-feature {
    font-size: 0.7rem;
    color: #888;
}

/* 設定說明清單 */
.guide-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.guide-list {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.guide-list li {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

.guide-list li ul {
    padding-left: 1rem;
    margin-top: 0.25rem;
}

/* 進階功能 */
.guide-advanced-item {
    margin-bottom: 1.25rem;
}

.guide-advanced-item:last-child {
    margin-bottom: 0;
}

.guide-advanced-item h6 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.guide-advanced-item h6 i {
    color: #667eea;
}

.guide-advanced-item p {
    font-size: 0.85rem;
    color: #555;
    margin: 0;
    line-height: 1.6;
}

/* FAQ 列表 */
.guide-faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guide-faq-item {
    background: #fafafa;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.guide-faq-question,
.guide-faq-answer {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.guide-faq-question {
    margin-bottom: 0.5rem;
}

.guide-faq-question i,
.guide-faq-answer i {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.guide-faq-question i {
    background: #667eea;
    color: #fff;
}

.guide-faq-answer i {
    background: #00c96a;
    color: #fff;
}

.guide-faq-question span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.guide-faq-answer span {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
}

/* 首頁教學入口按鈕 */
.home-guide-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.home-guide-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
}

/* Dark theme for guide page */
body.dark-theme .guide-toc {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    border-color: rgba(102, 126, 234, 0.25);
}

body.dark-theme .guide-toc-item {
    background: rgba(30, 30, 30, 0.8);
    color: #eee;
}

body.dark-theme .guide-toc-item:hover {
    background: rgba(40, 40, 40, 1);
}

body.dark-theme .guide-section-title {
    border-color: rgba(102, 126, 234, 0.3);
}

body.dark-theme .guide-card-item {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .guide-card-body p,
body.dark-theme .guide-feature-list li {
    color: #bbb;
}

body.dark-theme .guide-content-box {
    background: #252525;
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-theme .guide-content-box p {
    color: #bbb;
}

body.dark-theme .guide-step-content span {
    color: #888;
}

body.dark-theme .guide-tip {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.1) 100%);
    border-color: rgba(255, 193, 7, 0.3);
}

body.dark-theme .guide-tip span {
    color: #fcd34d;
}

body.dark-theme .guide-mode-item {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .guide-mode-item p {
    color: #888;
}

body.dark-theme .guide-bank-item {
    background: #2a2a2a;
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-theme .guide-bank-feature {
    color: #888;
}

body.dark-theme .guide-list li {
    color: #bbb;
}

body.dark-theme .guide-advanced-item p {
    color: #bbb;
}

body.dark-theme .guide-faq-item {
    background: #252525;
    border-color: rgba(255, 255, 255, 0.06);
}

body.dark-theme .guide-faq-question span {
    color: #eee;
}

body.dark-theme .guide-faq-answer span {
    color: #bbb;
}

body.dark-theme .home-guide-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.25);
}

/* 返回按鈕樣式 */
.guide-back-btn {
    background: transparent;
    border: none;
    padding: 0;
    color: #666;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.guide-back-btn:hover {
    color: var(--primary-color);
    transform: translateX(-3px);
}

.guide-back-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.guide-back-btn:hover .guide-back-icon {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

body.dark-theme .guide-back-btn {
    color: #aaa;
}

body.dark-theme .guide-back-btn:hover {
    color: #fff;
}

body.dark-theme .guide-back-icon {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-theme .guide-back-btn:hover .guide-back-icon {
    background: rgba(102, 126, 234, 0.2);
    color: #8b9aff;
}