* { box-sizing: border-box; }

:root { --primary: #007bff; --success: #28a745; --dark: #212529; --light: #f8f9fa; }

/* 1. 強力鎖定外層，禁止任何溢出捲動 */
html, body {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f0f2f5;
}

/* 2. 主容器：使用 Flex 垂直撐開 100% 高度 */
#app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

/* 3. 獨立捲動區：內容在這裡動，底部選單絕對不會動 */
.container {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* 讓 iOS 捲動變滑順 */
    padding: 15px;
    box-sizing: border-box;
    overscroll-behavior-y: contain; /* 防止捲動邊界觸發背景晃動 */
}

.content-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 30px;
}

.card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    width: 100%;
}

/* 4. 底部選單：位於 Flex 容器底部，不隨內容跑 */
.navbar {
    flex-shrink: 0;
    width: 100%;
    height: 70px;
    background-color: #ffffff;
    box-shadow: 0 -3px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom); /* iOS 安全區 */
    z-index: 9999;
    position: relative;
}

.nav-arrow {
    width: 30px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: white;
    z-index: 10;
    opacity: 0.5;
}

.nav-links {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0 5px;
    align-items: center;
    scroll-behavior: smooth;
}
.nav-links.disabled {
    pointer-events: none;
    opacity: 0.5;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 10px;
    background-color: #f2f4f6;
    flex-shrink: 0;
}
.nav-links a.active {
    color: #fff;
    background-color: var(--primary);
}

/* 基礎元件樣式 */
h1 { font-size: 24px; margin-top: 0; color: var(--dark); }
h2 { font-size: 18px; margin-bottom: 15px; }
p { color: #666; font-size: 15px; }
.btn { display: block; width: 100%; text-align: center; padding: 12px; background-color: var(--primary); color: white; text-decoration: none; border-radius: 8px; font-weight: 600; box-sizing: border-box; border: none; }
.footer { text-align: center; padding: 20px 0; color: #999; font-size: 12px; }

/* 表格樣式 */
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th { text-align: left; padding: 12px 10px; background: #fafafa; color: #888; font-size: 13px; border-bottom: 1px solid #f0f0f0; }
td { padding: 15px 10px; border-bottom: 1px solid #f5f5f5; font-size: 14px; }

/* 個人資料列表樣式 */
.feature-list { list-style: none; padding: 0; margin: 20px 0; }
.feature-item { margin-bottom: 20px; background: #fdfdfd; padding: 15px; border-radius: 8px; border-left: 4px solid var(--primary); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.feature-text b { display: inline-block; margin-bottom: 4px; color: var(--dark); }
