/*
 * Forum UI parity with www.vnpy.com/forum (P0).
 * Loaded AFTER FlaskBB app.css (BS5) and CDN BS3/site chrome CSS.
 * Does not modify shared CDN assets.
 */

/* --- rem / typography: defeat BS3 html{font-size:10px} + BS5 rem --- */
html {
    font-size: 14px;
}

body {
    font-family: "微软雅黑", Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.42857143;
    color: #333;
    background-color: #f6f9fc;
}

/* --- site chrome (fixed top nav) --- */
.navs {
    background-color: rgb(23, 30, 64) !important;
}

.flaskbb-layout {
    padding-top: 40px;
    padding-bottom: 70px;
    position: relative;
    min-height: 100vh;
}

/* Banner clearance under 60px fixed .navs (www: 40px + 2.5em) */
.flaskbb-header {
    margin-top: 2.5em;
}

/* Align outer width with BS3 aurora container ladder */
.flaskbb-layout > .container {
    width: 100%;
    max-width: 1170px;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .flaskbb-layout > .container {
        width: 750px;
        max-width: 750px;
    }
}

@media (min-width: 992px) {
    .flaskbb-layout > .container {
        width: 970px;
        max-width: 970px;
    }
}

@media (min-width: 1200px) {
    .flaskbb-layout > .container {
        width: 1170px;
        max-width: 1170px;
    }
}

/* --- defeat style_new-1.min.css global .card (max-width 1100px + heavy shadow) ---
 * Keep BS5 Card position:relative; do not zero all vertical margin/padding.
 */
.flaskbb-layout .card {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    top: auto;
    left: auto;
    border-radius: 0;
    background-color: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.flaskbb-layout .index-view > .card {
    width: 100%;
}

.flaskbb-layout .card.category,
.flaskbb-layout .card.forum,
.flaskbb-layout .card.topic,
.flaskbb-layout .card.page {
    margin-bottom: 20px;
    border-color: #cad7e1;
}

/* category cards: app.css uses mt-3; keep spacing close to www 20px panels */
.flaskbb-layout .card.category.mt-3 {
    margin-top: 0 !important;
}

/* --- forum sub-nav --- */
.flaskbb-navbar {
    min-height: 50px;
    margin-bottom: 20px;
    border: 1px solid #cad7e1;
    background-color: #f8f8f8 !important;
}

.flaskbb-navbar .nav-link {
    padding: 15px !important;
    line-height: 20px;
}

.flaskbb-navbar .nav-link.active,
.flaskbb-navbar .nav-link.active:hover {
    color: #555;
    background-color: #e7e7e7;
    box-shadow: none;
}

.flaskbb-navbar .nav-link:focus-visible {
    outline: 2px solid #337ab7;
    outline-offset: -2px;
    box-shadow: none;
}

.flaskbb-layout .row {
    --bs-gutter-x: 30px;
}

/* --- BS3/BS5 modal coexistence --- */
.modal.fade.show {
    opacity: 1;
}

.modal {
    z-index: 2000 !important;
}

.modal-backdrop {
    z-index: 1990 !important;
}

/* --- footer --- */
.veighna-site-footer {
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 4%;
    min-height: 50px;
    background-color: #f6f9fc;
    color: rgba(0, 0, 0, 0.4);
    position: absolute;
    width: 100%;
    bottom: 0;
    left: 0;
    font-size: 13px;
}

.veighna-site-footer a {
    color: inherit;
    text-decoration: none;
}

/* --- rem-based controls (sanity after html font-size:14px) --- */
.flaskbb-layout .btn {
    font-size: 14px;
    line-height: 1.42857143;
}

.flaskbb-layout .form-control {
    font-size: 14px;
    line-height: 1.42857143;
}

.flaskbb-layout .dropdown-menu {
    font-size: 14px;
}

.flaskbb-layout .badge {
    font-size: 12px;
}

.flaskbb-layout .pagination {
    font-size: 14px;
}

/* --- inbox / action button spacing --- */
.flaskbb-navbar .nav-link.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
}

.flaskbb-navbar .nav-link .badge {
    margin-left: 0.15em;
}

.flaskbb-layout .controls-row .col-auto .btn,
.flaskbb-layout .controls-row .col-auto form.d-inline,
.flaskbb-layout .controls-row .col-auto .dropdown {
    margin-left: 0.35rem;
}

.flaskbb-layout .controls-row .col-auto > :first-child {
    margin-left: 0;
}

/* --- markdown editor: defeat Songti fallback + flush cursor ---
 * FlaskBB 2 uses <markdown-toolbar> + textarea.flaskbb-editor.
 * CDN scripts-5 may still wrap with bootstrap-markdown (.md-editor); style both.
 */
.flaskbb-layout textarea.flaskbb-editor,
.flaskbb-layout .md-editor > textarea,
.flaskbb-layout .editor textarea {
    font-family: "微软雅黑", "Microsoft YaHei", Arial, Helvetica, sans-serif !important;
    font-size: 14px;
    line-height: 1.5;
    padding: 0.5rem 0.75rem !important;
    color: #333;
}

.flaskbb-layout textarea.flaskbb-editor::placeholder,
.flaskbb-layout .md-editor > textarea::placeholder {
    font-family: inherit;
    color: #999;
}

/* Hide legacy bootstrap-markdown chrome if CDN still injects it */
.flaskbb-layout .md-editor > .md-header,
.flaskbb-layout .md-editor > .md-footer {
    display: none !important;
}
