/* === [重構] Navbar 導航欄樣式 === */
.user-bar {
    display: flex;
    justify-content: space-between; /* 關鍵：讓 Logo 靠左，按鈕靠右 */
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95); /* 稍微帶點透明感 */
    backdrop-filter: blur(10px); /* 毛玻璃特效 */
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); /* 更柔和的陰影 */
    height: 60px; /* 固定高度讓視覺更穩定 */
}

/* 左側品牌 */
.nav-brand {
    font-size: 19px; /*稍微加大一點點，增加份量感*/
    font-weight: 800; /* 特粗體 */
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px; /* 圖片跟字的間距拉開一點 */
    letter-spacing: -0.5px; /* 讓英文字母緊湊一點，比較好看 */
}

/* [新增] Logo 圖片樣式 */
.nav-logo {
    width: 32px;  /* 設定適合導航欄的大小 */
    height: 32px;
    border-radius: 8px; /* 讓圖片四個角稍微圓圓的，像 App icon */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* 加一點點陰影，讓它浮起來 */
    object-fit: cover;
}

/* 右側純圖示按鈕 (取代原本的 auth-btn 文字按鈕) */
.icon-btn {
    background: transparent;
    border: none;
    padding: 8px;
    font-size: 18px;
    color: #555;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
    transform: scale(1.1);
}

/* 頭像樣式 */
.nav-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-left: 5px;
}

/* 手機版隱藏 "登入同步" 文字，只留 Google Icon，節省空間 */
@media (max-width: 360px) {
    .mobile-hide {
        display: none;
    }
}

.auth-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.google-btn {
    background: #DB4437;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

#userInfo {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 隱藏工具 */
.hidden { display: none !important; }

:root {
    --bg: #F0F2F5;
    --card: #FFFFFF;
    --primary: #4A90E2;
    --text: #2c3e50;
    --text-sub: #7f8c8d;
    --green: #27ae60;
    --red: #e74c3c;
    --update-banner-bg: #4a403a;
    
    /* 運具顏色 */
    --c-mrt: #0070BD;
    --c-bus: #2ECC71;
    --c-coach: #16A085;
    --c-tra: #2C3E50;
    --c-tymrt: #8E44AD;
    --c-lrt: #F39C12;
    --c-bike: #D35400;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg); color: var(--text); padding-bottom: 90px; }
.app-container { max-width: 480px; margin: 0 auto; min-height: 100vh; }

/* [已移除舊版 Dashboard 樣式 - 改用 .dashboard-simple] */

/* [已移除舊版身分切換器樣式 - 改用新版 .identity-selector] */

/* [已移除舊版週期設定樣式 - 改用設定頁面 Modal] */

/* [已移除舊版週期標籤選擇器樣式 - 改用新版 .cycle-pill 與設定 Modal] */

/* 週期列表樣式（移除，不再需要） */

/* [已移除舊版價格明細卡片樣式 - 改用新版 .price-section] */

/* 列表區樣式 (與上版相同，微調內容排版) */
.history-section { padding: 20px 15px; }
.section-header { display: flex; justify-content: space-between; margin-bottom: 15px; }
.text-btn { background: none; border: none; color: var(--text-sub); font-size: 14px; cursor: pointer; }
.history-list { list-style: none; }

/* [已移除日期分隔線重複定義 - 在下方有重新定義] */

.history-item { background: var(--card); padding: 12px 15px; border-radius: 12px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.03); }
.item-left { display: flex; align-items: center; gap: 12px; width: 70%; } /* 限制寬度讓文字省略 */
.t-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 16px; flex-shrink: 0; }
.item-info { flex: 1; min-width: 0; } /* Flex child min-width fix */
.item-info h4 { font-size: 15px; color: var(--text); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-info small { font-size: 12px; color: var(--text-sub); display: block; }
.item-right { text-align: right; }
.price-display { font-weight: bold; font-size: 15px; }
.price-original { font-size: 11px; text-decoration: line-through; color: #aaa; margin-right: 4px; }

/* 運具顏色 */
.c-mrt { background-color: var(--c-mrt); color: white; }
.c-bus { background-color: var(--c-bus); color: white; }
.c-coach { background-color: var(--c-coach); color: white; }
.c-tra { background-color: var(--c-tra); color: white; }
.c-tymrt { background-color: var(--c-tymrt); color: white; }
.c-lrt { background-color: var(--c-lrt); color: white; }
.c-bike { background-color: var(--c-bike); color: white; }

/* Form 樣式新增 */
.hidden { display: none !important; }
.station-inputs { display: flex; align-items: center; gap: 8px; }
.station-inputs input { flex: 1; padding: 12px !important; text-align: center; min-width: 0; }
.station-arrow { color: var(--text-sub); font-size: 14px; }

/* 日期時間輸入並排 */
.datetime-inputs { display: flex; align-items: center; gap: 10px; }
.datetime-inputs input { flex: 1; padding: 12px; border: 1px solid #ddd; border-radius: 10px; font-size: 16px; }

/* 網格選擇器 */
.transport-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.t-option input { display: none; }
.t-box { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 5px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; opacity: 0.5; transition: 0.2s; filter: grayscale(0.8); }
.t-box i { font-size: 20px; margin-bottom: 5px; }
.t-box small { font-size: 11px; font-weight: bold; }
.t-option input:checked + .t-box { opacity: 1; filter: grayscale(0); border-color: #333; transform: scale(1.05); }

/* Modal 與按鈕 (與上版相同) */
.fab-container {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none; /* 讓容器本身可穿透 */
    z-index: 2000; /* [新增] 確保層級比 Sticky Header (1000) 和清單都高 */
}
.fab {
    pointer-events: auto; /* 按鈕本體要能點 */
    background: var(--text);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
    position: relative; /* [新增] 為了讓偽元素定位 */
}
/* [新增] 擴大點擊熱區 (Hotspot) - 關鍵修正 */
.fab::after {
    content: '';
    position: absolute;
    top: -15px;    /* 往上擴大 15px */
    bottom: -15px; /* 往下擴大 15px */
    left: -15px;   /* 往左擴大 15px */
    right: -15px;  /* 往右擴大 15px */
    background: transparent; /* 透明 */
    border-radius: 60px; /* 跟隨按鈕圓角 */
    z-index: -1; /* 放在按鈕後面 */
}
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 3000; /* [修改] 原本是 100，改為 3000，確保比 FAB (2000) 還高 */
    display: flex;
    align-items: flex-end;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
}
.modal.hidden { visibility: hidden; opacity: 0; pointer-events: none; }
.modal:not(.hidden) { visibility: visible; opacity: 1; pointer-events: auto; }
.modal-content { background: var(--card); width: 100%; max-width: 480px; margin: 0 auto; border-radius: 24px 24px 0 0; padding: 25px; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
.modal:not(.hidden) .modal-content { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
.close-btn { background: none; border: none; font-size: 24px; cursor: pointer; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.form-group input[type="number"], .form-group input[type="text"] { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 10px; font-size: 16px; }
.checkbox-group { display: flex; align-items: center; gap: 10px; }
.checkbox-group input { width: 20px; height: 20px; }
.submit-btn { width: 100%; padding: 16px; background: var(--primary); color: white; border: none; border-radius: 12px; font-size: 16px; font-weight: bold; cursor: pointer; }

/* === 規則頁面 (rules.html) 專用樣式 === */

.page-header {
    background: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.back-btn {
    text-decoration: none;
    color: var(--primary);
    font-weight: bold;
    font-size: 14px;
}

.page-header h2 {
    font-size: 18px;
    flex: 1;
    text-align: center;
    margin-right: 30px; /* 平衡返回按鈕的寬度 */
}

.rules-content {
    padding: 20px 15px;
}

.rule-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.rule-card h3 {
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.rule-desc {
    font-size: 13px;
    color: var(--text-sub);
    margin-bottom: 15px;
    line-height: 1.5;
}

/* 轉乘視覺化 */
.transfer-visual {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.t-pair {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.t-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}
.t-badge.mrt { background: var(--c-mrt); }
.t-badge.bus { background: var(--c-bus); }
.t-badge.express { background: #E67E22; } /* 幹線橘色系 */

.t-pair i { color: var(--text-sub); font-size: 12px; }

/* 卡片內的次級展開容器 */
.sub-category {
    border: none;
    background: transparent;
    margin-top: 15px;
}

.sub-category summary {
    padding: 10px 0;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 14px;
    color: var(--text);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.sub-category summary::-webkit-details-marker { display: none; }

.sub-category .arrow {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 12px;
}

.sub-category[open] .arrow {
    transform: rotate(180deg);
}

.sub-category[open] summary {
    color: var(--primary);
}

.category-content {
    padding: 10px 0;
}

/* 公車折疊主容器 */
.main-category {
    border: none;
    background: transparent;
    margin-bottom: 10px;
}

.main-category summary {
    padding: 0;
    cursor: pointer;
    list-style: none; /* 移除預設三角形 */
    transition: all 0.2s;
}

.main-category summary::-webkit-details-marker { display: none; }

.main-category summary h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.main-category .arrow {
    margin-left: auto;
    transition: transform 0.3s;
    font-size: 14px;
}

.main-category[open] .arrow {
    transform: rotate(180deg);
}

.main-category[open] summary h3 {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.category-content {
    background: var(--card);
    border-radius: 0 0 12px 12px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

/* 幹線公車手風琴 */
.bus-category {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.bus-category summary {
    padding: 12px 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none; /* 移除預設三角形 */
    transition: background 0.2s;
}

.bus-category summary::-webkit-details-marker { display: none; }

.bus-category .arrow {
    transition: transform 0.3s;
    font-size: 12px;
}

.bus-category[open] .arrow {
    transform: rotate(180deg);
}

/* 顏色定義 */
.category-blue summary { color: #2980b9; background: #ebf5fb; }
.category-blue i.fa-circle { color: #2980b9; }

.category-green summary { color: #27ae60; background: #eafaf1; }
.category-green i.fa-circle { color: #27ae60; }

.category-yellow summary { color: #d35400; background: #fef5e7; }
.category-yellow i.fa-circle { color: #f1c40f; }

.category-gray summary { color: #555; background: #f4f4f4; }

/* 展開內容 */
.bus-list {
    padding: 10px 15px;
    background: white;
    border-top: 1px solid #eee;
}

.bus-item {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    font-size: 14px;
    color: #333;
}
.bus-item:last-child { border-bottom: none; }
.bus-item b { margin-right: 5px; }
.bus-item small { color: #888; margin-left: 5px; display: block; font-size: 12px; margin-top: 2px; }

.bus-tags {
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: white;
}

.bus-tags span {
    background: #f1f2f6;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

/* 回饋率表格 */
.rate-table {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
}

.rate-table h4 {
    margin-bottom: 10px;
    font-size: 14px;
    border-bottom: 2px solid #e1e1e1;
    padding-bottom: 5px;
}

.rate-table h4 small { font-weight: normal; color: #888; font-size: 11px; }

.rate-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}
.rate-row:last-child { border-bottom: none; }

.rate-val { font-weight: bold; color: var(--primary); }

.highlight-table .rate-val { color: var(--green); }

/* === 日期分隔線 (補上原本缺漏的) === */
.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 25px 0 15px 0;
    color: var(--text-sub);
    font-size: 13px;
    font-weight: bold;
    opacity: 0.8;
}

.date-separator::before,
.date-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e0e0e0;
    margin: 0 15px;
}

.history-list > .date-separator:first-child {
    margin-top: 0;
}

/* 設定頁面的身分選擇器 */
.identity-selector input[type="radio"] {
    display: none;
}
.radio-box {
    flex: 1;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    font-weight: bold;
    color: #555;
}
.identity-selector input:checked + .radio-box {
    border-color: var(--primary);
    background: #eaf2fa;
    color: var(--primary);
}

/* [已移除舊版 .period-selector-container - 功能已被 .cycle-selector-wrapper 取代] */

/* [已移除舊版 .cycle-manage-list 重複定義 - 在下方有新版本] */

/* [新增] 列表項目可點擊樣式 */
.history-item {
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.history-item:active {
    transform: scale(0.98);
    background-color: #f8f9fa;
}

/* [新增] 筆記欄位樣式 */
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #f8faff;
}

/* =========================================
   iOS 安裝引導視窗 - 毛玻璃風格專用樣式
========================================= */

/* 1. 外層容器：負責置中與背景變暗 */
#ios-guide.modal {
    /* 確保使用 Flexbox 進行絕對置中 */
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* 背景遮罩顏色，稍微調淡一點，讓背後的模糊感透出來 */
    background: rgba(0, 0, 0, 0.4) !important;
    
    /* 確保層級最高 */
    z-index: 9999;
}

/* 2. 內容視窗：核心毛玻璃效果 */
#ios-guide .modal-content {
    /* 關鍵：半透明的白色背景 */
    background: rgba(255, 255, 255, 0.8) !important;
    
    /* 關鍵：背景模糊濾鏡 (數值越大越糊) */
    backdrop-filter: blur(20px) saturate(180%);
    /* 針對 Safari (iOS) 的必要兼容寫法 */
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    /* 增加質感細節：細邊框與柔和陰影 */
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    /* 確保文字顏色夠深 */
    color: #1d1d1f;
    
    /* 強制圓角與內距 (覆蓋原本可能寫在 HTML 上的 style) */
    border-radius: 24px !important;
    padding: 35px 30px !important;
    max-width: 90%; /* 避免在小手機太寬 */
    width: 400px;   /* 設定一個合適的最大寬度 */
}

/* 微調內部步驟區塊的背景，讓它融入毛玻璃 */
#ios-guide .guide-steps-box {
    text-align: left;
    background: rgba(0, 0, 0, 0.06) !important; /* 淡淡的深色半透明 */
    padding: 20px;
    border-radius: 16px;
    font-size: 15px;
    margin: 25px 0;
}

/* 微調按鈕樣式，讓它看起來更像 iOS 原生按鈕 */
#ios-guide .guide-btn {
    background: #007AFF !important; /* iOS 標準藍 */
    font-size: 17px;
    font-weight: 600;
    padding: 12px 0;
    width: 100%;
    border-radius: 14px;
}

/* === [新增] 明細折疊區塊樣式 === */

.price-section {
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.price-section:last-of-type {
    border-bottom: none;
}

.price-section summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    list-style: none; /* 隱藏預設三角形 */
    transition: opacity 0.2s;
}

.price-section summary::-webkit-details-marker {
    display: none;
}

/* 自定義箭頭 */
.price-section summary::after {
    content: '\f107'; /* FontAwesome Down Arrow */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 12px;
    margin-left: 8px;
    transition: transform 0.3s;
    opacity: 0.6;
    order: 2; /* 讓箭頭排在最後面(如果需要) */
}

/* 展開時箭頭旋轉 */
.price-section[open] summary::after {
    transform: rotate(180deg);
}

/* 為了讓金額靠右，箭頭跟隨文字，我們微調 summary */
.price-section summary {
    position: relative;
}
.price-section summary span:last-child {
    margin-left: auto; /* 金額推到最右 */
    margin-right: 5px;
    font-weight: bold;
}

/* 折疊內容區 */
.price-details {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-row span:nth-child(2) {
    font-family: monospace; /* 數字對齊 */
    font-size: 13px;
}

/* [新增] 優惠明細中的月份標籤 */
.month-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-right: 6px;
    font-weight: normal;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* === [修正] iOS 輸入框自動放大問題  === */
input, 
select, 
textarea {
    font-size: 16px !important; /* 強制設定 16px，這是 iOS 不縮放的臨界值 */
    max-height: 100%; /* 防止因為字體變大而撐壞版型 */
}

/* 針對日期選單特別處理，避免被撐開 */
input[type="date"],
input[type="time"] {
    min-height: 44px; /* 確保手指好點擊 */
}

/* === [修改] 車站選擇區塊 (瘦身版) === */

/* 移除原本的卡片背景與大內距，改回乾淨的佈局 */
.station-row {
    margin-bottom: 5px; /* 每個輸入框之間只留一點點縫隙 */
    position: relative;
}

/* 隱藏原本佔空間的「起點/終點」小標題 */
/* 因為輸入框裡的 placeholder 已經夠清楚了 */
/* [已移除 .station-label-small - 已設為 display:none 可直接移除] */

/* 讓捷運的雙層選單保持並排，但不需要額外裝飾 */
.mrt-selector-group {
    display: flex;
    gap: 5px; /* 選單之間的間距縮小 */
}

/* 調整下拉選單樣式，讓它跟文字框高度一致 */
.line-select, .station-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    height: 40px; /* 固定高度 */
}

/* 路線選單稍微窄一點 (約 40%) */
.line-select {
    flex: 0.8; 
}

/* 車站選單寬一點 (約 60%) */
.station-select {
    flex: 1.2;
}

/* 一般文字輸入框 (台鐵/客運用) */
.station-text-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    height: 40px; /* 固定高度，跟上面一樣 */
}

/* 中間的箭頭縮小間距 */
#group-stations .fa-arrow-down {
    font-size: 12px;
    margin: 2px 0;
    opacity: 0.5;
}

/* === [重構] 簡約版 Dashboard 樣式 === */

.dashboard-simple {
    background: linear-gradient(135deg, #faf9f8 0%, #f9f4f0 50%, #f6eee7 100%);
    padding: 24px 20px 32px 20px;
    border-radius: 0 0 24px 24px;
    color: #2c3e50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.dashboard-simple::before {
    content: '';
    position: absolute;
    inset: -50% -5% auto 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(210, 100, 60, 0.12), transparent 70%);
    filter: blur(30px);
    z-index: 0;
}

.dashboard-simple::after {
    display: none;
}

/* 1. 週期選擇器樣式 */
.cycle-selector-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
    position: relative;
    z-index: 2;
}

.cycle-pill {
    background: #fff;
    border: 1px solid #e8e3dd;
    padding: 8px 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.2s;
    color: #2c3e50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.cycle-pill:active {
    transform: scale(0.98);
    background: #f5f0eb;
}

.cycle-dropdown {
    background: transparent;
    border: none;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
}

.cycle-dropdown option {
    background: #faf9f8;
    color: #2c3e50;
}

/* 2. 核心比對區 (Hero Section) */
.hero-comparison {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    padding: 0 6px;
    gap: 12px;
}

.hero-item {
    text-align: center;
    flex: 1;
}

.hero-item small {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 6px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.hero-number {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    color: #c45a3f;
    text-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.hero-number-static {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

.hero-vs {
    font-weight: 800;
    font-size: 18px;
    color: #7f8c8d;
    background: #fff;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* 3. 回本狀態區 */
.status-container {
    text-align: center;
    margin-bottom: 18px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 12px;
    background: #ffffff;
    color: #2c3e50;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    border: none;
}

.status-subtext {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 600;
}

/* 狀態顏色變數 */
.status-win { color: #27ae60 !important; }
.status-loss { color: #e74c3c !important; }
.status-neutral { color: #7f8c8d !important; }

/* 4. 導引按鈕 */
.dashboard-actions {
    text-align: center;
}

.action-link {
    background: #d97761;
    border: 1px solid #d97761;
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 6px 16px rgba(217, 119, 97, 0.18);
}

.action-link:hover {
    transform: translateY(-2px);
    background: #cf6d54;
}

.action-link i {
    margin-left: 6px;
    font-size: 11px;
}

/* === [新增] 次級文字連結樣式 === */
.sub-action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: #7f8c8d;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #e8e3dd;
}

.sub-action-link:hover {
    color: #d97761;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #d97761;
}

/* === Dashboard 標題樣式 (新增) === */
.app-title-simple {
    text-align: center;
    margin-bottom: 15px; /* 與下方週期選擇器的距離 */
}

.app-title-simple h2 {
    margin: 0;
    font-size: 22px; /* 標題大小 */
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05); /* 輕微陰影增加立體感 */
}

.app-title-simple small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #7f8c8d; /* 改用secondary text color */
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 微調週期選擇器，讓它跟標題不要太擠 */
.cycle-selector-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 25px; /* 保持與下方數字的距離 */
    position: relative;
    z-index: 2;
}

/* === [補回] 設定頁面 - 週期管理列表樣式 === */
.cycle-manage-list {
    list-style: none; /* 移除預設黑點 */
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 150px; /* 超過高度可捲動 */
    overflow-y: auto;
    background: #f9f9f9;
    padding: 0;
    margin: 5px 0 0 0;
}

.cycle-manage-item {
    display: flex;
    justify-content: space-between; /* 讓日期靠左、垃圾桶靠右 */
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    background: #fff;
    font-size: 15px;
    color: #333;
}

.cycle-manage-item:last-child {
    border-bottom: none; /* 最後一項不要底線 */
}

/* 垃圾桶按鈕 */
.btn-delete-cycle {
    background: none;
    border: none;
    color: #ff7675; /* 淺紅色 */
    cursor: pointer;
    padding: 8px;
    font-size: 14px;
    transition: all 0.2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-cycle:hover {
    color: #d63031; /* 深紅色 */
    background: rgba(255, 0, 0, 0.05); /* 淡淡的紅色背景 */
}

/* === 更新提示橫幅 === */
.update-banner {
    display: none;
    position: fixed;
    bottom: max(30px, env(safe-area-inset-bottom) + 30px);
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 450px;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background-color: var(--update-banner-bg);
    color: white;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    z-index: 10000;
}

.update-banner-btn {
    background: #2ecc71;
    border: none;
    color: white;
    padding: 10px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    white-space: nowrap;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}