/*  article-blue - 老麥文章樣式(prosilver 子樣式)
    只改文章頁(body.section-viewtopic),其他頁面維持 prosilver 原樣。
    -------------------------------------------------------------- */

@import url("../../prosilver/theme/stylesheet.css");
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&family=Noto+Serif+TC:wght@600;900&display=swap");

:root{
  --m-bg:#e9f1f8; --m-paper:#fbfaf6; --m-ink:#1d2b3a; --m-muted:#53657a; --m-accent:#2f6fa8; --m-line:#c5d5e5;
  --m-note:#fff7d6; --m-note-ink:#4a3d0a; --m-frame:#fdfcf8; --m-shadow:rgba(29,43,58,.18);
  --m-serif:"Noto Serif TC","Songti TC","PMingLiU",serif;
  --m-sans:"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;
}
@media (prefers-color-scheme:dark){
  :root{
    --m-bg:#101a26; --m-paper:#172433; --m-ink:#e6eef6; --m-muted:#9db0c4; --m-accent:#7db7ea; --m-line:#2c3f54;
    --m-note:#3a3414; --m-note-ink:#f3e7a8; --m-shadow:rgba(0,0,0,.5);
  }
}

/* ---------- 頁面外框(全站套用此樣式的頁面皆適用) ---------- */
:root{--m-wrap:1000px;--m-fs:19px;--m-read:100%;--m-hot:#e5421f;--m-head-a:#ffffff;--m-head-b:#fff3ec;--m-logo:url("https://www.mydc.com.tw/styles/lmrepair/theme/images/laomai-mark.png")}
@media (prefers-color-scheme:dark){:root{--m-head-a:#1b2a3b;--m-head-b:#2a2530;--m-hot:#ff7a5c}}
html{background:var(--m-bg)}
html body{background:var(--m-bg);color:var(--m-ink);font-family:var(--m-sans);margin:0;padding:0 0 env(safe-area-inset-bottom,0)}
body #wrap{max-width:var(--m-wrap);width:auto;background:transparent;border:0;border-radius:0;box-shadow:none;margin:0 auto;padding:20px 28px 0;min-width:0}
body a{color:var(--m-accent)}

/* 頁首:圓角卡片 + 標誌 + 站名 + 副標 + 搜尋 */
body .headerbar{background:linear-gradient(135deg,var(--m-head-a) 0%,var(--m-head-b) 100%);color:var(--m-ink);border-radius:24px;box-shadow:0 8px 28px var(--m-shadow);margin:0;padding:14px 24px}
body .headerbar .inner{display:flex;align-items:center;justify-content:space-between;gap:16px}
body .site-description{float:none;width:auto;display:grid;grid-template-columns:auto 1fr;column-gap:14px;align-items:center}
body .site-description .logo{grid-row:1 / span 2;float:none;padding:0;margin:0;display:block}
body .site-description .site_logo{display:block;width:56px;height:56px;background:var(--m-logo) center/contain no-repeat}
body .site-description h1{grid-column:2;font-family:var(--m-sans);font-size:26px;font-weight:700;line-height:1.25;margin:0;color:var(--m-ink)}
body .site-description > p:not(.skiplink){grid-column:2;margin:2px 0 0;font-size:13px;color:var(--m-muted)}
body .search-header{float:none;margin:0;border-radius:18px;box-shadow:none;background:var(--m-paper);border:0}

/* 主選單 */
body .mai-nav{display:flex;flex-wrap:wrap;gap:6px 28px;padding:18px 6px 8px;font-size:15px;font-weight:700}
body .mai-nav a{color:var(--m-ink);text-decoration:none}
body .mai-nav a:hover{color:var(--m-accent)}
body .mai-nav .mai-nav-hot{margin-left:auto;color:var(--m-hot)}

/* prosilver 原有的快速連結/麵包屑列:縮小、去底色 */
body .navbar{background:transparent;border-radius:0;padding:0;border-bottom:1px solid var(--m-line)}
body .navbar *{color:var(--m-muted)}
body .navbar a:hover{color:var(--m-accent);text-decoration:none}
body #page-footer .navbar{border-bottom:0;border-top:1px solid var(--m-line);margin-top:48px}
body .copyright{color:var(--m-muted);font-size:12px;padding:12px 0 24px}

@media (max-width:640px){
  :root{--m-fs:18px}
  body #wrap{padding:14px 14px 0}
  body .headerbar{padding:12px 16px;border-radius:18px}
  body .site-description h1{font-size:21px}
  body .mai-nav{gap:6px 18px}
  body .mai-nav .mai-nav-hot{margin-left:0}
}

/* ---------- 文章標題 ---------- */
body.section-viewtopic h2.topic-title,body.section-viewtopic .post{max-width:var(--m-read);margin-left:auto;margin-right:auto}
body.section-viewtopic h2.topic-title{font-family:var(--m-serif);font-size:clamp(28px,6.2vw,42px);font-weight:900;line-height:1.35;letter-spacing:.01em;color:var(--m-ink);margin:36px 0 4px;padding:0;border:0}
body.section-viewtopic h2.topic-title a{color:inherit}
body.section-viewtopic h2.topic-title a:hover{text-decoration:none}

/* ---------- 文章本體 ---------- */
body.section-viewtopic .post{background:transparent;border:0;border-radius:0;box-shadow:none;margin:0;padding:0}
body.section-viewtopic .post .inner{padding:0}
body.section-viewtopic .postbody{float:none;width:auto;max-width:none;padding:0;color:var(--m-ink)}
body.section-viewtopic .postbody h3{font-family:var(--m-serif);font-size:calc(var(--m-fs) * 1.3);border:0;margin:40px 0 4px;padding:0;text-transform:none}
body.section-viewtopic .postbody h3 a{color:var(--m-ink)}
body.section-viewtopic .art-meta{margin:6px 0 0;color:var(--m-muted);font-size:15px;line-height:1.6}
body.section-viewtopic .art-by{margin-right:.6em;font-weight:700}
body.section-viewtopic .postbody .content{font-family:var(--m-sans);font-size:var(--m-fs);line-height:1.9;color:var(--m-ink);min-height:0;overflow:visible;padding:8px 0 0}
body.section-viewtopic .postbody .content a{color:var(--m-accent)}
body.section-viewtopic .postbody ul.post-buttons{opacity:.55;margin:0}
body.section-viewtopic .postbody ul.post-buttons:hover{opacity:1}
body.section-viewtopic .postbody .notice,
body.section-viewtopic .signature{color:var(--m-muted);border-color:var(--m-line)}
body.section-viewtopic .art-foot{background:transparent;border:0;margin:32px auto 0;max-width:var(--m-read)}

/* ---------- 自訂 BBCode 元件 ---------- */
.content .art-h2{color:var(--m-ink);border-bottom:0;font-family:var(--m-serif);font-size:calc(var(--m-fs) * 1.5);font-weight:600;line-height:1.35;margin:56px 0 0;padding-top:20px;border-top:2px solid var(--m-line)}
.content .art-lead{font-size:calc(var(--m-fs) + 2px);color:var(--m-muted);margin:16px 0 0}
.content .art-film{margin:24px auto;max-width:320px;background:var(--m-frame);padding:12px 12px 0;border-radius:3px;box-shadow:0 6px 18px var(--m-shadow)}
.content .art-film img{display:block;width:100%;height:auto;margin:0;border:0}
.content .art-film figcaption{padding:12px 4px 14px;font-size:calc(var(--m-fs) - 3px);line-height:1.6;color:#4b5a6a;min-height:44px}
.content .art-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:24px 0;align-items:start}
.content .art-pair .art-film{margin:0 auto;max-width:360px;width:100%}
.content .art-pair .art-film:nth-child(odd){transform:rotate(-1deg)}
.content .art-pair .art-film:nth-child(even){transform:rotate(1deg)}
.content .art-diagram{margin:26px 0;background:#fff;border:1px solid var(--m-line);border-radius:4px;padding:10px}
.content .art-diagram img{display:block;width:100%;height:auto;margin:0;border:0}
.content .art-diagram figcaption{color:#3d4d5e;font-size:calc(var(--m-fs) - 3px);line-height:1.6;padding:8px 6px 4px}
.content .art-note{background:var(--m-note);color:var(--m-note-ink);padding:18px 20px;border-radius:2px;margin:0}
.content .art-verdict{background:var(--m-paper);border-left:6px solid var(--m-accent);padding:16px 20px;margin:24px 0;font-weight:500}
.content .art-card{background:var(--m-paper);padding:14px 16px;border-radius:4px}
.content .art-pair > .art-note,.content .art-pair > .art-card{align-self:center}

/* [list=1] 做成圓形編號 */
.content ol,.content ol li{list-style:none !important}
.content ol{counter-reset:m;padding:0;margin:20px 0}
.content ol li{counter-increment:m;position:relative;padding:12px 0 12px 48px;border-bottom:1px solid var(--m-line);margin:0}
.content ol li::before{content:counter(m);position:absolute;left:0;top:12px;width:32px;height:32px;border-radius:50%;background:var(--m-accent);color:var(--m-bg);display:grid;place-items:center;font-weight:700;font-size:15px;line-height:1}

/* 區塊元件後面 phpBB 自動補的換行不要顯示 */
.content .art-h2 + br,.content .art-lead + br,.content figure + br,
.content .art-pair + br,.content .art-note + br,.content .art-verdict + br,.content .art-card + br,
.content .art-pair > br{display:none}

@media (max-width:480px){
  .content .art-pair{grid-template-columns:minmax(0,1fr)}
  body.section-viewtopic #wrap{padding:0 14px}
}

/* ---------- 內嵌附件版元件:[afilm] / [adiagram](圖片用 [attachment=N] 放在標籤裡) ---------- */
.content .art-att{font-size:calc(var(--m-fs) - 3px);line-height:1.6}
.content .art-film.art-att{padding:12px 12px 14px;color:#4b5a6a}
.content .art-diagram.art-att{color:#3d4d5e}
.content .art-att .inline-attachment{margin:0 0 10px;padding:0}
.content .art-att .inline-attachment dl,
.content .art-att .inline-attachment dl.thumbnail,
.content .art-att .inline-attachment dl.file{margin:0;padding:0;border:0;background:transparent;box-shadow:none;float:none;width:auto;max-width:none}
.content .art-att .inline-attachment dl dt{display:block;float:none;width:auto;margin:0;padding:0;border:0;background:transparent}
.content .art-att .inline-attachment dl dd{display:none}
.content .art-att .inline-attachment img,
.content .art-att .inline-attachment img.postimage{display:block;width:100%;max-width:100%;height:auto;max-height:none;margin:0;padding:0;border:0;background:transparent}
.content .art-att br{display:none}

/* [stack]:讓 [pair] 的一欄可放多個區塊(例如便利貼 + 結論框) */
.content .art-stack{display:flex;flex-direction:column;gap:16px;align-self:center;min-width:0}
.content .art-stack > br{display:none}
.content .art-stack .art-verdict{margin:0}
.content .art-stack + br{display:none}

/* ================= 版區列表(viewforum):文章卡片目錄 ================= */
body.section-viewforum h2.forum-title{font-family:var(--m-serif);font-size:clamp(28px,6.2vw,42px);font-weight:900;line-height:1.35;color:var(--m-ink);max-width:var(--m-read);margin:36px auto 6px;padding:0;border:0}
body.section-viewforum h2.forum-title a{color:inherit}
body.section-viewforum h2.forum-title a:hover{text-decoration:none}
body.section-viewforum .art-forum-desc{max-width:var(--m-read);margin:0 auto 8px;color:var(--m-muted);font-size:calc(var(--m-fs) - 1px);line-height:1.8}
.art-list{list-style:none;margin:24px auto 0;padding:0;max-width:var(--m-read)}
.art-item{background:var(--m-paper);border-radius:16px;box-shadow:0 4px 16px var(--m-shadow);padding:22px 28px;margin:0 0 16px;border-left:6px solid transparent;transition:transform .15s ease,box-shadow .15s ease}
.art-item:hover{transform:translateY(-2px);box-shadow:0 8px 24px var(--m-shadow)}
.art-item.is-unread{border-left-color:var(--m-accent)}
.art-item.reported{border-left-color:var(--m-hot)}
.art-item-title{margin:0;padding:0;border:0;font-family:var(--m-serif);font-size:calc(var(--m-fs) * 1.35);font-weight:600;line-height:1.45;text-transform:none}
.art-item-title a.topictitle{color:var(--m-ink);font-family:inherit;font-size:inherit;font-weight:inherit;text-decoration:none}
.art-item-title a.topictitle:hover{color:var(--m-accent)}
.art-item-meta{margin:8px 0 0;font-size:15px;color:var(--m-muted)}
.art-item-meta a{color:var(--m-muted)}
.art-badge{display:inline-block;margin-right:8px;padding:0 10px;border-radius:999px;background:var(--m-accent);color:var(--m-bg);font-size:13px;font-weight:700;line-height:22px;text-decoration:none}
.art-badge-new{background:var(--m-hot);color:#fff}
body.section-viewforum .art-foot{background:transparent;border:0;margin:28px auto 0;max-width:var(--m-read)}
body.section-viewforum .panel{background:var(--m-paper);color:var(--m-ink);border-radius:16px;max-width:var(--m-read);margin-left:auto;margin-right:auto}
@media (max-width:640px){.art-item{padding:18px 18px;border-radius:14px}}

/* ---------- 1.0.7:圖解卡片 —— 圖片置中、說明文字置中 ---------- */
.content .art-diagram{text-align:center}
.content .art-diagram img,
.content .art-diagram.art-att .inline-attachment img,
.content .art-diagram.art-att .inline-attachment img.postimage{display:block !important;width:auto !important;max-width:100% !important;height:auto !important;margin:0 auto !important}
.content .art-diagram .inline-attachment,
.content .art-diagram .attach-image,
.content .art-diagram.art-att .inline-attachment dl dt{width:100% !important;max-height:none !important;overflow:visible !important;text-align:center;margin-left:0;margin-right:0;padding:0;border:0}
.content .art-diagram.art-att .inline-attachment{margin-bottom:14px}
.content .art-diagram figcaption{text-align:center;padding:10px 12px 6px}
