﻿/* คู่มือร้านเอกสารการเรียน : หน้า HTML ล้วน (ไม่ผ่าน ASP.NET) เปิดได้โดยไม่ต้องล็อกอิน · พิมพ์ได้ */
:root {
    --ink: #10233d;
    --ink-2: #3c4f66;
    --muted: #6b7a8c;
    --line: #e2e8f0;
    --bg: #f4f6fa;
    --card: #ffffff;
    --brand: #1a5aa6;
    --brand-soft: #e8f0fb;
    --accent: #b4531f;
    --ok: #15803d;
    --warn-bg: #fff6e5;
    --warn: #8a5a00;
    --danger: #b42318;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Prompt", "Leelawadee UI", "Tahoma", sans-serif;
    font-weight: 300;
    line-height: 1.7;
    font-size: 16px;
}
b, strong { font-weight: 600; }
a { color: var(--brand); }
img { max-width: 100%; height: auto; }

/* ---------- หัวคู่มือ ---------- */
.m-hero {
    background: linear-gradient(135deg, #0d2f5c 0%, #1a5aa6 100%);
    color: #fff;
    padding: 28px 16px 36px;
}
.m-hero-in, .m-main { max-width: 1040px; margin: 0 auto; }
.m-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.m-brand img { width: 44px; height: 44px; }
.m-brand span { font-weight: 500; font-size: 1rem; line-height: 1.3; }
.m-brand small { display: block; font-weight: 300; opacity: .75; font-size: .8rem; }
.m-hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); font-weight: 600; margin: 22px 0 6px; line-height: 1.3; }
.m-hero p { margin: 0; opacity: .88; max-width: 680px; }
.m-tag {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 16px; padding: 4px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .14); font-size: .85rem;
}
.m-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.m-switch a {
    color: #fff; text-decoration: none; font-size: .85rem;
    padding: 5px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35);
}
.m-switch a.is-on { background: #fff; color: var(--brand); border-color: #fff; font-weight: 500; }

/* ---------- เนื้อหา ---------- */
.m-main { padding: 0 16px 48px; }
.m-toc {
    background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    margin-top: -18px; padding: 18px 22px; box-shadow: 0 6px 24px rgba(16, 35, 61, .06);
}
.m-toc h2 { font-size: 1rem; margin: 0 0 8px; font-weight: 600; }
.m-toc ol { margin: 0; padding-left: 1.3rem; columns: 2 260px; column-gap: 32px; }
.m-toc li { break-inside: avoid; }
.m-toc a { text-decoration: none; }

.m-part { margin-top: 36px; }
.m-part > h2 {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.35rem; font-weight: 600; margin: 0 0 14px;
}
.m-part > h2 .n {
    display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
    border-radius: 10px; background: var(--brand); color: #fff; font-size: 1rem;
}
.m-part > p { margin: 0 0 14px; color: var(--ink-2); }

.m-step {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 22px; align-items: start;
    background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    padding: 20px; margin-bottom: 14px;
    break-inside: avoid; page-break-inside: avoid;
}
.m-step.is-phone { grid-template-columns: minmax(0, 1fr) 300px; }
.m-step.is-wide { grid-template-columns: 1fr; }
.m-step h3 { font-size: 1.08rem; font-weight: 600; margin: 0 0 6px; display: flex; gap: 10px; align-items: baseline; }
.m-step h3 .s {
    flex: none; display: inline-grid; place-items: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand); font-size: .9rem; font-weight: 600;
}
.m-step p, .m-step ul, .m-step ol { margin: 0 0 8px; color: var(--ink-2); }
.m-step ul, .m-step ol { padding-left: 1.2rem; }
.m-shot { margin: 0; }
.m-shot img {
    display: block; width: 100%;
    border: 1px solid var(--line); border-radius: 12px; background: #fff;
    box-shadow: 0 4px 18px rgba(16, 35, 61, .08);
}
.m-shot figcaption { font-size: .8rem; color: var(--muted); margin-top: 6px; text-align: center; }

.btn-ref {
    display: inline-block; padding: 0 8px; border-radius: 6px;
    background: var(--brand-soft); color: var(--brand); font-weight: 500; white-space: nowrap;
}
.btn-ref.is-accent { background: #fbeee6; color: var(--accent); }
.btn-ref.is-ok { background: #e6f4ea; color: var(--ok); }
.btn-ref.is-danger { background: #fdecea; color: var(--danger); }

.m-note, .m-warn {
    border-radius: 12px; padding: 10px 14px; margin: 10px 0 0; font-size: .92rem;
    display: flex; gap: 10px;
}
.m-note { background: var(--brand-soft); color: #173e6e; }
.m-warn { background: var(--warn-bg); color: var(--warn); }
.m-note i, .m-warn i { flex: none; margin-top: 2px; }

/* ตารางสถานะ / คำถามพบบ่อย */
.m-table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.m-table th, .m-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.m-table th { background: #f8fafc; font-weight: 600; font-size: .9rem; }
.m-table tr:last-child td { border-bottom: 0; }
.m-pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.p-wait { background: #fff1d6; color: #8a5a00; }
.p-bad { background: #fdecea; color: var(--danger); }
.p-paid { background: var(--brand-soft); color: var(--brand); }
.p-part { background: #eef2ff; color: #4338ca; }
.p-done { background: #e6f4ea; color: var(--ok); }
.p-off { background: #eef1f5; color: var(--muted); }

.m-faq details {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 16px; margin-bottom: 8px;
}
.m-faq summary { cursor: pointer; font-weight: 500; }
.m-faq details p { margin: 8px 0 0; color: var(--ink-2); }

.m-foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 40px; }
.m-print {
    position: fixed; right: 16px; bottom: 16px;
    border: 0; border-radius: 999px; padding: 10px 18px;
    background: var(--brand); color: #fff; font: inherit; font-weight: 500;
    box-shadow: 0 6px 20px rgba(26, 90, 166, .35); cursor: pointer;
}

@media (max-width: 760px) {
    .m-step, .m-step.is-phone { grid-template-columns: 1fr; padding: 16px; }
    .m-step.is-phone .m-shot { max-width: 320px; margin: 0 auto; }
    .m-table th, .m-table td { padding: 8px 10px; font-size: .9rem; }
}

@media print {
    body { background: #fff; font-size: 12pt; }
    .m-hero { background: none; color: var(--ink); padding: 0 0 8px; border-bottom: 2px solid var(--ink); }
    .m-brand, .m-switch a, .m-tag { color: var(--ink); }
    .m-switch, .m-print { display: none; }
    .m-toc { margin-top: 12px; box-shadow: none; }
    .m-step { box-shadow: none; }
    .m-shot img { box-shadow: none; }
    .m-step.is-phone { grid-template-columns: minmax(0, 1fr) 220px; }
    .m-faq details { break-inside: avoid; }
    .m-faq details > * { display: block; }
    a { color: inherit; text-decoration: none; }
}

/* ---------- เครดิตผู้พัฒนา : บริษัท โคราชบ้านซอฟต์แวร์ จำกัด ---------- */
.m-by { margin-top: 12px; font-size: .85rem; opacity: .8; }
.m-by b { font-weight: 500; }
.m-credit {
    display: flex; align-items: center; gap: 18px;
    margin-top: 40px; padding: 16px 20px;
    background: var(--card); border: 1px solid var(--line); border-radius: 16px;
    break-inside: avoid; page-break-inside: avoid;
}
.m-credit img { width: 150px; flex: none; }
.m-credit small { display: block; color: var(--muted); font-size: .8rem; }
.m-credit b { display: block; font-size: 1.05rem; }
.m-credit span { display: block; color: var(--muted); font-size: .85rem; }
.m-credit + .m-foot { margin-top: 16px; }

/* ลายน้ำมุมภาพหน้าจอ (อยู่ใน CSS ไม่ฝังในรูป — ถ่ายภาพใหม่ได้โดยไม่ต้องใส่ซ้ำ) */
.m-shot { position: relative; }
.m-shot::after {
    content: "© KORAT BAN SOFTWARE";
    position: absolute; right: 8px; bottom: 8px;
    padding: 1px 8px; border-radius: 6px;
    background: rgba(16, 35, 61, .55); color: #fff;
    font-size: .68rem; font-weight: 500; letter-spacing: .03em;
    pointer-events: none;
}
.m-shot:has(figcaption)::after { bottom: 32px; }

.m-print-credit { display: none; }

@media (max-width: 760px) {
    .m-credit { flex-direction: column; text-align: center; }
    .m-credit img { width: 130px; }
}

@media print {
    .m-by { opacity: 1; }
    .m-shot::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    /* position: fixed ในหน้าพิมพ์ = พิมพ์ซ้ำทุกหน้า */
    .m-print-credit {
        display: block; position: fixed; left: 0; right: 0; bottom: 0;
        text-align: center; font-size: 8pt; color: #6b7a8c;
    }
    .m-main { padding-bottom: 24px; }
}
