/* 離線內建子集化繁體字型（零外部連線可用） */
@font-face {
  font-family: "Noto Sans TC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/NotoSansTC-400.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans TC";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/NotoSansTC-700.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif TC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/NotoSerifTC-400.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif TC";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/NotoSerifTC-700.woff2") format("woff2");
}
@font-face {
  font-family: "Zen Maru Gothic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ZenMaruGothic-400.woff2") format("woff2");
}
@font-face {
  font-family: "LXGW WenKai TC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/LXGWWenKaiTC-400.woff2") format("woff2");
}

/* 主題色系定義：玉露（預設）、月光、極光、暖金 */
:root,
:root[data-theme="yulu"] {
  --bg-base: #F6F2E9;
  --bg: #F6F2E9;
  --bg-card: #FFFDF9;
  --bg-soft: #F1ECE0;
  --glass: rgba(255, 253, 249, 0.62);
  --glass-strong: rgba(255, 253, 249, 0.86);
  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-fallback: rgba(255, 253, 249, 0.96);
  --bloom-1: rgba(188, 220, 198, 0.54);
  --bloom-2: rgba(235, 212, 166, 0.54);
  --header-bg: rgba(255, 253, 249, 0.68);
  --header-fg: #1F3626;
  --primary: #2E4A36;
  --primary-dark: #1E3324;
  --primary-soft: rgba(46, 74, 54, 0.12);
  --accent: #C7923E;
  --accent-soft: #F7EEDB;
  --text: #1E2820;
  --text-muted: #647066;
  --border: rgba(46, 74, 54, 0.13);
  --slice-a: rgba(235, 226, 208, 0.68);
  --slice-b: rgba(255, 255, 255, 0.86);
  --slice-stroke: #3B5542;
  --slice-selected: rgba(182, 222, 192, 0.80);
  --slice-selected-stroke: #1F5130;
  --pendulum-fill: #C7923E;
  --pendulum-stroke: #8A5F1B;
  --ritual-bg: radial-gradient(circle at 50% 22%, #2B4A35 0%, #193122 54%, #0E1F15 100%);
  --orb-1: rgba(255, 255, 255, 0.96);
  --orb-2: rgba(184, 225, 196, 0.72);
  --orb-3: rgba(88, 155, 114, 0.54);
  --orb-glow: rgba(172, 226, 188, 0.42);
  --orb-text: #183121;
  --status-bar: #2E4A36;
  --danger: #B9382C;
  --danger-soft: #FDECEB;
  --ok: #256D41;
  --ok-soft: #E4F4EA;
  --shadow: 0 10px 28px rgba(32, 46, 36, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.74);
  --radius: 22px;
  --font-scale: 1;
  --app-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
}

:root[data-theme="moonlight"] {
  --bg-base: #EEF2F8;
  --bg: #EEF2F8;
  --bg-card: #FAFBFD;
  --bg-soft: #E4EAF3;
  --glass: rgba(250, 252, 255, 0.64);
  --glass-strong: rgba(250, 252, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.82);
  --glass-fallback: rgba(246, 249, 255, 0.97);
  --bloom-1: rgba(188, 210, 240, 0.56);
  --bloom-2: rgba(214, 206, 242, 0.48);
  --header-bg: rgba(248, 251, 255, 0.70);
  --header-fg: #263450;
  --primary: #3B4D70;
  --primary-dark: #25334F;
  --primary-soft: rgba(59, 77, 112, 0.13);
  --accent: #788EB8;
  --accent-soft: #E9EFF8;
  --text: #1E2534;
  --text-muted: #5F697E;
  --border: rgba(59, 77, 112, 0.14);
  --slice-a: rgba(227, 234, 246, 0.72);
  --slice-b: rgba(255, 255, 255, 0.88);
  --slice-stroke: #44577B;
  --slice-selected: rgba(195, 214, 244, 0.84);
  --slice-selected-stroke: #2A3E63;
  --pendulum-fill: #8EA2CB;
  --pendulum-stroke: #465B82;
  --ritual-bg: radial-gradient(circle at 50% 22%, #314266 0%, #1C2741 54%, #10172A 100%);
  --orb-1: rgba(255, 255, 255, 0.96);
  --orb-2: rgba(202, 218, 248, 0.74);
  --orb-3: rgba(116, 146, 204, 0.56);
  --orb-glow: rgba(190, 212, 252, 0.44);
  --orb-text: #1D2740;
  --status-bar: #3B4D70;
  --shadow: 0 10px 28px rgba(42, 56, 86, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

:root[data-theme="aurora"] {
  --bg-base: #EDF4FA;
  --bg: #EDF4FA;
  --bg-card: #FCFDFE;
  --bg-soft: #E8EEF7;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.82);
  --glass-fallback: rgba(250, 251, 255, 0.97);
  --bloom-1: rgba(178, 232, 218, 0.56);
  --bloom-2: rgba(232, 202, 234, 0.52);
  --header-bg: rgba(255, 255, 255, 0.68);
  --header-fg: #26444C;
  --primary: #39616A;
  --primary-dark: #23424A;
  --primary-soft: rgba(57, 97, 106, 0.13);
  --accent: #C79646;
  --accent-soft: #FAF2E1;
  --text: #202A33;
  --text-muted: #5C6875;
  --border: rgba(57, 97, 106, 0.14);
  --slice-a: rgba(230, 240, 246, 0.74);
  --slice-b: rgba(255, 255, 255, 0.90);
  --slice-stroke: #466B73;
  --slice-selected: rgba(182, 230, 214, 0.84);
  --slice-selected-stroke: #22584D;
  --pendulum-fill: #54A89B;
  --pendulum-stroke: #28665D;
  --ritual-bg: radial-gradient(circle at 50% 22%, #255052 0%, #173439 54%, #0D1E22 100%);
  --orb-1: rgba(255, 255, 255, 0.96);
  --orb-2: rgba(182, 238, 224, 0.74);
  --orb-3: rgba(98, 178, 170, 0.56);
  --orb-glow: rgba(168, 236, 220, 0.44);
  --orb-text: #173335;
  --status-bar: #39616A;
  --shadow: 0 10px 28px rgba(46, 72, 82, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

:root[data-theme="warmgold"] {
  --bg-base: #F7F1E5;
  --bg: #F7F1E5;
  --bg-card: #FFFDF8;
  --bg-soft: #EFE4CE;
  --glass: rgba(255, 252, 244, 0.66);
  --glass-strong: rgba(255, 252, 244, 0.88);
  --glass-border: rgba(255, 250, 238, 0.84);
  --glass-fallback: rgba(255, 252, 244, 0.97);
  --bloom-1: rgba(232, 208, 162, 0.56);
  --bloom-2: rgba(218, 202, 172, 0.48);
  --header-bg: rgba(255, 252, 244, 0.70);
  --header-fg: #543D19;
  --primary: #6E5023;
  --primary-dark: #4C3513;
  --primary-soft: rgba(184, 138, 62, 0.16);
  --accent: #B88A3E;
  --accent-soft: #F8EED8;
  --text: #29231B;
  --text-muted: #6E6252;
  --border: rgba(140, 108, 52, 0.16);
  --slice-a: rgba(241, 230, 208, 0.75);
  --slice-b: rgba(255, 253, 248, 0.90);
  --slice-stroke: #7E602D;
  --slice-selected: rgba(244, 220, 168, 0.84);
  --slice-selected-stroke: #7A5316;
  --pendulum-fill: #C7933B;
  --pendulum-stroke: #7D5615;
  --ritual-bg: radial-gradient(circle at 50% 22%, #4D3C21 0%, #2E2312 54%, #1A1309 100%);
  --orb-1: rgba(255, 254, 248, 0.96);
  --orb-2: rgba(244, 224, 178, 0.74);
  --orb-3: rgba(198, 152, 74, 0.56);
  --orb-glow: rgba(240, 212, 146, 0.42);
  --orb-text: #332510;
  --status-bar: #5A411B;
  --shadow: 0 10px 28px rgba(72, 54, 24, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

:root[data-theme="violet"] {
  --bg-base: #F5F1FA;
  --bg: #F5F1FA;
  --bg-card: #FCFAFF;
  --bg-soft: #E9E0F5;
  --glass: rgba(252, 248, 255, 0.68);
  --glass-strong: rgba(252, 248, 255, 0.90);
  --glass-border: rgba(246, 236, 255, 0.85);
  --glass-fallback: rgba(252, 248, 255, 0.97);
  --bloom-1: rgba(208, 174, 244, 0.52);
  --bloom-2: rgba(236, 214, 174, 0.44);
  --header-bg: rgba(252, 248, 255, 0.74);
  --header-fg: #3B2060;
  --primary: #522C82;
  --primary-dark: #34185A;
  --primary-soft: rgba(120, 74, 182, 0.14);
  --accent: #C49746;
  --accent-soft: #F6ECFC;
  --text: #22192E;
  --text-muted: #655778;
  --border: rgba(94, 58, 140, 0.16);
  --slice-a: rgba(235, 224, 248, 0.78);
  --slice-b: rgba(252, 249, 255, 0.92);
  --slice-stroke: #5A3588;
  --slice-selected: rgba(226, 200, 248, 0.86);
  --slice-selected-stroke: #49227A;
  --pendulum-fill: #B886D8;
  --pendulum-stroke: #4A2478;
  --ritual-bg: radial-gradient(circle at 50% 22%, #331B54 0%, #1E1033 56%, #0F081B 100%);
  --orb-1: rgba(255, 252, 255, 0.96);
  --orb-2: rgba(232, 206, 252, 0.78);
  --orb-3: rgba(142, 88, 206, 0.56);
  --orb-glow: rgba(212, 172, 252, 0.48);
  --orb-text: #26163B;
  --status-bar: #2A1448;
  --shadow: 0 10px 28px rgba(56, 30, 92, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: calc(15px * var(--font-scale));
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  font-family: var(--app-font);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(110% 58% at 12% 4%, var(--bloom-1) 0%, transparent 62%),
    radial-gradient(96% 54% at 90% 94%, var(--bloom-2) 0%, transparent 64%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  -webkit-tap-highlight-color: transparent;
}

.svg-slice {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.thin-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

/* Liquid Glass 基礎材質 */
.glass-surface {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* 響應式骨架：手機單欄／平板雙欄／寬螢幕三欄 */
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

.app-sidebar,
.catalog-rail {
  display: none;
}

.app-stage {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

/* 頂部精簡導覽列 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 14px)) 8px max(14px, env(safe-area-inset-left, 14px));
  background: transparent;
  transition: background 0.24s ease-out, padding 0.24s ease-out, box-shadow 0.24s ease-out;
}

.app-header.is-scrolled {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 6px 22px rgba(24, 36, 28, 0.06);
  padding-top: calc(7px + env(safe-area-inset-top, 0px));
  padding-bottom: 7px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.session-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 58%;
  min-height: 40px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.session-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFDF9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.session-chip-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease-out;
}

.icon-btn:active {
  transform: scale(0.95);
}

.update-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF4D4F;
  border: 1.5px solid #FFF;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow: var(--shadow);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 42px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.22, 1.35, 0.36, 1), background 0.2s ease-out;
}

.compact-pill {
  min-height: 36px;
  padding: 6px 11px;
  border-radius: 13px;
  font-size: 0.84rem;
}

.pill-btn:active {
  transform: scale(0.96);
}

.primary-pill {
  background: var(--primary);
  color: #FFFDF9;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(30, 51, 36, 0.22);
}

.danger-pill {
  background: var(--danger);
  color: #FFFFFF;
  border-color: transparent;
}

.report-pill-btn {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--primary);
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #FFF;
  font-size: 0.74rem;
  font-weight: 700;
}

.accent-badge {
  background: var(--accent);
  color: #FFFDF9;
}

/* 主內容滾動區 */
.main-content {
  padding: 6px max(14px, env(safe-area-inset-right, 14px)) calc(120px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 14px));
  max-width: 900px;
  width: 100%;
  min-width: 0;
  overflow-x: clip;
  margin: 0 auto;
}

.card {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
}

/* 頁首大標題（30px 粗體，捲動縮放） */
.hero-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.hero-title {
  margin: 0;
  font-size: 2rem; /* 約 30px @ 15px 基準 */
  font-weight: 700;
  line-height: 1.22;
  color: var(--primary-dark);
  letter-spacing: -0.01em;
  transition: font-size 0.24s ease-out;
}

.app-stage.scrolled .hero-title {
  font-size: 1.55rem;
}

.hero-subline {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.hero-nav-arrows {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 4px;
}

.nav-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-circle-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* 首頁專屬卡片與格子 */
.home-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.home-search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 0.94rem;
}

.continue-hero-card {
  border-radius: 26px;
  padding: 20px;
  margin-bottom: 16px;
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #FFFDF9;
  box-shadow: 0 14px 32px rgba(24, 42, 30, 0.22);
}

.continue-kicker {
  font-size: 0.82rem;
  opacity: 0.78;
  margin-bottom: 4px;
}

.continue-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.continue-head-row .continue-kicker {
  margin-bottom: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-reset-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  color: #FFFDF9;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease-out, transform 0.2s ease-out;
}

.continue-reset-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.24);
}

.continue-fresh-sub {
  font-size: 0.84rem;
  opacity: 0.84;
  margin-bottom: 14px;
  line-height: 1.45;
}

.continue-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.continue-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.continue-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.continue-fill {
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.continue-pct-label {
  font-size: 0.8rem;
  opacity: 0.85;
  white-space: nowrap;
}

.continue-cta-btn {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: 999px;
  background: #FFFDF9;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  transition: transform 0.2s ease-out;
}

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

.home-tiles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.home-tile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 14px;
  border-radius: 22px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 700;
  font-size: 0.96rem;
  cursor: pointer;
  text-align: left;
  transition: transform 0.2s ease-out;
}

.home-tile-btn:active {
  transform: scale(0.97);
}

.home-tile-btn .thin-svg {
  color: var(--primary);
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 4px 10px;
}

.section-head-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.section-head-link {
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}

.recent-rec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-rec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.recent-rec-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.recent-rec-title {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-rec-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--primary-dark);
  flex-shrink: 0;
}

/* 「更多」分頁群組選單 */
.more-group-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 14px 6px 8px;
}

.more-group-card {
  border-radius: 24px;
  overflow: hidden;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}

.more-row-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.more-row-btn:last-child {
  border-bottom: none;
}

.more-row-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
}

.more-row-left span {
  color: var(--text);
}

.more-row-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* 擺盤雙總表頁：頁頭說明與控制列 */
.question-box {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 8px;
}

.question-box div + div {
  margin-top: 4px;
}

.note-banner {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.seg-group {
  display: inline-flex;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 3px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease-out, color 0.2s ease-out;
}

.seg-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tool-chip {
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}

.tool-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.role-tag-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding: 9px 11px;
  background: var(--bg-soft);
  border-radius: 14px;
  font-size: 0.86rem;
}

.subchart-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.subchart-tab {
  flex: 1;
  min-width: 110px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  border-radius: 16px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.subchart-tab.active {
  background: var(--primary);
  color: #FFF;
  border-color: transparent;
}

/* 圖表 SVG 容器 */
.chart-box-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

.svg-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
}

.svg-wrap svg {
  width: 100%;
  height: auto;
  max-width: 680px;
  display: block;
}

.svg-slice {
  cursor: pointer;
  transition: opacity 0.14s ease;
}

.svg-slice:active {
  opacity: 0.78;
}

/* 擺盤下方即時摘要與待查雙膠囊卡 */
.chart-quick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  max-width: 100%;
  min-width: 0;
}

.chart-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 13px 16px;
  border-radius: 22px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

.chart-result-meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.chart-result-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.chart-result-val {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--primary);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 全螢幕專注圖盤浮動返回鍵 */
.fs-back-float {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: calc(14px + env(safe-area-inset-left, 0px));
  z-index: 90;
  border-radius: 999px;
  padding: 8px 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

body.chart-fullscreen .app-sidebar,
body.chart-fullscreen .catalog-rail,
body.chart-fullscreen .app-header,
body.chart-fullscreen .bottom-nav-capsule,
body.chart-fullscreen .page-header-card,
body.chart-fullscreen .subchart-tabs,
body.chart-fullscreen .saved-dock-section,
body.chart-fullscreen #jumpBar {
  display: none !important;
}

body.chart-fullscreen .main-content {
  max-width: 940px;
  padding-top: 62px;
  padding-bottom: 24px;
}

/* 好讀清單模式 */
.list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 560px) {
  .list-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 46px;
}

.option-btn.selected {
  background: var(--slice-selected);
  border-color: var(--slice-selected-stroke);
  font-weight: 700;
}

.option-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.jump-hint-badge {
  font-size: 0.74rem;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 2px 7px;
  font-weight: 600;
}

/* 決策大卡 */
.decision-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.decision-btn {
  text-align: left;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.decision-btn.selected {
  background: var(--slice-selected);
  border-color: var(--slice-selected-stroke);
}

.decision-jump-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 9px;
  border-radius: 999px;
}

/* 防呆左滑移除紀錄卡 */
.saved-dock-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.swipe-delete-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 9px;
  border: 1px solid var(--border);
  background: var(--danger);
}

.swipe-delete-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 112px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: var(--danger);
}

.swipe-confirm-del {
  width: 100%;
  border: none;
  background: var(--danger);
  color: #FFF;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0 8px;
}

.swipe-card-front {
  position: relative;
  z-index: 2;
  background: var(--bg-card);
  padding: 12px;
  transition: transform 0.2s ease;
  touch-action: pan-y;
}

.swipe-delete-wrap.swipe-open .swipe-card-front {
  transform: translateX(-112px);
}

.saved-item-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
}

.saved-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-weight: 700;
  font-size: 0.94rem;
}

.swipe-unlock-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.swipe-delete-wrap.swipe-open .swipe-unlock-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

.pct-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.pct-chip {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.pct-chip.active {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
}

.pct-slider {
  flex: 1;
  min-width: 90px;
}

.note-input-inline {
  width: 100%;
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.88rem;
}

.ritual-speech-box {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* 隨機抽選模組樣式（Feature B） */
.random-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 104px;
}

.random-seg-full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
}

.random-seg-full .seg-btn {
  text-align: center;
  padding: 8px 6px;
}

.random-q-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  color: var(--text);
  outline: none;
}

.random-yesno-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.random-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 118px;
  border-radius: 24px;
  border: 1.5px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.24s ease-out, background 0.24s ease-out, border-color 0.24s ease-out;
}

.random-card-btn.selected {
  background: var(--slice-selected);
  border-color: var(--slice-selected-stroke);
  transform: scale(1.03);
}

.random-card-btn.shuffling {
  animation: randomShufflePulse 0.5s ease-in-out;
}

@keyframes randomShufflePulse {
  0% { transform: scale(1) rotate(0deg); opacity: 0.72; }
  35% { transform: scale(0.94) rotate(-3deg); opacity: 0.52; }
  70% { transform: scale(1.04) rotate(2deg); opacity: 0.88; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.random-sym-circle { color: var(--primary); }
.random-sym-cross { color: var(--danger); }
.random-sym-tri { color: var(--accent); }

.random-breath-overlay {
  position: fixed;
  inset: 0;
  z-index: 92;
  background: rgba(16, 28, 20, 0.76);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  color: #FFFDF9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  cursor: pointer;
}

.random-breath-orb {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--orb-1) 0%, var(--orb-2) 55%, var(--orb-3) 100%);
  color: var(--orb-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 42px var(--orb-glow);
  animation: breathPulseSimple 1.5s ease-in-out infinite alternate;
}

@keyframes breathPulseSimple {
  from { transform: scale(0.95); }
  to { transform: scale(1.05); }
}

.random-breath-num {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
}

.random-custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  margin-bottom: 8px;
  transition: transform 0.2s ease-out;
}

.random-custom-row.selected {
  background: var(--slice-selected);
  border-color: var(--slice-selected-stroke);
  font-weight: 700;
}

/* 底部建議前往跳轉佇列 */
.jump-bar {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 12px));
  right: max(12px, env(safe-area-inset-right, 12px));
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 44;
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(24, 38, 28, 0.14);
  padding: 9px 13px;
}

.jump-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.jump-bar-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--primary);
}

.jump-bar-controls {
  display: flex;
  gap: 6px;
}

.mini-text-btn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.jump-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.jump-bar.collapsed .jump-list {
  display: none;
}

.jump-pill-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  cursor: pointer;
  min-width: 148px;
  max-width: 230px;
}

.jump-pill-btn.visited {
  border-color: var(--ok);
  background: var(--ok-soft);
  opacity: 0.86;
}

.jump-pill-target {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--primary);
}

.jump-pill-from {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 手機底部懸浮膠囊導覽 */
.bottom-nav-capsule {
  position: fixed;
  left: max(14px, env(safe-area-inset-left, 14px));
  right: max(14px, env(safe-area-inset-right, 14px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2px;
  padding: 5px 6px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 32px rgba(20, 32, 24, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.bnav-btn {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.22s ease-out, color 0.22s ease-out;
}

.bnav-btn .thin-svg {
  width: 19px;
  height: 19px;
}

.bnav-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

/* 總目錄搜尋與章節列表 */
.catalog-view-search {
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  color: var(--text);
  margin-bottom: 12px;
  outline: none;
}

.cat-group {
  margin-bottom: 10px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--glass);
  box-shadow: var(--shadow);
}

.cat-head {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: transparent;
  border: none;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.cat-items {
  display: flex;
  flex-direction: column;
}

.cat-group.collapsed .cat-items {
  display: none;
}

.drawer-page-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  text-align: left;
  padding: 10px 14px;
  border: none;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.36);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
}

.drawer-page-btn.active {
  background: var(--primary-soft);
  font-weight: 700;
  color: var(--primary);
}

/* Toast */
.toast {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  background: rgba(28, 42, 32, 0.94);
  color: #FFFDF9;
  padding: 10px 16px;
  border-radius: 18px;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  width: max-content;
  max-width: min(92vw, 360px);
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: center;
}

/* 通用玻璃彈窗／手機底抽抽屜 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 82;
  background: rgba(18, 26, 20, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  background: var(--glass-strong);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 28px 28px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.22);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: transform 0.24s ease-out;
}

.sheet-grabber {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(80, 92, 84, 0.28);
  margin: 10px auto 2px;
  flex-shrink: 0;
}

.modal-card-wide {
  max-width: 680px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.04rem;
  color: var(--primary);
}

.modal-body {
  padding: 14px 16px 20px;
  overflow-y: auto;
}

@media (min-width: 600px) {
  .modal {
    align-items: center;
    padding: 18px;
  }
  .modal-card {
    border-radius: 26px;
    padding-bottom: 0;
  }
  .sheet-grabber {
    display: none;
  }
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

/* 主題色票選擇器 */
.theme-swatch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.theme-swatch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.theme-swatch-btn.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.theme-swatch-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #FFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  flex-shrink: 0;
}

/* 實戰工作表樣式 */
.ws-field {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 10px;
}

.ws-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.ws-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
}

.ws-link-btn {
  flex-shrink: 0;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* 世界地圖與安全對照 */
.world-map-wrap img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.region-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.safety-row {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.safety-row h4 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.94rem;
}

/* 靈擺全螢幕專注放大遮罩 */
.zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px));
}

.zoom-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.zoom-title {
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
}

.zoom-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin: 4px 0 8px;
}

.zoom-svg-host {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.zoom-svg-host svg {
  width: 100%;
  height: auto;
  max-height: 82vh;
}

/* 綜合評估報告與查詢紀錄全螢幕 */
.report-overlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: var(--bg-base);
  background-image:
    radial-gradient(110% 58% at 12% 4%, var(--bloom-1) 0%, transparent 62%),
    radial-gradient(96% 54% at 90% 94%, var(--bloom-2) 0%, transparent 64%);
  display: flex;
  flex-direction: column;
}

.report-topbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  color: var(--primary);
}

.report-topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-top-title {
  flex: 1;
  font-weight: 700;
  font-size: 1.04rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-top-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.report-top-actions .pill-btn {
  width: 100%;
  padding: 6px 4px;
}

@media (min-width: 600px) {
  .report-topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .report-topbar-main {
    flex: 1;
    min-width: 0;
  }
  .report-top-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
  }
  .report-top-actions .pill-btn {
    width: auto;
    padding: 6px 13px;
  }
}

.report-action-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-action-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.report-action-row-2 .pill-btn {
  width: 100%;
  padding: 8px 6px;
  font-size: 0.86rem;
}

.report-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
}

.report-section {
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  padding: 15px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.report-section h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.report-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.report-kpi {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 9px 11px;
}

.report-kpi .k { font-size: 0.78rem; color: var(--text-muted); }
.report-kpi .v { font-size: 1rem; font-weight: 700; color: var(--primary); }

.alert-high {
  background: var(--danger-soft);
  border-left: 4px solid var(--danger);
  padding: 9px 11px;
  border-radius: 12px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.timeline-item {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  margin-bottom: 10px;
}

/* 極簡登入畫面（Feature G） */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(120% 60% at 15% 10%, var(--bloom-1) 0%, transparent 62%),
    radial-gradient(100% 55% at 88% 92%, var(--bloom-2) 0%, transparent 64%);
  overflow-y: auto;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 18px calc(36px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.auth-wrap {
  width: 100%;
  max-width: 380px;
  margin: auto 0;
  text-align: center;
}

.auth-emblem-box {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 22px;
  background: var(--glass-strong);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.auth-brand-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.auth-brand-en {
  margin: 3px 0 22px;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.auth-card {
  width: 100%;
  text-align: left;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  padding: 20px 18px;
  box-shadow: 0 18px 42px rgba(24, 40, 28, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 15px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  margin-bottom: 11px;
  outline: none;
}

.auth-primary-btn {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #FFFDF9;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 2px;
}

.auth-secondary-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.56);
  color: var(--primary);
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 9px;
}

.auth-footer-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.auth-text-link {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px;
}

/* 指紋與生物辨識解鎖介面 */
.bio-unlock-panel {
  text-align: center;
  padding: 10px 6px 4px;
}

.bio-unlock-circle {
  width: 78px;
  height: 78px;
  margin: 10px auto 12px;
  border-radius: 50%;
  border: 1.5px solid var(--glass-border);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(46, 74, 54, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease-out, background 0.2s ease-out;
}

.bio-unlock-circle:active {
  transform: scale(0.95);
}

.bio-quick-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 999px;
  border: 1.5px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.bio-status-msg {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 4px 0 14px;
}

/* 高我靜心調頻儀式：純白珍珠光球覆蓋層（Feature F） */
.ritual-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--ritual-bg);
  color: #F4FBF6;
  overflow-y: auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
}

.ritual-holo-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
  transform: translateZ(0);
}

.ritual-overlay * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.ritual-shell {
  position: relative;
  z-index: 2;
  max-width: 460px;
  min-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transform: translateZ(0);
}

.ritual-top-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.ritual-top-row > :first-child {
  justify-self: start;
}

.ritual-top-row > :nth-child(2) {
  justify-self: center;
}

.ritual-top-row > :last-child {
  justify-self: end;
}

.ritual-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #FFFDF9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ritual-top-pill {
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.88rem;
  font-weight: 700;
  color: #F4FBF6;
}

.ritual-voice-seg {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 2px;
}

.ritual-voice-btn {
  border: none;
  background: transparent;
  color: rgba(244, 251, 246, 0.72);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.ritual-voice-btn.active {
  background: rgba(255, 255, 255, 0.94);
  color: var(--primary-dark);
}

.ritual-theme-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.ritual-theme-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ritual-theme-dot.active {
  transform: scale(1.18);
  border-color: #FFFFFF;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.65);
}

.ritual-orb-stage {
  position: relative;
  width: 248px;
  height: 236px;
  margin: 2px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ritual-arc-svg {
  position: absolute;
  inset: 0;
  width: 248px;
  height: 236px;
  transform: rotate(-90deg);
  pointer-events: none;
  opacity: 0.48;
}

.ritual-orb-core {
  position: relative;
  z-index: 2;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: none;
  color: rgba(255, 252, 246, 0.96);
  text-shadow: 0 2px 18px rgba(10, 6, 22, 0.88), 0 0 24px rgba(255, 244, 214, 0.36);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 1.6s ease-in-out;
}

.ritual-orb-stage.phase-inhale .ritual-orb-core,
.ritual-orb-stage.phase-hold .ritual-orb-core,
.ritual-orb-stage.phase-higher .ritual-orb-core {
  transform: scale(1.06);
}

.ritual-orb-stage.phase-exhale .ritual-orb-core,
.ritual-orb-stage.phase-ego .ritual-orb-core {
  transform: scale(0.95);
}

.ritual-orb-label {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
}

.ritual-orb-digit {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 2px;
}

.ritual-stage-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin: 2px 0;
}

.ritual-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: width 0.25s ease-out, background 0.25s ease-out;
}

.ritual-dot.active {
  width: 22px;
  background: #FFFDF9;
}

.ritual-subtitle-box {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 22px;
  padding: 15px 16px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1rem;
  line-height: 1.58;
  color: #F4FBF6;
}

.ritual-audio-panel {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  padding: 12px 14px;
}

.ritual-audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ritual-play-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #FFFDF9;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.ritual-audio-progress {
  flex: 1;
  accent-color: #FFFFFF;
}

.ritual-audio-time {
  font-size: 0.78rem;
  color: rgba(244, 251, 246, 0.82);
  font-variant-numeric: tabular-nums;
}

.ritual-toggle-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 9px;
}

.ritual-chip-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 251, 246, 0.92);
  padding: 7px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
}

.ritual-geo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ritual-geo-pill {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 252, 246, 0.85);
  padding: 4px 10px;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.ritual-geo-pill.active {
  background: rgba(255, 255, 255, 0.92);
  color: #1F172A;
  border-color: #FFFFFF;
}
  font-weight: 600;
  cursor: pointer;
}

.ritual-chip-btn.active {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.52);
  color: #FFFDF9;
}

.ritual-calib-card {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 12px 14px;
  transition: border-color 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

.ritual-calib-card.ritual-spotlight {
  border-color: var(--orb-1);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 22px var(--orb-glow);
}

.ritual-calib-card.ritual-step-done {
  border-color: var(--orb-2);
  background: rgba(255, 255, 255, 0.15);
}

.ritual-step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.ritual-range {
  width: 100%;
  accent-color: var(--orb-1);
}

.ritual-step-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.ritual-action-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  color: #FFFDF9;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.ritual-proceed-btn {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.56);
  cursor: not-allowed;
}

.ritual-proceed-btn.ritual-ready {
  background: #FFFDF9;
  color: var(--primary-dark);
  box-shadow: 0 10px 26px var(--orb-glow);
  cursor: pointer;
}

.ritual-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: auto;
}

.ritual-ghost-btn {
  border: none;
  background: transparent;
  color: rgba(244, 251, 246, 0.72);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
}

/* 老師後台與進度條 */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.toggle-switch.on {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}

.toggle-switch.off {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.progress-track {
  width: 100%;
  height: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.2s ease;
}

.poster-preview-wrap {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 8px;
  text-align: center;
}

.poster-preview-wrap img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
}

/* 平板側欄（>=600px） */
@media (min-width: 600px) {
  .bottom-nav-capsule {
    display: none;
  }

  .app-shell {
    flex-direction: row;
    gap: 12px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 12px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 12px));
    align-items: stretch;
  }

  .app-sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(10px + env(safe-area-inset-top, 0px));
    height: calc(100vh - 22px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    width: 200px;
    flex-shrink: 0;
    border-radius: 26px;
    padding: 14px 10px;
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
  }

  .app-sidebar.collapsed {
    width: 72px;
    padding: 14px 8px;
    overflow: hidden;
  }

  .app-sidebar.collapsed .sidebar-head {
    justify-content: center;
  }

  .app-sidebar.collapsed .sidebar-brand {
    display: none;
  }

  .app-sidebar.collapsed #btnToggleSidebar svg,
  .catalog-rail.collapsed #btnToggleRail svg {
    transform: rotate(180deg);
  }

  .sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
    padding: 2px 4px;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
  }

  .sidebar-logo {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--primary);
    color: #FFFDF9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    flex-shrink: 0;
  }

  .sidebar-brand-name {
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
    overflow: hidden;
  }

  .sidebar-toggle-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.55);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }

  .sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
  }

  .snav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    border: none;
    border-radius: 16px;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease-out, color 0.2s ease-out;
  }

  .snav-btn.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
  }

  .sidebar-session-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.55);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
  }

  .app-sidebar.collapsed .sidebar-brand-name,
  .app-sidebar.collapsed .snav-label,
  .app-sidebar.collapsed .sidebar-sess-name {
    display: none;
  }

  .app-sidebar.collapsed .snav-btn,
  .app-sidebar.collapsed .sidebar-session-btn {
    justify-content: center;
    padding: 9px;
  }

  .jump-bar {
    position: sticky;
    left: auto;
    right: auto;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: min(720px, calc(100% - 28px));
    margin: 0 auto 14px;
  }

  .chart-quick-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .main-content {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

/* 寬平板三欄：側欄 + 可收合總目錄欄 + 擺盤（>=840px） */
@media (min-width: 840px) {
  .catalog-rail {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(10px + env(safe-area-inset-top, 0px));
    height: calc(100vh - 22px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    width: 264px;
    flex-shrink: 0;
    border-radius: 26px;
    padding: 14px 12px;
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
  }

  .catalog-rail.collapsed {
    width: 48px;
    padding: 12px 6px;
  }

  .catalog-rail.collapsed .rail-body-wrap,
  .catalog-rail.collapsed .rail-title-text {
    display: none;
  }

  .rail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
  }

  .rail-title-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
  }

  .rail-body-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .rail-search-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    margin-bottom: 10px;
    font-size: 0.86rem;
    outline: none;
  }

  .rail-scroll-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 2px;
  }

  .rail-page-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 11px;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    font-size: 0.86rem;
    text-align: left;
    cursor: pointer;
    margin-bottom: 3px;
  }

  .rail-page-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
  }

  .rail-page-num {
    font-size: 0.76rem;
    color: var(--text-muted);
    flex-shrink: 0;
  }
}

@media (min-width: 1024px) {
  .main-content {
    max-width: 1100px;
  }
}

/* 摺疊機雙螢幕展開自適應 */
@media (horizontal-viewport-segments: 2) {
  .app-sidebar {
    display: none !important;
  }

  .app-shell {
    flex-direction: row;
    gap: calc(env(viewport-segment-left 1 0, 50vw) - env(viewport-segment-right 0 0, 50vw) + 16px);
    padding: 12px;
  }

  .catalog-rail {
    display: flex !important;
    flex-direction: column;
    width: calc(env(viewport-segment-width 0 0) - 24px);
    flex-shrink: 0;
  }

  .app-stage {
    width: calc(env(viewport-segment-width 1 0) - 16px);
    flex: 0 0 auto;
  }
}

/* 隨機抽選：是非題模式切換與 3D 蓋牌靈擺選取 */
.rnd-submode-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

.rnd-submode-seg .seg-btn {
  text-align: center;
  padding: 7px 6px;
}

.rnd-card-3d {
  display: block;
  width: 100%;
  perspective: 900px;
  min-height: 160px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.rnd-card-3d.shuffling:nth-child(1) {
  animation: rndShuffleLeft 0.9s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.rnd-card-3d.shuffling:nth-child(2) {
  animation: rndShuffleMid 0.9s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.rnd-card-3d.shuffling:nth-child(3) {
  animation: rndShuffleRight 0.9s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.rnd-card-inner {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 160px;
  transform-style: preserve-3d;
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1);
}

.rnd-card-3d.flipped .rnd-card-inner {
  transform: rotateY(180deg);
}

.rnd-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 22px;
  border: 1.5px solid var(--glass-border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 6px;
}

.rnd-card-back {
  background: linear-gradient(155deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: rgba(255, 253, 249, 0.92);
  border-color: rgba(255, 255, 255, 0.36);
}

.rnd-card-back-emblem {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.rnd-card-front {
  background: var(--glass-strong);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  color: var(--text);
  transform: rotateY(180deg);
}

.rnd-card-3d.selected .rnd-card-front {
  background: var(--slice-selected);
  border-color: var(--slice-selected-stroke);
}

/* 開場高我光韻啟動動畫（仿姓名學啟動光渦粒子感） */
.splash-intro {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--ritual-bg);
  color: #FFFDF9;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
}

.splash-intro.is-playing {
  animation: guayouSplashExit 1.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.splash-vortex {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0%, var(--orb-glow) 35%, transparent 65%, rgba(255, 255, 255, 0.25) 85%, transparent 100%);
  filter: blur(8px);
  animation: guayouVortex 1.5s ease-out forwards;
}

.splash-plasma {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--orb-1) 0%, var(--orb-2) 40%, transparent 72%);
  opacity: 0;
  animation: guayouPlasma 1.4s ease-out forwards;
}

.splash-plasma-2 {
  width: 180px;
  height: 180px;
  animation-delay: 0.14s;
}

.splash-sparks {
  position: relative;
  width: 1px;
  height: 1px;
  grid-area: 1 / 1;
}

.splash-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--sz, 6px);
  height: var(--sz, 6px);
  border-radius: 50%;
  background: #FFFDF9;
  box-shadow: 0 0 12px var(--orb-1);
  opacity: 0;
  animation: guayouSpark 1.1s var(--sd, 0.1s) ease-out forwards;
}

.splash-center {
  position: relative;
  z-index: 2;
  grid-area: 1 / 1;
  text-align: center;
  animation: guayouTitleReveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.splash-emblem {
  width: 82px;
  height: 82px;
  margin: 0 auto 14px;
  border-radius: 26px;
  background: radial-gradient(circle at 32% 28%, var(--orb-1) 0%, var(--orb-2) 55%, var(--orb-3) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 42px var(--orb-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.splash-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.splash-sub {
  margin-top: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  opacity: 0.78;
}

@keyframes guayouVortex {
  0% { transform: scale(0.55) rotate(-45deg); opacity: 0; }
  35% { opacity: 0.95; }
  100% { transform: scale(1.65) rotate(60deg); opacity: 0; }
}

@keyframes guayouPlasma {
  0% { transform: scale(0.35); opacity: 0; }
  30% { opacity: 0.85; }
  100% { transform: scale(4.2); opacity: 0; }
}

@keyframes guayouSpark {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.1); }
}

@keyframes guayouTitleReveal {
  0% { opacity: 0; transform: scale(0.86); filter: blur(10px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes guayouSplashExit {
  0%, 68% { opacity: 1; transform: scale(1); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.12); filter: blur(16px); visibility: hidden; }
}

/* iOS 26 彈簧液態轉場與觸控光暈（透過設定開關 body.motion-enabled 控制） */
body.motion-enabled .ios-page-enter {
  animation: ios26PageEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

body.motion-enabled .modal:not(.hidden) .modal-card {
  animation: ios26SheetEnter 0.32s cubic-bezier(0.2, 0.85, 0.32, 1.04);
}

body.motion-enabled .report-overlay:not(.hidden),
body.motion-enabled .ritual-overlay:not(.hidden),
body.motion-enabled .zoom-modal:not(.hidden) {
  animation: ios26OverlayEnter 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.ios-tap-glow {
  position: fixed;
  z-index: 200;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.78) 0%, var(--orb-glow) 38%, transparent 72%);
  transform: translate(-50%, -50%) scale(0.2);
  animation: ios26TapGlow 0.36s ease-out forwards;
}

@keyframes ios26PageEnter {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes ios26SheetEnter {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes ios26OverlayEnter {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes ios26TapGlow {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.25); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
}

/* 不支援模糊或偏好降低透明度時改為穩固實底 */
@supports not (backdrop-filter: blur(1px)) {
  .glass-surface,
  .app-header.is-scrolled,
  .session-chip-btn,
  .icon-btn,
  .pill-btn,
  .card,
  .home-search-box,
  .home-tile-btn,
  .recent-rec-item,
  .more-group-card,
  .seg-group,
  .random-q-input,
  .random-card-btn,
  .jump-bar,
  .bottom-nav-capsule,
  .modal-card,
  .report-section,
  .auth-card,
  .app-sidebar,
  .catalog-rail {
    background: var(--glass-fallback) !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .glass-surface,
  .app-header.is-scrolled,
  .session-chip-btn,
  .icon-btn,
  .pill-btn,
  .card,
  .home-search-box,
  .home-tile-btn,
  .recent-rec-item,
  .more-group-card,
  .seg-group,
  .random-q-input,
  .random-card-btn,
  .jump-bar,
  .bottom-nav-capsule,
  .modal-card,
  .report-section,
  .auth-card,
  .app-sidebar,
  .catalog-rail {
    background: var(--glass-fallback) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

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

@media print {
  body > *:not(#reportOverlay) { display: none !important; }
  #reportOverlay {
    position: static !important;
    background: #FFFFFF !important;
    display: block !important;
  }
  .no-print { display: none !important; }
  .report-body { overflow: visible !important; max-width: none !important; padding: 0 !important; }
  .report-section { box-shadow: none !important; break-inside: avoid; border: 1px solid #CCC !important; }
}

/* v2.0.10: App Icon 圖示自適應、設定按鈕防破版與三張蓋牌洗牌動畫 */
.emblem-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.modal-card .pill-btn,
.ws-field .pill-btn {
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  height: auto;
  min-height: 44px;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

@keyframes rndShuffleLeft {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(58%, -10px) rotate(8deg) scale(1.04); z-index: 3; }
  55% { transform: translate(115%, 4px) rotate(-6deg) scale(0.98); z-index: 1; }
  80% { transform: translate(-8%, -4px) rotate(-4deg) scale(1.02); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}

@keyframes rndShuffleMid {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(-55%, 8px) rotate(-9deg) scale(0.96); z-index: 1; }
  55% { transform: translate(55%, -12px) rotate(7deg) scale(1.05); z-index: 4; }
  80% { transform: translate(6%, 3px) rotate(3deg) scale(0.99); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}

@keyframes rndShuffleRight {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  25% { transform: translate(-58%, -8px) rotate(-8deg) scale(1.04); z-index: 3; }
  55% { transform: translate(-115%, 6px) rotate(6deg) scale(0.97); z-index: 2; }
  80% { transform: translate(8%, -4px) rotate(4deg) scale(1.02); }
  100% { transform: translate(0, 0) rotate(0deg) scale(1); }
}

/* v2.0.13: 全站 120fps 合成器優化（以絲滑鏡面漸層取代大螢幕即時毛玻璃重繪）＋ iPhone Duo 摺疊開合液態玻璃過渡 */
.glass-surface,
.pill-btn,
.card,
.home-search-box,
.home-tile-btn,
.recent-rec-item,
.more-group-card,
.seg-group,
.random-q-input,
.random-card-btn,
.jump-bar,
.bottom-nav-capsule,
.modal-card,
.report-section,
.auth-card,
.app-sidebar,
.catalog-rail {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-image: linear-gradient(155deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.08) 55%, rgba(255, 255, 255, 0.22) 100%);
}

.app-shell {
  will-change: transform, opacity;
  transform-origin: center center;
}

#appShell.duo-unfolding {
  animation: duoUnfoldStage 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#appShell.duo-folding {
  animation: duoFoldStage 0.56s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.app-sidebar #btnToggleSidebar svg,
.catalog-rail #btnToggleRail svg {
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.fold-glass-veil {
  position: fixed;
  inset: 0;
  z-index: 180;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  transform-origin: center center;
  background:
    radial-gradient(68% 90% at 50% 50%, rgba(255, 255, 255, 0.58) 0%, var(--orb-glow, rgba(212, 184, 255, 0.38)) 42%, var(--bloom-1, rgba(200, 230, 215, 0.28)) 72%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 252, 245, 0.34) 50%, rgba(255, 255, 255, 0) 100%);
}

.fold-glass-veil.is-unfold {
  animation: duoGlassExtend 0.76s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fold-glass-veil.is-fold {
  animation: duoGlassCollapse 0.58s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes duoUnfoldStage {
  0% {
    opacity: 0.52;
    transform: perspective(1400px) scaleX(0.84) scaleY(0.98);
  }
  55% {
    opacity: 1;
    transform: perspective(1400px) scaleX(1.015) scaleY(1);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes duoFoldStage {
  0% {
    opacity: 0.65;
    transform: perspective(1400px) scaleX(1.08);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes duoGlassExtend {
  0% {
    opacity: 0.92;
    transform: scaleX(0.12) scaleY(0.92);
  }
  42% {
    opacity: 0.78;
    transform: scaleX(1.04) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: scaleX(1.18) scaleY(1.02);
  }
}

@keyframes duoGlassCollapse {
  0% {
    opacity: 0.75;
    transform: scaleX(1.08);
  }
  100% {
    opacity: 0;
    transform: scaleX(0.22);
  }
}

/* ===== v2.1.0 新增功能樣式（每日指引卡、自訂套組、流程腳本、計時器、語音速記、報告篩選） ===== */
.home-daily-banner {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  transition: transform 0.16s ease;
}
.home-daily-banner:active {
  transform: scale(0.985);
}
.home-daily-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.home-daily-badge {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}
.home-daily-title {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workflow-presets-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.workflow-preset-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg, rgba(255, 255, 255, 0.78));
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.workflow-preset-card:hover {
  border-color: var(--primary);
}
.workflow-preset-card:active {
  transform: scale(0.98);
}
.workflow-preset-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
}
.workflow-preset-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.workflow-progress-bar {
  border: 1px solid var(--primary);
  border-radius: 16px;
  background: var(--accent-soft);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.wf-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.wf-bar-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}
.wf-bar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.wf-manage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
}
.wf-manage-row.active {
  border-color: var(--primary);
  background: var(--accent-soft);
}
.wf-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wf-step-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}
.wf-step-chip button {
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
}
.wf-page-picker {
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 4px;
}
.wf-pick-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
}
.wf-pick-item:hover {
  background: var(--bg-soft);
}

.rnd-sets-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.rnd-set-form {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 8px 0;
  flex-wrap: wrap;
}

.rnd-daily-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rnd-daily-card {
  perspective: 1100px;
  width: 100%;
  min-height: 280px;
  cursor: pointer;
}
.rnd-daily-inner {
  position: relative;
  width: 100%;
  min-height: 280px;
  transition: transform 0.58s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
}
.rnd-daily-card.flipped .rnd-daily-inner {
  transform: rotateY(180deg);
}
.rnd-daily-card.shuffling .rnd-daily-inner {
  animation: rndDailyPulse 0.55s ease infinite;
}
@keyframes rndDailyPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.97) rotate(-1deg); }
}
.rnd-daily-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 22px;
  border: 1px solid var(--border);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}
.rnd-daily-back {
  align-items: center;
  text-align: center;
  background: linear-gradient(145deg, var(--primary), #1d3524);
  color: #fff;
  gap: 8px;
}
.rnd-daily-emblem {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}
.rnd-daily-back-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  opacity: 0.78;
}
.rnd-daily-back-title {
  font-size: 1.08rem;
  font-weight: 700;
}
.rnd-daily-back-sub {
  font-size: 0.8rem;
  opacity: 0.82;
}
.rnd-daily-front {
  transform: rotateY(180deg);
  background: var(--card-bg, #fff);
  justify-content: space-between;
  gap: 10px;
}
.rnd-daily-front-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rnd-daily-front-title {
  margin: 0;
  font-size: 1.18rem;
  color: var(--primary);
}
.rnd-daily-aff-box {
  padding: 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}
.rnd-daily-action-box {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-soft);
}

.timer-header-btn {
  position: relative;
  width: auto;
  min-width: 38px;
  padding: 0 8px;
  gap: 4px;
}
.timer-header-btn.is-active {
  border-color: var(--primary);
  color: var(--primary);
}
.timer-header-badge {
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.energy-timer-card {
  text-align: center;
  padding: 16px 12px;
  border-radius: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.energy-timer-kicker {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.energy-timer-clock {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.voice-rec-btn.is-recording {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  animation: voicePulse 1.1s ease infinite;
}
@keyframes voicePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.report-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.report-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-size: 0.82rem;
  cursor: pointer;
}
.report-filter-chip.active {
  border-color: var(--primary);
  background: var(--accent-soft);
  font-weight: 600;
}

/* ===== v2.2.0 雙模式查表入口與全域邊查邊錄狀態列 ===== */
.home-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.home-mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card-bg, rgba(255, 255, 255, 0.85));
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.home-mode-card.home-mode-other {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.home-mode-card.home-mode-self {
  border-color: var(--primary);
}
.home-mode-card:active {
  transform: scale(0.98);
}
.home-mode-icon {
  font-size: 1.35rem;
  line-height: 1;
}
.home-mode-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--primary);
}
.home-mode-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.intake-voice-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--primary);
  background: var(--accent-soft);
  cursor: pointer;
}
.intake-voice-opt input {
  margin-top: 3px;
}

.voice-header-btn.is-recording {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  animation: voicePulse 1.1s ease infinite;
}

.global-voice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin: 0 12px 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card-bg, rgba(255, 255, 255, 0.92));
  flex-wrap: wrap;
}
.global-voice-bar.is-listening {
  border-color: var(--danger);
}
.gvb-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 200px;
}
.voice-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--text-muted);
  flex-shrink: 0;
}
.global-voice-bar.is-listening .voice-live-dot {
  background: var(--danger);
  animation: voicePulse 1s ease infinite;
}
.gvb-status {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.global-voice-bar.is-listening .gvb-status {
  color: var(--danger);
}
.gvb-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.gvb-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ===== v2.3.0 盧恩符文占卜、高我專屬桌布與主題延伸引導樣式 ===== */
.home-runes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.home-runes-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card-bg, rgba(255, 255, 255, 0.85));
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.home-runes-card:hover {
  border-color: var(--primary);
}
.home-runes-card:active {
  transform: scale(0.98);
}

.runes-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 104px;
}

.runes-blind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}
.rune-stone-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 76px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(155deg, var(--primary), #1d3222);
  color: #fff;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.rune-stone-btn.picked {
  background: var(--card-bg, #fff);
  color: var(--primary);
  border: 2px solid var(--primary);
}
.rune-stone-btn:active {
  transform: scale(0.96);
}

.runes-dial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px;
}
.rune-dial-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.rune-dial-chip.active {
  border: 2px solid var(--primary);
  background: var(--accent-soft);
  color: var(--primary);
}

.rune-svg-glyph {
  width: 30px;
  height: 36px;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.rune-svg-glyph.reversed {
  transform: rotate(180deg);
}

.rune-result-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg, #fff);
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.rune-result-glyph-box {
  width: 58px;
  height: 70px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rune-dial-svg-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}
.rune-dial-svg-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}
.rune-dial-sector {
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.rune-dial-sector:hover {
  opacity: 0.85;
}

.wallpaper-preview-box {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}
.wallpaper-preview-box img {
  width: 100%;
  height: auto;
  display: block;
}

/* 360px 窄螢幕手機頂部導覽列精算，確保設定與全螢幕按鈕不裁切 */
@media (max-width: 599px) {
  .app-header {
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 10px)) 8px max(10px, env(safe-area-inset-left, 10px));
  }

  .header-top {
    gap: 6px;
  }

  .session-chip-btn {
    min-width: 0;
    flex: 0 1 auto;
    max-width: 44%;
    min-height: 36px;
    padding: 4px 8px 4px 5px;
    gap: 5px;
    font-size: 0.84rem;
  }

  .session-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }

  .header-actions {
    gap: 5px;
    flex-shrink: 0;
  }

  .icon-btn {
    min-width: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
  }

  .icon-btn .thin-svg {
    width: 18px;
    height: 18px;
  }

  .report-pill-btn {
    min-height: 34px;
    padding: 4px 9px;
    gap: 4px;
    font-size: 0.84rem;
  }
}
