:root {
    --bg-global: #F8FAFC;
    --bg-Container: #FFFFFF;
    --border-color: #E2E8F0;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --brand-blue: #0062FF; 
    --brand-green: #10B981;
    --brand-red: #EF4444;
  /* 微弱陰影：用於小型卡片，看起來比較輕盈 */
  --shadow-sm: 0 0.5cqw 2cqw rgba(0, 0, 0, 0.08);
  /* 標準陰影：用於你的 .phone-wrapper，更有穩定感 */
  --shadow-md: 0 1cqw 4cqw rgba(0, 0, 0, 0.1);
  /* 進階層次：如果你之後要做浮動按鈕，可以用這個 */
  --shadow-lg: 0 2cqw 8cqw rgba(0, 0, 0, 0.15);
    --card-bg: #FFFFFF;
    --blur-bg: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
    --bg-global: #0A0A0A;
    --bg-Container: #111111;
    --border-color: #262626;
    --text-main: #F5F5F5;
    --text-muted: #A3A3A3;
    --brand-blue: #2F80ED; 
    --brand-green: #34D399;
    --brand-red: #F87171;
  /* 微弱陰影：用於小型卡片，看起來比較輕盈 */
  --shadow-sm: 0 0.5cqw 2cqw rgba(0, 0, 0, 0.08);
  /* 標準陰影：用於你的 .phone-wrapper，更有穩定感 */
  --shadow-md: 0 1cqw 4cqw rgba(0, 0, 0, 0.1);
  /* 進階層次：如果你之後要做浮動按鈕，可以用這個 */
  --shadow-lg: 0 2cqw 8cqw rgba(0, 0, 0, 0.15);
    --card-bg: #1C1C1E;
    --blur-bg: rgba(17, 17, 17, 0.95);
}

* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

}

html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-global);   
    display: flex;
    justify-content: center; /* 水平置中 */
    overflow: hidden;    /* 隱藏超出視窗的內容，確保整體像紙張一樣 */
    line-height: 1; /* 讓行距跟著字體一起自動調整 */
    user-select: none;
    cursor: default;
}

input, textarea {
    border: 1cqw solid var(--border-color);
    border-radius: 10cqw;
    background-color: var(--bg-global);
    color: var(--text-main);
    line-height:1;
    box-sizing: border-box;
    max-width: 100%;
    object-fit: contain;
    user-select: text;
    cursor: text;
    background-color: #f0f0f0; /* 你原本的灰色 */
    transition: background-color 0.3s ease; /* 讓顏色變換有平滑的過場效果 */
}

.input-style:not(:placeholder-shown) {
    background-color: #ffffff; /* 已輸入時變回白色 */
}

img, .card {
    max-width: 100%;      /* 圖片寬度填滿容器 */
    max-height: 100%;     /* 圖片高度填滿容器 */
    object-fit: contain; /* 關鍵：確保完整顯示，不裁切，短邊留空 */
    background-color: transparent;
}

/* ==========================================================================
   3. 核心佈局架構 (Layout)
   ========================================================================== */
/* 手機外框 - 加強置中穩定性 */
.phone-wrapper {
    -webkit-overflow-scrolling: touch; /* 【加在這裡】讓滑動變順暢 */
    height: 100vh;           /* 高度撐滿視窗 */
    height: 100dvh;
    aspect-ratio: 9 / 16;    /* 強制維持 9:16 比例 */
    max-width: 100vw;        /* 不超過螢幕寬度 */
    max-width: 100dvw;
    background-color: var(--bg-Container);
    display: flex;
    flex-direction: column;  /* 垂直排列 */
    justify-content: space-between;
    border: 0.2cqw solid var(--border-color);
    border-radius: 3cqw;
    box-shadow: var(--shadow-md);
    padding: 1cqw;
    Container-type: size; /* 讓這個容器成為所有內部元素的參考點 */
    Container-name: phone;
    margin: 0 auto;
    cursor: default; 
} 

#buyerView,
#adminView {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;  /* 垂直排列 */
    height: 100%;
    width: 100%;
    background-color: var(--bg-Container);
}

/* 表單容器相關 */
#adminView > div,
#adminView .form-Container,
#adminView form {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* 並排欄位 */
#adminView .row,
#adminView .flex-row {
    display: flex;
    gap: 1cqw;
}

.header {
    height: 16%;
    max-width: 100%;
    display: flex;
    flex-direction: column; 
    justify-content: space-between;  
    align-items: stretch;
    box-sizing: border-box;
}

.pace-logo {
    height: 65%;
    max-width: 100%;
    display: flex;
    flex-direction: row; 
    justify-content: space-between; 
    align-items: center;   
    box-sizing: border-box;
}

.logo-link {
    height: 100%;
    max-width: 70%;
    display: flex;
    flex-direction: row; 
    justify-content: flex-start; 
    align-items: flex-end;
    box-sizing: border-box;
}

.avatar-icon {
    font-size: 14cqw;
    height: 70%; 
    max-width: 30%;    
    display: flex;
    flex-direction: row; 
    justify-content: flex-end; 
    align-items: flex-end;
}

.two {
    height: 35%;
    max-width: 100%;
    display: flex;
    flex-direction: row; 
    justify-content: space-between; 
    align-items: flex-end;  
    box-sizing: border-box;
    position: relative;
}

.pace {
    height: 100%;
    max-width: 70%;
    font-size: 5.125cqw;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1; /* 讓行距跟著字體一起自動調整 */
    display: flex;
    flex-direction: row; 
    justify-content: flex-start; 
    align-items: center;
    box-sizing: border-box;
    gap:0.5cqw;
    white-space: nowrap;
}

.theme-toggle {
    font-size: 4cqw;
    padding: 1cqw;
    background: var(--card-bg);
    border: 0.2cqw solid var(--border-color);
    border-radius: 50%;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center; 
    box-sizing: border-box;
}

.login-btn {
    height: 90%;
    max-width: 25%;
    font-size: 4cqw;
    font-weight: 500;
    background-color: var(--brand-blue);
    color: #FFFFFF;
    border: 0.2cqw solid var(--border-color);
    padding: 2cqw 4cqw;
    border-radius: 10cqw;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center; 
    box-sizing: border-box;
    line-height: 1;   /* 讓行距跟著字體一起自動調整 */
    white-space: nowrap;
}

.user-avatar-btn {
    height: 100%;             
    max-width: 30%;             /* 💡 建議先註解掉，或確保它夠寬，膠囊按鈕放了圖文需要寬度 */
    min-width: fit-content;     /* 💡 新增：確保按鈕至少能完整塞下內文 */
    padding: 0 1.5cqw;            /* 調整內襯，讓膠囊兩側有舒服的留白 */
    background-color: var(--card-bg); 
    border: 0.2cqw solid var(--border-color);
    border-radius: 10cqw;       
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: center; 
    align-items: center; 
}

.user-name {
    /* height: 100%; */          /* 移除它，讓內容自然靠 flex 置中即可 */
    /* max-width: 30%; */       /* ❌ 刪除這行！就是它把字跟圖片擠扁的 */
    font-size: 6cqw;
    font-weight: 600;
    display: flex; 
    flex-direction: row; 
    justify-content: center;
    align-items: center; 
    gap: 0.25cqw;                /* 💡 新增：圖片/皇冠和文字之間的小間距 */
    white-space: nowrap;        /* 💡 關鍵：死都不准換行，強迫橫排 */
    color: var(--text-main);
}

/* 💡 新增：限制買家圖片的尺寸，不然圖片會原始大小爆開 */
.user-name .buyer {
    height: 7cqw;               /* 讓高度跟字體大小（4cqw）差不多高或稍微大一點 */
    width: auto;
    object-fit: contain;
    display: inline-block;
}

/* 1. 選單本體的外觀與定位 */
.dropdown-menu {
    display: none;             /* 預設隱藏，點擊時用 JS 切換顯示 */
    position: absolute;
    top: 100%;                 /* 緊貼在頭像/名字按鈕下方 */
    right: 0;
    height: 90cqw;
    width: 70cqw;
    left: auto;
    background-color: #ffffff; /* 白色背景 */
    border: 0.2cqw solid #e0e0e0; /* 淡淡的灰色外框 */
    border-radius: 10cqw;        /* 圓角看起來比較現代 */
    padding: 2cqw 4cqw;            /* 上下留點空格 */
    box-shadow: 0 1cqw 4cqw rgba(0,0,0,0.9); /* 漂浮陰影效果 */
    z-index: 100;             /* 確保一定在最上層 */
}

/* 2. 控制選單內每一行 <a> 超連結的排版（解決擠扁換行問題） */
.dropdown-menu .nav-fast {
    display: block;            /* 核心：讓每一個選項各佔獨立的一整行 */
    padding: 2cqw 2cqw;        /* 讓手機或滑鼠比較好點擊的範圍 */
    color: #333333;            /* 文字顏色 */
    text-decoration: none;     /* 移除超連結下底線 */
    font-size: 5cqw;
    white-space: nowrap;       /* 核心：強制一行字絕對不換行 */
    text-align: left;          /* 文字靠左對齊 */
}

/* 當滑鼠移過去選項時，產生灰色高亮反白效果 */
.dropdown-menu .nav-fast:hover {
    background-color: #f5f5f5;
}

/* 3. 分隔線樣式（就是你 JS 裡的 .menu-divider） */
.dropdown-menu .menu-divider {
    height: 0.2cqw;
    background-color: #eeeeee;
    margin: 0.5cqw 1cqw;             /* 上下留點距離 */
}

/* 4. 特殊調整：JS 裡面最後一行的「登出按鈕」 */
#logoutBtn {
    width: 100%;    /* 覆蓋你寫在行內的 60%，點擊範圍比較大 */
    display: block;
    text-align: left;
    padding: 0.5cqw 1cqw;  /* 跟上面的超連結對齊 */
    font-size: 5cqw;  /* 讓字體大小跟其他選項一致 */
}
#logoutBtn:hover {
    background-color: #fff0f0; /* 登出按鈕移過去時顯示淡淡的紅色 */
}

/* ==========================================================================
   9. 燈箱模態框與通用組件 (Modals & Utilities)
   ========================================================================== */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(1cqw);
    -webkit-backdrop-filter: blur(1cqw);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1cqw;
}

.modal-card {
    color: var(--text-main);
    background-color: var(--bg-Container);
    border: 0.2cqw solid var(--border-color);
    border-radius: 5cqw;
    max-width: 100%;
    padding: 3cqw;
    box-shadow: var(--shadow-md);
    text-align: center;
    height: 60cqw;
    width: 80cqw;
}

.modal-title {
    font-size: 5cqw;;
    font-weight: 700;
    margin-bottom: 5cqw;
}

.modal-desc-address {
    font-size: 5cqw;
    color: var(--text-main);
    line-height: 1;
    word-break: break-all;
    background-color: var(--bg-global);
    padding: 1cqw;
    border-radius: 2cqw;
    border: 0.2cqw solid var(--border-color);
    text-align: left;
}

.modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1cqw;
    width: 100%;
    padding: 3cqw 0;
    border-radius: 3cqw;
    font-size: 5cqw;
    font-weight: 600;
    margin-bottom: 5cqw;
    cursor: pointer;
    border: 0.2cqw solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
}

.modal-btn.google {
    background-color: #FFFFFF;
    color: #374151;
    border-color: #E2E8F0;
}

