/* ==================== 管理后台公共样式 ==================== */

/* ---------- 侧边栏布局 ---------- */
body {
    margin: 0;
    min-height: 100vh;
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 230px;
    background: #1f2937;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 18px 16px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    gap: 2px;
}

.sidebar-nav .nav-link {
    color: #d1d5db;
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 0.95rem;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: #2563eb;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- 内容区 ---------- */
.content {
    margin-left: 230px;
    padding: 24px 28px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header h4 {
    margin: 0;
    font-weight: 600;
}

/* ---------- 登录页 ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 8px;
}

.login-card .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-card .card-body {
    padding: 32px;
}

/* ---------- 提示浮层 ---------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-item {
    min-width: 220px;
    max-width: 420px;
    padding: 10px 16px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-success {
    background: #16a34a;
}

.toast-danger {
    background: #dc2626;
}

.toast-warning {
    background: #d97706;
}

.toast-info {
    background: #2563eb;
}

.toast-hide {
    opacity: 0;
    transform: translateY(-8px);
}

/* ---------- 通用 ---------- */
.table td, .table th {
    vertical-align: middle;
}

.money {
    font-variant-numeric: tabular-nums;
}

.balance-pos {
    color: #16a34a;
}

.balance-neg {
    color: #dc2626;
    font-weight: 600;
}

/* 明文 key 展示框 */
.key-plain {
    background: #fef9c3;
    border: 1px dashed #eab308;
    border-radius: 8px;
    padding: 10px 12px;
    font-family: monospace;
    word-break: break-all;
    margin-bottom: 6px;
}

/* 详情页分区卡片 */
.section-card {
    margin-bottom: 20px;
}

.section-card .card-header {
    font-weight: 600;
    background: #f9fafb;
}

/* 模型分配勾选网格 */
.model-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
}

/* 单价表格行内输入框 */
.price-input {
    width: 120px;
    text-align: right;
}
