/* ============================================================
   pay.boseway.com 聚合支付网关 - 管理后台原生样式
   FastAdmin 风格黑色主题 (仅原生 CSS，零依赖)
   支持桌面 / 平板 / 手机端自适应
   ============================================================ */

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #eef1f5;
    color: #2c2c2c;
    font-size: 14px;
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
code, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

/* ---------- 布局容器 ---------- */
.admin-wrapper { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 (黑色) ---------- */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, #1f2430 0%, #151820 100%);
    color: #c9ccd4;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: transform .25s ease;
    z-index: 100;
}
.sidebar .brand {
    padding: 20px 18px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid #2a3040;
    letter-spacing: .5px;
}
.sidebar .brand .sub { display: block; font-size: 11px; font-weight: 400; color: #8a8f9a; margin-top: 4px; }
.sidebar .nav-title {
    padding: 14px 18px 6px;
    font-size: 11px;
    text-transform: uppercase;
    color: #6b7080;
    letter-spacing: 1px;
}
.sidebar .nav { flex: 1; overflow-y: auto; }
.sidebar .nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    color: #b6bac4;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.sidebar .nav a:hover { background: #2a3040; color: #fff; }
.sidebar .nav a.active {
    background: #2b6cb0;
    color: #fff;
    border-left: 3px solid #63b3ed;
}
.sidebar .nav a .ico { width: 18px; text-align: center; font-size: 15px; }
.sidebar .foot {
    padding: 12px 18px;
    border-top: 1px solid #2a3040;
    font-size: 12px;
    color: #8a8f9a;
}
.sidebar .foot a { color: #f56565; }
.sidebar .foot a:hover { color: #fc8181; }

/* ---------- 主内容区 ---------- */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.topbar {
    height: 54px;
    background: #1a1d27;
    color: #c9ccd4;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 90;
}
.topbar .menu-toggle {
    background: none;
    border: none;
    color: #c9ccd4;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    display: none;
}
.topbar .page-title { font-weight: 600; color: #fff; font-size: 15px; }
.topbar .spacer { flex: 1; }
.topbar .admin-user { position: relative; }
.topbar .admin-name {
    background: none;
    border: 1px solid #31374a;
    color: #dbe0e8;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1.4;
    transition: border-color .15s, color .15s;
}
.topbar .admin-name:hover { border-color: #2b6cb0; color: #fff; }
.topbar .admin-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 150px;
    background: #1a1d27;
    border: 1px solid #2a3040;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
    padding: 6px 0;
    z-index: 120;
    white-space: nowrap;
}
.topbar .admin-dropdown a {
    display: block;
    padding: 9px 16px;
    color: #c9ccd4;
    font-size: 13px;
    transition: background .15s, color .15s;
}
.topbar .admin-dropdown a:hover { background: #2b6cb0; color: #fff; }
.topbar .admin-user:hover .admin-dropdown,
.topbar .admin-user.open .admin-dropdown { display: block; }
.topbar .logout-btn {
    background: #2b6cb0;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}
.topbar .logout-btn:hover { background: #2c5282; }

.main-content {
    padding: 20px;
    flex: 1;
}
.footer-bar { padding: 14px 20px; text-align: center; color: #9aa0aa; font-size: 12px; border-top: 1px solid #dfe3ea; background: #fff; }

/* ---------- 卡片 ---------- */
.card {
    background: #fff;
    border: 1px solid #e7eaf0;
    border-radius: 6px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card-header {
    padding: 12px 16px;
    background: #f8f9fb;
    border-bottom: 1px solid #eef1f5;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px 6px 0 0;
}
.card-body { padding: 16px; }
.card-title { font-size: 15px; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card {
    background: #fff;
    border: 1px solid #e7eaf0;
    border-radius: 6px;
    padding: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.stat-card .label { font-size: 12px; color: #8a90a0; }
.stat-card .value { font-size: 26px; font-weight: 700; margin: 6px 0 2px; }
.stat-card .value.red { color: #e53e3e; }
.stat-card .value.green { color: #38a169; }
.stat-card .value.blue { color: #3182ce; }
.stat-card .hint { font-size: 12px; color: #a0a6af; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    transition: all .15s;
    background: transparent;
}
.btn-primary { background: #2b6cb0; color: #fff; }
.btn-primary:hover { background: #2c5282; }
.btn-success { background: #38a169; color: #fff; }
.btn-success:hover { background: #2f855a; }
.btn-danger { background: #e53e3e; color: #fff; }
.btn-danger:hover { background: #c53030; }
.btn-outline-success { border-color: #38a169; color: #38a169; }
.btn-outline-success:hover { background: #38a169; color: #fff; }
.btn-outline-danger { border-color: #e53e3e; color: #e53e3e; }
.btn-outline-danger:hover { background: #e53e3e; color: #fff; }
.btn-outline-primary { border-color: #2b6cb0; color: #2b6cb0; }
.btn-outline-primary:hover { background: #2b6cb0; color: #fff; }
.btn-outline-secondary { border-color: #cbd5e0; color: #6b7280; }
.btn-outline-secondary:hover { background: #edf2f7; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---------- 表单 ---------- */
.form-label { display: block; margin-bottom: 6px; font-size: 13px; color: #4a5568; font-weight: 500; }
.form-control, .form-select, textarea.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d4d9e0;
    border-radius: 4px;
    font-size: 14px;
    color: #2c2c2c;
    background: #fff;
    font-family: inherit;
}
.form-control:focus, .form-select:focus {
    border-color: #2b6cb0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(43,108,176,.12);
}
textarea.form-control { resize: vertical; }
.form-text { font-size: 12px; color: #8a90a0; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .col-span-2 { grid-column: 1 / -1; }
.form-row { margin-bottom: 14px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    background: #2b313c;
    color: #dbe0e8;
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    white-space: nowrap;
}
.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef1f5;
    vertical-align: middle;
}
.table tbody tr:hover { background: #f7f9fc; }
.table tbody tr:last-child td { border-bottom: none; }

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.badge-green { background: #38a169; }
.badge-red { background: #e53e3e; }
.badge-gray { background: #718096; }
.badge-blue { background: #3182ce; }
.badge-orange { background: #dd6b20; }
.badge-cyan { background: #00a3c4; }

/* ---------- 提示条 ---------- */
.alert {
    padding: 11px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid;
}
.alert-success { background: #f0fff4; border-color: #9ae6b4; color: #276749; }
.alert-danger { background: #fff5f5; border-color: #feb2b2; color: #9b2c2c; }

/* ---------- 文本工具 ---------- */
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 18px; }
.mt-3 { margin-top: 14px; }
.me-2 { margin-right: 8px; }
.small { font-size: 12px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-red { color: #e53e3e; }
.text-green { color: #38a169; }
.text-muted { color: #8a90a0; }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; align-items: center; gap: 8px; }
.jc-between { justify-content: space-between; }

/* ---------- 纯CSS 模态框 ---------- */
.modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-mask.show { display: flex; }
.modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
    animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header { padding: 14px 18px; border-bottom: 1px solid #eef1f5; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid #eef1f5; text-align: right; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #718096; }

/* ---------- 移动端隐藏切换 (手机) ---------- */
.mobile-only { display: none; }

/* ---------- 移动端适配 (≤900px) ---------- */
@media (max-width: 900px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: 4px 0 20px rgba(0,0,0,.2);
        height: 100vh;
    }
    .sidebar.open { transform: translateX(0); }
    .topbar .menu-toggle { display: block; }
    .main-content { padding: 14px; }
}

/* 手机窄屏 (≤480px) 表格卡片化 */
@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .table-wrap { margin: 0 -14px; padding: 0 14px; }
    .topbar .admin-name { display: none; }
}

/* 侧边栏背景遮罩 (手机) */
.mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 95;
}
.mask.show { display: block; }

/* ---------- Toast 轻提示 ---------- */
#adminToast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}
.admin-toast {
    min-width: 160px;
    max-width: 78vw;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,.28);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .25s, transform .25s;
    text-align: center;
}
.admin-toast.show { opacity: 1; transform: translateY(0); }
.admin-toast.success { background: #38a169; }
.admin-toast.error   { background: #e53e3e; }
.admin-toast.info    { background: #2b6cb0; }

/* 敏感操作复核弹层 */
.reauth-modal { max-width: 440px; }
