/* 青藤雲 列印素材專用樣式 */
:root {
  --ink: #0f1a18;
  --ink-soft: #44403c;
  --ink-muted: #78716c;
  --primary: #0d9488;
  --primary-deep: #115e59;
  --primary-soft: #ccfbf1;
  --primary-tint: #ecfdf5;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --accent-deep: #92400e;
  --paper: #fafaf9;
  --paper-warm: #fef9c3;
  --line: #d6d3d1;
  --line-soft: #e7e5e4;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #e7e5e4;
  font-family: 'Noto Sans TC', 'PingFang TC', system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
  line-height: 1.5;
}

/* Screen-only toolbar */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 26, 24, .92);
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(12px);
}
.toolbar a, .toolbar button {
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  color: white;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.toolbar a:hover, .toolbar button:hover { background: rgba(255,255,255,.1); }
.toolbar .group { display: flex; gap: 10px; align-items: center; }
.toolbar .label { font-size: 13px; opacity: .7; }

/* Sheet (paper representation) */
.sheet {
  background: white;
  margin: 32px auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.15);
  position: relative;
  overflow: hidden;
  page-break-after: always;
}

/* A3 portrait 297x420 mm */
.sheet-a3 { width: 297mm; height: 420mm; padding: 18mm 18mm 22mm; }

/* A4 portrait 210x297 mm */
.sheet-a4 { width: 210mm; height: 297mm; padding: 14mm; }

/* A4 landscape 297x210 mm */
.sheet-a4-l { width: 297mm; height: 210mm; padding: 0; }

/* Tri-fold grid on landscape A4 */
.tri-fold {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 100%;
  position: relative;
}
.tri-fold > .panel {
  padding: 12mm 9mm;
  position: relative;
  overflow: hidden;
}
/* Fold guides (screen only) */
.tri-fold::before, .tri-fold::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(180deg, var(--line-soft) 0, var(--line-soft) 6px, transparent 6px, transparent 10px);
  pointer-events: none;
}
.tri-fold::before { left: 33.33%; }
.tri-fold::after { left: 66.66%; }

/* Print-only adjustments */
@page { margin: 0; }

@media print {
  body { background: white; }
  .toolbar, .screen-only { display: none !important; }
  .sheet { box-shadow: none; margin: 0; }
  .tri-fold::before, .tri-fold::after { display: none; }
  .sheet-a3 { width: 297mm; height: 420mm; }
  .sheet-a4 { width: 210mm; height: 297mm; }
  .sheet-a4-l { width: 297mm; height: 210mm; }
}

/* Typography */
.h-display {
  font-size: 56pt;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.h-1 { font-size: 32pt; font-weight: 800; letter-spacing: -.015em; line-height: 1.15; }
.h-2 { font-size: 22pt; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.h-3 { font-size: 14pt; font-weight: 700; line-height: 1.3; }
.h-4 { font-size: 11pt; font-weight: 700; line-height: 1.3; }
.lead { font-size: 12pt; line-height: 1.55; color: var(--ink-soft); }
.body { font-size: 10pt; line-height: 1.55; color: var(--ink-soft); }
.tiny { font-size: 8pt; line-height: 1.4; color: var(--ink-muted); }
.mono { font-family: 'Inter', 'SF Mono', monospace; font-variant-numeric: tabular-nums; }

/* Brand mark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #14b8a6, #0d9488 60%, #115e59);
  display: grid; place-items: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 2px 8px -2px rgba(13,148,136,.4);
}
.brand-text { font-size: 16pt; letter-spacing: -.01em; }
.brand-sub { font-size: 10pt; color: var(--ink-muted); margin-left: 6px; font-weight: 500; }

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 9pt;
  font-weight: 700;
  letter-spacing: .02em;
}
.chip-green { background: var(--primary-soft); color: var(--primary-deep); }
.chip-amber { background: var(--accent-soft); color: var(--accent-deep); }
.chip-line { background: #d1fadc; color: #064e23; }
.chip-blue { background: #dbeafe; color: #1e3a8a; }
.chip-ink { background: var(--ink); color: white; }

/* Stat block */
.stat-block {
  background: var(--primary-tint);
  border-radius: 14px;
  padding: 14px 18px;
  border: 1px solid #99f6e4;
}
.stat-block .num {
  font-size: 28pt;
  font-weight: 800;
  color: var(--primary-deep);
  font-family: 'Inter', sans-serif;
  letter-spacing: -.02em;
  line-height: 1;
}
.stat-block .num small { font-size: 14pt; font-weight: 600; color: var(--primary); }
.stat-block .label { font-size: 9pt; color: var(--ink-soft); margin-top: 6px; }

/* QR placeholder */
.qr {
  width: 90px; height: 90px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.qr::before, .qr::after {
  content: '';
  position: absolute;
  background-image:
    linear-gradient(90deg, var(--ink) 0, var(--ink) 8%, transparent 8%, transparent 16%, var(--ink) 16%, var(--ink) 22%, transparent 22%, transparent 28%, var(--ink) 28%, var(--ink) 40%, transparent 40%, transparent 50%, var(--ink) 50%, var(--ink) 56%, transparent 56%, transparent 64%, var(--ink) 64%, var(--ink) 72%, transparent 72%, transparent 84%, var(--ink) 84%, var(--ink) 92%, transparent 92%),
    linear-gradient(0deg, var(--ink) 0, var(--ink) 8%, transparent 8%, transparent 16%, var(--ink) 16%, var(--ink) 22%, transparent 22%, transparent 30%, var(--ink) 30%, var(--ink) 42%, transparent 42%, transparent 52%, var(--ink) 52%, var(--ink) 58%, transparent 58%, transparent 66%, var(--ink) 66%, var(--ink) 74%, transparent 74%, transparent 86%, var(--ink) 86%, var(--ink) 92%, transparent 92%);
  background-size: 100% 100%;
}
.qr::before { inset: 8px; opacity: .9; mask-image: radial-gradient(circle at center, black 0, black 60%, transparent 60%); -webkit-mask-image: radial-gradient(circle at center, black 0, black 60%, transparent 60%); }
.qr-corner-tl, .qr-corner-tr, .qr-corner-bl {
  position: absolute;
  width: 22px; height: 22px;
  border: 4px solid var(--ink);
  background: white;
}
.qr-corner-tl { top: 8px; left: 8px; }
.qr-corner-tr { top: 8px; right: 8px; }
.qr-corner-bl { bottom: 8px; left: 8px; }
.qr-corner-tl::after, .qr-corner-tr::after, .qr-corner-bl::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--ink);
}

/* Utility */
.flex { display: flex; }
.col { flex-direction: column; }
.gap-s { gap: 6px; }
.gap-m { gap: 12px; }
.gap-l { gap: 20px; }
.gap-xl { gap: 28px; }
.between { display: flex; justify-content: space-between; align-items: center; }
.center { text-align: center; }
.muted { color: var(--ink-muted); }
.soft { color: var(--ink-soft); }
.bold { font-weight: 700; }
.box {
  background: white;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px 16px;
}
.box-tint { background: var(--primary-tint); border-color: #a7f3d0; }
.box-warm { background: var(--accent-soft); border-color: #fcd34d; }
.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }
.divider-strong { height: 2px; background: var(--ink); margin: 14px 0; }
