/*!
 * Magic UI · 插件兼容层 (plugin-ui.css)
 * 目标：让所有插件的用户端页面与 magicui 保持同一套设计语言，
 *       同时兼容插件里遗留的 Bootstrap 2/3 标记（panel / form-group / btn-default …）。
 * 作用域：仅在 .mf-plugin 容器内生效，不影响主题自身页面。
 */

/* ============================================================
   0. 容器与排版
   ============================================================ */
.mf-plugin { color: var(--mf-text); font-size: .9375rem; line-height: 1.65; }
.mf-plugin > :first-child { margin-top: 0; }
.mf-plugin h1, .mf-plugin h2, .mf-plugin h3, .mf-plugin h4, .mf-plugin h5, .mf-plugin h6 {
  color: var(--mf-heading); font-weight: 600; line-height: 1.35;
}
.mf-plugin h1 { font-size: 1.5rem; }
.mf-plugin h2 { font-size: 1.3rem; }
.mf-plugin h3 { font-size: 1.12rem; }
.mf-plugin h4 { font-size: 1rem; }
.mf-plugin h5 { font-size: .94rem; }
.mf-plugin h6 { font-size: .86rem; }
.mf-plugin p { margin-bottom: .85rem; }
.mf-plugin hr { border: 0; border-top: 1px solid var(--mf-border); opacity: 1; margin: 1rem 0; }
.mf-plugin .muted, .mf-plugin .text-muted { color: var(--mf-muted) !important; }
.mf-plugin .gray { color: var(--mf-muted); }
.mf-plugin .text-danger { color: #e11d48 !important; }
.mf-plugin .text-success { color: #16a34a !important; }
.mf-plugin .text-warning { color: #d97706 !important; }

/* ============================================================
   1. 卡片 / 面板（Bootstrap 2/3 兼容）
   ============================================================ */
.mf-plugin .panel,
.mf-plugin .well,
.mf-plugin .card {
  background: var(--mf-card);
  border: 1px solid var(--mf-border);
  border-radius: var(--mf-radius);
  box-shadow: var(--mf-shadow-sm);
  margin-bottom: 1rem;
}
.mf-plugin .panel-heading {
  padding: .9rem 1.15rem;
  border-bottom: 1px solid var(--mf-border);
  background: transparent;
  border-radius: var(--mf-radius) var(--mf-radius) 0 0;
  font-weight: 600;
  color: var(--mf-heading);
}
.mf-plugin .panel-title { margin: 0; font-size: 1rem; font-weight: 600; }
.mf-plugin .panel-body { padding: 1.15rem; }
.mf-plugin .panel-footer {
  padding: .8rem 1.15rem; background: var(--mf-card-2);
  border-top: 1px solid var(--mf-border);
  border-radius: 0 0 var(--mf-radius) var(--mf-radius);
}
.mf-plugin .panel-default { border-color: var(--mf-border); }
.mf-plugin .panel-white { background: var(--mf-card); }
.mf-plugin .card-body { padding: 1.15rem; }
.mf-plugin .card-header {
  padding: .9rem 1.15rem; background: transparent;
  border-bottom: 1px solid var(--mf-border); font-weight: 600;
}

/* ============================================================
   2. 按钮（补齐 BS3 的 btn-default / btn-xs 等）
   ============================================================ */
.mf-plugin .btn { font-weight: 500; border-radius: var(--bs-border-radius); }
.mf-plugin .btn-default,
.mf-plugin .btn-light {
  background: var(--mf-card);
  border: 1px solid var(--mf-border-strong);
  color: var(--mf-text);
}
.mf-plugin .btn-default:hover,
.mf-plugin .btn-light:hover {
  background: var(--mf-primary-soft);
  border-color: var(--mf-primary);
  color: var(--mf-primary);
}
.mf-plugin .btn-info { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
.mf-plugin .btn-info:hover { background: #0284c7; border-color: #0284c7; color: #fff; }
.mf-plugin .btn-primary { background: var(--mf-primary); border-color: var(--mf-primary); }
.mf-plugin .btn-primary:hover { background: var(--mf-primary-2); border-color: var(--mf-primary-2); }
.mf-plugin .btn-xs { padding: .22rem .55rem; font-size: .75rem; border-radius: .45rem; }
.mf-plugin .btn-sm { padding: .35rem .75rem; font-size: .82rem; }
.mf-plugin .btn-block { display: block; width: 100%; }
.mf-plugin .btn-group > .btn { border-radius: 0; }
.mf-plugin .btn-group > .btn:first-child { border-radius: var(--bs-border-radius) 0 0 var(--bs-border-radius); }
.mf-plugin .btn-group > .btn:last-child { border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0; }

/* ============================================================
   3. 表单（BS2 form-horizontal / control-group）
   ============================================================ */
.mf-plugin .form-group { margin-bottom: 1rem; }
.mf-plugin .form-horizontal .control-label,
.mf-plugin .control-label { font-weight: 500; color: var(--mf-heading); }
.mf-plugin .help-block { color: var(--mf-muted); font-size: .8rem; margin: .3rem 0 0; }
.mf-plugin .form-control,
.mf-plugin .control-group .controls > input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not(.btn),
.mf-plugin .control-group .controls > select,
.mf-plugin .control-group .controls > textarea {
  display: block; width: 100%;
  padding: .5rem .75rem; font-size: .9rem; line-height: 1.5;
  color: var(--mf-text); background: var(--mf-card);
  border: 1px solid var(--mf-border-strong); border-radius: var(--bs-border-radius);
  outline: 0; transition: border-color .15s ease, box-shadow .15s ease;
}
.mf-plugin .form-control:focus,
.mf-plugin .control-group .controls > input:focus,
.mf-plugin .control-group .controls > select:focus,
.mf-plugin .control-group .controls > textarea:focus {
  border-color: var(--mf-primary); box-shadow: 0 0 0 .22rem var(--mf-primary-soft);
}
.mf-plugin .control-group { margin-bottom: 1rem; }
.mf-plugin .control-group .controls { position: relative; }
.mf-plugin .form-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.mf-plugin .form-inline .form-group { margin-bottom: 0; }
.mf-plugin .checkbox, .mf-plugin .radio { padding-left: 1.25rem; }
.mf-plugin .input-group { display: flex; width: 100%; }
.mf-plugin .input-group .form-control { flex: 1 1 auto; }
.mf-plugin .input-group-addon {
  display: inline-flex; align-items: center; padding: .5rem .75rem;
  background: var(--mf-card-2); border: 1px solid var(--mf-border-strong);
  border-radius: var(--bs-border-radius);
}

/* ============================================================
   4. 表格
   ============================================================ */
.mf-plugin .table { width: 100%; margin-bottom: 0; color: var(--mf-text); border-color: var(--mf-border); }
.mf-plugin .table > :not(caption) > * > * { padding: .7rem .85rem; border-bottom-color: var(--mf-border); }
.mf-plugin .table thead th {
  background: var(--mf-card-2); color: var(--mf-muted);
  font-weight: 600; font-size: .8rem; white-space: nowrap;
}
.mf-plugin .table-bordered { border: 1px solid var(--mf-border); }
.mf-plugin .table-bordered > :not(caption) > * > * { border-width: 1px; border-color: var(--mf-border); }
.mf-plugin .table-striped > tbody > tr:nth-of-type(odd) > * { background: var(--mf-card-2); }
.mf-plugin .table-hover > tbody > tr:hover > * { background: var(--mf-primary-soft); }
.mf-plugin .table-condensed > :not(caption) > * > * { padding: .45rem .55rem; }
.mf-plugin .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 移动端表格转卡片：<table class="mf-table-stack"> 且每个 td 带 data-label */
@media (max-width: 767.98px) {
  .mf-plugin .mf-table-stack,
  .mf-table-stack { width: 100%; border: 0; }
  .mf-table-stack thead { display: none; }
  .mf-table-stack tbody,
  .mf-table-stack tr,
  .mf-table-stack td { display: block; width: 100%; }
  .mf-table-stack tr {
    margin-bottom: .75rem; padding: .25rem .9rem;
    background: var(--mf-card); border: 1px solid var(--mf-border);
    border-radius: var(--mf-radius-sm); box-shadow: var(--mf-shadow-sm);
  }
  .mf-table-stack tr:last-child { margin-bottom: 0; }
  .mf-table-stack td {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
    padding: .55rem 0; border: 0; border-bottom: 1px dashed var(--mf-border);
    text-align: right; white-space: normal !important; overflow-wrap: anywhere;
  }
  .mf-table-stack td:last-child { border-bottom: 0; }
  .mf-table-stack td::before {
    content: attr(data-label);
    flex: 0 0 auto; color: var(--mf-muted); font-size: .8rem; text-align: left;
  }
  .mf-table-stack td[data-label=""]::before { display: none; }
}

/* ============================================================
   5. 标签 / 徽章 / 提示
   ============================================================ */
.mf-plugin .label { display: inline-block; padding: .3em .65em; font-size: .74em; font-weight: 600; line-height: 1; color: #fff; border-radius: 999px; }
.mf-plugin .label-default { background: #64748b; }
.mf-plugin .label-info { background: var(--mf-primary); }
.mf-plugin .label-success { background: #16a34a; }
.mf-plugin .label-warning { background: #d97706; }
.mf-plugin .label-danger, .mf-plugin .label-important { background: #e11d48; }
.mf-plugin .badge { font-weight: 600; }
.mf-plugin .alert { border-radius: var(--mf-radius-sm); }
.mf-plugin .alert-block { padding: 1rem 1.15rem; }

/* ============================================================
   6. 分页（旧插件 r-tabs / pagination）
   ============================================================ */
.mf-plugin .pagination { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.mf-plugin .pagination > li > a,
.mf-plugin .pagination > li > span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 .6rem;
  color: var(--mf-text); background: var(--mf-card);
  border: 1px solid var(--mf-border-strong); border-radius: .55rem; font-size: .85rem;
}
.mf-plugin .pagination > .active > a,
.mf-plugin .pagination > .active > span { background: var(--mf-primary); border-color: var(--mf-primary); color: #fff; }
.mf-plugin .r-tabs-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  list-style: none; padding: 0; margin: 1rem 0 0;
}
.mf-plugin .r-tabs-tab { list-style: none; }
.mf-plugin .r-tabs-anchor {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 .8rem;
  color: var(--mf-text); background: var(--mf-card);
  border: 1px solid var(--mf-border-strong); border-radius: 999px; font-size: .85rem;
}
.mf-plugin .r-tabs-state-active .r-tabs-anchor { background: var(--mf-primary); border-color: var(--mf-primary); color: #fff; }

/* ============================================================
   7. 描述列表 / 空状态
   ============================================================ */
.mf-plugin .dl-horizontal { display: grid; grid-template-columns: 120px 1fr; gap: .5rem 1rem; }
.mf-plugin .dl-horizontal dt { color: var(--mf-muted); font-weight: 500; }
.mf-plugin .dl-horizontal dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 575.98px) {
  .mf-plugin .dl-horizontal { grid-template-columns: 1fr; gap: .15rem; }
  .mf-plugin .dl-horizontal dd { margin-bottom: .6rem; }
}

/* ============================================================
   8. 深色模式细节修正
   ============================================================ */[data-bs-theme="dark"] .mf-plugin .panel,
[data-bs-theme="dark"] .mf-plugin .well,
[data-bs-theme="dark"] .mf-plugin .card { background: var(--mf-card); }
[data-bs-theme="dark"] .mf-plugin .table-striped > tbody > tr:nth-of-type(odd) > * { background: rgba(148, 163, 184, .06); }
[data-bs-theme="dark"] .mf-plugin .btn-default,
[data-bs-theme="dark"] .mf-plugin .btn-light { background: var(--mf-card-2); color: var(--mf-text); }
[data-bs-theme="dark"] .mf-plugin .close { color: #fff; }

/* ============================================================
   9. 实名认证弹窗 / 二维码
   ============================================================ */
.mf-plugin .rn-modal {
  position: fixed; inset: 0; z-index: 1080;
  background: rgba(15, 23, 42, .55);
  padding: 1rem;
  overflow-y: auto;
}
.mf-plugin .rn-modal-box {
  max-width: 440px; margin: 12vh auto 0;
  background: var(--mf-card); color: var(--mf-text);
  border: 1px solid var(--mf-border); border-radius: var(--mf-radius);
  box-shadow: var(--mf-shadow-lg); padding: 1.25rem;
}
.mf-plugin .rn-modal-head { display: flex; align-items: center; gap: .65rem; margin-bottom: .75rem; }
.mf-plugin .rn-modal-head h5 { margin: 0; font-size: 1.05rem; }
.mf-plugin .rn-modal-ico {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(245, 158, 11, .15); color: #d97706; font-size: 1.1rem;
}
.mf-plugin .rn-qr {
  margin-top: .9rem; padding: .9rem; text-align: center;
  background: var(--mf-card-2); border: 1px dashed var(--mf-border-strong);
  border-radius: var(--mf-radius-sm);
}
.mf-plugin .rn-qr-box { display: inline-block; background: #fff; padding: .5rem; border-radius: 8px; }
.mf-plugin .rn-qr-box img, .mf-plugin .rn-qr-box canvas { max-width: 100%; height: auto; }
@media (max-width: 575.98px) {
  .mf-plugin .rn-modal-box { margin-top: 8vh; }
}

/* ============================================================
   Font Awesome → Bootstrap Icons 兼容层
   部分插件模板沿用 FA4 图标类名（<i class="fa fa-xxx"></i>），
   而魔方模板只内置 bootstrap-icons。这里把插件用到的图标映射到
   bootstrap-icons 字形，插件模板无需改动即可正常显示图标。
   ============================================================ */
.fa, .fas, .far, .fal, .fab, .fad,
[class^="fa-"], [class*=" fa-"] {
  font-family: "bootstrap-icons" !important;
  font-style: normal;
  font-weight: 400 !important;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  display: inline-block;
  speak: never;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.fa-spin { animation: mf-fa-spin 1.2s linear infinite; }
@keyframes mf-fa-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.fa-angle-down::before{content:"\f282"}
.fa-angle-left::before{content:"\f284"}
.fa-angle-right::before{content:"\f285"}
.fa-angle-up::before{content:"\f286"}
.fa-bolt::before{content:"\f46d"}
.fa-bullhorn::before{content:"\f484"}
.fa-calendar::before{content:"\f1f6"}
.fa-check-circle::before{content:"\f26b"}
.fa-circle::before{content:"\f28a"}
.fa-clock-o::before{content:"\f293"}
.fa-code::before{content:"\f2c6"}
.fa-compress::before{content:"\f14b"}
.fa-database::before{content:"\f8c4"}
.fa-flag::before{content:"\f3cc"}
.fa-headphones::before{content:"\f413"}
.fa-heartbeat::before{content:"\f66b"}
.fa-inbox::before{content:"\f42d"}
.fa-life-ring::before{content:"\f467"}
.fa-question-circle::before{content:"\f505"}
.fa-refresh::before{content:"\f116"}
.fa-search::before{content:"\f52a"}
.fa-server::before{content:"\f52c"}
.fa-spinner::before{content:"\f130"}
.fa-tachometer::before{content:"\f580"}
.fa-th-large::before{content:"\f3f8"}
.fa-user-o::before{content:"\f4e1"}