:root {
  --primary: #5b5bd6;
  --primary-dark: #4848b8;
  --accent: #5b5bd6;
  --accent-2: #8b8be0;
  --text: #0a2540;
  --text-light: #6b7280;
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.2);
  --card-bg: #ffffff;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
  --bg: #fafbfc;
  --clip-sm: none;
  --clip-md: none;
  --clip-lg: none;
  /* tag colors */
  --tag-model: #3b82f6;
  --tag-feature: #10b981;
  --tag-tool: #f59e0b;
  --tag-tip: #c026d3;
  --tag-industry: #6b7280;
  --tag-legal: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  font-family: 'Noto Sans TC', 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  position: relative
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(77, 159, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(77, 159, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0
}

body>* {
  position: relative;
  z-index: 1
}

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

/* Top Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav {
  position: relative;
  z-index: 2;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04)
}

.topnav-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 24px
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.brand:hover {
  opacity: 0.8;
}

.brand:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 4px;
}

.tvbs-logo {
  height: 36px;
  width: auto;
  max-width: 90px;
  flex-shrink: 0;
  filter: brightness(0) saturate(100%) invert(20%) sepia(91%) saturate(2375%) hue-rotate(213deg) brightness(91%) contrast(99%);
  object-fit: contain;
  object-position: left center;
  margin-right: -6px
}

.brand-divider {
  width: 1px;
  height: 24px;
  background: linear-gradient(180deg, transparent, var(--border), transparent)
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  padding: 2px 0
}

.brand-sub {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 1px
}

.logo {
  font-weight: 900;
  font-size: 22px;
  color: var(--text);
  letter-spacing: 0.5px;
  line-height: 1.3;
  padding-bottom: 2px
}

.searchbar {
  flex: 1;
  max-width: 360px;
  margin-left: auto;
  position: relative
}

.searchbar input {
  width: 100%;
  padding: 10px 18px 10px 44px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  color: var(--text)
}

.searchbar input::placeholder {
  color: var(--text-light)
}

.searchbar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.15)
}

.searchbar::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23425466' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 420px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  z-index: 110;
  display: none;
  padding: 8px
}

.search-results.open {
  display: block
}

.search-result-item {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s;
}

.search-result-item:last-child {
  border-bottom: none
}

.search-result-item:hover {
  background: rgba(91, 91, 214, 0.06)
}

.search-result-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text)
}

.search-result-snippet {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.search-result-meta {
  font-size: 10px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-result-source {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(91, 91, 214, 0.08);
  color: var(--primary);
  border: 1px solid rgba(91, 91, 214, 0.2);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.search-result-date {
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  font-size: 10px;
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.search-no-result {
  padding: 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px
}

/* 搜尋按鈕（桌機隱藏，行動版顯示）*/
.search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  color: var(--text);
  flex-shrink: 0;
}

.search-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.site-header.search-open .search-toggle {
  color: var(--primary);
  background: rgba(91, 91, 214, 0.1);
}

/* Tabs */
.tabs-wrap {
  position: relative;
  z-index: 1;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border)
}

/* 選單左右捲動按鈕（桌機隱藏，行動版顯示）*/
.tabs-scroll {
  display: none;
}

.tabs {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  flex-wrap: wrap
}

.tab {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: 0.5px
}

.tab:hover {
  color: var(--text)
}

.tab.active {
  color: var(--text);
  font-weight: 700
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0
}

.tab-sep {
  color: var(--border);
  font-size: 14px;
  user-select: none;
  pointer-events: none;
  font-weight: 300
}

.nav-dropdown {
  position: relative;
  display: inline-block
}

.nav-dropdown:hover .dropdown-content,
.nav-dropdown.open .dropdown-content {
  display: flex
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 150px;
  z-index: 100;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.dropdown-item {
  padding: 10px 16px;
  width: 100%;
  text-align: center;
  border-radius: 0
}

.dropdown-item:hover {
  background: #f5f6f8
}

.dropdown-item.active {
  background: rgba(91, 91, 214, 0.08)
}

.dropdown-item.active::after {
  display: none !important
}

.dropdown-toggle {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: 0.5px;
  display: inline-block
}

.nav-dropdown:hover .dropdown-toggle,
.nav-dropdown.open .dropdown-toggle {
  color: var(--accent);
  text-shadow: 0 0 10px rgba(94, 245, 255, 0.4)
}

.dropdown-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Layout */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 32px 24px;
  width: 100%
}

.page {
  display: none;
  animation: fadeIn .4s ease
}

.page.active {
  display: block
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.layout-3col {
  display: grid;
  grid-template-columns: 280px 950px 280px;
  gap: 24px;
  align-items: start;
  min-height: 100vh;
  max-width: 1558px;
  margin: 0 auto
}

@media(max-width:1100px) {
  .layout-3col {
    grid-template-columns: 1fr
  }
}

aside.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 140px;
  align-self: start
}

@media(max-width:1100px) {
  aside.side {
    position: static
  }
}

main {
  display: flex;
  flex-direction: column;
  gap: 24px
}

/* Panels */
.panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(94, 245, 255, 0.5), transparent)
}

.panel h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text)
}

.panel h3 .dot {
  display: none
}

.page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border)
}

.page-header h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--text-light);
  font-size: 14px
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text)
}

.section-title .emoji {
  font-size: 22px
}

/* Internal tools */
.internal-tool {
  display: block;
  padding: 10px 14px;
  background: #f5f6f8;
  color: var(--text) !important;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.internal-tool:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: rgba(91, 91, 214, 0.06);
  color: var(--primary) !important
}

.internal-tool.variant-2 {
  background: rgba(91, 91, 214, 0.04);
  border-color: rgba(91, 91, 214, 0.25);
}

.internal-tool.variant-2:hover {
  border-color: var(--primary);
  background: rgba(91, 91, 214, 0.08)
}

.internal-tool .tool-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--primary);
  letter-spacing: 0.5px
}

.internal-tool .tool-desc {
  font-size: 13px;
  color: var(--text-light)
}

.tool-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text)
}

.tool-link:hover {
  background: rgba(91, 91, 214, 0.06);
  color: var(--primary)
}

/* Buttons */
.btn {
  padding: 8px 18px;
  border-radius: 0;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all .25s
}

.btn-primary {
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.15), rgba(94, 245, 255, 0.08));
  color: var(--accent);
  border: 1.5px solid rgba(94, 245, 255, 0.5);
  box-shadow: 0 0 0 1px rgba(94, 245, 255, 0.15) inset, 0 0 18px rgba(77, 159, 255, 0.25), 0 4px 12px rgba(0, 20, 60, 0.3);
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(94, 245, 255, 0.3)
}

.btn-primary:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.25), rgba(94, 245, 255, 0.12));
  box-shadow: 0 0 0 1px rgba(94, 245, 255, 0.4) inset, 0 0 28px rgba(94, 245, 255, 0.5), 0 6px 20px rgba(77, 159, 255, 0.4)
}

/* Chips */
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-light);
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary)
}

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

/* Hero Slider */
.hero-grid {
  display: grid;
  grid-template-columns: 68fr 32fr;
  gap: 16px;
  min-height: 500px;
}

.hero-main {
  position: relative;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  transition: transform 0.2s;
}

.hero-main:hover {
  transform: translateY(-2px);
}

.hero-main-content {
  padding: 28px 32px;
  width: 100%;
}

.hero-main-title {
  color: white;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
  margin: 14px 0 0 0;
  max-width: 95%;
}

/* 第一張 hero 的 tag 跟後三張 hero-small 一樣不撐開下方留白 */
.hero-main .slide-tag {
  margin-bottom: 0;
}

.hero-side {
  display: grid;
  grid-template-rows: 1.3fr 1fr 1fr;
  gap: 16px;
  min-height: 500px;
}

.hero-small {
  position: relative;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  transition: transform 0.2s;
}

.hero-small:hover {
  transform: translateY(-2px);
}

.hero-small-content {
  padding: 12px 14px;
  width: 100%;
  line-height: 1;
}

.hero-small-title {
  color: white;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  margin: 6px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-side > .hero-small:first-child .hero-small-title {
  font-size: 17px;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.hero-small .slide-tag {
  font-size: 11px;
  padding: 7px 14px;
  margin-bottom: 0;
}

.hero-small .slide-tag--tool {}

@media(max-width: 700px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-side {
    grid-template-rows: 1fr;
    grid-template-columns: 1fr 1fr 1fr;
    min-height: 140px;
  }
}

.hero-slider {
  position: relative;
  aspect-ratio: 16/8;
  min-height: 380px;
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 8px 32px rgba(0, 20, 60, 0.4);
  background: #0a1228;
  overflow: hidden;
  clip-path: var(--clip-lg)
}

.slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .6s cubic-bezier(0.4, 0, 0.2, 1)
}

.slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center
}

.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 10, 26, 0.95), rgba(5, 10, 26, 0.3) 60%, transparent)
}

.slide-content {
  position: relative;
  padding: 32px 40px;
  width: 100%
}

.slide-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #ffffff;
  color: var(--primary);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.slide-tag--tool {
  background: #f3e8ff;
  color: #7c3aed;
}

.slide-title {
  color: white;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
  max-width: 95%
}

@media(max-width:700px) {
  .slide-title {
    font-size: 20px;
    max-width: 100%
  }

  .slide-content {
    padding: 20px 24px
  }
}

.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 18, 40, 0.7);
  border: 1.5px solid var(--border-strong);
  color: var(--accent);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  backdrop-filter: blur(8px)
}

.slider-arrow:hover {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 20px rgba(94, 245, 255, 0.5)
}

.slider-arrow.prev {
  left: 16px
}

.slider-arrow.next {
  right: 16px
}

.slider-dots {
  position: absolute;
  bottom: 16px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 2
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all .3s
}

.slider-dot.active {
  background: var(--accent);
  width: 28px;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(94, 245, 255, 0.6)
}

/* Articles */
.articles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px
}

@media(max-width:700px) {
  .articles {
    grid-template-columns: 1fr
  }
}

.articles.three-col {
  grid-template-columns: repeat(3, 1fr)
}

@media(max-width:1000px) {
  .articles.three-col {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(max-width:700px) {
  .articles.three-col {
    grid-template-columns: 1fr
  }
}

.article-card {
  background: var(--card-bg);
  padding: 18px;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.article-cover {
  width: calc(100% + 36px);
  aspect-ratio: 16/9;
  margin: -18px -18px 18px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  background-color: #f3f4f6;
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.article-card .tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(91, 91, 214, 0.08);
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
  border: 1px solid rgba(91, 91, 214, 0.2);
  align-self: flex-start;
  width: auto
}

.article-card h4 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px
}

.article-card .summary {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .summary-tags-row {
  margin-top: 2px;
  margin-bottom: 14px;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-light)
}

#toolIntroContainer .article-meta span:last-child {
  color: var(--accent);
  font-weight: 400;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent))
}

.timeline-item {
  position: relative;
  padding-bottom: 18px
}

.timeline-item:last-child {
  padding-bottom: 0
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(77, 159, 255, 0.2), 0 0 12px rgba(77, 159, 255, 0.6)
}

.timeline-item.hot::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(94, 245, 255, 0.2), 0 0 16px rgba(94, 245, 255, 0.7)
}

.timeline-date {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 700;
  margin-bottom: 4px
}

.timeline-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px
}

/* 模型類別切換 */
.model-type-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap
}

.model-type-tab {
  padding: 10px 20px;
  background: rgba(20, 35, 75, 0.4);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.5px;
  transition: all .2s
}

.model-type-tab:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.model-type-tab.active {
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.2), rgba(94, 245, 255, 0.1));
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(94, 245, 255, 0.3) inset, 0 0 16px rgba(94, 245, 255, 0.3);
  text-shadow: 0 0 8px rgba(94, 245, 255, 0.4)
}

.model-type-pane {
  display: none;
  animation: fadeIn .4s ease
}

.model-type-pane.active {
  display: block
}

/* 雜誌封面式 Hero */
.issue-hero {
  position: relative;
  aspect-ratio: 16/9;
  min-height: 340px;
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 8px 32px rgba(0, 20, 60, 0.4), 0 0 0 1px rgba(94, 245, 255, 0.1);
  background: #0a1228;
  overflow: hidden;
  clip-path: var(--clip-lg);
  cursor: pointer;
  transition: all .3s
}

.issue-hero:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(0, 20, 60, 0.5), 0 0 30px rgba(94, 245, 255, 0.25)
}

.issue-hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform .5s
}

.issue-hero:hover .issue-hero-img {
  transform: scale(1.04)
}

.issue-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 10, 26, 0.95) 0%, rgba(5, 10, 26, 0.55) 45%, rgba(5, 10, 26, 0.15) 100%)
}

.issue-hero-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 32px;
  z-index: 2
}

.issue-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap
}

.issue-vol {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #0a1228;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  box-shadow: 0 0 14px rgba(94, 245, 255, 0.4);
  font-family: 'SF Mono', Menlo, Consolas, monospace
}

.issue-date {
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 1px
}

.issue-label {
  font-size: 11px;
  color: var(--text-light);
  padding: 3px 10px;
  border: 1px solid rgba(94, 245, 255, 0.3);
  border-radius: 4px;
  letter-spacing: 1.5px;
  font-weight: 700
}

.issue-hero h2 {
  color: white;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.3;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85);
  margin-bottom: 6px
}

.issue-hero .sub-title {
  color: var(--accent-2);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8)
}

.issue-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: all 0.2s;
  transition: all .2s
}

.issue-hero-btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 91, 214, 0.25)
}

@media(max-width:700px) {
  .issue-hero h2 {
    font-size: 22px
  }

  .issue-hero .sub-title {
    font-size: 14px
  }

  .issue-hero-body {
    padding: 20px 24px
  }
}

/* 本期章節（新聞＋工具＋Prompt 混合） */
.issue-section-title {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0;
  white-space: nowrap;
  width: 100%
}

.issue-section-title .count {
  color: var(--text-light);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: 10px;
  display: none
}

.issue-section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
  min-width: 20px
}

#thisIssueNewsWrap {
  min-height: 500px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  transition: min-height 0.3s;
}

.issue-section-more {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: transparent;
  color: var(--text-light);
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  user-select: none;
  letter-spacing: 0.5px;
  box-shadow: none;
  text-shadow: none
}

.issue-section-more .chevron {
  font-weight: 700;
  letter-spacing: -2px;
  margin-right: 6px;
  font-size: 22px;
  transition: all .2s;
  display: inline-block;
  vertical-align: middle
}

.issue-section-more:hover {
  background: transparent;
  color: var(--primary);
  box-shadow: none;
  transform: translateX(2px)
}

.issue-section-more:hover .chevron {
  filter: brightness(1.3)
}

.issue-block {
  background: rgba(20, 35, 75, 0.4);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--border-strong);
  padding: 20px 25px;
  clip-path: var(--clip-md);
  transition: all .2s;
  cursor: pointer
}

.issue-block:hover {
  background: rgba(25, 45, 85, 0.85);
  border-color: rgba(94, 245, 255, 0.4);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transform: translateY(-4px)
}

.issue-block.tool {}

.issue-block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap
}

.issue-block-tag {
  padding: 3px 10px;
  background: rgba(77, 159, 255, 0.15);
  color: #a5c8ff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px
}

.issue-block h4 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin: 0
}

.issue-block .snippet {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.5;
  margin-top: 6px
}

/* 本期目錄 TOC */
.toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.toc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
  background: transparent
}

.toc-item:hover {
  background: rgba(91, 91, 214, 0.06);
  transform: translateY(-1px)
}

.toc-item:hover .toc-title {
  color: var(--primary)
}

.toc-num {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  opacity: 0.7;
  flex-shrink: 0;
  min-width: 20px;
  letter-spacing: -0.5px
}

.toc-icon {
  font-size: 14px;
  flex-shrink: 0;
  min-width: 20px;
  text-align: center
}

.toc-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.7;
  transition: all .2s
}

.toc-item:hover .toc-dot {
  opacity: 1;
  box-shadow: 0 0 12px rgba(94, 245, 255, 0.9)
}

.toc-prefix-tool {
  display: inline-block;
  color: #c084fc;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.3px;
  margin-right: 2px;
}

.toc-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 10px 4px;
}

.toc-title {
  font-size: 13px;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  transition: all .15s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

.toc-divider {
  height: 1px;
  background: rgba(77, 159, 255, 0.15);
  margin: 6px 0
}

.toc-item.toc-special:hover {
  background: rgba(94, 245, 255, 0.12)
}

/* 事件 ticker 列表 */
.ticker-list {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px dashed rgba(77, 159, 255, 0.12);
  cursor: pointer;
  transition: all .15s
}

.ticker-item:last-child {
  border-bottom: none
}

.ticker-item:hover {
  background: rgba(77, 159, 255, 0.06);
  padding-left: 8px
}

.ticker-item:hover .ticker-title {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(94, 245, 255, 0.25)
}

.ticker-bullet {
  color: var(--primary);
  font-size: 10px;
  flex-shrink: 0;
  opacity: 0.7;
  transform: translateY(-1px)
}

.ticker-item.hot .ticker-bullet {
  color: var(--accent);
  opacity: 1;
  text-shadow: 0 0 8px rgba(94, 245, 255, 0.5);
  animation: tickerPulse 1.8s ease-in-out infinite
}

@keyframes tickerPulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.4
  }
}

.ticker-date {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(77, 159, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(94, 245, 255, 0.25);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  flex-shrink: 0;
  white-space: nowrap
}

.ticker-item.hot .ticker-date {
  background: rgba(94, 245, 255, 0.2);
  border-color: rgba(94, 245, 255, 0.5);
  box-shadow: 0 0 8px rgba(94, 245, 255, 0.3)
}

.ticker-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  transition: all .15s
}

/* Poll */

/* 黑客松卡片 */
.hackathon-card-link {
  display: block;
  text-decoration: none;
  color: inherit
}

.hackathon-card-link:hover {}

.hackathon-card-link:hover .hackathon-card {}

.hackathon-card {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 18px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.hackathon-card::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(91, 91, 214, 0.08), transparent 70%);
  pointer-events: none
}

.hack-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px
}

.hack-tag {
  font-size: 10px;
  color: var(--primary);
  letter-spacing: 1px;
  font-weight: 700;
  text-transform: uppercase
}

.hack-name {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text);
  position: relative
}

.hack-timeline {
  position: relative;
  padding-left: 24px
}

.hack-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent-2))
}

.hack-step {
  position: relative;
  padding-bottom: 14px
}

.hack-step:last-child {
  padding-bottom: 0
}

.hack-step::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.15)
}

.hack-step.current::before {
  background: var(--primary);
  width: 14px;
  height: 14px;
  left: -21px;
  top: 3px;
  animation: hackPulse 1.8s ease-in-out infinite
}

@keyframes hackPulse {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.25), 0 0 12px rgba(91, 91, 214, 0.4)
  }

  50% {
    box-shadow: 0 0 0 6px rgba(91, 91, 214, 0.15), 0 0 20px rgba(91, 91, 214, 0.55)
  }
}

.hack-step.past::before {
  background: #9ca3af;
  box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.18);
  opacity: 0.6
}

.hack-step-date {
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: 0.5px
}

.hack-step-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5
}

.hack-step.current .hack-step-date {
  color: var(--primary)
}

.hack-step.current .hack-step-desc {
  font-weight: 700;
  color: var(--text);
  line-height: 1.5
}

.hack-step.past .hack-step-date {
  color: #9ca3af
}

.hack-step.past .hack-step-desc {
  color: #9ca3af;
  text-decoration: line-through;
  opacity: 0.7
}

.hack-prize {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(94, 245, 255, 0.08);
  border: 1px solid rgba(94, 245, 255, 0.2);
  clip-path: var(--clip-sm);
  font-size: 12px;
  line-height: 1.6
}

.hack-prize-title {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 1px;
  font-size: 14px
}

.hack-prize-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text)
}

.hack-prize-row span:last-child {
  font-weight: 700;
  color: var(--accent)
}

.hack-prize-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text);
  font-weight: 400
}

.hack-prize-grid .sep {
  color: var(--accent);
  opacity: 0.6
}

.hack-footer {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-light);
  text-align: center
}

/* Archive */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px
}

.archive-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.archive-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.archive-card .cover {
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  background-color: #f3f4f6;
  position: relative;
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.archive-card .cover-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 4px 12px;
  background: var(--primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(91, 91, 214, 0.35);
  z-index: 1;
}

.archive-card .body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column
}

.archive-card .issue-num {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px
}

.archive-card h4 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px
}

.archive-card .desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.35;
  margin-bottom: 10px;
  flex: 1
}

.archive-card .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-light);
  padding-top: 10px;
  border-top: 1px solid var(--border)
}

.archive-card .views {
  color: var(--accent);
  font-weight: 600
}

/* Term cards */
.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px
}

.term-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 14px 16px;
  border: 1.5px solid var(--border-strong);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px))
}

.term-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent)
}

.term-card .term-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 3px;
  text-shadow: 0 0 12px rgba(148, 187, 255, 0.25);
  line-height: 1.3
}

.term-card .term-en {
  font-size: 15px;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4
}

.term-card .term-def {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text)
}

.term-category {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(91, 91, 214, 0.08);
  color: var(--primary);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  border: 1px solid rgba(91, 91, 214, 0.25)
}

/* Prompt compact cards */
.prompt-list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px
}

@media(max-width:1200px) {
  .prompt-list-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(max-width:700px) {
  .prompt-list-grid {
    grid-template-columns: 1fr
  }
}

.prompt-compact-card {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 12px;
  transition: all .2s;
  text-decoration: none;
  clip-path: var(--clip-md)
}

.prompt-compact-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08)
}

.pc-cover {
  width: calc(100% + 28px);
  aspect-ratio: 16/9;
  margin: -14px -14px 10px;
  background-size: cover;
  background-position: center;
  background-color: #f3f4f6;
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.prompt-compact-card .pc-cat {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(91, 91, 214, 0.08);
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(91, 91, 214, 0.2);
  align-self: flex-start
}

.prompt-compact-card .pc-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text)
}

.prompt-compact-card .pc-sub {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prompt-compact-card .pc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 400;
  gap: 8px
}

.prompt-compact-card .pc-issue {
  color: var(--text-light);
  font-weight: 500;
  font-size: 11px
}

/* Prompt modal */
.prompt-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s
}

.prompt-modal-mask.open {
  opacity: 1;
  pointer-events: auto
}

.prompt-modal {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;     /* 同 article modal：滾到底時不傳到背後分頁 */
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
  transform: scale(0.92) translateY(20px);
  transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.prompt-modal-mask.open .prompt-modal {
  transform: scale(1) translateY(0)
}

.prompt-modal-head {
  padding: 22px 26px 16px;
  border-bottom: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px
}

.prompt-modal-head h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-top: 8px;
  line-height: 1.3
}

.prompt-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.prompt-modal-close:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: rotate(90deg)
}

.prompt-modal-body {
  padding: 20px 26px 26px
}

.prompt-modal-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 16px
}

.prompt-modal-content {
  background: #f8fafc;
  color: var(--text);
  padding: 18px 22px;
  font-size: 13px;
  line-height: 1.8;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  white-space: pre-wrap;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
}

.prompt-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.prompt-mini-btn {
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit
}

.prompt-modal::-webkit-scrollbar {
  width: 6px
}

.prompt-modal::-webkit-scrollbar-track {
  background: transparent
}

.prompt-modal::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 10px
}

.prompt-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.32)
}

.prompt-mini-btn.primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.prompt-mini-btn.primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(91, 91, 214, 0.25);
  transform: translateY(-1px);
}

.prompt-mini-btn.ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text)
}

/* Article Modal */
.article-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .3s
}

.article-modal-mask.active {
  display: flex;
  opacity: 1
}

.article-modal {
  background: #ffffff;
  width: 100%;
  max-width: 860px;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;     /* 滾到底/頂時不要把滾動傳到背後分頁（scroll chaining） */
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
  position: relative;
  animation: modalIn .4s cubic-bezier(0.16, 1, 0.3, 1)
}

@keyframes modalIn {
  from {
    transform: translateY(30px) scale(0.95);
    opacity: 0
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1
  }
}

.am-header {
  padding: 32px 40px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start
}

.am-title-wrap {
  flex: 1;
  padding-right: 40px
}

.am-breadcrumb {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}

.am-breadcrumb .crumb-sep {
  margin: 0 4px;
  color: rgba(15, 23, 42, 0.35);
  font-size: 16px;
  font-weight: 300;
  vertical-align: middle;
}

.am-breadcrumb .crumb-link {
  color: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}

.am-breadcrumb .crumb-link:hover {
  text-decoration: underline;
  color: var(--accent);
}

.am-tag {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(91, 91, 214, 0.08);
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  border: 1px solid rgba(91, 91, 214, 0.25);
  letter-spacing: 0.5px
}

.am-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}

.am-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all .2s;
  position: sticky;
  top: 16px;
  margin: 16px 16px -52px auto;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.am-close:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: rotate(90deg)
}

.am-body {
  padding: 40px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.8
}

.am-cover {
  width: 100%;
  height: 380px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  margin-bottom: 32px;
  border: 1px solid var(--border)
}

.am-content h4 {
  color: var(--text) !important;
  font-size: 22px;
  margin: 36px 0 12px;
  font-weight: 800;
  line-height: 1.3;
}

.am-content h5 {
  color: var(--primary) !important;
  font-size: 18px;
  margin: 24px 0 12px;
  font-weight: 700
}

.am-content p {
  margin-bottom: 20px;
  color: var(--text)
}

.am-content ul,
.am-content ol {
  padding-left: 1.6em;
  margin: 12px 0 20px;
  list-style-position: outside;
}

.am-content ul { list-style-type: disc; }
.am-content ol { list-style-type: decimal; }

.am-content li {
  margin-bottom: 8px;
  line-height: 1.8;
  color: var(--text);
  padding-left: 4px;
}

.am-content li::marker {
  color: var(--text-light);
}

.am-content li > ul,
.am-content li > ol {
  margin: 8px 0;
}

.am-content .news-columns {
  display: block;
  margin: 24px 0
}

.am-content .column {
  margin-bottom: 16px
}

.am-content strong {
  color: var(--text);
  font-weight: 700
}

.am-content .link-group {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px
}

.am-content .link-group.link-group-bottom {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.am-content .news-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.am-content .news-link:hover {
  background: var(--primary-dark);
  box-shadow: 0 6px 16px rgba(91, 91, 214, 0.25);
  transform: translateY(-1px)
}

.am-content .link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 14px
}

/* === 文章 modal 小標套用底線設計（重點趨勢/Prompt/工具介紹三類文章共用） === */
/* 只有第一層 h4（無 inline font-size）才加底線；次層 h4（縮小字級的子標題）保持無底線避免視覺重疊 */
/* 同時排除已有 background 設定的色塊型 h4，避免色塊下多一條線 */
.am-content h4:not([style*="background"]):not([style*="font-size"]) {
  border-bottom: 1px solid #e8e1f8;
  padding-bottom: 8px;
}

/* === Prompt 文章共用元件 === */

/* 文章封面圖 + 圖說（內嵌於 content 開頭） */
.am-content .prompt-cover,
.am-content .prompt-figure {
  text-align: center;
  margin: 8px 0 32px;
}
.am-content .prompt-cover img,
.am-content .prompt-figure img {
  max-width: 90%;
  width: 600px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(91, 91, 214, 0.18);
  display: block;
  margin: 0 auto;
}
.am-content .prompt-cover-caption,
.am-content .prompt-figure-caption {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
  margin: 10px 0 0;
  text-align: center;
}

/* 編號條列說明（淺灰底） */
.am-content .article-list-box {
  background: #f8f9fa;
  padding: 22px 24px;
  border-radius: 10px;
  margin: 20px 0 28px;
}
.am-content .article-list-box p {
  margin: 0 0 14px 0;
  line-height: 1.8;
}
.am-content .article-list-box p:last-child {
  margin-bottom: 0;
}
.am-content .article-list-box strong {
  color: var(--primary);
}

/* Prompt 範例引用區（紫色邊條） */
.am-content .prompt-quote {
  background: #f5f3ff;
  border-left: 4px solid var(--primary);
  padding: 18px 22px;
  border-radius: 8px;
  margin: 20px 0 28px;
  line-height: 1.8;
  color: #333;
}
.am-content .prompt-quote p {
  margin: 0;
}
.am-content .prompt-quote p + p {
  margin-top: 12px;
}

/* 黃色提醒（要留意的是）— 全描邊版本，避免左粗條跟圓角接縫的視覺重疊 */
.am-content .callout-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  line-height: 1.8;
}
.am-content .callout-warn p {
  margin: 0;
}

/* 灰色小提示（💡 小提醒） */
.am-content .callout-tip {
  background: #f3f4f6;
  border-left: 4px solid #9ca3af;
  padding: 14px 18px;
  border-radius: 6px;
  margin: 20px 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: #555;
}
.am-content .callout-tip p {
  margin: 0;
}

/* 使用前準備（淺紫底） */
.am-content .prep-box {
  background: #f5f0ff;
  border-radius: 10px;
  padding: 20px 24px;
  margin: 20px 0 28px;
}
.am-content .prep-box h5 {
  margin: 0 0 12px 0 !important;
  color: var(--primary) !important;
  font-size: 16px !important;
}
.am-content .prep-box ul {
  margin: 0;
  padding-left: 1.4em;
}
.am-content .prep-box li {
  margin-bottom: 6px;
  line-height: 1.75;
}

/* 編號情境卡片（Google 10 應用情境用） */
.am-content .scenario-card {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
/* 文章內的 scenario card 純閱讀用、不互動，覆寫全域 .scenario-card:hover 的紫框 */
.am-content .scenario-card:hover {
  border-color: var(--border);
}
.am-content .scenario-card .scenario-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.am-content .scenario-card .scenario-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.am-content .scenario-card h4.scenario-h {
  margin: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 1.4;
}
.am-content .scenario-card .scenario-intro {
  margin: 0 0 12px 0;
  line-height: 1.75;
}
.am-content .scenario-card .scenario-prompt {
  background: #fff;
  border-left: 3px solid var(--primary);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14.5px;
  line-height: 1.75;
  color: #444;
  margin: 0;
}
.am-content .scenario-card .scenario-prompt-label {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
  letter-spacing: 0.5px;
  vertical-align: 2px;
}

/* Google 40 應用情境（tip-card 系列）— 補上 legacy 文章未定義的 class 樣式 */
.am-content .tips-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin: 12px 0 24px;
}
.am-content .tip-card {
  padding: 8px 0;
}
.am-content .tip-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}
.am-content .tip-number {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}
.am-content .tip-number::after {
  content: ".";
}
.am-content .tip-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.am-content .tip-desc {
  margin: 0;
  line-height: 1.75;
}
.am-content .tip-desc .case-link {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}
.am-content h4.tips-category-title {
  margin-top: 36px;
}

/* 步驟卡片（Prompt Optimizer 5 步驟） */
.am-content .step-card {
  background: #fafafa;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 16px;
}
.am-content .step-card h5 {
  margin: 0 0 10px 0 !important;
  color: var(--primary) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}
.am-content .step-card p {
  margin: 0 0 12px 0;
  line-height: 1.75;
}
.am-content .step-card p:last-child {
  margin-bottom: 0;
}
.am-content .step-card .step-figure {
  text-align: center;
  margin: 14px 0 8px;
}
.am-content .step-card .step-figure img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.am-content .step-card .step-figure-caption {
  font-size: 12px;
  color: var(--text-light);
  margin: 6px 0 0;
}

.am-footer {
  padding: 30px 40px;
  border-top: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.am-meta {
  font-size: 13px;
  color: var(--text-light)
}

@media(max-width:700px) {
  .am-title {
    font-size: 26px
  }

  .am-header,
  .am-body {
    padding: 24px
  }

  .am-cover {
    height: 220px
  }
}

.article-modal::-webkit-scrollbar {
  width: 6px
}

.article-modal::-webkit-scrollbar-track {
  background: transparent
}

.article-modal::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 10px
}

.article-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.32)
}

/* Prompt resource sites */
.prompt-sites-heading {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}

.prompt-sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px
}

.prompt-site-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text) !important;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.prompt-site-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91, 91, 214, 0.12);
}

.site-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0
}

.site-info {
  flex: 1;
  min-width: 0
}

.site-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text)
}

.site-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5
}

.tool-section-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  padding-left: 12px;
  border-left: 3px solid var(--primary);
  line-height: 1.2
}

/* Model cards */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 32px
}

.model-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  padding: 24px;
  border: 1.5px solid var(--border-strong);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  clip-path: var(--clip-md)
}

.model-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent)
}

.model-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px
}

.model-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 10px;
  overflow: hidden
}

.model-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain
}

.model-name {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 3px;
  color: var(--text)
}

.model-maker {
  font-size: 13px;
  color: var(--text-light)
}

.model-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 14px
}

.model-spec {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.08), rgba(94, 245, 255, 0.04));
  border: 1px solid rgba(94, 245, 255, 0.15);
  clip-path: var(--clip-sm)
}

.spec-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px
}

.spec-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent)
}

.strength-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px
}

.strength-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px
}

.strength-tag {
  padding: 3px 10px;
  background: rgba(77, 159, 255, 0.15);
  color: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(94, 245, 255, 0.2)
}

.model-best {
  background: linear-gradient(135deg, rgba(94, 245, 255, 0.08), rgba(77, 159, 255, 0.06));
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.6;
  border-left: 3px solid var(--accent);
  margin-top: auto;
  color: var(--text);
  clip-path: var(--clip-sm)
}

.model-best strong {
  color: var(--accent)
}

/* Compare table */
.compare-table-wrap {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  padding: 8px;
  border: 1.5px solid var(--border-strong);
  overflow-x: auto;
  clip-path: var(--clip-md)
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px
}

.compare-table th {
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.12), rgba(94, 245, 255, 0.08));
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid var(--border-strong)
}

.compare-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text)
}

.compare-table tr:last-child td {
  border-bottom: none
}

.compare-table tr:hover td {
  background: rgba(77, 159, 255, 0.08)
}

.compare-table .model-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700
}

.compare-table .model-cell-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  flex-shrink: 0
}

.compare-table .model-cell-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain
}

.rating {
  display: inline-flex;
  gap: 1px;
  font-size: 11px
}

.star {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(94, 245, 255, 0.4)
}

.star.dim {
  color: rgba(77, 159, 255, 0.2);
  text-shadow: none
}

/* Scenario compact grid（怎麼選？）*/
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px
}

.scenario-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--border-strong);
  padding: 14px 16px;
  clip-path: var(--clip-sm)
}

.scenario-card:hover {
  border-color: var(--accent)
}

.scenario-card .tag {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(77, 159, 255, 0.15);
  color: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  border: 1px solid rgba(94, 245, 255, 0.2)
}

.scenario-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4
}

.scenario-card .summary {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5
}

.scenario-card .summary strong {
  color: var(--accent)
}

/* 學習資源 */
.learn-section {
  margin-bottom: 32px
}

.learn-section-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text)
}

.learn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px
}

.learn-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: rgba(20, 35, 75, 0.4);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--border-strong);
  text-decoration: none;
  color: var(--text) !important;
  clip-path: var(--clip-sm);
  transition: all .2s
}

.learn-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: rgba(77, 159, 255, 0.1);
  box-shadow: 0 0 16px rgba(94, 245, 255, 0.2)
}

.learn-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 700;
  color: white
}

.learn-info {
  flex: 1;
  min-width: 0
}

.learn-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap
}

.learn-badge {
  display: inline-block;
  padding: 1px 8px;
  background: rgba(94, 245, 255, 0.15);
  color: var(--accent);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(94, 245, 255, 0.25);
  letter-spacing: 0.5px
}

.learn-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.55
}

/* Tools grid */
.tool-section {
  margin-bottom: 28px
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px
}

.tool-card-big {
  background: #ffffff;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text) !important;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tool-card-big:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(91, 91, 214, 0.12);
}

.tool-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0
}

.tool-icon.logo-icon {
  padding: 8px;
  overflow: hidden
}

.tool-icon.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block
}

.tool-info {
  flex: 1;
  min-width: 0
}

.tool-info .tool-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px
}

.tool-sub {
  font-size: 12px;
  color: var(--text-light)
}

.internal-highlight {
  background: #ffffff !important;
  color: var(--text) !important;
  border: 1px solid rgba(91, 91, 214, 0.35) !important;
  box-shadow: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.internal-highlight:hover {
  transform: translateY(-2px);
  border-color: var(--primary) !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(91, 91, 214, 0.15) !important;
  color: var(--text) !important;
}

.internal-highlight .tool-name {
  color: var(--primary);
  font-weight: 700;
}

.internal-highlight .tool-sub {
  color: var(--text-light) !important;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px
}

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

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

.case-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  padding: 22px;
  border: 1.5px solid var(--border-strong);
  clip-path: var(--clip-md);
  display: flex;
  flex-direction: column;
  height: 100%
}

.case-card:hover {
  transform: translateY(-2px)
}

.case-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap
}

.case-author {
  display: flex;
  align-items: center;
  gap: 10px
}

.case-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px
}

.case-name {
  font-weight: 700;
  font-size: 15px
}

.case-dept {
  font-size: 13px;
  color: var(--text-light)
}

.case-badge {
  padding: 4px 12px;
  background: rgba(77, 159, 255, 0.15);
  color: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(94, 245, 255, 0.2)
}

.case-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.5
}

.case-desc {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 10px
}

.case-result {
  background: linear-gradient(135deg, rgba(94, 245, 255, 0.08), rgba(77, 159, 255, 0.08));
  padding: 12px 14px;
  font-size: 14px;
  border-left: 3px solid var(--accent);
  color: var(--text);
  clip-path: var(--clip-sm)
}

.case-result strong {
  color: var(--accent)
}

/* Feedback form */
.feedback-form {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  padding: 28px;
  border: 1.5px solid var(--border-strong);
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  clip-path: var(--clip-md)
}

.form-group {
  margin-bottom: 18px
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text)
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: rgba(10, 18, 40, 0.6);
  color: var(--text);
  clip-path: var(--clip-sm)
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(94, 245, 255, 0.2)
}

.rating-group,
.checkbox-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap
}

.rating-opt,
.checkbox-opt {
  padding: 10px 16px;
  background: rgba(10, 18, 40, 0.6);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  clip-path: var(--clip-sm)
}

.rating-opt:hover,
.checkbox-opt:hover {
  border-color: var(--accent)
}

.rating-opt.selected {
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.2), rgba(94, 245, 255, 0.1));
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(94, 245, 255, 0.3) inset, 0 0 16px rgba(94, 245, 255, 0.3);
  text-shadow: 0 0 8px rgba(94, 245, 255, 0.4)
}

.checkbox-opt.checked {
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.2), rgba(94, 245, 255, 0.1));
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(94, 245, 255, 0.3) inset, 0 0 14px rgba(94, 245, 255, 0.25);
  text-shadow: 0 0 8px rgba(94, 245, 255, 0.4)
}

/* Chat FAB */
footer {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  border-top: 1px solid var(--border);
  position: relative
}

footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 25%;
  right: 25%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent)
}

/* === Hero slider track + news feed timeline === */
.slides-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
  will-change: transform
}

.slide {
  cursor: pointer
}

.slide-desc {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.55;
  margin-top: 8px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  max-width: 78%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden
}

@media(max-width:700px) {
  .slide-desc {
    display: none
  }
}

.feed-tag {
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(91, 91, 214, 0.08);
  color: var(--primary);
  border: 1px solid rgba(91, 91, 214, 0.2);
  border-radius: 999px;
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: .5px;
  white-space: nowrap
}

.footer-disclaimer {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-light);
  max-width: 760px;
  margin: 0 auto 12px
}

.footer-address {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 6px;
  letter-spacing: .3px
}

.footer-team {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 1px
}

footer {
  padding: 32px 24px 40px;
  text-align: center
}

.summaries-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.legacy-source-link {
  color: var(--text-light);
  font-size: 14px;
  text-decoration: underline;
  transition: color 0.2s;
}

.legacy-source-link:hover {
  color: var(--accent);
}

/* Related articles in article modal */
.related-articles {
  margin-top: 48px;
}

.related-heading {
  font-size: 17px !important;
  color: var(--text) !important;
  margin: 0 0 16px 0 !important;
  font-weight: 700;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

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

.related-card {
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(91, 91, 214, 0.12);
}

.related-cover {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
}

.related-info {
  padding: 14px 12px 12px;
  line-height: 1;
}

.related-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(91, 91, 214, 0.08);
  padding: 5px 10px;
  border: 1px solid rgba(91, 91, 214, 0.25);
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 0;
}

.related-title,
.am-content .related-title {
  font-size: 14px;
  color: var(--text) !important;
  margin: 10px 0 8px 0 !important;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 700;
}

.related-date {
  font-size: 11px;
  color: var(--text-light);
}

/* 10 秒看趨勢延伸閱讀：單欄列表（每行：日期 → 分類 → 標題） */
.related-grid.related-grid--list {
  grid-template-columns: 1fr;
  gap: 8px;
}
.related-card.related-card--row {
  /* grid 鎖定每一欄的橫向位置：日期欄 / tag 欄（固定寬度容器，chip 本身維持自然寬度）/ 標題欄 */
  display: grid;
  grid-template-columns: auto 76px 1fr;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  overflow: hidden;
}
.related-card--row .related-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.related-card--row .related-tag {
  margin: 0;
  justify-self: center;
  font-size: 11px;
  padding: 3px 10px;
}
.related-card--row .related-title,
.am-content .related-card--row .related-title {
  margin: 0 !important;
  display: block;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  -webkit-box-orient: unset;
}

/* Robot icon animations: float + blink + antenna wiggle + glow pulse */
.robot-icon {
  animation: robotFloat 2.8s ease-in-out infinite;
}

.robot-icon svg {
  animation: robotGlow 2.4s ease-in-out infinite;
}

@keyframes robotGlow {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(94, 245, 255, 0.35)); }
  50% { filter: drop-shadow(0 0 12px rgba(94, 245, 255, 0.85)); }
}

@keyframes robotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.robot-icon svg circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: robotBlink 3s infinite;
}

@keyframes robotBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  93%, 96% { transform: scaleY(0.15); }
}

.robot-icon svg path:nth-child(1) {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: robotAntennaL 1.8s ease-in-out infinite;
}

.robot-icon svg path:nth-child(2) {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: robotAntennaR 1.8s ease-in-out infinite;
}

@keyframes robotAntennaL {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-12deg); }
}

@keyframes robotAntennaR {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(12deg); }
}

.trend-summary {
  margin: 0;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.summary-list-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  align-items: center;
  padding: 20px 0 20px 22px;
  cursor: pointer;
  transition: background 0.15s;
}

.sli-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sli-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 2px;
}

.sli-date {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0;
}

.sli-meta-sep {
  color: rgba(15, 23, 42, 0.25);
  font-weight: 300;
}

.sli-meta .feed-tag {
  margin: 0;
}

.sli-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
}

/* 列表/卡片預覽不顯示 <strong> 跟 <img>，僅內文 modal 顯示 */
.sli-summary strong,
.article-card .summary strong,
.pc-sub strong {
  font-weight: inherit;
  color: inherit;
}
.sli-summary img,
.article-card .summary img,
.pc-sub img {
  display: none;
}

.sli-summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 緊湊版：橫向 list（10 秒看趨勢 dedicated page）*/
.summary-list-item--compact {
  grid-template-columns: 1fr auto;
  column-gap: 14px;
  padding: 14px 12px 14px 22px;
}

.summary-list-item--compact .sli-date {
  white-space: nowrap;
  order: -1;
}

/* 桌機：日期(最左) + tag 在標題左側、上下置中；適用情境對齊標題左緣 */
.summary-list-item--compact .sli-compact-body {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "meta title"
    "meta tags";
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  min-width: 0;
}

.summary-list-item--compact .sli-meta {
  grid-area: meta;
  margin: 0;
  /* 鎖定 tag 欄位寬度，讓標題不會因 tag 字數不同而錯位 */
  display: grid;
  grid-template-columns: auto 72px;
  align-items: center;
  /* column-gap 對齊外層的 14px，tag 左右兩邊到 date / 標題的距離才會對稱 */
  column-gap: 14px;
}
.summary-list-item--compact .sli-meta .feed-tag {
  justify-self: center;
}

.summary-list-item--compact .sli-title {
  grid-area: title;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}

.summary-list-item--compact .summary-tags-row {
  grid-area: tags;
  margin-top: 6px;
}

.summary-list-item[data-content-tag="模型發布"] { --tag-color: var(--tag-model) }
.summary-list-item[data-content-tag="新功能"] { --tag-color: var(--tag-feature) }
.summary-list-item[data-content-tag="新工具"] { --tag-color: var(--tag-tool) }
.summary-list-item[data-content-tag="應用技巧"] { --tag-color: var(--tag-tip) }
.summary-list-item[data-content-tag="產業動態"] { --tag-color: var(--tag-industry) }
.summary-list-item[data-content-tag="法律規範"] { --tag-color: var(--tag-legal) }

/* tag pill 跟左側色條同色（淡底 + 同色文字 + 同色邊框） */
.summary-list-item .feed-tag {
  background: color-mix(in srgb, var(--tag-color, var(--primary)) 10%, transparent);
  border-color: color-mix(in srgb, var(--tag-color, var(--primary)) 32%, transparent);
  color: var(--tag-color, var(--primary));
}

.summary-list-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--tag-color, var(--border));
  border-radius: 2px;
}

.summary-list-item:hover {
  background: rgba(15, 23, 42, 0.025);
}

.summary-list-item::after {
  content: '';
  position: absolute;
  left: 0;
  right: 8px;
  bottom: 0;
  height: 1px;
  background: var(--border);
}

.filter-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto 20px;
  width: 100%;
}

/* 「篩選」收合按鈕：預設只顯示一顆按鈕，點開才展開 filter-panel */
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: #ece9fa;    /* 淡紫色底，跟主色 primary 同色相 */
  border: 1px solid var(--primary);
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-start;
}
.filter-toggle:hover {
  background: #ddd7f5;
}
.filter-toggle.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.filter-toggle-count {
  font-size: 12px;
  opacity: 0.8;
}
.filter-toggle-arrow {
  font-size: 10px;
  transition: transform 0.2s;
}
.filter-toggle.open .filter-toggle-arrow {
  transform: rotate(180deg);
}

.filter-panel {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.filter-panel.open {
  display: flex;
}

/* 單層篩選 panel（Prompt 技巧分頁用）：直接列選項按鈕，不再經過 select */
.filter-panel--list {
  padding: 6px 0;
  gap: 0;
}
.filter-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.filter-option:hover {
  background: rgba(91, 91, 214, 0.06);
}
.filter-option.active {
  background: rgba(91, 91, 214, 0.1);
  color: var(--primary);
  font-weight: 700;
}

/* page-header 底線下方的篩選提示：只在手機版 + 有選分類時顯示，桌機完全不出現 */
.filter-active-hint {
  display: none;          /* 桌機完全隱藏 */
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-light);
  margin: 10px 0 16px;
  padding: 6px 8px 6px 12px;
  background: rgba(91, 91, 214, 0.06);
  border-radius: 4px;
  line-height: 1.5;
}
.filter-active-hint-text {
  flex: 1;
  min-width: 0;
}
.filter-active-hint-clear {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  border-radius: 50%;
  transition: background 0.12s, color 0.12s;
}
.filter-active-hint-clear:hover {
  background: rgba(91, 91, 214, 0.15);
  color: var(--primary);
}

/* panel 開啟時的 invisible backdrop，攔截外部點擊 → 點到就關 panel 並吞掉點擊（不會誤觸下方文章） */
.filter-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
}
@media (max-width: 700px) {
  .filter-backdrop.active { display: block; }
}

/* 桌機預設：顯示 chip 版篩選、隱藏手機版的收合按鈕/panel */
.filter-chips-wrap { display: flex; flex-direction: column; gap: 8px; }
.filter-mobile-wrap { display: none; }
.page-header { position: relative; }
.page-header > .filter-toggle,
.page-header > .filter-panel { display: none; }
/* 桌機預設隱藏整個 filter-toggle-wrap（chip 模式處理桌機篩選 UI） */
.filter-toggle-wrap { display: none; }

/* 手機（≤700px）：按鈕用 flex 直接跟 h2 對齊在標題右側、panel 用 absolute 浮在 page-header 下方 */
@media (max-width: 700px) {
  .filter-chips-wrap { display: none; }
  /* Prompt 技巧分享的 chip 列表也隱藏，改用 h2 上的 .filter-toggle-wrap dropdown */
  .prompt-filters { display: none; }
  .page-header { margin-bottom: 4px; padding-bottom: 8px; }
  /* h2 改 flex，filter-toggle-wrap 自然落在標題右側、垂直置中對齊 */
  .page-header h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-right: 0;
  }
  /* wrapper 顯示成 inline-flex，position: relative 給 panel 當 absolute 參考框 */
  .filter-toggle-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
  }
  /* 手機版按鈕本體放大，方便點 */
  .filter-toggle {
    padding: 8px 16px;
    font-size: 14px;
    gap: 8px;
  }
  .filter-toggle-arrow {
    font-size: 12px;
  }

  /* panel 由 JS 搬到 body、用 position: fixed + getBoundingClientRect 動態定位，徹底脫離祖先 stacking 干擾 */
  /* 滾動時 panel 不跟著動（凍結在開啟瞬間的位置）；內容超過 viewport 高度時內部捲動（max-height 由 JS 算） */
  .filter-panel--floating.open {
    display: flex;
    position: fixed;
    z-index: 9999;
    width: 300px;
    max-width: calc(100vw - 32px);
    overflow-y: auto;            /* 超出時內部捲動，捲軸出現在右邊 */
    overscroll-behavior: contain;/* 滾到底不外傳，背後分頁不會動 */
    -webkit-overflow-scrolling: touch;
    padding: 18px;
    gap: 12px;
    background: #fff;
  }
  /* 單層 filter（Prompt）panel：寬度貼齊選項文字，但比雙層收斂一點 */
  .filter-panel--floating.filter-panel--list.open {
    width: auto;
    min-width: 200px;
    padding: 10px 0;
    gap: 0;
  }
  .filter-panel--floating .filter-row { width: 100%; gap: 12px; }
  /* 雙層 filter row：label 上、chip 列下，直向堆疊 */
  .filter-panel--floating .filter-row--stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .filter-panel--floating .filter-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 700;
  }
  /* 雙層 panel 的 chip 列：橫向 wrap，每顆 chip 觸控區 ≥ 38px、active 紫底白字 */
  .filter-panel--floating .filter-option-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }
  .filter-panel--floating .filter-option-chip {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;   /* 關掉 iOS 預設 tap 灰底 */
  }
  .filter-panel--floating .filter-option-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
  }
  .filter-panel--floating .filter-option-chip:active {
    background: rgba(91, 91, 214, 0.15);
  }
  .filter-panel--floating .filter-option-chip.active:active {
    background: var(--primary-dark);
  }
  /* 單層 panel 內的選項按鈕：高度 ≥ 52px 觸控更安全、選項間加細線分隔讓點擊區界線清楚 */
  .filter-panel--floating.filter-panel--list .filter-option {
    padding: 16px 26px;
    font-size: 17px;
  }
  .filter-panel--floating.filter-panel--list .filter-option + .filter-option {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
  }
  .filter-panel--floating.filter-panel--list .filter-option:active {
    background: rgba(91, 91, 214, 0.18);
  }
  /* 小三角原本在 top:-7px，會被 overflow-y: auto 切掉；改用 box-shadow + 按鈕視覺連續就足夠 */

  /* 篩選提示色塊只在手機版顯示 + 字級加大 */
  .filter-active-hint {
    display: flex;
    font-size: 14px;
    padding: 8px 10px 8px 14px;
    gap: 12px;
  }
  /* [hidden] 仍要壓回 none */
  .filter-active-hint[hidden] {
    display: none;
  }
  .filter-active-hint-clear {
    width: 32px;       /* hint ✕ 觸控區也拉到 32×32 */
    height: 32px;
    font-size: 16px;
  }

  /* 10 秒看趨勢列表第一張卡片的 padding 也縮，整體距離更緊湊 */
  .summary-list-item--compact { padding-top: 8px; padding-bottom: 8px; }
  /* filter-rows 容器在手機上沒實際內容（chips 隱藏、按鈕/panel 已被搬走），歸零 margin */
  .filter-rows { margin: 0; }
}

.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
  min-width: 100px;
}
.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.1);
}

/* ✕ 清除按鈕：只在篩選有值（不是「全部」）時顯示 */
.filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-light);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  margin-left: 4px;
  transition: all 0.15s;
}
.filter-clear:hover {
  background: var(--primary);
  color: #fff;
}
.filter-clear[hidden] {
  display: none;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-label {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 篩選 chip 改成單行橫向捲動，不換行、不擠壓、不爆版 */
.filter-row .chips {
  margin: 0;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}

.filter-row .chips::-webkit-scrollbar {
  display: none;
}

.summary-list-item .feed-tag {
  box-sizing: border-box;
}

.summary-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.summary-tags-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  margin-right: 6px;
}

.summary-tags-row .usecase-tag {
  color: var(--primary);
  font-size: 12px;
}

.summary-tags-row .usecase-tag:has(+ .usecase-tag)::after {
  content: '|';
  color: rgba(15, 23, 42, 0.18);
  margin: 0 8px;
  font-weight: 300;
}

.summary-list-item .chevron-icon {
  font-size: 26px;
  color: rgba(15, 23, 42, 0.25);
  padding: 0 32px 0 4px;
  align-self: center;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.2s, transform 0.2s;
}

.summary-list-item:hover .chevron-icon {
  color: var(--primary);
  transform: translateX(4px);
}

/* =========================================================
   Document Reader Mode (Homepage)
   Substack / Medium / Notion 風單欄置中閱讀版型
   ========================================================= */

.reader-flow {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

@media (max-width: 820px) {
  .reader-flow {
    padding: 20px 20px 40px;
    gap: 44px;
  }
}

.reader-flow .reader-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Masthead 跟 Overview 視覺上是同一個導讀群組 — 拉近距離 */
/* Masthead 跟首張 hero 拉近距離（reader-flow gap 56px 太鬆） */
.reader-header + .reader-section.reader-hero-section {
  margin-top: -28px;
}

/* --- Masthead --- */
.reader-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
  text-align: left;
}

.reader-issue-meta {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.reader-issue-meta::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--primary);
}

.reader-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0;
}

.reader-deck {
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-light);
  max-width: 640px;
  margin: 0;
  font-weight: 400;
}

@media (max-width: 820px) {
  .reader-title { font-size: 34px; }
  .reader-deck { font-size: 16px; }
}

/* --- Section Heading --- */
.reader-h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}

.reader-lead {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.7;
  margin: -8px 0 4px 0;
}

.reader-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
  width: 80px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.7;
}

.reader-section-cta {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

/* --- Overview: 趨勢數字 + 關鍵字 chips（左右並排） --- */
.reader-overview {
  flex-direction: row !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px !important;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.reader-trend-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  flex-shrink: 0;
  padding-right: 24px;
  border-right: 1px solid var(--border);
}

.reader-count-num {
  font-size: 64px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 0.9;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  text-align: right;
  min-width: 2ch;
}

.reader-count-unit {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.reader-keywords {
  display: flex;
  flex-direction: column;
  gap: 18px;       /* 涵蓋類型 ↔ 熱門情境 兩列之間給足呼吸感 */
  flex: 1;
  min-width: 0;
}

.reader-kw-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.reader-kw-axis {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.05em;
  color: var(--text);
  flex-shrink: 0;
  width: 76px;
  text-align: left;
  white-space: nowrap;
  position: relative;
  padding-left: 12px;
}

.reader-kw-axis::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 13px;
  background: var(--primary);
  border-radius: 2px;
}

/* 情境列：用淡紫色條區分 */
.reader-kw-row--usecase .reader-kw-axis::before {
  background: var(--accent-2);
}

/* 情境列關鍵字行高較小，axis 也跟著一致才會置中對齊 */
.reader-kw-row--usecase .reader-kw-axis {
  line-height: 1.3;
}

.reader-kw-chips {
  display: flex;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 4px;
  flex: 1;
  min-width: 0;
}

/* 情境列：inline 文字（無分隔符，靠 gap 分組） */
/* 涵蓋類型 — 迷你 bar chart 樣式（分類在左、bar 中間、篇數在右） */
.reader-kw-inline.reader-kw-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.reader-kw-bar-row {
  display: grid;
  grid-template-columns: 76px 1fr 28px;
  align-items: center;
  gap: 12px;
}
.reader-kw-bar-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.reader-kw-bar-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(91, 91, 214, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.reader-kw-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-2) 100%);
  border-radius: 999px;
}
.reader-kw-bar-num {
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.reader-kw-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  row-gap: 6px;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.reader-kw-link {
  display: inline-block;
  padding: 0;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-light);
  line-height: 1.35;
}

/* 類型列：tag 名加大加粗深色（主資訊） */
.reader-kw-row:not(.reader-kw-row--usecase) .reader-kw-link {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.reader-kw-row:not(.reader-kw-row--usecase) .reader-kw-inline {
  column-gap: 22px;
  row-gap: 2px;       /* 涵蓋類型 wrap 時行距收緊（原本 6px 太鬆） */
}

/* 熱門情境關鍵字：換行時行距縮小一點 */
.reader-kw-row--usecase .reader-kw-inline {
  row-gap: 2px;
}

.reader-kw-row--usecase .reader-kw-link {
  line-height: 1.3;
  padding: 0;
}

.reader-kw-link .kw-name {
  letter-spacing: -0.005em;
}

.reader-kw-link .kw-num {
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-left: 6px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.reader-kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.reader-kw-chip .kw-name {
  letter-spacing: -0.005em;
}

.reader-kw-chip .kw-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  background: rgba(15, 23, 42, 0.05);
  padding: 1px 8px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .reader-trend-count {
    padding-right: 0;
    border-right: none;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .reader-count-num { font-size: 36px; }
  .reader-kw-axis {
    width: auto;
  }
}

.reader-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.reader-link-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* --- Hero (override .hero-grid inside reader-flow) --- */
.reader-flow .hero-grid {
  grid-template-columns: 1fr;
  min-height: 0;
  gap: 14px;
}

.reader-flow .hero-main {
  min-height: 380px;
  border-radius: 12px;
}

.reader-flow .hero-main-content {
  padding: 24px 28px;
}

.reader-flow .hero-main-title {
  font-size: 28px;
  line-height: 1.25;
}

.reader-flow .hero-side {
  grid-template-rows: none;
  grid-template-columns: 1fr 1fr 1fr;
  min-height: 0;
  gap: 12px;
}

.reader-flow .hero-side .hero-small {
  min-height: 130px;
  border-radius: 10px;
}

.reader-flow .hero-side > .hero-small:first-child .hero-small-title {
  font-size: 14px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.reader-flow .hero-small-title {
  font-size: 13px;
}

@media (max-width: 600px) {
  .reader-flow .hero-side {
    grid-template-columns: 1fr;
  }
}

/* 行動版專屬視覺調整（桌機不套用）*/
@media (max-width: 700px) {
  /* 重點趨勢／Prompt／工具介紹的延伸閱讀（image card 版）：標題字級加大、tag 上下 padding 縮 */
  .related-card:not(.related-card--row) .related-title,
  .am-content .related-card:not(.related-card--row) .related-title {
    font-size: 16px;
    line-height: 1.5;
  }
  .related-card:not(.related-card--row) .related-tag {
    padding: 3px 10px;
  }

  /* 10 秒看趨勢延伸閱讀：手機版改 stacked — 日期+tag 縮成小字 inline 第一行，標題獨佔一行完整顯示 */
  .related-card.related-card--row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 12px 14px;
  }
  .related-card--row .related-tag {
    order: 1;
    justify-self: auto;
    margin: 0;
    font-size: 13px;
    padding: 3px 10px;
  }
  .related-card--row .related-date {
    order: 2;
    font-size: 13px;
    color: var(--text-light);
  }
  .related-card--row .related-title,
  .am-content .related-card--row .related-title {
    order: 3;
    flex: 1 1 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
  }

  /* 10秒分頁緊湊列表：箭頭靠右，收掉右邊空白 */
  .summary-list-item--compact {
    padding-right: 4px;
  }
  .summary-list-item--compact .chevron-icon {
    padding-right: 0;
  }
  /* 10秒分頁：tag + 日期 + 適用情境 改回堆疊在標題上方、靠左對齊 */
  .summary-list-item--compact .sli-compact-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  /* 手機版日期排回 tag 之後（tag 日期）*/
  .summary-list-item--compact .sli-date {
    order: 0;
  }
  /* 手機版 10 秒看趨勢分頁：tag 跟日期改成水平 flex 靠左對齊（覆寫桌機的 grid 置中 layout） */
  .summary-list-item--compact .sli-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
  }
  .summary-list-item--compact .sli-meta .feed-tag {
    justify-self: auto;
  }
  /* 手機版 masthead 跟 hero 也再多收一點 */
  .reader-header + .reader-section.reader-hero-section {
    margin-top: -20px;
  }

  /* 首頁四張大圖：每張圖區域跟第一則一樣大、標題字加大 */
  .reader-flow .hero-main {
    min-height: 240px;
  }
  .reader-flow .hero-main-content {
    padding: 20px 26px;
  }
  .reader-flow .hero-main-title {
    font-size: 24px;
    margin-top: 6px;       /* 手機版保留貼緊 tag 的緊湊感 */
  }
  .reader-flow .hero-side .hero-small {
    min-height: 240px;          /* 跟 hero-main 同高度，視覺上四張一樣大 */
  }
  .reader-flow .hero-small-content {
    padding: 20px 26px;
  }
  /* 三張小縮圖（非主圖）標題字大小跟 hero-main 一致，且不截行、完整顯示 */
  .reader-flow .hero-small-title,
  .reader-flow .hero-side > .hero-small:first-child .hero-small-title {
    font-size: 24px;
    line-height: 1.25;
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
  }
  /* 總則數搬到標題旁（JS 負責搬移），省去獨立一行 */
  .reader-title-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
  }
  .reader-title-row .reader-trend-count {
    padding: 0;
    border: none;
    width: auto;
  }
  .reader-title-row .reader-count-num {
    font-size: 32px;
  }
  /* 主標放大：右側仍有空間，避免被上方日期列搶走視覺 */
  .reader-title {
    font-size: 40px;
  }
  /* 標籤與關鍵字之間距離（比桌機略寬，但不要太開）*/
  .reader-kw-row {
    gap: 16px;
  }
  /* 歷期電子報分頁標題放大 */
  #page-archive .page-header h2 {
    font-size: 34px;
  }
}

/* --- TOC (本期重點) override --- */
.reader-flow .reader-toc {
  border-top: 1px solid var(--border);
}

.reader-flow .reader-toc .toc-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: padding-left 0.2s ease, background 0.2s ease;
  position: relative;
}

.reader-flow .reader-toc .toc-item:hover {
  padding-left: 8px;
  background: linear-gradient(90deg, rgba(91,91,214,0.04), transparent 70%);
}

.reader-flow .reader-toc .toc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.reader-flow .reader-toc .toc-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text);
  flex: 1;
}

.reader-flow .reader-toc .toc-item::after {
  content: '→';
  color: var(--text-light);
  opacity: 0;
  font-size: 16px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.reader-flow .reader-toc .toc-item:hover::after {
  opacity: 1;
  transform: translateX(4px);
}

.reader-flow .reader-toc .toc-prefix-tool {
  font-size: 11px;
  font-weight: 700;
  color: var(--tag-tool);
  background: rgba(245, 158, 11, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}

/* Hide the bottom "看更多" link injected by JS (we use reader-link-btn instead) */
.reader-flow .reader-toc > div:last-child[style*="flex-end"] {
  border-bottom: none;
  padding-top: 12px;
}

/* --- 10 秒看趨勢 list inside reader --- */
.reader-flow #weeklySummariesWrap {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.reader-flow .summary-list-item {
  border-bottom: 1px solid var(--border);
}

.reader-flow .summary-list-item:last-child {
  border-bottom: none;
}

.reader-flow .summary-list-item .chevron-icon {
  padding-right: 20px !important;
}

/* --- 內部 AI 工具 (2-col card grid) --- */
.reader-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .reader-tools {
    grid-template-columns: 1fr;
  }
}

.reader-tool-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 22px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.reader-tool-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91, 91, 214, 0.12);
}

.reader-tool-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.reader-tool-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.reader-tool-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.reader-tool-arrow {
  font-size: 20px;
  color: var(--text-light);
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.reader-tool-card:hover .reader-tool-arrow {
  color: var(--primary);
  transform: translateX(4px);
}

/* --- 黑客松水平時間軸 --- */
.reader-hack-timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin-top: 12px;
  position: relative;
  padding: 24px 0 8px;
}

.reader-hack-timeline::before {
  content: '';
  position: absolute;
  top: 30px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.reader-hack-timeline .hack-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding-top: 24px;
  z-index: 1;
}

.reader-hack-timeline .hack-step::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border-strong);
  box-sizing: border-box;
}

.reader-hack-timeline .hack-step.past::before {
  background: var(--primary);
  border-color: var(--primary);
}

.reader-hack-timeline .hack-step.current::before {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(91, 91, 214, 0.18);
  width: 16px;
  height: 16px;
}

.reader-hack-timeline .hack-step-date {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.reader-hack-timeline .hack-step-desc {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.45;
  max-width: 100px;
}

.reader-hack-timeline .hack-step.current .hack-step-date,
.reader-hack-timeline .hack-step.current .hack-step-desc {
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 600px) {
  .reader-hack-timeline {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 8px 0;
  }
  .reader-hack-timeline::before {
    display: none;
  }
  .reader-hack-timeline .hack-step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    padding-top: 0;
    padding-left: 28px;
    gap: 12px;
  }
  .reader-hack-timeline .hack-step::before {
    left: 0;
    top: 6px;
    transform: none;
  }
  /* 步驟原點之間補上垂直連貫線 */
  .reader-hack-timeline .hack-step::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 20px;
    bottom: -22px;
    width: 2px;
    background: var(--border);
  }
  .reader-hack-timeline .hack-step:last-child::after {
    display: none;
  }
  .reader-hack-timeline .hack-step-desc {
    max-width: none;
  }
}

/* =========================================================
   Outlook 版本產生器（隱藏 page #outlook-gen）
   ========================================================= */
.og-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

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

.og-controls, .og-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.og-field { margin-bottom: 14px; }

.og-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.og-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

.og-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.1);
}

/* 進頁面預設隱藏：期號 + 4 個篇數 row 等按了篩選日期才出現；status 等按了產出才出現 */
.og-controls .og-hidden { display: none !important; }

/* 篩選日期之下的期號 + 四個篇數顯示，inline 排版 + 突顯數字 */
.og-field.og-field--inline {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 13px;
  color: var(--text-light);
  padding: 3px 0;
  margin-bottom: 0;
  border-bottom: 1px dashed var(--border);
}
.og-field.og-field--inline:last-of-type {
  border-bottom: none;
}
.og-field.og-field--inline span {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 2px;
}

.og-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.og-btn {
  padding: 9px 16px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.og-btn--primary {
  background: var(--primary);
  color: #fff;
}

.og-btn--primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(91, 91, 214, 0.25);
}

.og-btn--ghost {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
}

.og-btn--ghost:hover {
  border-color: var(--primary);
}

.og-btn:disabled,
.og-btn:disabled:hover {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  box-shadow: none;
  border-color: var(--border);
}

.og-status {
  font-size: 12px;
  color: var(--text-light);
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 6px;
  margin-bottom: 16px;
}

.og-status.success { background: #ecfdf5; color: #059669; }
.og-status.error { background: #fef2f2; color: #dc2626; }

.og-help {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.7;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.og-help strong { color: var(--text); display: block; margin-bottom: 6px; }
.og-help ol { padding-left: 18px; margin: 0; }

.og-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.og-tab {
  padding: 8px 14px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.og-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.og-iframe {
  width: 100%;
  height: 720px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbfc;
}

.og-code {
  display: none;
  width: 100%;
  height: 720px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 11px;
  line-height: 1.5;
  resize: vertical;
  background: #1e293b;
  color: #94f5b3;
}

.og-iframe.hidden { display: none; }
.og-code.active { display: block; }

/* =========================================================
   行動版導覽（橫向捲動選單）+ 響應式間距
   ========================================================= */
@media (max-width: 700px) {
  .container {
    padding: 12px 16px 20px;
  }

  .topnav-inner {
    padding: 12px 16px;
    gap: 8px;
  }

  /* 網站名稱不換行 */
  .brand {
    flex-shrink: 0;
  }

  .logo {
    font-size: 18px;
  }

  .search-toggle {
    display: flex;
    margin-left: auto;
  }

  /* 搜尋框預設收起，點搜尋鈕才以浮層顯示（不擠版面）*/
  .searchbar {
    display: none;
  }

  .site-header.search-open .searchbar {
    display: block;
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    max-width: none;
    margin: 8px 0 0;
  }

  /* 選單：橫向捲動，下拉選單攤平成同一排 */
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* 用 mask 讓選單文字在右邊緣淡出（直接作用在元素本身，不會有圖層問題）*/
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  /* 群組之間的淡淡分隔線（取代原本的 | 字元）*/
  .tab-sep {
    font-size: 0;
    width: 1px;
    height: 16px;
    background: var(--border);
    align-self: center;
    flex-shrink: 0;
    margin: 0 2px;
  }

  .dropdown-toggle {
    display: none;
  }

  /* 下拉群組攤平：群組本身與內容都改成橫向 flex，子項直接排進選單列 */
  .nav-dropdown {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .dropdown-content,
  .nav-dropdown:hover .dropdown-content,
  .nav-dropdown.open .dropdown-content {
    display: flex;
    flex-direction: row;
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    min-width: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
  }

  .tab {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* 選單項目間距收窄，集中排列；子項不要撐滿寬度 */
  .tabs > .tab,
  .dropdown-item {
    width: auto;
    padding: 12px 9px;
    text-align: center;
  }

  /* 攤平後的下拉項目也要顯示 active 底線 */
  .dropdown-item.active::after {
    display: block !important;
    bottom: 0;
  }

  /* 捲離最左後，左邊緣也跟著淡出 */
  .tabs-wrap.nav-scrolled .tabs {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 44px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 44px), transparent);
  }

  /* 選單左右捲動按鈕：可點擊捲動選單 */
  .tabs-scroll {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
  }

  .tabs-scroll:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -4px;
  }

  .tabs-scroll-left {
    left: 0;
    display: none;
  }

  .tabs-scroll-right {
    right: 0;
  }

  /* 左鈕：捲離最左才出現；右鈕：捲到底就隱藏 */
  .tabs-wrap.nav-scrolled .tabs-scroll-left {
    display: flex;
  }

  .tabs-wrap.nav-at-end .tabs-scroll-right {
    display: none;
  }
}