/* 參考脆（Threads）的介面：白底、黑字、灰色輔助字、細分隔線、頭像串文、橫滑圖片 */
:root {
  --bg: #FAFAFA;
  --panel: #FFFFFF;
  --tx: #000000;
  --tx2: #999999;
  --tx3: #737373;
  --ln: rgba(0, 0, 0, .15);
  --ln2: rgba(0, 0, 0, .08);
  --hover: rgba(0, 0, 0, .04);
  --btn-solid: #000000;
  --btn-solid-tx: #FFFFFF;
  --sheet: #FFFFFF;
  --sheet-g: #F5F5F5;
  --av: #0F3B46;
  --accent: #FF6B3D;
  --gutter: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0A0A; --panel: #101010; --tx: #F3F5F7; --tx2: #777777; --tx3: #999999;
    --ln: rgba(243, 245, 247, .15); --ln2: rgba(243, 245, 247, .08); --hover: rgba(255, 255, 255, .05);
    --btn-solid: #F3F5F7; --btn-solid-tx: #000000; --sheet: #181818; --sheet-g: #212121;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--tx);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--tx); outline-offset: 2px; border-radius: 8px; }

.ic { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ic svg { width: 100%; height: 100%; }

/* 頂欄 */
.bar {
  position: sticky; top: 0; z-index: 30; height: 76px;
  display: grid; grid-template-columns: 48px 1fr 48px; align-items: center;
  padding: 0 8px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.mark { justify-self: center; font-size: 15px; }
.mark b { font-weight: 700; }
.bk { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
a.bk:hover { background: var(--hover); }
.bk .ic { width: 22px; height: 22px; }
.bk.out { justify-self: end; }
.bk.out .ic { width: 26px; height: 26px; }

/* 中間欄：手機滿版，桌機是脆的圓角白面板 */
.col { background: var(--panel); min-height: calc(100vh - 76px); }
@media (min-width: 700px) {
  .col { max-width: 640px; margin: 0 auto 40px; border: 1px solid var(--ln); border-radius: 28px; overflow: hidden; min-height: 0; }
}

/* 頂欄小 logo：淺色模式深藍字，深色模式米白字 */
.logos { display: flex; align-items: center; gap: 16px; }
.lg { display: block; width: 112px; }
.lg img { width: 100%; height: auto; }
.lg-cream { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lg-ink { display: none; }
  :root:not([data-theme="light"]) .lg-cream { display: block; }
}

/* 個人頁頭 */
.prof { padding: 20px 24px 4px; }
.prof-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pn { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: .2px; }
.ph2 { margin: 6px 0 0; display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 20px; }
.ph2 .hd2 { display: block; line-height: 20px; }
.pill { display: inline-flex; align-items: center; height: 20px; font-size: 11px; line-height: 1; color: var(--tx3); background: var(--ln2); border-radius: 10px; padding: 0 8px; }
.bio { margin: 16px 0 0; white-space: pre-line; font-size: 15px; line-height: 1.5; }
.meta2 { margin: 12px 0 0; font-size: 15px; color: var(--tx2); }
.pbtn { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 0; }
.b { display: inline-flex; justify-content: center; align-items: center; height: 36px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--ln); font-weight: 600; font-size: 15px; }
.b:hover { background: var(--hover); }
.b.solid { background: var(--btn-solid); color: var(--btn-solid-tx); border-color: var(--btn-solid); }
.b.solid:hover { opacity: .88; }

/* 分頁 */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; position: sticky; top: 76px; z-index: 20; background: var(--panel); }
.tabs button { height: 48px; font-weight: 600; font-size: 15px; color: var(--tx2); border-bottom: 1px solid var(--ln); }
.tabs button[aria-selected="true"] { color: var(--tx); border-bottom: 1px solid var(--tx); box-shadow: inset 0 -1px 0 var(--tx); }

/* 貼文 */
.post { display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; padding: 12px var(--gutter) 6px; border-bottom: 1px solid var(--ln); }
.gut { padding-top: 4px; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--av); display: grid; place-items: center; overflow: hidden; outline: 1px solid var(--ln2); }
.av img { width: 82%; }
.main { min-width: 0; }
.hd { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.nm { font-weight: 600; font-size: 15px; }
.nm:hover { text-decoration: underline; }
.tp { color: var(--tx); font-size: 15px; }
.tm { color: var(--tx2); font-size: 15px; }
.tm:hover { text-decoration: underline; }
.ttl { margin: 2px 0 4px; font-size: 15px; font-weight: 600; line-height: 1.45; }
.post.tap { cursor: pointer; transition: background .12s; }
@media (hover: hover) { .post.tap:hover { background: var(--hover); } }
.post.tap .strip { cursor: grab; }
.post.tap .act, .post.tap .ib, .post.tap .nm, .post.tap .tm { cursor: pointer; }
.post.full .ttl { font-size: 17px; }
.txt { white-space: pre-line; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.txt.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.more { color: var(--tx2); font-size: 15px; margin-top: 2px; }
.more:hover { text-decoration: underline; }

/* 圖片：橫向並排，露出下一張（脆的多圖樣式） */
.strip {
  display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  margin: 10px calc(-1 * var(--gutter)) 0 -48px; padding: 0 var(--gutter) 0 48px; scroll-padding-left: 48px;
  overscroll-behavior-x: contain;
}
.strip::-webkit-scrollbar { display: none; }
.ph { flex: 0 0 auto; width: min(66vw, 300px); aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; scroll-snap-align: start; outline: 1px solid var(--ln2); outline-offset: -1px; background: var(--ln2); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.strip.one .ph { width: min(78vw, 380px); }
.post.full .ph { width: min(80vw, 360px); }

/* 電腦：拖曳與箭頭 */
.media { position: relative; }
.strip.drag { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.strip.drag .ph { pointer-events: none; }
@media (hover: hover) and (pointer: fine) { .strip { cursor: grab; } }
.arrow {
  position: absolute; top: calc(50% + 5px); transform: translateY(-50%); z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel); color: var(--tx); border: 1px solid var(--ln); box-shadow: 0 2px 10px rgba(0,0,0,.12);
  opacity: 0; transition: opacity .15s;
}
.arrow.l { left: 6px; }
.arrow.r { right: 6px; }
.arrow.r .ic { transform: scaleX(-1); }
.arrow[hidden] { display: none; }
.media:hover .arrow, .arrow:focus-visible { opacity: 1; }
@media (hover: none) { .arrow { display: none; } }

/* 動作列 */
.acts { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; }

/* 分享選單 */
.menu-wrap { position: fixed; inset: 0; z-index: 60; }
.menu-bg { position: absolute; inset: 0; }
.menu {
  position: absolute; width: 260px; background: var(--sheet); border: 1px solid var(--ln);
  border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.14); padding: 6px; display: grid;
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top left; transition: opacity .14s, transform .14s;
}
.menu-wrap.on .menu { opacity: 1; transform: none; }
.mg + .mg { border-top: 1px solid var(--ln2); margin-top: 6px; padding-top: 6px; }
.mi { width: 100%; display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 44px; border-radius: 10px; font-size: 15px; font-weight: 600; text-align: left; }
.mi:hover, .mi:focus-visible { background: var(--hover); outline: none; }
.mi .ic { width: 20px; height: 20px; }
/* 手機：底部滑出 */
.menu-wrap.bottom .menu-bg { background: rgba(0,0,0,.4); opacity: 0; transition: opacity .18s; }
.menu-wrap.bottom.on .menu-bg { opacity: 1; }
.menu-wrap.bottom .menu {
  left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto;
  border-radius: 20px; padding: 8px; transform: translateY(110%); opacity: 1; transition: transform .2s ease-out;
}
.menu-wrap.bottom.on .menu { transform: none; }
.menu-wrap.bottom .mi { height: 52px; font-size: 16px; }
.act { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ln); font-size: 14px; font-weight: 600; color: var(--tx); }
.act .ic { width: 17px; height: 17px; }
.act:hover { background: var(--hover); }
.act.main { background: var(--btn-solid); color: var(--btn-solid-tx); border-color: var(--btn-solid); }
.act.main:hover { opacity: .88; background: var(--btn-solid); }
.sheet-h { margin: 0 4px 2px; font-size: 15px; font-weight: 700; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.list .post:last-child { border-bottom: 0; }
.empty { padding: 48px 24px; text-align: center; color: var(--tx2); display: grid; gap: 14px; justify-items: center; }

/* 單篇 */
.post.full { padding-top: 16px; padding-bottom: 12px; }
.sec { border-top: 1px solid var(--ln); }
.post.full + .sec { border-top: 0; }
.sh { margin: 0; padding: 14px var(--gutter); font-size: 15px; font-weight: 600; border-bottom: 1px solid var(--ln); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px var(--gutter) 16px; }
.gi { display: grid; gap: 6px; text-align: left; }
.gi img { border-radius: 8px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; outline: 1px solid var(--ln2); outline-offset: -1px; }
.gi span { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--tx3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gi .ic { width: 14px; height: 14px; }
.gi:hover span { color: var(--tx); }

/* 頁尾 */
.ft { border-top: 1px solid var(--ln); padding: 20px 24px; font-size: 13px; line-height: 1.6; color: var(--tx2); text-align: center; }
.ft p { margin: 0; }
.ft a { color: var(--tx); }
.ft .v { margin-top: 12px; color: var(--tx); font-weight: 600; }

/* 看大圖 */
.vw { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; display: grid; grid-template-rows: auto 1fr; }
.vw-bar { display: flex; justify-content: space-between; align-items: center; padding: calc(8px + env(safe-area-inset-top)) 8px 8px; }
.vw-b { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.vw-b:hover { background: rgba(255, 255, 255, .12); }
.vw-b .ic { width: 24px; height: 24px; }
.vw-n { font-size: 15px; font-weight: 600; }
.vw { height: 100vh; height: 100dvh; }
.vw-stage { position: relative; min-height: 0; }
.vw-track { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.vw-track::-webkit-scrollbar { display: none; }
.vw-track figure { margin: 0; flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; padding: 0 12px calc(16px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.vw-track img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 4px; user-select: none; -webkit-user-drag: none; }
.vw-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); color: #fff; z-index: 2; }
.vw-arrow:hover { background: rgba(255,255,255,.26); }
.vw-arrow.l { left: 20px; } .vw-arrow.r { right: 20px; }
.vw-arrow.r .ic { transform: scaleX(-1); }
.vw-arrow .ic { width: 24px; height: 24px; }
.vw-arrow[hidden] { display: none; }
@media (hover: none) { .vw-arrow { display: none; } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  background: var(--btn-solid); color: var(--btn-solid-tx); padding: 12px 18px; border-radius: 12px; font-size: 15px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 90; max-width: calc(100% - 32px); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* 搜尋 */
.search { position: relative; flex: 1; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px 0 14px; border-radius: 12px; background: var(--ln2); color: var(--tx2); }
.search > .ic { width: 18px; height: 18px; }
.sq { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font: inherit; font-size: 16px; color: var(--tx); }
.sq::placeholder { color: var(--tx2); }
.sq::-webkit-search-cancel-button { display: none; }
.sx { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--tx2); }
.sx:hover { background: var(--hover); color: var(--tx); }
.sx .ic { width: 16px; height: 16px; }
.sx[hidden] { display: none; }

.grow { flex: 1; }

/* 頂欄搜尋 */
.bar { position: sticky; }
.sbtn { justify-self: end; }
.sbtn .ic { width: 22px; height: 22px; }
.sbtn:hover { background: var(--hover); }
.bsearch { display: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; align-items: center; gap: 12px; padding: 0 16px; max-width: 640px; margin: 0 auto; }
.bar.searching .bsearch { display: flex; }
.bar.searching > .bk, .bar.searching > .mark { visibility: hidden; }
.scancel { font-size: 15px; font-weight: 600; color: var(--tx); padding: 8px 4px; flex: none; }
/* 頂欄內容跟中間面板同寬，搜尋鈕才不會跑到螢幕最右邊 */
.bar { padding-left: max(8px, calc((100% - 640px) / 2)); padding-right: max(8px, calc((100% - 640px) / 2)); }

/* 台北卡頭貼 */
.pav { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex: none; }
.pav img { width: 100%; height: 100%; }
.av img { width: 100%; height: 100%; }
/* 分頁點擊後不要黑色外框（鍵盤操作時用底線提示） */
.tabs button:focus-visible { outline: none; box-shadow: inset 0 -2px 0 var(--tx); }
.tabs button:focus:not(:focus-visible) { outline: none; }

/* 分頁直接用 logo */
.mark b { font-size: 17px; font-weight: 800; letter-spacing: 1px; }
.tabs button { height: 56px; display: flex; align-items: center; justify-content: center; }
.tabs .lgtab .lg { width: 84px; opacity: .32; transition: opacity .15s; }
.tabs .lgtab:hover .lg { opacity: .6; }
.tabs .lgtab[aria-selected="true"] .lg { opacity: 1; }

/* 頂欄（照脆）：左邊返回＋帳號，右邊放大鏡、⋯ */
.bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.bar-l, .bar-r { display: flex; align-items: center; gap: 4px; }
.bar-t { font-size: 17px; font-weight: 700; padding: 0 6px; }
.bar-l .bk + .bar-t { padding-left: 4px; }
.bar-r .bk .ic { width: 22px; height: 22px; }
.bar-r .bk:hover, .bar-l .bk:hover { background: var(--hover); }
.tabs { top: 60px; }
.bar.searching > .bar-l, .bar.searching > .bar-r { visibility: hidden; }
.bsearch { background: inherit; }
/* 滑鼠點擊後不顯示黑色外框，只有鍵盤操作才顯示 */
:focus:not(:focus-visible) { outline: none; }
