/* =========================================================
   RAR · 每日設計情報 — 深色編輯風（疊在 Casper screen.css 之上）
   色票：深底 #0a0a0a / #0d0d0f / #111114，accent 藍 #3b82f6、紫 #a78bfa
   注意：文章內文的 inline-style 卡片、每篇的 codeinjection_head
   （.article-image 380px、內文圖 440px）都不在這裡改，避免破壞舊文章。
   ========================================================= */

:root {
    --rar-bg: #0a0a0a;
    --rar-s1: #0d0d0f;
    --rar-s2: #111114;
    --rar-line: #1c1c20;
    --rar-line2: #2a2a30;
    --rar-tx: #f5f5f7;
    --rar-mu: #a1a1aa;
    --rar-dim: #6b7280;
    --rar-body: #c9cdd3;
    --rar-blue: #3b82f6;
    --rar-purple: #a78bfa;
    --rar-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --color-darkmode: #0a0a0a;
}

html.dark-mode body.rar {
    background: var(--rar-bg);
    color: var(--rar-mu);
    font-family: var(--font-sans);
}
html.dark-mode body.rar img { opacity: 1; }
.rar a { text-decoration: none; }

/* ---------- 共用小元件 ---------- */
.rar-mono {
    font-family: var(--rar-mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    line-height: 1.6;
}
.rar-blue { color: var(--rar-blue); }
.rar-dim { color: var(--rar-dim); }
.rar-dot { display: inline-block; width: 8px; height: 8px; margin-right: 10px; border-radius: 50%; background: var(--rar-blue); box-shadow: 0 0 12px var(--rar-blue); vertical-align: middle; }

.rar-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 18px; height: 40px; border-radius: 999px;
    font-size: 14px; font-weight: 600; white-space: nowrap;
    transition: opacity .2s, transform .2s;
}
.rar-btn:hover { opacity: .9; }
.rar-btn-purple { background: var(--rar-purple); color: #0a0a0a !important; }
.rar-btn-white { background: var(--rar-tx); color: #0a0a0a !important; }
.rar-btn-line { border: 1px solid var(--rar-line2); color: var(--rar-tx) !important; }

.rar-box { display: block; background: var(--rar-s1); border: 1px solid var(--rar-line); border-radius: 14px; }

.rar-sec { display: flex; align-items: baseline; gap: 14px; color: var(--rar-dim); }
.rar-sec b { color: var(--rar-tx); font-size: 20px; font-weight: 700; }

/* ---------- 頁首 ---------- */
html.dark-mode body.rar:not(.has-cover) .gh-head,
.rar .gh-head {
    position: sticky; top: 0; z-index: 150;
    height: 64px;
    background: rgba(10, 10, 10, .86);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rar-line);
    color: var(--rar-tx);
    font-size: 14px;
}
.rar .gh-head-inner { column-gap: 28px; }
.rar.is-head-left-logo.home-template .gh-head:not(.is-header-hidden) .gh-head-logo { display: flex; }
.rar.is-head-left-logo.home-template .gh-head:not(.is-header-hidden) .gh-head-menu { margin-left: 0; }
@media (min-width: 992px) { .rar.is-head-left-logo .gh-head-menu { margin: 0; } }
.rar .gh-head-logo { display: flex; align-items: center; color: var(--rar-tx); font-size: 17px; font-weight: 700; letter-spacing: .04em; }
.rar .gh-head-logo img { max-height: 30px; }
.rar .gh-head-menu .nav { gap: 24px; }
.rar .gh-head-menu .nav a { color: var(--rar-mu); font-size: 14px; font-weight: 500; text-transform: none; }
.rar .gh-head-menu .nav a:hover,
.rar .gh-head-menu .nav .nav-current a { color: var(--rar-tx); opacity: 1; }
.rar .rar-ext::after { content: " ↗"; color: var(--rar-dim); font-size: 12px; }
.rar .gh-head-actions { gap: 16px; }
.rar .gh-head-members { gap: 16px; }
.rar .gh-head-link { color: var(--rar-mu); font-size: 14px; }
.rar .gh-head-button { height: 40px; padding: 0 18px; font-size: 14px; background: var(--rar-tx); color: #0a0a0a; }
.rar .gh-icon-btn svg { width: 19px; height: 19px; color: var(--rar-mu); }
.rar .rar-menu-aiwaken { display: none; }
/* 選單太長時收進「•••」的下拉選單：改成深色 */
.rar .gh-dropdown { background: var(--rar-s2); border: 1px solid var(--rar-line2); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5); margin-top: 18px; }
.rar .gh-head-menu .gh-dropdown li a { color: var(--rar-mu); padding: 8px 18px; }
.rar .gh-head-menu .gh-dropdown li a:hover { color: var(--rar-tx); background: var(--rar-s1); }
.rar .gh-more-toggle svg { fill: var(--rar-mu); }

@media (max-width: 767px) {
    .rar #gh-head { height: 60px; }
    .rar #gh-head .gh-head-brand { height: 60px; }
    .rar .rar-head-aiwaken { display: none; }
    .rar.gh-head-open #gh-head { position: fixed; inset: 0; height: 100%; background: var(--rar-bg); border-bottom: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
    .rar.gh-head-open #gh-head .gh-head-inner { height: auto; min-height: 100%; }
    .rar.gh-head-open #gh-head .gh-head-actions { background: var(--rar-bg); }
    .rar.gh-head-open #gh-head .gh-head-menu { display: flex; flex-direction: column; align-items: center; gap: 28px; }
    .rar.gh-head-open .rar-menu-aiwaken { display: inline-flex; height: 48px; font-size: 16px; }
    .rar #gh-head .nav a { font-size: 22px; color: var(--rar-tx); }
    .rar #gh-head .gh-head-button { background: var(--rar-tx); color: #0a0a0a; height: 48px; }
}
html.dark-mode .rar .gh-burger::before,
html.dark-mode .rar .gh-burger::after,
html.dark-mode body.rar .gh-burger::before,
html.dark-mode body.rar .gh-burger::after { background-color: var(--rar-tx); }

/* ---------- 首頁 ---------- */
.rar-home { padding-top: 48px; }

.rar-hero { display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: center; }
.rar-hero-cover { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 16px; border: 1px solid var(--rar-line); background: var(--rar-s2); }
.rar-hero-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.rar-hero-cover:hover img { transform: scale(1.02); }
.rar-hero-title { margin: 16px 0; font-size: 36px; line-height: 1.3; letter-spacing: -.01em; font-weight: 800; }
.rar-hero-title a { color: var(--rar-tx); }
.rar-hero-excerpt { margin: 0; font-size: 15.5px; line-height: 1.75; color: var(--rar-mu); }
.rar-hero-meta { margin: 20px 0 24px; }

.rar-feedhead { display: flex; align-items: center; gap: 20px; margin: 72px 0 28px; }
.rar-feedhead .rar-sec { flex: none; }

.rar-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); padding-right: 24px; }
.rar-chips::-webkit-scrollbar { display: none; }
.rar-chip { flex: none; white-space: nowrap; padding: 6px 14px; border: 1px solid var(--rar-line2); border-radius: 999px; font-size: 13px; color: var(--rar-mu); transition: border-color .2s, color .2s; }
.rar-chip:hover { border-color: var(--rar-dim); color: var(--rar-tx); }
.rar-chip em { margin-left: 6px; font-style: normal; font-family: var(--rar-mono); font-size: 11px; color: var(--rar-dim); }
.rar-chip.is-on { background: var(--rar-tx); border-color: var(--rar-tx); color: #0a0a0a; }
.rar-chip.is-on em { color: #52525b; }

/* 卡片 grid（覆蓋 Casper 的 .post-feed） */
.rar .rar-grid,
.rar .post-feed.rar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; padding: 0; }
.rar-grid > section.post-card-large { grid-column: 1 / -1; }
.rar .rar-card { display: block; grid-column: auto; padding: 0; border: 0; }
.rar-card-link { display: block; color: inherit; }
.rar-card-thumb { aspect-ratio: 16 / 9; overflow: hidden; margin-bottom: 14px; border-radius: 12px; border: 1px solid var(--rar-line); background: var(--rar-s2); }
.rar-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.rar-card-link:hover .rar-card-thumb img { transform: scale(1.03); }
.rar-card-noimg { display: grid; place-items: center; height: 100%; font: 600 28px var(--rar-mono); color: var(--rar-line2); }
.rar-card-date { margin-bottom: 8px; color: var(--rar-dim); }
.rar-card-title { margin: 0 0 8px; font-size: 17px; line-height: 1.5; font-weight: 700; color: var(--rar-tx); letter-spacing: 0; }
.rar-card-link:hover .rar-card-title { color: #fff; text-decoration: underline; text-decoration-color: var(--rar-line2); text-underline-offset: 4px; }
.rar-card-excerpt { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--rar-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 導流帶 */
.rar-band { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; margin: 72px 0; }
.rar-band + .post-feed { margin-top: 0; }

.rar-aw { display: flex; flex-direction: column; align-items: flex-start; padding: 32px; border-radius: 14px; border: 1px solid #2d2142; background: linear-gradient(135deg, #160e22, #0b0b0e); }
.rar-aw .rar-mono { color: var(--rar-purple); }
.rar-aw h4 { margin: 10px 0 14px; font-size: 22px; line-height: 1.45; color: var(--rar-tx); }
.rar-aw ul { margin: 0 0 20px; padding: 0; list-style: none; font-size: 14px; line-height: 1.9; color: var(--rar-mu); }
.rar-aw li::before { content: "✦ "; color: var(--rar-purple); }

.rar-courses { padding: 26px 26px 12px; }
.rar-course { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--rar-line); font-size: 14.5px; line-height: 1.4; color: var(--rar-tx); }
.rar-courses .rar-mono + .rar-course { margin-top: 10px; }
.rar-course small { display: block; margin-top: 2px; font-size: 12px; color: var(--rar-dim); }
.rar-course::after { content: "→"; margin-left: auto; color: var(--rar-dim); transition: transform .2s; }
.rar-course:hover::after { transform: translateX(3px); color: var(--rar-tx); }
.rar-course-dot { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; font: 700 12px var(--rar-mono); color: #0a0a0a; }

.rar-sub { padding: 26px; }
.rar-sub h4 { margin: 8px 0 4px; font-size: 17px; line-height: 1.5; color: var(--rar-tx); }
.rar-sub p { margin: 0 0 16px; font-size: 13px; color: var(--rar-dim); }
.rar-sub-form { display: flex; gap: 8px; }
.rar-sub-input { flex: 1; padding: 11px 14px; border: 1px solid var(--rar-line2); border-radius: 10px; background: var(--rar-bg); font-size: 13.5px; color: var(--rar-dim); }
.rar-sub-btn { padding: 11px 18px; border-radius: 10px; background: var(--rar-blue); color: #fff; font-size: 13.5px; font-weight: 600; }

/* 標籤頁抬頭 */
.rar-listhead { padding: 8px 0 0; }
.rar-listhead h1 { margin: 12px 0 8px; font-size: 40px; line-height: 1.25; color: var(--rar-tx); }
.rar-listhead p { margin: 0; font-size: 15px; color: var(--rar-dim); }
.rar-listhead + .rar-feedhead { margin-top: 36px; }

/* 分頁（Casper 預設用無限捲動；關掉 JS 時才看得到） */
.rar .pagination a { color: var(--rar-tx); }

/* ---------- 文章頁 ---------- */
.rar .article-header { padding-top: 56px; }
.rar-article-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--rar-dim); }
.rar-article-meta a { color: var(--rar-blue); }
html.dark-mode .rar .article-title,
.rar .article-title { margin-top: 18px; font-size: 38px; line-height: 1.35; letter-spacing: -.01em; font-weight: 800; color: var(--rar-tx); }
html.dark-mode .rar .article-excerpt,
.rar .article-excerpt { margin-top: 16px; font-size: 17px; line-height: 1.75; color: var(--rar-mu); }
.rar .article-byline { margin: 26px 0 0; }
.rar .article-byline-meta .author-name { font-size: 14px; }
html.dark-mode .rar .article-byline-meta .author-name a { color: var(--rar-tx); }
.rar .article-byline-meta .byline-meta-content { font-size: 12px; color: var(--rar-dim); }
.rar .gh-button-share { border: 1px solid var(--rar-line2); background: transparent; color: var(--rar-tx); font-size: 13px; }
.rar .author-avatar { border-color: var(--rar-bg); }

/* 內文：無襯線、17px、跟深色卡片統一 */
.rar .gh-content { color: var(--rar-body); }
.rar .gh-content > p,
.rar .gh-content > ul,
.rar .gh-content > ol,
.rar .gh-content > dl,
.rar .gh-content > blockquote:not([class]) { font-family: var(--font-sans); font-size: 17px; line-height: 1.9; color: var(--rar-body); }
.rar .gh-content > [id] { font-family: var(--font-sans); color: var(--rar-tx); }
.rar .gh-content a:not([style]) { color: var(--rar-blue); }
.rar .gh-content figcaption { color: var(--rar-dim); font-size: 13px; }

/* 沒有 codeinjection 的舊文章：封面最高 560px（有 codeinjection 的會自己鎖 380px，不受影響） */
.rar .gh-canvas .article-image img { max-height: 560px; object-fit: cover; border-radius: 12px; }

/* 手機：封面改成等比例（舊文章的 codeinjection 把高度鎖 380px，手機上兩側會被裁掉）。
   選擇器比 codeinjection 的 .article-image img 更具體，所以不用改舊文章。 */
@media (max-width: 767px) {
    .rar .article .article-image { max-height: none; }
    .rar .article .article-image img { height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
    .rar .article-header { padding-top: 28px; }
    html.dark-mode .rar .article-title, .rar .article-title { font-size: 26px; }
    html.dark-mode .rar .article-excerpt, .rar .article-excerpt { font-size: 15.5px; }
    .rar .gh-content > p,
    .rar .gh-content > ul,
    .rar .gh-content > ol { font-size: 16.5px; }
}

/* 文末 */
.rar-end { margin-top: 80px; }
.rar-end-inner { max-width: 1200px; }
.rar-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 760px; margin: 0 auto 56px; }
.rar-pn .rar-box { padding: 20px 22px; color: inherit; transition: border-color .2s; }
.rar-pn a.rar-box:hover { border-color: var(--rar-line2); }
.rar-pn small { display: block; margin-bottom: 8px; color: var(--rar-dim); }
.rar-pn b { font-size: 15px; line-height: 1.5; font-weight: 600; color: var(--rar-tx); }
.rar-pn-next { text-align: right; }
.rar-pn-wait b { color: var(--rar-dim); }
.rar-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 760px; margin: 0 auto; }
.rar-two .rar-aw { padding: 26px; }
.rar-two .rar-aw h4 { font-size: 18px; }
.rar-more-head { margin: 80px 0 28px; }

/* ---------- 頁尾 ---------- */
.rar .site-footer { margin-top: 96px; padding: 40px 0 56px; background: var(--rar-bg); border-top: 1px solid var(--rar-line); color: var(--rar-dim); font-size: 13px; }
.rar .site-footer .inner.rar-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.rar .site-footer a { color: var(--rar-mu); }
.rar .site-footer a:hover { color: var(--rar-tx); }
.rar .copyright { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; font-size: 13px; }
.rar .copyright > a { color: var(--rar-tx); font-weight: 600; }
.rar .site-footer-center { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px 24px; }
.rar .site-footer-nav .nav { gap: 20px; }
.rar .site-footer-nav .nav a { font-size: 13px; }
.rar .site-footer-social-links { gap: 18px; }
.rar .site-footer-social-links svg { width: 18px; height: 18px; fill: var(--rar-mu); }

/* 404 頁的推薦文章 */
.rar .read-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

/* ---------- 響應式 ---------- */
@media (max-width: 991px) {
    .rar .rar-grid, .rar .post-feed.rar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rar-hero { gap: 28px; }
    .rar-hero-title { font-size: 28px; }
}
@media (max-width: 767px) {
    .rar-home { padding-top: 20px; }
    .rar-hero { grid-template-columns: 1fr; gap: 20px; }
    .rar-hero-title { font-size: 24px; margin: 12px 0; }
    .rar-feedhead { flex-direction: column; align-items: flex-start; gap: 14px; margin: 56px 0 24px; }
    .rar-feedhead .rar-chips { max-width: 100%; }
    .rar .rar-grid, .rar .post-feed.rar-grid { grid-template-columns: 1fr; gap: 36px; }
    .rar-band, .rar-two, .rar-pn { grid-template-columns: 1fr; }
    .rar-band { margin: 56px 0; }
    .rar-aw { padding: 26px; }
    .rar-aw h4 { font-size: 19px; }
    .rar-pn-next { text-align: left; }
    .rar-listhead h1 { font-size: 30px; }
    .rar .site-footer-center { justify-content: flex-start; }
    .rar .read-more { grid-template-columns: 1fr; }
}
