/* 世界商標專家 — 文章頁共用樣式 */
/* 方案 C：共用殼（首頁同款毛玻璃）+ 暖色閱讀內容 */

:root {
  /* 品牌色（跟首頁統一） */
  --primary: #5BC0BE;
  --primary-dark: #3ca09e;
  --primary-light: #7dd3d1;

  /* 殼：跟首頁一致的冷灰 */
  --bg-page: #F0F4F8;
  --nav-text: #64748b;
  --nav-text-main: #1e293b;

  /* 肉：暖色閱讀區 */
  --bg-card: #faf8f5;
  --bg-input: #f7f5f0;
  --text-primary: #3d3929;
  --text-secondary: #5c5647;
  --text-muted: #7a7464;
  --border: #e8e4db;
  --content-border: #e8e4db;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --transition: all 0.2s ease;
}

/* 重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans TC', "Microsoft JhengHei", "PingFang TC", sans-serif;
  line-height: 1.8;
  color: var(--text-primary);
  background: var(--bg-page);
}

/* ====== 殼：導覽列（首頁同款毛玻璃） ====== */
nav {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 1px 20px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

/* Logo（首頁同款圖標） */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--nav-text-main);
  letter-spacing: 1px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--primary);
  border-radius: 50%;
  opacity: 0.4;
}

.logo-icon::after {
  content: '';
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 5px 2px 5px 2px;
}

.logo-text {
  line-height: 1.1;
}

.logo-text small {
  display: block;
  font-size: 8px;
  font-weight: 300;
  color: var(--primary);
  letter-spacing: 2px;
  margin-top: -1px;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-links > a,
.nav-dropdown > .nav-dropdown-trigger {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: var(--transition);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  height: 38px;
  line-height: 1;
}

.nav-links > a:hover,
.nav-dropdown:hover > .nav-dropdown-trigger {
  color: var(--primary);
  background: rgba(91,192,190,0.08);
}

/* 下拉選單 */
.nav-dropdown { position: relative; }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border: 1px solid rgba(255,255,255,0.5);
  padding: 12px 8px 8px;
  min-width: 160px;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--nav-text-main);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-dropdown-menu a:hover {
  background: rgba(91,192,190,0.1);
  color: var(--primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--nav-text-main);
  padding: 4px;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 12px 24px;
    gap: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.5);
  }
  .nav-links.open { display: flex; }
  .nav-links > a,
  .nav-dropdown > .nav-dropdown-trigger { padding: 12px 0; border-radius: 0; height: auto; }
  .nav-dropdown-menu {
    position: static; transform: none; box-shadow: none;
    border: none; padding: 0 0 0 16px; background: transparent; backdrop-filter: none;
  }
  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown .nav-dropdown-menu { display: block; }
  .nav-dropdown-menu a { padding: 8px 0; }
}

/* ====== 閱讀進度條（品牌青色） ====== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  z-index: 101;
  width: 0;
  transition: width 0.1s linear;
}

/* ====== 文章容器 ====== */
.article-container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* ====== 內容區（暖色閱讀友善） ====== */
.article-content {
  flex: 1;
  max-width: 800px;
}

/* 麵包屑 */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 0;
  background: none;
  border: none;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

/* 文章標頭 */
.article-header {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--content-border);
}

h1 {
  font-size: 30px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.article-byline a {
  color: var(--text-sub);
  text-decoration: none;
  border-bottom: 1px dashed var(--text-muted);
  transition: color 0.2s;
}

.article-byline a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.article-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: var(--primary);
  border-radius: 999px;
  padding: 3px 14px;
}

/* 核心要點（青色左邊框 + 暖色底） */
.answer-box {
  background: var(--bg-card);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 24px 28px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--content-border);
  border-left: 4px solid var(--primary);
}

.answer-box h2 {
  font-size: 16px;
  color: var(--primary);
  border: none;
  margin: 0 0 12px 0;
  padding: 0;
  font-weight: 600;
}

.answer-box ul { margin-left: 20px; }
.answer-box li { margin-bottom: 8px; font-size: 14px; color: var(--text-secondary); }

/* 文章內文 */
.article-body {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--content-border);
}

h2 {
  font-size: 22px;
  margin: 36px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  color: var(--text-primary);
}

h3 {
  font-size: 18px;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

p { margin-bottom: 16px; line-height: 1.9; }

/* 提示框 */
.info-box {
  background: rgba(91,192,190,0.05);
  border: 1px solid rgba(91,192,190,0.15);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 20px 0;
}

.info-box h4 { font-size: 15px; margin-bottom: 8px; color: var(--primary-dark); }
.info-box p { font-size: 14px; margin-bottom: 6px; color: var(--text-secondary); }

.warning-box {
  background: #fff8f0;
  border: 1px solid #f0d8b5;
  border-left: 4px solid #f59e0b;
  padding: 20px 24px;
  margin: 20px 0;
  border-radius: var(--radius-sm);
}

.success-box {
  background: #f0faf0;
  border: 1px solid #c8e6c9;
  border-left: 4px solid #4caf50;
  padding: 20px 24px;
  margin: 20px 0;
  border-radius: var(--radius-sm);
}

/* 步驟方塊（流程說明） */
.step-box {
  background: rgba(91,192,190,0.05);
  border: 1px solid var(--content-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px 22px;
  margin: 14px 0;
}
.step-box h3 {
  font-size: 15px;
  color: var(--primary-dark);
  margin: 0 0 8px;
  font-weight: 600;
}
.step-box p { font-size: 14px; margin-bottom: 0; color: var(--text-secondary); }

/* 提示框（tip） */
.tip-box {
  background: rgba(91,192,190,0.05);
  border: 1px solid rgba(91,192,190,0.15);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
}
.tip-box p { font-size: 14px; margin-bottom: 6px; color: var(--text-secondary); }
.tip-box p:last-child { margin-bottom: 0; }
.tip-box strong { color: var(--primary-dark); }

/* 判例方塊（案例引用） */
.case-box {
  background: #faf6ef;
  border: 1px solid #e8ddc8;
  border-left: 4px solid #b08a5a;
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 20px 0;
}
.case-box h4 {
  font-size: 15px;
  color: #6b4f2a;
  margin: 0 0 10px;
  font-weight: 600;
}
.case-box p { font-size: 14px; margin-bottom: 0; color: var(--text-secondary); line-height: 1.8; }

/* 範例方塊（條文／案例展示） */
.example-box {
  background: rgba(91,192,190,0.04);
  border: 1px dashed rgba(91,192,190,0.4);
  border-radius: var(--radius-sm);
  padding: 16px 22px;
  margin: 20px 0;
}
.example-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 10px;
}
.example-box p { font-size: 14px; margin-bottom: 6px; color: var(--text-secondary); }
.example-box p:last-child { margin-bottom: 0; }

/* 一般註記 */
.note-box {
  background: var(--bg-input);
  border: 1px solid var(--content-border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  margin: 16px 0;
}
.note-box p { font-size: 14px; margin-bottom: 6px; color: var(--text-secondary); }
.note-box p:last-child { margin-bottom: 0; }
.note-box ul { margin-left: 20px; margin-bottom: 0; }
.note-box li { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; }

/* 重要提醒（比 note 更顯眼） */
.important-note {
  background: #fff8f0;
  border: 1px solid #f0d8b5;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  margin: 20px 0;
}
.important-note p { font-size: 14px; margin-bottom: 0; color: var(--text-secondary); }
.important-note strong { color: #b8740a; }

/* 資源方塊（連結 / 下載清單） */
.resource-box {
  background: rgba(91,192,190,0.04);
  border: 1px solid rgba(91,192,190,0.15);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 20px 0;
}
.resource-box h3 {
  font-size: 16px;
  color: var(--primary-dark);
  margin: 0 0 12px;
  font-weight: 600;
}
.resource-box ul { margin-left: 20px; margin-bottom: 0; }
.resource-box li { font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }

/* 法律聲明 / 參考資料（文末灰底） */
.disclaimer {
  background: var(--bg-input);
  border: 1px solid var(--content-border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 32px 0 24px;
}
.disclaimer h3 {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.disclaimer h3 + p { margin-bottom: 16px; }
.disclaimer p { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.75; }
.disclaimer ul { margin-left: 20px; margin-bottom: 0; }
.disclaimer li { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; line-height: 1.7; }

/* 比較表 / 資訊表（給表頭一點藍綠色強調） */
.comparison-table th,
.info-table th {
  background: rgba(91,192,190,0.08);
  color: var(--primary-dark);
}

/* 表格 */
.article-body {
  /* 防止內部元素 (例如過寬表格) 撐爆容器 */
  overflow-x: auto;
}
table {
  width: 100% !important;
  max-width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 15px;
  table-layout: fixed; /* 依 col 比例分配，避免內容撐寬 */
}

th, td {
  border: 1px solid var(--content-border);
  padding: 12px;
  text-align: left;
  word-break: break-word; /* 中文長句強制斷行 */
  overflow-wrap: anywhere;
  vertical-align: top;
}

th {
  background: var(--bg-input);
  font-weight: 600;
  color: var(--text-primary);
}

/* FAQ */
.faq-section { margin-top: 40px; }

.faq-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--content-border);
}

.faq-question {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.faq-answer {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ====== TOC 側邊欄 ====== */
.toc-sidebar {
  width: 260px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--content-border);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  align-self: flex-start;
}

.toc-sidebar h3,
.toc-title {
  font-size: 14px;
  margin: 0 0 16px 0;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toc-sidebar ul,
.toc-list { list-style: none; }

.toc-sidebar li,
.toc-item { margin-bottom: 6px; }

.toc-sidebar a,
.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  display: block;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 4px;
  transition: var(--transition);
}

.toc-sidebar a:hover,
.toc-link:hover { color: var(--primary); background: var(--bg-input); }

.toc-sidebar a.active,
.toc-link.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
  background: var(--bg-input);
}

/* ====== 殼：Footer（首頁同款） ====== */
.site-footer {
  background: rgba(15,23,42,0.92);
  backdrop-filter: blur(20px);
  color: rgba(255,255,255,0.6);
  padding: 32px 24px;
  margin-top: 64px;
  text-align: center;
  font-size: 14px;
}

.site-footer a { color: white; text-decoration: none; }
.site-footer strong { color: white; }

/* 回到頂部（品牌青色） */
#back-to-top {
  display: none;
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font-size: 20px;
  line-height: 44px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(91,192,190,0.3);
  z-index: 99;
  transition: all 0.3s;
}

#back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(91,192,190,0.4);
}

/* 上一篇/下一篇 */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--content-border);
}

.article-nav a {
  display: block;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--content-border);
  text-decoration: none;
  color: var(--text-primary);
  flex: 1;
  transition: var(--transition);
}

.article-nav a:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.article-nav .nav-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.nav-links-bottom {
  display: flex;
  justify-content: space-between;
}

.nav-prev, .nav-next {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

/* ====== 響應式 ====== */
@media (max-width: 1024px) {
  .toc-sidebar { display: none; }
  .article-content { max-width: 100%; }
}

@media (max-width: 768px) {
  .nav-container { padding: 0 16px; height: auto; min-height: 52px; }
  .toc-sidebar { display: none; }
  .article-container { flex-direction: column; padding: 0 16px; margin: 16px auto; gap: 0; }
  .article-content { max-width: 100%; }
  .article-header { padding: 24px 20px; }
  .article-body { padding: 24px 20px; }
  .breadcrumb { padding: 0; margin-bottom: 16px; }
  .answer-box { padding: 20px 16px; }
  .step-box, .tip-box, .case-box, .example-box,
  .note-box, .important-note, .resource-box, .disclaimer {
    padding: 14px 16px;
  }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 17px; }
  table { font-size: 13px; }
  th, td { padding: 8px; }
  .article-nav { flex-direction: column; }
  .related-grid { grid-template-columns: 1fr !important; }
}

/* 相關文章推薦 */
.related-articles {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--warm-border, #e8e4db);
}
.related-articles h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--warm-heading, #3d3929);
  margin-bottom: 20px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.related-card,
.related-card:link,
.related-card:visited {
  display: block;
  background: var(--warm-bg, #faf8f5);
  border: 1px solid var(--warm-border, #e8e4db);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none !important;
  color: var(--warm-heading, #3d3929) !important;
  transition: all 0.2s ease;
}
.related-card:hover {
  border-color: var(--primary, #5BC0BE);
  box-shadow: 0 4px 16px rgba(91,192,190,0.12);
  transform: translateY(-2px);
}
.related-meta {
  font-size: 12px;
  color: var(--warm-muted, #7a7464);
  margin-bottom: 6px;
}
.related-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}
.related-excerpt {
  font-size: 13px;
  color: var(--warm-sub, #5c5647);
  line-height: 1.5;
}

/* 文章內圖片（後台插入） */
.article-body img,
.article-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.article-body figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--warm-sub, #5c5647);
  margin-top: -16px;
  margin-bottom: 24px;
}
