@import url("https://fonts.googleapis.com/css2?family=Prompt:wght@500;600;700&display=swap");
/* ==========================================================================
   NITED Blog — บทความความรู้จากศึกษานิเทศก์ (/blog · /blog/[seq] · /blog/write · /blog/me)
   คลาสทั้งหมดขึ้นต้น bl- (หน้าแสดงผล) / be- (ตัวแก้ไข) — ไม่ชนกับ AdminLTE/dashboard.css
   ========================================================================== */
.bl-page {
  --bl-ink: #0f172a;
  --bl-text: #1e293b;
  --bl-muted: #64748b;
  --bl-line: #e2e8f0;
  --bl-soft: #f1f5f9;
  --bl-brand: #2563eb;
  --bl-brand-d: #1d4ed8;
  --bl-navy: #0f2356;
  --bl-pink: #db2777;
  --bl-radius: 18px;
  --bl-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --bl-shadow-h: 0 2px 6px rgba(15, 23, 42, .06), 0 18px 40px -16px rgba(15, 35, 86, .28);
  --bl-display: "Prompt", "Sarabun", system-ui, sans-serif;
  padding: 0 0 48px !important;
  font-family: "Sarabun", system-ui, sans-serif;
  color: var(--bl-text);
}
.bl-page *, .bl-page *::before, .bl-page *::after { box-sizing: border-box; }
.bl-container { max-width: 1200px; margin: 0 auto; padding: 0 18px; }

/* ---------- ปุ่ม ---------- */
.bl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font: 700 .92rem/1 "Sarabun", sans-serif; cursor: pointer; text-decoration: none !important;
  transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s; white-space: nowrap;
}
.bl-btn:active { transform: translateY(1px); }
.bl-btn:disabled { opacity: .55; cursor: not-allowed; }
.bl-btn.sm { min-height: 34px; padding: 0 13px; font-size: .84rem; }
.bl-btn.primary { background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .55); }
.bl-btn.primary:hover { box-shadow: 0 8px 22px -6px rgba(37, 99, 235, .7); color: #fff; }
.bl-btn.soft { background: #eff6ff; color: var(--bl-brand-d); border-color: #dbeafe; }
.bl-btn.soft:hover { background: #dbeafe; }
.bl-btn.ghost { background: #fff; color: #334155; border-color: var(--bl-line); }
.bl-btn.ghost:hover { border-color: #cbd5e1; background: #f8fafc; }
.bl-btn.ghost-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .35); }
.bl-btn.ghost-light:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.bl-btn.danger { background: #fff; color: #dc2626; border-color: #fecaca; }
.bl-btn.danger:hover { background: #fef2f2; }
.bl-owner-actions form, .bl-myrow-actions form { display: inline-flex; margin: 0; }

/* ---------- Hero หน้ารวม ---------- */
.bl-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(236, 72, 153, .35), transparent 60%),
    radial-gradient(700px 360px at 0% 120%, rgba(56, 189, 248, .35), transparent 60%),
    linear-gradient(120deg, #0f2356 0%, #1e3a8a 55%, #312e81 100%);
}
.bl-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.bl-hero-in { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 46px 18px 54px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.bl-hero-text { flex: 1 1 520px; min-width: 0; }
.bl-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); font-weight: 700; font-size: .85rem; letter-spacing: .5px; }
.bl-hero h1 { font-family: var(--bl-display); font-weight: 700; font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.25; margin: 16px 0 12px; color: #fff; }
.bl-hero h1 span { background: linear-gradient(90deg, #fde68a, #f9a8d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bl-hero p { max-width: 640px; font-size: 1.05rem; line-height: 1.75; color: #cbd5e1; margin: 0 0 22px; }
.bl-hero-stats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 18px; color: #cbd5e1; font-size: .92rem; }
.bl-hero-stats b { color: #fff; font-family: var(--bl-display); font-size: 1.25rem; margin-right: 4px; }
.bl-hero-cta { flex: 0 1 320px; }
.bl-hero-cta-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 22px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(6px); }
.bl-hero-cta-card > i { font-size: 1.6rem; color: #fde68a; }
.bl-hero-cta-card b { font-family: var(--bl-display); font-size: 1.15rem; }
.bl-hero-cta-card span { color: #cbd5e1; font-size: .9rem; line-height: 1.6; margin-bottom: 4px; }

/* ช่องค้นหา */
.bl-search { display: flex; align-items: center; gap: 6px; max-width: 620px; background: #fff; border-radius: 999px; padding: 5px 5px 5px 18px; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .45); }
.bl-search > i { color: #94a3b8; }
.bl-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: 500 1rem "Sarabun", sans-serif; color: var(--bl-ink); padding: 10px 6px; background: transparent; }
.bl-search-x { border: 0; background: transparent; color: #94a3b8; cursor: pointer; padding: 6px 8px; }
.bl-search-go { border: 0; border-radius: 999px; background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; font: 700 .92rem "Sarabun", sans-serif; padding: 11px 22px; cursor: pointer; }

/* ---------- แถบหมวด + เรียง ---------- */
.bl-filterbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: -22px 0 18px; position: relative; z-index: 2; background: #fff; border-radius: var(--bl-radius); padding: 12px 14px; box-shadow: var(--bl-shadow); }
.bl-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 500px; min-width: 0; }
.bl-chip { --c: #2563eb; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--bl-soft); color: #334155; font-weight: 600; font-size: .86rem; text-decoration: none !important; border: 1px solid transparent; transition: .15s; }
.bl-chip i { color: var(--c); }
.bl-chip em { font-style: normal; font-size: .74rem; font-weight: 800; color: #94a3b8; background: #fff; border-radius: 999px; padding: 1px 7px; }
.bl-chip:hover { background: #e2e8f0; color: var(--bl-ink); }
.bl-chip.on { background: var(--c); color: #fff; box-shadow: 0 6px 14px -6px var(--c); }
.bl-chip.on i { color: #fff; }
.bl-chip.on em { background: rgba(255, 255, 255, .25); color: #fff; }
.bl-sort { display: inline-flex; background: var(--bl-soft); border-radius: 999px; padding: 4px; gap: 2px; }
.bl-sort a { padding: 6px 14px; border-radius: 999px; color: var(--bl-muted); font-weight: 700; font-size: .85rem; text-decoration: none !important; }
.bl-sort a.on { background: #fff; color: var(--bl-ink); box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }
.bl-active-filter { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; margin: 0 0 18px; padding: 12px 16px; border-radius: 14px; background: #eff6ff; border: 1px solid #dbeafe; color: #1e3a8a; font-size: .93rem; }
.bl-af-author { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bl-af-author a { font-weight: 700; color: var(--bl-brand); }
.bl-af-clear { margin-left: auto; color: #64748b !important; font-weight: 600; font-size: .86rem; text-decoration: none !important; }

/* ---------- บทความเด่น ---------- */
.bl-featured { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; margin-bottom: 28px; }
.bl-featured-side { display: flex; flex-direction: column; gap: 12px; background: #fff; border-radius: var(--bl-radius); padding: 14px; box-shadow: var(--bl-shadow); }

/* ---------- เลย์เอาต์หลัก ---------- */
.bl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.bl-sec-h { display: flex; align-items: center; gap: 10px; font-family: var(--bl-display); font-weight: 600; font-size: 1.3rem; color: var(--bl-ink); margin: 6px 0 16px; }
.bl-pill { font-family: "Sarabun", sans-serif; font-size: .8rem; font-weight: 800; background: var(--bl-soft); color: var(--bl-muted); border-radius: 999px; padding: 2px 10px; }
.bl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.bl-grid-profile { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }

/* การ์ด */
.bl-card { display: flex; flex-direction: column; background: #fff; border-radius: var(--bl-radius); box-shadow: var(--bl-shadow); border: 1px solid #eef2f7; transition: transform .2s, box-shadow .2s; min-width: 0; }
.bl-card:hover { transform: translateY(-3px); box-shadow: var(--bl-shadow-h); }
.bl-card-img { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--bl-radius) var(--bl-radius) 0 0; background: var(--bl-soft); }
.bl-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; display: block; }
.bl-card:hover .bl-card-img img { transform: scale(1.05); }
.bl-card-pin { position: absolute; top: 12px; left: 12px; background: rgba(15, 23, 42, .72); color: #fde68a; font-weight: 800; font-size: .74rem; padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px); }
.bl-card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 16px; flex: 1; min-width: 0; }
.bl-card-title { font-family: var(--bl-display); font-weight: 600; font-size: 1.08rem; line-height: 1.5; margin: 2px 0 0; overflow-wrap: anywhere; }
.bl-card-title a { color: var(--bl-ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bl-card-title a:hover { color: var(--bl-brand); }
.bl-card-ex { color: var(--bl-muted); font-size: .92rem; line-height: 1.7; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bl-card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--bl-line); flex-wrap: wrap; }
.bl-card-author { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1 1 160px; text-decoration: none !important; }
.bl-card-author span { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.bl-card-author b { color: #334155; font-size: .86rem; overflow-wrap: anywhere; }
.bl-card-author small { color: #94a3b8; font-size: .76rem; }
.bl-card-stats { display: inline-flex; gap: 10px; color: #94a3b8; font-size: .8rem; font-weight: 600; }
.bl-card.feature .bl-card-img { aspect-ratio: 16 / 8.4; }
.bl-card.feature .bl-card-title { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
.bl-card.feature .bl-card-title a { -webkit-line-clamp: 3; }
.bl-card.feature .bl-card-body { padding: 20px 24px; }

/* ป้ายหมวด */
.bl-cat-chip { --c: #2563eb; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: .82rem; color: var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); border: 1px solid color-mix(in srgb, var(--c) 22%, #fff); text-decoration: none !important; }
.bl-cat-chip.sm { padding: 3px 10px; font-size: .74rem; }

/* ปกสำรองเมื่อไม่มีภาพ */
.bl-cover-ph { --c: #2563eb; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 16px 18px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--c) 55%, #fff) 0%, transparent 55%), linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #0f172a)); }
.bl-cover-ph i { position: absolute; right: 14px; top: 10px; font-size: 3.6rem; opacity: .22; }
.bl-cover-ph span { font-family: var(--bl-display); font-weight: 600; font-size: 1rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 8px rgba(0, 0, 0, .2); }
.bl-cover-ph.mini { justify-content: center; align-items: center; padding: 0; }
.bl-cover-ph.mini i { position: static; font-size: 1.3rem; opacity: .9; }

/* แถวย่อ */
.bl-row { display: flex; gap: 12px; align-items: center; text-decoration: none !important; padding: 6px; border-radius: 12px; transition: background .15s; min-width: 0; }
.bl-row:hover { background: var(--bl-soft); }
.bl-row-img { flex: 0 0 92px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--bl-soft); }
.bl-row-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bl-row-img .bl-cover-ph { padding: 6px 8px; }
.bl-row-img .bl-cover-ph span { display: none; }
.bl-row-img .bl-cover-ph i { font-size: 1.8rem; right: 8px; top: 6px; opacity: .35; }
.bl-row-main { min-width: 0; flex: 1; }
.bl-row-title { color: var(--bl-ink); font-weight: 700; font-size: .92rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bl-row-meta { color: #94a3b8; font-size: .78rem; margin-top: 3px; }

/* กล่องด้านข้าง */
.bl-aside { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 70px; }
.bl-box { background: #fff; border-radius: var(--bl-radius); padding: 16px 16px 14px; box-shadow: var(--bl-shadow); border: 1px solid #eef2f7; min-width: 0; }
.bl-box-h { display: flex; align-items: center; gap: 8px; font-family: var(--bl-display); font-weight: 600; font-size: 1.02rem; color: var(--bl-ink); margin-bottom: 10px; flex-wrap: wrap; }
.bl-box-sub { margin-left: auto; font-family: "Sarabun", sans-serif; font-weight: 600; font-size: .8rem; color: var(--bl-muted); }
.bl-popular { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bl-popular li { display: flex; align-items: center; gap: 4px; }
.bl-rank { flex: 0 0 26px; font-family: var(--bl-display); font-weight: 700; font-size: 1.25rem; color: #cbd5e1; text-align: center; }
.bl-popular li:nth-child(1) .bl-rank { color: #f59e0b; }
.bl-popular li:nth-child(2) .bl-rank { color: #94a3b8; }
.bl-popular li:nth-child(3) .bl-rank { color: #d97706; }
.bl-popular .bl-row { flex: 1; }
.bl-popular .bl-row-img { flex-basis: 70px; height: 50px; }
.bl-authors { display: flex; flex-direction: column; gap: 4px; }
.bl-author { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; text-decoration: none !important; transition: background .15s; }
.bl-author:hover, .bl-author.on { background: var(--bl-soft); }
.bl-author span { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.bl-author b { color: #334155; font-size: .88rem; overflow-wrap: anywhere; }
.bl-author small { color: #94a3b8; font-size: .76rem; }
.bl-box-cta { display: flex; flex-direction: column; gap: 6px; background: linear-gradient(160deg, #eff6ff, #fdf2f8); border-color: #e0e7ff; }
.bl-box-cta > i { font-size: 1.4rem; color: var(--bl-brand); }
.bl-box-cta b { font-family: var(--bl-display); font-weight: 600; color: var(--bl-ink); }
.bl-box-cta span { font-size: .86rem; color: var(--bl-muted); line-height: 1.6; margin-bottom: 4px; }
.bl-box-cta .bl-btn { align-self: flex-start; }

/* อวาตาร์ */
.bl-av { border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #e2e8f0; display: inline-block; }
.bl-av.ph { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; background: linear-gradient(135deg, #3b82f6, #8b5cf6); }

/* ว่าง */
.bl-empty { text-align: center; padding: 56px 20px; background: #fff; border-radius: var(--bl-radius); box-shadow: var(--bl-shadow); border: 1px dashed #cbd5e1; }
.bl-empty.sm { padding: 34px 18px; box-shadow: none; }
.bl-empty-ic { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 22px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; color: #fff; background: linear-gradient(135deg, #2563eb, #db2777); box-shadow: 0 12px 26px -10px rgba(37, 99, 235, .6); }
.bl-empty h3 { font-family: var(--bl-display); font-weight: 600; font-size: 1.25rem; color: var(--bl-ink); margin: 0 0 6px; }
.bl-empty p { color: var(--bl-muted); margin: 0 0 16px; }

/* ==========================================================================
   หน้าอ่านบทความ
   ========================================================================== */
.bl-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1100; pointer-events: none; }
.bl-progress span { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #db2777); transition: width .1s linear; border-radius: 0 3px 3px 0; }
.bl-read { padding-top: 18px !important; }
.bl-owner { max-width: 1200px; margin: 0 auto 14px; padding: 10px 14px; display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--bl-line); border-radius: 14px; box-shadow: var(--bl-shadow); }
.bl-owner-stats { color: var(--bl-muted); font-size: .86rem; }
.bl-owner-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.bl-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-weight: 800; font-size: .78rem; }
.bl-status.published { background: #dcfce7; color: #166534; }
.bl-status.draft { background: #fef3c7; color: #92400e; }
.bl-status.hidden { background: #fee2e2; color: #991b1b; }
.bl-status.featured { background: #fef9c3; color: #a16207; }
.bl-published-msg { max-width: 1200px; margin: 0 auto 16px; padding: 14px 18px; border-radius: 16px; background: linear-gradient(120deg, #ecfdf5, #eff6ff); border: 1px solid #bbf7d0; color: #065f46; display: flex; flex-direction: column; gap: 10px; }

.bl-article { max-width: 1200px; margin: 0 auto; padding: 0 18px; }
.bl-art-head { max-width: 820px; margin: 0 auto; text-align: center; padding: 18px 0 8px; display: flex; flex-direction: column; align-items: center; }
.bl-art-head .bl-cat-chip { align-self: center; }
.bl-crumb { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: #94a3b8; margin-bottom: 16px; flex-wrap: wrap; justify-content: center; }
.bl-crumb a { color: var(--bl-muted); text-decoration: none; font-weight: 600; }
.bl-crumb a:hover { color: var(--bl-brand); }
.bl-crumb > i { font-size: .65rem; }
.bl-title { font-family: var(--bl-display); font-weight: 700; color: var(--bl-ink); font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.35; margin: 16px 0 12px; overflow-wrap: anywhere; letter-spacing: -.2px; }
.bl-lead { font-size: clamp(1.05rem, 1.8vw, 1.2rem); line-height: 1.8; color: #475569; margin: 0 0 22px; max-width: 720px; overflow-wrap: anywhere; }
.bl-byline { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bl-byline-author { display: inline-flex; align-items: center; gap: 12px; text-decoration: none !important; padding: 6px 16px 6px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--bl-line); box-shadow: var(--bl-shadow); transition: border-color .15s; }
.bl-byline-author:hover { border-color: #93c5fd; }
.bl-byline-author span { display: flex; flex-direction: column; text-align: left; line-height: 1.4; min-width: 0; }
.bl-byline-author b { color: var(--bl-ink); font-size: .98rem; }
.bl-byline-author small { color: var(--bl-muted); font-size: .8rem; overflow-wrap: anywhere; }
.bl-byline-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; justify-content: center; color: var(--bl-muted); font-size: .88rem; }
.bl-byline-meta a { color: var(--bl-muted); text-decoration: none; }
.bl-cover { max-width: 1040px; margin: 26px auto 8px; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(15, 35, 86, .45); background: var(--bl-soft); }
.bl-cover img { width: 100%; max-height: 560px; object-fit: cover; display: block; }

.bl-art-layout { display: grid; grid-template-columns: 60px minmax(0, 740px) 60px; gap: 28px; justify-content: center; margin-top: 30px; }
.bl-art-layout.has-toc { grid-template-columns: 60px minmax(0, 740px) 250px; }
.bl-art-rail { position: relative; }
.bl-art-rail .bl-share { position: sticky; top: 90px; }
.bl-art-content { min-width: 0; }
.bl-art-toc { position: relative; }
.bl-art-toc .bl-toc { position: sticky; top: 90px; }

/* สารบัญ */
.bl-toc { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px 14px 14px; border-left: 2px solid var(--bl-line); max-height: calc(100vh - 120px); overflow: auto; }
.bl-toc-h { font-weight: 800; font-size: .8rem; letter-spacing: .5px; color: #94a3b8; margin-bottom: 6px; text-transform: uppercase; }
.bl-toc a { color: var(--bl-muted); text-decoration: none; font-size: .88rem; line-height: 1.5; padding: 5px 8px; border-radius: 8px; overflow-wrap: anywhere; position: relative; }
.bl-toc a.lv3 { padding-left: 20px; font-size: .84rem; }
.bl-toc a:hover { color: var(--bl-ink); background: var(--bl-soft); }
.bl-toc a.on { color: var(--bl-brand); font-weight: 700; background: #eff6ff; }
.bl-toc a.on::before { content: ""; position: absolute; left: -16px; top: 6px; bottom: 6px; width: 2px; background: var(--bl-brand); border-radius: 2px; }
.bl-toc-mobile { display: none; margin: 0 0 22px; background: #fff; border: 1px solid var(--bl-line); border-radius: 14px; padding: 4px 14px; }
.bl-toc-mobile summary { cursor: pointer; font-weight: 700; padding: 10px 0; color: var(--bl-ink); }
.bl-toc-mobile a { display: block; color: var(--bl-muted); text-decoration: none; padding: 6px 0; border-top: 1px solid var(--bl-soft); font-size: .92rem; }
.bl-toc-mobile a.lv3 { padding-left: 16px; font-size: .88rem; }

/* ---------- เนื้อหาบทความ (ใช้ร่วมกับตัวแก้ไข) ---------- */
.bl-prose { font-size: 1.13rem; line-height: 1.95; color: #1f2937; overflow-wrap: anywhere; }
.bl-prose > * + * { margin-top: 1.05em; }
.bl-prose p { margin: 0; }
.bl-prose > p + p { margin-top: .95em; }
.bl-prose h2 { font-family: var(--bl-display); font-weight: 700; font-size: 1.55rem; line-height: 1.45; color: var(--bl-ink); margin: 1.9em 0 .55em; scroll-margin-top: 80px; }
.bl-prose h3 { font-family: var(--bl-display); font-weight: 600; font-size: 1.25rem; line-height: 1.5; color: var(--bl-ink); margin: 1.5em 0 .45em; scroll-margin-top: 80px; }
.bl-prose > h2:first-child, .bl-prose > h3:first-child { margin-top: 0; }
.bl-prose a { color: var(--bl-brand); text-decoration: underline; text-decoration-color: rgba(37, 99, 235, .35); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.bl-prose a:hover { text-decoration-color: var(--bl-brand); }
.bl-prose strong, .bl-prose b { font-weight: 700; color: var(--bl-ink); }
.bl-prose ul, .bl-prose ol { padding-left: 1.5em; margin: 1em 0; }
.bl-prose li { margin: .35em 0; padding-left: .2em; }
.bl-prose li::marker { color: var(--bl-brand); font-weight: 700; }
.bl-prose blockquote { margin: 1.6em 0; padding: 6px 0 6px 22px; border-left: 4px solid; border-image: linear-gradient(180deg, #2563eb, #db2777) 1; font-family: var(--bl-display); font-weight: 500; font-size: 1.22rem; line-height: 1.75; color: #334155; }
.bl-prose blockquote p { margin: 0; }
.bl-callout, .bl-prose aside, .be-editor aside { display: flex; gap: 14px; align-items: flex-start; margin: 1.5em 0; padding: 16px 18px; border-radius: 16px; background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fde68a; color: #78350f; font-size: 1.05rem; line-height: 1.85; }
.bl-callout-ic { flex: 0 0 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: #f59e0b; color: #fff; box-shadow: 0 6px 14px -6px #f59e0b; }
.bl-figure { margin: 1.8em 0; }
.bl-figure img { width: 100%; border-radius: 16px; display: block; box-shadow: 0 16px 36px -22px rgba(15, 23, 42, .45); }
.bl-figure figcaption, .be-figure figcaption { text-align: center; color: var(--bl-muted); font-size: .9rem; margin-top: 10px; line-height: 1.6; }
.bl-video { margin: 1.8em 0; }
.bl-video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #0f172a; box-shadow: 0 16px 36px -22px rgba(15, 23, 42, .5); }
.bl-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bl-hr, .bl-prose hr { border: 0; height: auto; margin: 2.2em 0; text-align: center; overflow: visible; background: none; }
.bl-hr::before, .bl-prose hr::before { content: "• • •"; letter-spacing: .8em; color: #cbd5e1; font-size: 1.1rem; }
.bl-table-wrap { overflow-x: auto; margin: 1.6em 0; border-radius: 14px; border: 1px solid var(--bl-line); }
.bl-table, .be-table { width: 100%; border-collapse: collapse; font-size: .98rem; line-height: 1.65; }
.bl-table th, .bl-table td, .be-table th, .be-table td { border: 1px solid var(--bl-line); padding: 10px 14px; text-align: left; vertical-align: top; min-width: 90px; }
.bl-table th, .be-table th { background: #f8fafc; font-weight: 700; color: var(--bl-ink); }
.bl-table-wrap .bl-table th, .bl-table-wrap .bl-table td { border-width: 0 1px 1px 0; }

/* แท็ก + แถบท้าย */
.bl-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 30px; }
.bl-tags a { padding: 6px 13px; border-radius: 999px; background: var(--bl-soft); color: #475569; font-weight: 600; font-size: .86rem; text-decoration: none; }
.bl-tags a:hover { background: #e0e7ff; color: #3730a3; }
.bl-endbar { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 26px 0 0; padding: 16px 0; border-top: 1px solid var(--bl-line); border-bottom: 1px solid var(--bl-line); }

/* ถูกใจ */
.bl-like { display: inline-flex; align-items: center; gap: 9px; padding: 9px 18px; border-radius: 999px; border: 1.5px solid #fbcfe8; background: #fff; color: #be185d; font: 700 .95rem "Sarabun", sans-serif; cursor: pointer; transition: .15s; }
.bl-like:hover { background: #fdf2f8; }
.bl-like b { background: #fce7f3; border-radius: 999px; padding: 1px 9px; font-size: .84rem; }
.bl-like.on { background: linear-gradient(135deg, #ec4899, #db2777); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -8px rgba(219, 39, 119, .7); }
.bl-like.on b { background: rgba(255, 255, 255, .25); }
.bl-like.pop i { animation: bl-pop .6s ease; }
@keyframes bl-pop { 0% { transform: scale(1); } 30% { transform: scale(1.5); } 60% { transform: scale(.9); } 100% { transform: scale(1); } }

/* แชร์ */
.bl-share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; }
.bl-share.rail { flex-direction: column; }
.bl-share-label { font-weight: 700; color: #475569; font-size: .9rem; margin-right: 2px; }
.bl-share-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: #fff; cursor: pointer; font-size: 1rem; transition: transform .15s, box-shadow .15s, filter .15s; }
.bl-share-btn:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 8px 16px -8px rgba(15, 23, 42, .5); }
.s-facebook { background: #1877f2; }
.s-line { background: #06c755; }
.s-x { background: #0f1419; }
.s-email { background: #ea580c; }
.s-qr { background: #475569; }
.s-native { background: #7c3aed; }
.bl-share-btn.s-copy { background: var(--bl-soft); color: #334155; }
.bl-share.bar .bl-share-btn.s-copy { width: auto; padding: 0 15px; border-radius: 999px; font: 700 .86rem "Sarabun", sans-serif; }
.bl-share-btn.s-copy.ok { background: #dcfce7; color: #166534; }
.bl-share.rail .bl-share-btn { width: 42px; height: 42px; background: #fff; color: #475569; border: 1px solid var(--bl-line); box-shadow: var(--bl-shadow); }
.bl-share.rail .s-facebook:hover { color: #1877f2; } .bl-share.rail .s-line:hover { color: #06c755; } .bl-share.rail .s-x:hover { color: #000; }
.bl-qr-pop { position: fixed; inset: 0; z-index: 100001; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.bl-qr-card { background: #fff; border-radius: 22px; padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: #334155; font-weight: 600; max-width: 340px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; }
.bl-qr-card img { width: 240px; height: 240px; }

/* การ์ดผู้เขียน */
.bl-author-card { display: flex; gap: 18px; align-items: flex-start; margin: 32px 0; padding: 22px; border-radius: 22px; background: linear-gradient(135deg, #f8fafc, #eff6ff 60%, #fdf2f8); border: 1px solid #e0e7ff; }
.bl-author-main { min-width: 0; flex: 1; }
.bl-author-kicker { font-size: .78rem; font-weight: 800; letter-spacing: .6px; color: #94a3b8; text-transform: uppercase; }
.bl-author-card h3 { font-family: var(--bl-display); font-weight: 600; font-size: 1.25rem; color: var(--bl-ink); margin: 2px 0 4px; }
.bl-author-pos { color: var(--bl-muted); font-size: .9rem; line-height: 1.6; }
.bl-author-count { margin-top: 6px; color: var(--bl-pink); font-weight: 700; font-size: .86rem; }
.bl-author-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ความคิดเห็น */
.bl-comments { margin-top: 10px; }
.bl-cm-form { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.bl-cm-form.reply { margin: 8px 0 6px 50px; }
.bl-cm-form-main { flex: 1; min-width: 0; background: #fff; border: 1.5px solid var(--bl-line); border-radius: 16px; transition: border-color .15s, box-shadow .15s; }
.bl-cm-form-main:focus-within { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(147, 197, 253, .25); }
.bl-cm-form textarea { width: 100%; border: 0; outline: 0; resize: vertical; min-height: 64px; padding: 12px 14px 4px; font: 400 1rem/1.7 "Sarabun", sans-serif; background: transparent; color: var(--bl-ink); border-radius: 16px; }
.bl-cm-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px 8px 14px; flex-wrap: wrap; }
.bl-cm-form-foot > span { color: #94a3b8; font-size: .78rem; }
.bl-cm-form.reply .bl-cm-form-foot { justify-content: flex-end; }
.bl-cm-login, .bl-cm-closed { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 18px; border-radius: 16px; background: #f8fafc; border: 1px dashed #cbd5e1; color: #475569; margin-bottom: 18px; }
.bl-cm-login .bl-btn { margin-left: auto; }
.bl-cm-err { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; padding: 9px 14px; margin-bottom: 14px; font-size: .9rem; }
.bl-cm-list { display: flex; flex-direction: column; }
.bl-cm-thread { padding: 14px 0; border-top: 1px solid var(--bl-soft); }
.bl-cm { display: flex; gap: 12px; align-items: flex-start; }
.bl-cm.reply { margin: 12px 0 0 50px; }
.bl-cm-main { flex: 1; min-width: 0; }
.bl-cm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bl-cm-head b { color: var(--bl-ink); font-size: .95rem; }
.bl-cm-badge { font-size: .7rem; font-weight: 800; background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; padding: 2px 8px; border-radius: 999px; }
.bl-cm-time { color: #94a3b8; font-size: .8rem; }
.bl-cm-body { margin-top: 3px; color: #334155; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.bl-cm-body .rt-link { color: var(--bl-brand); }
.bl-cm-actions { display: flex; gap: 12px; margin-top: 4px; }
.bl-cm-actions button { border: 0; background: none; padding: 2px 0; color: #64748b; font: 600 .82rem "Sarabun", sans-serif; cursor: pointer; }
.bl-cm-actions button:hover { color: var(--bl-brand); }
.bl-cm-actions button.danger:hover { color: #dc2626; }
.bl-cm-deleted { color: #94a3b8; font-style: italic; font-size: .9rem; padding-top: 8px; }
.bl-cm-empty { color: #94a3b8; text-align: center; padding: 20px; }

.bl-more { margin-top: 40px; display: flex; flex-direction: column; gap: 30px; }
.bl-back-all { text-align: center; margin-top: 34px; }

/* ==========================================================================
   หน้า "บทความของฉัน"
   ========================================================================== */
.bl-me { padding-top: 22px; display: flex; flex-direction: column; gap: 18px; }
.bl-me-head { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.bl-me-head h1 { font-family: var(--bl-display); font-weight: 700; font-size: 1.7rem; color: var(--bl-ink); margin: 6px 0 4px; }
.bl-me-head p { color: var(--bl-muted); margin: 0; }
.bl-me-back { color: var(--bl-muted); font-weight: 600; font-size: .88rem; text-decoration: none; }
.bl-tabs { display: inline-flex; gap: 4px; background: #fff; border: 1px solid var(--bl-line); border-radius: 999px; padding: 4px; align-self: flex-start; }
.bl-tabs a { padding: 7px 16px; border-radius: 999px; color: var(--bl-muted); font-weight: 700; font-size: .88rem; text-decoration: none; }
.bl-tabs a.on { background: var(--bl-navy); color: #fff; }
.bl-flash { padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.bl-flash.ok { background: #dcfce7; color: #166534; }
.bl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.bl-kpi { --c: #2563eb; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: var(--bl-shadow); border: 1px solid #eef2f7; }
.bl-kpi i { grid-row: span 2; width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--c); box-shadow: 0 8px 16px -8px var(--c); }
.bl-kpi b { font-family: var(--bl-display); font-size: 1.45rem; color: var(--bl-ink); line-height: 1.1; }
.bl-kpi span { color: var(--bl-muted); font-size: .8rem; font-weight: 600; }
.bl-me-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
.bl-chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding: 8px 2px 0; border-bottom: 1px solid var(--bl-line); }
.bl-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bl-bar span { width: 100%; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #38bdf8, #2563eb); transition: filter .15s; }
.bl-bar span.zero { background: #e2e8f0; }
.bl-bar:hover span { filter: brightness(1.15); }
.bl-chart-axis { display: flex; justify-content: space-between; color: #94a3b8; font-size: .76rem; margin-top: 6px; }
.bl-top { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 10px; }
.bl-top li { color: var(--bl-muted); }
.bl-top li::marker { font-weight: 800; color: #f59e0b; }
.bl-top a { color: var(--bl-ink); font-weight: 600; text-decoration: none; display: block; overflow-wrap: anywhere; line-height: 1.5; }
.bl-top span { font-size: .8rem; }
.bl-muted { color: #94a3b8; font-size: .9rem; }
.bl-mylist { display: flex; flex-direction: column; }
.bl-myrow { display: flex; gap: 14px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--bl-soft); flex-wrap: wrap; }
.bl-myrow:first-child { border-top: 0; }
.bl-myrow-img { flex: 0 0 104px; height: 66px; border-radius: 12px; overflow: hidden; background: var(--bl-soft); display: block; }
.bl-myrow-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bl-myrow-main { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bl-myrow-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bl-myrow-cat { font-size: .78rem; font-weight: 700; }
.bl-myrow-title { font-weight: 700; color: var(--bl-ink); text-decoration: none; overflow-wrap: anywhere; line-height: 1.45; }
.bl-myrow-title:hover { color: var(--bl-brand); }
.bl-myrow-meta { display: flex; gap: 4px 14px; flex-wrap: wrap; color: #94a3b8; font-size: .8rem; }
.bl-myrow-author { display: inline-flex; align-items: center; gap: 5px; color: #475569; font-weight: 600; }
.bl-myrow-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ==========================================================================
   ตัวแก้ไข (/blog/write)
   ========================================================================== */
.be-wrap { max-width: 1240px; margin: 0 auto; padding: 0 18px; }
.be-top { position: sticky; top: 57px; z-index: 30; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 12px 0; margin-bottom: 14px; background: color-mix(in srgb, #f4f6f9 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bl-line); }
.be-back { color: #475569; font-weight: 700; text-decoration: none; font-size: .9rem; }
.be-status { padding: 4px 11px; border-radius: 999px; font-weight: 800; font-size: .78rem; }
.be-status.draft { background: #fef3c7; color: #92400e; }
.be-status.pub { background: #dcfce7; color: #166534; }
.be-status.hidden { background: #fee2e2; color: #991b1b; }
.be-count { color: var(--bl-muted); font-size: .84rem; }
.be-dirty { color: #d97706; font-size: .82rem; font-weight: 700; }
.be-top-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.be-restore { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-weight: 600; }
.be-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.be-main { min-width: 0; background: #fff; border-radius: 22px; box-shadow: var(--bl-shadow); border: 1px solid #eef2f7; padding: 26px clamp(16px, 4vw, 44px) 30px; }
.be-title { width: 100%; border: 0; outline: 0; resize: none; overflow: hidden; font-family: var(--bl-display); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.35; color: var(--bl-ink); padding: 0; margin: 0 0 14px; background: transparent; }
.be-title::placeholder { color: #cbd5e1; }
.be-toolbar { position: sticky; top: 124px; z-index: 20; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 6px; margin: 0 0 16px; background: #fff; border: 1px solid var(--bl-line); border-radius: 14px; box-shadow: 0 6px 16px -12px rgba(15, 23, 42, .35); }
.be-tb { min-width: 34px; height: 34px; padding: 0 7px; border: 0; border-radius: 9px; background: transparent; color: #334155; cursor: pointer; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; }
.be-tb:hover { background: var(--bl-soft); }
.be-tb.on { background: #dbeafe; color: var(--bl-brand-d); }
.be-tb:disabled { opacity: .5; }
.be-tb-txt { font: 800 .82rem "Sarabun", sans-serif; }
.be-sep { width: 1px; height: 22px; background: var(--bl-line); margin: 0 4px; }
.be-editor { min-height: 420px; outline: 0; padding: 4px 2px 40px; caret-color: var(--bl-brand); position: relative; }
.be-editor.drag { outline: 2px dashed #93c5fd; outline-offset: 6px; border-radius: 12px; background: #f8fbff; }
.be-editor:empty::before, .be-editor:has(> p:only-child > br:only-child)::before { content: attr(data-placeholder); position: absolute; color: #94a3b8; pointer-events: none; }
.be-editor blockquote { margin: 1.4em 0; padding: 6px 0 6px 22px; border-left: 4px solid #6366f1; font-family: var(--bl-display); font-weight: 500; font-size: 1.2rem; color: #334155; }
.be-editor aside::before { content: "\f0eb"; font-family: "Font Awesome 6 Free", "Font Awesome 5 Free"; font-weight: 900; color: #f59e0b; margin-right: 4px; }
.be-figure, .be-yt { margin: 1.4em 0; position: relative; cursor: default; user-select: none; }
.be-figure img { width: 100%; border-radius: 14px; display: block; }
.be-figure:hover img, .be-yt:hover img { outline: 3px solid #93c5fd; outline-offset: 2px; }
.be-ph { color: #cbd5e1; font-style: italic; }
.be-yt img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; display: block; filter: brightness(.8); }
.be-yt-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #ff0000; color: #fff; font-weight: 800; padding: 10px 18px; border-radius: 12px; box-shadow: 0 10px 22px -8px rgba(0, 0, 0, .5); white-space: nowrap; }
.be-editor .be-table { margin: 1.2em 0; }
.be-hint { color: #94a3b8; font-size: .82rem; margin: 10px 0 0; line-height: 1.6; }
.be-empty { color: #94a3b8; }
.be-preview .bl-cat-chip { margin-bottom: 6px; }
.be-preview .bl-title { margin-top: 10px; }
.be-preview .bl-cover-img { width: 100%; border-radius: 18px; margin: 4px 0 26px; display: block; }
.be-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 124px; max-height: calc(100vh - 140px); overflow: auto; padding-bottom: 6px; }
.be-card { background: #fff; border-radius: 16px; border: 1px solid #eef2f7; box-shadow: var(--bl-shadow); padding: 14px; }
.be-card-h { font-weight: 800; color: var(--bl-ink); font-size: .9rem; margin-bottom: 10px; display: flex; gap: 7px; align-items: center; }
.be-card-h i { color: var(--bl-brand); }
.be-cover img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 12px; display: block; }
.be-cover-actions { display: flex; gap: 6px; margin-top: 8px; }
.be-cover-empty { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px; border: 2px dashed #cbd5e1; border-radius: 14px; background: #f8fafc; color: #475569; cursor: pointer; font: 700 .9rem "Sarabun", sans-serif; }
.be-cover-empty i { font-size: 1.6rem; color: #60a5fa; }
.be-cover-empty small { color: #94a3b8; font-weight: 500; font-size: .76rem; }
.be-cover-empty:hover { border-color: #93c5fd; background: #eff6ff; }
.be-cats { display: flex; flex-direction: column; gap: 5px; }
.be-cat { --c: #2563eb; text-align: left; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--bl-line); background: #fff; color: #334155; font: 600 .86rem "Sarabun", sans-serif; cursor: pointer; }
.be-cat i { color: var(--c); width: 18px; text-align: center; }
.be-cat:hover { border-color: #cbd5e1; }
.be-cat.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, #fff); color: var(--bl-ink); box-shadow: inset 3px 0 0 var(--c); }
.be-input { width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 11px; font: 400 .92rem/1.6 "Sarabun", sans-serif; color: var(--bl-ink); background: #fff; resize: vertical; }
.be-input:focus { outline: 0; border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(147, 197, 253, .3); }
.be-sub { color: #94a3b8; font-size: .76rem; margin-top: 5px; }
.be-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .9rem; color: #334155; margin: 0; }
.be-switch input { display: none; }
.be-switch small { color: #94a3b8; font-weight: 500; }
.be-switch-ui { flex: 0 0 42px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .2s; }
.be-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.be-switch input:checked + .be-switch-ui { background: #22c55e; }
.be-switch input:checked + .be-switch-ui::after { transform: translateX(18px); }
.be-author { font-size: .88rem; color: #475569; }
.be-author i { color: var(--bl-pink); }
.be-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100002; padding: 12px 20px; border-radius: 14px; font-weight: 700; box-shadow: 0 16px 36px -12px rgba(15, 23, 42, .45); max-width: calc(100vw - 32px); animation: be-in .25s ease; }
.be-toast.ok { background: #0f172a; color: #fff; }
.be-toast.ok i { color: #4ade80; }
.be-toast.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
@keyframes be-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199px) {
  .bl-art-layout, .bl-art-layout.has-toc { grid-template-columns: 56px minmax(0, 740px); }
  .bl-art-toc { display: none; }
  .bl-toc-mobile { display: block; }
}
@media (max-width: 1099px) {
  .bl-layout { grid-template-columns: minmax(0, 1fr); }
  .bl-aside { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .be-grid { grid-template-columns: minmax(0, 1fr); }
  .be-side { position: static; max-height: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 899px) {
  .bl-featured { grid-template-columns: minmax(0, 1fr); }
  .bl-art-layout, .bl-art-layout.has-toc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .bl-art-rail { display: none; }
  .bl-me-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .bl-container, .bl-article, .be-wrap { padding: 0 14px; }
  .bl-hero-in { padding: 30px 16px 44px; }
  .bl-hero p { font-size: .98rem; }
  .bl-search-go { padding: 10px 14px; }
  .bl-filterbar { margin-top: -18px; }
  .bl-grid { grid-template-columns: minmax(0, 1fr); }
  .bl-prose { font-size: 1.06rem; line-height: 1.9; }
  .bl-prose h2 { font-size: 1.35rem; }
  .bl-cover { border-radius: 16px; margin-top: 18px; }
  .bl-author-card { flex-direction: column; align-items: center; text-align: center; }
  .bl-author-actions { justify-content: center; }
  .bl-cm.reply, .bl-cm-form.reply { margin-left: 22px; }
  .bl-owner-actions { margin-left: 0; }
  .be-top { top: 50px; }
  .be-top-actions { margin-left: 0; width: 100%; }
  .be-top-actions .bl-btn { flex: 1 1 auto; }
  .be-toolbar { top: 0; position: relative; }
  .bl-myrow-actions { width: 100%; }
}

/* ==========================================================================
   v2 — ติดตาม ศน. · ซีรีส์ · ตั้งเวลา · ผู้ช่วย AI · ผลงานรายปีงบ (2026-10-13)
   ========================================================================== */
.bl-status.sched, .be-status.sched { background: #e0e7ff; color: #3730a3; }
.bl-status.series { background: #f3e8ff; color: #6b21a8; }

/* ปุ่มติดตาม */
.bl-follow-wrap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; }
.bl-follow { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1.5px solid #bfdbfe; background: #fff; color: #1d4ed8; font: 700 .84rem "Sarabun", sans-serif; cursor: pointer; white-space: nowrap; transition: .15s; }
.bl-follow:hover { background: #eff6ff; }
.bl-follow b { background: #dbeafe; border-radius: 999px; padding: 0 8px; font-size: .78rem; }
.bl-follow.on { background: linear-gradient(135deg, #2563eb, #4f46e5); color: #fff; border-color: transparent; }
.bl-follow.on b { background: rgba(255, 255, 255, .25); }
.bl-follow.self { cursor: default; border-style: dashed; }
.bl-follow.light { background: #fff; border-color: #fff; }
.bl-follow.light.on { background: #22c55e; color: #fff; }
.bl-follow.light.self { background: rgba(255, 255, 255, .15); color: #fff; border-color: rgba(255, 255, 255, .5); }
.bl-follow.light.self b { background: rgba(255, 255, 255, .25); }
.bl-follow-msg { font-size: .78rem; color: #16a34a; font-weight: 600; }

/* กล่องซีรีส์ในหน้าอ่าน */
.bl-series { margin: 0 0 26px; padding: 16px 18px; border-radius: 18px; background: linear-gradient(135deg, #faf5ff, #eef2ff); border: 1px solid #e9d5ff; }
.bl-series-h { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; }
.bl-series-kicker { font-size: .74rem; font-weight: 800; color: #7c3aed; background: #fff; border-radius: 999px; padding: 3px 10px; }
.bl-series-h > a { font-family: var(--bl-display); font-weight: 600; color: var(--bl-ink); text-decoration: none; font-size: 1.05rem; overflow-wrap: anywhere; }
.bl-series-h > a:hover { color: #7c3aed; }
.bl-series-count { margin-left: auto; font-size: .8rem; color: var(--bl-muted); font-weight: 600; }
.bl-series ol { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 4px; font-size: .95rem; line-height: 1.6; }
.bl-series li::marker { color: #a78bfa; font-weight: 800; }
.bl-series li a { color: #4338ca; text-decoration: none; }
.bl-series li a:hover { text-decoration: underline; }
.bl-series li.on { font-weight: 700; color: var(--bl-ink); }
.bl-series li.on::marker { color: #7c3aed; }
.bl-series .soon { color: #94a3b8; }
.bl-series-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; }
.bl-series-nav a, .bl-series-nav span.next { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--bl-line); background: #fff; text-decoration: none; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.bl-series-nav a:hover { border-color: #a78bfa; box-shadow: var(--bl-shadow); }
.bl-series-nav .next { text-align: right; grid-column: 2; }
.bl-series-nav small { color: #7c3aed; font-weight: 700; font-size: .8rem; }
.bl-series-nav b { color: var(--bl-ink); font-size: .95rem; line-height: 1.45; overflow-wrap: anywhere; }
.bl-series-nav .soon b, .bl-series-nav .soon small { color: #94a3b8; }

/* ผลงานรายปีงบ + ซีรีส์ของฉัน */
.bl-fy { background: linear-gradient(135deg, #fffbeb, #fff 60%); border-color: #fde68a; }
.bl-fy-tabs { margin-left: auto; display: inline-flex; gap: 4px; background: #fff; border: 1px solid #fde68a; border-radius: 999px; padding: 3px; font-family: "Sarabun", sans-serif; }
.bl-fy-tabs a { padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #92400e; text-decoration: none; }
.bl-fy-tabs a.on { background: #f59e0b; color: #fff; }
.bl-fy-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.bl-fy-row > div { display: flex; flex-direction: column; padding: 10px 14px; background: #fff; border-radius: 12px; border: 1px solid #fef3c7; }
.bl-fy-row b { font-family: var(--bl-display); font-size: 1.5rem; color: var(--bl-ink); line-height: 1.2; }
.bl-fy-row span { font-size: .8rem; color: var(--bl-muted); font-weight: 600; }
.bl-sub-note { margin-top: 10px; font-size: .8rem; color: var(--bl-muted); }
.bl-series-list { display: flex; flex-wrap: wrap; gap: 8px; }
.bl-series-list a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: #faf5ff; border: 1px solid #e9d5ff; text-decoration: none; }
.bl-series-list b { color: #4c1d95; font-size: .88rem; overflow-wrap: anywhere; }
.bl-series-list span { color: #7c3aed; font-size: .76rem; font-weight: 700; }

/* ตัวแก้ไข: ตั้งเวลา / ซีรีส์ / AI */
.be-radio { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: #334155; font-weight: 600; margin: 0 0 6px; cursor: pointer; }
.be-inline { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: .86rem; font-weight: 600; color: #334155; }
.be-input.sm { width: 90px; }
.be-newseries { display: flex; gap: 6px; margin-top: 8px; }
.be-newseries .be-input { flex: 1; min-width: 0; }
.be-ai { background: linear-gradient(160deg, #f5f3ff, #fff 55%); border-color: #ddd6fe; }
.be-ai .be-card-h i { color: #7c3aed; }
.be-ai-sub { margin-left: auto; font-weight: 600; font-size: .72rem; color: #a78bfa; }
.be-ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.be-ai-btn { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 10px; border: 1px solid #ddd6fe; background: #fff; color: #4c1d95; font: 700 .8rem "Sarabun", sans-serif; cursor: pointer; text-align: left; line-height: 1.3; }
.be-ai-btn i { color: #7c3aed; width: 16px; text-align: center; flex-shrink: 0; }
.be-ai-btn:hover { background: #f5f3ff; border-color: #a78bfa; }
.be-ai-btn:disabled { opacity: .55; cursor: wait; }
.be-ai-btn:last-child { grid-column: 1 / -1; }
.be-ai-log { margin-top: 8px; font-size: .8rem; color: #6d28d9; font-weight: 600; }
.be-ai-err { margin-top: 8px; font-size: .8rem; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 7px 10px; line-height: 1.5; }
.be-ai-titles { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.be-ai-titles button { text-align: left; border: 1px solid #e9d5ff; background: #fff; border-radius: 10px; padding: 7px 10px; font: 600 .84rem/1.45 "Sarabun", sans-serif; color: var(--bl-ink); cursor: pointer; }
.be-ai-titles button:hover { background: #faf5ff; border-color: #a78bfa; }
.be-ai-key { margin-top: 8px; }
@media (max-width: 640px) {
  .bl-series-nav { grid-template-columns: minmax(0, 1fr); }
  .bl-series-nav .next { grid-column: 1; }
  .bl-fy-tabs { margin-left: 0; }
}

/* ==========================================================================
   v3 — อ่านง่ายขึ้น (เจ้าของแจ้ง 2026-10-14 "ตัวหนังสือกับพื้นหลังกลืนกัน")
   ลายตารางของพอร์ทัล (.content-wrapper ใน dashboard.css) ตัดกับตัวหนังสือ → ปิดเฉพาะหน้าบทความ
   + เนื้อหาบทความอยู่บน "กระดาษ" สีขาว มีขอบและเงา
   ========================================================================== */
.content-wrapper:has(.bl-page) { background-image: none !important; background-color: #eef2f8 !important; }
.bl-page { background: #eef2f8; min-height: calc(100vh - 57px); }

.bl-read .bl-article {
  background: #fff;
  border: 1px solid #e3e9f2;
  border-radius: 28px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05), 0 24px 60px -30px rgba(15, 35, 86, .25);
  padding: 30px clamp(16px, 4vw, 48px) 44px;
  margin: 0 auto;
  max-width: 1200px;
}
.bl-read .bl-art-head { padding-top: 6px; }
.bl-read .bl-cover { margin-top: 22px; box-shadow: 0 18px 40px -26px rgba(15, 35, 86, .45); }
.bl-read .bl-prose { color: #111827; }
.bl-read .bl-prose p, .bl-read .bl-prose li { color: #1f2937; }
.bl-read .bl-lead { color: #334155; }
/* สารบัญ = การ์ดอ่อนแยกจากเนื้อหา */
.bl-read .bl-toc { background: #f8fafc; border: 1px solid #e2e8f0; border-left: 3px solid #c7d2fe; border-radius: 0 14px 14px 0; }
/* ส่วนท้ายนอกกระดาษ (บทความอื่น) */
.bl-read .bl-more { margin-top: 34px; }
.bl-read .bl-owner, .bl-read .bl-published-msg { max-width: 1200px; }
@media (max-width: 640px) {
  .bl-read .bl-article { border-radius: 18px; padding: 18px 14px 30px; margin: 0 10px; }
  .bl-read { padding-top: 10px !important; }
}
