/* ============= 后台管理样式 ============= */
:root {
    --admin-primary: #1e3a5f;
    --admin-sidebar: #0f1923;
    --admin-sidebar-active: #1e3a5f;
    --admin-accent: #c8963e;
    --admin-bg: #f0f2f4;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: var(--admin-bg);
    color: #333;
    line-height: 1.6;
}

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

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}
.login-header h3 { font-size: 20px; margin-top: 10px; color: #333; font-weight: 700; }
.login-header p { color: #999; font-size: 14px; }

.btn-login {
    background: var(--admin-accent);
    color: #fff;
    padding: 10px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    transition: all 0.3s;
}
.btn-login:hover { background: #a67a2e; color: #fff; }

/* ============= 后台布局 ============= */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.admin-sidebar {
    width: 240px;
    background: var(--admin-sidebar);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 18px;
    font-weight: 700;
}
.sidebar-header i { color: var(--admin-accent); margin-right: 8px; font-size: 24px; }

.sidebar-nav {
    padding: 10px 0;
}
.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 12px 20px;
    font-size: 14px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}
.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}
.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--admin-sidebar-active);
    border-left-color: var(--admin-accent);
}
.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}
.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 0;
}

/* 主内容区 */
.admin-main {
    flex: 1;
    margin-left: 240px;
    min-height: 100vh;
}

.admin-header {
    background: #fff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}
.admin-header h5 { font-size: 16px; font-weight: 600; color: #333; }
.header-right { display: flex; align-items: center; font-size: 14px; color: #666; }

.admin-content { padding: 24px; }

/* ============= 统计卡片 ============= */
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}
.stat-info h3 { font-size: 24px; font-weight: 700; margin: 0; }
.stat-info p { font-size: 13px; color: #999; margin: 0; }

/* ============= 管理卡片 ============= */
.admin-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    overflow: hidden;
}
.admin-card .card-header {
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}
.admin-card .card-header h6 { font-size: 15px; font-weight: 600; margin: 0; }
.admin-card .card-body { padding: 20px; }

/* 表格 */
.table { margin-bottom: 0; }
.table th { font-size: 13px; font-weight: 600; color: #666; background: #fafafa; white-space: nowrap; }
.table td { font-size: 14px; vertical-align: middle; }

/* ============= 批量操作栏（固定底部） ============= */
.batch-bar {
    position: fixed;
    bottom: -80px;
    left: 240px;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #0f1923 0%, #1e3a5f 100%);
    color: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.batch-bar.show {
    bottom: 0;
}

.batch-bar .batch-count {
    font-weight: 600;
    white-space: nowrap;
    font-size: 14px;
    background: rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 20px;
}

.batch-bar .batch-count strong {
    color: var(--admin-accent);
    font-size: 16px;
    margin: 0 3px;
}

.batch-bar .btn {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.batch-bar .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ============= 分页样式 ============= */
.admin-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    padding: 16px 0;
}

.admin-pager .page-link {
    padding: 8px 14px;
    font-size: 14px;
    color: #555;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
}

.admin-pager .page-link:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.admin-pager .page-item.active .page-link {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    color: #fff;
}

.admin-pager .page-item.disabled .page-link {
    color: #ccc;
    cursor: not-allowed;
    background: #fafafa;
}

.admin-pager .page-info {
    font-size: 13px;
    color: #999;
    margin-left: 16px;
}

/* ============= 产品缩略图 ============= */
.admin-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    background: #f5f5f5;
}

.admin-thumb-placeholder {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    color: #ccc;
    font-size: 20px;
}

/* ============= 全选复选框 ============= */
.table th input[type="checkbox"],
.table td input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--admin-accent);
}

/* ============= 自定义 Promise 确认弹窗 ============= */
.custom-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.custom-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-confirm-box {
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px 24px;
    width: 380px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.85) translateY(20px);
    transition: all 0.25s ease;
}

.custom-confirm-box.show {
    transform: scale(1) translateY(0);
}

.custom-confirm-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.custom-confirm-icon-danger {
    background: #fdecea;
    color: #c62828;
}

.custom-confirm-icon-warning {
    background: #fff3e0;
    color: #e65100;
}

.custom-confirm-icon-info {
    background: #e3f2fd;
    color: #1565c0;
}

.custom-confirm-icon-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.custom-confirm-title {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    margin: 0 0 8px;
}

.custom-confirm-msg {
    font-size: 14px;
    color: #777;
    margin: 0 0 24px;
    line-height: 1.6;
}

.custom-confirm-btns {
    display: flex;
    gap: 12px;
}

.custom-confirm-btn {
    flex: 1;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-confirm-cancel {
    background: #f0f0f0;
    color: #555;
}

.custom-confirm-cancel:hover {
    background: #e0e0e0;
}

.custom-confirm-ok {
    color: #fff;
}

.custom-confirm-ok-danger {
    background: #c62828;
}

.custom-confirm-ok-danger:hover {
    background: #a52020;
}

.custom-confirm-ok-warning {
    background: #e65100;
}

.custom-confirm-ok-warning:hover {
    background: #bf4200;
}

.custom-confirm-ok-info {
    background: #1565c0;
}

.custom-confirm-ok-info:hover {
    background: #0d47a1;
}

.custom-confirm-ok-success {
    background: #2e7d32;
}

.custom-confirm-ok-success:hover {
    background: #1b5e20;
}

/* ============= 响应式 ============= */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-content { padding: 16px; }

    .batch-bar {
        left: 0;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 16px;
    }
    .batch-bar .btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .admin-pager {
        flex-wrap: wrap;
    }
    .admin-pager .page-link {
        padding: 6px 10px;
        font-size: 13px;
    }
    .admin-pager .page-info {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 8px;
    }
}
