/* ==========================================================================
   bootstrap-compat.css
   --------------------------------------------------------------------------
   项目只在自己 CSS 中手写了 Bootstrap 的一个子集（btn / form-control / modal /
   table / d-none …），但模板里还用了约 30 个「没写」的 Bootstrap 类，
   导致这些类静默失效（该加粗的不加粗、移动端表格不横滚、开关控件变形…）。

   本文件只做「补缺」：仅定义 app.css 中缺失的选择器，不覆盖任何已有规则。
   加载顺序必须位于 app.css 之后：
       app.css  →  bootstrap-compat.css  →  各页面 CSS(index.css / so.css …)

   同时补齐两个被引用但从未定义、导致阴影静默丢失的 CSS 变量：
       --shadow-soft（index.css .login-panel）
       --shadow-float（index.css .view-result-modal）
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量（与 app.css / index.css 的暖金色主题保持一致）
   -------------------------------------------------------------------------- */
:root {
    --bc-accent: #eeaf46;
    --bc-accent-light: #f8ca72;
    --bc-accent-soft: rgba(245, 191, 96, 0.12);
    --bc-accent-border: rgba(245, 191, 96, 0.28);

    --bc-slate-100: #f1f5f9;
    --bc-slate-200: #e2e8f0;
    --bc-slate-400: #94a3b8;
    --bc-slate-500: #64748b;
    --bc-slate-600: #475569;
    --bc-slate-700: #334155;
    --bc-slate-900: #0f172a;

    --bc-border: rgba(148, 163, 184, 0.2);
    --bc-border-soft: rgba(148, 163, 184, 0.16);

    /* 补齐：原项目引用了但没有定义这两个变量 */
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-float: 0 24px 60px rgba(15, 23, 42, 0.16);

    /* 常见的 Bootstrap 变量别名，避免手写 CSS 引用时落空 */
    --bs-primary: #eeaf46;
    --bs-body-color: #0f172a;
    --bs-border-color: rgba(148, 163, 184, 0.2);
}

/* --------------------------------------------------------------------------
   2. 栅格：container / col-12 / col-lg-12 / col-lg-8 / col-md-8
   （app.css 已有 .row 与 .row>*{width:100%}，此处只补缺失的列）
   -------------------------------------------------------------------------- */
.container,
.container-fluid {
    width: 100%;
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}
@media (min-width: 768px) {
    .container { max-width: 720px; }
}
@media (min-width: 992px) {
    .container { max-width: 960px; }
}
@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

/* 用 .row > .col-* 提高一级特异性，稳定压过 app.css 的 .row>*{width:100%} */
.col-12,
.row > .col-12 {
    flex: 0 0 auto;
    width: 100%;
}

.col-lg-12,
.row > .col-lg-12 {
    flex: 0 0 auto;
    width: 100%;
}

@media (min-width: 768px) {
    .col-md-8,
    .row > .col-md-8 {
        flex: 0 0 auto;
        width: 66.666667%;
    }
}

@media (min-width: 992px) {
    .col-lg-8,
    .row > .col-lg-8 {
        flex: 0 0 auto;
        width: 66.666667%;
    }
}

/* --------------------------------------------------------------------------
   3. 文本 / 排版工具类
   -------------------------------------------------------------------------- */
.small {
    font-size: 0.875em;
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-normal {
    font-weight: 400 !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   4. display / 间距 工具类
   -------------------------------------------------------------------------- */
.d-block {
    display: block !important;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

/* --------------------------------------------------------------------------
   5. 表格
   -------------------------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.align-middle {
    vertical-align: middle !important;
}

/* --------------------------------------------------------------------------
   6. 按钮：outline 变体 / btn-group-sm / btn-check
   -------------------------------------------------------------------------- */
.btn-outline-info {
    border-color: rgba(56, 189, 248, 0.32);
    background: rgba(56, 189, 248, 0.1);
    color: #0369a1;
}

.btn-outline-info:hover:not(:disabled) {
    background: rgba(56, 189, 248, 0.18);
}

.btn-outline-success {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.btn-outline-success:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.18);
}

.btn-outline-danger {
    border-color: rgba(239, 68, 68, 0.32);
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.btn-outline-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.18);
}

.btn-group-sm > .btn {
    min-height: 32px;
    padding: 0.35rem 0.7rem;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* .btn-check：视觉隐藏的单选/复选，配合后面的 <label class="btn …"> 使用 */
.btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.btn-check[disabled] + .btn,
.btn-check:disabled + .btn {
    pointer-events: none;
    opacity: 0.65;
}

.btn-check:checked + .btn,
.btn-check:checked + label.btn {
    border-color: rgba(245, 191, 96, 0.72);
    background: linear-gradient(135deg, #f8ca72, #eeaf46);
    color: #1f2937;
    box-shadow: 0 10px 22px rgba(245, 191, 96, 0.28);
}

/* --------------------------------------------------------------------------
   7. 表单开关（.form-check.form-switch > .form-check-input[type=checkbox]）
   -------------------------------------------------------------------------- */
.form-switch .form-check-input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    width: 44px;
    height: 24px;
    min-width: 44px;
    margin: 0;
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 999px;
    background: #e2e8f0;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.form-switch .form-check-input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
    transition: transform 0.18s ease;
}

.form-switch .form-check-input[type="checkbox"]:checked {
    border-color: rgba(245, 191, 96, 0.72);
    background: linear-gradient(135deg, #f8ca72, #eeaf46);
}

.form-switch .form-check-input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

.form-switch .form-check-input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(245, 191, 96, 0.2);
}

.form-switch .form-check-input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

/* --------------------------------------------------------------------------
   8. 提示条 alert（模板里用于「查看链接」弹窗的失效提示）
   -------------------------------------------------------------------------- */
.alert {
    position: relative;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 16px;
    line-height: 1.6;
}

.alert-warning {
    border-color: rgba(245, 191, 96, 0.36);
    background: rgba(245, 191, 96, 0.16);
    color: #8a5a12;
}

.alert-info {
    border-color: rgba(56, 189, 248, 0.32);
    background: rgba(56, 189, 248, 0.12);
    color: #075985;
}

.alert-success {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.alert-danger {
    border-color: rgba(239, 68, 68, 0.32);
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

/* --------------------------------------------------------------------------
   9. 弹窗尺寸 + 淡入
   -------------------------------------------------------------------------- */
.modal-xl {
    width: min(100%, 1140px);
}

.fade {
    transition: opacity 0.15s linear;
}

.fade:not(.show) {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .fade {
        transition: none;
    }
}

/* --------------------------------------------------------------------------
   10. 项目自定义工具类（模板在用，但项目 CSS 未定义）
   -------------------------------------------------------------------------- */
.shadow-soft {
    box-shadow: var(--shadow-soft) !important;
}

.shadow-float {
    box-shadow: var(--shadow-float) !important;
}

.rounded-4 {
    border-radius: 24px !important;
}
