/* ===================================================================
   MathMagic 官網 — 內頁通用樣式 page.css
   適用於產品頁、購買頁、下載頁、幫助中心等所有子頁面
   依賴 common.css 的變數與導航/頁尾樣式
   =================================================================== */

/* ---------- 頁面橫幅 ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(800px 420px at 85% -20%, rgba(3,121,228,.14), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
  padding: 62px 0 56px;
  border-bottom: 1px solid var(--mm-line);
}
.page-hero::after {
  content: attr(data-sym);
  position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
  font-family: "Cambria Math", serif; font-size: 280px; font-weight: 700; line-height: 1;
  color: rgba(3,121,228,.05); pointer-events: none;
}
.page-hero-inner { position: relative; z-index: 1; max-width: 860px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; color: var(--mm-muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--mm-muted); }
.breadcrumb a:hover { color: var(--mm-primary); }
.breadcrumb .sep { opacity: .5; }
.page-eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--mm-primary); margin-bottom: 14px;
}
.page-hero h1 { font-size: 42px; font-weight: 800; letter-spacing: -.6px; margin-bottom: 16px; }
.page-hero p { font-size: 17.5px; color: var(--mm-text); max-width: 720px; line-height: 1.8; margin: 0; }
.page-hero .hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

/* ---------- 內容區 ---------- */
.page-body { padding: 64px 0 80px; }
.page-narrow { max-width: 900px; margin: 0 auto; }
/* 無目錄頁：內容左對齊，寬度與含目錄頁的「目錄+內容」整體一致 */
.read-single { max-width: 1180px; margin: 0; }

/* ---------- 正文排版 prose ---------- */
.prose { color: var(--mm-text); font-size: 16px; line-height: 1.9; }
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  font-size: 27px; font-weight: 800; color: var(--mm-ink); margin: 48px 0 18px;
  padding-bottom: 12px; border-bottom: 2px solid var(--mm-primary-light);
}
.prose h3 { font-size: 21px; font-weight: 700; color: var(--mm-ink); margin: 32px 0 14px; }
.prose h4 { font-size: 17.5px; font-weight: 700; color: var(--mm-ink); margin: 24px 0 10px; }
.prose p { margin: 0 0 16px; }
.prose a { color: var(--mm-primary); font-weight: 600; text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose strong { color: var(--mm-ink); }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 4px; list-style: none; }
.prose ol { counter-reset: li; }
.prose li { position: relative; padding-left: 28px; margin-bottom: 10px; line-height: 1.8; }
.prose ul > li::before {
  content: ""; position: absolute; left: 4px; top: 11px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--mm-primary);
}
.prose ol > li { counter-increment: li; }
.prose ol > li::before {
  content: counter(li); position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%; background: var(--mm-primary-light);
  color: var(--mm-primary); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.prose img { border-radius: 12px; border: 1px solid var(--mm-line); margin: 16px 0; box-shadow: var(--mm-shadow-sm); }
.prose figure { margin: 22px 0; }
.prose figcaption { font-size: 13.5px; color: var(--mm-muted); text-align: center; margin-top: 8px; }
.prose blockquote {
  margin: 20px 0; padding: 16px 22px; border-left: 4px solid var(--mm-primary);
  background: var(--mm-primary-soft); border-radius: 0 12px 12px 0; color: var(--mm-text);
}
.prose hr { border: none; border-top: 1px solid var(--mm-line); margin: 36px 0; }
.prose code {
  background: var(--mm-bg-soft); border: 1px solid var(--mm-line); border-radius: 6px;
  padding: 2px 7px; font-family: Consolas, "SF Mono", Menlo, monospace; font-size: 13.5px; color: var(--mm-primary-dark);
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 22px 0; border-radius: 14px; border: 1px solid var(--mm-line); }
table.mm-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 540px; }
table.mm-table th, table.mm-table td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--mm-line); vertical-align: top; }
table.mm-table thead th { background: linear-gradient(135deg, var(--mm-primary), #1D57AE); color: #fff; font-weight: 700; white-space: nowrap; }
table.mm-table tbody tr:nth-child(even) { background: var(--mm-bg-soft); }
table.mm-table tbody tr:hover { background: var(--mm-primary-soft); }
table.mm-table td.center, table.mm-table th.center { text-align: center; }
.tick { color: #16a34a; font-weight: 700; }
.cross { color: #cbd5e1; }
.table-note { font-size: 13px; color: var(--mm-muted); margin: -4px 0 8px; }

/* ---------- 資訊卡 / 規格卡 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin: 26px 0; }
.info-card {
  background: #fff; border: 1px solid var(--mm-line); border-radius: 18px; padding: 28px 26px;
  box-shadow: var(--mm-shadow-sm); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.info-card:hover { transform: translateY(-5px); box-shadow: var(--mm-shadow); border-color: #cfe4fb; }
.info-card .ic-ico {
  width: 50px; height: 50px; border-radius: 14px; margin-bottom: 16px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--mm-primary), #1D57AE); box-shadow: 0 8px 18px rgba(3,121,228,.28);
}
.info-card .ic-ico svg { width: 24px; height: 24px; }
.info-card h3 { font-size: 18px; font-weight: 700; margin: 0 0 10px; color: var(--mm-ink); }
.info-card p { margin: 0; font-size: 14.5px; color: var(--mm-muted); line-height: 1.75; }

/* 規格盒（系統需求等） */
.spec-box {
  background: var(--mm-bg-soft); border: 1px solid var(--mm-line); border-radius: 16px;
  padding: 26px 28px; margin: 22px 0;
}
.spec-box h4 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 0 0 14px; color: var(--mm-ink); }
.spec-box h4 .badge-os {
  font-size: 12px; font-weight: 700; color: #fff; padding: 3px 10px; border-radius: 999px;
  background: var(--mm-primary);
}
.spec-box ul { margin: 0; padding: 0; list-style: none; }
.spec-box li { position: relative; padding-left: 24px; margin-bottom: 9px; font-size: 14.5px; line-height: 1.7; }
.spec-box li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--mm-primary); }

/* ---------- 標籤 ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--mm-primary-soft); color: var(--mm-primary); border: 1px solid #dcecfc;
}
.tag.free { background: #e7f8ef; color: #16a34a; border-color: #bdebcf; }
.tag.disc { background: #fdeaea; color: #d64545; border-color: #f6cccc; }

/* ---------- 內嵌 CTA ---------- */
.inline-cta {
  margin: 56px 0 10px; background: linear-gradient(135deg, #0c1d33, #103a63); color: #fff;
  border-radius: 22px; padding: 44px 40px; text-align: center; position: relative; overflow: hidden;
}
.inline-cta::after {
  content: ""; position: absolute; right: -70px; top: -70px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(3,121,228,.5), transparent 70%);
}
.inline-cta h2 { color: #fff; font-size: 28px; font-weight: 800; margin: 0 0 12px; position: relative; }
.inline-cta p { color: #b9c8dc; font-size: 16px; margin: 0 0 26px; position: relative; }
.inline-cta .ic-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; position: relative; }
.mm-btn-ghost.ondark { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.mm-btn-ghost.ondark:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.45); }
/* 深色 CTA 上的主按鈕：白底藍字，避免藍底藍光糊在一起 */
.inline-cta .mm-btn-primary { background: #fff; color: var(--mm-primary); box-shadow: 0 10px 26px rgba(0,0,0,.28); }
.inline-cta .mm-btn-primary:hover { background: #eef5ff; }

/* ---------- 價格卡 ---------- */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; margin: 28px 0; }
.price-card {
  position: relative; background: #fff; border: 1px solid var(--mm-line); border-radius: 20px;
  padding: 32px 28px; box-shadow: var(--mm-shadow-sm); display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.price-card:hover { transform: translateY(-6px); box-shadow: var(--mm-shadow); border-color: #cfe4fb; }
.price-card.featured { border-color: var(--mm-primary); box-shadow: var(--mm-shadow); }
.price-card.featured::before {
  content: "推薦"; position: absolute; top: 16px; right: 16px; font-size: 12px; font-weight: 700; color: #fff;
  background: var(--mm-primary); padding: 4px 12px; border-radius: 999px;
}
.price-card h3 { font-size: 19px; font-weight: 800; color: var(--mm-ink); margin: 0 0 6px; }
.price-card .pc-sub { font-size: 13.5px; color: var(--mm-muted); margin-bottom: 18px; }
.price-card .pc-price { font-size: 32px; font-weight: 800; color: var(--mm-primary); margin-bottom: 4px; }
.price-card .pc-price small { font-size: 14px; color: var(--mm-muted); font-weight: 500; }
.price-card ul { list-style: none; margin: 18px 0 24px; padding: 0; }
.price-card li { position: relative; padding-left: 26px; margin-bottom: 10px; font-size: 14px; line-height: 1.6; }
.price-card li::before {
  content: ""; position: absolute; left: 2px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--mm-primary-light); box-shadow: inset 0 0 0 4px var(--mm-primary);
}
.price-card .mm-btn { margin-top: auto; justify-content: center; }

/* ===================================================================
   統一英雄區（極簡 + 柔光背景） — 適用於全站重設計內頁
   =================================================================== */
.mm-hero {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--mm-line);
  padding: 68px 0 58px; background: linear-gradient(180deg, #e8f1fb 0%, #f3f8fc 100%);
}
.mm-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(620px 420px at 88% -20%, rgba(3,121,228,.16), transparent 62%),
    radial-gradient(520px 360px at 8% 120%, rgba(7,99,211,.10), transparent 60%);
}
.mm-hero-inner { position: relative; z-index: 1; max-width: 1180px; }
.mm-hero-bc { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--mm-muted); margin-bottom: 24px; }
.mm-hero-bc a { color: var(--mm-muted); }
.mm-hero-bc a:hover { color: var(--mm-primary); }
.mm-hero-bc .sep { opacity: .45; }
.mm-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase; color: var(--mm-muted); margin-bottom: 22px;
}
.mm-hero-eyebrow::before { content: ""; width: 30px; height: 1.5px; background: var(--mm-primary); }
.mm-hero h1 { font-size: 46px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.1; margin: 0 0 20px; color: var(--mm-ink); }
.mm-hero h1 .tag { vertical-align: middle; margin-left: 6px; }
.mm-hero-sub { font-size: 17px; color: var(--mm-muted); line-height: 1.75; margin: 0; max-width: 880px; }
.mm-hero .tag-row { margin: 26px 0 0; }
.mm-hero .hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.mm-hero-meta {
  display: flex; flex-wrap: wrap; margin: 40px 0 0;
  background: rgba(255,255,255,.75); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--mm-line); border-radius: 14px; box-shadow: var(--mm-shadow-sm); overflow: hidden;
}
.mm-hero-meta .mi { flex: 1 1 0; min-width: 180px; display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-left: 1px solid var(--mm-line); }
.mm-hero-meta .mi:first-child { border-left: none; }
.mm-hero-meta .mi svg { flex: 0 0 20px; width: 20px; height: 20px; color: var(--mm-primary); stroke-width: 1.8; }
.mm-hero-meta .mi h4 { font-size: 13.5px; font-weight: 800; color: var(--mm-ink); margin: 0; }
.mm-hero-meta .mi p { font-size: 11.5px; color: var(--mm-muted); margin: 2px 0 0; line-height: 1.4; }

/* ===================================================================
   閱讀型兩欄佈局：左側粘性「本頁目錄」+ 右側內容
   =================================================================== */
.read-layout { display: grid; grid-template-columns: 232px 1fr; gap: 44px; align-items: start; max-width: 1180px; margin: 0 auto; }
.read-toc { position: sticky; top: calc(var(--mm-nav-h) + 16px); }
.toc-card { background: #fff; border: 1px solid var(--mm-line); border-radius: 18px; box-shadow: var(--mm-shadow-sm); padding: 18px 16px; }
.toc-label { display: block; margin-bottom: 12px; font-size: 12px; font-weight: 800; color: var(--mm-muted); letter-spacing: .6px; text-transform: uppercase; padding-left: 6px; }
.toc-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc-nav li { margin: 0; padding: 0; }
.toc-nav li::before { display: none; }
.toc-nav a { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--mm-text); transition: all .18s ease; }
.toc-nav a svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--mm-muted); transition: color .18s ease; }
.toc-nav a:hover { background: var(--mm-bg-soft); color: var(--mm-primary); }
.toc-nav a:hover svg { color: var(--mm-primary); }
.toc-nav a.active { background: var(--mm-primary); color: #fff; box-shadow: 0 6px 16px rgba(3,121,228,.28); }
.toc-nav a.active svg { color: #fff; }
.toc-aside-cta { margin-top: 14px; display: block; text-align: center; }
.read-main { min-width: 0; }
.read-main [id] { scroll-margin-top: calc(var(--mm-nav-h) + 20px); }

/* ===================================================================
   更新日誌時間線
   =================================================================== */
.ver-log { margin: 16px 0 8px; padding-left: 8px; border-left: 2px solid var(--mm-line); }
.ver-item { position: relative; padding: 0 0 2px 26px; margin-bottom: 22px; }
.ver-item::before { content: ""; position: absolute; left: -9px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--mm-primary); }
.ver-item:not(:first-child)::before { border-color: var(--mm-line); }
.ver-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.ver-num { font-size: 13.5px; font-weight: 800; color: var(--mm-primary); background: var(--mm-primary-soft); border: 1px solid #dcecfc; padding: 2px 11px; border-radius: 8px; }
.ver-date { font-size: 13px; color: var(--mm-muted); font-weight: 600; }
.ver-item ul { margin: 0; }
.ver-item li { font-size: 14.5px; }

/* ===================================================================
   截圖網格 / 提示框（多頁共享）
   =================================================================== */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 22px 0; }
.shot-grid a { position: relative; display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--mm-line); box-shadow: var(--mm-shadow-sm); cursor: zoom-in; transition: transform .2s ease, box-shadow .2s ease; }
.shot-grid a:hover { transform: translateY(-4px); box-shadow: var(--mm-shadow); }
.shot-grid img { width: 100%; height: 188px; object-fit: cover; object-position: top center; display: block; margin: 0; border: none; border-radius: 0; box-shadow: none; background: var(--mm-bg-soft); }
/* 懸停放大提示圖示 */
.shot-grid a::after {
  content: ""; position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 8px;
  background: rgba(8,15,26,.55) center / 16px 16px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3M11 8v6M8 11h6'/%3E%3C/svg%3E");
  opacity: 0; transition: opacity .2s ease; pointer-events: none;
}
.shot-grid a:hover::after { opacity: 1; }
.shot-wide a { display: block; border-radius: 16px; overflow: hidden; border: 1px solid var(--mm-line); box-shadow: var(--mm-shadow); margin: 22px 0; cursor: zoom-in; }
.shot-wide img { width: 100%; height: auto; display: block; margin: 0; border: none; border-radius: 0; box-shadow: none; }

/* ===================================================================
   圖片燈箱（點選放大 + 左右切換）— 多頁共享
   =================================================================== */
.mm-lightbox {
  position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center;
  background: rgba(8,15,26,.9); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.mm-lightbox.open { display: flex; }
.mm-lightbox .lb-stage { position: relative; max-width: 90vw; max-height: 86vh; display: flex; align-items: center; justify-content: center; }
.mm-lightbox img { max-width: 90vw; max-height: 80vh; border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.55); background: #fff; }
.lb-btn {
  position: absolute; z-index: 2; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #fff; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s ease, transform .2s ease;
}
.lb-btn:hover { background: rgba(255,255,255,.26); }
.lb-btn:active { transform: scale(.94); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 22px; top: 50%; transform: translateY(-50%); }
.lb-prev:active, .lb-next:active { transform: translateY(-50%) scale(.94); }
.lb-close { top: 20px; right: 22px; }
.lb-caption { position: absolute; bottom: 56px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; max-width: 80vw; text-align: center; line-height: 1.5; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.lb-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #cdd8e6; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.1); padding: 5px 14px; border-radius: 999px; }
body.lb-lock { overflow: hidden; }
@media (max-width: 600px) {
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
  .lb-btn { width: 40px; height: 40px; }
}

.notice-box { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 16px; padding: 22px 26px; margin: 22px 0; font-size: 14.5px; line-height: 1.85; color: #7c4a14; }
.notice-box h4 { margin: 0 0 8px; color: #b45309; font-size: 16px; }
.notice-box a { color: #b45309; font-weight: 700; }
.notice-box.danger { background: #fdeaea; border-color: #f6cccc; color: #a23a3a; }
.notice-box.danger h4 { color: #c0392b; }
.notice-box.danger a { color: #c0392b; }

/* ---------- 響應式 ---------- */
@media (max-width: 980px) {
  .read-layout { grid-template-columns: 1fr; gap: 20px; }
  /* 移動端：目錄變為橫向可滾動膠囊條，吸附在導航欄下方 */
  .read-toc { position: sticky; top: var(--mm-nav-h); z-index: 20; min-width: 0; }
  .toc-card {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; max-width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .toc-card::-webkit-scrollbar { display: none; }
  .toc-label { flex: 0 0 auto; margin: 0; padding-left: 4px; }
  .toc-nav { flex-direction: row; flex-wrap: nowrap; gap: 8px; }
  .toc-nav a { white-space: nowrap; padding: 8px 14px; border: 1px solid var(--mm-line); background: var(--mm-bg-soft); }
  .toc-nav a.active { border-color: transparent; }
  .toc-aside-cta { display: none; }
}
@media (max-width: 480px) {
  .toc-label { display: none; }
}
@media (max-width: 768px) {
  .page-hero { padding: 44px 0 40px; }
  .page-hero::after { font-size: 180px; }
  .page-hero h1 { font-size: 30px; }
  .page-hero p { font-size: 15.5px; }
  .page-body { padding: 44px 0 52px; }
  .prose h2 { font-size: 22px; }
  .prose h3 { font-size: 18.5px; }
  .inline-cta { padding: 36px 22px; }
  .inline-cta h2 { font-size: 23px; }
  .mm-hero { padding: 46px 0 40px; }
  .mm-hero h1 { font-size: 32px; }
  .mm-hero-sub { font-size: 15.5px; }
  .mm-hero .tag-row { margin-top: 20px; gap: 7px; }
}
@media (max-width: 480px) {
  .tag-row { gap: 6px; }
  .tag { font-size: 12px; padding: 5px 10px; }
}
