:root {
    --brand: #409eff;
    --brand-light: #66b1ff;
    --brand-yellow: #ffba00;
    --brand-grad: linear-gradient(135deg, #409eff, #337ecc);
    --sidebar-w: 220px;
    --topbar-h: 56px;
    --bg: #f0f2f5;
    --card-shadow: 0 1px 4px rgba(0, 21, 41, .08);
}

* { box-sizing: border-box; }

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

/* ---------- 侧边栏 ---------- */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: #304156;
    color: #bfcbd9;
    display: flex;
    flex-direction: column;
    z-index: 1030;
    transition: transform .25s ease;
}
.admin-sidebar .brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: #263445;
}
.admin-sidebar .brand .logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--brand-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.admin-nav {
    list-style: none;
    margin: 0;
    padding: 12px 10px;
    overflow-y: auto;
    flex: 1;
}
.admin-nav .nav-group {
    font-size: 12px;
    color: #8b95aa;
    padding: 16px 14px 8px;
    letter-spacing: 1px;
}
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 4px;
    border-radius: 4px;
    color: #cfd2e0;
    text-decoration: none;
    font-size: 14.5px;
    transition: all .18s;
}
.admin-nav a .ico { width: 20px; text-align: center; font-size: 16px; }
.admin-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav a.active {
    background: var(--brand-grad);
    color: #fff;
    box-shadow: 0 4px 12px rgba(64, 158, 255, .28);
}

/* ---------- 顶栏 ---------- */
.admin-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    transition: margin .25s ease;
}
.admin-topbar {
    height: var(--topbar-h);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.admin-topbar .left { display: flex; align-items: center; gap: 14px; }
.admin-topbar .toggle-btn {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: #555;
    display: none;
}
.admin-topbar .page-title { font-size: 17px; font-weight: 600; }
.admin-topbar .user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.admin-topbar .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.admin-content { padding: 24px; }

/* ---------- 卡片 ---------- */
.card { border: none; border-radius: 6px; box-shadow: var(--card-shadow); }
.card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f3;
    font-weight: 600;
    padding: 16px 20px;
}

/* 统计卡片 */
.stat-card {
    border-radius: 6px;
    padding: 20px;
    color: #fff;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.stat-card .num { font-size: 30px; font-weight: 700; line-height: 1; }
.stat-card .lbl { font-size: 13px; opacity: .9; margin-top: 8px; }
.stat-card .icon { font-size: 40px; opacity: .35; }
.stat-1 { background: var(--brand-grad); }
.stat-2 { background: linear-gradient(135deg, #1abc9c, #16a085); }
.stat-3 { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-4 { background: linear-gradient(135deg, #f39c12, #e67e22); }

.btn-brand {
    background: var(--brand-grad);
    border: none;
    color: #fff;
    border-radius: 4px;
}
.btn-brand:hover { color: #fff; opacity: .92; }
.text-brand { color: var(--brand) !important; }

/* ---------- 上传区 ---------- */
.upload-drop {
    border: 2px dashed #d5d8e2;
    border-radius: 6px;
    padding: 48px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: #fafbff;
}
.upload-drop:hover, .upload-drop.dragover {
    border-color: var(--brand);
    background: #fff5f4;
}
.upload-drop .up-icon {
    font-size: 52px;
    color: var(--brand);
    line-height: 1;
    margin-bottom: 14px;
}
.upload-drop .up-title { font-size: 17px; font-weight: 600; color: #333; }
.upload-drop .up-sub { font-size: 13px; color: #999; margin-top: 8px; }

/* 上传任务列表 */
.upload-task {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #f0f0f3;
    border-radius: 6px;
    margin-top: 14px;
    background: #fff;
}
.upload-task .thumb {
    width: 68px;
    height: 68px;
    border-radius: 6px;
    background: var(--brand-grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}
.upload-task .info { flex: 1; min-width: 0; }
.upload-task .fname {
    font-size: 14.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-task .meta { font-size: 12.5px; color: #999; margin: 4px 0 8px; }
.upload-task .progress { height: 8px; border-radius: 6px; background: #eef0f5; }
.upload-task .progress-bar {
    background: var(--brand-grad);
    transition: width .15s linear;
    font-size: 0;
}
.upload-task .pct {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
    width: 90px;
    text-align: right;
    flex-shrink: 0;
}
.upload-task.done .thumb { background: linear-gradient(135deg, #1abc9c, #16a085); }
.upload-task.error .thumb { background: #7f8c8d; }
.upload-task.error .pct { color: #e74c3c; }

/* 视频卡片网格 */
.video-grid-card { overflow: hidden; }
.video-grid-card .cover {
    height: 150px;
    background: var(--brand-grad);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .9);
    font-size: 42px;
    overflow: hidden;
}
.video-grid-card .cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.video-grid-card .cover .dur {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 5px;
    z-index: 1;
}
.video-grid-card .body { padding: 12px 14px; }
.video-grid-card .vtitle {
    font-size: 14px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}
.video-grid-card .vmeta {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cover-preview {
    width: 100%;
    min-height: 120px;
    border: 1px solid #e9eef5;
    border-radius: 6px;
    background: #f8fafc;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cover-preview img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-topbar .toggle-btn { display: block; }
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 1025;
}
.sidebar-backdrop.show { display: block; }

/* ---------- 表格通用缩略图 ---------- */
.goods-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: var(--brand-grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
}
.card-footer { background: transparent; border-top: 1px solid #f0f0f3; }
.page-link { color: var(--brand); }
.page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-light);
    box-shadow: 0 0 0 .2rem rgba(64, 158, 255, .15);
}

/* 分类图标 */
.cat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border-radius: 14px;
    background: #fff5f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

/* ---------- 轻提示 toast ---------- */
.toast-msg {
    min-width: 200px;
    max-width: 320px;
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .3s, transform .3s;
}
.toast-msg.show { opacity: 1; transform: translateX(0); }
.toast-success { background: #2ecc71; }
.toast-danger  { background: #e74c3c; }
.toast-warning { background: #f39c12; }
.toast-info    { background: #3498db; }

/* ---------- 小号胶囊导航（订单状态筛选） ---------- */
.nav-pills-sm {
    flex-wrap: wrap;
    gap: 4px;
}
.nav-pills-sm .nav-link {
    padding: 4px 12px;
    font-size: 13px;
    color: #555;
    border-radius: 20px;
    cursor: pointer;
}
.nav-pills-sm .nav-link.active {
    background: var(--brand);
    color: #fff;
}
.nav-pills-sm .nav-link.active .badge {
    background: rgba(255, 255, 255, .25) !important;
    color: #fff;
}

/* ---------- 规格编辑行 ---------- */
.spec-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.spec-row .form-control { flex: 1; }
.spec-row .spec-del {
    flex: 0 0 auto;
    width: 36px;
}
.empty-row td { padding: 32px 0 !important; }

/* ---------- 商品图片上传 ---------- */
.img-uploader { display: flex; flex-wrap: wrap; gap: 10px; }
.img-uploader .img-item,
.img-uploader .img-add {
    width: 92px;
    height: 92px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
}
.img-uploader .img-item {
    border: 1px solid #eee;
    background: #f7f7f9;
}
.img-uploader .img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* 拖拽排序时的手柄光标 */
.img-uploader .img-item { cursor: move; }
.img-uploader .img-item.dragging { opacity: .4; }
.img-uploader .img-item .img-del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}
.img-uploader .img-item .img-cover-badge {
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(233, 51, 35, .85);
    color: #fff;
    font-size: 11px;
    text-align: center;
    line-height: 18px;
}
.img-uploader .img-item .img-progress {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4px;
    background: rgba(0,0,0,.15);
}
.img-uploader .img-item .img-progress > i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--brand);
    transition: width .2s;
}
.img-uploader .img-item.uploading img { opacity: .45; }
.img-uploader .img-add {
    border: 1px dashed #ccc;
    background: #fafafb;
    color: #bbb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .15s;
}
.img-uploader .img-add:hover { border-color: var(--brand); color: var(--brand); }
.img-uploader .img-add .plus { font-size: 26px; line-height: 1; }
.img-uploader .img-add .txt { font-size: 12px; margin-top: 2px; }

/* ---------- 问题反馈 ---------- */
.feedback-content {
    max-width: 520px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.55;
}
