/* ==========================================================================
   安可印刷 - 使用者條款頁樣式
   對應原型《原型/使用者條款.html》。所有選擇器以 .encore-terms 為 scope，
   token 沿用全站 --encore-* 並提供 fallback。
   ========================================================================== */

.encore-terms {
  --bg:           oklch(99% 0.002 240);
  --surface:      #ffffff;
  --fg:           var(--encore-fg, oklch(18% 0.012 250));
  --muted:        var(--encore-muted, oklch(54% 0.012 250));
  --border:       var(--encore-border, oklch(92% 0.005 250));
  --accent:       var(--encore-accent, #B00000);

  --accent-soft:  color-mix(in oklch, var(--accent) 12%, transparent);
  --fg-soft:      color-mix(in oklch, var(--fg) 6%, transparent);

  --font-display: var(--encore-font-display, -apple-system, BlinkMacSystemFont, 'Noto Sans TC', system-ui, 'Segoe UI', 'Microsoft JhengHei', sans-serif);
  --font-body:    var(--encore-font-body, -apple-system, BlinkMacSystemFont, 'Noto Sans TC', system-ui, 'Segoe UI', 'Microsoft JhengHei', sans-serif);
  --font-mono:    ui-monospace, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --fs-h1:   clamp(34px, 4.8vw, 60px);
  --fs-h2:   clamp(26px, 3.2vw, 40px);
  --fs-lead: 17.5px;
  --fs-body: 16px;
  --fs-meta: 13px;

  --gap-xs: 8px;  --gap-sm: 12px; --gap-md: 20px;
  --gap-lg: 32px; --gap-xl: 56px; --gap-2xl: 84px;

  --container: 1440px;
  --gutter:    32px;
  --radius:    10px;
  --radius-lg: 16px;
  --nav-h:     66px;

  --shadow-sm: 0 1px 2px color-mix(in oklch, var(--fg) 7%, transparent);
  --shadow-md: 0 16px 36px -18px color-mix(in oklch, var(--fg) 28%, transparent);
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);

  display: block;
  width: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.encore-terms img,
.encore-terms svg { display: block; max-width: 100%; }
.encore-terms a { color: inherit; text-decoration: none; }
.encore-terms button { font: inherit; cursor: pointer; color: inherit; }
.encore-terms a:focus-visible,
.encore-terms button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.encore-terms p { text-wrap: pretty; }
.encore-terms h1, .encore-terms h2, .encore-terms h3, .encore-terms h4 { text-wrap: balance; font-family: var(--font-display); }
.encore-terms [id] { scroll-margin-top: calc(var(--nav-h) + 18px); }

.encore-terms .et-sprite { display: none; }
.encore-terms .ic {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* ─── layout ─────────────────────────────────────────────────────────── */
.encore-terms .container {
  max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter);
}
.encore-terms .section { padding-block: clamp(52px, 7vw, var(--gap-2xl)); }

.encore-terms .eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 var(--gap-md);
}
.encore-terms .eyebrow::before {
  content: ''; display: inline-block; width: 16px; height: 2px;
  background: var(--accent); vertical-align: middle; margin-right: 9px;
}
.encore-terms .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.encore-terms h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.06; letter-spacing: -0.025em; font-weight: 800; margin: 0; }
.encore-terms h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.12; letter-spacing: -0.02em; font-weight: 750; margin: 0; }
.encore-terms h3 { font-size: 17.5px; font-weight: 650; line-height: 1.35; letter-spacing: -0.01em; margin: 0; }
.encore-terms .lead { font-size: var(--fs-lead); line-height: 1.65; color: var(--muted); max-width: 62ch; margin: 0; }

/* ─── buttons ────────────────────────────────────────────────────────── */
.encore-terms .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 22px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .06s ease;
}
.encore-terms .btn:active { transform: translateY(1px); }
.encore-terms .btn-primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.encore-terms .btn-primary:hover { background: color-mix(in oklch, var(--accent) 84%, black); }
.encore-terms .btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--border); }
.encore-terms .btn-secondary:hover { border-color: var(--fg); }
.encore-terms .btn-ghost { background: transparent; color: var(--fg); border-color: transparent; padding-inline: 12px; }
.encore-terms .btn-ghost:hover { color: var(--accent); }
.encore-terms .btn-quiet { background: transparent; color: var(--fg); border-color: var(--border); }
.encore-terms .btn-quiet:hover { border-color: var(--fg); }
.encore-terms .btn-arrow::after { content: '→'; transition: transform .16s ease; }
.encore-terms .btn-arrow:hover::after { transform: translateX(3px); }

/* ─── breadcrumb ─────────────────────────────────────────────────────── */
.encore-terms .crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 22px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.encore-terms .crumbs a { display: inline-flex; align-items: center; min-height: 30px; transition: color .15s ease; }
.encore-terms .crumbs a:hover { color: var(--fg); }
.encore-terms .crumbs .sep { color: color-mix(in oklch, var(--fg) 26%, transparent); }
.encore-terms .crumbs [aria-current] { color: var(--fg); }
.encore-terms .crumbs-lead { padding-block: 22px 2px; }
.encore-terms .crumbs-lead .crumbs { margin-bottom: 0; }

/* ─── section head ───────────────────────────────────────────────────── */
.encore-terms .sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--gap-lg); flex-wrap: wrap; margin-bottom: var(--gap-xl);
}
.encore-terms .sec-head h2 { margin-top: 2px; }
.encore-terms .sec-note { margin: 0; max-width: 40ch; color: var(--muted); font-size: 12.5px; font-family: var(--font-mono); line-height: 1.6; }

/* ─── terms hero ─────────────────────────────────────────────────────── */
.encore-terms .section.terms-hero { padding-block: clamp(18px, 3vw, 30px) clamp(34px, 5vw, 56px); }
.encore-terms .terms-hero-card {
  position: relative; overflow: hidden; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm);
  padding: clamp(30px, 5vw, 56px);
}
.encore-terms .terms-hero-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 88% -22%, color-mix(in oklch, var(--accent) 8%, transparent), transparent 60%);
  pointer-events: none;
}
.encore-terms .terms-hero-card > * { position: relative; z-index: 1; }
.encore-terms .terms-hero-card h1 { margin: 4px 0 0; }
.encore-terms .terms-hero-card .lead { margin-top: 12px; }
.encore-terms .terms-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.encore-terms .terms-meta {
  display: flex; flex-wrap: wrap; gap: clamp(22px, 5vw, 54px);
  margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--border);
}
.encore-terms .terms-meta-item .num {
  display: block; font-family: var(--font-mono); font-size: clamp(15px, 1.7vw, 19px);
  font-weight: 700; letter-spacing: -0.02em; color: var(--fg);
}
.encore-terms .terms-meta-item em { display: block; margin-top: 4px; font-size: 12.5px; font-style: normal; color: var(--muted); }

/* ─── terms layout ───────────────────────────────────────────────────── */
.encore-terms .terms-layout {
  display: grid; grid-template-columns: 246px minmax(0, 1fr);
  gap: clamp(26px, 4vw, 56px); align-items: start;
}
.encore-terms .terms-side { position: sticky; top: calc(var(--nav-h) + 18px); display: grid; gap: 20px; }
.encore-terms .terms-side-h { margin: 0 0 8px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-family: var(--font-mono); color: var(--muted); }
.encore-terms .terms-toc { display: grid; gap: 2px; }
.encore-terms .terms-toc a {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border-radius: var(--radius);
  border-left: 2px solid transparent; font-size: 14px; font-weight: 600; color: var(--muted);
  transition: color .14s ease, background .14s ease, border-color .14s ease;
}
.encore-terms .terms-toc a:hover { color: var(--fg); background: color-mix(in oklch, var(--fg) 5%, transparent); }
.encore-terms .terms-toc a.is-active { color: var(--fg); border-left-color: var(--accent); background: color-mix(in oklch, var(--accent) 7%, transparent); }
.encore-terms .terms-toc .n { flex: none; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.encore-terms .terms-toc a.is-active .n { color: var(--accent); }
.encore-terms .terms-side-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  padding: 20px 18px; display: grid; gap: 8px;
}
.encore-terms .terms-side-card .ic { font-size: 22px; color: var(--accent); }
.encore-terms .terms-side-card h3 { font-size: 15.5px; margin: 4px 0 0; }
.encore-terms .terms-side-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.encore-terms .terms-side-card .btn { width: 100%; justify-content: center; margin-top: 6px; }

/* ─── document ───────────────────────────────────────────────────────── */
.encore-terms .terms-doc { max-width: 90ch; }
.encore-terms .terms-summary {
  position: relative; overflow: hidden;
  border: 1px solid color-mix(in oklch, var(--accent) 26%, var(--border));
  background: color-mix(in oklch, var(--accent) 4.5%, var(--surface));
  border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 32px); margin-bottom: clamp(28px, 4vw, 44px);
}
.encore-terms .terms-summary-h { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 750; color: var(--fg); }
.encore-terms .terms-summary-h .ic { font-size: 20px; color: var(--accent); }
.encore-terms .terms-summary > p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.encore-terms .terms-summary ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.encore-terms .terms-summary li { position: relative; padding-left: 26px; font-size: 14px; color: var(--fg); line-height: 1.6; }
.encore-terms .terms-summary li .ic { position: absolute; left: 0; top: 3px; font-size: 16px; color: var(--accent); }
@media (min-width: 720px) { .encore-terms .terms-summary ul { grid-template-columns: 1fr 1fr; gap: 10px 26px; } }

.encore-terms .terms-sec { padding-block: clamp(26px, 3.6vw, 42px); border-top: 1px solid var(--border); }
.encore-terms .terms-doc > .terms-summary + .terms-sec { border-top: 0; padding-top: 0; }
.encore-terms .terms-sec h2 { display: flex; align-items: baseline; gap: 12px; font-size: clamp(20px, 2.3vw, 26px); letter-spacing: -0.015em; }
.encore-terms .terms-sec h2 .n { flex: none; font-family: var(--font-mono); font-size: .62em; font-weight: 700; color: var(--accent); }
.encore-terms .terms-sec h3 { font-size: 15.5px; margin: 22px 0 0; color: var(--fg); }
.encore-terms .terms-sec p { margin: 14px 0 0; color: var(--muted); font-size: 14.8px; line-height: 1.8; }
.encore-terms .terms-sec p:first-of-type { margin-top: 12px; }
.encore-terms .terms-sec strong { color: var(--fg); font-weight: 650; }
.encore-terms .terms-sec ul,
.encore-terms .terms-sec ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 9px; }
.encore-terms .terms-sec ul > li { position: relative; padding-left: 24px; color: var(--muted); font-size: 14.6px; line-height: 1.75; }
.encore-terms .terms-sec ul > li::before {
  content: ''; position: absolute; left: 3px; top: .72em; width: 6px; height: 6px; border-radius: 50%;
  background: color-mix(in oklch, var(--fg) 34%, transparent);
}
.encore-terms .terms-sec ol { counter-reset: t; }
.encore-terms .terms-sec ol > li { position: relative; padding-left: 30px; color: var(--muted); font-size: 14.6px; line-height: 1.75; counter-increment: t; }
.encore-terms .terms-sec ol > li::before {
  content: counter(t); position: absolute; left: 0; top: .28em;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.encore-terms .terms-sec a { color: var(--accent); font-weight: 600; }
.encore-terms .terms-sec a:hover { text-decoration: underline; text-underline-offset: 2px; }

.encore-terms .terms-note {
  display: flex; gap: 14px; margin: 20px 0 0; padding: 17px 20px;
  border: 1px solid var(--border); border-left: 3px solid var(--fg);
  border-radius: var(--radius); background: color-mix(in oklch, var(--fg) 2.5%, var(--surface));
}
.encore-terms .terms-note .ic { flex: none; margin-top: 2px; font-size: 19px; color: var(--fg); }
.encore-terms .terms-note p { margin: 0; font-size: 13.8px; line-height: 1.7; }

.encore-terms .terms-table { width: 100%; border-collapse: collapse; margin: 18px 0 0; font-size: 14px; }
.encore-terms .terms-table caption { margin-bottom: 8px; text-align: left; font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.encore-terms .terms-table th,
.encore-terms .terms-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.encore-terms .terms-table thead th { font-size: 12.5px; font-weight: 700; color: var(--fg); background: color-mix(in oklch, var(--fg) 3%, var(--surface)); }
.encore-terms .terms-table td { color: var(--muted); }
.encore-terms .terms-table td:first-child { color: var(--fg); font-weight: 600; white-space: nowrap; }

.encore-terms .terms-disclaimer {
  margin: clamp(24px, 3vw, 36px) 0 0; padding-top: 20px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px; color: var(--muted); line-height: 1.75;
}

/* ─── contact ────────────────────────────────────────────────────────── */
.encore-terms .help-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }
.encore-terms .help-card {
  display: grid; gap: 6px; align-content: start; padding: 24px 22px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  transition: border-color .15s ease, transform .2s var(--ease);
}
.encore-terms .help-card:hover { border-color: color-mix(in oklch, var(--fg) 22%, transparent); transform: translateY(-2px); }
.encore-terms .help-card .ic { font-size: 24px; color: var(--fg); }
.encore-terms .help-card h3 { font-size: 15.5px; margin: 6px 0 0; }
.encore-terms .help-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.encore-terms .help-card a { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.encore-terms .help-card a .ic { font-size: 15px; color: currentColor; }

/* ─── final cta ──────────────────────────────────────────────────────── */
.encore-terms .cta-band {
  position: relative; overflow: hidden; background: var(--fg); color: var(--surface);
  border-radius: var(--radius-lg); padding: clamp(36px, 6vw, 64px); box-shadow: var(--shadow-md);
}
.encore-terms .cta-band::after {
  content: ''; position: absolute; top: -160px; right: -120px; width: min(560px, 74vw); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklch, var(--accent) 34%, transparent), transparent 66%);
  pointer-events: none;
}
.encore-terms .cta-band > * { position: relative; z-index: 1; }
.encore-terms .cta-band .eyebrow { color: color-mix(in oklch, var(--surface) 70%, var(--accent)); }
.encore-terms .cta-band h2 { color: var(--surface); margin-bottom: var(--gap-md); }
.encore-terms .cta-band > p { color: color-mix(in oklch, var(--surface) 74%, transparent); max-width: 52ch; margin: 0 0 var(--gap-lg); font-size: var(--fs-lead); }
.encore-terms .cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.encore-terms .cta-band .btn-primary { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.encore-terms .cta-band .btn-primary:hover { background: color-mix(in oklch, var(--accent) 84%, white); }
.encore-terms .cta-band .btn-quiet { background: transparent; color: var(--surface); border-color: color-mix(in oklch, var(--surface) 34%, transparent); }
.encore-terms .cta-band .btn-quiet:hover { border-color: var(--surface); }

/* ─── reveal ─────────────────────────────────────────────────────────── */
.js .encore-terms .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0ms); }
.js .encore-terms .reveal.in { opacity: 1; transform: none; }

/* ─── 響應式 ─────────────────────────────────────────────────────────── */
@media (max-width: 920px) {
  .encore-terms .terms-layout { grid-template-columns: 1fr; }
  .encore-terms .terms-side { position: static; }
  .encore-terms .terms-toc { display: flex; flex-wrap: wrap; gap: 6px; }
  .encore-terms .terms-toc a { width: auto; border: 1px solid var(--border); border-left-width: 1px; }
  .encore-terms .terms-toc a.is-active { border-color: var(--accent); background: var(--accent); color: var(--surface); }
  .encore-terms .terms-toc a.is-active .n { color: color-mix(in oklch, var(--surface) 76%, transparent); }
  .encore-terms .help-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .encore-terms .container { padding-inline: 18px; }
  .encore-terms .crumbs-lead { padding-block: 16px 0; }
  .encore-terms .sec-head { margin-bottom: var(--gap-lg); gap: 8px; }
  .encore-terms .sec-note { max-width: none; }
  .encore-terms .help-grid { grid-template-columns: 1fr; }
  .encore-terms .terms-table { font-size: 13px; }
  .encore-terms .terms-table th,
  .encore-terms .terms-table td { padding: 10px; }
  .encore-terms .terms-table td:first-child { white-space: normal; }
  .encore-terms .terms-hero-actions .btn { width: 100%; }
}

@media (hover: none) {
  .encore-terms .help-card:hover { transform: none; border-color: var(--border); }
}

@media (prefers-reduced-motion: reduce) {
  .js .encore-terms .reveal { opacity: 1; transform: none; transition: none; }
}
