:root {
  /* 專屬品牌色彩系統 (風格.txt) */
  --navy: #1B3F78;
  --navy-dark: #0F2549;
  --navy-deep: #081A38;
  --teal: #5BB39A;
  --leaf: #8FC859;
  --sky: #3B8BC7;
  --amber: #F4A623;
  --amber-dark: #D48812;
  --danger-red: #C0492F;
  --danger-bg: #FDF1ED;
  --line-color: #E3E7DE;

  /* 溫潤紙張米底色 */
  --bg: #FAF8F2;
  --bg-subtle: #F3F0E6;
  --card: #FFFFFF;
  --ink: #1B3F78;
  --muted: #5B6B7B;
  --line: #E3E7DE;

  --brand: #1B3F78;
  --brand-ink: #FFFFFF;
  --ok: #5BB39A;
  --ok-bg: #EBF7F3;
  --warn: #D48812;
  --warn-bg: #FEF7EA;
  --err: #C0492F;
  --err-bg: #FDF1ED;

  /* 品牌代表漸層 */
  --grad-kyle: linear-gradient(135deg, #8FC859 0%, #5BB39A 45%, #3B8BC7 100%);
  --grad-gold: linear-gradient(135deg, #F4A623 0%, #D48812 100%);
  --grad-hero: linear-gradient(135deg, #081A38 0%, #0F2549 50%, #1B3F78 100%);

  /* 圓角與漫反射陰影 */
  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow-soft: 0 4px 20px rgba(27, 63, 120, 0.08);
  --shadow-float: 0 10px 30px rgba(27, 63, 120, 0.12);
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.skip { position: absolute; left: -999px; top: 0; background: var(--navy-deep); color: #fff; padding: .5rem 1rem; z-index: 100; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }

/* 頂部 Header - 深海藍漸層底圖 */
.topbar {
  background: var(--grad-hero);
  color: #fff;
  padding: 1.1rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(8, 26, 56, 0.25);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.topbar::after {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(91, 179, 154, 0.3) 0%, transparent 70%);
  pointer-events: none;
}
.topbar h1 {
  margin: 0;
  font-size: 1.4rem;
  font-family: "Noto Serif TC", Georgia, serif;
  font-weight: 700;
  letter-spacing: .05em;
  color: #FFFFFF;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  width: 100%;
  text-align: center;
}
.sync-status {
  margin: .35rem 0 0;
  font-size: .85rem;
  font-family: "JetBrains Mono", monospace;
  background: rgba(255, 255, 255, 0.12);
  padding: .3rem .8rem;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #EBF7F3;
}

/* 主佈局 - 溫潤紙張米底色 + 卡片浮起 */
.layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 1.75rem auto;
  padding: 0 1.25rem;
  align-items: start;
}

/* 側邊欄 Aside */
.side {
  position: sticky;
  top: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.35rem 1.2rem;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.side::before {
  content: "";
  position: absolute;
  top: 0; left: 16px; right: 16px;
  height: 3px;
  background: var(--grad-kyle);
  border-radius: 99px;
}
.side .ident {
  margin: .25rem 0 0;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  font-size: .95rem;
  color: var(--navy);
}
.side .pct {
  margin: .35rem 0 .65rem;
  color: var(--muted);
  font-size: .88rem;
}

/* 進度條 */
.progress {
  height: 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid #E3E7DE;
}
.progress .bar {
  height: 100%;
  background: var(--grad-kyle);
  transition: width .35s ease;
}

/* 章節導覽 */
.chapters ol { list-style: none; padding: 0; margin: 1.1rem 0; display: grid; gap: .45rem; }
.chapters button {
  width: 100%;
  text-align: left;
  padding: .6rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #FFF;
  color: var(--navy);
  cursor: pointer;
  font: inherit;
  font-size: .92rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all .2s ease;
}
.chapters button:hover {
  background: #FAF8F2;
  border-color: var(--teal);
  transform: translateX(2px);
}
.chapters button .ch-title { flex: 1; min-width: 0; line-height: 1.4; }
.chapters button.done { border-color: var(--teal); }
.chapters button.current {
  background: var(--navy);
  color: #FFF;
  border-color: var(--navy);
  box-shadow: 0 4px 12px rgba(27, 63, 120, 0.25);
}
.chapters button:disabled { opacity: .45; cursor: not-allowed; }

/* 必填徽章 (藥丸圓角) */
.badge-missing {
  display: inline-block;
  font-size: .75rem;
  font-family: "JetBrains Mono", monospace;
  padding: .15rem .55rem;
  border-radius: var(--radius-pill);
  background: var(--danger-bg);
  color: var(--danger-red);
  font-weight: 600;
  white-space: nowrap;
  margin-left: .4rem;
  border: 1px solid rgba(192, 73, 47, 0.2);
}
.chapters button.current .badge-missing {
  background: #FFF;
  color: var(--danger-red);
}

.missing-alert {
  background: #FFF9ED;
  border: 1px solid rgba(244, 166, 35, 0.4);
  border-radius: 12px;
  padding: .6rem .85rem;
  margin: .85rem 0;
  font-size: .88rem;
  color: var(--amber-dark);
}
.missing-alert.all-done {
  background: var(--ok-bg);
  border-color: var(--teal);
  color: var(--ok);
  font-weight: 600;
}
.missing-alert p { margin: 0; }

/* 內容卡片 Cards */
.content, .narrow .card, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.content::before, .narrow .card::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 3px;
  background: var(--grad-kyle);
  border-radius: 99px;
}
.narrow { max-width: 660px; margin: 2rem auto; padding: 0 1.25rem; display: grid; gap: 1.25rem; }

/* 標題 Typography - Noto Serif TC */
.content h2, .card h2 {
  margin-top: .2rem;
  color: var(--navy);
  font-family: "Noto Serif TC", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.meta, .hint, .muted { color: var(--muted); font-size: .88rem; margin: .3rem 0; }
.hint.legal { color: var(--warn); }
.intro {
  background: #F3F7FA;
  border-left: 4px solid var(--teal);
  border-radius: 0 10px 10px 0;
  padding: .75rem 1rem;
  margin: .75rem 0 1.25rem;
  font-size: .92rem;
  color: var(--navy);
}
.subsection {
  border-top: 1px solid var(--line);
  padding-top: .85rem;
  margin-top: 1.35rem;
}
.subsection h3 {
  margin: .25rem 0 .85rem;
  font-size: 1.1rem;
  color: var(--navy);
  font-weight: 700;
}

/* 表單欄位 */
.field { margin: 0 0 1.35rem; }
.field[hidden] { display: none; }
.field label, .field legend {
  font-weight: 600;
  color: var(--navy);
  display: block;
  margin-bottom: .4rem;
  font-size: .95rem;
}
.field legend { padding: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

input[type=text], input[type=number], select {
  width: 100%;
  max-width: 580px;
  padding: .6rem .85rem;
  border: 1px solid #C9D3DC;
  border-radius: 10px;
  font: inherit;
  font-size: .95rem;
  background: #FFF;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
input[type=text]:focus, input[type=number]:focus, select:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(91, 179, 154, 0.22);
}
input[readonly] { background: var(--bg-subtle); color: var(--muted); }

/* 選擇題區塊 */
.choices { display: grid; gap: .4rem; margin-top: .2rem; }
.choice {
  display: flex;
  flex-direction: column;
  padding: .5rem .75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .15s;
}
.choice:hover { background: #F5F3EC; }

/* 第一行：圓鈕 + 答案選項文字 */
.choice-row {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.choice-row input[type=radio], .choice-row input[type=checkbox] {
  margin: 0;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--navy);
  cursor: pointer;
  flex-shrink: 0;
}
.choice-text {
  font-size: .95rem;
  color: var(--navy);
  font-weight: 500;
}

/* 內容排版：答案選項與灰色加註說明同行並置於選項右邊 */
.choice-content {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* 灰色加註說明（置於選項右邊） */
.choice-subtext {
  font-size: .84rem;
  color: #7A8998;
  margin-top: 0;
  margin-left: 0.15rem;
  line-height: 1.45;
}

/* 複選題題目後方提示小字 */
.multi-hint {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--teal, #5BB39A);
  margin-left: 0.35rem;
}

/* 表格樣式 */
.table-title { font-weight: 600; margin: 0 0 .4rem; color: var(--navy); }
.table-wrap { overflow-x: auto; margin-bottom: .6rem; border-radius: 10px; border: 1px solid var(--line); }
.qtable { border-collapse: collapse; width: 100%; min-width: 640px; background: #FFF; }
.qtable th, .qtable td { border: 1px solid var(--line); padding: .55rem .75rem; text-align: left; vertical-align: middle; }
.qtable th { background: #F3F0E6; color: var(--navy); font-size: .88rem; font-weight: 700; }
.qtable input, .qtable select { max-width: none; border-radius: 6px; padding: .4rem .6rem; }

/* 錯誤與提示 */
.error { color: var(--danger-red); font-size: .88rem; margin: .35rem 0 0; }
.field.invalid input[type=text], .field.invalid input[type=number], .field.invalid select {
  border-color: var(--danger-red);
  box-shadow: 0 0 0 3px rgba(192, 73, 47, 0.18);
}

/* 未完全填寫章節中的題目淺色塊標示 */
.field.field-unfilled {
  background-color: #FFF9ED;
  border-left: 4px solid var(--amber, #F4A623);
  border-radius: 0 10px 10px 0;
  padding: .75rem 1rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  transition: background-color .25s ease, border-color .25s ease;
}
.field.invalid .choices {
  outline: 2px solid rgba(192, 73, 47, 0.25);
  border-radius: 10px;
}
.error-summary {
  background: var(--danger-bg);
  border: 1px solid rgba(192, 73, 47, 0.35);
  color: var(--danger-red);
  border-radius: 12px;
  padding: .75rem 1.1rem;
  margin: .85rem 0;
}
.error-summary ul { margin: .35rem 0 0; padding-left: 1.25rem; }

.banner { border-radius: 12px; padding: .65rem 1.1rem; margin: .85rem 0; font-size: .92rem; }
.banner.ok { background: var(--ok-bg); color: var(--teal); border: 1px solid rgba(91, 179, 154, 0.3); font-weight: 600; }
.banner.warn { background: var(--warn-bg); color: var(--amber-dark); border: 1px solid rgba(212, 136, 18, 0.3); }

/* 操作按鈕 Buttons - 完全圓角膠囊 (border-radius: 999px) + hover 上浮 */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.35rem; }
.actions.sticky {
  position: sticky;
  bottom: 0;
  background: linear-gradient(transparent, var(--card) 40%);
  padding: 1.25rem 0 .5rem;
}
button {
  font: inherit;
  border-radius: var(--radius-pill);
  padding: .65rem 1.45rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: .95rem;
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(27, 63, 120, 0.15);
}
button.primary {
  background: var(--navy);
  color: #FFF;
  border-color: var(--navy);
  box-shadow: 0 4px 12px rgba(27, 63, 120, 0.2);
}
button.primary:hover:not(:disabled) {
  background: var(--navy-dark);
}
/* 核心儲存/送出 CTA 按鈕 - 琥珀金漸層 */
#save {
  background: var(--grad-gold);
  color: #FFF;
  border: none;
  box-shadow: 0 4px 14px rgba(212, 136, 18, 0.35);
}
#save:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(212, 136, 18, 0.45);
}
button.secondary {
  background: #FFF;
  color: var(--navy);
  border: 1px solid var(--teal);
}
button.secondary:hover:not(:disabled) {
  background: #FAF8F2;
  border-color: var(--navy);
}
button.link {
  background: none;
  border: 0;
  color: var(--teal);
  text-decoration: underline;
  padding: .2rem .4rem;
  border-radius: 6px;
}
button.link:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  color: var(--navy);
}
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* 首頁履歷清單 */
.resume { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.resume-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem .5rem;
  border-bottom: 1px dashed var(--line);
}
.resume-item:last-child { border-bottom: none; }
.del-btn { color: var(--danger-red) !important; font-size: .85rem; text-decoration: none !important; }
.del-btn:hover { text-decoration: underline !important; }

/* 右下角置頂圓形進度環按鈕 (To-Top Progress Ring) */
.to-top-btn {
  position: fixed;
  right: clamp(16px, 3.5vw, 30px);
  bottom: clamp(16px, 3.5vw, 30px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(27, 63, 120, 0.18);
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
}
.to-top-btn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(27, 63, 120, 0.25);
}
.to-top-btn svg.ring-svg {
  position: absolute;
  top: 0; left: 0;
  width: 56px; height: 56px;
  transform: rotate(-90deg);
  pointer-events: none;
}
.to-top-btn circle.bg {
  stroke: rgba(27, 63, 120, 0.12);
  stroke-width: 3.5;
  fill: none;
}
.to-top-btn circle.progress-ring {
  stroke: url(#ttGrad);
  stroke-width: 3.5;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 150.79;
  stroke-dashoffset: 150.79;
  transition: stroke-dashoffset .15s ease;
}
.to-top-btn .arrow-icon {
  position: relative;
  z-index: 2;
  width: 22px;
  height: 22px;
  stroke: var(--navy);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  margin: auto;
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; margin: 1rem auto; }
  .side { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .progress .bar, .to-top-btn { transition: none; }
}
.sync-pending {
  background: var(--warn-bg);
  border: 1px solid rgba(212, 136, 18, 0.3);
  border-radius: 12px;
  padding: .6rem .85rem;
  margin: .85rem 0;
}
.sync-pending .warn-text { margin: 0 0 .4rem; color: var(--amber-dark); font-size: .88rem; }

/* ==========================================================================
   全卷檢核與極簡列印專用樣式（精簡題目、無外框、節省紙張頁數）
   ========================================================================== */

.review-paper {
  background: #FFFFFF;
  color: #0F172A;
  border-radius: var(--radius-card, 16px);
  padding: 28px 32px;
  box-shadow: var(--shadow-soft, 0 4px 20px rgba(27, 63, 120, 0.08));
  border: 1px solid var(--line, #E3E7DE);
  margin-top: 16px;
}

.paper-header {
  border-bottom: 2px solid var(--navy, #1B3F78);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.paper-header .brand-title {
  margin: 0 0 4px 0;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: var(--muted, #5B6B7B);
  font-weight: 600;
}

.paper-header h1 {
  margin: 0 0 6px 0;
  font-size: 1.45rem;
  font-family: 'Noto Serif TC', serif;
  font-weight: 800;
  color: var(--navy, #1B3F78);
}

.paper-meta-sub {
  margin: 0;
  font-size: 0.88rem;
  color: #475569;
}

/* 章節標題 */
.review-sec-block {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #E2E8F0;
  page-break-inside: avoid;
  break-inside: avoid;
}

.review-sec-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sec-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sec-num-pill {
  background: var(--navy, #1B3F78);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.sec-header-row h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy, #1B3F78);
}

/* 題目列表：緊湊雙欄或水平行，無外框 */
.review-q-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-q-item {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
  padding: 3px 0;
  border: none;
  background: transparent;
  line-height: 1.4;
  font-size: 0.9rem;
}

.review-q-title {
  flex: 0 0 280px;
  max-width: 280px;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.review-q-title .q-seq {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #94A3B8;
  flex-shrink: 0;
}

.review-q-title .q-label {
  word-break: break-word;
}

.review-ans-box {
  flex: 1;
  color: #0F172A;
  word-break: break-word;
}

.review-ans-box.is-empty {
  color: #94A3B8;
}

.choice-tag {
  font-weight: 600;
  color: var(--navy, #1B3F78);
}

.ans-note-inline {
  color: #64748B;
  font-size: 0.84rem;
  margin-left: 4px;
}

.multi-text {
  color: #0F172A;
  font-weight: 500;
}

/* 子表格極簡 */
.review-subtable {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0;
  font-size: 0.82rem;
}

.review-subtable th {
  background: #F1F5F9;
  color: #334155;
  padding: 3px 6px;
  text-align: left;
  border: 1px solid #CBD5E1;
}

.review-subtable td {
  padding: 3px 6px;
  border: 1px solid #CBD5E1;
  color: #1E293B;
}

/* 上傳進度浮層 Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 37, 73, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  background: #FFFFFF;
  border: 1px solid var(--line, #E3E7DE);
  border-radius: 16px;
  padding: 32px 36px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
}

.modal-card h3 {
  margin: 16px 0 8px 0;
  font-size: 1.15rem;
  color: var(--navy, #1B3F78);
}

.modal-card .hint {
  color: var(--muted, #5B6B7B);
  font-size: 0.85rem;
  margin: 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #E2E8F0;
  border-top-color: var(--teal, #5BB39A);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   問卷完成頁標題與工作台小字連結
   ========================================================================== */
.done-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.done-title-row h2 {
  margin: 0;
}

.link-goto-workbench {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--ok-bg);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(91, 179, 154, 0.35);
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.link-goto-workbench:hover {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 2px 8px rgba(91, 179, 154, 0.3);
}

/* ==========================================================================
   工作規則逐章重點細節檢核工作台（Workbench）專屬樣式
   ========================================================================== */
.workbench-container {
  margin: 1.5rem 0 2.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wb-layout-container {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.wb-sidebar {
  flex: 0 0 260px;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  padding: 1rem;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2.5rem);
  overflow-y: auto;
}

.wb-sidebar-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wb-vertical-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.wb-main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .wb-layout-container {
    flex-direction: column;
  }
  .wb-sidebar {
    flex: 1 1 100%;
    width: 100%;
    position: static;
    max-height: 260px;
  }
}

.wb-header {
  padding: 1.25rem 1.75rem;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  border-left: 5px solid var(--teal);
}

.wb-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.wb-title-row h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wb-title-row .badge {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: var(--ok-bg);
  color: var(--teal);
  border-radius: var(--radius-pill);
}

.wb-mode-switcher {
  display: flex;
  gap: 0.5rem;
}

.wb-mode-switcher .btn-mode {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.wb-progress-row {
  margin-top: 1rem;
}

.wb-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.wb-target-sheet {
  font-size: 0.8rem;
}

.wb-target-sheet code {
  background: var(--bg-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.wb-chapter-nav {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  scrollbar-width: thin;
}

.wb-chap-tab {
  flex: 0 0 auto;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  color: var(--ink);
}

.wb-chap-tab:hover {
  border-color: var(--sky);
}

.wb-chap-tab.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 2px 8px rgba(27, 63, 120, 0.25);
}

.wb-chap-tab.confirmed .wb-tab-status {
  color: var(--leaf);
  font-weight: bold;
}

.wb-chap-tab.draft .wb-tab-status {
  color: var(--warn);
}

.wb-chapter-card {
  padding: 1.5rem;
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.wb-chap-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.8rem;
}

.wb-chap-title-box h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1.2rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.wb-chap-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.wb-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.wb-section-head h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy-dark);
}

.wb-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.wb-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s;
}

.wb-check-item:hover {
  background: #f0ede3;
}

.wb-check-item.checked {
  background: var(--ok-bg);
  border-color: rgba(91, 179, 154, 0.4);
}

.wb-check-item input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--teal);
}

.wb-check-labelbox {
  flex: 1;
}

.wb-check-title {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.92rem;
}

.wb-check-desc {
  margin: 0.2rem 0 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.wb-check-inject {
  margin-top: 0.3rem;
  font-size: 0.8rem;
}

.wb-articles-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wb-article-item {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.wb-article-item.custom-article {
  border-left: 4px solid var(--amber);
}

.wb-article-top {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  align-items: center;
}

.wb-art-num-badge {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  background: var(--navy-dark);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  user-select: none;
}

.wb-order-btns {
  display: inline-flex;
  gap: 0.2rem;
  align-items: center;
}

.btn-arrow {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
  font-size: 0.85rem;
  color: var(--ink);
  transition: all 0.15s;
  line-height: 1;
}

.btn-arrow:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.btn-auto-reorder {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  background: var(--ok-bg);
  color: var(--teal);
  border: 1px solid rgba(91, 179, 154, 0.4);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-auto-reorder:hover {
  background: var(--teal);
  color: #fff;
}

.wb-check-custom-input {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.83rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  box-sizing: border-box;
}

.wb-check-custom-input:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 2px rgba(91, 179, 154, 0.2);
}

.wb-highlight-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.82rem;
  margin: 0.2rem 0;
}

.wb-art-highlight-preview {
  margin: 0.4rem 0 0.6rem 0;
  padding: 0.5rem 0.75rem;
  background: #FAF8F2;
  border-left: 3px solid var(--amber);
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #374151;
}

.wb-art-highlight-preview mark {
  background: #FEF08A;
  color: #854D0E;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-weight: 600;
}

.wb-art-num-input {
  width: 90px;
  font-weight: bold;
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.wb-art-title-input {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.wb-art-content-area {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  line-height: 1.7;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  resize: none; /* 刪除調整圖框功能 */
  overflow-y: hidden; /* 不要限制圖框，完全顯示 */
  min-height: 80px;
}

.wb-art-hint {
  margin-top: 0.45rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.83rem;
  color: #78350f;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  border-radius: 0 4px 4px 0;
  display: inline-block;
}

.wb-art-hint-title {
  font-weight: 700;
  color: #92400e;
  margin-right: 0.25rem;
}

.wb-art-hint-val {
  font-weight: 500;
}

/* 法條對應淡粉紅色塊（模式與問卷對應一致，置於問卷對應黃橙色塊下方） */
.wb-art-law {
  margin-top: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.83rem;
  color: #881337;
  background: #ffe4e6;
  border-left: 3px solid #f43f5e;
  border-radius: 0 4px 4px 0;
  display: table;
}

.wb-art-law-title {
  font-weight: 700;
  color: #9f1239;
  margin-right: 0.25rem;
}

.wb-art-law-val {
  font-weight: 500;
}

.wb-ans-val {
  color: #991b1b !important; /* 有回答之問卷答案文字用暗紅色標示 */
  font-weight: 700;
}

.btn-icon-del {
  background: none;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0.25rem 0.55rem;
  color: #dc2626;
  opacity: 0.85;
  transition: opacity 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn-icon-del:hover {
  opacity: 1;
  background-color: #fee2e2;
  border-color: #fca5a5;
}

.wb-footer-bar {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  flex-wrap: wrap;
}

.wb-synthesis-card {
  padding: 1.5rem;
  text-align: center;
  border: 2px solid var(--leaf);
  background: #f6fbf2;
}

.wb-synth-btn-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   超緊湊列印樣式（@media print） - 追求最少頁數與純淨墨水輸出
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 10mm;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 9.5pt !important;
    line-height: 1.25 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .no-print, header, nav, .side, .actions, .banner, .modal-backdrop, #to-top-btn {
    display: none !important;
  }

  .layout {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .content, .done-content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  .review-paper {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .paper-header {
    border-bottom: 1.5pt solid #000000 !important;
    padding-bottom: 4px !important;
    margin-bottom: 8px !important;
  }

  .paper-header h1 {
    font-size: 13pt !important;
    margin: 0 0 2px 0 !important;
    color: #000000 !important;
  }

  .paper-meta-sub {
    font-size: 8.5pt !important;
    color: #333333 !important;
  }

  .review-sec-block {
    margin-bottom: 8px !important;
    padding-bottom: 4px !important;
    border-bottom: 0.5pt dashed #999999 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .sec-header-row {
    margin-bottom: 4px !important;
  }

  .sec-num-pill {
    background: #000000 !important;
    color: #FFFFFF !important;
    font-size: 8pt !important;
    padding: 1px 4px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sec-header-row h3 {
    font-size: 10pt !important;
    color: #000000 !important;
  }

  .review-q-list {
    gap: 1px !important;
  }

  .review-q-item {
    font-size: 8.5pt !important;
    padding: 1px 0 !important;
    line-height: 1.25 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .review-q-title {
    flex: 0 0 220px !important;
    max-width: 220px !important;
    color: #222222 !important;
  }

  .choice-tag {
    color: #000000 !important;
    font-weight: 700 !important;
  }

  .ans-note-inline {
    color: #555555 !important;
    font-size: 7.5pt !important;
  }

  .review-subtable {
    margin: 2px 0 !important;
    font-size: 7.5pt !important;
  }

  .review-subtable th, .review-subtable td {
    padding: 1px 4px !important;
    border: 0.5pt solid #888888 !important;
  }
}


/* 固定條文／說明文字區塊（取消選項功能、直接帶入之固定文字） */
.static-label {
  margin: 0 0 0.35rem 0;
  font-weight: 700;
  color: var(--navy, #1B3F78);
  font-size: 0.95rem;
}

.static-text {
  white-space: pre-line;
  background: var(--bg-subtle, #F5F7F3);
  border-left: 3px solid var(--teal, #5BB39A);
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink, #1E293B);
}

.static-review-text {
  white-space: pre-line;
}


/* 條件觸發顯示的新題目：往右縮排做出視覺差異 */
.field.field-conditional {
  margin-left: 2rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--teal, #5BB39A);
  background: rgba(91, 179, 154, 0.05);
  border-radius: 0 10px 10px 0;
}

/* 「其他」選項後方的內嵌文字輸入框 */
.field.field-inline-other {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0 0.5rem;
  padding: 0;
}

.field.field-inline-other[hidden] {
  display: none !important;
}

.field.field-inline-other input[type="text"] {
  width: 260px;
  max-width: 100%;
  padding: 0.3rem 0.65rem;
  font-size: 0.9rem;
  border-radius: 8px;
}


/* 進度條與「快速完成」小按鈕同行排列 */
.progress-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.4rem 0 0.75rem;
}

.progress-row .progress {
  flex: 1;
  margin: 0;
}

.btn-quick-complete {
  flex-shrink: 0;
  padding: 0.2rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--navy, #1B3F78);
  background: var(--bg-subtle, #F5F7F3);
  border: 1px solid rgba(27, 63, 120, 0.25);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-quick-complete:hover {
  background: var(--navy, #1B3F78);
  color: #FFFFFF;
  border-color: var(--navy, #1B3F78);
}

/* ==========================================================================
   雙軌動態分類系統：共同必填 (Core) 與 行業專屬 (Industry)
   ========================================================================== */

/* 頂部副標題 */
.topbar-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  opacity: 0.88;
  letter-spacing: 0.03em;
  font-weight: 500;
  color: #DDE8F8;
  width: 100%;
}

/* 分類篩選 Tab 切換按鈕列 */
.tab-filter-row {
  display: flex;
  gap: 0.35rem;
  margin: 0.6rem 0 0.85rem;
  background: rgba(27, 63, 120, 0.05);
  padding: 0.25rem;
  border-radius: var(--radius-pill);
}

.tab-filter-btn {
  flex: 1;
  padding: 0.35rem 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-align: center;
}

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

.tab-filter-btn.active {
  color: #FFFFFF;
  background: var(--navy);
  box-shadow: 0 2px 6px rgba(27, 63, 120, 0.25);
}

/* 章節分組導覽 */
.chapters-grouped {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0.75rem 0 1.25rem;
}

.cat-group-block {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.6rem 0.6rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.cat-group-header {
  margin-bottom: 0.55rem;
  padding: 0 0.3rem;
}

.cat-badge-pill {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
}

.cat-badge-pill.core {
  background: #EBF2FA;
  color: var(--navy);
  border: 1px solid rgba(27, 63, 120, 0.25);
}

.cat-badge-pill.industry {
  background: #FFF4E5;
  color: var(--amber-dark);
  border: 1px solid rgba(212, 136, 18, 0.3);
}

.cat-subtext {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.cat-section-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* 未選擇行業別時的提示方塊 */
.industry-unselected-box {
  background: #FFFBF2;
  border: 1px dashed var(--amber);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0.35rem 0;
}

.industry-unselected-box .hint-text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--amber-dark);
}

/* 章節頁面頂部大分類徽章 */
.chapter-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
}

.chapter-cat-badge.core {
  background: #EBF2FA;
  border: 1px solid #C4D7F0;
  color: var(--navy);
}

.chapter-cat-badge.industry {
  background: #FFF5E8;
  border: 1px solid #FAD6A5;
  color: #B56804;
}

.chapter-cat-badge .badge-icon {
  font-size: 1rem;
}

.chapter-cat-badge .badge-main {
  font-weight: 700;
}

.chapter-cat-badge .badge-sub {
  font-size: 0.8rem;
  opacity: 0.85;
}

/* ==========================================================================
   首頁 Landing Page 步驟式選項卡片與自動分類模式選擇
   ========================================================================== */

.landing-main {
  max-width: 760px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

.landing-card {
  padding: 2.25rem 2.25rem 2rem;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  background: #FFFFFF;
}

.landing-header {
  margin-bottom: 2rem;
  text-align: center;
}

.landing-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal);
  background: var(--ok-bg);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.landing-header h2 {
  font-size: 1.7rem;
  font-family: "Noto Serif TC", Georgia, serif;
  color: var(--navy-dark);
  margin: 0.25rem 0 0.5rem;
}

.landing-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
}

/* 步驟方塊 */
.landing-step-block {
  margin-bottom: 1.85rem;
  background: #FAFAF7;
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  border: 1px solid #EAEBE5;
}

.step-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--navy);
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 700;
}

.step-label {
  font-weight: 700;
  color: var(--navy-dark);
  font-size: 1rem;
}

.step-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

/* 步驟 2：行業別選擇網格 */
.landing-industry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.industry-select-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.industry-select-card:hover {
  border-color: #A5C3E8;
  box-shadow: 0 4px 12px rgba(27, 63, 120, 0.08);
}

.industry-select-card.selected {
  border-color: var(--teal);
  background: #F4FAF8;
  box-shadow: 0 4px 14px rgba(91, 179, 154, 0.16);
}

.industry-select-card .ind-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.industry-select-card .ind-info {
  flex: 1;
  min-width: 0;
}

.industry-select-card .ind-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy-dark);
  margin-bottom: 0.15rem;
}

.industry-select-card .ind-desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.industry-select-card .ind-check {
  display: none;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--teal);
}

.industry-select-card.selected .ind-check {
  display: block;
}

/* 步驟 3：兩種分類模式直列卡片 */
.landing-mode-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mode-select-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  background: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-select-card:hover {
  border-color: #B4CEEE;
}

.mode-select-card.selected {
  border-color: var(--navy);
  background: #F8FAFD;
  box-shadow: 0 4px 16px rgba(27, 63, 120, 0.1);
}

.mode-radio {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #C4CBD4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.mode-select-card.selected .mode-radio {
  border-color: var(--navy);
}

.mode-radio .radio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.2s;
}

.mode-select-card.selected .mode-radio .radio-dot {
  background: var(--navy);
}

.mode-content {
  flex: 1;
}

.mode-header-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.mode-icon {
  font-size: 1.05rem;
}

.mode-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--navy-dark);
}

.mode-tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

.mode-tag.tag-all {
  background: #FDF4E5;
  color: var(--amber-dark);
}

.mode-tag.tag-core {
  background: #EBF2FA;
  color: var(--navy);
}

.mode-tag.tag-industry {
  background: #EBF7F3;
  color: var(--teal);
}

.mode-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
  line-height: 1.45;
}

.mode-count-pill {
  display: inline-block;
  font-size: 0.74rem;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  background: #F0F2EE;
  color: var(--navy);
  font-weight: 600;
}

.mode-select-card.selected .mode-count-pill {
  background: var(--navy);
  color: #FFFFFF;
}

/* 開始大按鈕 */
.landing-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-start-large {
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 12px;
  background: var(--grad-hero);
  box-shadow: 0 6px 18px rgba(8, 26, 56, 0.22);
  transition: all 0.2s ease;
  letter-spacing: 0.03em;
}

.btn-start-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(8, 26, 56, 0.3);
}

.landing-resume-card {
  margin-top: 1.5rem;
}

.text-center {
  text-align: center;
}

/* ==========================================================================
   一鍵載入公司基本資料與官網/對外資訊樣式
   ========================================================================== */
.tax-input-wrap {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
}

.tax-input-wrap input#tax-input {
  flex: 1;
  min-width: 160px;
}

.btn-autofill-company {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #3B82F6 100%);
  color: #FFFFFF !important;
  border: 1px solid #1D4ED8;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-autofill-company:hover {
  background: linear-gradient(135deg, #1E3A8A 0%, #1D4ED8 50%, #2563EB 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.38);
}

.btn-autofill-company:active {
  transform: translateY(0);
}

.btn-autofill-company .btn-icon {
  font-size: 1.05rem;
}

.autofill-tip-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.65rem;
  padding: 0.6rem 0.85rem;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  font-size: 0.84rem;
  color: #166534;
  line-height: 1.45;
}

.autofill-tip-note .tip-badge {
  display: inline-block;
  background: #16A34A;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Q01 內部的更新橫幅 */
.q01-autofill-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1px solid #93C5FD;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.q01-autofill-banner .banner-text-group strong {
  display: block;
  color: #1E3A8A;
  font-size: 1rem;
  margin-top: 0.25rem;
}

.q01-autofill-banner .banner-text-group p {
  color: #1E40AF;
  font-size: 0.85rem;
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

.q01-autofill-banner .badge-pill {
  display: inline-block;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

.btn-autofill-secondary {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  background: #FFFFFF;
  color: #1D4ED8 !important;
  border: 1.5px solid #2563EB;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-autofill-secondary:hover {
  background: #2563EB;
  color: #FFFFFF !important;
}

/* Modal 彈跳視窗樣式 */
.autofill-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.autofill-modal-card {
  background: #FFFFFF;
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.autofill-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.25rem 1.5rem;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  position: relative;
}

.header-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #EFF6FF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.header-titles {
  flex: 1;
}

.header-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #2563EB;
  background: #DBEAFE;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.header-titles h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #0F172A;
}

.header-sub {
  margin: 0.25rem 0 0;
  font-size: 0.86rem;
  color: #64748B;
  line-height: 1.4;
}

.btn-close-modal {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: #94A3B8;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-close-modal:hover {
  color: #1E293B;
  background: #E2E8F0;
}

.autofill-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.autofill-status-loading {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 1.5rem;
  background: #F8FAFC;
  border-radius: 12px;
  color: #334155;
  font-size: 0.98rem;
  justify-content: center;
}

.autofill-status-loading .spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #E2E8F0;
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.autofill-status-error {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 10px;
  color: #991B1B;
  margin-bottom: 1rem;
}

.autofill-status-error .err-icon {
  font-size: 1.35rem;
}

.autofill-status-error strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.autofill-status-error p {
  margin: 0;
  font-size: 0.86rem;
  color: #B91C1C;
}

/* 卡片區塊 */
.autofill-card-block {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.block-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.block-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 700;
}

.block-title {
  font-size: 1.02rem;
  font-weight: 750;
  color: #0F172A;
  flex: 1;
}

.verified-tag {
  background: #DCFCE7;
  color: #166534;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
}

.link-btn-search {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #2563EB;
  text-decoration: none;
  background: #EFF6FF;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #BFDBFE;
  font-weight: 600;
  transition: all 0.15s ease;
}

.link-btn-search:hover {
  background: #DBEAFE;
  text-decoration: underline;
}

.reg-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
}

.reg-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.reg-cell.full-width {
  grid-column: 1 / -1;
}

.cell-label {
  font-size: 0.78rem;
  color: #64748B;
  font-weight: 600;
}

.cell-val {
  font-size: 0.95rem;
  color: #1E293B;
}

.cell-val.bold-navy {
  color: #1E40AF;
  font-weight: 700;
}

.cell-val.monospace {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #0F172A;
}

.ind-pill {
  display: inline-block;
  background: #F1F5F9;
  color: #0F172A;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #CBD5E1;
}

.business-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.b-chip {
  display: inline-block;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-size: 0.76rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.section-hint {
  font-size: 0.85rem;
  color: #64748B;
  margin: 0 0 0.85rem 0;
  line-height: 1.45;
}

.web-form-group {
  margin-bottom: 0.85rem;
}

.web-form-group .field-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.autofill-textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
}

.autofill-textarea:focus,
.autofill-text:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.autofill-text {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.culture-pill-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #E2E8F0;
}

.culture-pill-row .pill-label {
  font-size: 0.8rem;
  color: #64748B;
  font-weight: 600;
}

.culture-tag {
  display: inline-block;
  background: #EFF6FF;
  color: #1D4ED8;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #BFDBFE;
}

.prefill-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.prefill-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.87rem;
  color: #334155;
  line-height: 1.45;
}

.prefill-feature-list .chk {
  color: #16A34A;
  font-weight: 700;
  flex-shrink: 0;
}

.autofill-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
}

.btn-autofill-confirm {
  background: linear-gradient(135deg, #15803D 0%, #16A34A 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  padding: 0.75rem 1.35rem !important;
  font-size: 0.96rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3) !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-autofill-confirm:hover:not(:disabled) {
  background: linear-gradient(135deg, #166534 0%, #15803D 100%) !important;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.4) !important;
}

.btn-autofill-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

@media (max-width: 640px) {
  .tax-input-wrap {
    flex-direction: column;
  }
  .q01-autofill-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn-autofill-secondary {
    width: 100%;
    justify-content: center;
  }
  .autofill-modal-footer {
    flex-direction: column;
  }
  .autofill-modal-footer button {
    width: 100%;
  }
}



