/* =========================================================
   房產財經筆記 jhenbang.com — 共用樣式 style.css
   設計準則：美觀、衝擊力、手機優先、柔和品牌色（非證券軟體冷硬黑紅綠）
   v0.3 §3 靜態站 / §4 六宮格 / §4.6 手機優先
   ========================================================= */

/* ---------- 設計變數 ---------- */
:root {
  /* 品牌主色：溫潤墨藍 + 暖金 */
  --ink:        #1d2a3a;   /* 主文字 / 深底 */
  --ink-soft:   #33445a;
  --gold:       #c6a052;   /* 暖金點綴 */
  --gold-deep:  #a9863c;
  --paper:      #faf7f1;   /* 暖白底 */
  --paper-2:    #f3ede2;
  --text:       #2b2f36;
  --muted:      #76808d;
  --line:       rgba(29,42,58,.10);
  --shadow:     0 10px 30px rgba(29,42,58,.10);
  --shadow-lg:  0 18px 50px rgba(29,42,58,.16);

  /* 六格柔和底色 */
  --c-fortune:  #efe9fb;  /* 每日運勢 — 柔紫 */
  --c-house:    #e6f0fa;  /* 房產情報 — 柔藍 */
  --c-stock:    #e4f3ec;  /* 股市情報 — 柔綠（可點） */
  --c-life:     #fdeede;  /* 生活情報 — 柔橙 */
  --c-member:   #faf1da;  /* 會員等級 — 柔金 */
  --c-service:  #fbe9ec;  /* 客服聯絡 — 柔玫 */

  --r-lg: 22px;
  --r-md: 16px;
  --maxw: 1080px;
}

/* ---------- 基礎 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: "PingFang TC","Microsoft JhengHei","Noto Sans TC","Helvetica Neue",Arial,sans-serif;
  color: var(--text);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.serif { font-family: "Noto Serif TC","Songti TC","PMingLiU",serif; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- 全站頂列 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 16px 20px;
  position: relative;
}
.topbar .brand-mini {
  font-weight: 700; letter-spacing: 2px; color: var(--ink);
  font-size: 17px;
}
.topbar .brand-mini b { color: var(--gold-deep); }

/* ---------- 首頁 HERO ---------- */
.hero {
  position: relative;
  text-align: center;
  min-height: 44vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 38px 20px 36px;
  background:
    radial-gradient(1200px 420px at 50% -120px, rgba(198,160,82,.22), transparent 60%),
    linear-gradient(180deg, rgba(11,17,27,.50) 0%, rgba(11,17,27,.40) 42%, rgba(11,17,27,.74) 100%),
    url(../img/hero.webp) center / cover no-repeat;
  color: #fff;
  overflow: hidden;
}
.hero::after { /* 細緻光暈 */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(700px 300px at 80% 120%, rgba(198,160,82,.16), transparent 60%);
  pointer-events: none;
}
.hero .eyebrow {
  letter-spacing: 6px; font-size: 12px; color: var(--gold);
  text-transform: uppercase; margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(34px, 9vw, 58px);
  font-weight: 800; letter-spacing: 4px; line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.7), 0 2px 24px rgba(0,0,0,.5);
}
.hero h1 .dot { color: var(--gold); }
.hero .divider {
  width: 54px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  margin: 22px auto 18px;
}
.hero .slogan {
  font-size: clamp(17px, 4.8vw, 22px);
  color: rgba(255,255,255,.95); letter-spacing: 1px; line-height: 1.55;
  font-weight: 600;
  text-shadow: 0 1px 14px rgba(0,0,0,.6);
}

/* ---------- 六宮格 ---------- */
.grid-section { padding: 42px 0 54px; margin-top: 0; }  /* HERO 與宮格間明顯留白 */
.grid {
  display: grid;
  grid-template-columns: 1fr;   /* 手機：1 欄（每格整行大圖卡片） */
  gap: 18px;
}
.cell {
  position: relative;
  display: flex; flex-direction: column;
  justify-content: flex-end;          /* 文字壓底部 */
  aspect-ratio: 75 / 56;              /* 配合 2400x1792 橫式情境圖，零裁切零變形 */
  padding: 14px 15px 13px;
  border-radius: var(--r-lg);
  background: #16222f center / cover no-repeat;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
  overflow: hidden;
}
.cell:active { transform: scale(.98); }
@media (hover:hover){
  .cell:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
}
.cell .ic { display: none; }          /* 改用真圖，隱藏 SVG 佔位 icon */

/* 底部深色漸層遮罩，確保白字在發光圖上仍清楚 */
.cell::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(8,12,20,.10) 0%,
    rgba(8,12,20,0) 26%,
    rgba(8,12,20,.48) 50%,
    rgba(8,12,20,.80) 73%,
    rgba(8,12,20,.94) 90%,
    rgba(8,12,20,.99) 100%);
  pointer-events: none;
}
.cell > * { position: relative; z-index: 1; }  /* 文字浮在遮罩之上 */
/* 手機基準字級（行動優先）— 對年長者明顯放大、加粗、放寬行距 */
.cell h3 {
  font-size: 24px; font-weight: 800; color: #fff;
  letter-spacing: 1.5px; line-height: 1.3;
  text-shadow: 0 2px 6px rgba(0,0,0,.9), 0 2px 16px rgba(0,0,0,.6);
}
.cell p  {
  font-size: 16px; font-weight: 600; color: #fff;
  margin-top: 5px; letter-spacing: .5px; line-height: 1.45;
  text-shadow: 0 1px 5px rgba(0,0,0,.9), 0 1px 12px rgba(0,0,0,.6);
}
.cell .go {
  margin-top: 10px;
  font-size: 16px; font-weight: 800; color: #f3d488;
  display: inline-flex; align-items: center; gap: 6px;
  text-shadow: 0 1px 6px rgba(0,0,0,.9);
}

/* 各格主視覺圖 */
.cell-fortune { background-image: url(../img/fortune.webp); }
.cell-house   { background-image: url(../img/house.webp); }
.cell-stock   { background-image: url(../img/stock.webp); }
.cell-life    { background-image: url(../img/life.webp); }
.cell-member  { background-image: url(../img/member.webp); }
.cell-service { background-image: url(../img/service.webp); }

/* 即將開放徽章 — 放「標題上方獨立一行」的小膠囊（不再絕對定位覆蓋標題，手機也不打架） */
.badge-soon {
  align-self: flex-start;
  margin-bottom: 7px;
  font-size: 12px; font-weight: 800; letter-spacing: .5px;
  color: var(--ink);
  background: rgba(255,255,255,.92);
  padding: 4px 11px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.30);
}
/* 可點的格子：金色「立即查看」 */
.cell-active { outline: 2px solid rgba(198,160,82,.55); }

/* ---------- 通用內頁區塊 ---------- */
.page { padding: 0 0 60px; }
.section-head { text-align: center; padding: 40px 20px 8px; }
.section-head .eyebrow { letter-spacing: 5px; font-size: 12px; color: var(--gold-deep); }
.section-head h2 { font-size: clamp(26px,7vw,38px); color: var(--ink); letter-spacing: 2px; margin-top: 8px; }
.section-head .sub { color: var(--muted); margin-top: 8px; font-size: 15px; }

/* 主視覺橫幅（台北101 HERO 圖） */
.hero-banner {
  position: relative;
  height: 240px; border-radius: var(--r-lg);
  margin: 18px 0 6px;
  background: #16222f url(../img/hero.webp) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  text-align: center;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-banner h2 { color: #fff; font-size: clamp(28px,8vw,44px); letter-spacing: 3px; text-shadow: 0 2px 16px rgba(0,0,0,.5); }
.hero-banner .bslogan { color: rgba(255,255,255,.9); margin-top: 6px; font-size: 15px; text-shadow: 0 1px 10px rgba(0,0,0,.55); }
.hero-banner .overlay {
  position: absolute; inset: 0; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(13,20,30,.32) 0%, rgba(13,20,30,.30) 45%, rgba(13,20,30,.6) 100%);
}

/* ===== 股市入口頁：便當盒（Bento Grid）===== */
/* 文字標題區（取代大圖 HERO） */
.pagehead { padding: 28px 0 4px; }
.pagehead .eyebrow { letter-spacing: 5px; font-size: 12.5px; font-weight: 700; color: var(--gold-deep); }
.pagehead h1 { font-size: clamp(32px, 8vw, 46px); color: var(--ink); letter-spacing: 3px; margin-top: 10px; font-weight: 800; }
.pagehead .sub { color: var(--muted); margin-top: 10px; font-size: 16px; letter-spacing: .5px; }

/* 便當盒：台股大卡(左,跨兩列) + 美股(右上) + 總經(右下) */
.bento {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  height: 440px;
  margin: 22px 0 12px;
}
.bento .tw { grid-column: 1; grid-row: 1 / 3; }   /* 台股：左側、跨兩列、雙倍高 */

.opt {
  position: relative; display: block;
  border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}
@media (hover:hover){ .opt:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); } }
.opt .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform .45s ease;
}
@media (hover:hover){ .opt:hover .bg { transform: scale(1.05); } }
.opt .mask {  /* 底部往上深色漸層，確保白字清楚 */
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(8,12,20,.12) 0%, rgba(8,12,20,0) 32%,
    rgba(8,12,20,.55) 60%, rgba(8,12,20,.86) 82%, rgba(8,12,20,.97) 100%);
}
.opt .inner {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 22px;
}
.opt .inner h3 {
  color: #fff; font-weight: 800; letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(0,0,0,.9), 0 2px 16px rgba(0,0,0,.6);
}
.opt .inner p {
  color: #fff; font-weight: 600; margin-top: 7px; line-height: 1.5;
  text-shadow: 0 1px 6px rgba(0,0,0,.9);
}
/* 主角(台股)字大；配角(美股/總經)略小 */
.tw .inner h3 { font-size: 30px; }
.tw .inner p  { font-size: 15px; }
.us .inner h3, .macro .inner h3 { font-size: 24px; }
.us .inner p,  .macro .inner p  { font-size: 13.5px; }

/* 台股 立即查看 金色膠囊 */
.cta {
  align-self: flex-start; margin-top: 15px;
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(180deg, #dcb863, var(--gold-deep)); color: #1a2533;
  font-weight: 800; font-size: 15px; letter-spacing: 1px;
  padding: 10px 20px; border-radius: 999px;
  box-shadow: 0 5px 16px rgba(0,0,0,.35);
}
/* 即將開放：右上徽章 + 略降明度 */
.opt.soon { cursor: default; }
.opt.soon .mask {
  background: linear-gradient(180deg,
    rgba(8,12,20,.34) 0%, rgba(8,12,20,.20) 34%,
    rgba(8,12,20,.62) 64%, rgba(8,12,20,.92) 100%);
}
.badge-corner {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  font-size: 13px; font-weight: 800; letter-spacing: .5px; color: var(--ink);
  background: rgba(255,255,255,.92); padding: 5px 13px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.30);
}
/* 三張真實情境圖 */
.tw    .bg { background-image: url(../img/stock_tw.webp); }
.us    .bg { background-image: url(../img/stock_us.webp); }
.macro .bg { background-image: url(../img/stock_macro.webp); }

/* 響應式：<720px 改一欄堆疊（台股→美股→總經，各有間距） */
@media (max-width: 719px){
  .bento { display: flex; flex-direction: column; height: auto; gap: 16px; }
  .bento .tw { height: 230px; }
  .bento .us, .bento .macro { height: 175px; }
}

/* （舊的 .options/.opt 橫條樣式已移除；股市入口頁改用上方便當盒 .bento/.opt） */

/* 麵包屑 */
.crumbs { padding: 18px 0 0; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--gold-deep); font-weight: 600; }
.crumbs span { margin: 0 6px; color: var(--line); }

/* 四選單（台股頁） */
.menu-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 20px; }
@media (min-width: 640px){ .menu-grid { grid-template-columns: repeat(2,1fr); } }
.mcard {
  position: relative; display: flex; gap: 14px; align-items: flex-start;
  padding: 20px; border-radius: var(--r-md);
  background: #fff; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
@media (hover:hover){ .mcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); } }
.mcard .mic { flex:0 0 auto; width:48px; height:48px; border-radius:13px;
  display:flex; align-items:center; justify-content:center; background: var(--c-stock); }
.mcard .mic svg { width:24px; height:24px; stroke: var(--ink); }
.mcard h3 { color: var(--ink); font-size: 17px; letter-spacing: 1px; }
.mcard p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.mcard .soon-pill { position:absolute; top:14px; right:14px; }

/* ---------- 即將開放 殼頁 ---------- */
.soon-page {
  min-height: 82vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 60px 24px;
  background:
    radial-gradient(900px 360px at 50% -60px, rgba(198,160,82,.12), transparent 60%),
    var(--paper);
}
.soon-page .crest {
  width: 84px; height: 84px; border-radius: 24px; margin-bottom: 24px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; box-shadow: var(--shadow);
}
.soon-page .crest svg { width: 40px; height: 40px; stroke: var(--gold-deep); }
.soon-page .ptitle { color: var(--gold-deep); letter-spacing: 4px; font-size: 13px; }
.soon-page h1 { color: var(--ink); font-size: clamp(30px,9vw,46px); letter-spacing: 3px; margin: 8px 0 6px; }
.soon-page .lead { color: var(--muted); font-size: 16px; max-width: 460px; }
.btn-home {
  margin-top: 30px; display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 700; letter-spacing: 1px;
  box-shadow: var(--shadow); transition: transform .2s ease;
}
.btn-home:active { transform: scale(.97); }
@media (hover:hover){ .btn-home:hover { background: var(--ink-soft); } }

/* ---------- 頁尾 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 20px 40px; text-align: center;
  color: var(--muted); font-size: 12.5px; line-height: 1.9;
}
.site-footer .src { color: var(--ink-soft); }
.site-footer .disclaimer { color: var(--muted); }
.site-footer .copyright { margin-top: 10px; color: var(--line); color: #aab2bb; }

/* ---------- 個股搜尋（detail / tw 共用） ---------- */
.searchbar { display: flex; gap: 8px; margin: 16px 0 0; }
.searchbar input { flex: 1; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.searchbar button { font-size: 15px; font-weight: 800; padding: 0 18px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; cursor: pointer; }
.ssr-wrap { position: relative; }
.ssr-box {
  display: none; position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 50;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  max-height: 340px; overflow-y: auto;
}
.ssr-item {
  padding: 11px 14px; font-size: 15px; color: var(--ink); cursor: pointer;
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.ssr-item:last-child { border-bottom: 0; }
@media (hover:hover){ .ssr-item:hover { background: var(--paper-2); } }
.ssr-item b { color: var(--ink); font-weight: 800; margin-right: 5px; }
.ssr-item .ssr-mk { float: right; font-size: 11px; color: var(--muted); background: var(--paper-2); padding: 2px 9px; border-radius: 999px; }
.ssr-empty { padding: 13px 14px; font-size: 14px; color: var(--muted); }

/* ---------- 響應式欄數：手機1欄(基準) / 平板2欄 / 桌機3欄 ---------- */
/* 平板（中等螢幕）：2 欄 x 3 列 */
@media (min-width: 600px){
  .grid { grid-template-columns: repeat(2, 1fr); }
}
/* 桌機（寬螢幕）：3 欄 x 2 列 */
@media (min-width: 1024px){
  .grid { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .cell { padding: 22px 22px 20px; }
  .grid-section { padding: 50px 0 60px; }
}
@media (min-width: 900px){
  .hero { min-height: 50vh; padding: 64px 20px 56px; }
  .hero-banner { height: 320px; }
}
