/* ============================================================
   潮流勁抽 — 官網設計系統 v2
   風格：科技簡約 SaaS · 左側固定側欄 · 靛藍主色
   ============================================================ */

:root {
  --bg:         #f8fafc;
  --surface:    #ffffff;
  --line:       #e2e8f0;
  --line-soft:  #eef2f7;
  --ink:        #0f172a;
  --ink-2:      #475569;
  --ink-3:      #94a3b8;
  --brand:      #2563eb;
  --brand-dark: #1d4ed8;
  --brand-tint: #eff6ff;
  --accent:     #0ea5e9;
  --sidebar-w:  248px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink-2);
  -webkit-font-smoothing: antialiased;
}

/* 中英混排：拉丁字母與數字走 Inter，中文走 Noto Sans TC */
h1, h2, h3, h4, h5 { color: var(--ink); }

/* 等寬數字 —— 統計數據、編號、表格用 */
.num {
  font-family: 'Inter', sans-serif;
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.02em;
}

/* ---------- 滾動條 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   側欄
   ============================================================ */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.is-open { transform: translateX(0); }

@media (min-width: 1024px) {
  .sidebar { transform: translateX(0); }
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* 側欄分組標題 */
.nav-label {
  padding: 0 12px;
  margin: 20px 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* 側欄項目 */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--ink-3);
  transition: color 0.15s ease;
}
.nav-item:hover { background: #f1f5f9; color: var(--ink); }
.nav-item:hover svg { color: var(--ink-2); }

.nav-item.active {
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-weight: 600;
}
.nav-item.active svg { color: var(--brand); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

/* 側欄計數徽章 */
.nav-count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
}
.nav-item.active .nav-count {
  background: #dbeafe;
  color: var(--brand-dark);
}

/* 遮罩層（行動版側欄展開時） */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }
@media (min-width: 1024px) {
  .scrim { display: none; }
}

/* ============================================================
   頂欄
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) {
  .topbar { padding: 0 28px; }
}

/* 麵包屑 */
.crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.crumb a { color: var(--ink-3); text-decoration: none; transition: color 0.15s; }
.crumb a:hover { color: var(--brand); }
.crumb .sep { color: #cbd5e1; }
.crumb strong { color: var(--ink); font-weight: 600; }

/* 狀態指示 */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15); }
  50%      { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.05); }
}

/* ============================================================
   版面容器
   ============================================================ */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (min-width: 640px) {
  .shell { padding: 0 28px; }
}

/* ============================================================
   裝飾底紋 —— 規整網格 + 淡藍光暈（取代舊版金色浮動元素）
   ============================================================ */
.grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.13) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.13) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}
.glow-brand { background: rgba(37, 99, 235, 0.10); }
.glow-accent { background: rgba(14, 165, 233, 0.09); }

/* 細分隔線（帶漸隱） */
.hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 15%, var(--line) 85%, transparent);
}

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card-lift:hover {
  border-color: #bfdbfe;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 28px -12px rgba(15, 23, 42, 0.12);
  transform: translateY(-3px);
}

/* 卡內圖片 */
.thumb {
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-lift:hover .thumb img { transform: scale(1.05); }

/* ============================================================
   按鈕
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 4px 14px -3px rgba(37, 99, 235, 0.45);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: #cbd5e1; background: #f8fafc; }

.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }

/* 文字箭頭連結 */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.link-arrow svg { width: 15px; height: 15px; transition: transform 0.2s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ============================================================
   標籤 / 徽章
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.pill-brand {
  border-color: #bfdbfe;
  background: var(--brand-tint);
  color: var(--brand-dark);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag-brand { background: var(--brand-tint); color: var(--brand-dark); }
.tag-slate { background: #f1f5f9; color: #64748b; }
.tag-green { background: #f0fdf4; color: #15803d; }
.tag-amber { background: #fffbeb; color: #b45309; }

/* ============================================================
   章節標頭（編號 + 線 + 英文小標）
   ============================================================ */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.eyebrow-num {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brand);
}
.eyebrow-line {
  width: 28px;
  height: 1px;
  background: #bfdbfe;
}
.eyebrow-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================
   分段控制器（取代舊版膠囊 filter tab）
   ============================================================ */
.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  gap: 2px;
}
.seg-item {
  padding: 7px 15px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.seg-item:hover { background: #f1f5f9; color: var(--ink); }
.seg-item.active {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* ============================================================
   數據表格
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead th {
  padding: 11px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: top;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table .th-key {
  width: 30%;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

/* ============================================================
   步驟流程
   ============================================================ */
.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

/* ============================================================
   FAQ 手風琴
   ============================================================ */
.faq-list {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
.faq-item + .faq-item { border-top: 1px solid var(--line-soft); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.faq-q:hover { background: #fafbfc; }
.faq-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--ink-3);
  transition: all 0.25s ease;
}
.faq-icon svg { width: 14px; height: 14px; }
.faq-item.is-open .faq-icon {
  background: var(--brand);
  color: #fff;
  transform: rotate(180deg);
}
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-a-inner {
  padding: 0 20px 20px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
}
.faq-item.is-open .faq-a { max-height: 320px; }

/* ============================================================
   CTA 橫幅
   ============================================================ */
.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(115deg, #1e40af 0%, #2563eb 45%, #0ea5e9 100%);
}
.cta-band::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 100% at 100% 50%, #000, transparent);
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 100% 50%, #000, transparent);
}

/* ============================================================
   文件頁排版（使用條款 / 私隱政策 / 帳號註銷）
   —— 沿用原檔的 .terms-section / .privacy-section 結構，統一重新著色
   ============================================================ */
.doc-prose {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-2);
}
.doc-prose > section,
.doc-prose > div[id] { scroll-margin-top: 88px; }

/* 每個條款區塊之間加細分隔線 */
.doc-prose .terms-section,
.doc-prose .privacy-section,
.doc-prose .doc-section {
  padding-bottom: 26px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line-soft);
}
.doc-prose .terms-section:last-child,
.doc-prose .privacy-section:last-child,
.doc-prose .doc-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.doc-prose h2 {
  margin: 0 0 13px;
  padding-left: 12px;
  border-left: 3px solid var(--brand);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.doc-prose h3 {
  margin: 22px 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.doc-prose h3:first-child { margin-top: 0; }
.doc-prose p { margin: 0 0 10px; }
.doc-prose p:last-child { margin-bottom: 0; }
.doc-prose ul,
.doc-prose ol { margin: 10px 0 14px; padding-left: 20px; }
.doc-prose li { margin-bottom: 6px; }
.doc-prose li::marker { color: #cbd5e1; }
.doc-prose strong { color: var(--ink); font-weight: 600; }
.doc-prose a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid #bfdbfe;
}
.doc-prose a:hover { border-bottom-color: var(--brand); }
.doc-prose .section-content { margin: 0; }

/* 條文編號行（(1) (2) …）縮排收窄一點，避免整段看起來鬆散 */
.doc-prose .section-content p { text-align: justify; }

/* ---------- 右側目錄 ---------- */
.toc-title {
  margin: 0 0 10px;
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.toc-scroll {
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc-link {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.toc-link:hover { background: #f1f5f9; color: var(--ink); }
.toc-link.active {
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-weight: 600;
}

/* ============================================================
   提示框
   ============================================================ */
.notice {
  border-radius: 12px;
  border: 1px solid;
  padding: 16px 18px;
}
.notice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 13.5px;
  font-weight: 700;
}
.notice-title svg { width: 16px; height: 16px; }
.notice ul { margin: 0; padding-left: 19px; }
.notice li { font-size: 12.5px; line-height: 1.8; margin-bottom: 4px; }
.notice p { margin: 0; font-size: 12.5px; line-height: 1.8; }

.notice-warn { background: #fffbeb; border-color: #fde68a; }
.notice-warn .notice-title { color: #b45309; }
.notice-warn ul, .notice-warn li, .notice-warn p { color: #92400e; }

.notice-info { background: var(--brand-tint); border-color: #bfdbfe; }
.notice-info .notice-title { color: var(--brand-dark); }
.notice-info ul, .notice-info li, .notice-info p { color: #1e40af; }

/* ============================================================
   表單
   ============================================================ */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.field-label .req { color: #dc2626; margin-left: 2px; }
.field-hint { margin: 6px 0 0; font-size: 11.5px; color: var(--ink-3); }

.input, .textarea {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea {
  height: auto;
  min-height: 104px;
  padding: 11px 13px;
  line-height: 1.7;
  resize: vertical;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.input::placeholder, .textarea::placeholder { color: #cbd5e1; }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.check-row input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.check-row label {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-2);
  cursor: pointer;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================================
   彈窗
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}
.modal.is-open { display: flex; }
.modal-card {
  width: 100%;
  max-width: 400px;
  padding: 28px 26px 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.45);
  text-align: center;
}
.modal-ico {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-ico svg { width: 22px; height: 22px; }
.modal-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
}
.modal-card p {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
}

/* ============================================================
   文字標誌（取代圖片 logo）
   ============================================================ */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  white-space: nowrap;
}

/* 方形標記 */
.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  box-shadow: 0 2px 8px -2px rgba(37, 99, 235, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #fff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.brand:hover .brand-badge {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

/* 字標：Most（深）· sincere（主色）· intl（淺） */
.brand-text {
  font-family: 'Inter', sans-serif;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.brand-text em {
  font-style: normal;
  color: var(--brand);
  transition: color 0.2s ease;
}
.brand-text .tld {
  font-weight: 700;
  color: var(--ink-3);
}
.brand:hover .brand-text em { color: var(--accent); }

/* ============================================================
   進場動畫
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
