@charset "utf-8";

/* 新手上路（#2326、#2327）：login.php／material.php／book.php／class.php 彈窗與 guide.php 共用。需排在 style.css 之後 */

/* ---------- 內容（後台編輯器存的 HTML） ---------- */

.guide-content {
    font-size: 16px;
    line-height: 1.6;
    color: #222;
    text-align: left;
    overflow-x: auto;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
}

.guide-content * {
    max-width: 100% !important;
    box-sizing: border-box;
}

.guide-content img {
    height: auto !important;
}

.guide-content video {
    height: auto;
}

.guide-content pre {
    white-space: pre-wrap;
}

.guide-content table {
    display: block;
    overflow-x: auto;
    margin: 0 0 0.8em;
}

.guide-content td,
.guide-content th {
    padding: 2px 6px;
}

/* style.css 把所有 margin/padding 歸零，這裡補回內文間距 */
.guide-content p,
.guide-content ul,
.guide-content ol,
.guide-content blockquote,
.guide-content pre,
.guide-content h1,
.guide-content h2,
.guide-content h3,
.guide-content h4,
.guide-content h5,
.guide-content h6 {
    margin: 0 0 0.8em;
}

.guide-content ul,
.guide-content ol {
    padding-left: 1.8em;
}

.guide-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 12px;
}

.guide-content a {
    color: #a40035;
    text-decoration: underline;
}

.guide-empty {
    text-align: center;
    color: #888;
    padding: 32px 0;
    font-size: 16px;
}

/* ---------- 彈窗 ---------- */

html.guide-lock,
html.guide-lock body {
    overflow: hidden;
}

.guide-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 9900;
    padding: 16px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
}

.guide-overlay.is-open {
    display: flex;
}

.guide-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 720px;
    max-height: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.guide-box-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 6px 18px;
    background: #a40035;
    color: #fff;
}

.guide-box-header h2 {
    font-size: 20px;
}

.guide-close {
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.guide-box-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 75vh;
    padding: 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- 獨立頁 guide.php ---------- */

.guide_bd {
    background: url(../images/bg.png) repeat top center;
}

.guide_bd .guide-header {
    background: #a40035;
    padding: 10px 16px;
}

.guide-home {
    display: inline-block;
    color: #fff;
    font-size: 20px;
    line-height: 40px;
}

.guide-home img {
    height: 40px;
    margin: 0 10px 0 0;
    vertical-align: top;
}

.guide-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 12px 40px;
}

.guide-title {
    font-size: 24px;
    color: #a40035;
    margin: 0 0 16px;
}

.guide-panel {
    background: #fff;
    padding: 18px;
    border-radius: 8px;
    box-shadow: 0 0 4px 4px rgba(0, 0, 0, 0.05);
}

.guide-back {
    display: inline-block;
    margin: 24px 0 0;
    padding: 10px 24px;
    border-radius: 6px;
    background: #a40035;
    color: #fff;
    font-size: 17px;
}

/* ---------- 內頁手機直向（#2327）：material／book／class，避免固定寬造成水平捲動 ---------- */

@media only screen and (max-width: 479px) {
    .inner_bd #top,
    .inner_bd #inside_sec {
        width: 100%;
    }
    .inner_bd .logo {
        width: auto;
        max-width: calc(100% - 75px);
        margin: 8px 0 15px 10px;
        font-size: 22px;
        white-space: normal;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    /* 三頁的 .mblink／.mbback 寬度寫在 style 屬性上 */
    .inner_bd .mblink,
    .inner_bd .mbback {
        float: none;
        width: auto !important;
    }
    .inner_bd .mblink {
        word-wrap: break-word;
        word-break: break-word;
    }
    .inner_bd .mbback {
        overflow: hidden;
        padding: 0 0 4px;
    }
    .inner_bd .listall {
        width: auto;
        margin: 15px 5px 30px;
    }
    .inner_bd .listall table {
        table-layout: fixed;
    }
    .inner_bd .listall td {
        font-size: 12px;
        overflow: hidden;
        word-wrap: break-word;
        word-break: break-word;
    }
    .inner_bd .listall td a {
        display: block;
    }
    .inner_bd .listall td img {
        max-width: 100%;
        box-sizing: border-box;
    }
}
