/* ============================================================
   算盤仔 SuanPan TW｜現代暖白財經質感設計系統 + A4 專業列印樣式
   ============================================================ */

:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-muted: #f4f1ea;
  --border: #e5e0d5;
  --border-strong: #d4cdbe;

  --ink: #172324;
  --ink-secondary: #4a5a5c;
  --ink-muted: #768486;

  --primary: #0f3d3e;
  --primary-hover: #0a2c2d;
  --primary-soft: #e6f2f1;

  --accent: #d97706;
  --accent-soft: #fef3c7;
  --success: #059669;
  --success-soft: #d1fae5;
  --danger: #dc2626;
  --danger-soft: #fee2e2;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(15, 61, 62, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 61, 62, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 61, 62, 0.14);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.num {
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Header / Navbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #166564 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(15, 61, 62, 0.25);
}

.brand small {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pro-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pro-pill.unlocked {
  background: var(--success-soft);
  border-color: #6ee7b7;
  color: #065f46;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 61, 62, 0.22);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.28);
}

.btn-accent:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--surface-muted);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

/* ---------- Hero Banner (Rich Editorial Fintech Style) ---------- */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.hero {
  position: relative;
  text-align: center;
  max-width: 100%;
  margin: 0 auto 26px;
  padding: 38px 28px 34px;
  border-radius: 24px;
  background: radial-gradient(circle at 85% 15%, rgba(245, 158, 11, 0.22) 0%, transparent 45%),
    linear-gradient(135deg, #0b2d2e 0%, #0f3d3e 55%, #165452 100%);
  color: #fff;
  box-shadow: 0 18px 42px rgba(11, 45, 46, 0.2);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fef3c7;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3.8vw, 2.65rem);
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero h1 span {
  color: #fbbf24;
  text-decoration: underline;
  text-decoration-color: rgba(251, 191, 36, 0.45);
  text-decoration-thickness: 5px;
  text-underline-offset: 4px;
}

.hero p {
  margin: 0 auto;
  max-width: 660px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.98rem;
}

.hero-kpis {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.kpi-chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.94);
}

/* Preset Chips & Featured Guides Grid */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.preset-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-muted);
  color: var(--ink-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.guides-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.guide-mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.guide-mini-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.guide-mini-card h3 {
  margin: 8px 0 8px;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink);
}

.guide-mini-card p {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.guide-mini-cta {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--primary);
}

.filter-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.16s ease;
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 0.88rem;
}

.compare-table th {
  background: var(--primary-soft);
  color: var(--primary);
  text-align: left;
  padding: 9px 10px;
}

.compare-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 900px) {
  .guides-preview-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Tabs ---------- */
.tool-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 24px;
  background: var(--surface-muted);
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.tab-btn {
  text-decoration: none;
  border: none;
  background: transparent;
  padding: 12px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.tab-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #92400e;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Cards & Grids ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.grid-quote {
  display: grid;
  grid-template-columns: minmax(340px, 440px) 1fr;
  gap: 24px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
}

.card-desc {
  margin: 0 0 20px;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

/* ---------- Form Controls ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  margin-bottom: 14px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.field label span.hint {
  font-weight: 500;
  font-size: 0.76rem;
  color: var(--ink-muted);
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.94rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 61, 62, 0.12);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

/* ---------- Metrics & Visual Breakdown ---------- */
.highlight-box {
  background: linear-gradient(135deg, var(--primary) 0%, #134e4a 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.highlight-label {
  font-size: 0.84rem;
  opacity: 0.85;
  margin-bottom: 4px;
}

.highlight-value {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.highlight-sub {
  margin-top: 8px;
  font-size: 0.84rem;
  opacity: 0.9;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.92rem;
}

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

.stat-row .label {
  color: var(--ink-secondary);
}

.stat-row .val {
  font-weight: 700;
}

.stat-row .val.minus {
  color: var(--danger);
}

.stat-row .val.plus {
  color: var(--success);
}

.stacked-bar {
  height: 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
  display: flex;
  margin: 14px 0 10px;
}

.bar-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--ink-secondary);
  margin-bottom: 14px;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
}

.alert-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 12px;
  border: 1px solid transparent;
}

.alert-warn {
  background: var(--accent-soft);
  border-color: #fcd34d;
  color: #78350f;
}

.alert-info {
  background: var(--primary-soft);
  border-color: #b5dad7;
  color: var(--primary);
}

.tier-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.tier-mini {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.tier-mini small {
  display: block;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.tier-mini strong {
  display: block;
  font-size: 1rem;
  color: var(--primary);
  margin-top: 4px;
}

/* ---------- Quote Line Items Editor ---------- */
.line-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.line-item-row {
  display: grid;
  grid-template-columns: 1fr 64px 96px 32px;
  gap: 6px;
  align-items: center;
}

.icon-btn {
  width: 32px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--danger);
  cursor: pointer;
  font-weight: 700;
}

.icon-btn:hover {
  background: var(--danger-soft);
}

/* ---------- A4 Live Quote Preview ---------- */
.a4-wrapper {
  background: #e9e5dc;
  padding: 20px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.a4-sheet {
  position: relative;
  background: #fff;
  color: #111827;
  width: 100%;
  min-height: 760px;
  padding: 36px 38px;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.a4-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.a4-watermark span {
  transform: rotate(-28deg);
  font-size: 1.9rem;
  font-weight: 800;
  color: rgba(15, 61, 62, 0.11);
  border: 3px dashed rgba(15, 61, 62, 0.15);
  padding: 12px 24px;
  border-radius: 12px;
  text-align: center;
  user-select: none;
}

.a4-sheet.pro-clean .a4-watermark {
  display: none;
}

.a4-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2.5px solid var(--primary);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.a4-doc-type {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0.08em;
}

.a4-doc-en {
  font-size: 0.78rem;
  color: #6b7280;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.a4-meta {
  text-align: right;
  font-size: 0.82rem;
  color: #374151;
}

.a4-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
  font-size: 0.85rem;
}

.a4-party-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
}

.a4-party-box h4 {
  margin: 0 0 6px;
  font-size: 0.76rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.a4-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
  font-size: 0.86rem;
}

.a4-table th {
  background: var(--primary);
  color: #fff;
  text-align: left;
  padding: 9px 10px;
  font-weight: 700;
}

.a4-table th.right,
.a4-table td.right {
  text-align: right;
}

.a4-table td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.a4-summary {
  margin-left: auto;
  width: 280px;
  font-size: 0.88rem;
}

.a4-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
}

.a4-summary-row.total {
  border-top: 2px solid var(--primary);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 1.08rem;
  font-weight: 900;
  color: var(--primary);
}

.a4-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.8rem;
  color: #4b5563;
}

.a4-sign-box {
  border: 1px dashed #9ca3af;
  border-radius: 8px;
  padding: 12px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ---------- Pricing / Monetization Section ---------- */
.pricing-section {
  margin-top: 52px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 28px;
}

.section-header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 2.8vw, 1.9rem);
}

.section-header p {
  margin: 0;
  color: var(--ink-secondary);
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  max-width: 920px;
  margin: 0 auto;
}

.price-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.price-tag-badge {
  position: absolute;
  top: -12px;
  right: 22px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

.price-amount {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 18px;
}

.price-amount .now {
  font-size: 2.1rem;
  font-weight: 900;
  color: var(--primary);
}

.price-amount .old {
  font-size: 0.95rem;
  color: var(--ink-muted);
  text-decoration: line-through;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  flex: 1;
}

.feature-list li {
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--ink-secondary);
  display: flex;
  gap: 8px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 24, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 18px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  padding: 26px;
  box-shadow: var(--shadow-lg);
}

.modal-card h3 {
  margin: 0 0 8px;
}

/* ---------- AdSense Slots & SEO FAQ / Editorial ---------- */
.ad-slot {
  display: none;
  margin: 22px auto;
  text-align: center;
  min-height: 90px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ad-slot.ad-active {
  display: block;
}

.ad-slot.ad-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  border: 1.5px dashed var(--border-strong);
  color: var(--ink-muted);
  font-size: 0.84rem;
  font-weight: 700;
  padding: 18px;
}

.seo-faq-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.faq-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.faq-item h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  color: var(--primary);
}

.faq-item p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-secondary);
}

.article-shell {
  max-width: 820px;
  margin: 0 auto;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.article-card h2 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 1.3rem;
}

.article-card h3 {
  margin: 18px 0 8px;
  font-size: 1.02rem;
  color: var(--ink);
}

.article-card p,
.article-card li {
  color: var(--ink-secondary);
  font-size: 0.94rem;
}

.article-meta {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .faq-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 56px;
  padding: 28px 20px 44px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .tool-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2,
  .grid-quote,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .form-grid,
  .a4-parties,
  .a4-footer-grid {
    grid-template-columns: 1fr;
  }
  .line-item-row {
    grid-template-columns: 1fr 56px 84px 30px;
  }
  .a4-sheet {
    padding: 20px;
  }
  .topbar-inner {
    flex-wrap: wrap;
  }
}

/* ---------- Print Styles: 輸出超乾淨 A4 PDF ---------- */
@media print {
  @page {
    size: A4;
    margin: 12mm;
  }
  body {
    background: #fff !important;
  }
  .no-print,
  .topbar,
  .hero,
  .tool-tabs,
  .quote-editor-panel,
  .pricing-section,
  .site-footer,
  .modal-backdrop,
  #tab-salary,
  #tab-bonus,
  #tab-freelance,
  #tab-savings {
    display: none !important;
  }
  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #tab-quote {
    display: block !important;
  }
  .grid-quote {
    display: block !important;
  }
  .a4-wrapper {
    background: #fff !important;
    padding: 0 !important;
  }
  .a4-sheet {
    box-shadow: none !important;
    padding: 0 !important;
    min-height: auto !important;
    border-radius: 0 !important;
  }
}
