/* PiMe 拍遇 官網與返圖網頁：品牌「晨光」＋元件「沖印店（X）」
 * 色碼、圓角、陰影取自 brand/tokens.ts（THEME、RADIUS、SHADOW、FILM_SWATCHES），字型取自 brand/typography.ts。
 * 不另外定義新的顏色或字型；要改先改 brand/，並經過確認。
 * 晨光桃（--brand）只用在三件事：Logo 的點、「新的」記號（含上傳進度）、光。一個區塊最多一團柔光，只放在主角後面。
 * 主要按鈕是墨色實心、圓角 10；不要膠囊、不要彩色陰影、不要底片顆粒。
 */

/* ---------- 字型 ---------- */

/* 中文大標題：源泉圓體子集（scripts/subset-heading-font.py 掃描 site/ 產生；文案改了要重跑） */
@font-face {
	font-family: "GenSenRounded2 TW";
	font-weight: 500;
	font-style: normal;
	font-display: swap;
	src: url("assets/fonts/gensen-rounded-500.woff2") format("woff2");
}

@font-face {
	font-family: "GenSenRounded2 TW";
	font-weight: 700;
	font-style: normal;
	font-display: swap;
	src: url("assets/fonts/gensen-rounded-700.woff2") format("woff2");
}

/* ---------- token ---------- */

/* 亮色：暖白底、葡萄墨字（THEME.light）。<head> 的腳本會依使用者選擇或系統設定加上 data-theme */
:root {
	color-scheme: light;
	--bg: #fff9f3;
	--surface: #ffffff;
	--raised: #ffffff;
	--border: #f0e4d8;
	--input-border: #8f8394;
	--text: #2b2433;
	--text-muted: #74687a;
	--text-disabled: #b9adbc;
	--brand: #ff8f70; /* 晨光桃：Logo 的點、「新的」、光。亮底只有 2.13:1，不可當文字 */
	--accent: #b9472f; /* 強調字（5.02:1） */
	--primary: #2b2433;
	--on-primary: #fff9f3;
	--primary-pressed: #36333f;
	--fresh: #ff8f70;
	--on-fresh: #2b2433;
	--stamp: #2b2433;
	--stamp-accent: #b9472f;
	--focus: #b9472f;
	--glow: rgba(255, 143, 112, 0.22);
	--scrim: rgba(27, 26, 34, 0.4);
	--success: #1a7a50;
	--warning: #a66300;
	--error: #c21e5c;
	--shadow-low: 0 1px 2px rgba(43, 36, 51, 0.08);
	--shadow-mid: 0 6px 18px rgba(43, 36, 51, 0.08);
	--shadow-high: 0 12px 32px rgba(43, 36, 51, 0.12);
	/* 沖好的相片與 QR 的相紙：亮色用純白表面，深色用暖白，QR 在兩種模式都是淺底深點 */
	--paper: #ffffff;
	--paper-ink: #2b2433;
	--perf: #dccfcb; /* 齒孔虛線：亮色 NEUTRAL 300、深色 NEUTRAL 700 */
	--logo-text: #2b2433;
	--logo-dot: #ff8f70;
	--logo-divider: #dccfcb;
	--logo-glow: 0.2475;

	--flash: #ffffff; /* 純白只給閃光瞬間（FLASH_COLOR） */
	--radius-stamp: 3px;
	--radius-photo: 6px;
	--radius-control: 10px;
	--radius-sheet: 24px;
	--font: "Plus Jakarta Sans", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
	--heading: "GenSenRounded2 TW", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
	--gutter: clamp(16px, 5vw, 48px);
	--nav-h: 64px;
	--ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
	--ease-in: cubic-bezier(0.55, 0, 0.85, 0.35);
}

/* 深色：茄紫黑底（THEME.dark）；越上層越亮，不靠陰影分層 */
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #1b1a22;
	--surface: #25232e;
	--raised: #36333f;
	--border: #36333f;
	--input-border: #6e6578;
	--text: #fbf3ec;
	--text-muted: #a99fb1;
	--text-disabled: #6e6578;
	--accent: #ffab92;
	--primary: #fbf3ec;
	--on-primary: #1b1a22;
	--primary-pressed: #dccfcb;
	--stamp: #fbf3ec;
	--stamp-accent: #ffab92;
	--focus: #ffab92;
	--glow: rgba(255, 143, 112, 0.16);
	--scrim: rgba(27, 26, 34, 0.6);
	--success: #5bd39a;
	--warning: #ffc266;
	--error: #ff7aa8;
	--shadow-low: none;
	--shadow-mid: 0 6px 18px rgba(0, 0, 0, 0.28);
	--shadow-high: 0 12px 32px rgba(0, 0, 0, 0.4);
	--paper: #fbf3ec;
	--perf: #6e6578;
	--logo-text: #fbf3ec;
	--logo-divider: #6e6578;
	--logo-glow: 0.2475;
}

/* 底片色調 [亮, 暗]（brand/tokens.ts FILM_SWATCHES）：照片佔位與頭像 */
.s0 { --ph-l: #8c7a92; --ph-d: #3b3240; }
.s1 { --ph-l: #a08b6e; --ph-d: #3e3528; }
.s2 { --ph-l: #6f8c97; --ph-d: #26353b; }
.s3 { --ph-l: #a57c77; --ph-d: #3d2b29; }
.s4 { --ph-l: #7c9278; --ph-d: #2c3729; }
.s5 { --ph-l: #908ca8; --ph-d: #33313f; }
.s6 { --ph-l: #a9937d; --ph-d: #41372d; }
.s7 { --ph-l: #7a84a3; --ph-d: #2a2f3e; }

/* ---------- 基本 ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: var(--nav-h);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

h1,
h2,
h3,
p,
ul,
figure {
	margin: 0;
}

h1,
h2,
h3,
.pain-q {
	text-wrap: balance;
}

ul {
	padding: 0;
	list-style: none;
}

a {
	color: inherit;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 4px;
}

em {
	font-style: normal;
	color: var(--accent);
}

:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
}

.sprite {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.icon {
	width: 1.25em;
	height: 1.25em;
	flex-shrink: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.container {
	width: min(100% - 2 * var(--gutter), 1200px);
	margin-inline: auto;
}

.muted {
	color: var(--text-muted);
}

/* 數字：Plus Jakarta Sans 的等寬數字（不用等寬字型） */
.mono,
.num {
	font-family: var(--font);
	font-variant-numeric: tabular-nums;
}

.small {
	font-size: 13px;
}

/* 一個子句不拆開，只在逗號後換行 */
.clause {
	display: inline-block;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.section {
	padding-block: clamp(96px, 14vw, 180px);
}

/* 中文大標題 */
.hero h1,
.pain-q,
.pain-answer,
.feature h3,
.safety-h,
.meet-text,
.rp-title,
.rp-title-sm {
	font-family: var(--heading);
	font-weight: 700;
}

/* 柔光：一個區塊最多一團，只放在主角後面 */
.glow {
	position: absolute;
	z-index: 0;
	border-radius: 50%;
	background: radial-gradient(circle, var(--glow), transparent 62%);
	pointer-events: none;
}

/* ---------- 按鈕 ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 52px;
	padding: 0 24px;
	border: 1.5px solid transparent;
	border-radius: var(--radius-control);
	font: 700 16px/1 var(--font);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s, border-color 0.2s, transform 0.2s var(--ease-out);
}

.btn:active {
	transform: scale(0.98);
}

/* 主要按鈕：墨色實心（深色反轉成暖白底） */
.btn-solid {
	background: var(--primary);
	color: var(--on-primary);
}

.btn-solid:hover {
	background: var(--primary-pressed);
}

/* 次要按鈕：1.5px 字色細框 */
.btn-outline {
	height: 40px;
	padding: 0 16px;
	border-color: var(--text);
	color: var(--text);
	font-size: 14px;
}

.btn-outline:hover {
	background: var(--surface);
}

/* 印章標籤：沖印單上的印章 */
.stamp {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border: 1.5px solid var(--stamp);
	border-radius: var(--radius-stamp);
	color: var(--stamp);
	font: 600 13px/1.3 var(--font);
}

.stamp .icon {
	width: 16px;
	height: 16px;
}

/* ---------- 導覽列 ---------- */

.nav {
	position: sticky;
	top: 0;
	z-index: 50;
	height: var(--nav-h);
	border-bottom: 1px solid transparent;
	transition: background-color 0.25s, border-color 0.25s;
}

.nav.is-scrolled {
	background: var(--bg);
	border-color: var(--border);
}

.nav-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	gap: 16px;
}

.brand {
	display: flex;
	color: var(--logo-text);
}

.logo-lockup {
	display: block;
	height: 22px;
	width: auto;
	aspect-ratio: 4584.7 / 839;
}

.nav-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.theme-toggle {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-control);
	background: transparent;
	color: var(--text);
	cursor: pointer;
	transition: background-color 0.2s;
}

.theme-toggle:hover {
	background: var(--surface);
}

.theme-toggle .icon {
	width: 18px;
	height: 18px;
}

:root:not([data-theme="dark"]) .icon-moon,
:root[data-theme="dark"] .icon-sun {
	display: none;
}

/* ---------- 照片佔位與頭像 ---------- */

/* 底片色調的放射漸層，右上角疊一點晨光桃的淡光；不放「圖片」小圖示 */
.ph {
	position: relative;
	display: block;
	overflow: hidden;
	background: radial-gradient(ellipse at 30% 25%, var(--ph-l, #8c7a92) 0%, var(--ph-d, #3b3240) 85%);
	border-radius: 2px;
}

.ph::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 85% 10%, rgba(255, 171, 146, 0.32), transparent 55%);
}

/* 頭像＝佔位色加暱稱第一個字（白字） */
.avatar {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	color: #ffffff;
	font: 700 18px/1 var(--font);
}

.avatar::after {
	content: none;
}

/* 沖好的相片：相紙白邊、圓角 6 */
.print {
	display: block;
	padding: clamp(6px, 1vw, 10px);
	border-radius: var(--radius-photo);
	background: var(--paper);
	box-shadow: var(--shadow-mid);
}

:root[data-theme="dark"] .print {
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.print .ph {
	aspect-ratio: 4 / 5;
}

/* 格數：01、02、03 */
.frame-no {
	display: block;
	margin-top: 6px;
	font: 600 11px/1 var(--font);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.06em;
	color: var(--text-muted);
}

/* ---------- 開場 ---------- */

.hero {
	position: relative;
	margin-top: calc(var(--nav-h) * -1);
	padding: calc(var(--nav-h) + 48px) 0 clamp(40px, 8vw, 104px);
	overflow: hidden;
}

.hero-grid {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 56px;
	align-items: center;
}

.eyebrow {
	font-size: 15px;
	font-weight: 500;
	color: var(--text-muted);
}

.hero h1 {
	margin-top: 16px;
	font-size: clamp(44px, 6.8vw, 96px);
	line-height: 1.2;
}

.hero h1 .line {
	display: block;
}

.tagline {
	margin-top: 20px;
	font-size: clamp(18px, 2vw, 22px);
	font-weight: 600;
	color: var(--text-muted);
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 24px;
	margin-top: 36px;
}

/* 掃不到 QR 時的入口：文字連結（底線 1.5、距離 4，同返圖網頁的文字按鈕） */
.hero-code {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--text);
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 4px;
}

/* 照片堆疊＋通知泡泡 */
.stack {
	position: relative;
	width: min(100%, 460px);
	aspect-ratio: 460 / 420;
	margin-inline: auto;
}

/* 開場唯一的一團光：放在照片後面 */
.stack::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 45%;
	width: 170%;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(circle, var(--glow), transparent 62%);
	pointer-events: none;
}

.stack .print {
	position: absolute;
	width: 52%;
}

.stack .back {
	left: 2%;
	top: 12%;
	transform: rotate(-4deg);
}

.stack .front {
	left: 40%;
	top: 0;
	transform: rotate(3deg);
}

.bubble {
	position: absolute;
	left: 10%;
	bottom: 2%;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 88%;
	padding: 12px 18px 12px 12px;
	border-radius: var(--radius-control);
	background: var(--raised);
	box-shadow: var(--shadow-high);
	line-height: 1.35;
}

:root[data-theme="dark"] .bubble {
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.bubble .avatar {
	width: 40px;
	height: 40px;
	font-size: 15px;
}

.bubble-text b {
	display: block;
	font-size: 15px;
	font-weight: 700;
}

.bubble-text small {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	color: var(--text-muted);
}

/* 晨光桃未讀點：「新的照片到了」 */
.fresh-dot {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 12px;
	height: 12px;
	border: 2px solid var(--raised);
	border-radius: 50%;
	background: var(--fresh);
	box-sizing: content-box;
}

@media (min-width: 960px) {
	.hero {
		min-height: 100svh;
		display: flex;
		align-items: center;
	}

	.hero-grid {
		grid-template-columns: 1.15fr 1fr;
		gap: clamp(48px, 6vw, 96px);
	}
}

/* ---------- 痛點 ---------- */

/* 不包卡片：上方一條細線分隔 */
.pain-grid {
	display: grid;
	gap: 48px;
}

.pain-item {
	padding-top: 28px;
	border-top: 1.5px solid var(--text);
}

.pain-q {
	margin-top: 24px;
	font-size: clamp(26px, 3.2vw, 42px);
	line-height: 1.3;
}

.pain-answer {
	margin-top: clamp(88px, 12vw, 144px);
	text-align: center;
	font-size: clamp(40px, 6vw, 80px);
	line-height: 1.2;
}

@media (min-width: 760px) {
	.pain-grid {
		grid-template-columns: 1fr 1fr;
		gap: clamp(32px, 5vw, 72px);
	}
}

/* ---------- 三個步驟 ---------- */

.features {
	padding-top: 0;
	overflow-x: clip;
}

.feature {
	display: grid;
	gap: 40px;
	align-items: center;
}

.feature + .feature {
	margin-top: clamp(96px, 12vw, 160px);
}

.feature-index {
	display: flex;
	align-items: center;
	gap: 14px;
	font: 800 16px/1 var(--font);
	font-variant-numeric: tabular-nums;
	color: var(--text);
}

.feature-index::after {
	content: "";
	width: 40px;
	height: 1.5px;
	background: var(--text);
}

.feature h3,
.safety-h {
	margin-top: 20px;
	font-size: clamp(34px, 4.4vw, 56px);
	line-height: 1.2;
}

.feature-desc {
	margin-top: 16px;
	max-width: 22em;
	font-size: 18px;
	color: var(--text-muted);
}

@media (min-width: 900px) {
	.feature {
		grid-template-columns: 5fr 6fr;
		gap: clamp(56px, 7vw, 112px);
	}

	.feature:nth-child(even) .feature-text {
		order: 2;
	}
}

/* 01 現場掃一下：QR 像一張沖好的相片 */
.step-visual {
	position: relative;
	width: min(100%, 420px);
	margin-inline: auto;
	font-size: 15px;
	line-height: 1.5;
}

.scan-card {
	position: relative;
	width: min(100%, 280px);
	margin-inline: auto;
	padding: 16px 16px 14px;
	border-radius: var(--radius-photo);
	background: var(--paper);
	box-shadow: var(--shadow-low), var(--shadow-mid);
	color: var(--paper-ink);
}

/* 三個步驟這一區唯一的一團光：QR 後面 */
.scan-card::before {
	content: "";
	position: absolute;
	inset: -45%;
	z-index: -1;
	border-radius: 50%;
	background: radial-gradient(circle, var(--glow), transparent 62%);
	pointer-events: none;
}

.qr {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	color: var(--paper-ink);
}

.qr svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.scan-cap {
	display: flex;
	justify-content: space-between;
	margin-top: 14px;
	font-size: 14px;
	font-weight: 600;
	color: #74687a;
}

.scan-cap b {
	color: var(--paper-ink);
	font-weight: 700;
}

.pair {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 36px;
}

.person {
	display: flex;
	align-items: center;
	gap: 12px;
}

.person .avatar {
	width: 44px;
	height: 44px;
	font-size: 16px;
}

.person-name {
	font-weight: 700;
}

.pair-line {
	flex: 1;
	height: 1.5px;
	min-width: 24px;
	background: var(--text);
	opacity: 0.25;
}

.details {
	display: grid;
	gap: 10px;
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid var(--border);
}

.details li {
	display: flex;
	align-items: center;
	gap: 12px;
}

.details .icon {
	color: var(--text-muted);
}

/* 02、03 相片袋 */
.slip {
	position: relative;
	width: min(100%, 440px);
	margin-inline: auto;
	padding: 20px 20px 20px;
	border-radius: var(--radius-photo);
	background: var(--surface);
	box-shadow: var(--shadow-low), var(--shadow-mid);
	font-size: 15px;
	line-height: 1.5;
}

:root[data-theme="dark"] .slip {
	box-shadow: none;
}

.slip-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}

.slip-name {
	font-size: 17px;
	font-weight: 700;
}

.slip-ev {
	margin-top: 2px;
	font-size: 13px;
	color: var(--text-muted);
}

.slip-count {
	flex-shrink: 0;
	display: flex;
	align-items: baseline;
	gap: 4px;
	font-size: 13px;
	color: var(--text-muted);
}

.slip-count b {
	font: 800 40px/1 var(--font);
	font-variant-numeric: tabular-nums;
	color: var(--text);
}

/* 齒孔虛線 */
.perf {
	margin: 18px -20px 16px;
	border-top: 1.5px dashed var(--perf);
}

.frames {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px 6px;
}

.frames .ph {
	aspect-ratio: 4 / 5;
}

.notify {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.notify .avatar {
	width: 44px;
	height: 44px;
	font-size: 16px;
}

/* 「新的」小標：晨光桃實心、圓角 3 */
.fresh-tag {
	position: absolute;
	top: -10px;
	left: 16px;
	padding: 4px 8px;
	border-radius: var(--radius-stamp);
	background: var(--fresh);
	color: var(--on-fresh);
	font: 700 12px/1 var(--font);
}

.slip.is-fresh {
	padding-top: 24px;
}

/* 示意用的主要按鈕：墨色實心，張數放右邊 */
.confirmed {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	height: 52px;
	margin-top: 20px;
	padding: 0 18px;
	border-radius: var(--radius-control);
	background: var(--primary);
	color: var(--on-primary);
	font-weight: 700;
}

.confirmed > span:first-child {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.confirmed .num {
	opacity: 0.6;
}

/* 04 只交照片：不包卡片，上方細線 */
.safety-grid {
	display: grid;
	gap: 40px;
	margin-top: clamp(40px, 6vw, 64px);
}

.rule-item {
	padding-top: 24px;
	border-top: 1.5px solid var(--text);
}

.safety-title {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
}

.safety-grid .feature-desc {
	margin-top: 8px;
	max-width: none;
	font-size: 16px;
}

@media (min-width: 960px) {
	.safety-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: clamp(32px, 4vw, 56px);
	}
}

.stores-note {
	margin-top: 40px;
	font-size: 15px;
	color: var(--text-muted);
}

.stores-note + .stores {
	margin-top: 16px;
}

/* ---------- 相遇 ---------- */

.meet {
	position: relative;
	padding-block: clamp(96px, 14vw, 180px);
	overflow: hidden;
	text-align: center;
}

.meet-stage {
	--w: clamp(120px, 26vw, 260px);
	position: relative;
	height: calc(var(--w) * 1.45 + 48px);
}

/* 相遇這一區唯一的一團光：兩張相片中間 */
.meet-stage::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: calc(var(--w) * 3.2);
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(circle, var(--glow), transparent 62%);
	pointer-events: none;
}

/* 兩張沖好的相片，下緣寫著身分 */
.meet-card {
	position: absolute;
	left: 50%;
	top: 50%;
	width: var(--w);
	margin: calc(var(--w) * -0.68) 0 0 calc(var(--w) / -2);
	padding: clamp(6px, 1vw, 10px) clamp(6px, 1vw, 10px) clamp(8px, 1.2vw, 14px);
	border-radius: var(--radius-photo);
	background: var(--paper);
	box-shadow: var(--shadow-mid);
	transition: transform 0.9s var(--ease-in);
}

.meet-card .ph {
	aspect-ratio: 4 / 5;
}

.meet-card.left {
	transform: translateX(calc(var(--w) * -0.4)) rotate(-5deg);
}

.meet-card.right {
	z-index: 2;
	transform: translateX(calc(var(--w) * 0.4)) rotate(5deg);
}

.meet-tag {
	display: block;
	padding: clamp(6px, 1vw, 10px) 2px 0;
	color: var(--paper-ink);
	font-size: clamp(12px, 1.4vw, 15px);
	font-weight: 600;
	line-height: 1.4;
	text-align: left;
}

/* 兩張相片之間的線：晨光桃（光） */
.meet-line {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 1;
	width: calc(var(--w) * 1.2);
	height: 3px;
	margin: -1.5px 0 0 calc(var(--w) * -0.6);
	border-radius: 2px;
	background: var(--brand);
	transform: scaleX(0);
}

.meet-text {
	position: relative;
	margin-top: clamp(40px, 6vw, 72px);
	padding-inline: var(--gutter);
	font-size: clamp(30px, 5.2vw, 72px);
	line-height: 1.3;
}

/* 有 JS 而且沒有減少動態效果時，才從分開的狀態開始播：線畫出來 → 相片靠攏 → 閃光 → 字出現 */
@media (prefers-reduced-motion: no-preference) {
	.js .meet:not(.is-met) .meet-card.left {
		transform: translateX(calc(var(--w) * -1.1));
	}

	.js .meet:not(.is-met) .meet-card.right {
		transform: translateX(calc(var(--w) * 1.1));
	}

	.js .meet.is-drawn:not(.is-met) .meet-line {
		transform: scaleX(1);
		transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
	}

	.js .meet.is-met .meet-line {
		transform: scaleX(0);
		transition: transform 0.9s var(--ease-in);
	}

	.js .meet .meet-text {
		opacity: 0;
		transform: translateY(16px);
		transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
	}

	.js .meet.is-done .meet-text {
		opacity: 1;
		transform: none;
	}
}

/* 純白快門閃光 */
.flash {
	position: fixed;
	inset: 0;
	z-index: 100;
	pointer-events: none;
	background: var(--flash);
	opacity: 0;
}

.flash.is-on {
	animation: flash 0.6s ease-out;
}

@keyframes flash {
	8% {
		opacity: 0.8;
	}
	100% {
		opacity: 0;
	}
}

/* ---------- 收尾 ---------- */

.outro {
	text-align: center;
}

.logo-big {
	display: block;
	width: clamp(200px, 36vw, 420px);
	height: auto;
	aspect-ratio: 2300 / 793;
	margin-inline: auto;
	overflow: visible;
	color: var(--logo-text);
}

.outro-tagline {
	margin-top: 28px;
	font-size: clamp(20px, 2.4vw, 26px);
	font-weight: 600;
	color: var(--text-muted);
}

.stores {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 48px;
}

.stores .btn {
	min-width: 180px;
}

.footer {
	padding: 32px 0 40px;
	border-top: 1px solid var(--border);
	font-size: 13px;
	color: var(--text-muted);
	text-align: center;
}

/* ---------- 捲動淡入 ---------- */

@media (prefers-reduced-motion: no-preference) {
	.js [data-reveal] {
		opacity: 0;
		transform: translateY(24px);
		transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
		transition-delay: var(--d, 0ms);
	}

	.js [data-reveal].is-in {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.btn,
	.meet-card {
		transition: none;
	}

	.rp-viewer {
		animation: none;
	}
}

/* ==========================================================================
 * 返圖網頁（site/q/、site/send/）：給沒裝 App 的攝影師
 * 同一套晨光 token 與沖印店元件：主要按鈕墨色、印章標籤、相片袋、輸入框圓角 10、墨色 toast。
 * 每個畫面最多一團柔光，只放在主角（頭像、完成記號或 QR）後面。
 * ========================================================================== */

.rp [hidden] {
	display: none !important;
}

.rp-stage {
	position: relative;
	min-height: calc(100svh - 96px);
	margin-top: calc(var(--nav-h) * -1);
	padding: calc(var(--nav-h) + 32px) 0 80px;
	overflow: hidden;
	/* clip 不會變成捲動容器，見面紀錄底部的主要按鈕才停得住（position: sticky） */
	overflow: clip;
}

.rp-wrap {
	position: relative;
	z-index: 1;
	width: min(100% - 2 * var(--gutter), 560px);
	margin-inline: auto;
}

.rp-send .rp-wrap {
	width: min(100% - 2 * var(--gutter), 720px);
}

.rp-view {
	display: grid;
	gap: 16px;
}

.rp-view h1:focus {
	outline: none;
}

/* 主卡：像一張沖印單（白紙、圓角 6、低陰影；深色靠表面明度） */
.panel {
	padding: clamp(24px, 5vw, 36px);
	border-radius: var(--radius-photo);
	background: var(--surface);
	box-shadow: var(--shadow-low), var(--shadow-mid);
	font-size: 15px;
	line-height: 1.5;
}

:root[data-theme="dark"] .panel {
	box-shadow: none;
}

.rp-card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0;
}

.rp-center {
	align-items: center;
	text-align: center;
}

.rp-avatar.lg {
	width: 72px;
	height: 72px;
	font-size: 26px;
}

/* 主角後面的一團光：置中畫面的頭像或完成記號；有 QR 時改放在 QR 後面 */
.rp-center > .rp-avatar.lg,
.rp-center > .rp-mark {
	box-shadow: 0 0 56px 28px var(--glow);
}

.rp-center:has(.qr) > .rp-mark {
	box-shadow: none;
}

.rp-title {
	font-size: clamp(26px, 6.4vw, 34px);
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.rp-title-sm {
	font-size: 22px;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.rp-lead {
	font-size: 16px;
	line-height: 1.6;
}

.rp-note-small {
	font-size: 13px;
	line-height: 1.6;
}

.rp-head {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

/* 資訊分兩行：場次一行、身分一行 */
.rp-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 4px;
	font-size: 14px;
	color: var(--text-muted);
}

.rp-center .rp-meta {
	align-items: center;
}

.rp-meta span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.rp-meta .icon {
	width: 16px;
	height: 16px;
}

/* 錯誤畫面的英文小標：像沖印單上的印章 */
.rp .eyebrow {
	display: inline-block;
	padding: 4px 8px;
	border: 1.5px solid var(--stamp);
	border-radius: var(--radius-stamp);
	color: var(--stamp);
	font: 700 12px/1.2 var(--font);
	letter-spacing: 0.04em;
}

/* 按鈕：手機寬度下文字可以換行，不撐出橫向捲動 */
.rp .rp-view .btn {
	height: auto;
	min-height: 52px;
	padding-block: 12px;
	line-height: 1.4;
	text-align: center;
	white-space: normal;
}

.rp .rp-view .btn-outline {
	min-height: 48px;
	padding-block: 10px;
	font-size: 15px;
}

.rp .rp-view .rp-btn-lg {
	min-height: 52px;
	padding-inline: 24px;
	font-size: 16px;
}

.rp-block {
	width: 100%;
}

.rp button.btn-outline {
	background: transparent;
	cursor: pointer;
}

.rp button.btn-outline:hover {
	background: var(--bg);
}

.rp button.btn-solid {
	cursor: pointer;
}

.btn:disabled {
	background: var(--border);
	border-color: transparent;
	color: var(--text-muted);
	cursor: not-allowed;
	transform: none;
}

.rp-actions {
	display: grid;
	gap: 12px;
	width: 100%;
	margin-top: 4px;
}

/* 文字按鈕：底線 1.5、距離 4 */
.rp-textbtn {
	justify-self: center;
	min-height: 44px;
	padding: 0 8px;
	border: 0;
	background: none;
	color: var(--text);
	font: 600 15px/1.4 var(--font);
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 4px;
	cursor: pointer;
}

.rp-store {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	font-weight: 500;
	opacity: 0.7;
}

/* 輸入代碼：六格（3＋3，中間 ‑），每格同輸入框（1.5px inputBorder、圓角 10）。
 * 真正的輸入框疊在格子上、透明，貼上、自動完成、鍵盤都照常；格子只負責顯示 */
.rp-code {
	position: relative;
	justify-self: center;
	display: block;
	width: min(100%, 336px);
	cursor: text;
}

.rp-code-boxes {
	display: flex;
	align-items: center;
	gap: 6px;
}

.rp-code-box {
	display: grid;
	place-items: center;
	flex: 1 1 0;
	min-width: 0;
	height: 56px;
	border: 1.5px solid var(--input-border);
	border-radius: var(--radius-control);
	background: var(--surface);
	color: var(--text);
	font: 700 22px/1 var(--font);
	transition: border-color 0.15s;
}

:root[data-theme="dark"] .rp-code-box {
	background: var(--bg);
}

.rp-code-box.is-filled {
	border-color: var(--text);
}

.rp-code.is-focused .rp-code-box.is-active {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

.rp-code.is-invalid .rp-code-box {
	border-color: var(--error);
}

.rp-code.is-busy .rp-code-box {
	color: var(--text-muted);
	border-color: var(--input-border);
}

.rp-code-dash {
	flex: none;
	width: 12px;
	color: var(--text-muted);
	font: 500 20px/1 var(--font);
	text-align: center;
}

.rp-code-input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: transparent;
	caret-color: transparent;
	font-size: 16px; /* iOS 小於 16px 會自動放大畫面 */
	opacity: 0;
	cursor: text;
}

.rp-code-error {
	justify-content: center;
	text-align: center;
}

/* 輸入框：1.5px inputBorder、圓角 10、標籤在上方 */
.field {
	display: grid;
	gap: 8px;
	width: 100%;
	text-align: left;
}

.field label {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.input {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 11px 14px;
	border: 1.5px solid var(--input-border);
	border-radius: var(--radius-control);
	background: var(--surface);
	color: var(--text);
	font: 400 16px/1.5 var(--font);
}

:root[data-theme="dark"] .input {
	background: var(--bg);
}

textarea.input {
	min-height: 96px;
	resize: vertical;
}

.input::placeholder {
	color: var(--text-muted);
	opacity: 1;
}

.input:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

.input[aria-invalid="true"] {
	border-color: var(--error);
}

.field-foot {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	font-size: 13px;
	line-height: 1.5;
}

.field-count {
	flex-shrink: 0;
	font-size: 12px;
	color: var(--text-muted);
}

.field-error,
.rp-error {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--error);
	text-align: left;
}

.field-error .icon,
.rp-error .icon {
	width: 18px;
	height: 18px;
	margin-top: 1px;
}

/* 提醒（需要登入、青少年保護）：印章色細框 */
.rp-notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	padding: 14px 16px;
	border: 1.5px solid var(--stamp-accent);
	border-radius: var(--radius-photo);
	font-size: 14px;
	line-height: 1.6;
	text-align: left;
}

.rp-notice .icon {
	width: 20px;
	height: 20px;
	margin-top: 2px;
	color: var(--stamp-accent);
}

.rp-notice strong {
	display: block;
	font-weight: 700;
}

/* 完成記號 */
.rp-mark {
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--surface);
	border: 1.5px solid var(--text);
}

.rp-mark .icon {
	width: 28px;
	height: 28px;
}

/* 齒孔虛線 */
.rp-divider {
	width: calc(100% + 2 * clamp(24px, 5vw, 36px));
	margin-inline: calc(-1 * clamp(24px, 5vw, 36px));
	border-top: 1.5px dashed var(--perf);
}

/* 選照片 */
.rp-drop {
	display: grid;
	justify-items: center;
	gap: 10px;
	padding: 28px 20px;
	border: 1.5px dashed var(--input-border);
	border-radius: var(--radius-photo);
	text-align: center;
	transition: border-color 0.2s, background-color 0.2s;
}

.rp-drop.is-over {
	border-color: var(--text);
	background: var(--bg);
}

.rp-drop > .icon {
	width: 32px;
	height: 32px;
	color: var(--text-muted);
}

.rp-drop-hint {
	display: none;
	font-weight: 600;
}

@media (hover: hover) and (pointer: fine) {
	.rp-drop-hint {
		display: block;
	}
}

/* 已選的照片：照片格＋格數 */
.rp-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px;
}

@media (min-width: 600px) {
	.rp-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.rp-grid li {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 2px;
	background: var(--border);
}

.rp-grid li.is-over-limit img {
	opacity: 0.35;
}

.rp-grid img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rp-grid .frame-no {
	position: absolute;
	left: 6px;
	bottom: 6px;
	margin: 0;
	padding: 3px 5px;
	border-radius: var(--radius-stamp);
	background: rgba(27, 26, 34, 0.6);
	color: #fbf3ec;
}

.rp-remove {
	position: absolute;
	top: 4px;
	right: 4px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: rgba(27, 26, 34, 0.6);
	color: #fbf3ec;
	cursor: pointer;
}

.rp-remove::before {
	content: "";
	position: absolute;
	inset: -4px;
}

.rp-remove .icon {
	width: 18px;
	height: 18px;
}

.rp-count {
	font-size: 13px;
	color: var(--text-muted);
}

/* 上傳進度：晨光桃（「新的照片」正在送出） */
.rp-progress {
	width: 100%;
	height: 4px;
	overflow: hidden;
	border-radius: 2px;
	background: var(--border);
}

.rp-progress span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--fresh);
	transition: width 0.25s var(--ease-out);
}

/* 狀態標籤：印章 */
.chip {
	display: inline-flex;
	align-items: center;
	padding: 3px 7px;
	border: 1.5px solid var(--stamp);
	border-radius: var(--radius-stamp);
	color: var(--stamp);
	font: 600 12px/1.3 var(--font);
}

/* 載入中 */
.rp-loading {
	justify-items: center;
	padding: 56px 0;
}

.rp-skeleton {
	display: block;
	height: 14px;
	border-radius: var(--radius-stamp);
	background: var(--border);
}

/* 登入對話框：底部 sheet 的圓角 24，亮色加高陰影 */
.rp-dialog {
	width: min(100% - 32px, 420px);
	max-height: calc(100svh - 32px);
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--text);
}

.rp-dialog::backdrop {
	background: var(--scrim);
}

.rp-dialog .panel {
	border-radius: var(--radius-sheet);
	background: var(--raised);
	box-shadow: var(--shadow-high);
}

/* toast：墨色底、圓角 10 */
.rp-toast {
	position: fixed;
	left: 50%;
	bottom: max(24px, env(safe-area-inset-bottom));
	z-index: 110; /* 看大圖（100）裡按愛心、下載、分享的提示也要看得到 */
	max-width: calc(100% - 32px);
	padding: 12px 18px;
	border-radius: var(--radius-control);
	background: var(--primary);
	color: var(--on-primary);
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	font-variant-numeric: tabular-nums;
	opacity: 0;
	transform: translate(-50%, 16px);
	transition: opacity 0.25s, transform 0.25s var(--ease-out);
	pointer-events: none;
}

/* 看大圖時提示放在下方按鈕列上面，不蓋住愛心、下載、分享 */
.rp-viewer-open .rp-toast {
	bottom: calc(max(16px, env(safe-area-inset-bottom)) + 68px);
}

.rp-toast b {
	font-weight: 800;
}

.rp-toast.is-on {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* 電腦打開反向情境時的下載 QR：像一張沖好的相片，後面一團光 */
.rp .qr {
	position: relative;
	width: min(100%, 240px);
	margin-inline: auto;
	padding: 16px;
	border-radius: var(--radius-photo);
	background: var(--paper);
	box-shadow: var(--shadow-low), var(--shadow-mid), 0 0 64px 32px var(--glow);
}

/* ---------- 今天的樣子（直式照片佔位，圓角 6） ---------- */
.rp-look {
	flex-shrink: 0;
	width: 56px;
	aspect-ratio: 4 / 5;
	border-radius: var(--radius-photo);
}

.rp-look.xs {
	width: 40px;
}

.rp-look.md {
	width: 88px;
}

.rp-look.xl {
	width: min(48vw, 168px);
}

/* /q/ 開頭：QR 主人今天的樣子，後面一團光 */
.rp-today {
	display: grid;
	justify-items: center;
	gap: 10px;
	margin: 0;
}

.rp-today .rp-look {
	box-shadow: 0 0 64px 32px var(--glow);
}

.rp-today figcaption {
	max-width: 24ch;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--text-muted);
}

.rp-sub {
	margin-top: 6px;
	font-size: 15px;
	color: var(--text-muted);
}

.rp-sub .num {
	color: var(--text);
	font-weight: 600;
}

/* ---------- /send/ 見面紀錄 ---------- */
.rp-meeting {
	gap: 20px;
}

.rp-meet-head {
	display: flex;
	align-items: flex-end;
	gap: 16px;
	min-width: 0;
}

.rp-meet-head > .rp-look,
.rp-meet-head > .avatar {
	box-shadow: 0 0 56px 24px var(--glow);
}

.rp-meet-info {
	display: grid;
	gap: 2px;
	min-width: 0;
	font-size: 14px;
	line-height: 1.5;
}

.rp-meet-info .rp-title-sm {
	margin-bottom: 4px;
}

.rp-meet-time {
	font-size: 16px;
	font-weight: 700;
}

/* 篩選：細框按鈕，選中的反成墨色實心 */
.rp-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}

.rp-filter button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 12px;
	border: 1.5px solid var(--text);
	border-radius: var(--radius-control);
	background: transparent;
	color: var(--text);
	font: 600 14px/1.2 var(--font);
	cursor: pointer;
}

.rp-filter button[aria-pressed="true"] {
	background: var(--primary);
	color: var(--on-primary);
}

.rp-filter .num {
	opacity: 0.7;
}

.rp-posts {
	display: grid;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* 一批照片＝相片袋 */
.rp-post {
	position: relative;
	padding: 18px 18px 16px;
	border-radius: var(--radius-photo);
	background: var(--surface);
	box-shadow: var(--shadow-low), var(--shadow-mid);
}

:root[data-theme="dark"] .rp-post {
	box-shadow: none;
}

.rp-post.is-fresh {
	padding-top: 24px;
}

.rp-post-head {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.rp-post-head .avatar {
	width: 40px;
	height: 40px;
	font-size: 15px;
}

.rp-post-who {
	flex: 1;
	min-width: 0;
	font-size: 15px;
	line-height: 1.45;
}

.rp-post .slip-count b {
	font-size: 32px;
}

.rp-post-msg {
	margin-top: 12px;
	font-size: 15px;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.rp-post .perf {
	margin: 14px -18px;
}

.rp-photos {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 3px;
}

@media (min-width: 600px) {
	.rp-photos {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.rp-photo {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	padding: 0;
	border: 0;
	border-radius: 2px;
	cursor: zoom-in;
}

.rp-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rp-photo:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

.rp-photo .frame-no,
.rp-photo-time {
	position: absolute;
	z-index: 1;
	margin: 0;
	padding: 3px 5px;
	border-radius: var(--radius-stamp);
	background: rgba(27, 26, 34, 0.6);
	color: #fbf3ec;
	font: 600 11px/1 var(--font);
	font-variant-numeric: tabular-nums;
}

.rp-photo .frame-no {
	left: 5px;
	top: 5px;
	background: none;
	padding: 0;
	opacity: 0.85;
}

.rp-photo-time {
	left: 5px;
	bottom: 5px;
}

/* 愛心角標：我按過的（對方傳的）、對方按過的（我傳的）；底跟拍攝時間標籤一樣 */
.rp-photo-liked {
	position: absolute;
	z-index: 1;
	right: 5px;
	bottom: 5px;
	display: grid;
	place-items: center;
	padding: 3px;
	border-radius: var(--radius-stamp);
	background: rgba(27, 26, 34, 0.6);
	color: #fbf3ec;
}

.rp-photo-liked .icon {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

.rp-post-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-top: 14px;
}

.rp .rp-view .rp-post-foot .btn {
	min-height: 44px;
	padding-block: 8px;
}

.rp-post-foot .rp-textbtn {
	padding: 0 4px;
}

.rp-btn-count {
	margin-left: 2px;
	opacity: 0.6;
}

.chip {
	gap: 4px;
}

.chip .icon {
	width: 14px;
	height: 14px;
}

/* 「小澄喜歡 N 張」：實心小愛心，跟印章同色（主文字色） */
.chip-liked .icon {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

/* 還沒有照片 */
.rp-empty {
	padding: 32px 20px;
	border: 1.5px dashed var(--perf);
	border-radius: var(--radius-photo);
	text-align: center;
	font-size: 15px;
	line-height: 1.7;
}

.rp-empty-title {
	margin-bottom: 4px;
	font-size: 17px;
	font-weight: 700;
}

/* 主要按鈕停在畫面底部，捲到哪裡都按得到 */
.rp-main {
	display: grid;
	gap: 12px;
	justify-items: center;
	position: sticky;
	bottom: 0;
	z-index: 2;
	margin-inline: calc(-1 * var(--gutter));
	padding: 16px var(--gutter) max(16px, env(safe-area-inset-bottom));
	background: linear-gradient(to bottom, transparent, var(--bg) 24px);
}

.rp-dock {
	display: grid;
	gap: 6px;
	width: 100%;
}

.rp-dock-note {
	text-align: center;
}

.rp-meet-foot {
	text-align: center;
}

/* ---------- 看圖器：黑底全螢幕，上下拉走關閉 ---------- */
.rp-viewer-open,
.rp-viewer-open body {
	overflow: hidden;
}

.rp-viewer {
	--viewer-alpha: 1;
	position: fixed;
	inset: 0;
	z-index: 100;
	display: grid;
	grid-template-rows: auto 1fr auto;
	background: rgba(12, 11, 16, calc(0.96 * var(--viewer-alpha)));
	color: #fbf3ec;
	animation: rp-viewer-in 0.2s var(--ease-out);
}

.rp-viewer.is-closing {
	opacity: 0;
	transition: opacity 0.2s;
}

@keyframes rp-viewer-in {
	from {
		opacity: 0;
	}
}

.rp-viewer-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: max(12px, env(safe-area-inset-top)) 16px 12px;
	transition: opacity 0.15s;
}

.rp-viewer-bottom {
	padding: 12px 16px max(16px, env(safe-area-inset-bottom));
}

.rp-viewer.is-pulling .rp-viewer-bar,
.rp-viewer.is-pulling .rp-viewer-nav {
	opacity: 0;
	pointer-events: none;
}

.rp-viewer-top {
	justify-content: flex-start;
	gap: 4px;
}

.rp-viewer-no {
	font-size: 15px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* 誰拍的：樣子小圖 28＋暱稱＋拍攝時間；點了回到見面紀錄 */
.rp-viewer-who {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	min-height: 44px;
	padding: 4px 8px 4px 4px;
	border: 0;
	border-radius: var(--radius-control);
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.rp-viewer-who:hover {
	background: rgba(251, 243, 236, 0.12);
}

.rp-viewer-face {
	width: 28px;
	height: 28px;
}

.rp-look.rp-viewer-face {
	aspect-ratio: auto;
	border-radius: var(--radius-stamp);
}

.avatar.rp-viewer-face {
	font-size: 12px;
}

.rp-viewer-who-text {
	display: grid;
	min-width: 0;
}

.rp-viewer-name {
	display: flex;
	align-items: baseline;
	gap: 8px;
	min-width: 0;
}

.rp-viewer-name b {
	overflow: hidden;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rp-viewer-cap,
.rp-viewer-liked {
	color: rgba(251, 243, 236, 0.7);
	font-size: 13px;
	line-height: 1.35;
}

.rp-viewer-liked {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 3px;
}

.rp-viewer-liked .icon {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

.rp-viewer-actions {
	display: flex;
	gap: 8px;
}

.rp-viewer-btn[hidden] {
	display: none;
}

.rp-viewer-btn .icon.is-filled {
	fill: currentColor;
}

.rp-viewer-btn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: var(--radius-control);
	background: rgba(251, 243, 236, 0.12);
	color: inherit;
	cursor: pointer;
}

.rp-viewer-btn .icon {
	width: 22px;
	height: 22px;
}

.rp-viewer-btn:hover {
	background: rgba(251, 243, 236, 0.2);
}

.rp-viewer-btn:focus-visible,
.rp-viewer-who:focus-visible {
	outline: 2px solid #fbf3ec;
	outline-offset: 2px;
}

.rp-viewer-stage {
	display: grid;
	place-items: center;
	min-height: 0;
	padding: 0 16px;
	overflow: hidden;
	touch-action: none;
}

.rp-viewer-photo {
	border-radius: 2px;
	will-change: transform;
}

.rp-viewer-photo.is-springing {
	transition: transform 0.25s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.rp-viewer-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.rp-viewer-nav {
	position: fixed;
	top: 50%;
	display: none;
	width: 48px;
	height: 48px;
	margin-top: -24px;
	border: 0;
	border-radius: var(--radius-control);
	background: rgba(251, 243, 236, 0.12);
	color: #fbf3ec;
	font: 400 32px/1 var(--font);
	cursor: pointer;
}

.rp-viewer-nav.prev {
	left: 16px;
}

.rp-viewer-nav.next {
	right: 16px;
}

@media (hover: hover) and (pointer: fine) {
	.rp-viewer-nav:not([hidden]) {
		display: block;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rp-viewer,
	.rp-viewer-photo.is-springing,
	.rp-toast,
	.rp-drop,
	.rp-progress span {
		transition: none;
	}

	.rp-viewer {
		animation: none;
	}
}

/* ==========================================================================
 * 說明文件頁（site/privacy/、site/terms/、site/support/）
 * 同一套晨光 token：葡萄墨字、暖白底、沖印單卡片（.panel）。不加新顏色，不放柔光。
 * ========================================================================== */

.doc-stage {
	margin-top: calc(var(--nav-h) * -1);
	padding: calc(var(--nav-h) + 40px) 0 clamp(72px, 10vw, 120px);
}

.doc {
	width: min(100% - 2 * var(--gutter), 720px);
	margin-inline: auto;
	font-size: 16px;
	line-height: 1.8;
}

.doc-head {
	display: grid;
	gap: 12px;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--border);
}

.doc-head h1 {
	font-family: var(--heading);
	font-weight: 700;
	font-size: clamp(32px, 7vw, 48px);
	line-height: 1.25;
}

.doc-meta {
	font-size: 14px;
	color: var(--text-muted);
}

.doc-lead {
	font-size: 17px;
}

/* 重點摘要與目錄：沖印單卡片 */
.doc .panel {
	margin-top: 28px;
	font-size: 15px;
	line-height: 1.7;
}

.doc-panel-title {
	font: 700 15px/1.4 var(--font);
	margin-bottom: 12px;
}

.doc-toc ol {
	display: grid;
	gap: 4px 24px;
	margin: 0;
	padding-left: 1.6em;
}

@media (min-width: 640px) {
	.doc-toc ol {
		grid-template-columns: 1fr 1fr;
	}
}

.doc-toc li::marker {
	color: var(--text-muted);
	font-variant-numeric: tabular-nums;
}

.doc-toc a {
	text-decoration: none;
}

.doc-toc a:hover {
	text-decoration: underline;
}

.doc-body section {
	padding-top: 44px;
	scroll-margin-top: calc(var(--nav-h) + 8px);
}

.doc-body h2 {
	margin-bottom: 14px;
	font-family: var(--heading);
	font-weight: 700;
	font-size: clamp(22px, 4.6vw, 26px);
	line-height: 1.4;
}

.doc-body h3 {
	margin: 24px 0 8px;
	font: 700 17px/1.5 var(--font);
}

.doc-body p + p,
.doc-body p + ul,
.doc-body p + ol,
.doc-body ul + p,
.doc-body ol + p,
.doc-body .doc-table + p,
.doc-body p + .doc-table {
	margin-top: 12px;
}

.doc-body ul,
.doc-body ol {
	margin: 0;
	padding-left: 1.4em;
}

.doc-body ul {
	list-style: disc;
}

.doc-body li + li {
	margin-top: 6px;
}

.doc-body li::marker {
	color: var(--text-muted);
}

.doc-body strong {
	font-weight: 700;
}

.doc-body a {
	overflow-wrap: anywhere;
}

/* 資料表：寬螢幕兩欄，手機改成上下排 */
.doc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 1.7;
}

.doc-table th,
.doc-table td {
	padding: 12px 0;
	border-top: 1px solid var(--border);
	text-align: left;
	vertical-align: top;
}

.doc-table tr:last-child th,
.doc-table tr:last-child td {
	border-bottom: 1px solid var(--border);
}

.doc-table th {
	width: 30%;
	padding-right: 20px;
	font-weight: 700;
}

@media (max-width: 599px) {
	.doc-table,
	.doc-table tbody,
	.doc-table tr,
	.doc-table th,
	.doc-table td {
		display: block;
		width: auto;
	}

	.doc-table th {
		padding: 12px 0 2px;
	}

	.doc-table td {
		padding: 0 0 12px;
		border-top: 0;
	}

	.doc-table tr:last-child th {
		border-bottom: 0;
	}
}

/* 聯絡信箱這類單一重點 */
.doc-contact {
	display: inline-block;
	margin-top: 4px;
	font: 700 18px/1.5 var(--font);
}

/* ---------- 頁尾連結（官網、返圖網頁、說明頁共用） ---------- */

.footer-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 20px;
	margin-bottom: 8px;
}

.footer-links a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	color: var(--text-muted);
	text-decoration: none;
}

.footer-links a:hover {
	color: var(--text);
	text-decoration: underline;
}
