@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&family=Noto+Serif+TC:wght@500;700&display=swap');

/* =========================================================================
   左岸可玻璃工藝 X 哈克藝術文創 — 系統 Demo 共用樣式
   設計語彙：玻璃厚邊的青綠、霧面玻璃白、窯火琥珀金
   ========================================================================= */

:root {
	color-scheme: light;

	/* 色彩 —— 取自玻璃本身：側看的邊緣青、霧面、窯火 */
	--ink: #10211f;
	--ink-70: #3c504d;
	--ink-45: #6c807d;
	--glass-deep: #1f4d46;
	--glass: #2e7d6f;
	--glass-soft: #d8e8e2;
	--glass-mist: #eef4f2;
	--frost: #f5f8f7;
	--surface: #ffffff;
	--kiln: #b8651a;
	--kiln-bright: #e4a020;
	--kiln-soft: #fbf0d9;
	--alert: #a8341f;
	--alert-soft: #fbe9e5;
	--line: #d5e2de;
	--line-strong: #b4c9c3;

	/* 字級 —— 完全四度音階（1.333），基準 16px */
	--t-xs: 0.75rem;
	--t-sm: 0.875rem;
	--t-base: 1rem;
	--t-md: 1.3125rem;
	--t-lg: 1.75rem;
	--t-xl: 2.3125rem;
	--t-2xl: 3.0625rem;

	/* 間距 */
	--s1: 4px;
	--s2: 8px;
	--s3: 12px;
	--s4: 16px;
	--s5: 24px;
	--s6: 32px;
	--s7: 48px;
	--s8: 72px;

	--r-sm: 4px;
	--r-md: 10px;
	--r-lg: 18px;

	--shadow-lift: 0 2px 6px rgba(16, 33, 31, 0.07), 0 12px 28px rgba(16, 33, 31, 0.06);
	--font-sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
	--font-serif: 'Noto Serif TC', 'Songti TC', serif;
	--font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--frost);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: var(--t-base);
	line-height: 1.7;
	letter-spacing: 0.01em;
}

h1,
h2,
h3,
h4 {
	font-family: var(--font-serif);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.005em;
	margin: 0;
}

h1 {
	font-size: var(--t-lg);
}

h2 {
	font-size: var(--t-md);
}

h3 {
	font-size: var(--t-base);
}

p {
	margin: 0 0 var(--s4);
	max-width: 42em;
}

a {
	color: var(--glass-deep);
	text-underline-offset: 3px;
}

img {
	max-width: 100%;
	display: block;
}

:focus-visible {
	outline: 2px solid var(--kiln);
	outline-offset: 2px;
	border-radius: var(--r-sm);
}

/* =========================================================================
   版面骨架
   前台頁面 = 顧客手機，單欄 480px；後台 = 工作台，寬版
   ========================================================================= */

.phone {
	max-width: 480px;
	margin: 0 auto;
	min-height: 100vh;
	background: var(--surface);
	position: relative;
	padding-bottom: var(--s8);
}

@media (min-width: 900px) {
	body.on-phone {
		background:
			radial-gradient(1100px 600px at 50% -200px, #26635a 0%, transparent 70%),
			var(--glass-deep);
	}

	.phone {
		margin-top: var(--s5);
		margin-bottom: var(--s5);
		min-height: calc(100vh - 48px);
		border-radius: var(--r-lg);
		/* clip 而非 hidden：一樣裁圓角，但不會讓 .phone 變成捲動容器而使內部 sticky 失效 */
		overflow: clip;
		box-shadow: 0 30px 80px rgba(6, 22, 20, 0.45);
	}
}

/* 頁首與示意標記由 UI 插在 body 最前面，寬度要跟 .phone 對齊（後台頁不套用） */
body.on-phone > .topbar,
body.on-phone > .demo-flag {
	max-width: 480px;
	margin-inline: auto;
}

.wide {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 var(--s5);
}

.stack {
	padding: var(--s5) var(--s4);
}

/* =========================================================================
   前台頁首
   ========================================================================= */

.topbar {
	display: flex;
	align-items: center;
	gap: var(--s3);
	padding: var(--s3) var(--s4);
	background: var(--glass-deep);
	color: #eaf3f0;
	position: sticky;
	top: 0;
	z-index: 20;
}

.topbar a {
	color: inherit;
	text-decoration: none;
}

.topbar .back {
	font-size: var(--t-md);
	line-height: 1;
	opacity: 0.75;
	padding: var(--s1) var(--s2);
}

.topbar .back:hover {
	opacity: 1;
}

.topbar .title {
	font-family: var(--font-serif);
	font-size: var(--t-base);
	font-weight: 700;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.topbar .cart-link {
	position: relative;
	padding: var(--s1) var(--s2);
	font-size: var(--t-sm);
}

.topbar .cart-count {
	position: absolute;
	top: -2px;
	right: -6px;
	min-width: 18px;
	height: 18px;
	border-radius: 9px;
	background: var(--kiln-bright);
	color: var(--ink);
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	padding: 0 4px;
}

/* 玻璃口味的品牌列：兩家公司並置 */
.brandline {
	font-size: var(--t-xs);
	color: var(--ink-45);
	letter-spacing: 0.04em;
}

/* =========================================================================
   卡片與區塊
   用細邊線與淺底分層，不靠一律相同的灰陰影
   ========================================================================= */

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: var(--s4);
}

.card.tint {
	background: var(--glass-mist);
	border-color: var(--glass-soft);
}

.card.lift {
	box-shadow: var(--shadow-lift);
	border-color: transparent;
}

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--s3);
	margin-bottom: var(--s3);
}

.section-head .hint {
	font-size: var(--t-sm);
	color: var(--ink-45);
}

.hr {
	height: 1px;
	background: var(--line);
	border: 0;
	margin: var(--s5) 0;
}

.muted {
	color: var(--ink-45);
}

.small {
	font-size: var(--t-sm);
}

.xsmall {
	font-size: var(--t-xs);
}

.serif {
	font-family: var(--font-serif);
}

.mono {
	font-family: var(--font-mono);
	font-size: 0.9em;
	letter-spacing: 0;
}

/* =========================================================================
   按鈕
   ========================================================================= */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--s2);
	padding: 11px var(--s4);
	border-radius: var(--r-sm);
	border: 1px solid var(--glass);
	background: var(--glass);
	color: #fff;
	font-family: inherit;
	font-size: var(--t-base);
	font-weight: 500;
	line-height: 1.4;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
	background: var(--glass-deep);
	border-color: var(--glass-deep);
}

.btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.btn.ghost {
	background: transparent;
	color: var(--glass-deep);
	border-color: var(--line-strong);
}

.btn.ghost:hover {
	background: var(--glass-mist);
	border-color: var(--glass);
}

.btn.amber {
	background: var(--kiln-bright);
	border-color: var(--kiln-bright);
	color: var(--ink);
}

.btn.amber:hover {
	background: #d0910f;
	border-color: #d0910f;
}

.btn.danger {
	background: transparent;
	color: var(--alert);
	border-color: #e2c1b9;
}

.btn.block {
	width: 100%;
}

.btn.sm {
	padding: 6px 12px;
	font-size: var(--t-sm);
}

.btn-row {
	display: flex;
	gap: var(--s2);
	flex-wrap: wrap;
}

/* 前台底部固定操作條 */
.actionbar {
	position: sticky;
	bottom: 0;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(6px);
	border-top: 1px solid var(--line);
	padding: var(--s3) var(--s4);
	display: flex;
	gap: var(--s2);
	z-index: 15;
}

.actionbar .btn {
	flex: 1;
}

/* =========================================================================
   表單
   ========================================================================= */

.field {
	margin-bottom: var(--s4);
}

.field > label {
	display: block;
	font-size: var(--t-sm);
	font-weight: 500;
	margin-bottom: var(--s2);
	color: var(--ink-70);
}

.field .req {
	color: var(--alert);
	margin-left: 2px;
}

input[type='text'],
input[type='tel'],
input[type='email'],
input[type='date'],
input[type='number'],
select,
textarea {
	width: 100%;
	padding: 10px var(--s3);
	border: 1px solid var(--line-strong);
	border-radius: var(--r-sm);
	background: var(--surface);
	font-family: inherit;
	font-size: var(--t-base);
	color: var(--ink);
}

textarea {
	min-height: 84px;
	resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
	border-color: var(--glass);
	outline: 2px solid rgba(46, 125, 111, 0.2);
	outline-offset: 0;
}

.field .help {
	font-size: var(--t-xs);
	color: var(--ink-45);
	margin-top: var(--s1);
}

.field.error input,
.field.error select,
.field.error textarea {
	border-color: var(--alert);
}

.field .err {
	display: none;
	font-size: var(--t-xs);
	color: var(--alert);
	margin-top: var(--s1);
}

.field.error .err {
	display: block;
}

.field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--s3);
}

/* 時段／數量之類的選擇鈕 */
.choice-grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s2);
}

.choice {
	border: 1px solid var(--line-strong);
	background: var(--surface);
	border-radius: var(--r-sm);
	padding: 8px var(--s3);
	font-family: inherit;
	font-size: var(--t-sm);
	color: var(--ink);
	cursor: pointer;
}

.choice[aria-pressed='true'],
.choice.on {
	background: var(--glass-deep);
	border-color: var(--glass-deep);
	color: #fff;
}

.choice:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	text-decoration: line-through;
}

.stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--line-strong);
	border-radius: var(--r-sm);
	overflow: hidden;
}

.stepper button {
	width: 36px;
	height: 36px;
	border: 0;
	background: var(--surface);
	font-size: var(--t-md);
	line-height: 1;
	color: var(--ink);
	cursor: pointer;
}

.stepper button:hover {
	background: var(--glass-mist);
}

.stepper .qty {
	min-width: 40px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

/* =========================================================================
   狀態標籤與價格
   ========================================================================= */

.pill {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: var(--t-xs);
	font-weight: 500;
	line-height: 1.6;
	white-space: nowrap;
	border: 1px solid transparent;
}

.pill.wait {
	background: var(--kiln-soft);
	color: #7a4a06;
	border-color: #ecd6a4;
}

.pill.ok {
	background: var(--glass-soft);
	color: var(--glass-deep);
	border-color: #b6d4cb;
}

.pill.doing {
	background: #e5eef7;
	color: #1d4f7c;
	border-color: #c2d9ec;
}

.pill.done {
	background: #e6e9e8;
	color: var(--ink-70);
	border-color: #ccd5d3;
}

.pill.off {
	background: var(--alert-soft);
	color: var(--alert);
	border-color: #ecc8c0;
}

.price {
	font-family: var(--font-serif);
	font-size: var(--t-md);
	font-weight: 700;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}

.price .cur {
	font-size: var(--t-sm);
	font-weight: 500;
	color: var(--ink-45);
	margin-right: 2px;
}

.price.ask {
	font-size: var(--t-base);
	color: var(--kiln);
}

/* =========================================================================
   示意資料標記（整份 demo 都要看得到）
   ========================================================================= */

.demo-flag {
	background: var(--kiln-soft);
	border-bottom: 1px solid #ecd6a4;
	color: #7a4a06;
	font-size: var(--t-xs);
	padding: 6px var(--s4);
	text-align: center;
	line-height: 1.5;
}

.demo-flag strong {
	font-weight: 700;
}

.note {
	border-left: 3px solid var(--glass);
	background: var(--glass-mist);
	padding: var(--s3) var(--s4);
	border-radius: 0 var(--r-sm) var(--r-sm) 0;
	font-size: var(--t-sm);
	color: var(--ink-70);
}

.note.warn {
	border-left-color: var(--kiln-bright);
	background: var(--kiln-soft);
	color: #7a4a06;
}

/* =========================================================================
   清單與表格（後台）
   ========================================================================= */

.table-wrap {
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	background: var(--surface);
}

table.data {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--t-sm);
	white-space: nowrap;
}

table.data th {
	text-align: left;
	font-weight: 500;
	color: var(--ink-70);
	background: var(--glass-mist);
	padding: 10px var(--s3);
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
}

table.data td {
	padding: 10px var(--s3);
	border-bottom: 1px solid var(--line);
	vertical-align: middle;
}

table.data tr:last-child td {
	border-bottom: 0;
}

table.data tbody tr:hover {
	background: #fafcfb;
}

table.data .num {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.empty {
	padding: var(--s7) var(--s4);
	text-align: center;
	color: var(--ink-45);
	font-size: var(--t-sm);
}

/* =========================================================================
   分頁籤
   ========================================================================= */

.tabs {
	display: flex;
	gap: var(--s1);
	overflow-x: auto;
	border-bottom: 1px solid var(--line);
	scrollbar-width: thin;
}

.tabs button {
	border: 0;
	background: transparent;
	font-family: inherit;
	font-size: var(--t-sm);
	color: var(--ink-70);
	padding: 10px var(--s3);
	cursor: pointer;
	white-space: nowrap;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.tabs button[aria-selected='true'] {
	color: var(--glass-deep);
	font-weight: 700;
	border-bottom-color: var(--glass);
}

/* =========================================================================
   QR Code
   ========================================================================= */

.qr {
	display: inline-block;
	padding: var(--s3);
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	line-height: 0;
}

.qr canvas,
.qr img {
	display: block;
}

.qr-fallback {
	width: 132px;
	height: 132px;
	display: grid;
	place-items: center;
	font-size: var(--t-xs);
	color: var(--ink-45);
	text-align: center;
	line-height: 1.5;
	padding: var(--s2);
	background: var(--glass-mist);
}

/* =========================================================================
   吐司提示
   ========================================================================= */

.toast-host {
	position: fixed;
	left: 50%;
	bottom: 88px;
	transform: translateX(-50%);
	z-index: 90;
	display: flex;
	flex-direction: column;
	gap: var(--s2);
	align-items: center;
	pointer-events: none;
	width: max-content;
	max-width: 88vw;
}

.toast {
	background: var(--ink);
	color: #eef4f2;
	padding: 10px var(--s4);
	border-radius: 999px;
	font-size: var(--t-sm);
	box-shadow: 0 10px 24px rgba(16, 33, 31, 0.28);
	animation: toast-in 0.18s ease-out;
}

@keyframes toast-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
}

/* =========================================================================
   頁尾
   ========================================================================= */

.foot {
	padding: var(--s5) var(--s4) var(--s6);
	border-top: 1px solid var(--line);
	color: var(--ink-45);
	font-size: var(--t-xs);
	line-height: 1.8;
	background: var(--frost);
}

.foot a {
	color: var(--glass-deep);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
