/*!
 * Magic UI for SWAPIDC
 * 现代化客户中心主题 (Bootstrap 5 基础) — 内置资源、离线可用、低资源占用
 * 设计参考：魔方财务默认模板风格
 */

/* ============================================================
   1. 设计令牌 (Design Tokens)
   ============================================================ */
:root,
[data-bs-theme="light"] {
  --mf-primary: #2d8cf0;
  --mf-primary-2: #5a6cf3;
  --mf-primary-soft: rgba(45, 140, 240, 0.12);
  --mf-bg: #f4f6fb;
  --mf-bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(90, 108, 243, 0.10), transparent 60%),
                radial-gradient(1000px 500px at -10% 0%, rgba(45, 140, 240, 0.10), transparent 55%);
  --mf-card: #ffffff;
  --mf-card-2: #f8fafc;
  --mf-border: rgba(15, 23, 42, 0.08);
  --mf-border-strong: rgba(15, 23, 42, 0.14);
  --mf-text: #1f2937;
  --mf-heading: #111827;
  --mf-muted: #6b7280;
  --mf-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --mf-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 30px -14px rgba(15, 23, 42, 0.16);
  --mf-shadow-lg: 0 24px 60px -28px rgba(15, 23, 42, 0.35);
  --mf-radius: 14px;
  --mf-radius-sm: 10px;
  --mf-nav-bg: rgba(255, 255, 255, 0.82);
  --mf-nav-border: rgba(15, 23, 42, 0.08);
  --mf-footer-bg: #0f1a2e;
  --mf-footer-text: #b9c2d6;
  --mf-sortable: #2d8cf0;
}

[data-bs-theme="dark"] {
  --mf-primary: #5a9dff;
  --mf-primary-2: #8b8cff;
  --mf-primary-soft: rgba(90, 157, 255, 0.16);
  --mf-bg: #0b1220;
  --mf-bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(90, 108, 243, 0.14), transparent 60%),
                radial-gradient(1000px 500px at -10% 0%, rgba(45, 140, 240, 0.12), transparent 55%);
  --mf-card: #111a2e;
  --mf-card-2: #0f1729;
  --mf-border: rgba(148, 163, 184, 0.16);
  --mf-border-strong: rgba(148, 163, 184, 0.28);
  --mf-text: #d7deea;
  --mf-heading: #f1f5f9;
  --mf-muted: #94a3b8;
  --mf-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --mf-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 34px -16px rgba(0, 0, 0, 0.6);
  --mf-shadow-lg: 0 26px 60px -28px rgba(0, 0, 0, 0.75);
  --mf-nav-bg: rgba(17, 26, 46, 0.82);
  --mf-nav-border: rgba(148, 163, 184, 0.14);
  --mf-footer-bg: #070d18;
  --mf-footer-text: #8fa0bd;
}

/* ============================================================
   2. 基础
   ============================================================ */
:root {
  --bs-border-radius: 0.6rem;
  --bs-border-radius-sm: 0.5rem;
  --bs-border-radius-lg: 0.9rem;
  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background-color: var(--mf-bg);
  background-image: var(--mf-bg-grad);
  background-attachment: fixed;
  color: var(--mf-text);
  font-size: 0.9375rem;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 { color: var(--mf-heading); font-weight: 600; }

a { color: var(--mf-primary); text-decoration: none; }
a:hover { color: var(--mf-primary-2); }

::selection { background: var(--mf-primary-soft); color: var(--mf-primary); }

/* 滚动条 */
* { scrollbar-width: thin; scrollbar-color: var(--mf-border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--mf-border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--mf-muted); background-clip: content-box; }

.page-wrap { flex: 1 0 auto; padding: 1.75rem 0 3rem; }

.text-brand { color: var(--mf-primary) !important; }
.text-secondary, .text-muted { color: var(--mf-muted) !important; }
.bg-brand-soft { background: var(--mf-primary-soft) !important; }
.divider { border: 0; border-top: 1px solid var(--mf-border); margin: 1rem 0; }

/* ============================================================
   3. 导航栏
   ============================================================ */
.navbar-mf {
  background: var(--mf-nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--mf-nav-border);
  padding-top: .6rem;
  padding-bottom: .6rem;
  transition: box-shadow .25s ease;
  z-index: 1040;
}
.navbar-mf.mf-scrolled { box-shadow: var(--mf-shadow-sm); }

.navbar-mf .navbar-brand { font-weight: 700; color: var(--mf-heading); }
.navbar-mf .nav-link {
  color: var(--mf-text);
  font-weight: 500;
  padding: .45rem .9rem;
  border-radius: 999px;
  transition: background .18s ease, color .18s ease;
}
.navbar-mf .nav-link:hover { background: var(--mf-primary-soft); color: var(--mf-primary); }
.navbar-mf .nav-link.active { background: var(--mf-primary-soft); color: var(--mf-primary); }

.brand-mark {
  width: 34px; height: 34px; flex: 0 0 auto;
  filter: drop-shadow(0 4px 10px rgba(45, 140, 240, .35));
}
.brand-name { font-size: 1.12rem; letter-spacing: .2px; }

.mf-lang-form .form-select { min-width: 92px; border-radius: 999px; padding-left: .8rem; }

.btn-icon {
  width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--mf-border);
  background: var(--mf-card);
  color: var(--mf-text);
}
.btn-icon:hover { border-color: var(--mf-primary); color: var(--mf-primary); }

.btn-user {
  border: 1px solid var(--mf-border);
  background: var(--mf-card);
  color: var(--mf-heading);
  border-radius: 999px;
  padding: .4rem .9rem;
  display: inline-flex; align-items: center; gap: .35rem;
}
.btn-user:hover { border-color: var(--mf-primary); color: var(--mf-primary); }
.dropdown-menu { border: 1px solid var(--mf-border); border-radius: var(--mf-radius-sm); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .7rem; }

/* ============================================================
   4. 按钮
   ============================================================ */
.btn { --bs-btn-padding-y: .5rem; --bs-btn-padding-x: 1rem; font-weight: 500; }
.btn-gradient {
  background: linear-gradient(135deg, var(--mf-primary), var(--mf-primary-2));
  border: 0; color: #fff;
  box-shadow: 0 8px 20px -10px rgba(45, 140, 240, .8);
}
.btn-gradient:hover, .btn-gradient:focus { color: #fff; filter: brightness(1.06); transform: translateY(-1px); }
.btn-soft {
  background: var(--mf-primary-soft); color: var(--mf-primary); border: 1px solid transparent;
}
.btn-soft:hover { background: var(--mf-primary); color: #fff; }
.btn-light { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.5); color: #fff; }
.btn-light:hover { background: #fff; color: var(--mf-primary); }
.btn-inverse { --bs-btn-color:#fff; --bs-btn-bg:#334155; --bs-btn-border-color:#334155; --bs-btn-hover-color:#fff; --bs-btn-hover-bg:#1e293b; --bs-btn-hover-border-color:#1e293b; }

/* ============================================================
   5. 卡片
   ============================================================ */
.mf-card {
  background: var(--mf-card);
  border: 1px solid var(--mf-border);
  border-radius: var(--mf-radius);
  box-shadow: var(--mf-shadow-sm);
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.mf-card.p-3, .mf-card.p-4 { }
.mf-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .95rem 1.15rem; border-bottom: 1px solid var(--mf-border);
  flex-wrap: wrap;
}
.mf-card-title { margin: 0; font-size: 1.02rem; display: flex; align-items: center; gap: .5rem; }
.mf-card-title .bi { color: var(--mf-primary); }
.mf-card-body { padding: 1.15rem; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-title { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: .55rem; }
.page-title .bi { color: var(--mf-primary); }

/* ============================================================
   6. Hero (首页)
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--mf-radius);
  padding: clamp(1.75rem, 4vw, 3rem);
  color: #fff;
  background: linear-gradient(135deg, #2d8cf0 0%, #5a6cf3 55%, #7a5af5 100%);
  box-shadow: var(--mf-shadow-lg);
  border: 0;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.35), transparent 60%);
}
.hero::before { width: 320px; height: 320px; top: -140px; right: -80px; }
.hero::after { width: 240px; height: 240px; bottom: -150px; left: -60px; opacity: .7; }
.hero-body { position: relative; z-index: 1; max-width: 640px; }
.hero-title { color: #fff; font-size: clamp(1.5rem, 3vw, 2.15rem); margin-bottom: .6rem; }
.hero-sub { color: rgba(255,255,255,.9); margin-bottom: 1.4rem; }

/* ============================================================
   7. 功能入口 (Feature Tiles)
   ============================================================ */
.feature-tile {
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--mf-card); border: 1px solid var(--mf-border);
  border-radius: var(--mf-radius); padding: 1.15rem; height: 100%;
  color: var(--mf-text); box-shadow: var(--mf-shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature-tile:hover { transform: translateY(-3px); box-shadow: var(--mf-shadow); border-color: var(--mf-primary); color: var(--mf-text); }
.feature-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: #fff;
}
.feature-ico.t-info { background: linear-gradient(135deg,#2d8cf0,#4aa3ff); }
.feature-ico.t-danger { background: linear-gradient(135deg,#f5576c,#ff7a8a); }
.feature-ico.t-success { background: linear-gradient(135deg,#22c55e,#4ade80); }
.feature-ico.t-warning { background: linear-gradient(135deg,#f59e0b,#fbbf24); }
.feature-ico.t-purple { background: linear-gradient(135deg,#7a5af5,#a78bfa); }
.feature-ico.t-dark { background: linear-gradient(135deg,#334155,#475569); }
.feature-name { font-weight: 600; color: var(--mf-heading); }
.feature-sub { font-size: .82rem; color: var(--mf-muted); line-height: 1.5; }

/* ============================================================
   8. 数据块 (Stat Tiles) + 兼容旧 .stat
   ============================================================ */
.stat-tile {
  border-radius: var(--mf-radius-sm); padding: 1rem 1.1rem; border: 1px solid var(--mf-border);
  background: var(--mf-card-2);
}
.stat-tile .stat-value { font-size: 1.35rem; font-weight: 700; color: var(--mf-heading); line-height: 1.2; }
.stat-tile .stat-label { font-size: .82rem; color: var(--mf-muted); }
.stat-tile.is-brand { background: linear-gradient(135deg, var(--mf-primary), var(--mf-primary-2)); border: 0; }
.stat-tile.is-brand .stat-value, .stat-tile.is-brand .stat-label { color: #fff; }

/* 兼容默认模板插件注入的 .stat / .stat.info 等结构 */
.stat {
  border-radius: var(--mf-radius-sm); padding: .9rem 1rem; margin-bottom: .75rem;
  background: var(--mf-card-2); border: 1px solid var(--mf-border); text-align: center;
  color: var(--mf-text); overflow-wrap: anywhere;
}
.stat h2 { font-size: 1.4rem; margin: 0; }
.stat h4 { font-size: .82rem; margin: .25rem 0 0; color: var(--mf-muted); font-weight: 500; }
.stat h5 { font-size: .78rem; margin: .25rem 0 0; color: var(--mf-muted); }
.stat.info { border-top: 3px solid #2d8cf0; }
.stat.success { border-top: 3px solid #22c55e; }
.stat.warning { border-top: 3px solid #f59e0b; }
.stat.danger { border-top: 3px solid #f5576c; }
.stat.inverse { border-top: 3px solid #334155; }
.stat.active { border-top: 3px solid var(--mf-primary); background: linear-gradient(135deg, var(--mf-primary), var(--mf-primary-2)); border-color: transparent; }
.stat.active h2, .stat.active h4, .stat.active h5 { color: #fff; }

/* ============================================================
   9. 侧栏菜单 / 卡片
   ============================================================ */
.side-card { overflow: hidden; }
.side-user { display: flex; align-items: center; gap: .75rem; padding: 1.1rem; }
.side-avatar {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff;
  background: linear-gradient(135deg, var(--mf-primary), var(--mf-primary-2));
}
.side-balance {
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.1rem; background: var(--mf-card-2); border-top: 1px solid var(--mf-border);
}

.side-menu { list-style: none; margin: 0; padding: .4rem; }
.side-menu li a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .8rem; border-radius: 10px; color: var(--mf-text); font-weight: 500;
  transition: background .16s ease, color .16s ease;
}
.side-menu li a:hover { background: var(--mf-primary-soft); color: var(--mf-primary); }
.side-menu li a .bi { font-size: 1.05rem; color: var(--mf-muted); }
.side-menu li a:hover .bi { color: var(--mf-primary); }

.mf-side-title { display: flex; align-items: center; gap: .4rem; font-size: .82rem; text-transform: none; color: var(--mf-muted); font-weight: 600; letter-spacing: .3px; margin-bottom: .7rem; }
.side-link {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem;
  border-radius: 9px; color: var(--mf-text); font-weight: 500;
}
.side-link:hover { background: var(--mf-primary-soft); color: var(--mf-primary); }
.side-link-ico {
  width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--mf-primary), var(--mf-primary-2));
}
.side-account { display: grid; gap: .45rem; font-size: .86rem; color: var(--mf-text); }
.side-account .bi { color: var(--mf-primary); }

/* 兼容旧 .profile-sidebar */
.profile-sidebar { background: var(--mf-card); border: 1px solid var(--mf-border); border-radius: var(--mf-radius); padding: 1rem; box-shadow: var(--mf-shadow-sm); }
.profile-sidebar h4 { font-size: .95rem; }
.profile-sidebar ul { list-style: none; padding: 0; margin: .6rem 0 0; }
.profile-sidebar ul li a { display: block; padding: .5rem .6rem; border-radius: 9px; color: var(--mf-text); }
.profile-sidebar ul li a:hover { background: var(--mf-primary-soft); color: var(--mf-primary); }
.rating-star, .half-star, .no-star { display: none; }

/* ============================================================
   10. 表格 + 徽章
   ============================================================ */
.mf-table-wrap { border: 1px solid var(--mf-border); border-radius: var(--mf-radius); overflow: hidden; background: var(--mf-card); }
.table-panel { background: var(--mf-card); border: 1px solid var(--mf-border); border-radius: var(--mf-radius); padding: .5rem 1rem 1rem; box-shadow: var(--mf-shadow-sm); }
.table { margin-bottom: 0; --bs-table-border-color: var(--mf-border); color: var(--mf-text); }
.table > :not(caption) > * > * { padding: .8rem .9rem; }
.table thead th {
  background: var(--mf-card-2); color: var(--mf-muted); font-weight: 600;
  font-size: .8rem; text-transform: none; border-bottom: 1px solid var(--mf-border);
  white-space: nowrap;
}
.table tbody tr { transition: background .14s ease; }
.table tbody tr:hover { background: var(--mf-primary-soft); }
.table a { font-weight: 500; }
.table-responsive { border-radius: var(--mf-radius); }

/* 表格排序 */
.table.sortable thead th { cursor: pointer; user-select: none; position: relative; padding-right: 1.6rem; }
.table.sortable thead th::after { content: "\f282"; font-family: "bootstrap-icons"; position: absolute; right: .6rem; opacity: .35; font-size: .8rem; }
.table.sortable thead th[data-sort-dir="asc"]::after { content: "\f57b"; opacity: .9; color: var(--mf-sortable); }
.table.sortable thead th[data-sort-dir="desc"]::after { content: "\f575"; opacity: .9; color: var(--mf-sortable); }

.badge { font-weight: 600; padding: .38em .7em; border-radius: 999px; }
.badge-soft-primary { background: var(--mf-primary-soft); color: var(--mf-primary); }
.badge-soft-info { background: rgba(56,189,248,.14); color: #0ea5e9; }
.badge-soft-success { background: rgba(34,197,94,.15); color: #16a34a; }
.badge-soft-warning { background: rgba(245,158,11,.16); color: #d97706; }
.badge-soft-danger { background: rgba(245,87,108,.15); color: #e11d48; }
.badge-soft-secondary { background: rgba(100,116,139,.15); color: #64748b; }
.badge-soft-dark { background: rgba(15,23,42,.85); color: #fff; }
[data-bs-theme="dark"] .badge-soft-info { color: #7dd3fc; }
[data-bs-theme="dark"] .badge-soft-success { color: #86efac; }
[data-bs-theme="dark"] .badge-soft-warning { color: #fcd34d; }
[data-bs-theme="dark"] .badge-soft-danger { color: #fda4af; }
[data-bs-theme="dark"] .badge-soft-secondary { color: #cbd5e1; }

/* ============================================================
   11. 表单
   ============================================================ */
.form-control, .form-select {
  background-color: var(--mf-card);
  border-color: var(--mf-border-strong);
  color: var(--mf-text);
  padding-top: .5rem; padding-bottom: .5rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--mf-primary);
  box-shadow: 0 0 0 .22rem var(--mf-primary-soft);
  background-color: var(--mf-card);
}
.form-label { font-weight: 500; color: var(--mf-heading); margin-bottom: .3rem; }
.form-text, .help-block { color: var(--mf-muted); font-size: .8rem; }
.form-check-input:checked { background-color: var(--mf-primary); border-color: var(--mf-primary); }
.input-group-text { background: var(--mf-card-2); border-color: var(--mf-border-strong); color: var(--mf-muted); }

/* 兼容旧 .control-group / .form-horizontal */
.control-group { margin-bottom: 1rem; }
.form-horizontal .control-label { font-weight: 500; color: var(--mf-heading); margin-bottom: .3rem; display: block; }
.form-horizontal .controls { }
.form-horizontal .btn { }

.query-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* 认证页 */
.auth-wrap { max-width: 480px; margin: 2rem auto; }
.auth-card { padding: clamp(1.4rem, 4vw, 2.2rem); }
.auth-logo { width: 58px; height: 58px; margin: 0 auto 1rem; display: block; }
.auth-title { text-align: center; margin-bottom: .25rem; }
.auth-sub { text-align: center; color: var(--mf-muted); margin-bottom: 1.5rem; }
.input-icon { position: relative; }
.input-icon .bi { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--mf-muted); }
.input-icon .form-control { padding-left: 2.4rem; }
.input-icon .icon-right { left: auto; right: .6rem; cursor: pointer; }
.input-icon .icon-right:hover { color: var(--mf-primary); }

/* ============================================================
   12. 分页
   ============================================================ */
.mf-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.mf-pager .pager-info { color: var(--mf-muted); font-size: .85rem; }
.mf-pager .btn { border-radius: 999px; }
.mf-pager .btn.disabled { opacity: .45; pointer-events: none; }

/* ============================================================
   13. 提示
   ============================================================ */
.alert { border: 1px solid transparent; border-radius: var(--mf-radius-sm); align-items: flex-start; }
.alert .bi { font-size: 1.05rem; line-height: 1.4; }

/* ============================================================
   14. 工单时间线
   ============================================================ */
.timeline { position: relative; }
.timeline-item { display: flex; gap: .9rem; padding: .9rem 0; }
.timeline-item + .timeline-item { border-top: 1px dashed var(--mf-border); }
.timeline-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
}
.timeline-avatar.user { background: linear-gradient(135deg,#2d8cf0,#4aa3ff); }
.timeline-avatar.staff { background: linear-gradient(135deg,#7a5af5,#a78bfa); }
.timeline-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.timeline-name { font-weight: 600; color: var(--mf-heading); }
.timeline-time { font-size: .78rem; color: var(--mf-muted); }
.timeline-body { background: var(--mf-card-2); border: 1px solid var(--mf-border); border-radius: 10px; padding: .75rem .9rem; margin-top: .35rem; }
.timeline-item.staff .timeline-body { background: rgba(122,90,245,.08); border-color: rgba(122,90,245,.2); }

/* ============================================================
   15. 公告正文
   ============================================================ */
.article-body { line-height: 1.8; overflow-wrap: anywhere; }
.article-body img { max-width: 100%; height: auto; border-radius: 10px; }
.article-body table { width: 100%; border-collapse: collapse; }
.article-body table td, .article-body table th { border: 1px solid var(--mf-border); padding: .5rem .7rem; }
.article-meta { color: var(--mf-muted); font-size: .85rem; }

/* ============================================================
   16. 产品卡 (购买页)
   ============================================================ */
.product-card { display: flex; flex-direction: column; padding: 1.2rem; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--mf-shadow); border-color: var(--mf-primary); }
.product-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.product-name { margin: 0; font-size: 1.08rem; }
.product-desc { color: var(--mf-muted); font-size: .86rem; margin: .6rem 0 .9rem; flex: 1 1 auto; overflow-wrap: anywhere; }
.product-cycles { border-top: 1px dashed var(--mf-border); border-bottom: 1px dashed var(--mf-border); padding: .6rem 0; margin-bottom: .9rem; }
.cycle-line { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .28rem 0; font-size: .88rem; }
.cycle-price { font-weight: 700; color: var(--mf-primary); }
.product-fixed { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .9rem; font-weight: 600; }

/* 周期选择按钮与购买页工具栏样式已内置于 buy.tpl（{$f} 内容依赖运行时变量） */

/* ============================================================
   17. 帮助 / 折叠
   ============================================================ */
.qa { border: 1px solid var(--mf-border); border-radius: var(--mf-radius-sm); margin-bottom: .7rem; background: var(--mf-card); padding: 0 1rem; }
.qa summary { cursor: pointer; list-style: none; padding: .9rem 0; font-weight: 600; color: var(--mf-heading); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "\F282"; font-family: "bootstrap-icons"; color: var(--mf-muted); transition: transform .2s ease; }
.qa[open] summary::after { transform: rotate(180deg); }
.qa p { color: var(--mf-text); padding-bottom: .9rem; margin: 0; }
.qa h4 { font-size: 1rem; margin: 0; }

/* ============================================================
   18. 兼容层 (默认模板旧类名 — 保障插件注入样式)
   ============================================================ */
.label {
  display: inline-block; padding: .32em .62em; font-size: .74em; font-weight: 700;
  line-height: 1; color: #fff; text-align: center; white-space: nowrap;
  border-radius: 999px; background-color: #64748b; vertical-align: baseline;
}
.label-success { background-color: #16a34a; }
.label-info { background-color: #2d8cf0; }
.label-warning { background-color: #d97706; }
.label-important { background-color: #e11d48; }
.label-inverse { background-color: #1e293b; }

.alert-error { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
[data-bs-theme="dark"] .alert-error { color: #f1aeb5; background-color: #2c0b0e; border-color: #58151c; }
.alert-warning, .alert-success, .alert-info { }

.close { float: right; font-size: 1.4rem; font-weight: 700; line-height: 1; color: #000; opacity: .4; background: none; border: 0; }
.close:hover { opacity: .8; }
[data-bs-theme="dark"] .close { color: #fff; }

.widget { background: var(--mf-card); border: 1px solid var(--mf-border); border-radius: var(--mf-radius); padding: 1rem; margin-bottom: 1rem; }
.stats { }
.header { }
h4.header { margin-bottom: 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--mf-border); display: flex; align-items: center; gap: .5rem; }
.small-divide { margin: 1.2rem 0 .8rem; }
.wtzt { font-weight: 700; color: var(--mf-heading); }

/* 旧版 Bootstrap2 栅格 (.row-fluid / .spanN) — 插件注入内容兼容 */
.row-fluid { display: flex; flex-wrap: wrap; margin-left: -.5rem; margin-right: -.5rem; }
.row-fluid > [class*="span"] { padding-left: .5rem; padding-right: .5rem; box-sizing: border-box; min-width: 0; width: 100%; }
@media (min-width: 768px) {
  .row-fluid > .span1 { width: 8.3333%; }
  .row-fluid > .span2 { width: 16.6667%; }
  .row-fluid > .span3 { width: 25%; }
  .row-fluid > .span4 { width: 33.3333%; }
  .row-fluid > .span5 { width: 41.6667%; }
  .row-fluid > .span6 { width: 50%; }
  .row-fluid > .span7 { width: 58.3333%; }
  .row-fluid > .span8 { width: 66.6667%; }
  .row-fluid > .span9 { width: 75%; }
  .row-fluid > .span10 { width: 83.3333%; }
  .row-fluid > .span12 { width: 100%; }
}
.row-fluid::after { content: ""; display: table; clear: both; }

/* 旧 span 栅格出现在新 .row (flex) 内时（插件注入 .span4 数据块等） */
.row > .span2, .row > .span3, .row > .span4, .row > .span6, .row > .span8 {
  position: relative; box-sizing: border-box; padding-left: .5rem; padding-right: .5rem; min-width: 0;
}
.row > .span2 { flex: 0 0 16.6667%; max-width: 16.6667%; }
.row > .span3 { flex: 0 0 25%; max-width: 25%; }
.row > .span4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
.row > .span6 { flex: 0 0 50%; max-width: 50%; }
.row > .span8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
@media (max-width: 767.98px) {
  .row > .span2, .row > .span3, .row > .span4, .row > .span6, .row > .span8 { flex: 0 0 100%; max-width: 100%; }
}

/* ============================================================
   19. 页脚
   ============================================================ */
.footer-mf {
  flex-shrink: 0;
  margin-top: auto;
  background: var(--mf-footer-bg);
  color: var(--mf-footer-text);
  padding: 2.5rem 0 1.25rem;
}
.footer-mf h6 { color: #fff; font-weight: 600; margin-bottom: 1rem; }
.footer-mf a { color: var(--mf-footer-text); }
.footer-mf a:hover { color: #fff; }
.footer-mf .footer-brand { color: #fff; font-weight: 700; font-size: 1.15rem; display: inline-flex; align-items: center; gap: .5rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 1.75rem; padding-top: 1.1rem; font-size: .82rem; color: rgba(255,255,255,.55); }

/* ============================================================
   20. 工具
   ============================================================ */
.overflow-anywhere { overflow-wrap: anywhere; }
.stack-sm { display: grid; gap: .5rem; }
.gap-section { margin-bottom: 1.25rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--mf-muted); }
.empty-state .bi { font-size: 2.2rem; opacity: .4; display: block; margin-bottom: .6rem; }
.kv-list { display: grid; gap: 0; }
.kv-row { display: flex; gap: 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--mf-border); }
.kv-row:last-child { border-bottom: 0; }
.kv-key { flex: 0 0 130px; color: var(--mf-muted); font-size: .86rem; }
.kv-val { flex: 1 1 auto; overflow-wrap: anywhere; font-weight: 500; }

.spinner-inline { display: inline-block; width: 1em; height: 1em; vertical-align: -.125em; border: .15em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: mf-spin .7s linear infinite; }
@keyframes mf-spin { to { transform: rotate(360deg); } }

/* ============================================================
   21. 响应式 / 动画偏好
   ============================================================ */
@media (max-width: 991.98px) {
  .navbar-mf .navbar-collapse { padding-top: .6rem; }
  .navbar-mf .nav-link { border-radius: 10px; }
  .page-wrap { padding-top: 1.25rem; }
  /* 移动端内容优先：侧栏（用户菜单/快速导航）排到正文之后，避免先看到一长串菜单 */
  .page-wrap .container > .row > aside { order: 2; }
  .page-wrap .container > .row > div[class*="col-"]:not(aside) { order: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
