/* ==========================================================================
   ZeitFrei 需求探針 — Notion 清爽風（2026）
   自適應：phone / tablet / desktop；含微動效、玻璃導覽、焦點環
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f6f3;
  --bg-hover: rgba(55, 53, 47, 0.06);
  --bg-active: rgba(35, 131, 226, 0.1);
  --surface: #ffffff;
  --text: #37352f;
  --text-muted: #787774;
  --text-faint: #9b9a97;
  --border: rgba(55, 53, 47, 0.09);
  --border-strong: rgba(55, 53, 47, 0.16);
  --blue: #2383e2;
  --blue-hover: #0b6bcb;
  --blue-soft: rgba(35, 131, 226, 0.12);
  --red: #eb5757;
  --red-soft: rgba(235, 87, 87, 0.1);
  --green: #0f7b6c;
  --green-soft: rgba(15, 123, 108, 0.1);
  --amber: #d9730d;
  --amber-soft: rgba(217, 115, 13, 0.12);
  --purple: #6940a5;
  --shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 15, 15, 0.06), 0 1px 2px rgba(15, 15, 15, 0.04);
  --shadow-lg: 0 12px 40px rgba(15, 15, 15, 0.08);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    "Apple Color Emoji", Arial, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC",
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --content: 720px;
  --wide: 1080px;
  --header-h: 52px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.22s;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --bg-soft: #202020;
    --bg-hover: rgba(255, 255, 255, 0.055);
    --bg-active: rgba(35, 131, 226, 0.18);
    --surface: #252525;
    --text: #ffffffeb;
    --text-muted: #ffffff99;
    --text-faint: #ffffff66;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(35, 131, 226, 0.07), transparent 55%),
    radial-gradient(700px 360px at 92% 0%, rgba(105, 64, 165, 0.05), transparent 50%),
    var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(35, 131, 226, 0.28);
  color: inherit;
}

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

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
a:hover {
  color: var(--blue-hover);
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- layout ---------- */
.wrap {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}

.wrap-narrow {
  width: min(100% - 2rem, var(--content));
  margin-inline: auto;
}

/* ---------- header glass ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--duration) var(--ease);
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-sm);
}
.site-header .wrap,
.site-header-inner {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text) !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--blue), #6940a5);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.link-quiet {
  color: var(--text-muted) !important;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: 6px;
}
.link-quiet:hover {
  background: var(--bg-hover);
  color: var(--text) !important;
}

/* ---------- buttons ---------- */
.btn,
.zf-survey .zf-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 560;
  line-height: 1.25;
  cursor: pointer;
  text-decoration: none !important;
  transition:
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    transform 0.15s var(--ease),
    color var(--duration) var(--ease);
  user-select: none;
}
.btn:active,
.zf-survey .zf-btn:active {
  transform: translateY(1px);
}

.btn-primary,
.zf-survey .zf-btn-primary {
  background: var(--blue);
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(35, 131, 226, 0.25);
}
.btn-primary:hover,
.zf-survey .zf-btn-primary:hover {
  background: var(--blue-hover);
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(35, 131, 226, 0.28);
}

.btn-ghost,
.zf-survey .zf-btn-ghost {
  background: transparent;
  color: var(--text) !important;
  border-color: var(--border-strong);
}
.btn-ghost:hover,
.zf-survey .zf-btn-ghost:hover {
  background: var(--bg-hover);
}

.btn-soft {
  background: var(--bg-hover);
  color: var(--text) !important;
  border-color: var(--border);
}
.btn-soft:hover {
  background: var(--bg-active);
  border-color: color-mix(in srgb, var(--blue) 30%, var(--border));
}

.btn-danger {
  background: var(--red-soft);
  color: var(--red) !important;
  border-color: color-mix(in srgb, var(--red) 35%, transparent);
}
.btn-danger:hover {
  filter: brightness(0.98);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.btn-large {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  border-radius: 8px;
}

/* ---------- landing ---------- */
.page-landing .landing-main,
.landing-main {
  padding: 2.5rem 0 4rem;
}

.hero {
  width: min(100% - 2rem, var(--content));
  margin: 0 auto 2.5rem;
  padding: 2rem 1.5rem 2.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: rise-in 0.55s var(--ease) both;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid color-mix(in srgb, var(--blue) 18%, transparent);
}
.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}
.hero .lede {
  margin: 0 0 1.35rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 46ch;
}
.hero .lede strong {
  color: var(--text);
  font-weight: 650;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0.85rem;
}
.fineprint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.pillars {
  width: min(100% - 2rem, var(--wide));
  margin: 0 auto;
  animation: rise-in 0.55s var(--ease) 0.08s both;
}
.pillars h2,
.section-title {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pillar {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}
.pillar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--blue), #6940a5);
  opacity: 0.85;
}
.pillar:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.pillar h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 650;
}
.pillar p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.pillar-num {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.meta-row {
  width: min(100% - 2rem, var(--content));
  margin: 1.75rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  animation: rise-in 0.55s var(--ease) 0.14s both;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
}
.chip strong {
  color: var(--text);
  font-weight: 650;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 2rem;
  color: var(--text-faint);
  font-size: 0.85rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
}

/* ---------- survey page shell ---------- */
.page-survey .survey-main {
  padding: 1.25rem 0 3.5rem;
}
.loading-hint,
.error-hint {
  width: min(100% - 2rem, var(--content));
  margin: 2rem auto;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.error-hint {
  color: var(--red);
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 30%, transparent);
}

/* ---------- survey engine (Notion) ---------- */
.zf-survey {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 0.25rem 0 2rem;
  color: var(--text);
  line-height: 1.55;
  animation: rise-in 0.4s var(--ease) both;
}
.zf-survey h1 {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.35rem;
  line-height: 1.25;
}
.zf-survey .zf-sub {
  margin: 0 0 1.15rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.zf-survey .zf-progress {
  height: 6px;
  background: var(--bg-hover);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 0 0 0.5rem;
  border: 1px solid var(--border);
}
.zf-survey .zf-progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #5b8def 40%, #6940a5);
  background-size: 200% 100%;
  animation: progress-shine 2.8s linear infinite;
  transition: width 0.35s var(--ease);
}
.zf-survey .zf-step-meta {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 1.35rem;
}
.zf-survey .zf-sec-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}
.zf-survey .zf-sec-blurb {
  margin: 0 0 1.15rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.zf-survey .zf-q {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem 1.05rem;
  margin: 0 0 0.75rem;
  box-shadow: var(--shadow-sm);
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    transform var(--duration) var(--ease);
  animation: fade-up 0.35s var(--ease) both;
}
.zf-survey .zf-q:nth-child(n) {
  animation-delay: 0.02s;
}
.zf-survey .zf-q:hover {
  border-color: var(--border-strong);
}
.zf-survey .zf-q.zf-err {
  border-color: color-mix(in srgb, var(--red) 55%, var(--border));
  box-shadow: 0 0 0 3px var(--red-soft);
}
.zf-survey .zf-qlabel {
  font-weight: 650;
  margin: 0 0 0.7rem;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.zf-survey .zf-req {
  color: var(--red);
  margin-left: 0.2rem;
}
.zf-survey .zf-err-msg {
  color: var(--red);
  font-size: 0.82rem;
  margin-top: 0.55rem;
}

.zf-survey .zf-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  margin: 0 0 0.25rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}
.zf-survey .zf-opt:hover {
  background: var(--bg-hover);
}
.zf-survey .zf-opt:has(input:checked) {
  background: var(--bg-active);
  border-color: color-mix(in srgb, var(--blue) 28%, transparent);
}
.zf-survey .zf-opt input {
  margin-top: 0.2rem;
  accent-color: var(--blue);
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.zf-survey .zf-opt span {
  flex: 1;
  font-size: 0.95rem;
}

.zf-survey textarea,
.zf-survey input[type="text"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  resize: vertical;
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}
.zf-survey textarea:hover,
.zf-survey input[type="text"]:hover {
  border-color: color-mix(in srgb, var(--text) 28%, var(--border));
}
.zf-survey textarea:focus,
.zf-survey input[type="text"]:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.zf-survey .zf-hint {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 0.35rem;
  text-align: right;
}

.zf-survey .zf-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.zf-survey .zf-scale label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  transition:
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    transform 0.15s var(--ease);
}
.zf-survey .zf-scale label:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
}
.zf-survey .zf-scale label:has(input:checked) {
  border-color: var(--blue);
  background: var(--bg-active);
  color: var(--text);
  font-weight: 650;
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.zf-survey .zf-scale input {
  accent-color: var(--blue);
  margin: 0 0 0.2rem;
}

.zf-survey .zf-matrix-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}
.zf-survey .zf-matrix {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.zf-survey .zf-matrix th,
.zf-survey .zf-matrix td {
  padding: 0.55rem 0.35rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.zf-survey .zf-matrix th:first-child,
.zf-survey .zf-matrix td:first-child {
  text-align: left;
  padding-right: 0.75rem;
  min-width: 9rem;
  color: var(--text);
  font-weight: 500;
}
.zf-survey .zf-matrix th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.zf-survey .zf-matrix input {
  accent-color: var(--blue);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}
.zf-survey .zf-matrix tr:hover td {
  background: var(--bg-hover);
}

.zf-survey .zf-rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.zf-survey .zf-rank-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  margin: 0 0 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}
.zf-survey .zf-rank-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.zf-survey .zf-rank-item .zf-rank-n {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.zf-survey .zf-rank-item .zf-rank-t {
  flex: 1;
  font-size: 0.92rem;
}
.zf-survey .zf-rank-btns {
  display: flex;
  gap: 0.25rem;
}
.zf-survey .zf-rank-btns button {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background var(--duration) var(--ease);
}
.zf-survey .zf-rank-btns button:hover:not(:disabled) {
  background: var(--bg-hover);
}
.zf-survey .zf-rank-btns button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.zf-survey .zf-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.35rem;
  flex-wrap: wrap;
  position: sticky;
  bottom: 12px;
  padding: 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.zf-survey .zf-done {
  text-align: center;
  padding: 2.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: pop-in 0.45s var(--ease) both;
}
.zf-survey .zf-done h2 {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
.zf-survey .zf-done p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}
.zf-survey .zf-toast {
  margin-top: 0.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: left;
}
.zf-survey .zf-toast.ok {
  background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  color: var(--green);
}
.zf-survey .zf-toast.warn {
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  color: var(--amber);
}
.zf-survey .zf-toast.err {
  background: var(--red-soft);
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent);
  color: var(--red);
}

/* ---------- admin ---------- */
.admin-shell {
  min-height: 100dvh;
  padding: 0 0 4rem;
  color: var(--text);
}
.admin-shell > .admin-header,
.admin-shell > .admin-toolbar,
.admin-shell > .insight-grid,
.admin-shell > .admin-section {
  width: min(100% - 2rem, var(--wide));
  margin-left: auto;
  margin-right: auto;
}
.admin-header {
  padding: 1.75rem 0 0.5rem;
}
.admin-header h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}
.admin-header .sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 70ch;
}
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 1rem auto 1.25rem !important;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.admin-toolbar .spacer {
  flex: 1;
  min-width: 8px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 1.25rem !important;
}
.insight-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
  animation: fade-up 0.4s var(--ease) both;
}
.insight-card:hover {
  box-shadow: var(--shadow-md);
}
.insight-card.wide {
  grid-column: 1 / -1;
}
.insight-card h3 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: none;
}
.insight-metric {
  font-size: 1.85rem;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
}
.insight-metric small {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.15fr) 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}
.bar-row .lbl {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-row .track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  overflow: hidden;
}
.bar-row .fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #6940a5);
  min-width: 0;
  transition: width 0.5s var(--ease);
}
.bar-row .n {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  min-width: 2.5em;
}

.price-matrix {
  display: grid;
  gap: 10px;
}
.price-tier .tier-name {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 0.88rem;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px !important;
  box-shadow: var(--shadow-sm);
}
.admin-section h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.guide-list {
  margin: 0;
  padding-left: 1.15em;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}
.guide-list li {
  margin-bottom: 6px;
}
.guide-list strong {
  color: var(--text);
}

.summary-box {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.65;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
}
.summary-box:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.summary-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.toast-inline {
  font-size: 0.82rem;
  color: var(--blue);
  min-height: 1.2em;
}

.open-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.open-tabs button {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.open-tabs button:hover {
  background: var(--bg-hover);
}
.open-tabs button.active {
  background: var(--bg-active);
  border-color: color-mix(in srgb, var(--blue) 35%, transparent);
  color: var(--text);
}
.open-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}
.open-item {
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.open-item .meta {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.empty-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 8px 0;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  border: 1px solid var(--border);
}
.status-pill.ok {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 30%, transparent);
  background: var(--green-soft);
}
.status-pill.warn {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 30%, transparent);
  background: var(--amber-soft);
}
#import-file {
  display: none;
}

/* ---------- motion ---------- */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes progress-shine {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

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

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .pillar-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15.5px;
  }
  .hero {
    padding: 1.35rem 1.1rem 1.5rem;
  }
  .cta-row .btn {
    width: 100%;
  }
  .zf-survey .zf-nav {
    bottom: 8px;
  }
  .zf-survey .zf-nav .zf-btn {
    flex: 1;
  }
  .bar-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .bar-row .n {
    text-align: left;
  }
  .admin-toolbar .spacer {
    display: none;
  }
  .admin-toolbar .btn {
    flex: 1 1 auto;
  }
}

@media (min-width: 1100px) {
  .hero {
    padding: 2.35rem 2rem 2.5rem;
  }
}

/* print */
@media print {
  .site-header,
  .zf-survey .zf-nav,
  .admin-toolbar {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .insight-card,
  .admin-section,
  .hero,
  .pillar {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* ========== Focus survey (one question attention) ========== */
body.focus-survey .site-header {
  opacity: 0.55;
  transition: opacity 0.25s ease;
}
body.focus-survey .site-header:hover,
body.focus-survey .site-header:focus-within {
  opacity: 1;
}
.zf-survey.zf-focus {
  max-width: 40rem;
  padding-bottom: 6rem;
}
.zf-focus-chrome {
  margin-bottom: 1.5rem;
}
.zf-focus-stage {
  min-height: 48vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: rise-in 0.4s var(--ease) both;
}
.zf-focus-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.zf-focus-title {
  margin: 0 0 1rem !important;
  font-size: clamp(1.45rem, 4.2vw, 1.95rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  line-height: 1.28 !important;
  color: var(--text) !important;
}
.zf-focus-lede {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 36ch;
  line-height: 1.55;
}
.zf-focus-bullets {
  margin: 0 0 1.25rem;
  padding-left: 1.2em;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.zf-focus-meaning {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--blue-soft);
  border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
}
.zf-focus-q {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}
.zf-focus-q.zf-err {
  box-shadow: none !important;
}
.zf-focus .zf-opt {
  padding: 0.85rem 1rem;
  margin-bottom: 0.45rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  font-size: 1.02rem;
  box-shadow: var(--shadow-sm);
}
.zf-focus .zf-opt:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.zf-focus .zf-opt:has(input:checked) {
  border-color: color-mix(in srgb, var(--blue) 45%, transparent);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.zf-focus-nav {
  position: sticky;
  bottom: 12px;
  z-index: 20;
}
.page-survey .survey-main {
  padding-top: 0.75rem;
}
@media (max-width: 640px) {
  .zf-focus-stage { min-height: 42vh; }
  .zf-focus .zf-opt { font-size: 0.98rem; }
}

/* 長說明排版 */
.zf-focus-title {
  max-width: 22em;
}
.zf-focus-body {
  margin: 0 0 1.25rem;
  max-width: 34em;
}
.zf-focus-p {
  margin: 0 0 0.85rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.zf-focus-p:last-child {
  margin-bottom: 0;
}
.zf-focus-list {
  margin: 0.35rem 0 1rem;
  padding: 0.85rem 1rem 0.85rem 1.35rem;
  list-style: disc;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
}
.zf-focus-list li {
  margin: 0.15rem 0;
  padding-left: 0.15rem;
}
.zf-focus-list li::marker {
  color: var(--blue);
}
.zf-focus .zf-focus-q {
  margin-top: 0.25rem;
}
@media (max-width: 640px) {
  .zf-focus-title {
    font-size: clamp(1.25rem, 5.5vw, 1.55rem) !important;
    max-width: none;
  }
  .zf-focus-p {
    font-size: 0.98rem;
    line-height: 1.6;
  }
  .zf-focus-list {
    font-size: 0.95rem;
    padding: 0.75rem 0.85rem 0.75rem 1.2rem;
  }
}

/* 結束頁建議卡 */
.zf-done-suggest {
  text-align: left;
}
.zf-done-suggest h2 {
  text-align: center;
}
.zf-suggest-h {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.zf-suggest-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.zf-suggest-card {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.zf-suggest-title {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.zf-suggest-why {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* 冷卻頁、CTA */
.zf-cooldown {
  text-align: center;
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}
.zf-cooldown h2 {
  margin: 0 0 0.75rem;
  line-height: 1.35;
}
.zf-cooldown-msg {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-muted);
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.zf-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 1.15rem 0 0.5rem;
}
.zf-cta-row .zf-btn {
  text-decoration: none;
  min-width: 10.5rem;
}
.zf-cta-hint {
  text-align: center;
  font-size: 0.82rem !important;
  word-break: break-all;
}
.zf-done-suggest .zf-cta-row {
  justify-content: flex-start;
}
@media (max-width: 640px) {
  .zf-cta-row .zf-btn {
    width: 100%;
  }
}

/* 填完頁內嵌圓餅 */
.zf-done-pies {
  margin: 0.5rem 0 1.25rem;
}
.zf-pie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.zf-pie-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.zf-pie-title {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
}
.zf-pie-wrap {
  position: relative;
  height: 200px;
}
.page-survey .wrap.zf-done-wide,
.survey-main .wrap {
  max-width: 1100px;
}
@media (max-width: 640px) {
  .zf-pie-wrap { height: 190px; }
}
