
*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;background-color:#f1f1f1;color:#111;display:flex;justify-content:center;transition:background 0.3s, color 0.3s;}
.app{width:100%;max-width:500px;background:#fff;min-height:100vh;box-shadow:0 0 15px rgba(0,0,0,0.05);position:relative;padding-bottom:40px;transition:background 0.3s, color 0.3s;}

body.dark-mode{background-color:#121212;color:#e0e0e0;}
body.dark-mode .app{background:#181818;box-shadow:0 0 15px rgba(0,0,0,0.5);}
body.dark-mode .post-item{border-bottom-color:#2a2a2a;}
body.dark-mode .text{color:#e0e0e0;}
body.dark-mode .author-name{color:#7993c4;}
body.dark-mode .time{color:#666;}
body.dark-mode .action-btn{background:#252525;color:#7993c4;}
body.dark-mode .action-menu{background:#2a2a2a;}
body.dark-mode .comment-box{background:#222;}
body.dark-mode .comment-line{color:#ccc;}
body.dark-mode .comment-user{color:#7993c4;}
body.dark-mode .comment-avatar{background:#333;color:#7993c4;}
body.dark-mode .comment-avatar img{background:#222;}
body.dark-mode .comment-form{background:#222;}
body.dark-mode .comment-form input{background:#181818;color:#fff;border-color:#333;}
body.dark-mode .file-card{background:#222;border-color:#333;color:#e0e0e0;}
body.dark-mode .file-name{color:#e0e0e0;}
body.dark-mode .file-action{color:#7993c4;}
body.dark-mode .timeline-tr{border-bottom-color:#2a2a2a;}
body.dark-mode .col-content:hover{background:#202020;}
body.dark-mode .date-day{color:#e0e0e0;}
body.dark-mode .date-month{color:#888;}
body.dark-mode .media-post-text{color:#e0e0e0;}
body.dark-mode .file-post-text-top{color:#e0e0e0;}
body.dark-mode .file-name-bottom{color:#7993c4;}
body.dark-mode .text-post-card{color:#e0e0e0;}
body.dark-mode .wechat-notice-text { color: #e0e0e0 !important; }

.wechat-notice-bar-container {
  display: flex;
  justify-content: center;
  padding: 12px 16px 4px 16px;
}
.wechat-notice-bar {
  display: inline-flex;
  align-items: center;
  background: #f7f7f7;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 5px 12px 5px 6px;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  gap: 8px;
}
body.dark-mode .wechat-notice-bar {
  background: #222222;
  border-color: #333333;
}
.wechat-notice-bar:hover {
  background: #f0f0f0;
}
body.dark-mode .wechat-notice-bar:hover {
  background: #2a2a2a;
}
.wechat-notice-avatar {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}
.wechat-notice-text {
  font-size: 13px;
  color: #111;
  font-weight: 500;
  white-space: nowrap;
}

.notice-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.notice-modal-content {
  background: #fff;
  width: 100%;
  max-width: 340px;
  border-radius: 12px;
  padding: 24px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  text-align: center;
  position: relative;
  animation: modalScale 0.2s ease-out;
}
body.dark-mode .notice-modal-content {
  background: #222;
  color: #fff;
}
@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.notice-modal-icon-wrap {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}
.notice-modal-icon-wrap svg {
  width: 24px;
  height: 24px;
  stroke: #07c160;
  fill: none;
  stroke-width: 2;
}
.notice-modal-body {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
  word-break: break-word;
  white-space: pre-wrap;
}
body.dark-mode .notice-modal-body {
  color: #ccc;
}
.notice-modal-btn {
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(7,193,96,0.3);
}


body.dark-mode{background-color:#121212;color:#e0e0e0;}
body.dark-mode .app{background:#181818;box-shadow:0 0 15px rgba(0,0,0,0.5);}
body.dark-mode .fab-btn{background:rgba(40,40,40,0.75);color:#fff;border-color:rgba(255,255,255,0.1);}
/* v2.9.2：右錨點抽成 --fab-r，回頂與右下豎列共用同一個值（手機 = 內容欄右緣內 16）。
   1024–1199 由 desktop-layout 換成 820 單欄右緣內 16；≥1200 仍由寬屏樣式接管。 */
:root{--fab-r:max(16px,calc(50% - 234px));}
/* v2.9.2：豎列 = 鈴鐺（有未讀才在）+ 菜單鈕；↑ 由 #backToTop 自己渲染在更下方。
   高度仍是 24+44+10+44 = 122，與 v2.4.7 一致，不碰 safe-area。 */
.fab-container{position:fixed;bottom:calc(24px + 44px + 10px + env(safe-area-inset-bottom,0px));right:var(--fab-r);left:auto;width:44px;z-index:1000;display:flex;flex-direction:column;gap:10px;align-items:center;transition:opacity .22s ease,transform .22s ease,visibility .22s;}
/* v2.9.3：收起改回「看滑動方向」——向下累計 90px 收起，向上累計 10px 立刻回來；
   與回頂（1.5 屏才出現）互不干擾，兩顆可以同時在。 */
.fab-container.is-hidden{opacity:0;visibility:hidden;transform:translateY(8px);pointer-events:none;}
/* v2.9.2：菜單鈕與面板綁在一起；面板與按鈕同一條豎軸（居中），從按鈕正上方直著往上彈 */
.fab-menu-wrap{position:relative;width:44px;height:44px;flex:none;}
.fab-stack-panel{position:absolute;left:50%;right:auto;bottom:calc(100% + 8px);width:60px;padding:8px;display:flex;flex-direction:column;gap:8px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-radius:18px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08),0 10px 28px rgba(0,0,0,.15);opacity:0;visibility:hidden;transform:translate(-50%,12px);transform-origin:bottom center;transition:opacity .2s,transform .26s cubic-bezier(.32,.72,0,1),visibility .2s;}
body.dark-mode .fab-stack-panel{background:rgba(32,32,34,.95);box-shadow:inset 0 0 0 1px rgba(255,255,255,.1),0 10px 28px rgba(0,0,0,.35);}
.fab-container.open .fab-stack-panel{opacity:1;visibility:visible;transform:translate(-50%,0);}
/* 打開 = 三道橫線換成 X；面板展開時鈴鐺讓位（保留佔位，按鈕位置不跳） */
.fab-container .fab-x{display:none;}
.fab-container.open .fab-bars{display:none;}
.fab-container.open .fab-x{display:block;}
.fab-container.open #bellBtn{opacity:0;visibility:hidden;pointer-events:none;}
.fab-scrim{position:fixed;inset:0;z-index:-1;pointer-events:none;}
.fab-container.open .fab-scrim{pointer-events:auto;}
/* v2.9.2：鈴鐺無未讀整顆不顯示（全寬度生效，含寬屏）；紅點只表示數量，不再兼任開關 */
#bellBtn[hidden]{display:none;}
/* 日夜已進面板第 6 項：手機上這顆獨立按鈕不渲染，寬屏由 desktop-layout 恢復 */
.fab-container #themeBtn{display:none;}
/* 五個導航與日夜之間的一條細線（兩處面板共用） */
.fab-div{height:1px;flex:none;margin:0 2px;background:rgba(0,0,0,.08);}
body.dark-mode .fab-div{background:rgba(255,255,255,.1);}
/* ===== v2.7.0：貼邊把手（v2.9.2 起預設不渲染，只有詳情頁 / 文章頁打開） ===== */
.fab-left{position:fixed;left:0;top:50%;z-index:1000;display:none;}
body.moment-page .fab-left,body.article-page .fab-left{display:block;}
/* 入口：寬 16、高 72 的細長豎條。定稿 16 / 72 / -36 / 8（=width/2 就是半圓端），不要再換尺寸 */
.fab-handle{width:16px;height:72px;margin-top:-36px;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.92);backdrop-filter:blur(8px);color:#333;border:1px solid rgba(0,0,0,.2);border-left:0;border-radius:0 8px 8px 0;box-shadow:0 4px 12px rgba(0,0,0,.1);cursor:pointer;transition:transform .2s,opacity .2s;}
.fab-handle svg{width:13px;height:13px;fill:currentColor;stroke:none;}
.fab-handle:active{transform:scale(.94);}
body.dark-mode .fab-handle{background:rgba(40,40,40,.75);color:#fff;border-color:rgba(255,255,255,.1);}
/* 展開：一整塊圓角底板包住六項（5×44 + 4×8 + 分隔 1 + 44 + padding 16 + gap 8 = 321） */
.fab-left-panel{position:absolute;left:8px;top:0;padding:8px;display:flex;flex-direction:column;gap:8px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-radius:18px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08),0 10px 28px rgba(0,0,0,.15);opacity:0;visibility:hidden;transform:translateX(-34px) translateY(-50%);transition:opacity .22s,transform .26s cubic-bezier(.32,.72,0,1),visibility .22s;}
.fab-left.open .fab-left-panel{opacity:1;visibility:visible;transform:translateX(0) translateY(-50%);}
.fab-left.open .fab-handle{opacity:0;pointer-events:none;}
body.dark-mode .fab-left-panel{background:rgba(32,32,34,.95);box-shadow:inset 0 0 0 1px rgba(255,255,255,.1),0 10px 28px rgba(0,0,0,.35);}
/* v2.9.2：文章頁鏡像到右緣，面板向左彈（同一份 DOM，只換定位與圓角方向） */
body.article-page .fab-left{left:auto;right:0;}
body.article-page .fab-handle{border-left:1px solid rgba(0,0,0,.2);border-right:0;border-radius:8px 0 0 8px;}
body.article-page .fab-left-panel{left:auto;right:8px;transform:translateX(34px) translateY(-50%);}
body.article-page .fab-left.open .fab-left-panel{transform:translateX(0) translateY(-50%);}
/* v2.9.2：詳情頁 / 文章頁右下角一顆都不留，只剩回頂（寬屏在 desktop-layout 裡恢復） */
body.moment-page .fab-container,body.article-page .fab-container{display:none;}
/* 方鈕：底板內的裸圖標，不再各自帶底 */
.fab-sq{width:44px;height:44px;flex:none;display:flex;align-items:center;justify-content:center;background:transparent;border:1px solid transparent;color:#333;border-radius:12px;transition:transform .16s,background .2s,color .2s;}
.fab-sq svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.fab-sq:active{transform:scale(.93);}
.fab-sq.is-cur{color:#07c160;background:rgba(7,193,96,.1);}
body.dark-mode .fab-sq{color:#fff;}
body.dark-mode .fab-sq.is-cur{color:#4ade80;background:rgba(74,222,128,.12);}
/* 遮罩：關閉時必須放行點擊（否則整頁都點不動），展開後才接住點擊用來關閉 */
.fab-left-scrim{position:fixed;inset:0;z-index:-1;pointer-events:none;}
.fab-left.open .fab-left-scrim{pointer-events:auto;}

.fab-btn{width:44px;height:44px;flex:none;background:rgba(255,255,255,.92);backdrop-filter:blur(8px);color:#333;border:1px solid rgba(0,0,0,.2);border-radius:50%;font-size:17px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(0,0,0,0.1);transition:transform .25s,background .25s;}
.fab-btn svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.fab-btn:active{transform:scale(.94);}
@media (prefers-reduced-motion:reduce){.fab-btn,.bell-panel,.fab-container,.fab-stack-panel{transition:none;}}
/* 鈴鐺：紅點用 hidden 屬性控制（不是 display:none），無障礙讀屏才知道有沒有未讀 */
.menu-badge{position:absolute;top:6px;right:6px;width:8px;height:8px;border-radius:50%;background:#e5453c;box-shadow:0 0 0 2px #fff;}
.menu-badge[hidden]{display:none;}
#bellBtn{position:relative;}
.bell-panel{position:absolute;bottom:calc(100% + 10px);right:0;width:280px;max-height:360px;overflow:auto;background:#fff;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.18);padding:8px 0;z-index:1002;display:flex;flex-direction:column;}
.bell-panel[hidden]{display:none;}
.bell-panel-head{display:flex;align-items:center;justify-content:space-between;padding:2px 12px 8px;border-bottom:1px solid #f0f0f0;font-size:13px;color:#111;}
.bell-panel-close{border:0;background:none;font-size:16px;color:#999;cursor:pointer;padding:2px 4px;line-height:1;}
.bell-list{display:flex;flex-direction:column;}
.bell-item{display:block;width:100%;text-align:left;border:0;background:none;padding:9px 12px;font:inherit;font-size:13px;color:#333;line-height:1.5;cursor:pointer;border-bottom:1px solid #f7f7f7;}
.bell-item:hover{background:#f7fbf8;}
.bell-item.is-unread{background:#f2fbf6;}
.bell-item strong{color:#07a854;font-weight:600;}
.bell-item time{display:block;font-size:11px;color:#9aa2ad;margin-top:2px;}
.bell-empty{margin:0;padding:18px 12px;font-size:12px;color:#9aa2ad;text-align:center;}
.bell-read-all{margin:6px 12px 2px;border:1px solid #e5e7eb;border-radius:8px;background:#fafbfc;color:#3b4252;font:inherit;font-size:12px;padding:6px 8px;cursor:pointer;}
body.dark-mode .bell-panel{background:#1e1e1e;color:#e0e0e0;}
body.dark-mode .bell-panel-head{color:#e0e0e0;border-bottom-color:#2c2c2c;}
body.dark-mode .bell-item{color:#dcdcdc;border-bottom-color:#262626;}
body.dark-mode .bell-item:hover{background:#252525;}
body.dark-mode .bell-item.is-unread{background:#1f2a23;}
body.dark-mode .bell-read-all{background:#252525;border-color:#333;color:#dcdcdc;}
body.dark-mode .menu-badge{box-shadow:0 0 0 2px #181818;}
.footer-note{text-align:center;color:#b2b2b2;font-size:12px;padding:30px 0 10px;}
/* v2.8.2：公告弹窗（从 home.css 复制，首页那份保留不动） */
.notice-modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.6);z-index:9999;justify-content:center;align-items:center;padding:20px;}
.notice-modal-content{background:#fff;width:100%;max-width:340px;border-radius:12px;padding:24px 20px;box-shadow:0 10px 30px rgba(0,0,0,.2);text-align:center;position:relative;animation:modalScale .2s ease-out;}
body.dark-mode .notice-modal-content{background:#222;color:#fff;}
@keyframes modalScale{from{transform:scale(.9);opacity:0;}to{transform:scale(1);opacity:1;}}
.notice-modal-icon-wrap{margin-bottom:12px;display:flex;justify-content:center;}
.notice-modal-icon-wrap svg{width:24px;height:24px;stroke:#07c160;fill:none;stroke-width:2;}
.notice-modal-body{font-size:14px;color:#666;line-height:1.6;margin-bottom:20px;word-break:break-word;white-space:pre-wrap;}
body.dark-mode .notice-modal-body{color:#ccc;}
.notice-modal-btn{background:#07c160;color:#fff;border:none;border-radius:20px;padding:8px 24px;font-size:14px;font-weight:bold;cursor:pointer;box-shadow:0 2px 8px rgba(7,193,96,.3);}




.header{position:relative;margin-bottom:38px;}
.cover-img{width:100%;height:240px;object-fit:cover;display:block;}
.user-info{position:absolute;right:16px;bottom:-30px;display:flex;align-items:center;gap:12px;}
.user-name{color:#fff;font-weight:bold;font-size:18px;text-shadow:0 1px 3px rgba(0,0,0,0.8);margin-bottom:20px;}
.user-avatar{width:70px;height:70px;border-radius:8px;border:2px solid #fff;object-fit:cover;background:#fff;cursor:pointer;transition:transform 0.1s;}
.user-avatar:active{transform:scale(0.95);}
.bio{text-align:right;padding:0 16px 4px;font-size:12px;color:#888;margin-bottom:6px;}


.post-list{padding-top:4px;}
.post-item{display:flex;padding:16px;border-bottom:1px solid #f0f0f0;gap:12px;}
.post-avatar{width:42px;height:42px;border-radius:6px;object-fit:cover;flex-shrink:0;cursor:pointer;}
/* v2.9.6：詳情頁頭像改成真連結（可點擊、可新分頁），外層 a 必須完全繼承頭像的盒子，
   否則 flex 佈局會多出一個行內基線縫隙。 */
.post-avatar-link{display:block;flex:0 0 auto;width:42px;height:42px;border-radius:6px;overflow:hidden;-webkit-tap-highlight-color:transparent;}
.post-avatar-link .post-avatar{width:100%;height:100%;display:block;}
.post-avatar-link:focus-visible{outline:2px solid #576b95;outline-offset:2px;}
.post-content{flex:1;min-width:0;}
.art-item .post-content{display:flex;flex-direction:column;}
.art-link{display:flex;align-items:flex-start;gap:12px;color:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent;}
.art-main{flex:1;min-width:0;}
.art-title{font-size:16px;font-weight:700;line-height:1.45;color:#111;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;}
.art-excerpt{font-size:13px;line-height:1.55;color:#7a7a7a;margin:4px 0 0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;overflow-wrap:anywhere;}
.art-cover{width:92px;height:92px;flex:none;object-fit:cover;border-radius:6px;background:#f0f0f0;}
.art-item .post-footer{margin-top:8px;}
.art-item .cms-pin-badge{align-self:flex-start;}
body.dark-mode .art-title{color:#e0e0e0;}body.dark-mode .art-excerpt{color:#9a9a9a;}body.dark-mode .art-cover{background:#252525;}
@media(max-width:380px){.art-cover{width:76px;height:76px}.art-link{gap:10px}}
.cms-pin-badge{display:inline-flex;align-items:center;background:#fff4e5;color:#9a5a00;border-radius:5px;padding:2px 7px;margin:0 0 7px;font-size:11px;font-weight:700;}
.author-name{color:#576b95;font-weight:600;font-size:15px;margin-bottom:4px;}
.text{font-size:15px;line-height:1.4;color:#111;margin-bottom:8px;white-space:pre-wrap;word-break:break-word;}
.text a{color:#576b95;text-decoration:none;word-break:break-all;}
/* v2.6.0：首頁長文折疊。服務端仍輸出全文，截斷純前端做（展開能拿到全文，RSS/搜尋也不受影響）。
   -webkit-line-clamp 與 .text 的 white-space:pre-wrap 共存時，含換行的長文在 Chromium 仍按行數截斷
   （v2.6.0 驗收：375px 6 行 = 126px、1280px 6 行 = 158px，實測有效，故不走 max-height 降級方案）。 */
.text-clampable[data-collapsed="1"]{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6;overflow:hidden;}
.text-expand{margin:6px 0 0;padding:0;border:0;background:none;color:#576b95;font-size:13px;line-height:1.6;cursor:pointer;}
body.dark-mode .text-expand{color:#7993c4;}
body.dark-mode .text a{color:#7993c4;}
.markdown-body{font-size:15px;line-height:1.8;overflow-wrap:anywhere;color:#252525;margin:12px 0 22px;}
.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4{line-height:1.35;margin:1.2em 0 .5em;}
.markdown-body p,.markdown-body ul,.markdown-body ol,.markdown-body blockquote,.markdown-body table,.markdown-body .md-code-wrap{margin:0 0 1em;}
.markdown-body a{color:#2674c8;text-decoration:underline;}
.markdown-body img{max-width:100%;height:auto;border-radius:8px;}
.markdown-body video{display:block;width:100%;max-width:100%;max-height:70vh;height:auto;margin:18px auto;border-radius:10px;background:#111;}
.markdown-body blockquote{border-left:4px solid #cbd5e1;padding:8px 14px;color:#64748b;background:#f8fafc;}
.markdown-body table{width:100%;border-collapse:collapse;display:block;overflow-x:auto;}
.markdown-body th,.markdown-body td{border:1px solid #dbe1e8;padding:7px 10px;text-align:left;}
.markdown-body pre{overflow-x:auto;padding:14px;background:#111827;color:#e5e7eb;border-radius:9px;}
.markdown-body code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;}
.md-code-head{display:flex;justify-content:space-between;padding:7px 10px;background:#263244;color:#cbd5e1;border-radius:8px 8px 0 0;font-size:12px;}
.md-code-wrap .md-code-block{border-radius:0 0 8px 8px;}
.md-copy-code{border:1px solid #64748b;border-radius:5px;background:transparent;color:inherit;padding:2px 7px;cursor:pointer;}
.md-task{list-style:none;}
.md-task input{margin-right:7px;}
.grid{display:grid;gap:4px;margin-bottom:8px;width:100%;max-width:280px;}
.grid-1{grid-template-columns:minmax(0,1fr);max-width:min(100%,280px);}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr));max-width:240px;}
.grid-4{grid-template-columns:repeat(2,minmax(0,1fr));max-width:200px;}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr));max-width:280px;}
.grid-item{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:2px;cursor:pointer;background:#f2f3f5;min-width:0;overflow:hidden;
  /* 圖裂時（外鏈失效）瀏覽器會拿 alt 文字排版，幾十字的 alt 直接把格子撐成豎長條、把整行高度拉爆。
     font-size/line-height 歸零後 img 沒有文字內容，aspect-ratio 才管得住格子。alt 仍給讀屏。 */
  font-size:0;line-height:0;}
body.dark-mode .grid-item{background:#242424;}
/* v2.9.1：列表宮格封 3×3，第 9 格蓋 +N。div 當格子用，內層圖撐滿，遮罩絕對定位鋪滿整格。 */
.grid-more{position:relative;overflow:hidden;display:block;background:#f2f3f5;border-radius:2px;}
.grid-more>img{display:block;width:100%;height:100%;object-fit:cover;}
.grid-more-n{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.52);color:#fff;font-size:20px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:.02em;}
body.dark-mode .grid-more{background:#242424;}
/* 單圖動態：按原始比例顯示，最寬 280、最高 360，不裁切。
   justify-self:start 不能省 —— grid 子項預設 stretch，去掉 width:100% 後會被拉成整列寬。 */
.grid-1 .grid-item{width:auto;height:auto;max-width:100%;max-height:360px;aspect-ratio:auto;object-fit:contain;justify-self:start;border-radius:4px;}

.video-box{position:relative;width:100%;max-height:240px;aspect-ratio:1/1;background:#111;border-radius:2px;overflow:hidden;}
.video-box:fullscreen,.video-box:-webkit-full-screen{width:100vw!important;height:100vh!important;max-width:none!important;max-height:none!important;aspect-ratio:auto!important;border-radius:0;background:#000;display:flex;align-items:center;justify-content:center;}
.video-box:fullscreen .video-player,.video-box:-webkit-full-screen .video-player{width:100%;height:100%;object-fit:contain;}
.video-replay-overlay{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:6;display:flex;align-items:center;justify-content:center;width:56px;height:56px;padding:0;border:1px solid rgba(255,255,255,.85);border-radius:50%;background:rgba(0,0,0,.68);color:#fff;font-size:29px;line-height:1;cursor:pointer;}
.video-box.video-ended .custom-fullscreen-btn{display:none;}
.video-player{width:100%;height:100%;object-fit:contain;display:block;outline:none;background:#000;}
.custom-fullscreen-btn{position:absolute;top:8px;right:8px;background:rgba(0,0,0,0.6);color:white;border:none;width:32px;height:32px;border-radius:6px;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:5;transition:background 0.2s;backdrop-filter:blur(4px);}
.custom-fullscreen-btn:hover{background:rgba(0,0,0,0.8);}
.video-player::-webkit-media-controls-fullscreen-button{display:none!important;}
.video-box.video-ended.video-fullscreen-fallback .custom-fullscreen-btn{display:flex;}
.video-box.video-fullscreen-fallback{position:fixed!important;inset:0;width:100vw!important;height:100vh!important;height:100dvh!important;max-width:none!important;max-height:none!important;aspect-ratio:auto!important;border-radius:0;background:#000;display:flex;align-items:center;justify-content:center;z-index:100000;}
.video-box.video-fullscreen-fallback .video-player{width:100%;height:100%;object-fit:contain;}
.video-grid.grid-1{max-width:min(100%,180px);}
.video-grid.video-playing-grid{max-width:min(100%,280px);}
.video-preview{position:relative;display:block;width:100%;height:100%;padding:0;border:0;background:#101010;overflow:hidden;cursor:pointer;}
.video-poster{display:block;width:100%;height:100%;object-fit:cover;background:#101010;}
.video-play-mark{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:44px;height:44px;border-radius:50%;display:grid;place-items:center;padding-left:3px;background:rgba(0,0,0,.58);border:1px solid rgba(255,255,255,.75);color:#fff;font-size:18px;box-shadow:0 2px 12px rgba(0,0,0,.25);}
.video-box.video-autoplay-on::after{content:'靜音';position:absolute;left:8px;bottom:8px;z-index:4;padding:2px 6px;border-radius:5px;background:rgba(0,0,0,.55);color:#fff;font-size:10px;line-height:1.4;pointer-events:none;}
/* 真放不了的影片（HEVC / .mov / R2 404）：给一个可见角标，点击开原文件，别静默变回没反应的缩略图 */
.video-unsupported-chip{position:absolute;left:6px;bottom:6px;right:6px;z-index:4;padding:3px 6px;border-radius:4px;background:rgba(0,0,0,.62);color:#fff;font-size:11px;line-height:1.4;text-align:center;pointer-events:none;}

#video-lightbox{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.92);justify-content:center;align-items:center;z-index:99999;}
#video-lightbox video{max-width:min(86vw,720px);max-height:78vh;object-fit:contain;border-radius:8px;outline:none;}
.close-lightbox{position:absolute;top:20px;right:25px;color:white;font-size:32px;cursor:pointer;background:none;border:none;font-weight:bold;}

.music-player{width:100%;max-width:280px;height:86px;margin:8px 0;display:flex;align-items:center;justify-content:center;border-radius:8px;overflow:hidden;border:1px solid #e2e2e2;background:#fafafa;box-shadow:0 2px 6px rgba(0,0,0,0.04);}
.music-player iframe { width: 100%; height: 100%; border: none; }
/* v2.11.1：原生 <audio>（含文章頁音訊與 @[音樂：] 語法）不需要 86px 的播放器框，
   高度交給音訊控制列自己決定。:has() 不支援時退回固定高度，功能不受影響。 */
.music-player audio{width:100%;height:44px;display:block;}
.music-player:has(audio){height:auto;padding:10px 12px;}

.file-card{display:flex;align-items:center;gap:10px;background:#f7f7f7;border:1px solid #e8e8e8;border-radius:6px;padding:10px;margin:8px 0;max-width:320px;text-decoration:none;color:#333;}
.file-icon{display:flex;align-items:center;}
.file-icon svg{width:24px;height:24px;stroke:#576b95;fill:none;stroke-width:2;}
.file-info{flex:1;overflow:hidden;}
.file-name{font-size:13px;font-weight:600;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.file-action{font-size:12px;color:#576b95;margin-top:2px;}
.post-footer{display:flex;justify-content:space-between;align-items:center;margin-top:6px;position:relative;}
.time-like-container{display:flex;align-items:center;gap:8px;font-size:12px;flex-wrap:wrap;}
.time{color:#b2b2b2;}
.post-tag{display:inline-flex;align-items:center;gap:3px;background:#f0f2f5;color:#576b95;padding:1px 6px;border-radius:4px;font-size:11px;font-weight:500;text-decoration:none;}
body.dark-mode .post-tag{background:#252525;color:#7993c4;}

.like-badge{color:#576b95;font-weight:500;display:inline-flex;align-items:center;gap:3px;}
.action-btn{background:#f7f7f7;border:none;color:#576b95;width:30px;height:20px;border-radius:4px;font-size:14px;font-weight:bold;cursor:pointer;display:flex;align-items:center;justify-content:center;}
/* v2.6.0：選單變三鍵（點赞 / 評論 / 分享），收緊內邊距並禁止換行（320px 也不許斷） */
.action-menu{display:none;position:absolute;right:35px;bottom:-6px;background:#4c4c4c;border-radius:4px;padding:6px 10px;gap:10px;align-items:center;white-space:nowrap;z-index:10;box-shadow:0 2px 8px rgba(0,0,0,0.15);}
.action-menu.show{display:flex;}
.action-menu button{background:none;border:none;color:white;font-size:13px;cursor:pointer;display:flex;align-items:center;gap:4px;}
.comment-box{background:#f7f7f7;border-radius:4px;margin-top:8px;padding:6px 10px;font-size:13px;}
.comment-line{display:flex;gap:8px;align-items:flex-start;margin:6px 0;color:#333;line-height:1.45;}
.comment-main{flex:1;min-width:0;word-break:break-word;overflow-wrap:anywhere;}
.comment-time{flex:none;font-size:11px;line-height:1.3;color:#b2b2b2;white-space:nowrap;}
body.dark-mode .comment-time{color:#666;}
/* v2.7.0：右側信息列 —— 時間在上、回覆在下，不參與正文行高；min-height 兜住只有時間的情況 */
.comment-side{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:2px;padding-top:1px;min-height:32px;}

/* v2.7.0：頭裡只留暱稱（時間與回覆搬到右側 .comment-side），不再 space-between */
.comment-head{display:flex;align-items:baseline;gap:8px;}
.comment-head .comment-user{margin-right:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.comment-text{margin-top:1px;}
.comment-user{color:#576b95;font-weight:500;margin-right:4px;}
.comment-avatar{position:relative;flex:0 0 26px;width:26px;height:26px;border-radius:6px;background:#dfe6e2;color:#576b95;font-size:12px;font-weight:600;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.comment-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#fff;}
.comment-qq-row{display:flex;align-items:center;gap:8px;margin-bottom:4px;}
.comment-qq-row input{margin-bottom:0;}
.comment-submit{padding:4px 10px;background:#07c160;color:#fff;border:none;border-radius:4px;font-size:12px;cursor:pointer;}
.pager{display:flex;align-items:center;justify-content:center;gap:14px;padding:18px 12px 6px;font-size:13px;color:#999;}
.pager a{color:#576b95;text-decoration:none;padding:6px 14px;border:1px solid #e5e5e5;border-radius:16px;}
body.dark-mode .pager a{color:#7993c4;border-color:#333;}
.comment-form{display:none;margin-top:8px;background:#f7f7f7;padding:8px;border-radius:4px;}
.comment-form.show{display:block;}
.comment-form input{width:100%;padding:6px;margin-bottom:4px;border:1px solid #ddd;border-radius:4px;font-size:12px;}
.footer-note{text-align:center;color:#b2b2b2;font-size:12px;padding:30px 0 10px;}

/* v2.6.0：點讚圖示（大拇指）。未讚 = currentColor 描邊不填充；已讚 = 藍色填充。
   色值只在 LIKE_BLUE / LIKE_BLUE_DARK 兩個常量裡，這裡插值生成。 */
.thumb-icon{stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.thumb-icon.on{stroke:#1677ff;fill:#1677ff;}
body.dark-mode .thumb-icon.on{stroke:#4c9aff;fill:#4c9aff;}
.like-panel{display:flex;align-items:flex-start;gap:6px;background:#f7f7f7;border-radius:4px;margin-top:8px;padding:6px 10px;font-size:13px;color:#576b95;line-height:1.5;}
.like-panel>svg{margin-top:4px;}
.like-panel[data-like-mode="avatars"]{align-items:center;}
.like-panel[data-like-mode="avatars"]>svg{margin-top:0;}
.liker-list{min-width:0;word-break:break-word;overflow-wrap:anywhere;}
.liker-name{color:#576b95;font-weight:500;}
.liker-sep,.liker-more{color:#576b95;}
.liker-avatars{display:flex;flex-wrap:wrap;gap:4px;min-width:0;}
.liker-av{position:relative;width:28px;height:28px;border-radius:4px;background:#dfe6e2;color:#576b95;font-size:12px;font-weight:600;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.liker-av img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#fff;}
body.dark-mode .like-panel{background:#222;}
body.dark-mode .liker-name,body.dark-mode .liker-sep,body.dark-mode .liker-more,body.dark-mode .like-panel{color:#7993c4;}
body.dark-mode .liker-av{background:#333;color:#7993c4;}
body.dark-mode .liker-av img{background:#222;}
.liker-modal{display:none;position:fixed;inset:0;z-index:100030;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.55);}
.liker-dialog{width:100%;max-width:340px;max-height:90vh;overflow:auto;background:#fff;color:#111;border-radius:14px;padding:20px 18px 16px;box-shadow:0 12px 40px rgba(0,0,0,.25);}
.liker-dialog h3{font-size:16px;margin-bottom:4px;}
.liker-sub{font-size:12px;color:#888;margin-bottom:8px;line-height:1.5;}
.liker-dialog input[type=text]{width:100%;padding:9px 10px;margin-top:6px;border:1px solid #ddd;border-radius:8px;font-size:14px;background:#fafafa;color:#111;outline:none;}
.liker-dialog input[type=text]:focus{border-color:#07c160;background:#fff;}
.liker-qq-row{display:flex;align-items:center;gap:8px;margin-top:2px;}
.liker-qq-row input{margin-top:0!important;}
.liker-qq-preview{position:relative;flex:0 0 34px;width:34px;height:34px;border-radius:8px;background:#dfe6e2;color:#576b95;font-weight:600;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.liker-qq-preview img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#fff;}
.liker-avatar-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-top:6px;}
.liker-pick{padding:0;border:2px solid transparent;border-radius:10px;background:#f3f3f3;aspect-ratio:1/1;overflow:hidden;cursor:pointer;}
.liker-pick img{display:block;width:100%;height:100%;object-fit:cover;}
.liker-pick.selected{border-color:#07c160;box-shadow:0 0 0 2px rgba(7,193,96,.2);}
.liker-msg{min-height:16px;font-size:12px;color:#d33;margin-top:8px;}
.liker-actions{display:flex;gap:10px;margin-top:10px;}
.liker-actions button{flex:1;padding:10px;border:0;border-radius:8px;font-size:14px;cursor:pointer;background:#f0f0f0;color:#333;}
.liker-actions button[type=submit]{background:#07c160;color:#fff;font-weight:600;}
.liker-toast{position:fixed;left:50%;bottom:84px;transform:translateX(-50%) translateY(12px);background:rgba(40,40,40,.92);color:#fff;font-size:13px;padding:9px 14px;border-radius:999px;z-index:100040;opacity:0;visibility:hidden;transition:all .25s;display:flex;align-items:center;gap:10px;max-width:90vw;white-space:nowrap;}
.liker-toast.show{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0);}
.liker-toast span{overflow:hidden;text-overflow:ellipsis;}
.comment-time{flex:none;font-size:11px;line-height:1.3;color:#b2b2b2;white-space:nowrap;}
body.dark-mode .comment-time{color:#666;}
.comment-identity{display:flex;align-items:center;gap:6px;margin-bottom:6px;font-size:12px;color:#576b95;}
.comment-identity .ci-avatar{flex:0 0 22px;width:22px;height:22px;font-size:11px;}
/* v2.5.3：訪客存過郵箱時整段收起。用 !important 是因為 .comment-form input 有 width:100% 等規則，
   某些後面的規則可能把 display 改回 block，露出一個孤零零的郵箱框。 */
.comment-contact[hidden]{display:none!important;}
.liker-contact[hidden]{display:none!important;}
.liker-subscribe{display:flex;align-items:center;gap:7px;margin-top:10px;font-size:13px;color:#333;cursor:pointer;line-height:1.5;}
.liker-subscribe input{width:16px;height:16px;margin:0;flex:none;accent-color:#07c160;}
body.dark-mode .liker-subscribe{color:#ddd;}
.ci-name{font-weight:600;max-width:12em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ci-edit{border:0;background:none;color:#07c160;font-size:12px;cursor:pointer;padding:0 2px;}
body.dark-mode .comment-identity{color:#7993c4;}
.liker-toast button{background:none;border:0;color:#7bd88f;font-size:13px;cursor:pointer;padding:0;}
body.dark-mode .liker-dialog{background:#222;color:#e0e0e0;}
body.dark-mode .liker-dialog input[type=text]{background:#181818;color:#fff;border-color:#333;}
body.dark-mode .liker-pick{background:#2a2a2a;}
body.dark-mode .liker-actions button{background:#333;color:#ddd;}
body.dark-mode .liker-actions button[type=submit]{background:#07c160;color:#fff;}

.protected-post-modal{display:none;position:fixed;inset:0;z-index:100020;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.6);}
.protected-post-dialog{width:100%;max-width:340px;box-sizing:border-box;background:#fff;border-radius:12px;padding:24px 20px;box-shadow:0 10px 30px rgba(0,0,0,.2);text-align:center;position:relative;animation:modalScale .2s ease-out;}
.protected-post-dialog h3{font-size:16px;margin:0 0 14px;color:#24312d;}
.protected-post-dialog input{display:block;width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid #ddd;border-radius:8px;background:#fff;color:#222;caret-color:#07c160;font:inherit;font-size:16px;outline:none;opacity:1;pointer-events:auto;-webkit-text-security:none;}
.protected-post-dialog input:focus{border-color:#07c160;box-shadow:0 0 0 2px rgba(7,193,96,.12);}
.protected-post-actions{display:flex;justify-content:center;gap:8px;margin-top:14px;}
.protected-post-actions button{padding:8px 20px;border:0;border-radius:20px;font:inherit;font-size:14px;font-weight:bold;cursor:pointer;}
.protected-post-cancel{background:#f1f1f1;color:#666;}
.protected-post-submit{background:#07c160;color:#fff;box-shadow:0 2px 8px rgba(7,193,96,.3);}
.protected-post-message{min-height:18px;margin-top:8px;color:#b84d3f;font-size:12px;}
body.dark-mode .protected-post-dialog{background:#222;color:#fff;}
body.dark-mode .protected-post-dialog h3{color:#fff;}



#lightbox{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.95);z-index:9999;touch-action:none;overscroll-behavior:contain;}
#lightbox .lb-stage{position:absolute;inset:0;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;}
#lightbox .lb-stage.lb-grabbing{cursor:grabbing;}
#lightbox .lb-slide{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;will-change:transform;}
#lightbox .lb-slide.lb-anim{transition:transform .28s cubic-bezier(.22,.61,.36,1);}
#lightbox .lb-slide img{max-width:100%;max-height:100%;object-fit:contain;border-radius:2px;opacity:0;transition:opacity .18s;user-select:none;-webkit-user-select:none;-webkit-user-drag:none;transform-origin:center center;will-change:transform;}
#lightbox .lb-slide img.lb-ready{opacity:1;}
#lightbox .lb-slide img.lb-anim{transition:transform .22s cubic-bezier(.22,.61,.36,1),opacity .18s;}
#lightbox .lb-slide .lb-media{display:flex;align-items:center;justify-content:center;max-width:100%;max-height:100%;}
#lightbox .lb-slide video{max-width:100%;max-height:100%;object-fit:contain;border-radius:2px;background:#000;}
.lightbox-close{position:absolute;top:max(14px,env(safe-area-inset-top));right:18px;color:white;font-size:32px;cursor:pointer;background:none;border:none;font-weight:bold;z-index:10000;line-height:1;}
.lightbox-arrow{position:absolute;top:50%;transform:translateY(-50%);background:rgba(255,255,255,0.2);color:white;border:none;width:40px;height:40px;border-radius:50%;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:10000;}
.lightbox-prev{left:15px;}
.lightbox-next{right:15px;}
#lightbox .lb-bar{position:absolute;left:50%;bottom:max(18px,env(safe-area-inset-bottom));transform:translateX(-50%);display:flex;align-items:center;gap:6px;background:rgba(40,40,40,.72);border-radius:999px;padding:4px 6px;z-index:10000;color:#fff;font-size:13px;}
#lightbox .lb-counter{padding:0 10px;min-width:46px;text-align:center;font-variant-numeric:tabular-nums;}
#lightbox .lb-zbtn{width:32px;height:32px;border-radius:50%;border:0;background:rgba(255,255,255,.16);color:#fff;font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;}
#lightbox .lb-zbtn:active{background:rgba(255,255,255,.3);}

.tl-month-toast{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom,0px));transform:translate(-50%,8px);background:rgba(40,40,40,.86);color:#fff;font-size:13px;padding:8px 16px;border-radius:999px;opacity:0;visibility:hidden;transition:opacity .2s,transform .2s,visibility .2s;z-index:1001;pointer-events:none;}
.tl-month-toast.show{opacity:1;visibility:visible;transform:translate(-50%,0);}
.timeline-table{width:100%;border-collapse:collapse;table-layout:fixed;}
.timeline-tr{border-bottom:1px solid #f0f0f0;}
.timeline-tr td{padding:14px 8px 14px 12px;vertical-align:top;}
.col-date{width:75px;padding-right:4px !important;}
.col-date div{white-space:nowrap;}
.date-day{font-size:22px;font-weight:bold;color:#111;line-height:1;white-space:nowrap;}
.date-month{font-size:11px;font-weight:normal;color:#666;margin-left:2px;white-space:nowrap;}
.timeline-year-cell{position:-webkit-sticky;position:sticky;top:0;z-index:6;padding:2px 6px;background:rgba(255,255,255,.96);box-shadow:0 1px 0 #f0f0f0;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);}
.timeline-year{font-size:12px;font-weight:600;color:#999;letter-spacing:.04em;}
/* 年份行里的月份选择器（A3r）：菜单 absolute 贴在 sticky 的 td 上，不用 fixed 跟着吸顶 */
.tl-year-trigger{display:inline-flex;align-items:center;gap:4px;min-height:40px;padding:0 10px;
  border:0;border-radius:9px;background:none;color:#999;font:inherit;font-size:12px;font-weight:600;
  letter-spacing:.04em;cursor:pointer;-webkit-tap-highlight-color:transparent;}
.tl-year-trigger:hover{background:#f5f5f5;color:#666;}
.tl-year-trigger:focus-visible{outline:2px solid #07c160;outline-offset:2px;}
.tl-year-trigger[aria-expanded="true"]{background:#f0f0f0;color:#333;}
.tl-year-caret{transition:transform .16s ease;}
.tl-year-trigger[aria-expanded="true"] .tl-year-caret{transform:rotate(180deg);}
.tl-year-menu{position:absolute;z-index:30;top:100%;left:0;min-width:176px;
  max-width:min(260px,calc(100vw - 24px));max-height:min(56vh,320px);overflow-y:auto;
  padding:6px;border:1px solid rgba(0,0,0,.05);border-radius:14px;background:#fff;
  box-shadow:0 12px 32px rgba(0,0,0,.14),0 2px 8px rgba(0,0,0,.06);
  transform-origin:top left;animation:tl-menu-in .14s ease;}
@keyframes tl-menu-in{from{opacity:0;transform:translateY(-4px) scale(.98);}to{opacity:1;transform:none;}}
@media (prefers-reduced-motion:reduce){.tl-year-menu{animation:none;}.tl-year-caret{transition:none;}}
.tl-year-opt{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;
  min-height:40px;padding:0 12px;border:0;border-radius:9px;background:none;color:#333;
  font:inherit;font-size:14px;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;}
.tl-year-opt:hover{background:#f5f5f5;}
.tl-year-opt:focus-visible{outline:2px solid #07c160;outline-offset:-2px;}
.tl-year-opt.is-active{background:#eaf9f0;color:#059a50;font-weight:600;}
.tl-year-opt-count{font-size:12px;color:#bbb;font-variant-numeric:tabular-nums;}
.tl-year-opt.is-active .tl-year-opt-count{color:#07c160;}
body.dark-mode .timeline-year-cell{background:rgba(24,24,24,.96);box-shadow:0 1px 0 #2a2a2a;}
body.dark-mode .tl-year-trigger{color:#8a8a8a;}
body.dark-mode .tl-year-trigger:hover,
body.dark-mode .tl-year-trigger[aria-expanded="true"]{background:#242424;color:#ddd;}
body.dark-mode .tl-year-menu{background:#1f1f1f;border-color:#2a2a2a;box-shadow:0 12px 32px rgba(0,0,0,.6);}
body.dark-mode .tl-year-opt{color:#ddd;}
body.dark-mode .tl-year-opt:hover{background:#262626;}
body.dark-mode .tl-year-opt.is-active{background:#12301f;color:#52d98f;}
.col-content{width:auto;cursor:pointer;}
.col-content:hover{background:#fafafa;}
.media-post-card{display:flex;align-items:start;gap:10px;width:100%;height:64px;overflow:hidden;}
.timeline-grid{display:grid;gap:2px;width:64px;height:64px;border-radius:4px;overflow:hidden;flex-shrink:0;background:transparent;position:relative;}
.t-grid-1{grid-template-columns:minmax(0,1fr);}
.t-grid-2{grid-template-columns:repeat(2,minmax(0,1fr));}
.t-grid-4{grid-template-columns:repeat(2,minmax(0,1fr));}
.t-grid-3{grid-template-columns:repeat(3,minmax(0,1fr));}
.timeline-grid-item{width:100%;height:100%;aspect-ratio:1/1;object-fit:cover;cursor:pointer;min-width:0;min-height:0;overflow:hidden;font-size:0;line-height:0;}
/* v2.9.1：時間軸封 3×3，第 9 格蓋 +N。64px 的宮格每格約 20px，數字用 10px 才放得下 */
.tl-more{position:relative;overflow:hidden;display:block;}
.tl-more>img,.tl-more>video{display:block;width:100%;height:100%;object-fit:cover;}
.tl-more-n{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.5);color:#fff;font-size:10px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums;}
.timeline-video-fallback{display:block;width:100%;height:100%;object-fit:cover;background:#151515;}
.timeline-video-fallback-icon{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:#252525;color:#fff;font-size:12px;}
.timeline-video-badge{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,0.4);color:#fff;font-size:18px;pointer-events:none;}
.media-post-text-container{flex:1;height:64px;display:flex;flex-direction:column;justify-content:space-between;overflow:hidden;}
.media-post-text{font-size:14px;color:#111;line-height:1.35;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;}
.file-post-text-top{font-size:14px;color:#111;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;}
.file-name-bottom{font-size:12px;color:#576b95;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:2px;}
.text-post-card{font-size:14px;color:#111;line-height:1.42;width:100%;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;}

#backToTop{position:fixed;right:var(--fab-r);bottom:calc(24px + env(safe-area-inset-bottom,0px));width:44px;height:44px;padding:0;display:flex;align-items:center;justify-content:center;border:1px solid rgba(0,0,0,.2);border-radius:50%;background:rgba(255,255,255,.92);color:#333;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);box-shadow:0 4px 12px rgba(0,0,0,.1);cursor:pointer;-webkit-tap-highlight-color:transparent;opacity:0;visibility:hidden;transform:translateY(8px);transition:opacity .22s,transform .22s,visibility .22s;z-index:1000;}
#backToTop.is-visible{opacity:1;visibility:visible;transform:none;}
#backToTop:active{transform:scale(.94);}
#backToTop svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;}
body.dark-mode #backToTop{background:rgba(40,40,40,.75);color:#fff;border-color:rgba(255,255,255,.1);}
@media (prefers-reduced-motion:reduce){#backToTop{transition:none;}}


/* ===== 留言：楼中楼 / 作者回复 / 待审 / 回访提醒（v2.4.6）===== */
/* v2.9.7：楼中楼不再画左侧竖线，改为纯缩进 —— 回复头像回到 34px，与主楼正文同一条竖线。
   display:flex 是为了让相邻回复的 margin 不再合并：块级时 6+6 会塌成 6，flex 才是 12。 */
.comment-children{display:flex;flex-direction:column;margin:2px 0 6px 34px;padding-left:0;border-left:0;}
/* v2.9.8：全部收起时才收紧 —— 入口跟着上面那条主楼，上下留白拉匀（-6 抵消主楼自带的 margin-bottom:6）。
   详情/文章“露 2 条”是部分折叠，不加这个类，首条回复的间距保持不变。 */
.comment-children.is-all-folded:not(.is-open){margin:-6px 0 12px 34px;}
.comment-line.is-folded{display:none;}
.comment-children.is-open .comment-line.is-folded{display:flex;}
.comment-replies-toggle{display:flex;width:100%;align-items:center;margin:0;padding:2px 0 2px;border:0;border-top:1px solid #e7eaed;background:none;color:#98a0ac;font-size:12px;line-height:1.3;letter-spacing:.01em;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;}
/* 入口要让到回复正文那一列：children 左缘 34 + 头像 22 + gap 6 = 62，所以再推 28 */
.comment-children .comment-replies-toggle{margin-left:28px;width:calc(100% - 28px);}
.comment-children.is-open .comment-replies-toggle{color:#a4abb6;}
.comment-replies-toggle:active{opacity:.62;}
.comment-line.is-reply{gap:6px;margin:6px 0;}
.comment-line.is-reply .comment-avatar{width:22px;height:22px;flex-basis:22px;font-size:11px;border-radius:5px;}
.comment-at{color:#576b95;margin-right:2px;}
.comment-owner{display:inline-block;margin-left:5px;padding:1px 5px;border-radius:4px;background:#07c160;color:#fff;font-size:10px;line-height:1.4;font-weight:600;vertical-align:1px;}
/* v2.7.0：負 margin 抵消左右 padding，作者行的頭像回到與訪客同一條豎線 */
.comment-line.is-owner{background:#f3faf6;border-radius:6px;padding:6px 8px;margin:6px -8px;}
/* v2.7.0：回覆按鈕搬進右側信息列，點擊區撐到 32px 高；用顏色而不是透明度做層級
   （舊寫法 opacity:.6 在小屏上等於看不清，hover 又救不回來） */
.comment-reply-btn{margin:0;padding:0 6px;min-height:32px;display:inline-flex;align-items:center;border:0;background:none;color:#98a0ac;font-size:11.5px;line-height:1.2;border-radius:6px;cursor:pointer;}
.comment-reply-btn:hover{color:#576b95;background:rgba(87,107,149,.08);}
body.dark-mode .comment-reply-btn:hover{background:rgba(121,147,196,.12);}
@media (hover:none){.comment-reply-btn{color:#9aa4b2;}}
.comment-replying{display:flex;align-items:center;gap:6px;margin:0 0 6px;padding:4px 8px;border-radius:6px;background:#eef7f1;color:#07a854;font-size:12px;}
.comment-replying[hidden]{display:none;}
.comment-replying-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.comment-replying-cancel{border:0;background:none;color:#07a854;font-size:14px;line-height:1;cursor:pointer;padding:0 2px;}
.comment-contact-input{margin-top:6px;}
.comment-closed{margin:8px 0 0;padding:8px 10px;border-radius:6px;background:#f4f6fa;color:#8b94a3;font-size:12px;line-height:1.6;}
body.dark-mode .comment-closed{background:#252525;color:#9aa2ad;}
.comment-contact-label{display:block;margin:6px 0 3px;color:#576b95;font-size:12px;line-height:1.5;}
/* v2.7.0：label 后面那个「必填 / 選填/如有」的小字（原来是一整句灰字说明） */
.comment-contact-req{margin-left:6px;color:#9aa2ad;font-weight:400;}
body.dark-mode .comment-contact-label{color:#7993c4;}
body.dark-mode .comment-contact-req{color:#7d8593;}
.comment-pending-notice{margin:8px 0 0;padding:6px 10px;border-radius:6px;background:#fff8e6;color:#a5761b;font-size:12px;}
.comment-revisit{margin:8px 0;padding:6px 8px;border-radius:8px;background:#eef7f1;display:flex;flex-wrap:wrap;gap:4px;align-items:center;}
.comment-revisit-line{border:0;background:none;color:#07a854;font-size:12px;text-align:left;padding:3px 2px;cursor:pointer;flex:1;min-width:0;}
.comment-revisit-close{margin-left:auto;border:0;background:none;color:#9aa4b2;font-size:15px;line-height:1;cursor:pointer;padding:0 4px;}
.comment-line.is-pending{opacity:.72;}
.comment-line.is-pending .comment-text{color:#9aa4b2;}
.comment-line.is-revisit-hl{background:#fff4d6;border-radius:6px;transition:background .3s;}
body.dark-mode .comment-replies-toggle{color:#8b929d;border-top-color:#2e2e2e;}
body.dark-mode .comment-children.is-open .comment-replies-toggle{color:#9aa1ac;}
body.dark-mode .comment-line.is-owner{background:#15241b;}
body.dark-mode .comment-at{color:#7993c4;}
body.dark-mode .comment-replying{background:#16281e;color:#52d98f;}
body.dark-mode .comment-replying-cancel{color:#52d98f;}
body.dark-mode .comment-pending-notice{background:#2a2314;color:#d8b46a;}
body.dark-mode .comment-revisit{background:#16281e;}
body.dark-mode .comment-revisit-line{color:#52d98f;}
body.dark-mode .comment-line.is-revisit-hl{background:#332b12;}

.comment-line.is-hash-hl{background:#fff4d6;border-radius:6px;transition:background .3s;}
body.dark-mode .comment-line.is-hash-hl{background:#332b12;}

/* v2.9.7：三种收起入口共用一套观感（C 极简细线）
   首页主楼折叠 .comment-more / 楼中楼 .comment-replies-toggle / 详情页懒加载 .comment-load-more */
.comment-rest[hidden],.comment-more[hidden]{display:none;}
.comment-more{display:block;width:calc(100% - 34px);margin:0 0 0 34px;padding:10px 0 2px;border:0;background:none;color:#98a0ac;font-size:12px;line-height:1.3;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;}
.comment-more:active{opacity:.62;}
body.dark-mode .comment-more{color:#8b929d;}
.comment-load-more{display:block;width:100%;margin:8px 0 0;padding:9px 0 2px;border:0;border-top:1px solid #e7eaed;background:none;color:#98a0ac;font-size:12px;line-height:1.3;text-align:center;letter-spacing:.02em;cursor:pointer;-webkit-tap-highlight-color:transparent;}
.comment-load-more:active{opacity:.62;}
.comment-load-more[disabled]{cursor:default;opacity:.75;}
body.dark-mode .comment-load-more{color:#8b929d;border-top-color:#2e2e2e;}
