/* UCC2026 Color Override
   裝載幸福的冒險：我的城市逃跑計畫 集點活動
   Color Palette: UCC 紅 / 奶油白 / 金色緞帶 / 黑底徽章（取自活動 KV）
   v2 — 2026/07 全站重新設計
----------------------------------------------------------------------- */

:root {
    --ucc-red:       #D9251C;
    --ucc-red-deep:  #A31810;
    --ucc-maroon:    #6E1208;
    --ucc-cream:     #FBF1DC;
    --ucc-cream-2:   #FFFDF6;
    --ucc-gold:      #E3B23C;
    --ucc-gold-deep: #B8860B;
    --ucc-black:     #201a16;
    --ucc-text:      #3D1400;
    --ind-1: 28px;

    /* 2026/08/04：「指定商品」三個次標頭改成各自獨立漸層（不是三個共用同一組），
       色相跟主標題正紅（--ucc-red）錯開，改用橘色系，三階從亮橘到深橘各自區分 */
    --ucc-product-orange-1:      #F0923D;
    --ucc-product-orange-1-deep: #C15F12;
    --ucc-product-orange-2:      #E37A1E;
    --ucc-product-orange-2-deep: #A84E0C;
    --ucc-product-orange-3:      #C15F12;
    --ucc-product-orange-3-deep: #7A3505;
}

/* ===== Body Background（咖啡豆灑點紋理） =====
   2026/07/31：原本 body 與 #main 是同一色（--ucc-cream-2），內容區塊完全融入背景看不出邊界。
   body 改用較深的 --ucc-cream，#main 維持 --ucc-cream-2 並加卡片感（圓角＋陰影），
   讓活動內容區與頁面背景明顯區隔開來。 */
body {
    background-color: var(--ucc-cream);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='%23D9251C' fill-opacity='0.05'%3E%3Cellipse cx='20' cy='30' rx='9' ry='6' transform='rotate(30 20 30)'/%3E%3Cellipse cx='90' cy='80' rx='9' ry='6' transform='rotate(-20 90 80)'/%3E%3Cellipse cx='60' cy='10' rx='7' ry='5' transform='rotate(60 60 10)'/%3E%3Cellipse cx='100' cy='20' rx='7' ry='5' transform='rotate(10 100 20)'/%3E%3Cellipse cx='30' cy='95' rx='7' ry='5' transform='rotate(-40 30 95)'/%3E%3C/g%3E%3C/svg%3E");
}
/* 2026/08/07：receipt.jsp 發票示意圖在 iPhone Safari／Chrome（皆為 WKWebView）連續兩輪
   針對特定 flex 容器（.row > .inv_type*_block、.spotlight > .content）補 min-width:0
   的修法都回報「還是一樣」——這個沙盒環境用的是 Chromium，沒辦法真的重現 WebKit 的
   算圖結果，等於是盲測，連續兩次盲猜都沒中。與其再猜第三個可能的 flex 容器，
   改用不需要抓到確切元凶的做法：直接不讓整個頁面在 X 方向捲動。這個頁面除了兩個
   刻意做成可左右滑動的表格（各自有自己 overflow-x:auto 的容器）以外，沒有任何地方
   應該需要頁面層級的水平捲動，所以這條規則風險很低。 */
html, body { overflow-x: hidden; }

/* ===== Utility Colors ===== */
.t_pink  { color: var(--ucc-red) !important; font-weight: normal; }
.t_o     { color: #d4860a; font-weight: normal; }
.t_y     { color: var(--ucc-gold-deep) !important; }
.t_r     { color: var(--ucc-red-deep); font-weight: normal; }
.t_b     { color: var(--ucc-text) !important; }

/* ===== 主標題（10 個主段落／各頁 header.major h2）=====
   紅色漸層藥丸章，index.html 用 <h2 class="lv2"> 直接套用，
   其他頁沿用既有 header.major.special > h2 結構，同一套外觀 */
h2.lv2,
header.major.special h2,
header.major h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--ucc-red) 0%, var(--ucc-red-deep) 100%);
    color: #fff !important;
    font-size: 1.6em;
    /* main.css 有一條全站 h1~h6 重設 `line-height: 0.5em`，我們這裡從沒蓋過它。單行標題看
       不出問題（反正只有一行），但字數多到要換行時（例如手機版「中獎公佈及兌獎說明」那條），
       0.5em 的行高比字高還矮，第二三行會直接疊在第一行上面——這才是真正的「擠成重疊」成因，
       不是膠囊不夠大。 */
    line-height: 1.35;
    font-weight: 500;
    padding: 14px 28px;
    border-radius: 40px;
    margin: 40px 0 24px 0;
    box-shadow: 0 3px 8px rgba(163,24,16,0.35);
}
header.major.special h2:after,
header.major h2:after { display: none !important; }
h2.lv2 .icon {
    width: 34px; height: 34px;
    background: var(--ucc-gold);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1em;
    flex-shrink: 0;
}
/* 2026/08/04：主標題小圖示改成從自家 KV 主視覺裁切出來的咖啡豆形狀
   （kv_1920x680.jpg 左下角「買UCC全系列商品…」文字旁的金色豆子圖案，
   用色彩距離門檻去背＋柔化邊緣萃取成 images/icon-bean-kv.png，形狀比通用圖示庫更貼近品牌自己的美術風格）。
   用 CSS mask 上色而非直接放圖，之後要換色只要改這裡的 background-color。 */
h2.lv2 .icon::before {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    background-color: var(--ucc-maroon);
    /* 拆成完整寫法而非 mask 簡寫，部分瀏覽器對 mask 簡寫的 position/size 語法解析不穩定，
       拆開來每個屬性各自宣告比較保險 */
    -webkit-mask-image: url("../images/icon-bean-kv.png");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-image: url("../images/icon-bean-kv.png");
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

/* ===== 次標題（原「■」小節標籤，改為金邊淺底色塊）=====
   index.html 用 <h3 class="lv-sub">；其他頁沿用既有 h3 > span.item 結構 */
h3.lv-sub,
h3 .item, h2 .item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-left: 6px solid var(--ucc-gold);
    background: var(--ucc-cream);
    color: var(--ucc-text) !important;
    font-size: 1.2em;
    font-weight: 700;
    padding: 8px 18px 8px 14px;
    border-radius: 0 8px 8px 0;
    margin: 32px var(--ind-1) 14px var(--ind-1);
    background-image: none !important;
}
h3.lv-sub { margin-left: var(--ind-1); margin-right: var(--ind-1); max-width: calc(100% - var(--ind-1) * 2); }

/* ===== 內文縮排（index.html 用）===== */
.c1, .c2 { margin-left: var(--ind-1); margin-right: var(--ind-1); }
p.body-text { line-height: 1.9; margin-top: 0; margin-bottom: 12px; color: var(--ucc-text); }

/* ===== ※ 提示文字（2026/07/31 依客戶要求取消框線對話框，改小字＋酒紅色） ===== */
.note-callout {
    display: block;
    padding: 0;
    margin-top: 4px;
    margin-bottom: 16px;
    font-size: 0.8em;
    line-height: 1.7;
    color: var(--ucc-maroon);
}
.note-callout.c1, .note-callout.c2 { margin-left: calc(var(--ind-1) + 12px); margin-right: 24px; }

/* ===== 條列清單（法規條款，index.html 用） ===== */
/* padding-left 要留夠兩位數編號（10.、20.）的寬度——1.3em 只夠放個位數，兩位數的
   「1」會被外層 .notice-scroll 的 overflow 裁掉，畫面上看起來像「10.」變成「0.」。
   注意事項＋個資法相關說明合併成同一份清單後最多會到 20，所以必須抓夠。 */
.rule-list { padding-left: 1.8em; }
.rule-list li { margin-bottom: 10px; line-height: 1.8; }
.rule-list li::marker { color: var(--ucc-red); font-weight: normal; }
/* 註冊/登入帳號頁：客戶要求比一般 .rule-list 更寬鬆的行距與項目間距，加條分隔線提高易讀性 */
.login-rule-list li { margin-bottom: 20px; line-height: 2; padding-bottom: 16px; border-bottom: 1px dashed rgba(180, 128, 31, 0.35); }
.login-rule-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
/* main.css 有一條 `.main ul { margin: 0 0 2em 25px; }`，class+element 的優先度比單純
   `.sub-list` 這個 class 選擇器高，會整條蓋掉下面這條規則（多出 2em 的底部間距，就是
   「多一行空間」的真正原因）。加上 #main 前綴把優先度墊高，才能真的蓋過去。 */
#main .sub-list {
    /* 只留 top margin，不留 bottom margin——父層 <li> 本身（.rule-list li）已有
       margin-bottom，兩個 margin 疊加會讓巢狀清單結束後多出一整行空白。 */
    list-style: none;
    padding-left: 1.2em;
    margin: 0.4em 0 0;
}
.sub-list li { margin-bottom: 6px; line-height: 1.7; }
.sub-list li::before { content: "● "; color: var(--ucc-red); }

/* ===== 注意事項：固定高度內嵌式捲動區 ===== */
.notice-scroll {
    box-sizing: border-box;
    height: 360px;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 10px 0 30px;
    padding: 18px 0;
    border: 1px solid rgba(180, 128, 31, 0.45);
    border-radius: 6px;
    background: #fffaf0;
    box-shadow: inset 0 2px 8px rgba(61, 20, 0, 0.08);
    scrollbar-color: var(--ucc-gold) #f4ead6;
    -webkit-overflow-scrolling: touch;
}
.notice-scroll .c1 { margin-left: var(--ind-1); margin-right: var(--ind-1); }
.notice-scroll > :first-child { margin-top: 0; }
.notice-scroll > :last-child { margin-bottom: 0; }
.notice-scroll:focus-visible { outline: 3px solid rgba(180, 128, 31, 0.45); outline-offset: 3px; }

/* ===== 緞帶分隔線（index.html 章節之間） ===== */
.ribbon-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 50px 0 10px;
    color: var(--ucc-gold-deep);
    opacity: 0.7;
}
.ribbon-divider::before, .ribbon-divider::after {
    content: "";
    flex: 1;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--ucc-gold) 0 8px, transparent 8px 14px);
}

/* ===== 活動商品：系列/品名對照表（index.html 用） ===== */
table.product-table {
    width: calc(100% - var(--ind-1) * 2);
    border-collapse: collapse;
    margin: 10px var(--ind-1) 20px;
    font-size: 0.95em;
}
.product-table th {
    background: var(--ucc-red);
    color: #fff;
    padding: 8px 14px;
    text-align: left;
    font-weight: 500;
    font-size: 0.9em;
}
.product-table td {
    padding: 7px 14px;
    border-bottom: 1px solid #f0e4cf;
    vertical-align: top;
    color: var(--ucc-text);
    text-align: left;
}
.product-table td.series {
    background: var(--ucc-cream);
    font-weight: 500;
    vertical-align: middle;
    width: 32%;
    border-right: 1px solid #f0e4cf;
}

/* 正面列表雙欄（指定商品）：兩欄等寬，不用系列窄欄樣式；
   欄內小標題（如「即溶咖啡系列商品」）改用跟表頭一致的紅底白字，配色統一
   （這條要排在 .product-table td.series 後面，優先權相同時靠後者覆蓋前者） */
.product-table-2col td { width: 50%; }
.product-table-2col td.series {
    width: auto;
    color: #fff;
    font-weight: 500;
    border-right: none;
}

/* 2026/08/04：即飲／沖調／即溶三個次標頭改成各自獨立的橘色漸層（不再共用同一組），
   每個都自己左淺右深，三個彼此顏色也不同，同色系但跟主標題正紅明顯區隔 */
.product-table th.cat-1 { background: linear-gradient(135deg, var(--ucc-product-orange-1) 0%, var(--ucc-product-orange-1-deep) 100%); }
.product-table th.cat-2 { background: linear-gradient(135deg, var(--ucc-product-orange-2) 0%, var(--ucc-product-orange-2-deep) 100%); }
.product-table td.cat-3 { background: linear-gradient(135deg, var(--ucc-product-orange-3) 0%, var(--ucc-product-orange-3-deep) 100%); }

/* ===== 獎項清單（圖左文右，index.html 用） ===== */
.prize-row { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; margin-bottom: 30px; }
.prize-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: var(--ucc-cream);
    border: 2px solid var(--ucc-gold);
    border-radius: 14px;
    padding: 12px 18px;
}
.prize-card .circle-img {
    flex-shrink: 0;
    width: 150px; height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.prize-card .circle-img img {
    width: 100%; height: 100%; object-fit: cover;
    -webkit-mask-image:
        linear-gradient(to right,  transparent 0%, black 12%, black 88%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
    mask-image:
        linear-gradient(to right,  transparent 0%, black 12%, black 88%, transparent 100%),
        linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
    -webkit-mask-composite: intersect;
    mask-composite: intersect;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
/* 2026/07/31：原本 flex:1 讓文字區塊撐滿卡片剩餘寬度，圖+字整體偏左、右側大片留白。
   改成固定寬度，讓「圖片＋文字」整組在卡片內置中，左右平均 */
.prize-card .prize-info { flex: 0 1 460px; min-width: 0; line-height: 1.9; }
/* 2026/08/04：全站黑底膠囊統一為黑底白字（.ps-pill／.b_b 原本就是白字，
   這個是唯一還沒跟上的，原本是黑底金字/棕字） */
.prize-card .badge {
    display: inline-block;
    background: var(--ucc-black);
    color: #fff;
    padding: 3px 14px;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: 500;
    margin-bottom: 4px;
}
.prize-card .prize-title {
    display: block;
    background: none;
    margin: 0;
    padding: 0;
    color: var(--ucc-text) !important;
    font-size: 1em !important;
    font-weight: 500;
    line-height: 1.9;
}
.prize-title-prefix,
.prize-title-suffix { display: inline-block; white-space: nowrap; }

/* h2.lv2 是 display:flex，.icon 之外只能再有一個文字節點當第二個 flex item，
   不能像 .prize-title 那樣拆成兩個 span 各自當 flex item（會被排成並排欄位而非正常文字換行）。
   改成單一 .lv2-title 當唯一的文字 flex item，裡面用 .lv2-title-nowrap 包住不能被拆開的片語
   （例如「中獎公佈及兌獎說明」），這只是內層一般 inline span，不影響外層 flex-item 換行行為。 */
.lv2-title-nowrap { display: inline-block; white-space: nowrap; }
.prize-card .price { color: var(--ucc-red); font-weight: normal; font-size: 0.95em; margin: 0; line-height: 1.9; }

/* ===== Status Badge（q_receipt.html 發票審核狀態） ===== */
.b_b {
    background: var(--ucc-black);
    color: #fff;
    font-weight: 500;
    margin-right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
}

/* ===== Navigation ===== */
#nav {
    background: var(--ucc-black) !important;
    background-size: cover;
    color: #fff;
}
#nav ul li a:hover { color: var(--ucc-gold) !important; }
#nav ul li a.active {
    background-color: #ffffff !important;
    color: var(--ucc-black) !important;
    font-weight: 500;
    box-shadow: none;
    border: 3px solid #fff !important;
}
#nav.alt { background-color: var(--ucc-black) !important; }

/* Mobile Menu：三條線漢堡圖示，疊在 KV 圖右上角（不是圖片上方獨立一條黑色 bar） */
.navbar { display: none; }
.dropbtn {
    /* main.css 裡有殘留的舊版圖示按鈕設計（text-indent 把文字推到看不到的地方、
       背景改指向一張路徑寫錯的 images/menu.png），這裡要全部重設回來。 */
    background-image: none;
    text-indent: 0;
    overflow: visible;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.45);
    border-radius: 8px;
}
/* 三條線本體：span 自己是中間那條，::before／::after 是上下兩條 */
.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
    display: block;
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background-color: #fff;
}
.hamburger-icon { position: relative; }
.hamburger-icon::before,
.hamburger-icon::after { content: ""; position: absolute; left: 0; }
.hamburger-icon::before { top: -8px; }
.hamburger-icon::after { top: 8px; }

.dropdown-content { background-color: var(--ucc-black); }
.dropdown-content a:hover {
    background-color: var(--ucc-maroon);
    color: var(--ucc-gold) !important;
}

/* ===== Main Content Area ===== */
#main, #nav + #main {
    background-color: var(--ucc-cream-2);
    color: var(--ucc-text);
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(110,18,8,0.12);
    padding: 8px 32px;
}
/* main.css 有一條 `#nav + #main { padding-top: 0px; }`（相鄰兄弟選擇器，兩個 ID 疊加、優先度比
   單純 #main 高）。這條規則只有在 #main 緊接在 #nav 後面（沒有其他標籤包住）時才會生效——
   index.html 的 #main 直接接在 #nav 後面，會中招變成 padding-top:0；但 login.jsp／receipt.jsp／
   q_receipt.jsp／winners.jsp 的 #main 是包在 <form id="main_form"> 裡面，中間隔了一層，
   不算「緊鄰」，這條規則不生效，於是這幾頁保留了 ucc.css 自己設的 padding-top（4-8px）。
   同一份 CSS 在不同頁面因為 DOM 結構差一層 wrapper 就跑出不同的內距，正是客戶回報「各頁面
   白底比例不一致」的另一個成因。修法：改用 `#main, #nav + #main` 兩個選擇器同時宣告同一組
   padding，讓 `#nav + #main` 這個較高優先度的選擇器改成跟 `#main` 完全同值，兩種 DOM 結構
   下最終 padding 都一樣，不再看 #main 前面有沒有 wrapper。 */
/* main.css 有一條 `#main { margin-top: 5em; }`（80px），原本是給桌機版「導覽列下方留空間」用的。
   手機寬度（<=980px，跟漢堡選單同一個斷點）#header／#nav 都是 display:none，
   這 80px 就變成 KV 圖片下面一段沒有理由存在的死空白——這正是客戶回報「KV 下方接著
   下一區塊的空隙太大」的原因。改成 12px，跟 ULOS 參考站一樣資訊密度更緊湊。 */
@media screen and (max-width: 980px) {
    /* 2026/08/12：12px 被客戶回報「太緊密」，希望 KV 底部能露出一些白色空間，
       改成 24px（介於原本 80px 死空白跟修過頭的 12px 之間）。 */
    #main { margin-top: 24px; }
    /* h2.lv2 自己還帶 margin-top:40px，疊在剛剛修好的 #main margin-top 上面，
       KV 圖到第一個標題的實際間距其實是 12+40=52px，還是太大。
       只清掉「進入 #main 後第一個」標題的頂部間距，其他段落之間原本的 40px
       間距不動（那是刻意留給段落之間喘息空間，客戶沒有反應那裡有問題）。
       2026/08/12：login.jsp/receipt.jsp/q_receipt.jsp/winners.jsp 的第一個標題不是
       h2.lv2 本身，而是包在 <header class="major special"><h2> 裡面——這個選擇器
       原本沒有涵蓋到，導致這幾頁 #main 內部標題上方的空白比 index.html 大很多
       （h2 的 margin-top:40px 沒被歸零，也是客戶回報「各頁面白底比例不一致」的成因）。
       補上 header.major.special:first-child h2 這個組合，四頁跟 index.html 統一。 */
    .content > h2.lv2:first-child,
    .content > header.major.special:first-child h2 { margin-top: 0; }
}
@media screen and (max-width: 736px) {
    #main, #nav + #main { border-radius: 12px; padding: 4px 16px; }
}
@media screen and (max-width: 480px) {
    #main, #nav + #main { border-radius: 0; padding: 4px 4px; box-shadow: none; }
}
#main input, #main select, #main textarea { color: var(--ucc-text); }
#main a:hover { color: var(--ucc-text); }
/* 2026/08/04：main.css 的基礎主題把全站 <b>/<strong> 重設成 font-weight:400（等於沒加粗），
   這裡用 #main 的 ID 選擇器把權重蓋回來。影響所有頁面既有的 <b> 用法（約20處，
   q_receipt.jsp／receipt.jsp 皆有），不是只有 PPT 第12頁那兩處而已——這是全站性的問題。 */
#main strong, #main b { color: var(--ucc-text); font-weight: 700; }
#main h1, #main h2, #main h3, #main h4, #main h5, #main h6 { color: var(--ucc-text); }

/* ===== Primary Buttons ===== */
#main input[type="submit"].primary,
#main input[type="reset"].primary,
#main input[type="button"].primary,
#main button.primary,
#main .button.primary {
    background-color: var(--ucc-red) !important;
    color: #fff !important;
    border: none;
    box-shadow: none;
}
#main input[type="submit"].primary:hover,
#main input[type="reset"].primary:hover,
#main input[type="button"].primary:hover,
#main button.primary:hover,
#main .button.primary:hover {
    background-color: var(--ucc-red-deep) !important;
}

/* Normal buttons */
#main input[type="submit"],
#main input[type="reset"],
#main input[type="button"],
#main button,
#main .button {
    background-color: var(--ucc-black);
    box-shadow: inset 0 0 0 1px var(--ucc-gold);
    color: #fff !important;
}
#main input[type="submit"]:hover,
#main input[type="reset"]:hover,
#main input[type="button"]:hover,
#main button:hover,
#main .button:hover {
    background: var(--ucc-maroon) !important;
}

/* ===== receipt.jsp 發票示意圖：修正 iPhone Safari（含 LINE 內建瀏覽器，同樣是 WKWebView）
   圖片超出米色背景範圍的問題 =====
   .row 是 display:flex，裡面的 .inv_type1_block／.inv_type2_block 是 flex item，
   預設 min-width:auto 會用裡面 <img> 的原始寬度當作「不能再縮小」的下限——img 自己的
   max-width:100% 蓋不掉這個下限。WebKit（Safari／LINE 內建瀏覽器）對這條規則遵守得很嚴格，
   圖片跟著整個 flex item 一起被撐到超出容器；Chrome／Android 對這條規則比較寬鬆，所以
   客戶才會回報「安卓沒有這個情況」。明確設 min-width:0 拿掉這個下限就能解決。 */
.inv_type1_block, .inv_type2_block { min-width: 0; }
/* 上面那條只解掉第一層 flex（.row > .inv_type*_block）的 min-width:auto。但 main.css 的
   .spotlight 本身也是 display:flex（手機寬度下 flex-direction:column-reverse），
   而 .content（#info 的祖先）就是 .spotlight 的 flex item——同一個 min-width:auto 陷阱
   在這一層外層又會重演一次：只要 .content 沒有明確設 min-width:0，即使內層的
   .inv_type2_block 已經修好，.content 自己還是可能被裡面最寬的後代（540px 的示意圖）
   撐開到超出手機寬度，導致整個頁面出現水平捲動、圖片看起來從右邊「跑出去」。
   這正是為什麼「上傳了 CSS 但 iPhone/Chrome 還是一樣」——只補了內層沒補到外層。 */
.spotlight .content { min-width: 0; }

/* ===== Table（q_receipt / gift / ok 共用的紀錄表格） ===== */
#main .table-wrapper table thead tr {
    background-color: var(--ucc-red);
    color: #fff;
}
#main table th { color: #fff !important; }
#main .table-wrapper table tr:nth-child(even) td { background: var(--ucc-cream); }
/* main.css 的 table th 是 padding: 0 0.75em 0.75em 0.75em（上面完全沒 padding），
   瀏覽器 <th> 預設 vertical-align 又是 baseline 不是 middle，兩個疊在一起讓表頭文字
   看起來偏下、沒有置中。這裡統一改成對稱 padding + 明確垂直置中。 */
#main .table-wrapper table th {
    padding: 0.6em 0.75em;
    vertical-align: middle;
}
#main .table-wrapper table td { vertical-align: middle; }

/* ===== Upload button ===== */
.btn_upload {
    background: var(--ucc-red);
    color: #fff;
    padding: 5px 15px;
    border-radius: 8px;
    cursor: pointer;
}
/* 2026/08/11：Uppy 上傳中會把 <input> 暫時 disabled，畫面上原本沒有任何提示，
   使用者看不出按鈕是「還在處理」還是「壞了」。這裡只加狀態文字，不動上傳邏輯本身。 */
/* white-space:nowrap 讓「（已上傳完成）」這類短語整段一起換行，不會被硬拆成兩行 */
.upload-status { margin-left: 6px; font-size: 0.9em; font-weight: 600; white-space: nowrap; }
.upload-status.uploading { color: var(--ucc-gold-deep); }
.upload-status.upload-done { color: #2e7d32; }
.upload-status.upload-failed { color: var(--ucc-red); }

/* ===== Back to top ===== */
#backtotop { color: #FFFFFF; background-color: var(--ucc-black); }

/* ===== Fixed Login button ===== */
#btn_login { bottom: 120px; right: 13px; }

/* ===== Footer ===== */
#footer { background-color: var(--ucc-black); color: #c9a96e; }
#footer .copyright { color: #c9a96e; }

/* ===== Responsive - phone menu (breakpoint matches main.css: 980px) ===== */
@media screen and (max-width: 980px) {
    /* .navbar 在本檔案前面（315行）被無條件設成 display:none；main.css 的 .hide-in-menu
       雖然在 980px 內是 display:block，但因為 ucc.css 排在 main.css 之後載入、選擇器優先度
       相同，最後套用的是這個檔案的 display:none，導致整個手機選單列（含漢堡按鈕）在手機上完全
       不會出現。這裡必須明確覆寫回 display:block，兩條規則才不會打架。
       navbar 在 HTML 裡排在 KV 圖片 <img> 正前面、沒有任何外層包住兩者的容器，
       改成 position:fixed 後一開始就會疊在頁面最上方——正好就是 KV 圖片的右上角，
       不需要額外加包裝 div；用 fixed（不是 absolute）是為了讓選單按鈕固定在畫面右上角，
       捲動頁面時不會跟著跑掉。 */
    .navbar {
        display: block;
        position: fixed;
        top: 12px;
        right: 12px;
        width: auto;
        overflow: visible;
        background: transparent;
        z-index: 999;
    }
    .dropdown { position: relative; float: none; overflow: visible; }
    .dropdown .dropbtn {
        /* main.css 同樣有一條 .dropdown .dropbtn（兩個 class，優先度比 ucc.css 這裡單純
           .dropbtn 高），背景又指向那張路徑寫錯的 menu.png，這裡要用同樣兩個 class 的
           選擇器把背景蓋回半透明深底，選擇器優先度打平後由後載入的 ucc.css 勝出。 */
        position: relative; border: none; outline: none;
        margin: 0;
        background: rgba(0,0,0,0.45);
    }
    .dropdown button { box-shadow: inset 0 0 0 0; }
    .dropdown-content {
        display: none; position: absolute; top: calc(100% + 8px); right: 0;
        background-color: var(--ucc-black); min-width: 160px; width: max-content; max-width: 80vw;
        box-shadow: 0 8px 16px rgba(0,0,0,0.3); z-index: 9999; border-radius: 6px; overflow: hidden;
    }
    .dropdown-content a {
        float: none; color: #fff !important; padding: 12px 20px;
        text-decoration: none; display: block; text-align: left; border: 0;
        white-space: nowrap;
    }
    .dropdown-content a:hover { background: var(--ucc-maroon) !important; color: var(--ucc-gold) !important; }
    .dropdown:hover .dropdown-content { display: block; }
    /* 手機觸控沒有 hover 事件，:hover 開不了選單，改用 js/nav-menu.js 加的 .open class 點擊切換 */
    .dropdown.open .dropdown-content { display: block; }
    #btn_login { bottom: 80px; right: 5px; width: 120px; height: 78px; }
    #btn_login img { width: 65%; }
    #footer { padding: 0; width: 100%; }
    /* #info { padding:0 } 讓裡面的 .row/.col 內容（main.css 的 grid 系統預設是零 gutter，
       欄位之間、欄位跟容器邊緣完全沒有留白）直接貼齊螢幕邊緣——receipt.jsp 的發票類型
       說明文字（.t_ps）跟示意圖因此緊貼右邊界，字幾乎被切齊螢幕邊緣。補回左右 padding，
       並用 box-sizing:border-box 確保 padding 不會讓 #info 自己的寬度超出 100% 又造成新的溢出。 */
    #info { padding: 0 20px; width: 100%; box-sizing: border-box; }
    /* .t_ps（發票類型提示文字）本身是 CJK 換行段落，就算欄位有留白，換行後最後一個字
       還是會自然貼近欄位自己的右邊界（這是正常斷行行為，不是溢出）——額外加
       padding-right 讓文字視覺上跟欄位邊界之間也留一點呼吸空間，不要看起來像貼齊。 */
    .t_ps { padding-right: 10px; box-sizing: border-box; }

    /* receipt 的示意圖原始寬度為 540px。iOS WebKit 會把它沿著
       spotlight → content → #info → row 這串 flex item 的 min-content 寬度往外傳，
       單靠 img 的 max-width:100% 或頁面 overflow-x:hidden 都只能掩蓋、不能縮回元件。
       在手機版將整條鏈鎖在可用寬度，並取消發票區不需要的負 gutter，避免白底與說明文字再超出右邊界。 */
    #main_form .spotlight,
    #main_form .spotlight .content,
    #main_form #info,
    #main_form #info > .row,
    #main_form #info > .row > * {
        min-width: 0;
        max-width: 100%;
    }
    #main_form .spotlight .content,
    #main_form #info { box-sizing: border-box; }
    #main_form #info > .row {
        width: 100%;
        margin-left: 0;
    }
    #main_form #info > .row > * {
        padding-left: 0;
        padding-right: 0;
    }
    #main_form #info img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
    #main_form #info .t_ps { overflow-wrap: anywhere; }
    /* 統一編號提醒與欄位同寬；原本僅多出的 10px 右 padding 會讓最後兩字被擠到下一行。 */
    #main_form #info .t_r.t_ps {
        padding-right: 0;
        white-space: nowrap;
    }
    /* main.css 的 input 在手機版是 block + 100% 寬，需由同一個 flex 容器接住前綴斜線。 */
    #main_form #info .barcode-field {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
    }
    #main_form #info .barcode-field input {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        margin: 0;
    }
    #main_form #info .barcode-prefix { flex: 0 0 auto; }

    /* 示意圖可吃滿 #info 的左右內距，比一般說明文字寬 40px；
       仍在 #info 範圍內，所以不會重新造成頁面右側溢出。 */
    #main_form #info > .row > .invoice-example {
        flex: 0 0 calc(100% + 40px);
        width: calc(100% + 40px);
        max-width: calc(100% + 40px);
        margin-left: -20px;
    }

    h2.lv2, header.major.special h2, header.major h2 { font-size: 1.25em; padding: 12px 20px; }
    h3.lv-sub, h3 .item, h2 .item { margin-left: 0; margin-right: 0; max-width: 100%; font-size: 1.05em; }
    .c1, .c2 { margin-left: 0; margin-right: 0; }
    .note-callout.c1, .note-callout.c2 { margin-left: 0; margin-right: 0; }
    .notice-scroll { height: 320px; margin-left: 0; margin-right: 0; padding: 14px 0; }
    .notice-scroll .c1 { margin-left: 0; margin-right: 0; }
    table.product-table { width: 100%; margin-left: 0; margin-right: 0; }
    .prize-card { flex-direction: column; text-align: center; }
    .prize-card .prize-info { flex-basis: auto; width: 100%; }
}

/* ===== Fix: h3 line-height & spacing ===== */
h3 { line-height: 1.4em !important; margin-bottom: 0.8em !important; }
h4 { line-height: 1.4em !important; margin-top: 1em !important; margin-bottom: 0.5em !important; }
h3:has(.item) { line-height: 2.2em !important; margin-bottom: 0.6em !important; }

/* ===== Point status display（q_receipt.html / gift.html） ===== */
/* ===== 集點狀態摘要卡片（q_receipt.jsp，2026/08/04 依 PPT 第9-11頁改版）=====
   配色沿用現有紅／金／奶油色系（客戶確認過不採用參考稿的深綠配色，只學版面結構）。
   卡片外觀比照 .prize-card 同一套視覺語言，維持全站一致。 */
.point-status { margin: 1em 0 1.5em; }

.ps-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.ps-pill {
    background: var(--ucc-black);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}
.ps-pill b { color: #fff; font-weight: 700; }
#main .ps-pill,
#main .ps-pill b { color: #fff; }

.ps-card {
    background: var(--ucc-cream);
    border: 2px solid var(--ucc-gold);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.ps-card-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--ucc-maroon);
    margin-bottom: 12px;
}

.ps-stage-row { display: flex; gap: 14px; flex-wrap: wrap; }
.ps-stage-box {
    flex: 1 1 240px;
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
/* 2026/08/13：「第二重與加碼」原本共用一個橫跨全寬的 .ps-card-title，客戶要求改成
   跟「第一重」的兩個階段一樣，各自有自己的標題（📮 第二重｜集點抽獎 / 💳 加碼｜超集幸運抽）
   分別疊在自己的白色卡片正上方。新增 .ps-ticket-col 當「標題+卡片」的直向包裝容器，
   flex-basis 從 .ps-ticket-box 移到這裡；.ps-ticket-box 維持原本的白底卡片外觀，
   但改用 flex:1 撐滿容器高度即可，不用再自己管寬度。 */
.ps-ticket-col { flex: 1 1 240px; display: flex; flex-direction: column; }
.ps-ticket-col .ps-card-title { margin-bottom: 8px; }
.ps-ticket-box {
    flex: 1;
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.ps-stage-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.ps-stage-name { font-weight: 700; color: var(--ucc-text); }
.ps-status-pill {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
    flex-shrink: 0;
}

.ps-stage-dates { font-size: 0.85em; color: #888; margin-bottom: 6px; }
.ps-stage-points { margin-bottom: 4px; }
.ps-stage-rank { color: var(--ucc-red); font-weight: 500; }

.ps-ticket-name { font-weight: 500; margin-bottom: 8px; line-height: 1.5; }
/* 原本只認 .ps-ticket-chance 底下的 b.big，但左邊 box 把「累計點數」跟「共 X 次抽獎機會」
   合併成一行後不再有 .ps-ticket-chance 這層，導致左右兩個數字大小不一致。改成認整個
   .ps-ticket-box，兩邊不管在哪一層都套得到。 */
.ps-ticket-box b.big { font-size: 1.8em; color: var(--ucc-red); }

.ps-footnote { font-size: 0.8em; color: var(--ucc-maroon); margin: 10px 0 0; }

@media screen and (max-width: 736px) {
    .ps-stage-row { flex-direction: column; }
    /* .ps-stage-box／.ps-ticket-box 的 flex: 1 1 240px 是照橫排（row）寫的，240px 當時
       指的是寬度。手機版 .ps-stage-row 改成 flex-direction:column 後，同一個 240px
       在直排的 flex 容器裡變成「高度」下限——不管內容多短，每個卡片都被撐到至少 240px
       高，這就是查詢已登錄發票頁面手機版卡片下方一大塊空白的原因。改成 flex-basis:auto
       讓卡片高度回歸跟著內容走。 */
    .ps-stage-box, .ps-ticket-col { flex-basis: auto; }
}

/* ===== 兌換登記期間：階段狀態燈號（2026/08/03，PPT 修改內容第3頁） =====
   資料來源 api/stage-status.jsp，由 index.html 內的 <script> AJAX 填入。 */
.stage-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
}
.ps-status-pill.pending,
.stage-badge.state-not_open { background: #fff; color: var(--ucc-text); border: 1px solid #ccc; }
.ps-status-pill.active,
.ps-status-pill.done,
.stage-badge.state-green { background: #e4f6e9; color: #1e7d3c; border: 1px solid #1e7d3c; }
.stage-badge.state-yellow   { background: #fff6d9; color: #a67c00; border: 1px solid #d4a900; }

/* 2026/08/04：第一欄保持同行；登記期間只允許在第二個片段前換行。 */
.stage-table td:first-child .stage-badge { margin-left: 8px; margin-top: 0; }
.stage-table td:nth-child(5) .stage-badge {
    width: 11em;
    box-sizing: border-box;
    margin-left: 0;
    /* 2026/08/04：改左對齊而非置中——兩列文字長度不同（「剩餘18/50名」vs「尚未開放」），
       置中的話圓點符號位置會跟著文字長度跑，兩列對不齊。固定寬度＋靠左，圓點永遠在同一個 X 座標。 */
    text-align: left;
}
.stage-table th, .stage-table td { text-align: center; }
.stage-table th:first-child,
.stage-table td:first-child { white-space: nowrap; }
.stage-table .stage-name { white-space: nowrap; }
.stage-table .stage-period-start,
.stage-table .stage-period-end { display: inline-block; white-space: nowrap; }
.stage-table td:nth-child(3), .stage-table td:nth-child(4) { white-space: nowrap; }
@media screen and (max-width: 736px) {
    .stage-table { display: block; overflow-x: auto; }
}
.stage-badge.state-closed   { background: #e9e9e9; color: #555; border: 1px solid #aaa; }

/* 集點狀態摘要下方的注意事項，沿用 #info 的排版 */
#point-status-notes { font-size: 0.9em; }
/* main.css 有一條 `.main ul { margin: 0 0 2em 25px; }`，class+element 的優先度雖然
   比我們的 ID 選擇器低，但「輸給哪一條規則」是逐一屬性比的，我們原本沒設 margin，
   所以 main.css 那條 margin-left:25px 依然生效，讓 ul 整體比下面的兌換流程示意圖多縮排
   25px，兩者左邊界對不齊。這裡要明確蓋掉 margin，不能只設 padding。 */
#point-status-notes ul { margin: 0; padding-left: 1.2em; list-style: disc outside; }
#point-status-notes ul li { margin-bottom: 8px; }
/* 兌換流程示意圖標題／流程圖本身沒有跟上面項目符號清單同樣的左邊縮排，兩者對不齊，
   這裡補上跟 ul 一樣的 padding-left，讓左邊界對齊。（选擇器不能用 > 子選擇器，
   這個 <p> 實際上是 #point-status-notes 的孫層，不是直接子層，之前試過 > 沒生效。） */
#point-status-notes p.space_t20,
#point-status-notes .redeem-flow { padding-left: 1.2em; }

/* 兌換流程示意圖（q_receipt.jsp） */
.redeem-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    margin: 10px 0 20px;
}
.redeem-flow-step {
    flex: 1 1 140px;
    background: linear-gradient(135deg, #f6c453, #e8a33d);
    color: #3d1400;
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
}
.redeem-flow-title { font-weight: 700; }
.redeem-flow-desc { font-size: 0.85em; margin-top: 4px; }
.redeem-flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1.3em;
    color: var(--ucc-maroon);
}
@media screen and (max-width: 600px) {
    .redeem-flow { flex-direction: column; }
    .redeem-flow-step { flex: 1 1 auto; }
    .redeem-flow-arrow { transform: rotate(90deg); }
}

/* 發票登錄紀錄表格：內文置中對齊 */
#main .table-wrapper table td { text-align: center; }

