/* 全局基础样式重置 */
:root {
    --logo-height: 65px;
    --logo-margin-top: 1px;
    --logo-margin-bottom: 1px;
    --header-height: calc(var(--logo-height) + var(--logo-margin-top) + var(--logo-margin-bottom));
    --navbar-brand-left: 15px;
    --navbar-brand-left-mobile: 1px;
    --navbar-margin: 0px auto;
    --head-gap: 2px;
    --page-top: calc(var(--header-height) + var(--head-gap));
    /* 右侧内容高度 */
    --max-width: 1440px;
    --mainnav_div-width: 260px;
    --header-bgcolor: #252532;
    --bgcolor: #393946;
    --tblr-white: #FFFAFA;
    /* 右侧卡片背景颜色 */
    --tblr-nav-link-font-size: 16px;
    --tipbg: rgb(245 255 245);
    --font-family: "Microsoft YaHei", "微软雅黑", "Arial", "Helvetica", "SimSun", sans-serif;
    --tblr-body-font-family: "Microsoft YaHei", "微软雅黑", "Arial", "Helvetica", "SimSun", sans-serif;
}

[data-bs-theme-base=slate] {
    --tblr-gray-500: #808080;
    --tblr-gray-800: var(--bgcolor);
    /* 暗黑模式 - 右侧内容背景色 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root,
* {
    scrollbar-color: color-mix(in srgb, var(--tblr-scrollbar-color, var(--tblr-body-color)) 50%, #f5f5f5 50%) transparent;
    scrollbar-width: thin;
}

*::-webkit-scrollbar {
    width: 1rem;
    height: 1rem;
    -webkit-transition: background 0.3s;
}

.mb-3 {
    margin-bottom: 4px !important;
    /* 卡片之间的距离 */
}

.gap-3 {
    gap: 0.2rem !important;
    /* 语言图标与语言选择器间隔 */
}

body {
    background: var(--bgcolor) !important;
    font-family: var(--font-family) !important;
    font-size: 14px !important;
    font-weight: 300 !important;
}

/* 头部容器样式 */
.header {
    width: 100%;
    min-height: var(--header-height);
    background-color: var(--header-bgcolor);
    border-bottom: 1px solid gray;
    position: fixed;
    z-index: 999999;
}

@media (max-width: 991.98px) {
    .header {
        position: static;
    }
}

/* 头部内部容器 */
.header_b {
    padding-top: var(--logo-margin-top);
    padding-bottom: var(--logo-margin-bottom);
    max-width: var(--max-width);
    margin: auto;
    display: flex;
    /* 弹性布局，让logo和语言选择器左右分布 */
    justify-content: space-between;
    /* 两端对齐 */
    align-items: center;
    /* 垂直居中 */
}

/* logo样式 */
.navbar-brand-image {
    padding-left: var(--navbar-brand-left);
    height: var(--logo-height);
    object-fit: contain;
}

@media (max-width: 991.98px) {
    .navbar-brand-image {
        padding-left: var(--navbar-brand-left-mobile);
    }
}

#version {
    color: #26A2E0;
    font-weight: 400;
}

#update_version {
    position: fixed;
    bottom: calc(100% - var(--top) + 6px);
    margin-left: var(--version-left);
    font-size: 16px;
    color: #26A2E0;
    bottom: calc(100% - var(--top) + 6px);
    margin-left: var(--version-left);
}

.page-header {
    margin-top: 0px;
}

.icon {
    --tblr-icon-size: 40px;
    width: var(--tblr-icon-size);
    height: var(--tblr-icon-size);
    font-size: var(--tblr-icon-size);
    vertical-align: bottom;
    stroke-width: 1px;
}

.text-muted {
    --tblr-text-opacity: 1;
    color: gray !important;
}

#langSelect {
    padding: 0.375rem 1.25rem 0.375rem 0.375rem;
    cursor: pointer;
}

.form-control-sm {
    font-size: 0.875rem;
}

.pt-lg-3 {
    padding-top: 1px !important;
}

.row {
    width: 100%;
    display: flex;
    align-items: center;
}

.col-auto.ms-auto {
    padding: 0;
}

/* 头部结束 */

.page {
    padding-top: var(--page-top);
    background: none !important;
    width: calc(var(--max-width) + 0px) !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    z-index: 1;
}

@media (max-width: 991.98px) {
    .page {
        padding-top: 0;
    }
}

.navbar {
    min-height: 2rem;
    position: sticky;
    top: 0px;
    z-index: 99
}

.navbar-expand-lg.navbar-vertical {
    box-shadow: none;
}

.container,
.container-fluid,
.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm {
    --tblr-gutter-x: calc(var(--tblr-page-padding) * 2);
    --tblr-gutter-y: 0;
    width: 100%;
    padding-right: 0px;
    padding-left: 0px;
    margin-right: auto;
    margin-left: auto;
}

.navbar-toggler {
    color: #26A2E0;
    opacity: 1;
    border: 2px solid;
    width: 3rem;
    height: 2rem;
    z-index: 99;
}

#mainnav_div {
    margin: var(--navbar-margin);
    height: auto;
    max-height: calc(100vh - var(--page-top) - 20px);
    background-color: var(--bgcolor);
    position: fixed;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 1;
    width: var(--mainnav_div-width);
}

@media (max-width: 991.98px) {
    #mainnav_div {
        width: 100%;
        position: sticky;
    }
}

.dropdown-menu {
    font-size: var(--tblr-dropdown-font-size);
    font-weight: 300;
}

.dropdown-item {
    font-weight: 300;
}

.navbar-vertical.navbar-expand-lg .navbar-collapse .dropdown-menu .dropdown-item {
    color: var(--tblr-white);
}

/* common.css 258行 */
/* iOS14.2 win7 低版本chrome 不支持 color-mix 兼容修改*/
.navbar.navbar-vertical .navbar-nav>.nav-item.active>.nav-link,
.navbar.navbar-vertical .navbar-nav>.nav-item>.nav-link.active {
    background-color: #ffffff;
    color: var(--tblr-primary);
    position: relative;
    z-index: 1;
    /* 文字在上 */
}

/* 用一个内部叠加层，不影响任何原生伪元素（箭头/图标都保留） */
.navbar.navbar-vertical .navbar-nav>.nav-item.active>.nav-link::before,
.navbar.navbar-vertical .navbar-nav>.nav-item>.nav-link.active::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: -1;
}

/* 新浏览器用原生 color-mix */
@supports (color: color-mix(in srgb, red 50%, #000)) {

    .navbar.navbar-vertical .navbar-nav>.nav-item.active>.nav-link,
    .navbar.navbar-vertical .navbar-nav>.nav-item>.nav-link.active {
        color: color-mix(in srgb, var(--tblr-primary) 80%, #000000);
    }

    .navbar.navbar-vertical .navbar-nav>.nav-item.active>.nav-link::before,
    .navbar.navbar-vertical .navbar-nav>.nav-item>.nav-link.active::before {
        display: none;
    }
}

/* 当前子菜单项 */
.navbar.navbar-vertical .dropdown-menu .dropdown-item.active {
    color: rgba(var(--tblr-primary-rgb), 0.9);
    background: transparent;
}

@media (min-width: 992px) {

    .navbar-vertical.navbar-expand-lg .navbar-collapse .dropdown-menu .dropdown-item.active,
    .navbar-vertical.navbar-expand-lg .navbar-collapse .dropdown-menu .dropdown-item:active {
        background: transparent;
    }

    .navbar-vertical.navbar-expand-lg,
    .navbar-vertical.navbar-expand-lg .navbar-collapse {
        width: var(--mainnav_div-width);
    }
}

.page-body {
    margin-top: 1px;
    margin-bottom: 1px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* tabStyle.css - 编码相关修改 */
.tab_card {
    padding: 0;
}
.content_box_content {
    padding: 10px 30px 50px 32px;
    font-size: 14px;
}

.content_header_tab{
    justify-content: space-between;
}

@media (max-width: 576px) {
    .content_box_content {
        padding: 10px 10px 50px 8px;
    }
}

/* 顶部提示框采用 Tabler 卡片样式 */
.tabWrite {
    max-width: 1200px;
    margin-left: 2px;
}

.tab_tips_box {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 10px;
}


.tabWrite dl {
    display: grid;
    grid-template-columns: minmax(50px, 200px) 1fr;
    width: 100%;
    max-width: 800px;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 2px;
}

@media (max-width: 576px) {
    .tabWrite dl {
        display: grid;
        grid-template-columns: minmax(50px, 150px) 1fr;
        width: 100%;
        max-width: 400px;
    }
}

.tabWrite select {
    --tblr-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    display: block;
    padding: 0.375rem 1.25rem 0.375rem 0.375rem;
    line-height: 1.25rem;
    color: var(--tblr-body-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none !important;
    background-color: var(--tblr-body-bg);
    background-image: var(--tblr-form-select-bg-img), var(--tblr-form-select-bg-icon, none);
    background-repeat: no-repeat;
    background-position: right 0.1rem center;
    background-size: 16px 12px;
    box-shadow: var(--tblr-shadow-input);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.tabWrite input[type="text"] {
    padding: 0.375rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    font-size: 0.875rem;
    max-width: 100%;
    flex: 1;
    min-width: 50px;
}

#encodePart input[type="text"],
#tsPart input[type="text"],
#audioPart input[type="text"] {
    max-width: 150px;
}

.write input {
    max-width: 1200px;
}

.tab_content {
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.content_box_header {
    border-radius: 4px;
}

/* 结束-tabStyle.css - 编码相关修改 */

/* 提示文字 */
.settings-form .hint {
    font-size: 0.875rem;
    color: var(--tblr-muted);
}

/* OSD等页面输入框统一宽度 */
.settings-form input[type="text"],
.settings-form input[type="password"],
.settings-form input[type="number"] {
    max-width: 280px;
}

@media (max-width: 576px) {
    .settings-form {
        padding: 20px 8px;
    }

    .settings-form input[type="text"],
    .settings-form input[type="password"],
    .settings-form input[type="number"] {
        max-width: 150px;
    }

}

/* OSD-text宽度 基础样式*/
[id^="txtOsd"] input[type="text"] {
    min-width: 20px !important;
    width: 100% !important;
    max-width: 920px !important;
}

/* 下拉框 */
.form-select {
    font-size: 0.875rem;
    padding: 0.375rem 1.25rem 0.375rem 0.375rem;
    background-position: right 0.1rem center;
}

.settings-form dl,
.settings-form .form-row {
    grid-template-columns: 200px 1fr;
    grid-template-columns: minmax(50px, 200px) 1fr;
}

@media (max-width: 576px) {

    .settings-form dl,
    .settings-form .form-row {
        grid-template-columns: minmax(20px, 200px) 1fr;
    }
}

@media (max-width: 576px) {

    .settings-form:has(label[data-i18n^="netTest."]),
    .result-output {
        padding: 0;
        display: block;
        line-height: 3rem;
    }

    .result-output {
        margin-bottom: 40px;
        max-width: 100%;
        word-break: break-word;
    }
}

/* 按钮 */
.btn-save,
.tabWrite .but {
    min-width: 120px !important;
}

.backup-buttons>button.btn.btn-secondary {
    background-color: #26A2E0;
    border: 1px solid #2C7DCF;
}

/* 按钮位置 */
.form-actions-page {
    margin-left: calc(1.25rem + 200px + 1rem);
    margin-top: 0.5rem !important;
    margin-bottom: 1rem !important;
}

@media (max-width: 576px) {
    .form-actions-page {
        margin-left: calc(50vw - 60px);
    }
}

/* 去除网页抖动 - 显示 */
body {
    visibility: visible;
}
