/* 兩個部落格共用的基本樣式；各站的版型在 lab.css／journal.css */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:"Noto Sans TC","Microsoft JhengHei","PingFang TC",system-ui,sans-serif;color:var(--ink);background:var(--bg);line-height:1.75;font-size:16px}
img{max-width:100%;height:auto;display:block}
a{color:inherit;text-decoration:none}
a:hover{color:var(--brand)}
h1,h2,h3{margin:0}
.wrap{max-width:1760px;margin:0 auto;padding:0 20px}
.sticky{position:sticky;top:20px;display:flex;flex-direction:column;gap:22px;align-items:center}

/* 預覽標記 */
.preview-bar{background:#fff3b0;color:#5b4a00;text-align:center;font-size:14px;padding:6px 12px;border-bottom:1px solid #e6d36b}
.badge{display:inline-block;font-size:12px;line-height:1.6;padding:0 8px;border-radius:99px;font-weight:700;letter-spacing:0}
.badge-draft{background:#ffe0e0;color:#9a1c1c}
.badge-review{background:#fff3b0;color:#6b5600}
.badge-sample{background:#ece4ff;color:#4b2a9a}
.disclose{margin:14px 0 0;padding:9px 14px;font-size:13.5px;line-height:1.6;color:var(--ink-soft);background:var(--note-bg);border-left:3px solid var(--accent);border-radius:4px}
mark.todo{background:#fff3b0;color:#5b4a00;padding:0 3px;border-radius:3px}
.pending{border:2px dashed #e0c44c;background:#fffbe6;padding:12px 16px;border-radius:8px;margin:20px 0}
.pending-label{font-size:13px;font-weight:700;color:#8a6d00;margin-bottom:6px}

/* 頂端經營者說明 */
.topbar{background:var(--top-bg);color:var(--top-ink);font-size:13px;padding:6px 0}
.topbar a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.topbar .sep{opacity:.45;margin:0 .6em}

/* 分類標籤、日期列 */
.kicker{display:inline-block;font-size:13px;font-weight:700;letter-spacing:.06em;color:var(--c,var(--brand))}
.kicker:hover{color:var(--c,var(--brand));text-decoration:underline}
.kicker-plain{font-size:13px;font-weight:700;letter-spacing:.2em;color:var(--brand);margin:0 0 6px}
.meta{display:flex;flex-wrap:wrap;align-items:center;gap:2px 12px;font-size:13px;color:var(--muted);margin-top:8px}

/* 卡片共用 */
.c-img{display:block;overflow:hidden;background:#e9ecea}
.c-img img{width:100%;aspect-ratio:16/9;object-fit:cover;transition:transform .35s}
.c-img:hover img{transform:scale(1.03)}
.c-title{line-height:1.45;margin-top:4px}
.c-title a:hover{color:var(--brand)}
.c-sum{color:var(--ink-soft);margin:8px 0 0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}

/* 近期更新清單 */
.rank{list-style:none;margin:0;padding:0;counter-reset:r}
.rank li{display:grid;grid-template-columns:28px 92px 1fr;gap:10px;align-items:start;padding:12px 0;border-top:1px solid var(--line);counter-increment:r}
.rank li:first-child{border-top:0;padding-top:4px}
.rank li::before{content:counter(r);font-weight:900;font-size:20px;color:var(--brand);line-height:1.3;text-align:center}
.r-img{border-radius:6px;overflow:hidden}
.r-img img{aspect-ratio:16/9;object-fit:cover;width:92px}
.r-title{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:14.5px;line-height:1.5;font-weight:500}
.r-date{display:block;font-size:12px;color:var(--muted);margin-top:2px}

/* 廣告位 */
.ad{display:flex;flex-direction:column;align-items:center;gap:4px;width:100%}
.ad-label{font-size:11px;color:var(--muted);letter-spacing:.3em}
.ad-box{display:flex;overflow:hidden;border-radius:6px}
.ad-left .ad-box{width:160px;height:600px}
.ad-right .ad-box{width:300px;max-width:100%;height:250px}
.ad-bottom{margin:36px auto}
.ad-bottom .ad-box{width:728px;max-width:100%;min-height:90px}
.ad-empty{align-items:center;justify-content:center;text-align:center;border:2px dashed #c4cbc7;color:#7f8984;font-size:13px;background:repeating-linear-gradient(45deg,#fafbfa 0 10px,#f0f2f1 10px 20px)}
.ad-img img{width:100%;height:100%;object-fit:cover}
.ad-house{flex-direction:column;justify-content:space-between;gap:12px;padding:20px 18px;background:linear-gradient(160deg,#1f4630,#2d6442 55%,#3d7d54);color:#fff}
.ad-house:hover{color:#fff;filter:brightness(1.06)}
.ah-brand{display:flex;align-items:center;gap:8px;font-size:12px;letter-spacing:.05em;opacity:.92}
.ah-brand img{width:26px;height:26px;background:#fff;border-radius:50%;padding:3px}
.ah-title{font-size:22px;line-height:1.35;font-weight:900}
.ah-lines{display:flex;flex-direction:column;gap:6px;font-size:13px;line-height:1.5;opacity:.95}
.ah-lines span::before{content:"✓ ";color:#f5b76c;font-weight:700}
.ah-cta{align-self:flex-start;background:#d97f28;color:#fff;font-weight:700;font-size:14px;padding:7px 14px;border-radius:99px}
.ad-left .ah-title{font-size:22px}
.ad-left .ah-lines{gap:12px}
.ad-right .ad-house{padding:18px 20px}
.ad-bottom .ad-house{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px 18px;padding:14px 22px}
.ad-bottom .ah-title{font-size:19px}
.ad-bottom .ah-title br{display:none}
.ad-bottom .ah-lines{flex-direction:row;gap:12px;flex:1}
.ad-bottom .ah-cta{align-self:center}

/* 方塊、區塊標題 */
.box{background:var(--card);border-radius:var(--radius);padding:18px 18px}
.sec-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:14px}
.sec-head h2{font-size:19px;font-weight:900}
.sec-head a{font-size:13.5px;color:var(--muted)}
.sec-head a:hover{color:var(--brand)}
.about-box h2{font-size:17px;margin-bottom:8px}
.about-box p{font-size:14px;color:var(--ink-soft);margin:0 0 10px}
.about-box .links{display:flex;gap:16px;font-weight:700;color:var(--brand);margin:0}

/* 麵包屑 */
.crumb{display:flex;flex-wrap:wrap;gap:8px;font-size:13px;color:var(--muted);padding:18px 0 12px}
.crumb a:hover{color:var(--brand)}

/* 文章頁 */
.post-grid{display:grid;grid-template-columns:180px minmax(0,1fr) 340px;gap:40px;align-items:stretch}
.post-left,.post-right{min-width:0}
.post-right{display:flex;flex-direction:column;gap:22px}
.post-right .sticky{top:20px}
.post-head h1{font-size:34px;line-height:1.4;margin:8px 0 12px;font-weight:900}
.post-head .dek{font-size:18px;color:var(--ink-soft);margin:0 0 14px;line-height:1.7}
.byline{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;font-size:14px;color:var(--muted);padding-bottom:18px;border-bottom:1px solid var(--line)}
.byline .by{color:var(--ink);font-weight:700}
.post-cover{margin:22px 0 26px}
.post-cover img{width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:var(--radius-img)}
.post-cover figcaption{font-size:12.5px;color:var(--muted);margin-top:8px}
.content{font-size:19px;line-height:1.95;color:var(--ink-body);overflow-wrap:anywhere}
.content p{margin:0 0 1.2em}
.content h2{font-size:23px;line-height:1.45;margin:1.8em 0 .7em;padding-left:12px;border-left:5px solid var(--accent)}
.content h3{font-size:19px;margin:1.5em 0 .5em}
.content ul,.content ol{padding-left:1.4em;margin:0 0 1.2em}
.content li{margin:.35em 0}
.content a{color:var(--brand);text-decoration:underline;text-underline-offset:3px}
.content blockquote{margin:1.6em 0;padding:6px 0 6px 20px;border-left:4px solid var(--accent);color:var(--ink-soft);font-size:18px}
.content blockquote p{margin:0}
.table-wrap{overflow-x:auto;margin:0 0 1.4em}
.content table{width:100%;border-collapse:collapse;font-size:16px;line-height:1.6}
.content th,.content td{border:1px solid var(--line);padding:8px 10px;text-align:left;vertical-align:top}
.content th{background:var(--bg-soft,#f4f5f2);font-weight:700}
.refs{margin-top:36px;padding-top:18px;border-top:1px solid var(--line)}
.refs h2{font-size:17px;margin-bottom:8px}
.refs ol{margin:0;padding-left:1.4em;font-size:14.5px;color:var(--ink-soft)}
.refs li{margin:.3em 0;overflow-wrap:anywhere}
.refs a{text-decoration:underline;text-underline-offset:3px}
.post-note{margin:22px 0 0;padding:12px 16px;background:var(--note-bg);border-radius:8px;font-size:13.5px;color:var(--ink-soft)}

/* 分享 */
.share{display:flex;gap:8px;align-items:center}
.sh-label{font-size:12px;color:var(--muted);letter-spacing:.2em}
.sh{display:inline-flex;align-items:center;justify-content:center;font:inherit;font-size:13px;font-weight:700;border-radius:99px;padding:6px 14px;border:1px solid var(--line);background:var(--card);color:var(--ink);cursor:pointer}
.sh:hover{border-color:var(--brand);color:var(--brand)}
.sh-line{color:#06a845}
.sh-fb{color:#1877f2}
.share-v{flex-direction:column;align-items:stretch;width:160px}
.share-h{margin-top:26px;flex-wrap:wrap}

/* 延伸閱讀、上下篇 */
.more{margin:10px 0 30px}
.prevnext{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:0 0 30px}
.prevnext a{display:block;padding:16px 18px;background:var(--card);border-radius:var(--radius);font-weight:700;line-height:1.5}
.prevnext a span{display:block;font-size:12.5px;font-weight:500;color:var(--muted);margin-bottom:4px}
.pn-next{text-align:right}
.more + .prevnext + .about-box,.prevnext + .about-box{margin-bottom:40px}

/* 列表頁 */
.page-head{padding:10px 0 22px}
.page-head h1{font-size:32px;font-weight:900;line-height:1.35}
.page-head p{color:var(--ink-soft);margin:8px 0 0}
.page-head.center{text-align:center;padding:80px 0}
.list-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:40px;align-items:stretch;margin-bottom:40px}
.list-main{min-width:0}
.c-row{display:grid;grid-template-columns:300px 1fr;gap:22px;padding:20px 0;border-top:1px solid var(--line)}
.c-row:first-child{border-top:0;padding-top:0}
.c-row .c-img{border-radius:var(--radius-img)}
.c-row .c-title{font-size:21px}
.page-body{min-width:0}
.empty{color:var(--muted)}

/* 頁尾 */
.ft{background:var(--ft-bg);color:var(--ft-ink);margin-top:50px;padding:44px 0 26px;font-size:14px}
.ft a:hover{color:#fff;text-decoration:underline}
.ft-top{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:30px;padding-bottom:26px;border-bottom:1px solid rgba(255,255,255,.15)}
.ft-name{font-size:20px;font-weight:900;color:#fff}
.ft-brand p{margin:10px 0 0;line-height:1.8;opacity:.85}
.ft-col{display:flex;flex-direction:column;gap:6px}
.ft-col h3{font-size:13px;letter-spacing:.2em;opacity:.6;margin-bottom:4px}
.ft-co{padding-top:18px;font-size:13px;opacity:.85}
.ft-co p{margin:0 0 4px}
.ft-co strong{color:#fff}

/* 響應式 */
@media (max-width:1099px){
  .post-grid{grid-template-columns:minmax(0,1fr) 280px;gap:30px}
  .post-left{display:none}
  .grid3{grid-template-columns:repeat(2,minmax(0,1fr))}
  .list-grid{grid-template-columns:minmax(0,1fr) 280px;gap:30px}
  .c-row{grid-template-columns:220px 1fr}
}
@media (max-width:820px){
  .post-grid,.list-grid{grid-template-columns:1fr}
  .post-right .sticky,.sticky{position:static}
  .post-head h1{font-size:27px}
  .post-head .dek{font-size:16.5px}
  .content{font-size:17px}
  .ft-top{grid-template-columns:1fr 1fr}
  .ft-brand{grid-column:1/-1}
}
@media (max-width:600px){
  .wrap{padding:0 16px}
  .grid2,.grid3{grid-template-columns:1fr}
  .c-row{grid-template-columns:120px 1fr;gap:14px}
  .c-row .c-title{font-size:17px}
  .c-row .c-sum{display:none}
  .prevnext{grid-template-columns:1fr}
  .pn-next{text-align:left}
  .page-head h1{font-size:26px}
  .topbar{font-size:12px}
  .ad-bottom .ah-lines{display:none}
}
