/* ============================================
   鑫小猫管理后台 - 自定义样式
   基于 Bootstrap 5 二次定制
   ============================================ */

:root {
    --sidebar-width: 220px;
    --topbar-height: 56px;
    --primary-color: #4f46e5;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #4f46e5;
}

* { box-sizing: border-box; }

body {
    background-color: #f5f7fa;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    font-size: 14px;
    margin: 0;
}

/* ============= 登录页 ============= */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 40px 32px;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 13px;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 28px;
}

.login-card .form-control {
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
}

.login-card .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.login-card .btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 11px;
    font-weight: 600;
    width: 100%;
}

/* ============= 主框架布局 ============= */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #cbd5e1;
    z-index: 1030;
    overflow-y: auto;
    transition: transform 0.25s ease;
    transform: translateX(-100%);
}

.app-sidebar.show {
    transform: translateX(0);
}

.app-sidebar .brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.2);
}

.app-sidebar .nav-link {
    color: #cbd5e1 !important;
    padding: 12px 22px;
    font-size: 14px;
    border-radius: 0;
    display: flex;
    align-items: center;
    transition: all 0.15s;
}

.app-sidebar .nav-link i {
    font-size: 18px;
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.app-sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff !important;
}

.app-sidebar .nav-link.active {
    background: var(--sidebar-active);
    color: #fff !important;
    border-left: 3px solid #fff;
}

.app-sidebar .nav-section {
    padding: 14px 22px 6px;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.app-main {
    margin-left: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

.app-main.sidebar-open {
    margin-left: var(--sidebar-width);
}

.app-topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-topbar .toggle-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #64748b;
    cursor: pointer;
    margin-right: 16px;
    padding: 4px;
}

.app-topbar .page-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.app-content {
    flex: 1;
    padding: 20px;
}

.app-footer {
    text-align: center;
    padding: 14px;
    color: #94a3b8;
    font-size: 12px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

/* 移动端额外样式 */
@media (max-width: 768px) {
    .app-sidebar .nav-link.active { border-left: none; }
}

/* ============= 卡片 / 表格 通用 ============= */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 20px;
    font-weight: 600;
    color: #1e293b;
    border-radius: 12px 12px 0 0 !important;
}

.card-body { padding: 20px; }

.table {
    margin-bottom: 0;
    color: #333;
}

.table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tbody tr:hover { background: #f8fafc; }

.table tbody tr:last-child td { border-bottom: none; }

/* ============= 工具样式 ============= */
.badge-soft-primary { background: rgba(79, 70, 229, 0.12); color: var(--primary-color); }
.badge-soft-success { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.badge-soft-warning { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.badge-soft-danger  { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.badge-soft-secondary { background: rgba(100, 116, 139, 0.14); color: #475569; }
.badge-soft-info     { background: rgba(8,145,178,.12);    color: #0891b2; }

.btn-soft {
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    color: #cbd5e1;
}

.empty-state p { margin-bottom: 16px; font-size: 14px; }

/* 加载态 */
.loading-mask {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ============================================
   上传区组件
   ============================================ */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: #f8fafc;
    color: #94a3b8;
}
.upload-area:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}
.upload-area.dragover {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #22c55e;
}
.upload-area.uploading {
    border-style: solid;
    border-color: #3b82f6;
    background: #eff6ff;
    cursor: default;
}
.cover-preview img {
    object-fit: cover;
}

