*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 0 !important;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

.text-center {
    width: 100%;
    min-width: 0;
}

.bj {
    width: min(1200px, 100%) !important;
    max-width: 1200px;
    padding-inline: clamp(8px, 2.5vw, 24px);
    margin-inline: auto;
}

.fn_part,
.fn_bz,
.mod_box_t1,
.mod_box_t3,
.mod_box_t3 .box_con,
.fn_part .intro_area,
.fn_part .intro_area_b,
.relateLinks,
.bd,
.viewbox,
.inform_vip {
    max-width: 100%;
}

.mod_box_t1 .bd {
    overflow-wrap: anywhere;
}

.listTable {
    max-width: 100%;
}

.listTable th,
.listTable td {
    white-space: nowrap;
    vertical-align: middle;
}

.yaopan {
    width: 100% !important;
    max-width: 770px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-inline: auto;
}

.yaopan > .listTable {
    min-width: 680px;
}

.con-title {
    width: auto !important;
    min-height: 2rem;
    height: auto !important;
    line-height: 1.5;
    padding-bottom: 6px;
}

.con-word {
    overflow-wrap: anywhere;
}

.con-word table,
.con-word pre {
    max-width: 100%;
    overflow-x: auto;
}

.fn_part .info_prop {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.fn_part .info_prop span {
    float: none;
}

.fn_part .cur_info .a_retest_dy,
.fn_part .cur_info .a_retest_fx,
.fn_part .cur_info .a_retest_dl,
.fn_part .cur_info .a_retest_ls,
.fn_part .cur_info .a_retest_tc {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px !important;
    margin: 4px;
    position: static !important;
    float: none;
    white-space: nowrap;
}

.login_div,
.login_div tbody,
.login_div tr,
.login_div td {
    display: block;
    width: 100% !important;
    max-width: 100%;
}

.login_div ul {
    width: min(500px, 100%) !important;
    height: auto !important;
    min-height: 0;
    padding: 0;
    margin-inline: auto;
}

.login_div li {
    width: 100%;
}

.login_div .row,
#myModaS .row {
    margin-inline: 0;
}

.login_div .form-control,
.login_div .bb-input,
.login_div input,
#myModaS .form-control,
#myModaS .bb-input,
#myModaS input,
#myModaS textarea {
    width: 100% !important;
    max-width: 100%;
}

.auth-panel {
    width: min(440px, calc(100vw - 48px));
    max-width: 100%;
    box-sizing: border-box;
    display: grid;
    gap: 14px;
    padding: 4px 2px 2px;
}

.auth-panel-register {
    width: min(440px, calc(100vw - 48px));
    max-width: 100%;
    max-height: min(72vh, 620px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.auth-field {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.auth-field > * {
    min-width: 0;
}

.auth-field label {
    margin: 0;
    color: #463525;
    font-weight: 700;
    white-space: nowrap;
}

.auth-field .form-control,
.auth-field .bb-input,
.auth-field input {
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
}

.auth-actions,
.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.auth-actions {
    justify-content: flex-end;
    padding-top: 4px;
}

.captcha-row img {
    width: 96px;
    height: 42px;
    border: 1px solid #d4b993;
    border-radius: 6px;
    background: #fff;
    object-fit: cover;
}

#myModaS {
    width: min(686px, calc(100vw - 24px)) !important;
    max-width: 100%;
}

#myModaS table,
#myModaS tbody,
#myModaS tr {
    width: 100%;
}

.bb-modal .modal-dialog,
.modal-dialog {
    max-width: calc(100vw - 16px);
    margin-inline: auto;
}

.bb-modal .modal-body,
.modal-body {
    overflow-x: hidden;
}

.bb-slide-list {
    max-width: calc(100vw - 16px) !important;
}

.chat-icon {
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
}

.message-container {
    min-width: 0;
}

.message-text-container {
    min-width: 0;
    overflow-wrap: anywhere;
}

.message-text-container pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.customer-message,
.staff-message {
    height: auto !important;
    min-height: 38px;
}

@media (max-width: 1024px) {
    .mod_box_t1 .bd,
    .mod_box_t3 .box_con {
        padding-inline: clamp(10px, 2.5vw, 18px) !important;
    }

    .fn_part .intro_area {
        line-height: 1.8;
        text-align: left;
    }
}

@media (max-width: 768px) {
    .bj {
        padding-inline: 8px !important;
    }

    .mod_box_t1 .hd {
        height: auto;
        min-height: 44px;
        margin-inline: 8px;
    }

    .mod_box_t1 .bd,
    .mod_box_t3 .box_con {
        padding: 0 10px 18px !important;
    }

    .fn_part .intro_area {
        font-size: 14px;
    }

    .row.g-3 {
        --bs-gutter-x: .5rem;
        --bs-gutter-y: .5rem;
    }

    .row.g-3 > [class*="col-"],
    .row.g-6 > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    .col-form-label {
        padding-bottom: 0;
        text-align: left;
    }

    .img-list {
        margin-left: 0 !important;
        padding-left: 0;
    }

    .img-list ul {
        display: flex;
        justify-content: center;
        gap: 10px;
        padding-left: 0;
        margin: 0;
    }

    .img-list li {
        float: none !important;
        width: auto !important;
    }

    #result,
    #divYaoGua > div[style*="margin-left"] {
        margin-left: 0 !important;
        text-align: center;
    }

    .btn_tool_retest,
    .d-flex.justify-content-center.flex-grow-1 {
        flex-wrap: wrap;
    }

    .btn_orange,
    .action-btn {
        min-width: 112px;
        width: auto !important;
    }

    .yaopan > .listTable {
        min-width: 620px;
        font-size: 13px;
    }

    .con-word {
        font-size: 15px;
        line-height: 1.75;
        padding-inline: 8px;
    }

    .fn_part .info_prop {
        padding-inline: 4px;
        gap: 4px 10px;
    }

    .fn_part .info_prop span {
        width: 100%;
    }

    .fn_part .info_prop span[style*="padding-left"] {
        padding-left: 0 !important;
    }

    #myModaS table,
    #myModaS tbody,
    #myModaS tr,
    #myModaS td {
        display: block;
        width: 100% !important;
        height: auto !important;
    }

    #myModaS td:first-child {
        padding-top: 10px;
        font-weight: 600;
    }

    #myModaS .col-12,
    #myModaS .col-sm-7 {
        width: 100%;
        max-width: 100%;
        padding-inline: 0;
    }

    .chat-icon {
        width: auto !important;
        min-width: 48px;
        height: 48px !important;
    }
}

@media (max-width: 480px) {
    .bb-modal .modal-body,
    .modal-body {
        padding-inline: 10px;
    }

    .yaopan {
        margin-inline: -2px;
        width: calc(100% + 4px) !important;
    }

    .yaopan > .listTable {
        min-width: 560px;
        font-size: 12px;
        border-spacing: 3px;
    }

    .con-title b {
        font-size: 16px !important;
    }

    .download-link-container a {
        font-size: 14px !important;
    }
}
/* App-style shared navigation */
.web-shell {
    min-height: 100vh;
    background: #f6f3ee;
}

.web-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 56px;
    padding: 0 28px;
    background: #fffaf2;
    border-bottom: 1px solid rgba(80, 64, 42, 0.16);
}

.brand {
    color: #2d2012;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.web-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.web-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #463525;
    white-space: nowrap;
}

.web-nav a,
.web-auth a,
.web-tabbar a {
    color: #463525;
    text-decoration: none;
}

.web-nav a {
    padding: 8px 14px;
    border-radius: 6px;
}

.web-nav a.active {
    background: #ff991e;
    color: #111;
}

.web-main {
    min-height: calc(100vh - 56px);
}

.web-tabbar {
    display: none;
}

.app-page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.app-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.app-section-head h1 {
    margin: 0;
    font-size: 28px;
    color: #2b2015;
}

.app-section-head p {
    margin: 6px 0 0;
    color: #6f6255;
}

.app-card,
.profile-card,
.book-card,
.reading-card,
.stat-card,
.chapter-row,
.menu-list a,
.menu-button {
    background: #fffdf8;
    border: 1px solid rgba(80, 64, 42, 0.14);
    border-radius: 8px;
}

.app-card {
    padding: 18px;
}

.app-error {
    color: #9d1c1c;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.book-card {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 14px;
    padding: 14px;
}

.book-card img {
    width: 92px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 6px;
    background: #eee5d6;
}

.book-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.book-card p {
    margin: 0 0 12px;
    color: #63584c;
    line-height: 1.6;
}

.app-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 6px;
    background: #ff991e;
    color: #111;
    text-decoration: none;
    border: 0;
}

.app-button-light {
    background: #fff6e7;
    border: 1px solid #d4b993;
}

.exam-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.exam-panel h2,
.quiz-result h2,
.quiz-question-card h2,
.quiz-question-card h3 {
    margin-top: 0;
}

.exam-actions,
.quiz-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.compact {
    margin-top: 4px;
}

.quiz-progress {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: #6f6255;
    font-weight: 700;
}

.quiz-options {
    display: grid;
    gap: 10px;
    margin: 16px 0;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(80, 64, 42, 0.14);
    border-radius: 8px;
    background: #fffdf8;
}

.quiz-option input {
    margin-top: 4px;
}

.quiz-review {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.history-head,
.history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.history-head {
    margin-bottom: 12px;
}

.history-head h2 {
    margin: 0;
}

.history-row > div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.history-row span {
    color: #6f6255;
}

.app-link {
    color: #8a4f00;
    text-decoration: none;
}

.chapter-list,
.menu-list {
    display: grid;
    gap: 10px;
}

.chapter-row,
.menu-list a,
.menu-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 16px;
    color: #2f251b;
    text-decoration: none;
}

.menu-button {
    width: 100%;
    font: inherit;
    cursor: pointer;
}

.reading-card {
    padding: 22px;
    line-height: 1.9;
    color: #2d241b;
}

.profile-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    margin-bottom: 14px;
}

.profile-card h2 {
    margin: 0 0 6px;
}

.profile-card p {
    margin: 0;
    color: #6f6255;
}

.account-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.account-card h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.account-card p {
    margin: 0;
    color: #6f6255;
}

.account-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.stat-card {
    padding: 16px;
}

.stat-card strong {
    display: block;
    font-size: 26px;
    color: #2d2012;
}

.stat-card span {
    color: #6f6255;
}

@media (max-width: 768px) {
    .web-topbar {
        display: none;
    }

    .web-main {
        min-height: 100vh;
        padding-bottom: 72px;
    }

    .web-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 200;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        min-height: 58px;
        background: #fffaf2;
        border-top: 1px solid rgba(80, 64, 42, 0.18);
    }

    .web-tabbar a {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
    }

    .web-tabbar a.active {
        color: #b26000;
        font-weight: 700;
    }

    .app-page {
        width: min(100% - 20px, 680px);
        padding: 18px 0 24px;
    }

    .app-section-head,
    .profile-card,
    .account-card,
    .exam-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .history-row {
        align-items: flex-start;
        flex-direction: column;
        min-height: auto;
        padding: 12px 14px;
    }

    .auth-field {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .auth-actions {
        justify-content: stretch;
    }

    .auth-actions .btn {
        flex: 1 1 120px;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .book-card {
        grid-template-columns: 74px 1fr;
    }

    .book-card img {
        width: 74px;
    }
}
