/* ==========================================================================
   115年度消費者權益報導獎 - 樣式表 (純色、條列式公告排版、無漸層)
   ========================================================================== */

:root {
  /* 主要色彩系統 (純色調配，無漸層) */
  --primary: #0d7f66;
  /* 參考圖標準深翡翠綠 */
  --primary-dark: #09614e;
  /* 深綠 */
  --primary-darker: #043d31;
  /* 極深墨綠 */
  --primary-light: #14b8a6;
  /* 青綠 */
  --primary-subtle: #f0fdf9;
  /* 極淺綠背景 */
  --primary-surface: #ccfbf1;
  /* 淺綠裝飾 */
  --primary-border: #0d7f66;
  /* 標題下底線色 */

  /* 中性色彩 */
  --bg-body: #ffffff;
  /* 頁面背景純白 (公文公告標準白底) */
  --bg-surface: #f8fafc;
  /* 區塊微灰底 */
  --bg-header: #ffffff;
  /* 導覽列純白 */

  --text-main: #1e293b;
  /* 正文深色 */
  --text-heading: #0f172a;
  /* 標題深色 */
  --text-muted: #475569;
  /* 次要文字 */
  --text-light: #64748b;
  /* 弱化文字 */
  --text-white: #ffffff;
  /* 純白文字 */

  --border-light: #e2e8f0;
  /* 分隔線淺灰 */
  --border-strong: #94a3b8;
  /* 邊框中灰 */

  /* 字體與排印 */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* 全域重設 */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

img,
svg {
  vertical-align: middle;
}

/* 容器與版面佈局 (公文閱讀舒適寬度) */
.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* ==========================================================================
   頂部導覽列 (Sticky Header)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon-box {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #154c79 100%);
  color: var(--text-white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(30, 90, 142, 0.25);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.site-brand:hover .brand-icon-box {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 4px 12px rgba(30, 90, 142, 0.35);
}

.brand-logo-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.brand-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.2;
}

/* 主導覽連結 (與參考圖字樣一致) */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background-color: var(--primary-subtle);
}

.nav-link.active {
  color: var(--primary-dark);
  border-bottom: 2px solid var(--primary);
  font-weight: 700;
}

.nav-cta {
  background-color: var(--primary);
  color: var(--text-white) !important;
  font-weight: 700;
  margin-left: 6px;
}

.nav-cta:hover {
  background-color: var(--primary-dark) !important;
}

/* 行動選單按鈕 */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text-heading);
}

/* ==========================================================================
   Hero 主視覺 Banner (使用 images/cpc_main_banner.jpg)
   ========================================================================== */
.hero-banner {
  background-color: #15a987;
  /* 與主視覺綠色背景同調 */
  padding: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-banner-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.hero-banner-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   條列式內容排版系統 (Document / List Style 如參考圖所示)
   ========================================================================== */
.doc-section {
  padding: 2.5rem 0 1.5rem 0;
  scroll-margin-top: 65px;
}

/* 大標題（壹、目的、貳、主辦單位 等）- 參考圖綠色色塊與下底線 */
.doc-section-header {
  margin-bottom: 1.25rem;
}

.doc-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #0d7f66;
}

.doc-title-bar {
  display: inline-block;
  width: 10px;
  height: 24px;
  background-color: #0d7f66;
  flex-shrink: 0;
}

.doc-section-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.04em;
}

/* 條列層級階梯式縮排 */
.doc-content {
  font-size: 1.02rem;
  color: #1e293b;
  line-height: 2;
  padding-left: 0.5rem;
}

.doc-paragraph {
  margin-bottom: 1.25rem;
  text-align: justify;
}

/* 第一層條列：一、二、三... */
.doc-level-1 {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5rem;
}

.doc-level-1>li {
  margin-bottom: 1.25rem;
}

.doc-item-title-1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
  display: block;
}

/* 第二層條列：(一)、(二)、(三)... */
.doc-level-2 {
  list-style: none;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.doc-level-2>li {
  margin-bottom: 0.75rem;
  position: relative;
}

.doc-item-title-2 {
  font-weight: 700;
  color: #0f172a;
}

/* 第三層條列：1. 2. 3. ... */
.doc-level-3 {
  list-style: none;
  padding-left: 1.75rem;
  margin-top: 0.4rem;
  margin-bottom: 0.5rem;
}

.doc-level-3>li {
  margin-bottom: 0.4rem;
}

/* 重點強調文字 */
.highlight-text {
  font-weight: 700;
  color: #0d7f66;
}

.alert-text {
  font-weight: 700;
  color: #b91c1c;
}

/* 分隔線 */
.doc-divider {
  border: 0;
  height: 1px;
  background-color: var(--border-light);
  margin: 2rem 0;
}

/* 備註與注意事項條列框 (純色無漸層) */
.doc-note-box {
  background-color: #f8fafc;
  border-left: 4px solid #0d7f66;
  padding: 16px 20px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.8;
}

.doc-warn-box {
  background-color: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 16px 20px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #78350f;
  line-height: 1.8;
}

/* ==========================================================================
   附件與表單列表 (條列式呈現)
   ========================================================================== */
.attachment-list {
  list-style: none;
  padding-left: 0;
  margin-top: 1rem;
}

.attachment-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background-color: #f8fafc;
  border: 1px solid var(--border-light);
  border-left: 4px solid #0d7f66;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.attachment-item-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.attachment-item-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background-color: #0d7f66;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #09614e;
  color: #ffffff;
}

.btn-secondary {
  background-color: #e2e8f0;
  color: #334155;
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.copy-btn {
  background-color: #0d7f66;
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 8px;
}

.copy-btn:hover {
  background-color: #09614e;
}

/* ==========================================================================
   名單預留條列區塊 (評審名單 / 得獎名單)
   ========================================================================== */
.placeholder-list-box {
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  color: #475569;
  font-size: 0.98rem;
}

/* ==========================================================================
   頁尾 (Footer - 參考圖片深綠底橫式呈現場景，純色無漸層)
   ========================================================================== */
.site-footer {
  background-color: #12634d;
  /* 參考圖片的深墨綠純色底 */
  color: #ffffff;
  padding: 1.75rem 0;
  font-size: 0.95rem;
  margin-top: 3.5rem;
}

.footer-units-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-unit-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footer-unit-label {
  font-size: 1.05rem;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.footer-unit-content {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-unit-logo {
  height: 48px;
  width: auto;
  display: block;
}

.footer-unit-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.footer-mediawatch-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footer-mediawatch-icon {
  height: 46px;
  width: auto;
}

.footer-mediawatch-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  color: #ffffff;
}

.footer-mediawatch-title-top {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.footer-mediawatch-title-main {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   回頂部按鈕
   ========================================================================== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background-color: #0d7f66;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  border: none;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: #09614e;
}

/* ==========================================================================
   表單預覽互動 Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.75);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  max-width: 850px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  background-color: #0d7f66;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-close {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px;
  font-size: 1.2rem;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 0.95rem;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-surface);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.preview-table th,
.preview-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 12px;
}

.preview-table th {
  background-color: #f1f5f9;
  font-weight: 700;
  width: 180px;
  text-align: left;
}

/* Toast 提示 */
.toast-msg {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #0f172a;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  z-index: 3000;
  display: none;
  animation: fadeInOut 2.5s forwards;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }

  15% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  85% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}

/* ==========================================================================
   響應式斷點 (RWD)
   ========================================================================== */
@media (max-width: 992px) {
  .hero-title-main {
    font-size: 2.6rem;
  }

  .hero-title-sub {
    font-size: 2.3rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    flex-direction: column;
    padding: 14px;
    border-bottom: 2px solid var(--primary);
    box-shadow: var(--shadow-md);
    gap: 6px;
  }

  .main-nav.show {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 8px 12px;
  }

  .nav-cta {
    margin-left: 0;
    text-align: center;
  }

  .doc-level-2 {
    padding-left: 1rem;
  }

  .doc-level-3 {
    padding-left: 1rem;
  }
}

/* 列印樣式支援 */
@media print {

  .site-header,
  .back-to-top,
  .modal-overlay,
  .btn {
    display: none !important;
  }

  body {
    background-color: #ffffff;
    color: #000000;
  }

  .doc-section {
    padding: 1rem 0;
  }
}