/* 映跡：Material 3 風格（色調層次、大圓角、膠囊按鈕、無漸層） */
:root {
  --bg: #F8FAFD;
  --card: #FFFFFF;
  --fill: #E9EEF6;
  --fill-2: #DDE3EA;
  --text: #1F1F1F;
  --text2: #5E6368;
  --outline: #C4C7C5;
  --sep: rgba(31, 31, 31, 0.09);
  --accent: #0B57D0;
  --on-accent: #FFFFFF;
  --accent-soft: #D3E3FD;
  --on-accent-soft: #0842A0;
  --danger: #B3261E;
  --danger-soft: #F9DEDC;
  --warn-bg: #FFEFC2;
  --warn-text: #574100;
  --ok-bg: #C4EED0;
  --ok-text: #0A3818;
  --bar: #F0F4F9;
  --hero: #D3E3FD;
  --hero-text: #041E49;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tab-h: 68px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --font: "Google Sans Text", "Google Sans", Roboto, -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --font-display: var(--font);
  --font-num: var(--font);
  --title-size: 32px;
  --title-weight: 700;
  --r-card: 24px;
  --r-list: 20px;
  --r-btn: 999px;
  --r-chip: 999px;
  --r-seg: 999px;
  --r-thumb: 14px;
  --r-stage: 24px;
  --r-input: 16px;
  --r-sheet: 28px;
  --r-notice: 18px;
  --card-shadow: none;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131314;
    --card: #1E1F20;
    --fill: #2A2C2E;
    --fill-2: #37393B;
    --text: #E3E3E3;
    --text2: #B4B8BC;
    --outline: #5C5F61;
    --sep: rgba(227, 227, 227, 0.1);
    --accent: #A8C7FA;
    --on-accent: #062E6F;
    --accent-soft: #0842A0;
    --on-accent-soft: #D3E3FD;
    --danger: #F2B8B5;
    --danger-soft: #601410;
    --warn-bg: #4A3800;
    --warn-text: #FFE08A;
    --ok-bg: #0F5223;
    --ok-text: #C4EED0;
    --bar: #1E1F20;
    --hero: #0E3A7E;
    --hero-text: #E8F0FE;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app {
  position: fixed; inset: 0;
  max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column;
  background: var(--bg);
}
#view {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-t) + 14px) 16px calc(var(--tab-h) + var(--safe-b) + 32px);
}

/* 底部導覽列：目前分頁以膠囊色塊標示 */
#tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex;
  height: calc(var(--tab-h) + var(--safe-b)); padding: 0 4px var(--safe-b);
  background: var(--bar);
  z-index: 10;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text2); font-size: 12px; font-weight: 500;
}
.tab .pill { width: 60px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; transition: background 0.25s var(--ease); }
.tab.on { color: var(--text); font-weight: 700; }
.tab.on .pill { background: var(--accent-soft); color: var(--on-accent-soft); }
.tab:active .pill { background: var(--fill-2); }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on svg { stroke-width: 2.1; }

.ico { display: inline-flex; }
.ico svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* 標題 */
.page-head { margin: 10px 4px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.large-title { font-family: var(--font-display); font-size: var(--title-size); font-weight: var(--title-weight); letter-spacing: -0.01em; line-height: 1.15; }
.page-sub { color: var(--text2); font-size: 15px; margin-top: 4px; }
.section-title { font-size: 14px; color: var(--text2); margin: 26px 8px 10px; font-weight: 600; }
.section-foot { font-size: 13px; color: var(--text2); margin: 10px 8px 0; line-height: 1.5; }

/* 插畫 */
.art svg { display: block; width: 100%; height: auto; }
.art-panel { background: var(--hero); border-radius: 28px; padding: 14px 24px 6px; }

/* 首頁主視覺：最近一個項目的狀態。預設（晨光）顯示人物插畫，照片區塊留給其他皮膚 */
.head-acts { display: flex; gap: 4px; }
.icon-btn.tool { background: var(--fill); color: var(--text); width: 44px; height: 44px; border-radius: 22px; }
.pending-note { margin-bottom: 12px; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 40%; align-items: end; background: var(--hero); color: var(--hero-text); border-radius: 28px; padding: 18px 4px 0 20px; margin-bottom: 14px; overflow: hidden; min-height: 164px; }
.hero-text { align-self: center; padding-bottom: 18px; min-width: 0; position: relative; z-index: 1; }
.hero .tagp { display: inline-block; font-size: 12px; font-weight: 600; background: var(--card); color: var(--on-accent-soft); border-radius: 999px; padding: 3px 11px; }
.hero h2 { font-family: var(--font-display); font-size: 21px; font-weight: 800; line-height: 1.25; margin-top: 8px; }
.hero p { font-size: 13px; opacity: 0.8; margin-top: 3px; line-height: 1.4; }
.hero .cta { margin-top: 12px; padding: 0 18px 0 14px; min-height: 42px; }
.hero .art { align-self: end; }
.hero-media { display: none; }
.hm { position: relative; overflow: hidden; }
.hm img { display: block; width: 100%; height: 100%; object-fit: cover; }
.stamp, .hm-cap, .hm-days { display: none; }

/* 儲存頁的說明橫幅 */
.banner { display: grid; grid-template-columns: minmax(0, 1fr) 44%; align-items: center; gap: 4px; background: var(--hero); color: var(--hero-text); border-radius: var(--r-card); padding: 18px 8px 10px 22px; overflow: hidden; }
.banner h2 { font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1.25; }
.banner p { font-size: 14px; margin-top: 6px; opacity: 0.82; line-height: 1.45; }

/* 項目卡裡各皮膚才會用到的部分，預設不顯示 */
.proj-collage, .proj-count, .proj-bars, .proj-note, .proj-dot, .weight-card { display: none; }
.proj-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.proj-list > .proj { grid-column: span 2; }
.demo-note { align-items: center; margin-bottom: 12px; }
.demo-note .grow { flex: 1; }
.demo-note .btn { flex: none; }

/* 功能方塊：把首頁排滿，一眼看到能做什麼 */
.quick { display: flex; flex-direction: column; align-items: flex-start; text-align: left; position: relative; min-height: 112px; padding: 14px; background: var(--card); color: var(--text); border-radius: var(--r-card); box-shadow: var(--card-shadow); transition: transform 0.15s var(--ease); }
.quick:active { transform: scale(0.97); }
.quick .q-ico { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--on-accent-soft); display: grid; place-items: center; margin-bottom: auto; flex: none; }
.quick .q-ico svg { width: 20px; height: 20px; }
.quick b { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-top: 12px; }
.quick .q-desc { font-size: 12.5px; color: var(--text2); line-height: 1.4; margin-top: 2px; }
.quick.wide-q { grid-column: span 2; }
.quick.off .q-ico, .quick.off b { opacity: 0.5; }
.quick.q-pending { background: var(--warn-bg); color: var(--warn-text); }
.quick.q-pending .q-desc { color: inherit; opacity: 0.85; }
.quick.q-pending .q-ico { background: rgba(0, 0, 0, 0.09); color: inherit; }
.quick.q-scrub .q-ico svg { fill: currentColor; }
.q-vis { position: absolute; right: 12px; top: 12px; display: flex; pointer-events: none; }
.q-vis i { display: block; width: 32px; height: 42px; border-radius: 8px; overflow: hidden; background: var(--fill-2); box-shadow: 0 0 0 2px var(--solid, var(--card)); }
.q-vis i + i { margin-left: -10px; }
.q-vis img { display: block; width: 100%; height: 100%; object-fit: cover; }
.q-vis.v-pair i + i { margin-left: 3px; }
.q-vis.v-film i { width: 27px; height: 36px; border-radius: 4px; }
.q-vis.v-film i + i { margin-left: 3px; }
.q-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.q-chips i { font-style: normal; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--fill); color: var(--text2); }
.proj-list .card + .card { margin-top: 0; }
.proj-info { min-width: 0; flex: 1; }
.proj-badge { margin-top: 5px; }

/* 比較頁的「相隔」 */
.span-card { display: flex; align-items: baseline; gap: 10px; background: var(--ok-bg); color: var(--ok-text); border-radius: var(--r-list); padding: 14px 18px; margin-bottom: 10px; }
.span-card small { font-size: 13px; font-weight: 600; opacity: 0.8; white-space: nowrap; flex: none; }
.span-card strong { font-family: var(--font-num); font-size: 30px; font-weight: 800; line-height: 1; white-space: nowrap; flex: none; }
.span-card strong em { font-family: var(--font); font-size: 14px; font-style: normal; font-weight: 700; margin-left: 3px; }
.span-card span { margin-left: auto; min-width: 0; font-size: 13px; opacity: 0.85; text-align: right; }

/* 時光滑桿 */
.scrub { background: var(--card); border-radius: var(--r-card); box-shadow: var(--card-shadow); padding: 14px; margin-top: 14px; }
.scrub-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.scrub-head h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; flex: 1; white-space: nowrap; }
.scrub-head .pill-select select { min-height: 36px; font-size: 14px; max-width: 150px; }
.scrub-head .btn .ico svg { fill: currentColor; }
.scrub-stage { position: relative; aspect-ratio: 3 / 4; width: 100%; max-width: calc(46vh * 0.75); margin: 0 auto; background: #000; border-radius: var(--r-stage); overflow: hidden; touch-action: pan-y; cursor: ew-resize; }
.scrub-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.scrub-date, .scrub-day { position: absolute; bottom: 12px; background: rgba(0, 0, 0, 0.62); color: #fff; padding: 6px 13px; border-radius: 999px; font-weight: 700; font-size: 15px; pointer-events: none; }
.scrub-date { left: 12px; }
.scrub-day { right: 12px; font-family: var(--font-num); font-size: 14px; }
.scrub-track { position: relative; height: 52px; margin: 8px 14px 0; touch-action: none; cursor: pointer; outline-offset: 4px; }
.scrub-track::before { content: ""; position: absolute; left: -6px; right: -6px; top: 26px; height: 4px; border-radius: 2px; background: var(--fill-2); }
.scrub-fill { position: absolute; left: 0; top: 26px; height: 4px; border-radius: 2px; background: var(--accent); }
.scrub-tick { position: absolute; top: 20px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: var(--text2); opacity: 0.55; }
.scrub-tick.on { background: var(--accent); opacity: 1; }
.scrub-tick.tagged::after { content: ""; position: absolute; left: 50%; top: -13px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--tag-dot, var(--accent)); }
.scrub-thumb { position: absolute; top: 13px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; background: var(--accent); border: 4px solid var(--solid, var(--card)); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.scrub-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); margin: 0 6px; }
.scrub-info { min-height: 30px; margin: 10px 4px 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 14px; color: var(--text2); }
.scrub-foot { font-size: 12.5px; color: var(--text2); line-height: 1.5; margin: 8px 4px 0; }
.scrub-pick { background: var(--card); border-radius: var(--r-card); box-shadow: var(--card-shadow); padding: 14px 16px; margin-top: 14px; display: grid; gap: 10px; }
.scrub-pick b { font-family: var(--font-display); font-size: 17px; margin-right: 8px; }
.scrub-pick span { font-size: 14px; color: var(--text2); }

/* 閃切與分享卡 */
.stage.blink .blink-b { opacity: 0; }
.stage.blink.show-b .blink-b { opacity: 1; }
.hold { margin-top: 12px; touch-action: none; -webkit-touch-callout: none; }
.hold.down { transform: scale(0.98); filter: brightness(0.88); }
.share-btn { margin-top: 12px; }
.share-wrap { display: flex; justify-content: center; }
.share-prev { display: block; width: auto; height: auto; max-width: 100%; max-height: 58vh; border-radius: 18px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }

/* 批次匯入的總表 */
.batch-all { display: grid; gap: 8px; }
.batch-all .small { margin-top: 4px; }
.batch-all .add-tag { margin-top: 2px; }
.batch-row { align-items: flex-start; gap: 12px; padding: 12px 8px 12px 14px; }
.batch-row .thumb { width: 54px; height: 70px; }
.batch-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.batch-line + .batch-line { margin-top: 8px; }
.batch-marks { display: inline-flex; flex-wrap: wrap; gap: 5px; }
.batch-fill { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.batch-fill label { display: grid; gap: 5px; min-width: 0; }
.batch-fill .batch-date { min-width: 0; width: 100%; }
.batch-gap { -moz-appearance: textfield; }
.batch-date, .batch-line select { min-height: 38px; padding: 0 8px; border: 0; border-radius: 10px; background: var(--fill); font-size: 14px; outline: none; }
.batch-date { -webkit-appearance: none; appearance: none; min-width: 138px; }
.batch-line select { flex: 1; min-width: 0; }
.batch-date:focus, .batch-line select:focus { box-shadow: inset 0 0 0 2px var(--accent); }

/* 建立項目：選目的 */
.purpose-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.purpose { display: grid; gap: 2px; align-content: center; text-align: left; min-height: 68px; padding: 10px 12px; border-radius: var(--r-input); background: var(--card); box-shadow: inset 0 0 0 1px var(--sep); }
.purpose b { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.purpose span { font-size: 11.5px; color: var(--text2); line-height: 1.3; }
.purpose.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.purpose.on span { color: inherit; opacity: 0.85; }

/* 首次引導 */
.ob-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ob-steps li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; background: var(--card); border-radius: var(--r-list); padding: 12px; box-shadow: var(--card-shadow); }
.ob-text b { display: block; font-size: 15.5px; line-height: 1.35; }
.ob-text span { display: block; font-size: 13px; color: var(--text2); margin-top: 3px; line-height: 1.4; }
.ob-pic { height: 72px; border-radius: 12px; background: var(--fill); display: grid; place-items: center; padding: 8px; }
.ob-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; height: 34px; padding: 0 8px; border-radius: 10px; background: var(--solid, var(--card)); align-self: end; }
.ob-bar.top { align-self: start; }
.ob-bar i { width: 12px; height: 12px; border-radius: 4px; background: var(--fill-2); font-style: normal; font-size: 10px; color: var(--text2); }
.ob-bar.top i { width: auto; height: auto; background: none; }
.ob-bar em { flex: 1; height: 8px; border-radius: 4px; background: var(--fill-2); }
.ob-bar b { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 12px; flex: none; }
.ob-bar b svg, .ob-menu b svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.ob-menu { display: grid; gap: 4px; width: 100%; }
.ob-menu i { height: 12px; border-radius: 6px; background: var(--solid, var(--card)); }
.ob-menu b { display: flex; align-items: center; justify-content: space-between; height: 26px; padding: 0 8px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; white-space: nowrap; }
.ob-menu b span { display: block; }
.ob-lead { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 4px 4px 0; }

/* 皮膚選擇 */
.skin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.skin-opt { text-align: left; background: var(--solid, var(--card)); border-radius: 20px; padding: 10px 10px 12px; box-shadow: inset 0 0 0 1px var(--sep); }
.skin-opt.on { box-shadow: inset 0 0 0 2.5px var(--accent); }
.skin-prev { height: 104px; border-radius: 13px; padding: 12px 12px 0; display: grid; align-content: start; gap: 7px; position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.22); }
.skin-prev i { display: block; border-radius: 6px; }
.skin-prev .sp-title { width: 44%; height: 9px; opacity: 0.9; }
.skin-prev .sp-card { height: 32px; display: flex; align-items: center; gap: 6px; padding: 0 7px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.skin-prev .sp-card i:first-child { width: 18px; height: 18px; border-radius: 50%; }
.skin-prev .sp-card i:last-child { width: 46%; height: 7px; border-radius: 4px; }
.skin-prev .sp-card.short { width: 70%; height: 18px; }
.skin-prev .sp-bar { position: absolute; left: 30%; right: 30%; bottom: 7px; height: 7px; border-radius: 4px; }
.skin-name { font-weight: 700; font-size: 16px; margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.skin-check { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: inline-grid; place-items: center; }
.skin-check svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.skin-tag { font-size: 12.5px; color: var(--text2); margin: 1px 0 7px; }

/* 卡片與清單 */
.card { background: var(--card); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--card-shadow); }
.card + .card { margin-top: 12px; }
.list { background: var(--card); border-radius: var(--r-list); overflow: hidden; box-shadow: var(--card-shadow); }
.row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 54px; padding: 12px 18px; text-align: left; position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; background: var(--sep); }
.row .grow { flex: 1; min-width: 0; }
.row .val { color: var(--text2); text-align: right; }
.row .sub { color: var(--text2); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.row .chev { color: var(--text2); opacity: 0.7; font-size: 18px; }
.row.tap:active { background: var(--fill); }
.row.accent { color: var(--accent); font-weight: 600; }
.row.danger { color: var(--danger); font-weight: 600; }

/* 按鈕：膠囊形 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r-btn);
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: transform 0.15s var(--ease), opacity 0.15s;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.tinted { background: var(--accent-soft); color: var(--on-accent-soft); }
.btn.gray { background: var(--fill); color: var(--text); }
.btn.plain { color: var(--accent); padding: 0 12px; min-height: 40px; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 56px; font-size: 17px; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn:disabled { opacity: 0.38; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--text2); flex: none; }
.icon-btn:active { background: var(--fill-2); }
.icon-btn:disabled { opacity: 0.38; }

/* 小標籤 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px; padding: 0 16px; border-radius: var(--r-chip);
  border: 1px solid var(--outline); color: var(--text); font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.2s var(--ease);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
span.chip { background: var(--fill); border-color: transparent; }
.tag { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--on-accent-soft); white-space: nowrap; }
.badge { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: var(--fill); color: var(--text2); white-space: nowrap; }
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }

/* 分段控制 */
.seg { display: flex; background: var(--fill); border-radius: var(--r-seg); padding: 4px; }
.seg button { flex: 1; min-height: 36px; border-radius: var(--r-seg); font-size: 14px; font-weight: 500; padding: 0 10px; color: var(--text2); transition: background 0.2s var(--ease); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
@media (prefers-color-scheme: dark) { .seg button.on { background: var(--accent-soft); color: var(--on-accent-soft); box-shadow: none; } }

/* 篩選列 */
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 14px -16px 4px; padding: 0 16px 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.pill-select { position: relative; flex: none; }
.pill-select select {
  appearance: none; -webkit-appearance: none;
  min-height: 38px; padding: 0 34px 0 16px; border-radius: var(--r-chip);
  border: 1px solid var(--outline); background: transparent; font-size: 15px; font-weight: 500; max-width: 210px;
}
.pill-select.on select { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--on-accent-soft); font-weight: 600; }
.pill-select::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 6px; height: 6px;
  border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; opacity: 0.7;
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* 提示 */
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-notice); font-size: 14px; line-height: 1.5; background: var(--fill); }
.notice + .notice { margin-top: 8px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice.ok { background: var(--ok-bg); color: var(--ok-text); }
.notice .ico { flex: none; margin-top: 1px; }
.notice.tap:active { opacity: 0.7; }
.muted { color: var(--text2); }
.small { font-size: 13px; }

/* 空狀態 */
.empty { text-align: center; padding: 20px 20px 28px; color: var(--text2); }
.empty .art { max-width: 260px; margin: 0 auto 8px; }
.empty .art-hero { max-width: 170px; }
.empty h3 { color: var(--text); font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.empty .chips { justify-content: center; margin-top: 18px; }

/* 首頁項目卡 */
.proj-top { display: flex; gap: 14px; padding: 16px 16px 14px; align-items: center; width: 100%; text-align: left; position: relative; }
.proj-top:active { background: var(--fill); }
.proj-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-meta { color: var(--text2); font-size: 14px; margin-top: 2px; }
.proj-actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.proj-actions .btn { flex: 1; padding: 0 12px; }
.proj-actions .icon-btn { width: 48px; height: 48px; border-radius: 24px; background: var(--fill); color: var(--text); }
.proj-score { display: flex; justify-content: space-between; margin: 0 16px; padding: 12px 2px 14px; border-top: 1px solid var(--sep); font-size: 13px; color: var(--text2); }

/* 照片縮圖 */
.thumb { background: var(--fill); border-radius: var(--r-thumb); overflow: hidden; flex: none; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.s60 { width: 60px; height: 76px; }
.thumb.s72 { width: 68px; height: 86px; border-radius: 16px; }
.thumb.empty-thumb { display: flex; align-items: center; justify-content: center; color: var(--text2); }

/* 時間線 */
.month { font-size: 20px; font-weight: 700; margin: 26px 8px 12px; }
.rec-row { align-items: flex-start; padding: 14px 16px; }
.rec-row + .rec-row::before { left: 88px; }
.rec-date { font-weight: 700; }
.rec-meta { color: var(--text2); font-size: 14px; margin-top: 1px; }
.rec-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.rec-note { color: var(--text2); font-size: 13px; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 底部彈出頁 */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.42); z-index: 50; opacity: 0; transition: opacity 0.25s; }
.backdrop.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-width: 560px; margin: 0 auto;
  max-height: calc(100% - var(--safe-t) - 24px);
  display: flex; flex-direction: column;
  background: var(--sheet-bg, var(--bg)); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  transform: translateY(100%); transition: transform 0.4s var(--ease);
}
.sheet.tall { height: calc(100% - var(--safe-t) - 24px); }
.sheet.in { transform: none; }
.sheet::before { content: ""; position: absolute; top: 8px; left: 50%; width: 32px; height: 4px; margin-left: -16px; border-radius: 2px; background: var(--outline); }
.sheet-head {
  flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  min-height: 64px; padding: 14px 8px 0;
}
.sheet-head .title { font-weight: 700; font-size: 17px; text-align: center; white-space: nowrap; }
.sheet-head .right { justify-self: end; }
.sheet-head .left { justify-self: start; }
.sheet-head .btn.done { background: var(--accent); color: var(--on-accent); padding: 0 20px; margin-right: 6px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px calc(var(--safe-b) + 28px); }

/* 對話框與動作選單 */
.alert-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.42); opacity: 0; transition: opacity 0.2s; padding: 28px; }
.alert-wrap.in { opacity: 1; }
.alert { width: 100%; max-width: 320px; background: var(--solid, var(--card)); border-radius: var(--r-sheet); overflow: hidden; }
.alert .body { padding: 24px 24px 18px; }
.alert h3 { font-size: 20px; font-weight: 700; line-height: 1.3; }
.alert p { font-size: 14px; margin-top: 10px; line-height: 1.5; color: var(--text2); }
.alert .acts { display: flex; justify-content: flex-end; gap: 4px; padding: 0 16px 18px; }
.alert .acts button { min-height: 40px; padding: 0 16px; border-radius: 999px; color: var(--accent); font-size: 15px; font-weight: 600; }
.alert .acts button.danger { color: var(--danger); }
.alert .acts button:active { background: var(--fill); }
.action-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-width: 560px; margin: 0 auto; background: var(--solid, var(--card)); border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 20px 8px calc(var(--safe-b) + 12px); transform: translateY(110%); transition: transform 0.35s var(--ease); }
.action-sheet.in { transform: none; }
.action-sheet::before { content: ""; position: absolute; top: 8px; left: 50%; width: 32px; height: 4px; margin-left: -16px; border-radius: 2px; background: var(--outline); }
.action-sheet .cap { padding: 8px 16px 10px; font-size: 14px; font-weight: 600; color: var(--text2); }
.action-sheet button { display: block; width: 100%; min-height: 54px; padding: 0 16px; border-radius: 16px; text-align: left; font-size: 16px; font-weight: 500; }
.action-sheet button.danger { color: var(--danger); }
.action-sheet button.cancel { color: var(--text2); }
.action-sheet button:active { background: var(--fill); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); z-index: 90;
  transform: translate(-50%, 16px); opacity: 0; transition: all 0.25s var(--ease);
  background: #303030; color: #F2F2F2; font-size: 14px; font-weight: 500;
  padding: 13px 20px; border-radius: 999px; max-width: 86%; text-align: center; pointer-events: none;
}
.toast.in { transform: translate(-50%, 0); opacity: 1; }

.progress-wrap { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.42); padding: 28px; }
.progress-box { width: 100%; max-width: 300px; background: var(--solid, var(--card)); border-radius: var(--r-sheet); padding: 24px; text-align: center; }
.bar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; margin-top: 16px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 0.15s; }

/* 表單 */
.field-label { font-size: 14px; font-weight: 600; color: var(--text2); margin: 24px 8px 10px; }
.field-label:first-child { margin-top: 4px; }
.field-hint { font-size: 13px; color: var(--text2); margin: 9px 8px 0; line-height: 1.5; }
.input {
  display: block; width: 100%; min-height: 54px; padding: 12px 18px; border: 0; border-radius: var(--r-input);
  background: var(--card); font-size: 16px; outline: none; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow 0.15s;
}
.input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
textarea.input { min-height: 96px; resize: none; line-height: 1.45; }
.input:disabled { color: var(--text2); opacity: 0.55; }
input[type="date"].input { -webkit-appearance: none; appearance: none; text-align: left; }
.list .input { border-radius: 0; }
.row input.inline { border: 0; background: none; text-align: right; outline: none; min-width: 0; width: 130px; font-size: 16px; }
.box { background: var(--card); border-radius: var(--r-list); padding: 14px; }
.add-tag { display: flex; gap: 8px; margin-top: 12px; }
.add-tag .input { background: var(--fill); min-height: 40px; padding: 6px 16px; border-radius: 999px; }

.switch { position: relative; flex: none; width: 52px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-2); box-shadow: inset 0 0 0 2px var(--outline); transition: background 0.2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 8px; left: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--text2); transition: all 0.2s var(--ease); }
.switch input:checked + i { background: var(--accent); box-shadow: none; }
.switch input:checked + i::after { top: 4px; left: 24px; width: 24px; height: 24px; background: var(--on-accent); }
.switch input:disabled { cursor: default; }
.switch input:disabled + i { opacity: 0.4; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type="range"] { width: 100%; accent-color: var(--accent); margin: 8px 0 0; }

/* 確認頁的照片預覽 */
.confirm-photo { background: #000; border-radius: var(--r-stage); overflow: hidden; height: 240px; display: flex; align-items: center; justify-content: center; }
.confirm-photo img { max-width: 100%; max-height: 100%; display: block; }
.detail-photo { background: #000; border-radius: var(--r-stage); overflow: hidden; max-height: 56vh; display: flex; align-items: center; justify-content: center; }
.detail-photo img { max-width: 100%; max-height: 56vh; display: block; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row .btn { flex: 1; padding: 0 12px; }

/* 相機 */
.camera { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam-top { flex: none; display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-t) + 10px) 12px 10px; }
.cam-top .btn { color: #fff; font-weight: 500; }
.cam-top .btn.on { background: #FBBC04; color: #202124; padding: 0 16px; }
.cam-stage { flex: 1; position: relative; overflow: hidden; min-height: 0; border-radius: 24px; }
.cam-stage video, .cam-stage .ghost { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cam-stage video.mirror, .cam-stage .ghost.mirror { transform: scaleX(-1); }
.cam-stage .ghost { opacity: 0.38; pointer-events: none; }
.cam-msg { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; text-align: center; padding: 32px; color: #E3E3E3; font-size: 15px; line-height: 1.5; }
.cam-msg .btn { background: #fff; color: #1F1F1F; }
.cam-bottom { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 20px 26px calc(var(--safe-b) + 24px); }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; padding: 4px; }
.shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform 0.12s var(--ease); }
.shutter:active i { transform: scale(0.86); }
.shutter:disabled { opacity: 0.35; }
.cam-side { color: #fff; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; justify-self: start; }
.cam-side.right { justify-self: end; width: 48px; height: 48px; border-radius: 24px; background: rgba(255, 255, 255, 0.16); justify-content: center; }
.cam-side .ico { font-size: 20px; }

/* 比較 */
.slots { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: stretch; }
.slot { background: var(--card); border-radius: var(--r-list); box-shadow: var(--card-shadow); padding: 10px; display: flex; gap: 10px; align-items: center; text-align: left; min-width: 0; }
.slot:active { background: var(--fill); }
.slot .thumb { width: 44px; height: 56px; border-radius: 12px; }
.slot .who { font-size: 12px; font-weight: 600; color: var(--accent); }
.slot .when { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .what { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .grow { min-width: 0; flex: 1; }
.swap { align-self: center; background: var(--fill); color: var(--text); }
.stage { margin-top: 12px; background: #000; border-radius: var(--r-stage); overflow: hidden; position: relative; touch-action: none; cursor: grab; }
.stage.side { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.pane { position: relative; overflow: hidden; aspect-ratio: 3 / 4; background: #000; }
.pane img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; will-change: transform; pointer-events: none; -webkit-user-drag: none; }
.pane .clip { position: absolute; inset: 0; overflow: hidden; }
.pane-label { position: absolute; left: 10px; bottom: 10px; z-index: 3; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.pane-label.right { left: auto; right: 10px; }
.split-handle { position: absolute; top: 0; bottom: 0; width: 48px; margin-left: -24px; z-index: 4; cursor: ew-resize; touch-action: none; }
.split-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 23px; width: 2px; background: #fff; box-shadow: 0 0 3px rgba(0, 0, 0, 0.5); }
.split-handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: #fff; color: #1F1F1F; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; letter-spacing: 1px; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); }
.stage-tools { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.stage-tools .seg { flex: 1; }
.grid-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick { text-align: left; min-width: 0; }
.pick .thumb { width: 100%; aspect-ratio: 3 / 4; border-radius: 16px; }
.pick .cap { font-size: 13px; font-weight: 600; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick .cap2 { font-size: 11px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick.on .thumb { outline: 3px solid var(--accent); outline-offset: -3px; }

/* 匯出 */
.check { flex: none; width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--outline); display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: background 0.15s; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.check svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.result { background: #000; border-radius: var(--r-stage); overflow: hidden; display: flex; justify-content: center; }
.result img, .result video { max-width: 100%; max-height: 58vh; display: block; }
.range-head { display: flex; justify-content: space-between; }
.set-label { width: 44px; flex: none; }
.link { color: var(--accent); font-weight: 600; }

@media (min-width: 600px) {
  body { background: #E1E6EE; }
  #app { box-shadow: 0 0 48px rgba(0, 0, 0, 0.1); }
}
@media (min-width: 600px) and (prefers-color-scheme: dark) { body { background: #0A0A0B; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
