/* 我的月老 會員專區 v2（2026-11-04）。用法與元件清單見 md/APP_V2_COMPONENTS.md。
   載入順序：site.css（官網 tokens 與基礎）→ app-v2-legacy.css（舊 app.css 換色，給還沒重排的頁面）→ 本檔 → 頁面專屬 app-v2-<組名>.css。
   只用 --s-*／--l-*／--n-*／--header-* 與本檔下方的衍生 tokens，不寫死色碼（LINE 綠、照片上的深色遮罩除外）。
   動效只動 transform／translate／scale／opacity；減少動態時全部關閉。 */

/* ========== 1. 衍生 tokens ==========
   都是官網既有顏色拆成 rgb（給半透明用），不是新色票。--a-k 放大淺底上金線的透明度，黑金維持 1。
   狀態色只有一個：--a-danger（淺底＝酒紅 #8b1e24、深底＝舊 App 錯誤色 #dd8b8b，兩者都是既有值）。 */
:root, html[data-theme="gold"] {
  --a-l-ink-rgb: 42, 27, 18; --a-n-ink-rgb: 243, 230, 207; --a-gold-rgb-l: 176, 132, 63; --a-gold-rgb-n: 200, 162, 101;
  --a-shadow-rgb: 58, 36, 23; --a-shadow-k: .5; --a-k-l: 1.5;
  --a-danger-l: #8b1e24; --a-danger-rgb-l: 139, 30, 36;
}
html[data-theme="green"] {
  --a-l-ink-rgb: 22, 38, 28; --a-n-ink-rgb: 238, 245, 234; --a-gold-rgb-l: 70, 112, 82; --a-gold-rgb-n: 134, 168, 139;
  --a-shadow-rgb: 29, 58, 42; --a-shadow-k: .5; --a-k-l: 1.5;
  --a-danger-l: #8b1e24; --a-danger-rgb-l: 139, 30, 36;
}
html[data-theme="dark"] {
  --a-l-ink-rgb: 241, 234, 217; --a-n-ink-rgb: 241, 234, 217; --a-gold-rgb-l: 239, 189, 108; --a-gold-rgb-n: 239, 189, 108;
  --a-shadow-rgb: 0, 0, 0; --a-shadow-k: 1; --a-k-l: 1;
  --a-danger-l: #dd8b8b; --a-danger-rgb-l: 221, 139, 139;
}
html, .site-tone-light {
  --a-ink-rgb: var(--a-l-ink-rgb); --a-gold-rgb: var(--a-gold-rgb-l); --a-k: var(--a-k-l);
  --a-danger: var(--a-danger-l); --a-danger-rgb: var(--a-danger-rgb-l);
}
.site-tone-night {
  --a-ink-rgb: var(--a-n-ink-rgb); --a-gold-rgb: var(--a-gold-rgb-n); --a-k: 1;
  --a-danger: #dd8b8b; --a-danger-rgb: 221, 139, 139;
}
/* 舊樣式與頁面仍在用的名字，對到官網 tokens（區塊色調切換時一起變） */
html, .site-tone-light, .site-tone-night {
  --gold: var(--s-accent); --ivory: var(--s-ink); --black: var(--s-btn-ink);
  --app-line: var(--s-hair-soft); --app-card-line: var(--s-hair-soft); --app-card-bg: var(--s-card);
  --app-dim: var(--s-muted); --app-error: var(--a-danger);
}
:root {
  --red: #8b1e24; --a-on-red: #fbf2e2; /* 徽章：酒紅底＋黑金主題按鈕字色，都是既有值 */
  --a-r: 3px;
  --a-side: 0px; --a-side-gap: 0px;
  --app-header-h: 60px;
  --app-tabbar-h: 70px;
  --app-shell-w: 100%;
  --a-page-x: 16px;
  --header-h: var(--app-header-h);
}
@media (min-width: 768px) {
  :root { --a-side: 112px; --a-side-gap: 28px; --app-header-h: 74px; --a-page-x: 28px; }
}
@media (min-width: 1024px) {
  :root { --a-side: 232px; --a-side-gap: 36px; --a-page-x: 36px; }
}
@media (min-width: 1280px) {
  :root { --a-side: 256px; --a-side-gap: 48px; --a-page-x: 48px; }
}

/* ========== 2. 基礎 ========== */
.app-body {
  min-height: 100dvh;
  background: var(--l-bg);
  color: var(--s-ink);
  font-size: 16px;
  line-height: 1.75;
}
/* 頁面底色的光暈放固定層：不用 background-attachment: fixed（手機上捲動會重繪、iOS 也不支援） */
.app-body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--band-cream); pointer-events: none; }
html[data-theme="dark"] .app-body { background: var(--n-bg); }
html[data-theme="dark"] .app-body::before { background: var(--band-night); }
.app-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.site-skip { z-index: 70; }
:focus-visible { outline: 2px solid var(--s-accent); outline-offset: 3px; }

/* 主內容區：手機單欄；平板起讓出左側導覽。寬度上限與官網頁首同為 1560 */
.app-main {
  padding: calc(var(--app-header-h) + env(safe-area-inset-top, 0px) + 20px) var(--a-page-x) calc(var(--app-tabbar-h) + env(safe-area-inset-bottom, 0px) + 28px);
  overflow-x: clip;
}
.app-shell { width: 100%; max-width: 100%; margin-inline: auto; }
@media (min-width: 768px) {
  .app-main { padding-bottom: 56px; padding-top: calc(var(--app-header-h) + 32px); }
  .app-body--nav .app-main {
    margin-left: calc(max(var(--a-page-x), (100vw - 1560px) / 2 + var(--a-page-x)) + var(--a-side));
    padding-left: var(--a-side-gap);
    padding-right: max(var(--a-page-x), (100vw - 1560px) / 2 + var(--a-page-x));
  }
  /* 還沒重排的頁面：維持好讀的欄寬、靠左對齊標題；重排完成的頁面改用 app-shell--wide */
  .app-shell { max-width: 760px; margin-inline: 0; }
  .app-body--plain .app-shell { margin-inline: auto; }
  .app-shell--wide { max-width: none; }
}

/* ========== 3. 頂部（與官網 .site-header 同一語言） ========== */
.app-header {
  position: fixed; inset: 0 0 auto; z-index: 40; display: block;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--header-bg); border-bottom: 1px solid var(--header-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--header-ink);
}
.app-header__inner {
  width: 100%; max-width: 1560px; height: var(--app-header-h); margin: 0 auto;
  display: flex; align-items: center; gap: 4px; padding-inline: 10px 6px;
}
.app-header__brand { flex: none; display: flex; align-items: center; height: 44px; min-height: 48px; padding-inline: 4px; text-decoration: none; color: inherit; line-height: 0; }
.app-header__brand img { width: auto; max-height: none; height: 40px; object-fit: contain; } /* 淺底／深底兩張的切換交給 site.css 的 .site-logo--*，這裡不可寫 display */
.app-header__brand .site-header__brand-text, .app-header__brand-text { font-family: var(--serif-tc); font-size: 20px; line-height: 1.3; }
.app-header__back {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 48px; height: 48px; padding: 0 4px; color: var(--s-accent); text-decoration: none; font-size: 28px; line-height: 1;
}
.app-header__back-text { display: none; font-family: var(--serif-tc); font-size: 16px; letter-spacing: .08em; }
.app-header__title {
  flex: 1; min-width: 0; margin: 0 0 0 6px;
  font-family: var(--serif-tc); font-size: 18px; font-weight: 600; letter-spacing: .08em; line-height: 1.4; color: var(--header-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header__title a { color: inherit; text-decoration: none; display: flex; align-items: center; min-height: 48px; width: 100%; }
.app-header__member { display: none; }
.app-header__switch { display: none; }
.app-header--sub .app-header__brand { display: none; }

/* 通知 */
.app-bell { position: relative; flex: none; }
.app-bell__btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: auto; min-width: 48px; height: 52px; white-space: nowrap; padding: 0 4px; border: 0; background: none; color: var(--s-accent); cursor: pointer; font: inherit;
}
.app-bell__icon { position: relative; display: block; width: 24px; height: 24px; }
.app-bell__btn svg { display: block; width: 24px; height: 24px; }
.app-bell__label { font-size: 13px; line-height: 1.2; letter-spacing: .04em; color: var(--s-ink-2); }
.app-bell__badge {
  position: absolute; top: -5px; left: 13px; right: auto; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: var(--a-on-red); font-size: 12px; font-weight: 600; line-height: 19px; text-align: center;
}
.app-bell__panel, .app-theme__panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 45; width: min(320px, calc(100vw - 24px)); padding: 8px;
  border: 1px solid var(--s-hair); border-radius: var(--a-r); background: var(--s-bg-2); box-shadow: var(--card-shadow);
}
.app-bell__item { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 4px 14px; border-radius: var(--a-r); color: var(--s-ink); font-size: 16px; text-decoration: none; }
.app-bell__item:hover { background: rgba(var(--a-gold-rgb), .12); }
.app-bell__item + .app-bell__item { border-top: 1px solid var(--s-hair-soft); }
.app-bell__count { flex: none; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--red); color: var(--a-on-red); font-size: 14px; font-weight: 600; line-height: 24px; text-align: center; }
.app-bell__empty { margin: 0; padding: 14px; color: var(--s-muted); font-size: 16px; }

/* 配色：手機收在按鈕裡（一體式 switch 放大到每段 56×48）；平板起直接放在頁首，與官網相同 */
.app-theme { position: relative; flex: none; }
.app-theme__btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 48px; height: 52px; padding: 0 4px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--s-ink-2);
}
.app-theme__dots { display: block; width: 36px; height: 16px; margin: 4px 0; border-radius: 999px; box-shadow: 0 0 0 1px rgba(127, 127, 127, .6); background: linear-gradient(90deg, #b0843f 0 33.3%, #0b0a0a 33.3% 66.6%, #1f4a34 66.6%); }
.app-theme__label { font-size: 13px; line-height: 1.2; letter-spacing: .04em; }
.app-theme__panel { width: 220px; padding: 14px 16px 18px; }
.app-theme__title { margin: 0 0 12px; font-family: var(--serif-tc); font-size: 16px; font-weight: 600; letter-spacing: .08em; color: var(--s-ink); }
.site-switch.app-theme__switch { --seg-w: 60px; --seg-h: 44px; display: inline-flex; }
.site-switch.app-theme__switch .site-switch__btn::before { top: -2px; bottom: -2px; }
.site-switch.app-theme__switch .site-switch__btn::after { display: none; }

@media (min-width: 768px) {
  .app-header__inner { gap: 10px; padding-inline: var(--a-page-x); }
  .app-header__brand, .app-header--sub .app-header__brand { display: flex; }
  .app-body--nav .app-header__brand { width: var(--a-side); margin-right: calc(var(--a-side-gap) - 10px); }
  .app-header__brand img { height: 46px; }
  .app-header__back { min-width: 72px; padding-right: 10px; font-size: 24px; }
  .app-header__back-text { display: inline; }
  .app-header__title { margin: 0; font-size: 22px; letter-spacing: .1em; }
  .app-bell__btn { flex-direction: row; gap: 14px; min-width: 88px; height: 48px; padding: 0 10px; }
  .app-bell__label { font-family: var(--serif-tc); font-size: 16px; letter-spacing: .06em; color: var(--header-ink); }
  .app-theme { display: none; }
  .site-switch.app-header__switch { --seg-w: 34px; --seg-h: 28px; display: inline-flex; margin-inline: 4px 8px; }
  .site-switch.app-header__switch .site-switch__btn::before { top: -10px; bottom: -10px; } /* 點擊區 48px 高 */
  .app-header__member { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; max-width: 200px; padding: 2px 6px; color: var(--header-ink); text-decoration: none; }
  .app-header__avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--s-hair); background: var(--s-bg-2); }
  .app-header__member-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif-tc); font-size: 16px; letter-spacing: .06em; }
  .app-header__member:hover .app-header__member-name { color: var(--s-accent); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .app-header__member { max-width: 56px; }
  .app-header__member-name { display: none; } /* 平板頁首放不下：留頭像（aria-label 有名字），讓頁面標題不被截斷 */
  .app-body--nav .app-header__brand { width: auto; margin-right: 8px; }
}

/* ========== 4. 導覽 ==========
   手機：底部 Tab Bar。平板：左側窄欄（圖示在上、文字在下）。電腦：左側一般導覽列，圖示＋文字，目前頁以底色標示。
   負責人 2026-11-04 裁示：好操作優先，不做拱門、金線等裝飾。
   兩者輸出自同一份 nav-data.php，只差 class 前綴。 */
.app-sidenav { display: none; }
.app-tabbar {
  position: fixed; inset: auto 0 0; z-index: 30; display: block;
  background: var(--header-bg); border-top: 1px solid var(--header-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.app-tabbar__list { width: 100%; display: flex; margin: 0; padding: 0; list-style: none; }
.app-tabbar__item { flex: 1; min-width: 0; }
.app-tabbar__link {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--app-tabbar-h); min-width: 48px; padding-top: 2px;
  color: var(--s-ink-2); text-decoration: none; font-size: 15px; line-height: 1.2; letter-spacing: .02em; -webkit-tap-highlight-color: transparent;
}
.app-tabbar__icon { position: relative; display: block; width: 26px; height: 26px; }
.app-tabbar__icon > svg:first-child { display: block; width: 26px; height: 26px; }
.app-tabbar__label { white-space: nowrap; }
.app-tabbar__link[aria-current="page"] { color: var(--s-accent); font-weight: 600; background: rgba(var(--a-gold-rgb), .16); } /* 與電腦版相同：底色標示，不做金線與菱形（負責人裁示） */
.app-tabbar__link[aria-current="page"]::before, .app-tabbar__link[aria-current="page"]::after { display: none; } /* legacy 留下的金線 */
.app-tabbar__badge {
  position: absolute; top: 5px; left: calc(50% + 6px); transform: none; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: var(--a-on-red); font-size: 13px; font-weight: 600; line-height: 20px; text-align: center;
}
.app-tabbar__link--locked { color: var(--s-muted); }
.app-tabbar__note { font-size: 12px; line-height: 1.1; letter-spacing: 0; color: var(--s-muted); white-space: nowrap; }
.app-tabbar__link--locked .app-tabbar__icon > svg:first-child { opacity: .55; }
.app-nav-lock { position: absolute; right: -7px; bottom: -3px; width: 15px; height: 15px; padding: 1px; border-radius: 50%; background: var(--s-bg-2); color: var(--s-accent); }
body.is-editing .app-tabbar { translate: 0 100%; pointer-events: none; transition: translate 260ms var(--ease-out); }

@media (min-width: 768px) {
  .app-tabbar { display: none; }
  .app-sidenav {
    position: fixed; z-index: 20; display: block; overflow: hidden auto; overscroll-behavior: contain;
    top: var(--app-header-h); bottom: 0;
    left: max(var(--a-page-x), (100vw - 1560px) / 2 + var(--a-page-x)); width: var(--a-side);
    padding: 20px 0 24px; color: var(--s-ink);
    border-right: 1px solid var(--s-hair-soft);
    scrollbar-width: none;
  }
  .app-sidenav::-webkit-scrollbar { display: none; }
  .app-sidenav__list { list-style: none; margin: 0; padding: 0 12px 0 0; display: grid; gap: 4px; }
  .app-sidenav__link {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 76px; padding: 8px 2px; color: var(--s-ink-2); text-decoration: none; font-size: 15px; line-height: 1.25; text-align: center;
    border-radius: var(--a-r); transition: color .2s, background-color .2s;
  }
  .app-sidenav__link:hover { color: var(--s-ink); background: rgba(var(--a-gold-rgb), .1); }
  .app-sidenav__link:focus-visible { outline: 2px solid var(--s-accent); outline-offset: -2px; }
  .app-sidenav__link[aria-current="page"] { color: var(--s-accent); font-weight: 600; background: rgba(var(--a-gold-rgb), .16); }
  .app-sidenav__icon { position: relative; display: block; width: 26px; height: 26px; }
  .app-sidenav__icon > svg:first-child { display: block; width: 26px; height: 26px; }
  .app-sidenav__badge {
    position: absolute; top: 6px; left: calc(50% + 8px); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    background: var(--red); color: var(--a-on-red); font-size: 14px; font-weight: 600; line-height: 22px; text-align: center;
  }
  .app-sidenav__note { font-size: 13px; line-height: 1.2; color: var(--s-muted); }
  .app-sidenav__link--locked { color: var(--s-muted); }
  .app-sidenav__link--locked .app-sidenav__icon > svg:first-child { opacity: .6; }
  .app-sidenav .app-nav-lock { background: var(--s-bg); color: var(--s-accent); }
}
@media (min-width: 1024px) {
  .app-sidenav__list { padding-right: 16px; }
  .app-sidenav__link { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; gap: 0 14px; min-height: 56px; padding: 8px 14px; text-align: left; font-size: 17px; }
  .app-sidenav__badge { position: static; margin-left: auto; }
  .app-sidenav__note { flex-basis: 100%; padding-left: 40px; font-size: 14px; }
}

/* ========== 5. 共用元件 ========== */
/* --- 按鈕 --- */
.app-btn {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; padding: 10px 24px;
  font-family: var(--serif-tc); font-size: 17px; font-weight: 600; letter-spacing: .12em; line-height: 1.4; text-align: center; text-decoration: none;
  border: 1px solid var(--s-line); border-radius: 0; background: transparent; color: var(--s-ink); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .3s, color .3s, translate .35s var(--ease-out), scale .18s var(--ease-out), box-shadow .35s, border-color .3s;
}
.app-btn:active, .app-btn.is-pressed { scale: .98; }
.app-btn--primary { background: var(--s-btn); color: var(--s-btn-ink); border-color: var(--s-line); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); } /* 外陰影會壓到堆疊的下一顆按鈕 */
.app-btn--primary:hover { background: var(--s-btn-hover); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.app-btn--primary[disabled] { background: rgba(var(--a-ink-rgb), .14); color: var(--s-ink-2); border-color: var(--s-hair-soft); box-shadow: none; cursor: default; }
.app-btn--ghost { background: transparent; color: var(--s-ink); border-color: var(--s-hair); padding: 10px 20px; font-size: 16px; font-weight: 500; }
.app-btn--ghost:hover { background: rgba(var(--a-gold-rgb), .1); border-color: var(--s-line); }
.app-btn--danger { background: transparent; border-color: var(--a-danger); color: var(--a-danger); }
.app-btn--danger:hover { background: rgba(var(--a-danger-rgb), .1); }
.app-btn.is-done, .app-btn.is-done:disabled { border: 1px solid var(--s-line); background: rgba(var(--a-gold-rgb), .12); color: var(--s-accent); box-shadow: none; opacity: 1; cursor: default; }
.app-btn--auto { display: inline-flex; width: auto; min-width: 200px; }
.app-btn.app-btn--line { min-height: 56px; border-color: transparent; border-radius: 0; background: #06c755; color: #fff; font-family: var(--sans); letter-spacing: .04em; box-shadow: none; }
.app-btn-row { gap: 12px; }
.app-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.app-actions .app-btn { width: auto; flex: 1 1 200px; }
.app-ripple { background: radial-gradient(circle, rgba(var(--a-gold-rgb), .4), rgba(var(--a-gold-rgb), 0) 68%); }
.app-btn--primary .app-ripple { background: radial-gradient(circle, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 68%); }

/* --- 區塊與區塊標頭 --- */
.app-section {
  --a-sec-pad: clamp(18px, 2.4vw, 32px);
  position: relative; margin-top: 24px; padding: var(--a-sec-pad);
  border: 1px solid var(--s-hair-soft); border-radius: var(--a-r); background: var(--s-card); box-shadow: var(--shadow);
}
.app-section__title { margin: 0 0 16px; text-align: left; font-family: var(--serif-tc); font-size: 20px; font-weight: 600; letter-spacing: .08em; line-height: 1.5; color: var(--s-ink); }
.app-section__head { gap: 12px; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--s-hair-soft); }
.app-edit-btn { min-height: 48px; padding: 0 16px; border: 1px solid var(--s-hair); border-radius: 0; background: transparent; color: var(--s-accent); font-family: var(--serif-tc); font-size: 16px; font-weight: 600; letter-spacing: .06em; transition: background-color .25s, border-color .25s; }
.app-edit-btn:hover { background: rgba(var(--a-gold-rgb), .1); border-color: var(--s-line); }
.app-note, .app-hint { color: var(--s-ink-2); font-size: 16px; line-height: 1.8; }

/* 頁內區塊的開場：英文小字＋襯線標題＋菱形線（官網 .site-head 的縮小版，靠左） */
.app-pagehead { position: relative; margin: 0 0 20px; }
.app-pagehead__en { margin: 0 0 2px; font-family: var(--latin); font-style: italic; font-weight: 500; font-size: 19px; line-height: 1.3; letter-spacing: .03em; color: var(--s-accent); }
.app-pagehead__title { margin: 0; font-family: var(--serif-tc); font-size: clamp(22px, 2vw, 28px); font-weight: 600; line-height: 1.5; letter-spacing: .08em; color: var(--s-ink); }
.app-pagehead__title .site-num { font-size: 1.5em; background: none; color: var(--s-accent); -webkit-text-fill-color: currentColor; } /* 是資訊不是裝飾：不用官網的漸層字（金棕配色太淡） */
.app-pagehead__meta { margin: 2px 0 0; color: var(--s-ink-2); font-size: 16px; letter-spacing: .04em; }
.app-pagehead__rule { position: relative; display: block; width: min(240px, 60%); height: 1px; margin-top: 14px; background: linear-gradient(90deg, var(--s-line), var(--s-line) 60%, transparent); }
.app-pagehead__rule::after { content: ""; position: absolute; left: 0; top: 50%; width: 7px; height: 7px; border: 1px solid var(--s-line); background: var(--s-bg); transform: translate(0, -50%) rotate(45deg); }

/* --- 表單 --- */
.app-form label, .app-fieldset > p, .app-field__label { font-size: 16px; font-weight: 500; color: var(--s-ink-2); }
.app-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .app-form select, .app-form textarea {
  min-height: 52px; margin-top: 6px; padding: 12px 14px; border: 1px solid var(--s-hair); border-radius: 0; background-color: var(--s-input); color: var(--s-ink); font-family: var(--sans); font-size: 17px; line-height: 1.5;
  transition: border-color .2s, box-shadow .2s;
}
.app-form select { padding-right: 36px; }
.app-form input:focus-visible, .app-form select:focus-visible, .app-form textarea:focus-visible { outline: 2px solid var(--s-accent); outline-offset: 1px; border-color: var(--s-accent); }
.app-form input::placeholder, .app-form textarea::placeholder { color: var(--s-muted); }
.app-form select option { background: var(--s-bg-2); color: var(--s-ink); }
.app-form__grid { gap: 16px 14px; }
.app-fieldset { margin-top: 20px; }
.app-inline-error { color: var(--a-danger); }
.app-check { font-size: 16px !important; color: var(--s-ink); }

/* 編輯中黏底列 */
.app-form-actions { gap: 12px; margin: 20px calc(-1 * var(--a-sec-pad, 16px)) calc(-1 * var(--a-sec-pad, 22px)); padding: 14px var(--a-sec-pad, 16px) calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--s-hair); background: var(--s-bg-2); box-shadow: 0 -18px 30px -24px rgba(var(--a-shadow-rgb), .7); }

/* --- 卡片 --- */
.app-card { display: block; margin-bottom: 0; border: 1px solid var(--s-hair-soft); border-radius: var(--a-r); background: var(--s-card); box-shadow: var(--shadow); color: var(--s-ink); text-decoration: none; transition: translate .4s var(--ease-out), box-shadow .4s, border-color .3s; }
a.app-card:hover { border-color: var(--s-line); }
@media (hover: hover) { a.app-card:hover { translate: 0 -4px; box-shadow: var(--card-shadow); } }
.app-card__media { overflow: hidden; }
.app-card__media img { transition: transform .9s var(--ease-out); }
@media (hover: hover) { a.app-card:hover .app-card__media img { transform: scale(1.03); } }
.app-card__name { color: var(--n-ink); }
.app-card__name strong { font-family: var(--serif-tc); font-size: 20px; }
.app-card__name span { color: var(--n-ink); font-size: 16px; }
.app-card__info { color: var(--s-ink-2); font-size: 16px; }
.app-card__media::before { background: linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, rgba(0, 0, 0, 0) 26%), linear-gradient(0deg, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, 0) 38%); }

/* 拱門卡（名單、心動、收藏等人物卡）：照片上緣半圓，姓名放照片下方、不壓在臉上。內線已拿掉（2026-11-05 美術審核）：九張重複時會畫過頭髮與肩膀 */
.app-card--arch { display: flex; flex-direction: column; height: 100%; padding: 14px 14px 18px; }
.app-card--arch .app-card__media { aspect-ratio: 4 / 5; border-radius: 999px 999px 0 0; background: var(--s-bg-2); }
.app-card--arch .app-card__media::before { background: linear-gradient(0deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 26%); z-index: 1; }
.app-card__media:has(img[src*="avatar-neutral"])::before { display: none; } /* 佔位頭像是透明底：底部的黑色漸層不要蓋在淺底上 */
.app-card--arch .app-card__phototags { top: auto; right: 16px; bottom: 14px; left: 16px; justify-content: center; z-index: 3; }
.app-card__who { margin: 14px 2px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.app-card__who strong { font-family: var(--serif-tc); font-size: 22px; font-weight: 600; letter-spacing: .08em; color: var(--s-ink); line-height: 1.4; }
.app-card__who span { color: var(--s-ink-2); font-size: 16px; }
.app-card--arch .app-card__meta { padding: 10px 2px 0; }
.app-card--arch .app-card__info { padding: 10px 2px 0; margin-top: auto; display: grid; gap: 0; color: var(--s-ink-2); font-size: 16px; line-height: 1.6; }
.app-card--arch .app-card__info:not(:empty) { margin-top: 10px; border-top: 1px solid var(--s-hair-soft); }

/* 人物卡格線 */
.app-roster { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
@media (min-width: 640px) { .app-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .app-roster { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 24px; } }
.app-roster > .app-preview-card { display: flex; flex-direction: column; margin: 0; }
.app-preview-card .app-card--static { flex: none; height: auto; }
.app-preview-card__actions { padding: 12px 14px 16px; }
.app-preview-card .app-card { box-shadow: none; }
.app-preview-card__actions p { color: var(--s-ink-2); font-size: 16px; }
.app-preview-card__more { display: inline-flex; align-items: center; min-height: 48px; color: var(--s-accent); font-size: 16px; text-decoration: none; }

/* --- 標籤、徽章、選項 --- */
.app-tag { padding: 3px 10px; border-radius: 0; font-size: 14px; letter-spacing: .04em; }
.app-tag--new { border-color: var(--s-line); color: var(--s-accent); background: var(--s-bg-2); }
.app-tag--sent { border-color: var(--s-line); background: var(--s-bg-2); color: var(--s-accent); }
.app-tag--read { border-color: var(--s-line); background: var(--s-bg-2); color: var(--s-accent); }
.app-tag--off { border-color: var(--s-hair-soft); background: rgba(var(--a-ink-rgb), .06); color: var(--s-ink-2); }
.app-card__phototags .app-tag { background: var(--s-bg-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
.app-card__phototags .app-tag--read { background: var(--s-bg-2); color: var(--s-accent); }
.app-chip { padding: 5px 12px; border: 1px solid var(--s-hair); border-radius: 0; color: var(--s-ink-2); font-size: 15px; line-height: 1.5; }
.app-chip--sm { padding: 3px 10px; font-size: 15px; }
.app-status__badge { border-color: var(--s-line); color: var(--s-accent); background: transparent; font-size: 15px; border-radius: 0; }
.app-banner { border: 1px solid var(--s-hair); border-radius: var(--a-r); background: var(--s-bg-2); color: var(--s-ink); font-size: 16px; line-height: 1.75; }
.app-banner--ok { border-color: var(--s-line); }
.app-banner--warn { border-color: var(--a-danger); }
.app-subtabs__badge, .app-friend__dot { background: var(--red); color: var(--a-on-red); }
.app-subtabs__badge { min-width: 20px; height: 20px; font-size: 13px; line-height: 20px; border-radius: 10px; }

/* --- 分頁籤 --- */
.app-subtabs { margin: 0 0 20px; border-bottom: 1px solid var(--s-hair); gap: 4px; }
.app-subtabs a { min-height: 52px; padding: 12px 8px; display: flex; align-items: center; justify-content: center; font-family: var(--serif-tc); font-size: 17px; letter-spacing: .06em; color: var(--s-ink-2); transition: color .25s; }
.app-subtabs a:hover { color: var(--s-ink); }
.app-subtabs a[aria-current="page"] { color: var(--s-accent); font-weight: 600; }
.app-subtabs a[aria-current="page"]::after { left: 18%; right: 18%; height: 2px; background: var(--s-line); }
@media (min-width: 768px) { .app-subtabs a { flex: 0 1 auto; min-width: 140px; } }

/* --- 空狀態（官網卡片的內框＋圓章） --- */
.app-empty--card {
  position: relative; gap: 10px; padding: clamp(36px, 4vw, 56px) clamp(22px, 3vw, 44px);
  border: 1px solid var(--s-hair); border-radius: var(--a-r);
  background: radial-gradient(circle at 50% 0%, rgba(var(--dust), .1), rgba(var(--dust), 0) 55%), var(--s-card);
  box-shadow: var(--shadow);
}
.app-empty--card::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--s-hair-soft); pointer-events: none; }
.app-empty__icon { position: relative; width: 72px; height: 72px; margin-bottom: 10px; border: 1px solid var(--s-line); outline: 1px solid var(--s-hair-soft); outline-offset: 4px; background: var(--s-seal); color: var(--s-metal-hi); }
.app-empty__icon svg { width: 30px; height: 30px; }
.app-empty__title { position: relative; margin: 4px 0 0; font-family: var(--serif-tc); font-size: 21px; font-weight: 600; letter-spacing: .08em; line-height: 1.5; color: var(--s-ink); text-align: center; }
.app-empty__text { position: relative; color: var(--s-ink-2); font-size: 16px; line-height: 1.85; text-align: center; }
.app-empty--card .app-btn { position: relative; margin-top: 10px; }
@media (min-width: 768px) { .app-empty--card .app-btn { width: auto; min-width: 240px; } }

/* --- 對話框、底部面板、提示 --- */
.app-confirm { width: min(440px, calc(100vw - 32px)); padding: 28px 24px 24px; border: 1px solid var(--s-line); border-radius: 0; background: var(--s-bg-2); color: var(--s-ink); box-shadow: var(--card-shadow); }
.app-confirm::backdrop { background: rgba(0, 0, 0, .58); }
.app-confirm__title { color: var(--s-ink); font-family: var(--serif-tc); font-size: 21px; font-weight: 600; letter-spacing: .06em; line-height: 1.5; }
.app-confirm__body { color: var(--s-ink-2); }
.app-confirm__actions .app-btn { min-height: 54px; }
.app-sheet { z-index: 50; }
.app-sheet__backdrop { background: rgba(0, 0, 0, .55); }
.app-sheet__panel { max-width: none; background: var(--s-bg-2); border: 1px solid var(--s-hair); border-bottom: 0; color: var(--s-ink); box-shadow: var(--card-shadow); }
.app-sheet__panel::before { background: var(--s-hair); }
.app-sheet__head { background: var(--s-bg-2); border-bottom: 1px solid var(--s-hair-soft); color: var(--s-ink); font-family: var(--serif-tc); font-size: 18px; font-weight: 600; letter-spacing: .08em; }
.app-sheet__close { min-width: 48px; min-height: 48px; color: var(--s-ink-2); font-size: 16px; }
.app-sheet__group { color: var(--s-accent); font-size: 16px; }
.app-sheet__chips button[data-canned] { min-height: 48px; border: 1px solid var(--s-hair); border-radius: 0; background: var(--s-input); color: var(--s-ink); font-size: 16px; }
.app-sheet__chips button[data-canned]:hover { border-color: var(--s-line); }
@media (min-width: 768px) {
  /* 平板與電腦：底部面板改成置中對話框。不用 translate 置中：app-v2.js 的拖曳關閉寫的是 style.translate */
  .app-sheet__panel { inset: 0; margin: auto; width: min(600px, calc(100vw - 64px)); height: fit-content; max-height: 82dvh; border-bottom: 1px solid var(--s-line); border-color: var(--s-line); }
  .app-sheet__panel::before { display: none; }
}
.app-toast { top: calc(var(--app-header-h) + env(safe-area-inset-top, 0px) + 12px); border: 1px solid var(--s-line); border-radius: 0; background: var(--s-bg-2); color: var(--s-ink); box-shadow: var(--card-shadow); }
.app-toast svg { color: var(--s-accent); }
.app-toast--error { border-color: var(--a-danger); }
.app-toast--error svg { color: var(--a-danger); }
.app-progress { top: calc(var(--app-header-h) + env(safe-area-inset-top, 0px)); background: linear-gradient(90deg, var(--s-hair), var(--s-line)); }

/* 水平捲動容器裡有 .app-sr（絕對定位）時，容器要是定位基準，否則字會跑出捲動範圍、撐出整頁橫向捲動 */
.app-wz-steps { position: relative; }

/* ========== 6. 範本頁：最新名單 ========== */
.app-latest { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.app-latest__aside { display: grid; gap: 16px; min-width: 0; align-content: start; }
.app-latest__aside > * { margin: 0; }
.app-latest__list { min-width: 0; }
.app-lead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; margin: 0 0 20px; color: var(--s-ink-2); font-size: 16px; }
.app-hint { margin: 0 0 20px; }

/* 開始使用清單 */
.app-start { margin: 0; }
.app-start__head { align-items: baseline; }
.app-start__count { color: var(--s-ink-2); font-size: 16px; }
.app-start__mark { border-color: var(--s-line); color: var(--s-accent); font-family: var(--latin); font-size: 18px; }
.app-start__step.is-done .app-start__mark { background: var(--s-btn); color: var(--s-btn-ink); border-color: var(--s-btn); }
.app-start__title { color: var(--s-ink); font-size: 17px; }
.app-start__text { color: var(--s-ink-2); font-size: 16px; }
.app-start__link { color: var(--s-accent); font-size: 16px; min-height: 48px; display: inline-flex; align-items: center; }
.app-home-entry {
  display: flex; align-items: center; gap: 2px 14px; min-height: 60px; margin: 0; padding: 10px 18px;
  border: 1px solid var(--s-hair); border-radius: var(--a-r); background: var(--s-card); color: var(--s-ink); text-decoration: none; transition: border-color .25s;
}
.app-home-entry:hover { border-color: var(--s-line); }
.app-home-entry .app-bigmenu__arrow { margin-left: auto; color: var(--s-accent); font-size: 24px; }
.app-home-entry { flex-wrap: nowrap; }
.app-home-entry svg { flex: none; width: 28px; height: 28px; color: var(--s-accent); }
.app-home-entry strong { font-family: var(--serif-tc); font-size: 18px; color: var(--s-ink); letter-spacing: .06em; }
.app-home-entry span span { font-size: 16px; color: var(--s-ink-2); line-height: 1.5; }

/* ========== 7. 範本頁：會員中心 ========== */
.app-me { display: grid; gap: 20px; }
.app-me__top { display: grid; gap: 16px; }
.app-me__top > * { margin: 0; }
.app-me__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.app-me__side { display: grid; gap: 16px; min-width: 0; }
.app-me__side > * { margin: 0; }
.app-me__main { display: grid; gap: 24px; min-width: 0; }
.app-me__main > * { margin: 0; }
@media (min-width: 1100px) {
  .app-me__grid { grid-template-columns: 340px minmax(0, 1fr); gap: 32px; }
  .app-me__side { position: sticky; top: calc(var(--app-header-h) + 24px); }
}

/* 身分卡：手機橫向（頭像＋狀態）；電腦直向。頭像一律圓形，與頁首、朋友列表一致（2026-11-05 美術審核：外框、內框、頭像框、拱門四層太花俏） */
.app-mecard.app-mecard--hub { position: relative; margin: 0; padding: 20px 18px; gap: 14px 16px; border: 1px solid var(--s-hair); border-radius: var(--a-r); background: radial-gradient(circle at 50% 0%, rgba(var(--dust), .12), rgba(var(--dust), 0) 55%), var(--s-card); box-shadow: var(--shadow); }
.app-mecard__avatar { width: 88px; height: 88px; border: 1px solid var(--s-line); border-radius: 50%; background: var(--s-bg-2); object-fit: cover; }
.app-mecard__photo { border-radius: 50%; }
a.app-mecard__progress { display: block; color: var(--s-ink-2); text-decoration: none; min-height: 48px; }
.app-mecard__name { font-family: var(--serif-tc); font-size: 22px; font-weight: 600; letter-spacing: .08em; color: var(--s-ink); }
.app-mecard__progress { color: var(--s-ink-2); font-size: 16px; }
.app-mecard__progress strong { color: var(--s-accent); }
.app-mecard__bar, .app-fillcard__bar { height: 4px; border-radius: 0; background: rgba(var(--a-ink-rgb), .12); }
.app-mecard__bar > span, .app-fillcard__bar > span { border-radius: 0; background: var(--s-accent); }
.app-mecard__next p, .app-mecard__note { color: var(--s-ink-2); font-size: 16px; }
@media (min-width: 1100px) {
  .app-mecard.app-mecard--hub { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 32px 26px 26px; text-align: center; }
  .app-mecard__photo { position: relative; }
  .app-mecard__avatar { width: 136px; height: 136px; }
  .app-mecard__main { width: 100%; position: relative; }
  .app-mecard__name { margin-top: 10px; font-size: 26px; }
  .app-mecard__badges { display: flex; justify-content: center; }
  .app-mecard__next, .app-mecard__note { width: 100%; position: relative; }
}
.app-brandcard { padding: 8px 18px 8px; border: 1px solid var(--s-hair-soft); border-radius: var(--a-r); background: var(--s-card); }
.app-brandcard__row dt { color: var(--s-ink-2); font-size: 16px; }
.app-brandcard__row dd { color: var(--s-ink); font-size: 16px; font-weight: 600; }
.app-brandcard__row + .app-brandcard__row { border-top: 1px solid var(--s-hair-soft); }
.app-fillcard { padding: 18px; border: 1px solid var(--s-hair); border-radius: var(--a-r); background: var(--s-card); }
.app-fillcard__head { color: var(--s-ink); }
.app-fillcard__head strong { font-family: var(--serif-tc); font-size: 18px; letter-spacing: .06em; color: var(--s-ink); }
.app-fillcard__head span { color: var(--s-ink-2); font-size: 16px; }
.app-me-note { color: var(--s-ink-2); font-size: 16px; }

/* 選單群組：同一組收在一張卡裡，項目之間只有細線；電腦兩欄 */
.app-menu-section { min-width: 0; }
.app-menu-group { margin: 0 0 10px; padding: 0 2px; font-family: var(--serif-tc); font-size: 19px; font-weight: 600; letter-spacing: .1em; line-height: 1.5; color: var(--s-ink); }
summary.app-menu-group { display: flex; align-items: center; gap: 10px; min-height: 52px; margin: 0; padding: 4px 14px 4px 16px; border: 1px solid var(--s-hair-soft); border-radius: var(--a-r); background: var(--s-card); cursor: pointer; list-style: none; }
summary.app-menu-group::-webkit-details-marker { display: none; }
summary.app-menu-group small { margin-left: auto; font-family: var(--sans); font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--s-ink-2); }
summary.app-menu-group::after { content: "›"; flex: none; width: 20px; text-align: center; color: var(--s-accent); font-size: 22px; line-height: 1; rotate: 90deg; transition: rotate .2s; }
details[open] > summary.app-menu-group { margin-bottom: 10px; }
details[open] > summary.app-menu-group::after { rotate: -90deg; }
.app-bigmenu, .app-bigmenu--grouped { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 16px; border: 1px solid var(--s-hair-soft); border-radius: var(--a-r); background: var(--s-card); box-shadow: var(--shadow); }
.app-bigmenu a, .app-bigmenu--grouped a { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 2px; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--s-ink); text-decoration: none; transition: color .2s; }
.app-bigmenu a + a { border-top: 1px solid var(--s-hair-soft); }
.app-bigmenu svg { flex: none; width: 26px; height: 26px; margin: 0; color: var(--s-accent); }
.app-bigmenu a > span:nth-of-type(1) { min-width: 0; flex: 1; }
.app-bigmenu strong { display: block; font-family: var(--serif-tc); font-size: 18px; font-weight: 600; letter-spacing: .05em; line-height: 1.45; color: var(--s-ink); }
.app-bigmenu p { margin: 2px 0 0; font-size: 16px; line-height: 1.55; color: var(--s-ink-2); }
.app-bigmenu__arrow { flex: none; margin-left: auto; color: var(--s-accent); font-size: 22px; line-height: 1; transition: translate .3s var(--ease-out); }
.app-bigmenu a:hover strong { color: var(--s-accent); }
.app-bigmenu a:hover .app-bigmenu__arrow { translate: 3px 0; }
.app-me-logout-menu { margin-top: 0; }
@media (min-width: 1280px) {
  .app-menu-section .app-bigmenu { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; padding: 4px 24px; }
  .app-menu-section .app-bigmenu a + a { border-top: 0; }
  .app-menu-section .app-bigmenu a:nth-child(n + 3) { border-top: 1px solid var(--s-hair-soft); }
}

/* ========== 8. 範本頁：訊息與聊天 ==========
   手機：訊息頁是列表，聊天室用整頁捲動＋固定輸入列（與舊版相同）。
   平板起：左列表＋右對話；兩欄都在視窗內各自捲動，頁面本身不捲。 */
.app-friend { position: relative; min-height: 76px; gap: 14px; padding: 12px 8px; border-bottom: 1px solid var(--s-hair-soft); border-radius: 0; color: var(--s-ink); transition: background-color .2s; }
.app-friend:hover { background: rgba(var(--a-gold-rgb), .08); }
.app-friend[aria-current="true"] { background: rgba(var(--a-gold-rgb), .16); }
.app-friend[aria-current="true"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; background: var(--s-accent); }
.app-friend__avatar { width: 56px; height: 56px; border: 1px solid var(--s-hair); background: var(--s-bg-2); }
.app-friend__name { font-family: var(--serif-tc); font-size: 18px; letter-spacing: .05em; color: var(--s-ink); }
.app-friend__last { color: var(--s-ink-2); font-size: 16px; }
.app-friend__side { color: var(--s-muted); font-size: 14px; }
.app-friend__dot { min-width: 24px; height: 24px; border-radius: 12px; font-size: 14px; line-height: 24px; }
.app-friend__lock { color: var(--s-accent); font-size: 14px; }

.app-chatview__list-title { display: none; }
.app-chatview__placeholder { display: none; }
.app-chatview__peer { display: none; }
.app-chatview__list { display: block; }
.app-chatview--room .app-chatview__list { display: none; }
.app-chatview__pane, .app-chatview__top, .app-chatview__scroll { display: contents; }

.app-chat__notice { border: 1px solid var(--s-hair); border-radius: var(--a-r); background: var(--s-bg-2); color: var(--s-ink); font-size: 16px; }
.app-chat__notice--propose { border-color: var(--s-line); }
.app-chat__notice--cancelled { border-color: var(--a-danger); }
.app-chat__notice-text { color: var(--s-ink); font-size: 16px; }
.app-chat__notice .app-chat__notice-link { color: var(--s-accent); font-size: 16px; min-height: 48px; }
.app-chat__notice button[data-date-open] { background: transparent; border: 1px solid var(--s-hair); color: var(--s-ink); }
.app-chat__notice .app-chat__notice-actions .app-btn--primary { background: var(--s-btn); color: var(--s-btn-ink); }
.app-chat__notice .app-chat__notice-actions .app-btn--ghost { background: transparent; color: var(--s-ink); }
.app-chat__unlock { color: var(--s-ink-2); font-size: 15px; }
.app-chat__service { color: var(--s-ink-2); font-size: 15px; }
.app-chat__identity { border: 1px solid var(--s-line); border-radius: var(--a-r); background: var(--s-bg-2); color: var(--s-ink); font-size: 16px; }
.app-chat__identity-warn { color: var(--a-danger); }
.app-msg { margin: 14px 0; }
.app-msg__bubble { padding: 11px 15px; border-radius: 0; font-size: 17px; line-height: 1.65; }
.app-msg--them .app-msg__bubble { background: var(--s-bg-2); color: var(--s-ink); border: 1px solid var(--s-hair); border-radius: 0 14px 14px 14px; }
.app-msg--me .app-msg__bubble { background: var(--s-btn); color: var(--s-btn-ink); border: 1px solid var(--s-btn); border-radius: 14px 0 14px 14px; }
html[data-theme="dark"] .app-msg--me .app-msg__bubble { background: rgba(var(--a-gold-rgb), .16); border-color: var(--s-line); color: var(--s-ink); } /* 黑金的主按鈕是酒紅，整片紅色泡泡會蓋掉「紅色＝主要動作」 */
.app-msg__meta { color: var(--s-muted); font-size: 13px; line-height: 1.35; }
.app-msg--failed .app-msg__bubble { background: transparent; color: var(--s-ink); border: 1px dashed var(--a-danger); }
.app-msg--failed .app-msg__meta { color: var(--a-danger); }
.app-msg__retry { min-height: 48px; color: var(--a-danger); font-size: 16px; }

.app-chatbar { background: var(--header-bg); border-top: 1px solid var(--header-line); }
.app-chatbar form, .app-chatbar__inner { width: 100%; }
.app-chatbar input { min-height: 50px; padding: 12px 16px; border: 1px solid var(--s-hair); border-radius: 0; background: var(--s-input); color: var(--s-ink); font-size: 17px; }
.app-chatbar input::placeholder { color: var(--s-muted); }
.app-chatbar__send, .app-chatbar__send.app-chatbar__send--text { flex: none; width: auto; height: 50px; min-width: 48px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--s-line); border-radius: 0; background: var(--s-btn); color: var(--s-btn-ink); font-family: var(--serif-tc); font-size: 16px; font-weight: 600; letter-spacing: .06em; }
.app-chatbar__send:hover { background: var(--s-btn-hover); }

@media (min-width: 768px) {
  .app-page--chat .app-main { height: 100dvh; padding-top: calc(var(--app-header-h) + 20px); padding-bottom: 20px; }
  /* 聊天室：對方名字在右欄頂端（h1），頁首不重複；訊息頁：標題在頁首，左欄不重複 */
  .app-page--room .app-header__title { display: none; } /* 768～1179 單欄時要留返回鍵，≥1180 兩欄才收起 */
  .app-page--room .app-header__searchform, .app-page--room .app-header__search { margin-left: auto; } /* 標題收起時，搜尋不要跳到標題的位置 */
  .app-page--messages .app-chatview__list-title { display: none; }
  /* 768～1179：訊息頁只有列表，點進聊天室只有對話（2026-11-05 美術複查，窄欄擠不下兩欄）；≥1180 才兩欄 */
  .app-chatview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; height: 100%; border: 1px solid var(--s-hair); border-radius: var(--a-r); background: var(--s-card); box-shadow: var(--card-shadow); overflow: hidden; }
  .app-chatview__list { display: block; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .app-chatview--room .app-chatview__list, .app-page--messages .app-chatview__pane { display: none; }
  .app-chatview__list-title { display: block; position: sticky; top: 0; z-index: 2; margin: 0; padding: 16px 18px 12px; background: var(--s-bg-2); border-bottom: 1px solid var(--s-hair-soft); font-family: var(--serif-tc); font-size: 20px; font-weight: 600; letter-spacing: .1em; color: var(--s-ink); }
  .app-chatview__list .app-friend { padding-inline: 14px 12px; }
  .app-chatview__top { border-bottom: 1px solid var(--s-hair-soft); }
  .app-chatview__pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--band-paper); }
  .app-chatview__peer { display: flex; align-items: center; gap: 14px; flex: none; min-height: 72px; padding: 10px 20px; border-bottom: 1px solid var(--s-hair-soft); background: var(--s-bg-2); }
  .app-chatview__peer-photo { flex: none; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid var(--s-hair); background: var(--s-bg-2); }
  .app-chatview__peer-name { margin: 0; flex: 1; min-width: 0; font-family: var(--serif-tc); font-size: 21px; font-weight: 600; letter-spacing: .08em; line-height: 1.4; color: var(--s-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-chatview__peer-link { flex: none; display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; color: var(--s-accent); font-size: 16px; text-decoration: none; }
  .app-chatview__peer-link:hover { text-decoration: underline; text-underline-offset: 4px; }
  .app-chatview__top { display: block; flex: none; max-height: 52%; overflow-y: auto; padding: 14px 20px 0; }
  .app-chat__identity-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2px 20px; margin-bottom: 0; } /* 約會成立後的訂位資訊排成緊湊兩欄，整張卡放得下，不被切斷 */
  .app-chatview__top:empty { display: none; }
  .app-chatview__top > * { margin-bottom: 12px; }
  .app-chatview__scroll { display: block; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 24px 20px; }
  .app-chatview .app-chatbar { position: static; flex: none; display: block; padding: 12px 20px; background: var(--s-bg-2); border-top: 1px solid var(--s-hair); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .app-chatview--empty { display: block; height: auto; border: 0; background: none; box-shadow: none; overflow: visible; }
  .app-chatview--empty .app-chatview__list { border: 0; overflow: visible; }
  .app-page--messages.app-page--none .app-main { height: auto; }
  .app-chatview__placeholder { display: flex; flex: 1; align-items: center; justify-content: center; padding: 32px; text-align: center; }
  .app-chatview__placeholder .app-empty--card { max-width: 440px; border: 0; background: none; box-shadow: none; }
  .app-chatview__placeholder .app-empty--card::before { display: none; } /* 面板裡不再包一層卡片與內框 */
  .app-msg__bubble { max-width: min(68%, 560px); }
}
@media (min-width: 1180px) {
  .app-page--room .app-header__back { display: none; }
  .app-chatview { grid-template-columns: 320px minmax(0, 1fr); }
  .app-chatview__list, .app-chatview--room .app-chatview__list { display: block; border-right: 1px solid var(--s-hair); }
  .app-page--messages .app-chatview__pane { display: flex; }
}
@media (min-width: 1280px) {
  .app-chatview { grid-template-columns: 360px minmax(0, 1fr); }
}
.app-chat__empty { margin-top: 8px; }
.app-chatview__scroll [data-chat-log]:not(:empty) + .app-chat__empty { display: none; }

/* ========== 9. 動效 ==========
   與官網相同的緩動。不新增循環動畫，減少動態全部停用。 */
/* 外殼不做進場：這是多頁式網站，頁首與導覽每換一頁就重播只會讓人分心，內容區才有進場（legacy 的 .app-motion） */
.app-motion .app-header, .app-motion .app-tabbar, .app-motion .app-sidenav { animation: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .app-card, .app-btn, .app-card__media img, .app-bigmenu__arrow { transition: none !important; }
  a.app-card:hover { translate: none; }
  a.app-card:hover .app-card__media img { transform: none; }
}

/* 元件展示頁（只有 /app-v2-preview/components/ 用；切換上線可刪） */
.app-demo { max-width: 1100px; margin-inline: auto; }
.app-demo__h { margin: 40px 0 6px; font-family: var(--serif-tc); font-size: 22px; font-weight: 600; letter-spacing: .08em; color: var(--s-ink); }
.app-demo__h:first-child { margin-top: 0; }
.app-demo__note { margin: 0 0 14px; color: var(--s-ink-2); font-size: 16px; }
.app-demo__note code { font-size: 15px; color: var(--s-accent); }

/* 底部面板內的表單欄位、關閉鈕 */
.app-sheet__form input, .app-sheet__stack input, .app-sheet__stack select, .app-sheet__stack textarea { min-height: 52px; border: 1px solid var(--s-hair); border-radius: 0; background: var(--s-input); color: var(--s-ink); font-size: 17px; }
.app-sheet__close { border: 1px solid var(--s-hair-soft); border-radius: 0; background: transparent; }

/* 聊天室裡會影響決定的文字維持內文字級 */
.app-chat__identity-warn, .app-chat__unlock { font-size: 16px; }

/* 會員本人資料讀不到（app_me() 回空身分）：頁首下方固定一條提示，主內容讓位 */
.app-me-fail { position: fixed; z-index: 35; top: calc(var(--app-header-h) + env(safe-area-inset-top, 0px)); left: 0; right: 0; }
.app-me-fail .app-banner { margin: 0; border-width: 0 0 1px; border-radius: 0; padding: 10px var(--a-page-x); min-height: 52px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.app-banner__retry { display: inline-flex; align-items: center; min-height: 48px; padding-inline: 6px; }
.app-body:has(.app-me-fail) .app-main { padding-top: calc(var(--app-header-h) + env(safe-area-inset-top, 0px) + 88px); }

/* E59 頁首搜尋：手機與平板是按鈕（圖示＋文字，與通知同款），寬螢幕直接放輸入框 */
.app-header__searchform { display: none; }
.app-header__search { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 48px; height: 52px; padding: 0 2px; color: var(--s-accent); text-decoration: none; }
.app-header__search svg { display: block; width: 24px; height: 24px; }
@media (min-width: 768px) {
  .app-header__search { flex-direction: row; gap: 8px; height: 48px; padding: 0 8px; }
}
@media (min-width: 1180px) {
  .app-header__search { display: none; }
  .app-header__searchform { flex: 0 1 260px; min-width: 180px; display: flex; align-items: stretch; height: 50px; border: 1px solid var(--s-hair); background: var(--s-input); transition: border-color .2s; }
  .app-header__searchform:focus-within { border-color: var(--s-accent); }
  .app-header__searchform input { flex: 1; min-width: 0; height: 100%; padding: 0 4px 0 12px; border: 0; background: transparent; color: var(--s-ink); font: inherit; font-size: 16px; outline: none; }
  .app-header__searchform input::placeholder { color: var(--s-muted); }
  .app-header__searchform button { flex: none; width: 48px; border: 0; background: none; color: var(--s-accent); cursor: pointer; }
  .app-header__searchform button svg { display: block; width: 22px; height: 22px; margin: auto; }
}
/* 平板到小筆電的標題欄較窄（有搜尋入口）：標題最多兩行，不截字 */
@media (min-width: 768px) and (max-width: 1359px) {
  .app-header__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; text-wrap: balance; font-size: 18px; line-height: 1.25; letter-spacing: .04em; }
  .app-header__title a { min-height: 0; }
}
/* 窄手機多了一顆按鈕：Logo 與標題讓位，按鈕維持 48px */
@media (max-width: 380px) {
  .app-header__inner { padding-inline: 6px 2px; gap: 2px; }
  .app-header__brand { padding-inline: 2px; }
  .app-header__brand img { height: 32px; }
  .app-header__title { margin-left: 2px; font-size: 17px; letter-spacing: .03em; }
}
/* 從搜尋結果或入場 QR 連過去時，不要被固定頁首蓋住 */
[id^="event-"], [id^="faq-"], [id^="announcement-"] { scroll-margin-top: calc(var(--app-header-h) + 16px); }
.app-form :is(input, select, textarea) { scroll-margin-top: calc(var(--app-header-h) + 44px); }

/* ========== 10. 2026-11-05 審核修正（v0.98） ========== */
/* 勾選框與文字在同一行（.app-form label 的 display:block 權重較高，舊規則被蓋掉） */
.app-form label.app-events__check, .app-form label.app-feedback__confirm { display: flex; align-items: flex-start; gap: 10px; }
.app-form label.app-issue__opt { display: flex; align-items: center; gap: 12px; }
.app-form .app-events__notice-body { margin-left: 39px; } /* 對齊勾選框右邊的文字 */
/* 我的方案等頁面：舊規則的 .app-mc a 底線與強調色蓋掉分頁籤 */
.app-mc .app-subtabs a { color: var(--s-ink-2); text-decoration: none; }
.app-mc .app-subtabs a:hover { color: var(--s-ink); }
.app-mc .app-subtabs a[aria-current="page"] { color: var(--s-accent); }
/* 表單欄距：標籤要離上一欄比離自己這一欄遠；格線版面（.app-form__grid、發票頁）有自己的 gap */
.app-form > label + label { margin-top: 18px; }
.app-req { margin-left: 4px; color: var(--a-danger); font-size: 16px; font-weight: 400; }
/* 檔案選擇鈕：原生灰底看起來像停用；一律點擊區 48px、與其他次要按鈕同款 */
.app-me-note + .app-form { margin-top: 18px; }
.app-form input[type="file"] { display: block; width: 100%; padding: 0; border: 0; }
input[type="file"] { max-width: 100%; margin-top: 6px; background: transparent; color: var(--s-ink-2); font-family: var(--sans); font-size: 16px; }
input[type="file"]::file-selector-button { min-height: 48px; margin-right: 12px; padding: 0 16px; border: 1px solid var(--s-hair); border-radius: 0; background: transparent; color: var(--s-ink); font-family: var(--serif-tc); font-size: 16px; cursor: pointer; transition: background-color .2s, border-color .2s; }
input[type="file"]::file-selector-button:hover { border-color: var(--s-line); background: rgba(var(--a-gold-rgb), .1); }
/* 摺疊項目的展開記號（比照 FAQ 的＋／－），範圍只到這幾個：.app-menu-group 有自己的箭頭 */
.app-events__more > summary, .app-events__notice-body > summary, .app-fm-details > summary, .app-feedback__details > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; list-style: none; }
.app-events__more > summary::-webkit-details-marker, .app-events__notice-body > summary::-webkit-details-marker, .app-fm-details > summary::-webkit-details-marker, .app-feedback__details > summary::-webkit-details-marker { display: none; }
.app-events__more > summary::after, .app-events__notice-body > summary::after, .app-fm-details > summary::after, .app-feedback__details > summary::after { content: "＋"; flex: none; color: var(--s-accent); font-size: 18px; line-height: 1; }
.app-events__more[open] > summary::after, .app-events__notice-body[open] > summary::after, .app-fm-details[open] > summary::after, .app-feedback__details[open] > summary::after { content: "－"; }
/* 隱形 MATCH 表單的下拉，比照 .app-form select 的箭頭 */
select.app-mform__input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, rgba(var(--a-gold-rgb), calc(.7 * var(--a-k))) 50%), linear-gradient(135deg, rgba(var(--a-gold-rgb), calc(.7 * var(--a-k))) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
/* 驗證徽章：所有頁都是方角（原本只寫在 A 組樣式，其他頁載不到） */
.app-vbadge { border-radius: 0; }
/* 「發起約會」卡縮成一行 */
.app-chat__notice--row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.app-chat__notice--row .app-chat__notice-text { margin: 0; }
.app-chat__notice--row .app-chat__notice-actions { flex: none; margin: 0; }
.app-chat__notice--row .app-btn { width: auto; min-height: 48px; padding-inline: 18px; }
/* 開始使用：寬螢幕按鈕不撐滿 */
@media (min-width: 1024px) {
  .app-start__body > .app-btn, .app-start > .app-btn { display: inline-flex; width: auto; min-width: 240px; }
}
.app-safety .app-bigmenu a { text-decoration: none; }
/* 搜尋頁本身就有搜尋框，頁首不重複 */
.app-page--search .app-header__searchform, .app-page--search .app-header__search { display: none; }
.app-page--search .app-bell { margin-left: auto; }
/* 底部面板拿到焦點時不畫框：焦點只是讓讀屏念出名稱，按 Tab 才進入內容 */
.app-sheet__panel:focus { outline: none; }
/* 頁首搜尋框焦點：只靠外框變色不夠明顯 */
.app-header__searchform:focus-within { outline: 2px solid var(--s-accent); outline-offset: 1px; }
/* 手機子頁的長標題：改兩行，不截字 */
@media (max-width: 767px) {
  .app-header--sub .app-header__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; white-space: normal; font-size: 17px; line-height: 1.25; letter-spacing: .03em; }
}
