/* home.aliens.tw — 水彩繪本的溫度：紙色底、珊瑚色重點、鼠尾草綠當「休息」。
 * 廚房平板橫放、手常是濕的：可以點的東西至少 56px 高，字比一般網站大一級。 */

:root {
	--paper: #fbf6ef;
	--card: #fffdf9;
	--ink: #3d2c22;
	--muted: #7b6558;
	--faint: #a89486;
	--line: #eadccd;
	--coral: #d9785a;
	--coral-deep: #b4583d;
	--peach: #fbe9dd;
	--sage: #6f8f6a;
	--sage-bg: #eaf1e5;
	--sun1: #f3c08f;
	--todo: #b4583d;
	--todo-bg: #fdecec;
	--radius: 18px;
	--tap: 60px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
	color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font);
	font-size: 18px;
	line-height: 1.55;
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }

.sun {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 35%, var(--sun1), var(--coral));
}
.sun-sm { width: 26px; height: 26px; flex: none; }

/* ── 登入 ─────────────────────────────────── */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
	width: 100%;
	max-width: 380px;
	padding: 28px 22px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 24px;
	text-align: center;
}
.login-card .sun { margin: 0 auto 12px; }
.login-card h1 { margin: 0; font-size: 1.7rem; }
.login-zh { margin: 0 0 12px; color: var(--muted); }
.login-hint { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; }
.login-err { margin: 0 0 10px; color: var(--coral-deep); font-weight: 700; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin-bottom: 18px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--coral); }
.pin-dots span.on { background: var(--coral); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pin-pad button {
	min-height: 64px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--paper);
	font-size: 1.5rem;
	font-weight: 700;
	cursor: pointer;
}
.pin-pad button:active { background: var(--peach); }
.pin-pad button.muted { font-size: 1rem; color: var(--muted); }

/* ── 版面骨架 ─────────────────────────────── */
.app { min-height: 100%; }
.topbar {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
	background: rgba(251, 246, 239, 0.95);
	border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.lang {
	min-height: 48px;
	min-width: 72px;
	padding: 0 16px;
	border: 2px solid var(--coral);
	border-radius: 999px;
	background: var(--card);
	color: var(--coral-deep);
	font-weight: 800;
	cursor: pointer;
}

.nav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 5;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
	background: var(--card);
	border-top: 1px solid var(--line);
}
.nav button {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-height: var(--tap);
	padding: 4px 2px;
	border: 0;
	border-radius: 14px;
	background: none;
	color: var(--muted);
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
}
.nav button .ic { font-size: 1.35rem; line-height: 1; }
.nav button[aria-current="page"] { background: var(--peach); color: var(--coral-deep); }

.main { padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px)); max-width: 980px; margin: 0 auto; outline: none; }

/* 橫放平板：左側選單 */
@media (min-width: 900px) {
	.app { display: grid; grid-template-columns: 210px 1fr; grid-template-rows: auto 1fr; }
	.topbar { grid-column: 1 / -1; }
	.nav {
		position: sticky;
		top: 70px;
		align-self: start;
		display: flex;
		flex-direction: column;
		gap: 8px;
		padding: 16px 12px;
		border: 0;
		background: none;
	}
	.nav button { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 16px; font-size: 1.05rem; min-height: 64px; }
	.nav button .ic { font-size: 1.5rem; }
	.main { padding: 20px 28px 40px; margin: 0; }
}

/* ── 共用元件 ─────────────────────────────── */
h2 { margin: 8px 0 12px; font-size: 1.35rem; }
h3 { margin: 22px 0 10px; font-size: 1.1rem; }
.card {
	padding: 18px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.stack { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.todo {
	display: inline-block;
	padding: 0 8px;
	border-radius: 8px;
	background: var(--todo-bg);
	color: var(--todo);
	font-weight: 800;
	font-size: 0.9em;
}
.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--peach);
	color: var(--coral-deep);
	font-weight: 700;
	font-size: 0.95rem;
}
.chip.sage { background: var(--sage-bg); color: var(--sage); }
.btn {
	min-height: 52px;
	padding: 0 20px;
	border: 0;
	border-radius: 14px;
	background: var(--coral);
	color: #fff;
	font-weight: 800;
	cursor: pointer;
}
.btn.ghost { background: var(--card); color: var(--coral-deep); border: 2px solid var(--coral); }
.btn:disabled { opacity: 0.5; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* 插畫槽位：之後放水彩插畫，沒有圖時整個不佔位 */
.illus { display: block; width: 100%; border-radius: var(--radius); background: var(--peach); }

/* ── 今天 ─────────────────────────────────── */
.today-head { display: grid; gap: 14px; }
@media (min-width: 900px) { .today-head { grid-template-columns: 1fr 1.4fr; align-items: stretch; } }
.clock-card { display: flex; flex-direction: column; justify-content: center; }
.clock { font-size: 4rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.date { margin-top: 6px; font-size: 1.15rem; color: var(--muted); }
.daytype { margin-top: 10px; }
.now-card { background: var(--peach); border-color: #f2cdb7; }
.now-label { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral-deep); }
.now-time { font-weight: 800; font-variant-numeric: tabular-nums; }
.now-text { margin: 4px 0 0; font-size: 1.35rem; font-weight: 700; line-height: 1.4; }
.next { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e8b9a0; }
.next-text { margin: 2px 0 0; font-size: 1.05rem; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.msg-banner { border-left: 6px solid var(--sage); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tl {
	display: grid;
	grid-template-columns: 8.8rem 1fr;
	gap: 12px;
	padding: 12px 14px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 14px;
}
.tl-time { font-weight: 800; color: var(--coral-deep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-fam { margin-top: 4px; color: var(--muted); font-size: 0.9rem; }
.tl.past { opacity: 0.55; }
.tl.rest { background: var(--sage-bg); border-color: #cfdcc8; }
.tl.rest .tl-time { color: var(--sage); }
.tl.now { border: 3px solid var(--coral); box-shadow: 0 6px 20px rgba(217, 120, 90, 0.18); opacity: 1; }
@media (max-width: 480px) { .tl { grid-template-columns: 1fr; gap: 2px; } }

/* ── 清單 ─────────────────────────────────── */
.progress { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0 16px; }
.progress > span { display: block; height: 100%; background: var(--sage); border-radius: 999px; }
.tasks { display: grid; gap: 10px; }
@media (min-width: 900px) { .tasks { grid-template-columns: 1fr 1fr; } }
.task {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	min-height: 72px;
	padding: 12px 16px;
	text-align: left;
	background: var(--card);
	border: 2px solid var(--line);
	border-radius: 16px;
	cursor: pointer;
}
.task .box {
	flex: none;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 3px solid var(--coral);
	color: #fff;
	font-weight: 900;
}
.task .t-body { flex: 1; min-width: 0; }
.task .t-time { display: block; color: var(--faint); font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.task .t-text { display: block; font-weight: 700; }
.task .t-by { display: block; color: var(--sage); font-size: 0.85rem; }
.task[aria-pressed="true"] { background: var(--sage-bg); border-color: #cfdcc8; }
.task[aria-pressed="true"] .box { background: var(--sage); border-color: var(--sage); }
.task[aria-pressed="true"] .t-text { text-decoration: line-through; color: var(--muted); }

/* ── 留言、購物 ───────────────────────────── */
.two { display: grid; gap: 18px; }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 1fr; align-items: start; } }
.msg { padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.msg.helper { background: var(--sage-bg); border-color: #cfdcc8; }
.msg-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.msg-text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.del { min-height: 40px; min-width: 40px; border: 0; background: none; color: var(--faint); font-size: 1.2rem; cursor: pointer; }
textarea, input[type="text"] {
	width: 100%;
	min-height: 56px;
	padding: 12px 14px;
	border: 2px solid var(--line);
	border-radius: 14px;
	background: var(--card);
	font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > input[type="text"] { flex: 1; min-width: 0; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.seg button { min-height: 52px; min-width: 72px; padding: 0 14px; border: 0; background: var(--card); font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--coral); color: #fff; }
.shop { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.shop .task { min-height: 56px; border: 0; padding: 6px 0; background: none; }
.shop .task .box { width: 32px; height: 32px; }

/* ── 資訊 ─────────────────────────────────── */
.info-list { margin: 0; padding-left: 1.2rem; }
.info-list li { margin: 6px 0; }
.num-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.num-row:last-child { border-bottom: 0; }
.num { min-width: 4.5rem; font-size: 1.6rem; font-weight: 900; color: var(--coral-deep); font-variant-numeric: tabular-nums; }
.addr { font-size: 1.6rem; font-weight: 800; line-height: 1.5; }
.table { width: 100%; border-collapse: collapse; }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td:first-child { width: 7rem; font-weight: 800; color: var(--coral-deep); white-space: nowrap; }
.table tr.today td { background: var(--peach); }

/* ── 家人設定 ─────────────────────────────── */
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.plan-row:last-child { border-bottom: 0; }
.plan-date { font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-date .muted { font-weight: 600; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
