/* ============================================================
   FontCreator 繁體中文官網 · 手冊樣式 manual.css
   主題: #0A3E87  強調: #f5b800
   ============================================================ */

:root {
  --m-primary: #0A3E87;
  --m-primary-light: #1557b8;
  --m-primary-50: #eef4fc;
  --m-primary-100: #d8e6f7;
  --m-accent: #f5b800;
  --m-text: #1f2937;
  --m-text-muted: #6b7280;
  --m-border: #e5e7eb;
  --m-bg-soft: #f7f9fc;
  --m-radius: 14px;
  --m-shadow-sm: 0 2px 8px rgba(10,62,135,.06);
  --m-shadow-md: 0 8px 24px rgba(10,62,135,.08);
  --m-shadow-lg: 0 18px 48px rgba(10,62,135,.12);
}

/* ============================================================
   英雄區 (索引頁) - 與站點 .page-hero 一致的通欄樣式
   ============================================================ */
.manual-hero {
  position: relative;
  padding: 80px 0 64px;
  background: linear-gradient(180deg, #fafbfd 0%, #ffffff 100%);
  overflow: hidden;
}
.manual-hero::before {
  content: "MANUAL.";
  position: absolute; top: 60px; left: -40px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic; font-weight: 700;
  font-size: clamp(180px, 22vw, 320px);
  line-height: 1;
  color: rgba(10,62,135,.04);
  letter-spacing: -8px;
  pointer-events: none; -webkit-user-select: none; user-select: none;
}
.manual-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(700px 360px at 88% 10%, rgba(10,62,135,.08), transparent 65%),
    radial-gradient(640px 340px at 6% 88%, rgba(245,184,0,.08), transparent 65%);
}
.manual-hero__inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  z-index: 1;
}
.manual-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  margin-bottom: 22px;
}
.manual-hero__eyebrow .dot {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic; font-weight: 700;
  font-size: 18px; color: var(--m-primary);
}
.manual-hero__eyebrow .dot::before {
  content: "—"; color: rgba(10,62,135,.4); margin-right: 6px;
}
.manual-hero__eyebrow .lbl {
  font-size: 12px; font-weight: 700; letter-spacing: 2.5px;
  color: var(--m-text-muted); text-transform: uppercase;
}
.manual-hero__title {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.08;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -1.4px;
  max-width: 900px;
}
.manual-hero__title em {
  font-style: italic; font-weight: 700;
  font-family: Georgia, "Times New Roman", "Source Han Serif SC", "Songti SC", serif;
  background: linear-gradient(120deg, #0A3E87 0%, #1557b8 50%, #f5b800 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.manual-hero__lead {
  margin-top: 22px;
  max-width: 760px;
  font-size: 17px; line-height: 1.85;
  color: #4b5563;
}
.manual-hero__lead strong { color: var(--m-primary); font-weight: 700; }

.manual-hero__stats {
  margin-top: 36px;
  display: flex; flex-wrap: wrap; gap: 48px;
}
.manual-hero__stat .num {
  font-size: 36px; font-weight: 800; color: #0f172a;
  letter-spacing: -1px;
  font-family: Georgia, "Times New Roman", serif;
}
.manual-hero__stat .num em {
  font-style: italic;
  background: linear-gradient(120deg, #0A3E87, #f5b800);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.manual-hero__stat .lbl {
  display: block; margin-top: 4px;
  font-size: 12px; color: var(--m-text-muted);
  letter-spacing: 2px; text-transform: uppercase; font-weight: 600;
}

/* 英雄搜尋框 */
.manual-hero__search {
  margin-top: 40px;
  max-width: 640px;
  background: #fff;
  border: 1px solid var(--m-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(10,62,135,.12);
  padding: 8px 8px 8px 18px;
  display: flex; align-items: center; gap: 10px;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.manual-hero__search:focus-within {
  border-color: var(--m-primary);
  box-shadow: 0 16px 48px rgba(10,62,135,.18);
}
.manual-hero__search svg { width: 20px; height: 20px; color: var(--m-primary); flex-shrink: 0; }
.manual-hero__search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 16px; color: var(--m-text);
  padding: 12px 0;
}
.manual-hero__search button {
  padding: 12px 22px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0A3E87, #1557b8);
  color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(10,62,135,.3);
  transition: all .25s ease;
}
.manual-hero__search button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(10,62,135,.4); }

.manual-hero__searchstatus {
  margin-top: 14px;
  font-size: 14px;
  color: var(--m-text-muted);
}
.manual-hero__searchstatus strong { color: var(--m-primary); font-weight: 700; }
.manual-hero__searchstatus[data-empty="1"] { color: #b45309; }
.manual-hero__searchstatus kbd {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--m-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--m-primary);
}

mark {
  background: rgba(245,184,0,.4);
  color: inherit;
  padding: 0 3px; border-radius: 3px;
  font-weight: 700;
}

/* ============================================================
   全文搜尋結果面板
   ============================================================ */
.manual-results {
  background: var(--m-bg-soft);
  border-top: 1px solid var(--m-border);
  border-bottom: 1px solid var(--m-border);
}
.manual-results__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}
.manual-results__head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--m-border);
}
.manual-results__count {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic; font-weight: 700;
  font-size: 36px;
  background: linear-gradient(120deg, #0A3E87, #f5b800);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.manual-results__hint {
  font-size: 15px; color: var(--m-text-muted);
}
.manual-results__clear {
  margin-left: auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--m-border);
  color: var(--m-text-muted);
  font-size: 13px; font-weight: 600;
  transition: all .2s ease;
}
.manual-results__clear:hover {
  border-color: var(--m-primary);
  color: var(--m-primary);
  background: var(--m-primary-50);
}
.manual-results__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 14px;
  counter-reset: r;
}
.manual-results__item {
  counter-increment: r;
  background: #fff;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow-sm);
  transition: all .25s ease;
  overflow: hidden;
}
.manual-results__item:hover {
  border-color: var(--m-primary);
  box-shadow: var(--m-shadow-md);
  transform: translateY(-2px);
}
.manual-results__item a {
  display: block;
  padding: 18px 22px 18px 64px;
  color: inherit;
  text-decoration: none;
  position: relative;
}
.manual-results__item a::before {
  content: counter(r, decimal-leading-zero);
  position: absolute; left: 22px; top: 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; font-weight: 700;
  color: var(--m-text-muted);
  letter-spacing: 1px;
}
.manual-results__title {
  font-size: 17px; font-weight: 700;
  color: var(--m-primary);
  margin-bottom: 4px;
}
.manual-results__bc {
  font-size: 12px;
  color: var(--m-text-muted);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.manual-results__snippet {
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
}

/* ============================================================
   索引頁主體
   ============================================================ */
.manual-index {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  position: relative;
}
.manual-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}
.manual-cat {
  background: #fff;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow-sm);
  padding: 26px 24px 18px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
  overflow: hidden;
}
.manual-cat::before {
  content: "";
  position: absolute; left: 0; top: 0; height: 4px; width: 56px;
  background: linear-gradient(90deg, var(--m-primary), var(--m-accent));
  border-radius: 0 0 4px 0;
  transition: width .3s ease;
}
.manual-cat:hover {
  transform: translateY(-4px);
  box-shadow: var(--m-shadow-lg);
  border-color: rgba(10,62,135,.18);
}
.manual-cat:hover::before { width: 100%; }
.manual-cat__head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.manual-cat__icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--m-primary-50), #fff);
  border: 1px solid var(--m-primary-100);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--m-primary);
  flex-shrink: 0;
}
.manual-cat__icon svg { width: 22px; height: 22px; }
.manual-cat__title {
  font-size: 17px; font-weight: 700;
  color: var(--m-primary);
  letter-spacing: -.2px;
}
.manual-cat__count {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; font-weight: 700;
  color: var(--m-text-muted);
  background: var(--m-bg-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.manual-cat ul {
  list-style: none;
  margin: 0; padding: 0;
}
.manual-cat li { margin: 0; }
.manual-cat li a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  color: var(--m-text);
  font-size: 14.5px;
  text-decoration: none;
  transition: all .2s ease;
}
.manual-cat li a::before {
  content: "›";
  color: var(--m-text-muted);
  font-weight: 700;
  transition: transform .2s ease, color .2s ease;
}
.manual-cat li a:hover {
  background: var(--m-primary-50);
  color: var(--m-primary);
}
.manual-cat li a:hover::before { color: var(--m-accent); transform: translateX(3px); }

/* ============================================================
   主題文章頁
   ============================================================ */
.manual-page {
  background: var(--m-bg-soft);
  min-height: calc(100vh - 72px);
}

.manual-pagehead {
  background:
    radial-gradient(800px 320px at 0% 0%, rgba(245,184,0,.10), transparent 60%),
    linear-gradient(135deg, #0A3E87, #072c63);
  color: #fff;
  padding: 56px 24px 80px;
  position: relative;
  overflow: hidden;
}
.manual-pagehead::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 60px;
  background: linear-gradient(180deg, transparent, var(--m-bg-soft));
}
.manual-pagehead__inner {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
}
.manual-breadcrumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
  letter-spacing: .5px;
}
.manual-breadcrumb a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  transition: color .2s ease;
}
.manual-breadcrumb a:hover { color: var(--m-accent); }
.manual-breadcrumb svg { width: 14px; height: 14px; opacity: .6; }
.manual-pagehead h1 {
  margin-top: 14px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.5px;
}

/* 文章主區 */
.manual-container {
  max-width: 960px;
  margin: -48px auto 0;
  padding: 0 24px 80px;
  position: relative;
}

/* 搜尋條 (文章頁) */
.search-container {
  background: #fff;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow-md);
  padding: 14px;
  margin-bottom: 28px;
}
.search-box {
  display: flex; gap: 10px; align-items: center;
}
.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 1.5px solid var(--m-border);
  border-radius: 10px;
  font-size: 15px;
  color: var(--m-text);
  background: var(--m-bg-soft);
  transition: all .2s ease;
}
.search-input:focus {
  outline: none;
  border-color: var(--m-primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(10,62,135,.08);
}
.search-button {
  padding: 12px 22px;
  background: linear-gradient(135deg, #0A3E87, #1557b8);
  color: #fff; font-size: 14px; font-weight: 600;
  border-radius: 10px;
  transition: all .25s ease;
  box-shadow: 0 6px 16px rgba(10,62,135,.25);
}
.search-button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(10,62,135,.35); }
.search-navigation {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--m-border);
  font-size: 13px;
  color: var(--m-text-muted);
}
.search-nav-btn {
  padding: 5px 14px;
  background: var(--m-primary-50);
  color: var(--m-primary);
  border: 1px solid var(--m-primary-100);
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.search-nav-btn:hover { background: var(--m-primary-100); }
.search-nav-btn:disabled { opacity: .4; cursor: not-allowed; }

.search-highlight {
  background: rgba(245,184,0,.4);
  padding: 1px 3px; border-radius: 3px;
  font-weight: 600;
}
.search-highlight.active {
  background: var(--m-accent);
  color: #1f2937;
}

/* 內容卡片 */
.manual-content {
  background: #fff;
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius);
  box-shadow: var(--m-shadow-md);
  padding: 48px 56px;
  line-height: 1.85;
  color: var(--m-text);
  font-size: 16px;
}
.manual-content > h1:first-child,
.manual-content > h2:first-child { margin-top: 0; }

.manual-content h1, .manual-content h2,
.manual-content h3, .manual-content h4 {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -.3px;
  margin-top: 36px; margin-bottom: 14px;
}
.manual-content h1 { font-size: 1.9em; }
.manual-content h2 {
  font-size: 1.45em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--m-border);
  position: relative;
}
.manual-content h2::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 48px; height: 2px;
  background: linear-gradient(90deg, var(--m-primary), var(--m-accent));
}
.manual-content h3 { font-size: 1.2em; color: var(--m-primary); }
.manual-content h4 { font-size: 1.05em; color: var(--m-primary-light); }

.manual-content p { margin: 0 0 14px; }
.manual-content strong { color: #0f172a; }
.manual-content em { color: var(--m-primary); font-style: normal; font-weight: 600; }

.manual-content a {
  color: var(--m-primary);
  text-decoration: none;
  border-bottom: 1px dashed rgba(10,62,135,.4);
  transition: all .2s ease;
}
.manual-content a:hover {
  color: var(--m-primary-light);
  border-bottom-color: var(--m-primary-light);
  border-bottom-style: solid;
}

.manual-content ul, .manual-content ol {
  margin: 12px 0 18px;
  padding-left: 1.4em;
}
.manual-content li { margin-bottom: 6px; }
.manual-content ul li::marker { color: var(--m-accent); }

.manual-content img {
  max-width: 100%; height: auto;
  border: 1px solid var(--m-border);
  border-radius: 10px;
  margin: 22px 0;
  box-shadow: var(--m-shadow-sm);
}

.manual-content code {
  background: var(--m-primary-50);
  color: var(--m-primary);
  padding: 2px 7px; border-radius: 5px;
  font-size: .9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.manual-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.7;
}
.manual-content pre code { background: transparent; color: inherit; padding: 0; }

.manual-content blockquote, .manual-content .note {
  margin: 18px 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(245,184,0,.08), rgba(10,62,135,.04));
  border-left: 3px solid var(--m-accent);
  border-radius: 0 8px 8px 0;
  color: #4b5563;
  font-size: 15px;
}

.manual-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 15px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--m-shadow-sm);
}
.manual-content th {
  background: linear-gradient(135deg, #0A3E87, #1557b8);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
}
.manual-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--m-border);
  background: #fff;
}
.manual-content tr:nth-child(even) td { background: var(--m-bg-soft); }
.manual-content tr:hover td { background: var(--m-primary-50); }

/* 英文原文連結 (低調風格) */
.manual-original {
  margin-top: 28px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--m-text-muted);
  background: var(--m-bg-soft);
  border-left: 2px solid var(--m-border);
  border-radius: 0 6px 6px 0;
  letter-spacing: .2px;
}
.manual-original a {
  color: var(--m-text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--m-border);
  word-break: break-all;
}
.manual-original a:hover {
  color: var(--m-primary);
  border-bottom-color: var(--m-primary);
  border-bottom-style: solid;
}

/* 上下頁導航 */
.page-navigation {
  display: flex; justify-content: space-between; gap: 14px;
  margin-top: 36px;
}
.page-nav-btn {
  flex: 1;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--m-border);
  border-radius: 12px;
  color: var(--m-text);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: all .25s ease;
  box-shadow: var(--m-shadow-sm);
  max-width: 48%;
}
.page-nav-btn:hover {
  border-color: var(--m-primary);
  color: var(--m-primary);
  transform: translateY(-2px);
  box-shadow: var(--m-shadow-md);
}
.page-nav-prev::before { content: "←"; color: var(--m-primary); font-weight: 700; }
.page-nav-next {
  justify-content: flex-end;
  margin-left: auto;
  text-align: right;
}
.page-nav-next::after { content: "→"; color: var(--m-primary); font-weight: 700; }
.page-nav-next-disabled {
  opacity: .4; cursor: not-allowed;
  flex: 1; max-width: 48%;
  padding: 16px 20px;
  background: var(--m-bg-soft);
  border: 1px dashed var(--m-border);
  border-radius: 12px;
  color: var(--m-text-muted);
  text-align: right;
}

/* ============================================================
   主題文章頁 Hero (使用現有 .manual-header 結構)
   ============================================================ */
body { background: var(--m-bg-soft); }

.manual-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
  position: relative;
}

.manual-container > .manual-header {
  position: relative;
  /* 通欄：突破容器寬度鋪滿視窗 */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 0;
  margin-bottom: 40px;
  padding: 64px 0 56px;
  background: linear-gradient(180deg, #fafbfd 0%, #ffffff 100%);
  overflow: hidden;
}
.manual-container > .manual-header::before {
  content: "TOPIC.";
  position: absolute; top: 40px; left: -30px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic; font-weight: 700;
  font-size: clamp(140px, 18vw, 240px);
  line-height: 1;
  color: rgba(10,62,135,.05);
  letter-spacing: -8px;
  pointer-events: none; -webkit-user-select: none; user-select: none;
}
.manual-container > .manual-header::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 320px at 92% 10%, rgba(10,62,135,.08), transparent 65%),
    radial-gradient(540px 300px at 4% 88%, rgba(245,184,0,.08), transparent 65%);
}
.manual-container > .manual-header .breadcrumb,
.manual-container > .manual-header h1 {
  position: relative; z-index: 1;
  max-width: 960px;
  margin-left: auto; margin-right: auto;
  padding-left: 24px; padding-right: 24px;
}
.manual-container > .manual-header .breadcrumb {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  color: var(--m-text-muted);
  letter-spacing: .5px;
  margin-bottom: 16px;
}
.manual-container > .manual-header .breadcrumb::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--m-accent); box-shadow: 0 0 0 4px rgba(245,184,0,.18);
  flex-shrink: 0;
}
.manual-container > .manual-header h1 {
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  color: #0f172a;
}

@media (max-width: 640px) {
  .manual-container > .manual-header { padding: 44px 0 36px; margin-bottom: 28px; }
  .manual-container > .manual-header .breadcrumb,
  .manual-container > .manual-header h1 { padding-left: 18px; padding-right: 18px; }
}

/* ============================================================
   響應式
   ============================================================ */
@media (max-width: 900px) {
  .manual-hero { padding: 56px 20px 72px; }
  .manual-hero__stats { gap: 24px; }
  .manual-content { padding: 28px 22px; }
  .manual-pagehead { padding: 40px 20px 64px; }
}
@media (max-width: 640px) {
  .manual-index { padding: 0 16px 56px; }
  .manual-container { padding: 0 16px 56px; }
  .manual-hero__title { font-size: 30px; }
  .manual-content { padding: 22px 18px; font-size: 15.5px; }
  .search-box { flex-direction: column; align-items: stretch; }
  .search-button { width: 100%; }
  .page-navigation { flex-direction: column; }
  .page-nav-btn, .page-nav-next-disabled { max-width: 100%; }
  .manual-hero__search { flex-direction: column; padding: 12px; align-items: stretch; }
  .manual-hero__search button { width: 100%; }
}
