/* 2026-10 register_new 手機版
   全站原本沒有 <meta name="viewport">，版面寬度又寫死(#pagebody 1200px、#ac_box 1072px、
   資訊表格 830px、register.css 裡一堆 400~740px 的欄位)，手機上只會整頁縮到看不清楚或被切掉。
   只有 layout/header_register.php 在 register_new 模組時才載入這份檔案、加 viewport、
   在 body 加上 .rn-mobile，舊版 /register/ 跟其他頁面完全不受影響。
   規則全部包在 max-width:767px 裡，桌機版畫面不變。
   寫死的寬度太多、散在 register.css/common.css/各 step 頁的 <style> 裡，不逐條改，
   改用「所有元素最多跟父層一樣寬」+ 主要容器改流動寬度 + 兩欄改直排 的通用做法 */
@media (max-width:767px){
	html, body{ min-width:0 !important; overflow-x:hidden; }
	.rn-mobile #wrapper *{ max-width:100%; box-sizing:border-box; }
	.rn-mobile #wrapper img{ height:auto; }

	/* 主要容器：寫死的 px 寬度改成跟著螢幕 */
	.rn-mobile #wrapper,
	.rn-mobile #box_step.container,
	.rn-mobile #pagebody.container,
	.rn-mobile #footer.container,
	.rn-mobile #box_center,
	.rn-mobile #ac_box,
	.rn-mobile #box_bulletin,
	.rn-mobile .register,
	.rn-mobile .right{
		width:auto !important;
		min-width:0 !important;
		float:none !important;
		display:block;
	}
	.rn-mobile #box_step.container,
	.rn-mobile #pagebody.container{ padding-left:10px !important; padding-right:10px !important; margin-left:0; margin-right:0; }
	.rn-mobile #footer.container{ margin-left:10px !important; margin-right:10px !important; }
	.rn-mobile #box_center{ padding:14px !important; }
	.rn-mobile aside{ display:none; }

	/* 步驟條：760px 的橫條改成 4 等分，只留圖示，文字縮小 */
	.rn-mobile .step-bar-card{ padding:14px 8px 10px !important; }
	.rn-mobile .step-bar{ width:100% !important; }
	.rn-mobile .step-bar li{ min-width:0; flex:1 1 0; }
	.rn-mobile .step-bar .step-label, .rn-mobile .step-bar li span:last-child{ font-size:11px; line-height:1.3; white-space:normal; }

	/* 標題 + 回報名首頁按鈕 */
	.rn-mobile #my_title{ flex-wrap:wrap; }
	.rn-mobile #my_title h3{ font-size:20px; flex:1 1 100%; }

	/* step_1 活動圖片 + 報名資訊：左右兩欄改上下 */
	.rn-mobile .bulletin_img,
	.rn-mobile .bulletin_information{
		float:none !important;
		width:100% !important;
		margin:0 0 12px 0 !important;
	}
	.rn-mobile .bulletin_img{ text-align:center; }
	.rn-mobile .bulletin_img img{ width:100%; max-width:260px; }
	.rn-mobile .info-table .info-label{ width:76px; white-space:nowrap; }
	.rn-mobile .bulletin_btn{ padding:0; }

	/* 內文(後台編輯器內容)表格：欄位很多的表格塞不下，讓表格本身可以左右捲動，不撐破版面 */
	.rn-mobile .edtor{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
	.rn-mobile .edtor table{ width:100% !important; height:auto !important; }
	/* 欄寬保留 HTML 設定(例如活動資訊左邊標題欄 width="80")，不然中文標題欄會被擠成一個字寬直排；
	   text-align:justify 在窄欄位會把字距撐開(「台 灣 自 行 車」)，手機上改靠左 */
	.rn-mobile .edtor td, .rn-mobile .edtor th{ height:auto !important; }
	.rn-mobile .edtor [style*="justify"]{ text-align:left !important; }
	.rn-mobile .edtor iframe, .rn-mobile .edtor video{ max-width:100%; }
	/* 表格內有指定寬度的圖片：上限用 vw（% 會讓欄位被壓扁），高度自動保持比例；表格仍太寬時由 .edtor 橫向捲動 (2026-11) */
	.rn-mobile #wrapper .edtor td img[style*="width"]{ max-width:10vw; height:auto !important; }

	/* 報名表單：label + 欄位的兩欄表格改上下排，輸入框撐滿 */
	.rn-mobile #wrapper input[type=text],
	.rn-mobile #wrapper input[type=tel],
	.rn-mobile #wrapper input[type=email],
	.rn-mobile #wrapper input[type=password],
	.rn-mobile #wrapper input[type=number],
	.rn-mobile #wrapper select,
	.rn-mobile #wrapper textarea{ max-width:100%; font-size:16px; }
	.rn-mobile #wrapper table{ table-layout:auto; }

	/* 團體報名 (2026-11)：團長資料表、團員列表標題列、團員/團長的報名內容原本都是寫死欄寬的多欄表格，
	   手機上「聯絡電話」等欄位被擠出畫面、團員資料超出右邊被切掉。改成上下排列 */
	.rn-mobile #wrapper fieldset{ min-width:0; }	/* fieldset 預設 min-width:min-content，裡面內容寬就撐破父層 */
	.rn-mobile .team_register > table, .rn-mobile .team_register > table > tbody, .rn-mobile .team_register > table > tbody > tr{ display:block; width:auto !important; }
	.rn-mobile .team_register > table > tbody > tr > td{ display:block; width:auto !important; padding:2px 0 !important; }
	.rn-mobile .team_register > table > tbody > tr > td:nth-child(odd){ padding-top:10px !important; font-weight:700; }
	.rn-mobile .team_register > table > tbody > tr > td:empty{ display:none; }
	/* 團員列表標題列：姓名/手機/生日/金額同一行，Email 另起一行 */
	.rn-mobile .member_data table, .rn-mobile .member_data tbody{ display:block; width:100%; }
	.rn-mobile .member_data tr{ display:flex; flex-wrap:wrap; align-items:center; gap:2px 10px; }
	.rn-mobile .member_data td{ display:block; width:auto !important; padding:0 !important; text-align:left !important; }
	.rn-mobile .member_data td.member_email{ flex:1 1 100%; order:5; word-break:break-all; }
	.rn-mobile .member_data td.member_cash{ margin-left:auto; }
	/* 團員展開內容 / 團長本人加購 / 新增團員區：標籤一行、欄位一行 */
	.rn-mobile .purchase_content, .rn-mobile #profile_purchase, .rn-mobile #add__purchase{ padding:12px 10px !important; }
	.rn-mobile .purchase_content > table, .rn-mobile .purchase_content > table > tbody, .rn-mobile .purchase_content > table > tbody > tr, .rn-mobile .purchase_content > table > tbody > tr > td,
	.rn-mobile #profile_purchase > table, .rn-mobile #profile_purchase > table > tbody, .rn-mobile #profile_purchase > table > tbody > tr, .rn-mobile #profile_purchase > table > tbody > tr > td,
	.rn-mobile #add__purchase > table, .rn-mobile #add__purchase > table > tbody, .rn-mobile #add__purchase > table > tbody > tr, .rn-mobile #add__purchase > table > tbody > tr > td{ display:block; width:auto !important; }
	.rn-mobile .purchase_content > table > tbody > tr[style*="none"], .rn-mobile #profile_purchase > table > tbody > tr[style*="none"], .rn-mobile #add__purchase > table > tbody > tr[style*="none"]{ display:none; }
	.rn-mobile .purchase_content > table > tbody > tr > td:first-child, .rn-mobile #profile_purchase > table > tbody > tr > td:first-child, .rn-mobile #add__purchase > table > tbody > tr > td:first-child{ font-weight:700; padding:8px 0 2px !important; }
	/* 贈品「名稱＋下拉」整組換行，不要從名稱中間斷開 */
	.rn-mobile .gift_item{ display:inline-block; white-space:nowrap; margin:2px 10px 2px 0; }
	/* 尺寸表：標籤在上，表格太寬時表格本身左右捲動 */
	.rn-mobile fieldset.clear > div{ float:none !important; }
	.rn-mobile fieldset.clear > div:last-child{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
	.rn-mobile #team_member li .size_sheet td, .rn-mobile .size_sheet td, .rn-mobile .size_sheet th{ padding:4px 6px !important; }
}
