/* 
 * RCCI 智財與技術成果專區 - 網站樣式表
 * Research Center for Critical Issues | Academia Sinica
 */

:root {
  --primary: #008fa0;
  --primary-hover: #007785;
  --primary-light: #e6f6f8;
  --primary-dark: #005f6b;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #38bdf8;
  --badge-solar-bg: #fef3c7;
  --badge-solar-text: #92400e;
  --badge-quantum-bg: #ede9fe;
  --badge-quantum-text: #5b21b6;
  --badge-hydrogen-bg: #d1fae5;
  --badge-hydrogen-text: #065f46;
  --badge-family-bg: #e0f2fe;
  --badge-family-text: #0369a1;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  box-sizing: border-box;
  overflow-x: hidden;
  max-width: 100vw;
}

*, *::before, *::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

/* 頂部全域通知 / 同步狀態列 */
.sync-banner {
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid #1e293b;
}

.sync-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
}

.status-dot.syncing {
  background-color: #f59e0b;
  animation: pulse 1s infinite alternate;
}

.status-dot.synced {
  background-color: #10b981;
}

.status-dot.fallback {
  background-color: #3b82f6;
}

.status-dot.error {
  background-color: #ef4444;
}

@keyframes pulse {
  0% { opacity: 0.4; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.2); }
}

.sync-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.btn-sync {
  background: transparent;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}

.btn-sync:hover {
  background: #1e293b;
  color: #ffffff;
  border-color: #64748b;
}

.btn-sync.spinning svg {
  animation: spin 0.8s linear infinite;
}

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

.sheet-link {
  color: #38bdf8;
  text-decoration: none;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sheet-link:hover {
  text-decoration: underline;
}

/* 主導覽列 (Navbar) */
.main-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

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

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  min-width: 0;
  flex-shrink: 1;
}

.logo-img {
  height: 46px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  transition: var(--transition);
}

/* 手機版導覽切換按鈕 (漢堡鈕) */
.mobile-nav-toggle {
  display: none;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  padding: 10px 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  flex-shrink: 0;
  margin-left: 12px;
}

.mobile-nav-toggle:hover {
  background: var(--bg-body);
  border-color: var(--primary);
}

.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.mobile-nav-toggle.active .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-nav-toggle.active .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-item a {
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-item a:hover {
  color: var(--primary);
}

.nav-item.active a {
  color: var(--primary);
  font-weight: 700;
}

.nav-item.active a::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--primary);
  border-radius: 2px 2px 0 0;
}

/* 介於 961px 與 1120px 之間的桌機/筆電版面 */
@media (max-width: 1120px) and (min-width: 961px) {
  .nav-container {
    padding: 0 16px;
  }
  .logo-img {
    height: 40px;
  }
  .nav-menu {
    gap: 10px;
  }
  .nav-item a {
    font-size: 14px;
    padding: 6px 8px;
  }
}

/* 平板與手機版面 (< 960px) */
@media (max-width: 960px) {
  .nav-container {
    height: 62px;
    padding: 0 16px;
  }

  .logo-img {
    height: 36px;
    max-width: calc(100vw - 86px);
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 16px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.12);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
    z-index: 50;
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-item {
    width: 100%;
  }

  .nav-item a {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--radius-md);
  }

  .nav-item a:hover {
    background: var(--bg-body);
  }

  .nav-item.active a {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
  }

  .nav-item.active a::after {
    display: none;
  }
}

/* 主要頁面內容包裝 */
.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

/* 麵包屑導航 */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumb-link {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.breadcrumb-link:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--text-light);
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 600;
}

/* 列表頁頂部資訊區 */
.hero-header {
  margin-bottom: 28px;
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-muted);
}

/* 搜尋與篩選控制列 (PDF Page 2) */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  background: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 40px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14.5px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 143, 160, 0.15);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 16px;
  cursor: pointer;
  display: none;
}

.search-clear.visible {
  display: block;
}

/* 分類標籤篩選鈕 (PDF Page 2: 全部 6, 太陽能 5, 量子科技 1) */
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: #f1f5f9;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.filter-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.filter-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 143, 160, 0.25);
}

.filter-count {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
}

/* 檢視模式切換 (卡片 / 各國申請案明細表) */
.view-switchers {
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 1px solid var(--border-color);
  padding-left: 16px;
}

.view-btn {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.view-btn:hover {
  background: #ffffff;
  color: var(--text-main);
}

.view-btn.active {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* 卡片網格 (PDF Page 2: 3 Columns) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* 單張成果卡片 */
.patent-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.patent-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 24px -6px rgba(0, 143, 160, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* 標籤 Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-solar {
  background-color: var(--badge-solar-bg);
  color: var(--badge-solar-text);
  border: 1px solid #fde68a;
}

.badge-quantum {
  background-color: var(--badge-quantum-bg);
  color: var(--badge-quantum-text);
  border: 1px solid #ddd6fe;
}

.badge-hydrogen {
  background-color: var(--badge-hydrogen-bg);
  color: var(--badge-hydrogen-text);
  border: 1px solid #a7f3d0;
}

.badge-default {
  background-color: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge-family {
  background-color: var(--badge-family-bg);
  color: var(--badge-family-text);
  border: 1px solid #bae6fd;
}

.card-case-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.card-title {
  font-size: 17.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 20px;
  flex: 1;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  font-size: 12.5px;
  color: var(--text-muted);
}

.card-countries {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.country-pill {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.card-action-text {
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* 詳情檢視頁面 (PDF Pages 3-8) */
.detail-view {
  display: none;
}

.detail-view.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-header {
  margin-bottom: 28px;
}

.detail-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
  letter-spacing: -0.3px;
}

/* 雙欄佈局 (PDF Pages 3-8) */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 960px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

/* 左欄：技術摘要與申請案列表 */
.detail-main-column {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.content-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.content-box-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-box-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background-color: var(--primary);
  border-radius: 2px;
  display: inline-block;
}

.abstract-text {
  font-size: 15.5px;
  line-height: 1.85;
  color: #334155;
  text-align: justify;
}

/* 各國申請案表格 */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 14px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
  background: #ffffff;
}

.data-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: #f8fafc;
}

.country-flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.granted {
  background: #dcfce7;
  color: #15803d;
}

.status-badge.pending {
  background: #f1f5f9;
  color: #475569;
}

.status-badge.reviewing {
  background: #fef9c3;
  color: #854d0e;
}

/* 右欄：基本資訊 Card (PDF Pages 3-8) */
.info-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 96px;
}

.info-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 22px;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.info-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-label {
  color: var(--text-muted);
  min-width: 80px;
}

.info-value {
  color: var(--text-main);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

/* 按鈕：智財技轉處-案件技術資料 (PDF Pages 3-8) */
.btn-primary-action {
  width: 100%;
  height: 44px;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 143, 160, 0.2);
}

.btn-primary-action:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(0, 143, 160, 0.3);
}

/* 全域明細表檢視區塊 */
.all-table-view {
  display: none;
}

.all-table-view.active {
  display: block;
}

/* 彈出視窗 (Modal) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 32px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.contact-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
}

/* 空狀態與載入中 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

/* 頁尾 */
.main-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 32px 24px;
  margin-top: 60px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}


/* ========================================================
   多頁籤視圖切換與共用版型 (最新消息、關於中心、研究計畫、設施服務、人才招募)
   ======================================================== */

.page-section {
  display: none;
}

.page-section.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

/* 次分頁頁籤按鈕 (如關於中心內之切換) */
.subtabs-bar {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.subtab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.subtab-btn:hover {
  color: var(--primary);
}

.subtab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.subpage-panel {
  display: none;
}

.subpage-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

/* ========================================================
   1. 最新消息視圖 (News Grid)
   ======================================================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

.news-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.news-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.news-date {
  font-size: 13px;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

.news-title {
  font-size: 17.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 10px;
}

.news-location {
  font-size: 12.5px;
  color: #0369a1;
  background: #f0f9ff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.news-summary {
  font-size: 14.5px;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 16px;
  flex: 1;
}

.news-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.news-tag {
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* ========================================================
   2. 關於中心 (About RCCI)
   ======================================================== */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 24px 0;
}

@media (max-width: 768px) {
  .mission-grid {
    grid-template-columns: 1fr;
  }
}

.mission-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.mission-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.mission-card-desc {
  font-size: 14px;
  color: #475569;
  line-height: 1.65;
}

/* 時間軸樣式 (沿革) */
.timeline {
  position: relative;
  padding-left: 30px;
  margin: 24px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #cbd5e1;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--primary);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px var(--primary);
}

.timeline-year {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 14.5px;
  color: #334155;
  line-height: 1.6;
}

/* 首長個人介紹卡片 */
.profile-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #008fa0, #005f6b);
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.profile-title {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}

.profile-email {
  font-size: 13px;
  color: var(--text-muted);
}

/* 委員會名單網格 */
.committee-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .committee-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.committee-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.committee-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.committee-role {
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.committee-affil {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========================================================
   3. 研究計畫視圖 (Projects Grid)
   ======================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

.project-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.project-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.project-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.project-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.project-meta {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}

.project-summary {
  font-size: 14.5px;
  color: #334155;
  line-height: 1.7;
  margin-bottom: 18px;
}

.milestone-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 20px;
}

.milestone-title {
  font-size: 13px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 8px;
}

.milestone-list {
  padding-left: 18px;
  font-size: 13px;
  color: #15803d;
  line-height: 1.6;
}

/* 串聯智財專利成果的重點引導鈕 */
.btn-view-ip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #b2ebf2;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-view-ip:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ========================================================
   4. 設施服務視圖 (Facilities)
   ======================================================== */
.facilities-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

@media (max-width: 800px) {
  .facilities-grid {
    grid-template-columns: 1fr;
  }
}

.facility-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.facility-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.facility-loc {
  font-size: 13px;
  color: #0369a1;
  margin-bottom: 12px;
}

.facility-intro {
  font-size: 14px;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 16px;
}

.equipment-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.equipment-list {
  padding-left: 18px;
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
}

/* 設施收費流程專用卡片 */
.charge-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 32px;
}

.bank-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin: 16px 0;
}

@media (max-width: 640px) {
  .bank-info-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   5. 人才招募視圖 (Careers / Recruitment)
   ======================================================== */
.career-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 800px) {
  .career-grid {
    grid-template-columns: 1fr;
  }
}

.career-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.career-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.career-unit {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.career-title {
  font-size: 17.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.career-title a:hover {
  color: var(--primary) !important;
  text-decoration: underline;
}

.career-period {
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
  margin-bottom: 14px;
}

.career-desc {
  font-size: 14px;
  color: #334155;
  line-height: 1.65;
  margin-bottom: 14px;
}

.career-req {
  font-size: 13px;
  background: #f8fafc;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #475569;
  line-height: 1.6;
  margin-bottom: 18px;
}

.btn-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: var(--primary);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.btn-apply:hover {
  background-color: var(--primary-hover);
}

/* ========================================================
   全站跨裝置響應式適配 (Responsive Adaptation)
   ======================================================== */
@media (max-width: 768px) {
  .sync-banner {
    padding: 6px 12px;
    font-size: 12px;
    justify-content: center;
    text-align: center;
  }

  .page-container {
    padding: 20px 16px 48px;
  }

  .hero-header {
    margin-bottom: 20px;
  }

  .hero-title {
    font-size: 22px;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 14px;
    line-height: 1.5;
  }

  .controls-bar {
    padding: 14px;
    gap: 12px;
    margin-bottom: 20px;
  }

  .search-wrapper {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .filter-group {
    width: 100%;
    gap: 6px;
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .view-switchers {
    width: 100%;
    border-left: none;
    padding-left: 0;
    margin-top: 4px;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
  }

  .subtabs-bar {
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .subtab-btn {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 14px;
    flex-shrink: 0;
  }

  .breadcrumb-bar {
    flex-wrap: wrap;
    font-size: 12.5px;
    gap: 4px;
  }

  .detail-header {
    margin-bottom: 20px;
  }

  .detail-title {
    font-size: 20px;
    line-height: 1.35;
  }

  .table-responsive {
    margin-top: 8px;
    border-radius: var(--radius-sm);
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .nav-container {
    height: 56px;
    padding: 0 12px;
  }

  .logo-img {
    height: 32px;
    max-width: calc(100vw - 74px);
  }

  .mobile-nav-toggle {
    width: 38px;
    height: 38px;
    padding: 9px 7px;
    margin-left: 8px;
  }

  .hamburger-bar {
    width: 20px;
  }

  .nav-menu {
    top: 56px;
    padding: 10px 12px 14px;
  }

  .nav-item a {
    padding: 10px 14px;
    font-size: 14.5px;
  }

  .hero-title {
    font-size: 20px;
  }

  .hero-subtitle {
    font-size: 13.5px;
  }

  .patent-card {
    padding: 18px 16px;
  }

  .card-title {
    font-size: 16px;
  }

  .info-card {
    padding: 18px 16px;
  }

  .content-box {
    padding: 18px 16px;
  }
}
