/* ========== Reset & Base ========== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: "Microsoft JhengHei", "PingFang TC", "Heiti TC", Arial, sans-serif;
  font-size: 14px;
  color: #222;
  background: #f3f5f8;
  line-height: 1.5;
}
a { color: #163A2E; text-decoration: none; }
a:hover { color: #1B4332; text-decoration: underline; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 12px; }

/* ========== Top bar ========== */
.top-bar {
  background: #1a1a1a;
  color: #ccc;
  font-size: 12px;
  border-bottom: 2px solid #1B4332;
}
.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
}
.top-left .divider { margin: 0 8px; color: #555; }
.top-right a {
  color: #ddd;
  margin-left: 16px;
}
.top-right a:hover { color: #fff; text-decoration: none; }

/* ========== Logo bar ========== */
.logo-bar { background: #fff; border-bottom: 1px solid #e0e3e8; }
.logo-bar-inner {
  display: flex;
  align-items: center;
  height: 78px;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: baseline;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 1px;
}
.logo-bi {
  font-size: 34px;
  color: #1B4332;
  background: linear-gradient(180deg, #2D6A4F 0%, #0D2818 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-net {
  font-size: 34px;
  color: #163A2E;
}
.logo-ai {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #D4B884 0%, #8B6F47 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-left: 6px;
  align-self: center;
}
@media (max-width: 768px) { .logo-ai { font-size: 28px; } }
@media (max-width: 480px) { .logo-ai { font-size: 24px; } }
.logo-sub {
  margin-left: 12px;
  font-size: 12px;
  color: #888;
  font-weight: 400;
  letter-spacing: 0;
  align-self: center;
  border-left: 1px solid #ddd;
  padding-left: 12px;
}

.search-box {
  flex: 1;
  max-width: 520px;
  display: flex;
  border: 2px solid #1B4332;
  border-radius: 2px;
  overflow: hidden;
}
.search-box input {
  flex: 1;
  border: none;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}
.search-box button {
  background: #1B4332;
  color: #fff;
  border: none;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 600;
}
.search-box button:hover { background: #0D2818; }

.quick-links { display: flex; gap: 8px; }
.qlink {
  display: inline-block;
  padding: 6px 12px;
  background: #f3f5f8;
  border: 1px solid #d8dde4;
  border-radius: 2px;
  color: #444;
  font-size: 12px;
}
.qlink:hover { background: #e8edf3; color: #163A2E; text-decoration: none; }

/* ========== Main nav ========== */
.main-nav {
  background: linear-gradient(180deg, #163A2E 0%, #0A1F18 100%);
  border-bottom: 3px solid #1B4332;
}
.main-nav ul {
  display: flex;
  flex-wrap: wrap;
}
.main-nav li a {
  display: block;
  padding: 12px 18px;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.main-nav li a:hover {
  background: #1B4332;
  text-decoration: none;
}
.main-nav li.active a {
  background: #1B4332;
}

/* ========== Ticker ========== */
.ticker {
  background: #fff8e1;
  border-bottom: 1px solid #f0d77a;
  display: flex;
  align-items: center;
  height: 36px;
  overflow: hidden;
}
.ticker-label {
  background: #1B4332;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.ticker-track {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  padding-left: 16px;
  font-size: 13px;
}
.ticker-track .tk-item { display: inline-block; margin-right: 32px; }
.ticker-track .tk-code { font-weight: 600; margin-right: 6px; }
.ticker-track .tk-price { margin-right: 4px; }

/* ========== Main grid ========== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  padding-top: 20px;
  padding-bottom: 40px;
}
@media (max-width: 920px) {
  .main-grid { grid-template-columns: 1fr; }
}

/* ========== Panels ========== */
.panel {
  background: #fff;
  border: 1px solid #e0e3e8;
  border-radius: 4px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 2px solid #163A2E;
  background: linear-gradient(180deg, #f8fafd 0%, #eef2f7 100%);
}
.panel-head h2 {
  font-size: 17px;
  color: #163A2E;
  border-left: 4px solid #1B4332;
  padding-left: 10px;
}
.panel-head h3 {
  font-size: 15px;
  color: #163A2E;
  border-left: 4px solid #1B4332;
  padding-left: 10px;
}
.panel-head .more { font-size: 12px; color: #666; }
.panel-foot {
  padding: 10px 16px;
  border-top: 1px solid #eee;
  font-size: 12px;
  color: #777;
  background: #fafbfc;
}
.panel-tabs { display: flex; gap: 4px; }
.tab {
  background: #fff;
  border: 1px solid #d0d5dc;
  padding: 4px 12px;
  font-size: 12px;
  color: #555;
  border-radius: 2px;
}
.tab.active {
  background: #163A2E;
  color: #fff;
  border-color: #163A2E;
}
.tab:hover:not(.active) { background: #f0f3f8; }

/* ========== Stock table ========== */
.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stock-table th {
  background: #f3f5f8;
  color: #555;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e0e3e8;
}
.stock-table th.num { text-align: right; }
.stock-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef0f3;
}
.stock-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.stock-table tr:hover { background: #fff8e1; }
.stock-table .code { font-weight: 600; color: #163A2E; }
.stock-table .name { font-weight: 500; }
/* 台股慣例：漲紅跌綠（與品牌色解耦） */
.up { color: #EF4444 !important; font-weight: 600; }
.down { color: #16A34A !important; font-weight: 600; }
.flat { color: #666 !important; }
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.status-興櫃 { background: #fde7eb; color: #EF4444; }
.status-未上市 { background: #e6efff; color: #163A2E; }
.status-準上市 { background: #fff4d6; color: #b07b00; }
.add-btn {
  background: none;
  border: 1px solid #d0d5dc;
  color: #666;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
}
.add-btn:hover { background: #163A2E; color: #fff; border-color: #163A2E; }

.loading { text-align: center; color: #999; padding: 28px !important; }

/* ========== News list ========== */
.news-list li {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid #eef0f3;
  font-size: 14px;
}
.news-list li:last-child { border-bottom: none; }
.news-list li:hover { background: #f8fafd; }
.news-time {
  color: #999;
  font-size: 12px;
  width: 56px;
  flex-shrink: 0;
}
.news-tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 2px;
  margin-right: 10px;
  flex-shrink: 0;
}
.news-tag.熱門 { background: #1B4332; color: #fff; }
.news-tag.焦點 { background: #ff8a00; color: #fff; }
.news-tag.公告 { background: #163A2E; color: #fff; }
.news-tag.個股 { background: #1a8e3e; color: #fff; }
.news-tag.週評 { background: #6c5ce7; color: #fff; }
.news-tag.抽籤 { background: #00a8a8; color: #fff; }
.news-title { color: #222; }

/* ========== Side panels ========== */
.side-panel .panel-head { padding: 10px 14px; }

.topic-list {
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.topic-list li {
  background: #f3f5f8;
  border: 1px solid #e0e3e8;
  padding: 5px 10px;
  border-radius: 14px;
  font-size: 12px;
  color: #444;
  cursor: pointer;
}
.topic-list li:hover { background: #1B4332; color: #fff; border-color: #1B4332; }

.ad-box .ad-tag {
  font-size: 11px;
  color: #999;
  padding: 4px 10px;
  border-bottom: 1px dashed #eee;
}
.ad-body { padding: 16px 14px; }
.ad-title { font-weight: 700; color: #163A2E; font-size: 15px; margin-bottom: 6px; }
.ad-body p { font-size: 12px; color: #666; margin-bottom: 12px; }
.btn-primary {
  background: #1B4332;
  color: #fff;
  border: none;
  padding: 8px 16px;
  width: 100%;
  font-size: 13px;
  font-weight: 600;
  border-radius: 2px;
}
.btn-primary:hover { background: #0D2818; }

.ipo-list li {
  padding: 10px 14px;
  border-bottom: 1px solid #eef0f3;
}
.ipo-list li:last-child { border-bottom: none; }
.ipo-name { font-weight: 600; color: #163A2E; font-size: 13px; }
.ipo-info { font-size: 12px; color: #777; margin-top: 2px; }

.line-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}
.line-icon {
  background: #06c755;
  color: #fff;
  font-weight: 700;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}
.line-box p { font-size: 12px; color: #555; margin-bottom: 6px; }
.btn-line {
  background: #06c755;
  color: #fff;
  border: none;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 2px;
  font-weight: 600;
}
.btn-line:hover { background: #05a548; }

/* ========== Footer ========== */
.site-footer {
  background: #1a1a1a;
  color: #aaa;
  font-size: 13px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 32px 12px;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-logo {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.site-footer h4 {
  color: #fff;
  font-size: 14px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
}
.site-footer ul li { margin-bottom: 6px; }
.site-footer a { color: #aaa; font-size: 13px; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.copyright {
  background: #0d0d0d;
  padding: 14px 0;
  text-align: center;
  font-size: 12px;
  color: #777;
  border-top: 1px solid #2a2a2a;
}

/* ========== Sub-page common ========== */
.page-head {
  background: #fff;
  border-bottom: 1px solid #e0e3e8;
  padding: 18px 0;
}
.page-head h1 {
  font-size: 22px;
  color: #163A2E;
  border-left: 5px solid #1B4332;
  padding-left: 12px;
}
.breadcrumb {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  padding-left: 17px;
}

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: #f8fafd;
  border-bottom: 1px solid #e0e3e8;
  flex-wrap: wrap;
}
.filter-bar label { font-size: 13px; color: #555; }
.filter-bar select, .filter-bar input {
  padding: 6px 10px;
  border: 1px solid #d0d5dc;
  border-radius: 2px;
  font-size: 13px;
  outline: none;
}

/* discussion */
.thread-list li {
  display: grid;
  grid-template-columns: 80px 1fr 100px 80px 110px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eef0f3;
  font-size: 13px;
}
.thread-list li:hover { background: #f8fafd; }
.thread-cat {
  background: #163A2E;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  text-align: center;
  width: fit-content;
}
.thread-title { font-weight: 500; }
.thread-author, .thread-replies, .thread-time { color: #777; font-size: 12px; }
.thread-replies { color: #1B4332; font-weight: 600; }

/* tutorial */
.tutorial-content {
  padding: 24px 28px;
  line-height: 1.9;
  color: #333;
}
.tutorial-content h2 {
  font-size: 18px;
  color: #163A2E;
  margin: 24px 0 12px;
  padding-left: 10px;
  border-left: 4px solid #1B4332;
}
.tutorial-content h2:first-child { margin-top: 0; }
.tutorial-content p { margin-bottom: 12px; }
.tutorial-content ol, .tutorial-content ul {
  margin-left: 24px;
  margin-bottom: 12px;
}
.tutorial-content ol li, .tutorial-content ul li {
  list-style: decimal;
  margin-bottom: 6px;
}
.tutorial-content ul li { list-style: disc; }
.tip-box {
  background: #fff8e1;
  border-left: 4px solid #f0a800;
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 2px;
}

/* ========== AI 今日盤勢警報（進站彈窗）========== */
.ai-alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 31, 24, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
  pointer-events: none;
}
.ai-alert-overlay.visible { opacity: 1; pointer-events: auto; }
.ai-alert-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}
.ai-alert-overlay.visible .ai-alert-modal { transform: translateY(0) scale(1); }
.ai-alert-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s;
}
.ai-alert-close:hover { background: rgba(255,255,255,0.3); }

.ai-alert-header {
  background: linear-gradient(135deg, #0A1F18 0%, #1B4332 60%, #2D6A4F 100%);
  color: #fff;
  padding: 26px 28px;
  border-radius: 16px 16px 0 0;
  position: relative;
  overflow: hidden;
}
.ai-alert-header::before {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, #C5A572 0%, transparent 60%);
  opacity: 0.4;
  pointer-events: none;
}
.ai-alert-eyebrow {
  font-size: 11px;
  color: #C5A572;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  font-weight: 700;
  text-transform: uppercase;
  position: relative;
}
.ai-alert-modal h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
  position: relative;
}
.ai-alert-date {
  font-size: 12px;
  opacity: 0.78;
  position: relative;
}
.ai-alert-body { padding: 10px 18px; }
.ai-alert-item {
  display: flex;
  gap: 14px;
  padding: 14px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  align-items: flex-start;
}
.ai-alert-item:hover {
  background: #f7f4ec;
  text-decoration: none;
}
.ai-alert-rank {
  font-size: 20px;
  font-weight: 800;
  color: #C5A572;
  letter-spacing: 1px;
  flex-shrink: 0;
  width: 30px;
  text-align: center;
  line-height: 1.4;
}
.ai-alert-content { flex: 1; min-width: 0; }
.ai-alert-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.ai-alert-row strong {
  color: #1B4332;
  font-size: 15px;
}
.ai-alert-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.ai-alert-tag.tag-strong { background: #fef3c7; color: #92400e; }
.ai-alert-tag.tag-tech { background: #dbeafe; color: #1e40af; }
.ai-alert-tag.tag-policy { background: #fee2e2; color: #991b1b; }
.ai-alert-content p {
  font-size: 13px;
  color: #555;
  line-height: 1.55;
  margin: 0;
}
.ai-alert-footer {
  display: flex;
  gap: 8px;
  padding: 14px 20px 12px;
  background: #faf8f3;
  border-top: 1px solid #eee5d4;
}
.ai-alert-btn {
  flex: 1;
  text-align: center;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.ai-alert-btn.primary {
  background: linear-gradient(135deg, #D4B884 0%, #8B6F47 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(197, 165, 114, 0.4);
}
.ai-alert-btn.primary:hover {
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 6px 18px rgba(197, 165, 114, 0.5);
}
.ai-alert-btn.line {
  background: #06c755;
  color: #fff;
}
.ai-alert-btn.line:hover { background: #05a548; text-decoration: none; color: #fff; }
.ai-alert-disclaimer {
  font-size: 11px;
  color: #999;
  text-align: center;
  padding: 0 20px 16px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .ai-alert-overlay { padding: 12px; }
  .ai-alert-modal { border-radius: 12px; }
  .ai-alert-header { padding: 20px 22px; border-radius: 12px 12px 0 0; }
  .ai-alert-modal h2 { font-size: 17px; }
  .ai-alert-body { padding: 6px 10px; }
  .ai-alert-item { padding: 12px 6px; gap: 10px; }
  .ai-alert-rank { font-size: 18px; width: 26px; }
  .ai-alert-row strong { font-size: 14px; }
  .ai-alert-content p { font-size: 12px; }
  .ai-alert-footer { flex-direction: column; gap: 8px; padding: 14px 14px 10px; }
  .ai-alert-disclaimer { padding: 0 14px 14px; }
}

/* ========== PWA 安裝橫幅 ========== */
.pwa-install-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 100%);
  color: #fff;
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  z-index: 998;
  max-width: 92%;
  font-size: 14px;
  transition: transform 0.4s ease;
  border: 1px solid rgba(197, 165, 114, 0.3);
}
.pwa-install-banner.show { transform: translateX(-50%) translateY(0); }
.pwa-install-banner .pwa-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #D4B884, #C5A572);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.pwa-install-banner .pwa-text {
  flex: 1;
  line-height: 1.4;
}
.pwa-install-banner .pwa-text strong { display: block; font-weight: 700; }
.pwa-install-banner .pwa-text small { font-size: 11px; opacity: 0.78; }
.pwa-install-banner button {
  background: #C5A572;
  color: #0A1F18;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.pwa-install-banner button:hover { background: #D4B884; }
.pwa-install-banner .pwa-dismiss {
  background: transparent;
  color: rgba(255,255,255,0.5);
  padding: 6px 10px;
  font-size: 16px;
}
.pwa-install-banner .pwa-dismiss:hover { color: #fff; background: transparent; }
@media (max-width: 480px) {
  .pwa-install-banner {
    bottom: 76px;
    padding: 10px 12px;
    font-size: 13px;
    width: calc(100% - 16px);
  }
  .pwa-install-banner .pwa-icon { width: 32px; height: 32px; font-size: 18px; }
}

/* ========== Hero 區塊（首頁品牌主視覺）========== */
.hero {
  background: linear-gradient(135deg, #0A1F18 0%, #163A2E 40%, #1B4332 100%);
  color: #fff;
  padding: 50px 0 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -50px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #C5A572 0%, transparent 60%);
  opacity: 0.22;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -60px;
  left: 8%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #2D6A4F 0%, transparent 60%);
  opacity: 0.28;
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-block;
  background: rgba(197, 165, 114, 0.15);
  border: 1px solid rgba(197, 165, 114, 0.4);
  color: #C5A572;
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.hero-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}
.hero-title .accent {
  background: linear-gradient(135deg, #C5A572 0%, #2D6A4F 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 15px;
  opacity: 0.88;
  margin-bottom: 22px;
  line-height: 1.75;
}
.hero-stats {
  display: flex;
  gap: 28px;
  margin-bottom: 26px;
  font-size: 12px;
  opacity: 0.9;
}
.hero-stats > div { line-height: 1.3; }
.hero-stats strong {
  display: block;
  color: #C5A572;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 2px;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-btn {
  padding: 12px 24px;
  border-radius: 26px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}
.hero-btn.primary {
  background: #C5A572;
  color: #0A1F18;
  box-shadow: 0 4px 20px rgba(197, 165, 114, 0.4);
}
.hero-btn.primary:hover {
  background: #fff;
  color: #163A2E;
  text-decoration: none;
  transform: translateY(-2px);
}
.hero-btn.ghost {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
}
.hero-btn.ghost:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none;
}
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  animation: heroCardFloat 6s ease-in-out infinite;
}
.hero-card:nth-child(2) { animation-delay: -2s; transform: translateX(20px); }
.hero-card:nth-child(3) { animation-delay: -4s; }
@keyframes heroCardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.hero-card .hc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.hero-card .hc-name { font-weight: 700; }
.hero-card .hc-price { font-size: 20px; font-weight: 700; }
.hero-card .hc-pct { color: #EF4444; font-size: 13px; font-weight: 600; }
.hero-card .hc-ai {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255,255,255,0.18);
  font-size: 11px;
  opacity: 0.78;
}
.hero-card .hc-ai::before { content: "✨ "; filter: drop-shadow(0 0 4px #C5A572); }

@media (max-width: 768px) {
  .hero { padding: 28px 0 36px; }
  .hero-inner { grid-template-columns: 1fr; gap: 20px; }
  .hero-title { font-size: 26px; }
  .hero-sub { font-size: 14px; line-height: 1.65; }
  .hero-stats { gap: 16px; font-size: 11px; }
  .hero-stats strong { font-size: 18px; }
  .hero-btn { padding: 10px 18px; font-size: 13px; }
  .hero-card:nth-child(2) { transform: none; }
}

/* ========== AI placeholder area（電光綠＋深紫 = AI 科技感）========== */
.ai-panel {
  background: linear-gradient(135deg, #faf5ff 0%, #f0fdf4 50%, #f3e8ff 100%);
  border: 1px solid #e9d5ff;
  border-radius: 8px;
  padding: 16px;
  margin: 16px;
  position: relative;
  overflow: hidden;
}
.ai-panel::before {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, #C5A572 0%, transparent 70%);
  opacity: 0.18;
  pointer-events: none;
}
.ai-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
}
.ai-panel-title {
  font-weight: 700;
  color: #163A2E;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-panel-title::before {
  content: "✨";
  margin-right: 2px;
  filter: drop-shadow(0 0 6px #C5A572);
}
.ai-trigger {
  background: linear-gradient(135deg, #163A2E 0%, #1B4332 50%, #C5A572 130%);
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(27, 67, 50, 0.3);
  position: relative;
}
.ai-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(197, 165, 114, 0.4);
}
.ai-placeholder { color: #888; font-size: 13px; }
.ai-result {
  background: #fff;
  border: 1px solid #e8ecf2;
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.8;
}
.ai-result-head {
  font-weight: 700;
  color: #163A2E;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e8ecf2;
}
.ai-result p { margin-bottom: 6px; }
.ai-disclaimer { color: #999; font-size: 11px; margin-top: 8px; }
.ai-loading { color: #888; font-size: 13px; padding: 12px; }
.ai-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: #163A2E;
  border-radius: 50%;
  margin: 0 2px;
  animation: aibounce 1.4s infinite ease-in-out;
}
.ai-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes aibounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}
.add-btn.in-fav {
  background: #163A2E;
  color: #fff;
  border-color: #163A2E;
}

/* ========== Stock detail page ========== */
.stock-hero {
  background: #fff;
  border-bottom: 1px solid #e0e3e8;
  padding: 24px 0;
}
.stock-hero-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
}
@media (max-width: 760px) { .stock-hero-inner { grid-template-columns: 1fr; } }
.stock-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.stock-name-big { font-size: 26px; font-weight: 700; color: #163A2E; }
.stock-code-big { font-size: 18px; color: #888; }
.stock-meta { font-size: 12px; color: #666; }
.stock-meta .status-pill { vertical-align: middle; }

.stock-price-block { display: flex; align-items: baseline; gap: 16px; margin-top: 14px; }
.stock-price-big { font-size: 40px; font-weight: 700; }
.stock-change-big { font-size: 18px; font-weight: 600; }

.stock-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
  background: #f8fafd;
  border: 1px solid #e8ecf2;
  border-radius: 4px;
  padding: 12px;
}
.qs-item { text-align: center; }
.qs-label { font-size: 11px; color: #888; }
.qs-value { font-size: 16px; font-weight: 600; color: #333; margin-top: 2px; }

.stock-action-row { display: flex; gap: 8px; margin-top: 16px; }
.stock-action-row button {
  padding: 8px 18px;
  border-radius: 4px;
  border: 1px solid #d0d5dc;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #444;
}
.stock-action-row button:hover { background: #f0f3f8; }
.stock-action-row .btn-primary { background: #1B4332; color: #fff; border-color: #1B4332; width: auto; }
.stock-action-row .btn-primary:hover { background: #0D2818; }

/* K 線 chart */
.kchart-wrap {
  background: #fff;
  border: 1px solid #e0e3e8;
  border-radius: 4px;
  padding: 12px;
  height: 220px;
  position: relative;
}
.kchart-canvas { width: 100%; height: 100%; display: block; }

/* 詳情頁 tab nav */
.detail-tabs {
  display: flex;
  border-bottom: 2px solid #163A2E;
  background: #fff;
  padding: 0 16px;
  margin-top: 20px;
}
.detail-tabs button {
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  color: #555;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.detail-tabs button.active {
  color: #1B4332;
  font-weight: 700;
  border-bottom-color: #1B4332;
}
.detail-tabs button:hover { background: #f8fafd; }

.detail-section { display: none; padding: 16px 20px; background: #fff; }
.detail-section.active { display: block; }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  font-size: 13px;
}
@media (max-width: 600px) { .info-grid { grid-template-columns: 1fr; } }
.info-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  border-bottom: 1px solid #eef0f3;
}
.info-label {
  background: #f8fafd;
  padding: 10px 12px;
  color: #666;
  font-weight: 500;
  border-right: 1px solid #eef0f3;
}
.info-value { padding: 10px 12px; color: #333; }

.fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.fin-table th, .fin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f3;
  text-align: left;
}
.fin-table th { background: #f8fafd; color: #555; font-weight: 600; }
.fin-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 會員 / 表單 */
.form-card {
  max-width: 440px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid #e0e3e8;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  padding: 32px;
}
.form-card h2 {
  font-size: 22px;
  color: #163A2E;
  text-align: center;
  margin-bottom: 8px;
}
.form-card .form-sub {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-bottom: 24px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d5dc;
  border-radius: 3px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.form-group input:focus { border-color: #163A2E; }
.form-btn {
  width: 100%;
  background: #1B4332;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 3px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
}
.form-btn:hover { background: #0D2818; }
.form-foot {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: #666;
}

/* VIP 方案 */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px;
}
@media (max-width: 760px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card {
  background: #fff;
  border: 1px solid #e0e3e8;
  border-radius: 6px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
}
.plan-card.featured {
  border: 2px solid #1B4332;
  box-shadow: 0 8px 24px rgba(200,16,46,0.12);
  transform: translateY(-6px);
}
.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #1B4332;
  color: #fff;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.plan-name { font-size: 16px; color: #888; margin-bottom: 8px; }
.plan-price {
  font-size: 36px;
  font-weight: 700;
  color: #163A2E;
  margin-bottom: 4px;
}
.plan-price small { font-size: 14px; color: #888; font-weight: 400; }
.plan-feat {
  margin: 20px 0;
  text-align: left;
}
.plan-feat li {
  padding: 6px 0;
  font-size: 13px;
  color: #444;
  border-bottom: 1px dashed #eef0f3;
}
.plan-feat li::before { content: "✓"; color: #1a8e3e; margin-right: 8px; font-weight: 700; }

/* IPO 表格 */
.ipo-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ipo-table th { background: #163A2E; color: #fff; padding: 12px; text-align: left; font-weight: 600; }
.ipo-table td { padding: 12px; border-bottom: 1px solid #eef0f3; }
.ipo-table tr:hover { background: #fff8e1; }
.btn-apply {
  background: #1B4332; color: #fff; border: none;
  padding: 5px 12px; border-radius: 2px; font-size: 12px; font-weight: 600;
}
.btn-apply:hover { background: #0D2818; }
.btn-apply.disabled { background: #ccc; cursor: not-allowed; }

/* QR / download */
.qr-card {
  background: #fff;
  border: 1px solid #e0e3e8;
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  max-width: 360px;
  margin: 16px auto;
}
.qr-box {
  width: 180px;
  height: 180px;
  background: repeating-conic-gradient(#000 0% 25%, #fff 25% 50%);
  margin: 16px auto;
  border: 8px solid #fff;
  box-shadow: 0 0 0 2px #ddd;
}

/* ============================================================
 * Mobile RWD - 全站行動裝置適配
 * 斷點：768px (平板) / 480px (手機)
 * ============================================================ */

/* 漢堡按鈕 (預設隱藏，行動裝置才顯示) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  padding: 10px 14px;
  cursor: pointer;
}

@media (max-width: 768px) {
  /* 頂部 top-bar：壓縮 */
  .top-bar-inner {
    height: auto;
    padding: 4px 0;
    flex-direction: column;
    gap: 2px;
  }
  .top-left, .top-right { font-size: 11px; }
  .top-right a { margin-left: 8px; }

  /* Logo 列 */
  .logo-bar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 12px;
  }
  .logo-bi, .logo-net { font-size: 28px; }
  .logo-sub { display: none; }
  .search-box {
    order: 3;
    width: 100%;
    max-width: none;
  }
  .search-box input { padding: 8px 10px; font-size: 13px; }
  .quick-links { display: none; }

  /* 主選單變漢堡 */
  .menu-toggle { display: block; }
  .main-nav { position: relative; }
  .main-nav .container { padding: 0; }
  .main-nav ul {
    display: none;
    flex-direction: column;
    background: #0A1F18;
    width: 100%;
  }
  .main-nav.open ul { display: flex; }
  .main-nav li a {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 14px 18px;
    font-size: 14px;
  }
  .main-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 6px;
  }
  .main-nav-bar .nav-label {
    color: #fff;
    font-size: 14px;
    padding: 12px 14px;
    font-weight: 600;
  }

  /* 跑馬燈 */
  .ticker { height: 32px; }
  .ticker-label { font-size: 11px; padding: 6px 10px; }
  .ticker-track { font-size: 11px; }

  /* 主要 grid 變單欄 */
  .main-grid, .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .col-side { display: flex; flex-direction: column; gap: 12px; }

  /* ipo / fin 表格仍用橫向滾動 */
  .ipo-table, .fin-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* 股票表格：手機改成卡片式 */
  .stock-table {
    display: block;
    background: transparent;
    padding: 0;
    white-space: normal;
  }
  .stock-table thead { display: none; }
  .stock-table tbody, .stock-table tr { display: block; }
  .stock-table tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 10px;
    row-gap: 4px;
    align-items: baseline;
    background: #fff;
    border: 1px solid #eef0f3 !important;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 8px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
  }
  .stock-table tr:hover, .stock-table tr:active {
    background: #fafbfc;
  }
  .stock-table td {
    display: block;
    padding: 0 !important;
    border: none !important;
    white-space: normal;
  }
  /* 第 1 欄：代號 */
  .stock-table td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    font-weight: 700;
    color: #163A2E;
    font-size: 15px;
  }
  .stock-table td:nth-child(1) a { color: inherit; text-decoration: none; }
  /* 第 2 欄：名稱 */
  .stock-table td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    font-size: 15px;
    color: #222;
  }
  /* 第 3 欄：成交價 → 右上角大字 */
  .stock-table td:nth-child(3) {
    grid-column: 3;
    grid-row: 1 / span 2;
    text-align: right;
    font-size: 22px !important;
    font-weight: 700;
    line-height: 1.1;
    align-self: center;
  }
  /* 第 4 欄：漲跌、第 5 欄：漲跌幅 → 合併右下 */
  .stock-table td:nth-child(4) {
    grid-column: 3;
    grid-row: 3;
    text-align: right;
    font-size: 13px !important;
  }
  .stock-table td:nth-child(5) {
    grid-column: 3;
    grid-row: 4;
    text-align: right;
    font-size: 12px !important;
    margin-top: -2px;
  }
  /* 第 6 欄：成交量 → 左下，加標籤 */
  .stock-table td:nth-child(6) {
    grid-column: 1 / span 2;
    grid-row: 3;
    font-size: 11px;
    color: #888;
  }
  .stock-table td:nth-child(6)::before {
    content: "量 ";
    color: #aaa;
  }
  /* 第 7 欄：類別、第 8 欄：狀態 → 左中 */
  .stock-table td:nth-child(7) {
    grid-column: 1 / span 2;
    grid-row: 2;
    font-size: 11px;
    color: #666;
  }
  .stock-table td:nth-child(8) {
    grid-column: 1 / span 2;
    grid-row: 2;
    padding-left: 60px !important;
    font-size: 11px;
  }
  .stock-table td:nth-child(8) .status-pill {
    padding: 1px 7px;
    font-size: 10px;
  }
  /* 第 9 欄：自選按鈕 → 左下對齊 */
  .stock-table td:nth-child(9) {
    grid-column: 1 / span 2;
    grid-row: 4;
    padding-top: 4px !important;
  }
  .stock-table .add-btn {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 12px;
  }

  /* 漲跌價的紅綠在卡片上更顯眼 */
  .stock-table td.up { color: #EF4444 !important; }
  .stock-table td.down { color: #16A34A !important; }

  /* 公告/IPO 表格也要橫向滾 */
  .ipo-table th, .ipo-table td,
  .fin-table th, .fin-table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* 面板間距 */
  .panel-head {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .panel-head h2 { font-size: 15px; }
  .panel-head h3 { font-size: 14px; }
  .panel-tabs {
    flex-wrap: wrap;
    width: 100%;
  }
  .tab { font-size: 11px; padding: 3px 8px; }

  /* 個股詳情頁 hero */
  .stock-hero { padding: 16px 0; }
  .stock-hero-inner {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .stock-name-big { font-size: 22px; }
  .stock-code-big { font-size: 15px; }
  .stock-price-big { font-size: 32px; }
  .stock-change-big { font-size: 15px; }
  .stock-quick-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }
  .stock-action-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .stock-action-row button {
    padding: 6px 12px;
    font-size: 12px;
    flex: 1;
    min-width: 0;
  }

  /* 詳情頁 tab */
  .detail-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 0;
  }
  .detail-tabs button {
    padding: 10px 14px;
    font-size: 13px;
    flex-shrink: 0;
  }
  .detail-section { padding: 12px 14px; }

  /* 基本資料 grid */
  .info-grid { grid-template-columns: 1fr !important; }
  .info-row { grid-template-columns: 90px 1fr; }
  .info-label { padding: 8px 10px; font-size: 12px; }
  .info-value { padding: 8px 10px; font-size: 12px; }

  /* 討論串列表 */
  .thread-list li {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 14px;
  }
  .thread-list .thread-cat {
    grid-column: auto;
    width: fit-content;
  }
  .thread-list .thread-author,
  .thread-list .thread-replies,
  .thread-list .thread-time {
    display: inline-block;
    margin-right: 12px;
  }

  /* 表單卡 */
  .form-card {
    padding: 20px 16px;
    margin: 20px 8px;
  }

  /* VIP 方案 */
  .plan-grid { grid-template-columns: 1fr; }
  .plan-card.featured { transform: none; }

  /* 頁面標題 */
  .page-head { padding: 12px 0; }
  .page-head h1 { font-size: 18px; padding-left: 10px; }
  .breadcrumb { font-size: 11px; padding-left: 14px; }

  /* 篩選列 */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .filter-bar label { font-size: 12px; }
  .filter-bar select, .filter-bar input {
    width: 100%;
    font-size: 13px;
  }

  /* 教學內容 */
  .tutorial-content {
    padding: 16px 14px;
    font-size: 13px;
    line-height: 1.7;
  }
  .tutorial-content h2 { font-size: 15px; margin: 16px 0 8px; }

  /* AI 區塊 */
  .ai-panel { padding: 12px; margin: 12px; }
  .ai-panel-head { flex-direction: column; align-items: stretch; gap: 6px; }
  .ai-trigger { width: 100%; padding: 8px; }
}

@media (max-width: 480px) {
  body { font-size: 13px; }
  .container { padding: 0 8px; }
  .logo-bi, .logo-net { font-size: 24px; }
  .stock-price-big { font-size: 28px; }
  .ticker-label { display: none; }

  /* 大標題縮小 */
  .panel-head h2 { font-size: 14px; }

  /* 按鈕 */
  .btn-primary { padding: 8px 14px; font-size: 13px; }

  /* 表單按鈕 */
  .form-btn { padding: 10px; font-size: 14px; }
}

/* ============================================================
 * 底部 Tab Bar（手機限定，由 JS 注入 .bottom-tab-bar）
 * ============================================================ */
.bottom-tab-bar { display: none; }

@media (max-width: 768px) {
  .bottom-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e0e3e8;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-tab-bar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0 6px;
    text-decoration: none;
    color: #999;
    font-size: 11px;
    line-height: 1;
    transition: color 0.2s;
    min-height: 56px;
  }
  .bottom-tab-bar a:hover { text-decoration: none; }
  .bottom-tab-bar a.active {
    color: #1B4332;
  }
  .bottom-tab-bar a.active .tab-icon {
    transform: scale(1.12);
  }
  .bottom-tab-bar .tab-icon {
    display: block;
    font-size: 22px;
    margin-bottom: 3px;
    transition: transform 0.2s;
  }
  .bottom-tab-bar .tab-label {
    font-size: 11px;
    font-weight: 500;
  }
  /* 為底部 tab 預留空間 */
  body { padding-bottom: 64px; }
  /* footer 在手機版隱藏（被 tab bar 取代） */
  .site-footer .footer-grid { display: none; }
  .site-footer .copyright {
    background: transparent;
    color: #999;
    font-size: 10px;
    padding: 8px 0;
    border-top: 1px solid #eef0f3;
  }
}

/* ============================================================
 * 可收合 Header（手機限定，由 JS 切換 .header-hidden class）
 * ============================================================ */
@media (max-width: 768px) {
  .top-bar, .logo-bar, .main-nav, .ticker {
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease;
    overflow: hidden;
  }
  body.header-hidden .top-bar {
    max-height: 0;
    opacity: 0;
    padding: 0 !important;
    border-bottom: none;
  }
  body.header-hidden .top-bar > * { display: none; }
  body.header-hidden .logo-bar-inner {
    padding: 8px 0;
  }
  body.header-hidden .logo-bi,
  body.header-hidden .logo-net {
    font-size: 20px;
  }
  body.header-hidden .ticker {
    max-height: 0;
    opacity: 0;
  }
  /* logo 列維持 sticky 不消失 */
  .logo-bar {
    position: sticky;
    top: 0;
    z-index: 99;
    background: #fff;
  }

  /* 浮動回到頂部按鈕 */
  .back-to-top {
    position: fixed;
    bottom: 76px;
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #163A2E, #1B4332);
    color: #fff;
    border: none;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    display: none;
    z-index: 998;
  }
  .back-to-top.visible { display: flex; align-items: center; justify-content: center; }
}
