:root {
    --primary: #4f7cff;
    --primary-2: #7aa2ff;
    --bg: #f4f6fb;
    --text: #1f2d3d;
    --muted: #8a94a6;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(31, 45, 61, 0.06);
    --shadow-lg: 0 10px 30px rgba(31, 45, 61, 0.12);
}

html, body, #app { height: 100%; margin: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Element 主题微调 ---------- */
.el-button { border-radius: 8px; }
.el-button--primary { background: var(--primary); border-color: var(--primary); }
.el-button--primary:hover, .el-button--primary:focus { background: #3f6ef0; border-color: #3f6ef0; }
.el-button--success { background: #22c07d; border-color: #22c07d; }
.el-button--success:hover, .el-button--success:focus { background: #1ea96d; border-color: #1ea96d; }
.el-switch.is-checked .el-switch__core { background: var(--primary); border-color: var(--primary); }
.el-tag { border-radius: 6px; }
.el-pagination.is-background .el-pager li:not(.disabled).active { background: var(--primary); }
.el-radio__input.is-checked .el-radio__inner,
.el-checkbox__input.is-checked .el-checkbox__inner { background: var(--primary); border-color: var(--primary); }
.el-input__inner, .el-textarea__inner { border-radius: 8px; }
.el-dialog { border-radius: 14px; }
.el-dialog__header { padding: 20px 22px 10px; font-weight: 600; }
.el-dialog__body { padding: 12px 22px 18px; }
.el-card { border-radius: var(--radius); }
.el-menu { border-right: none; }

/* ---------- 布局 ---------- */
.app-root { height: 100%; }
.layout-aside {
    background: #fff;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 60px;
    padding: 0 20px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--primary);
    border-bottom: 1px solid #f0f2f7;
}
.logo i { font-size: 20px; }
.side-menu { flex: 1; overflow: auto; padding: 10px 8px; }
.side-menu .el-menu-item {
    height: 46px;
    line-height: 46px;
    border-radius: 10px;
    margin: 4px 6px;
    color: #5b6472;
    font-size: 14px;
    transition: all 0.2s;
}
.side-menu .el-menu-item i { margin-right: 10px; color: inherit; }
.side-menu .el-menu-item:hover { background: #f2f5ff; color: var(--primary); }
.side-menu .el-menu-item.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 6px 16px rgba(79, 124, 255, 0.35);
}

.layout-header {
    height: 60px;
    background: #fff;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: relative;
    z-index: 5;
}
.page-title { font-size: 18px; font-weight: 600; }
.user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 10px;
    transition: 0.2s;
    outline: none;
}
.user:hover { background: #f2f5ff; }
.user .uname { font-size: 14px; }
.user i { color: var(--muted); font-size: 12px; }
.layout-main { background: var(--bg); padding: 20px; overflow: auto; }

/* ---------- 页面通用 ---------- */
.toolbar {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.toolbar .el-input, .toolbar .el-select { }
.el-table {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: none;
}
.el-table th { background: #f7f9fc !important; color: #5b6472; font-weight: 600; }
.el-table td, .el-table th { padding: 11px 0; }
.pager { margin-top: 16px; text-align: right; }
.thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; border: 1px solid #eef1f6; }
.muted { color: var(--muted); }

/* ---------- 仪表盘统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: 0.25s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.stat-value { font-size: 23px; font-weight: 700; }

/* ---------- 登录页 ---------- */
.login-wrap {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5b7cfa 0%, #8a63f0 55%, #56cfe1 120%);
    position: relative;
    overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}
.login-wrap::before { width: 420px; height: 420px; top: -140px; left: -80px; }
.login-wrap::after { width: 320px; height: 320px; bottom: -110px; right: -60px; }
.login-card {
    width: 380px;
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    position: relative;
    z-index: 2;
}
.login-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin: 4px auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 8px 20px rgba(79, 124, 255, 0.4);
}
.login-title { text-align: center; font-size: 20px; font-weight: 700; }
.login-sub { text-align: center; font-size: 13px; color: var(--muted); margin: 6px 0 22px; }
.api-cfg .el-collapse-item__header { font-size: 12px; color: var(--muted); }

/* 详情描述块 */
.el-descriptions__body { background: #fff; }

/* ---------- 图片上传 ---------- */
.img-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.img-item {
    position: relative;
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eef1f6;
    background: #fafbfe;
}
.img-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-remove {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 18px;
    opacity: 0;
    transition: 0.2s;
    cursor: pointer;
}
.img-item:hover .img-remove { opacity: 1; }
.img-uploader .el-upload { display: block; }
.img-add {
    width: 84px;
    height: 84px;
    border: 1px dashed #c3cbd8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa4b2;
    font-size: 26px;
    background: #fafbfe;
    transition: 0.2s;
    cursor: pointer;
}
.img-add:hover { border-color: var(--primary); color: var(--primary); background: #f2f5ff; }

/* ---------- 商品弹窗分页签 ---------- */
.goods-tabs .el-tabs__header { margin-bottom: 14px; }
.goods-tabs .el-tabs__content { max-height: 54vh; overflow: auto; padding-right: 8px; }
.goods-tabs .el-tabs__item { font-size: 14px; }
