/* ShopClone-style dashboard theme */
:root {
    --sc-sidebar-w: 260px;
    --sc-topbar-h: 56px;
    --sc-primary: #3b82f6;
    --sc-primary-dark: #2563eb;
    --sc-primary-soft: #eff6ff;
    --sc-sidebar-bg: #ffffff;
    --sc-body-bg: #f1f5f9;
    --sc-table-head: #f8fafc;
    --sc-table-head-text: #475569;
    --sc-border: #e2e8f0;
    --sc-text: #0f172a;
    --sc-text-muted: #64748b;
    --sc-green: #16a34a;
    --sc-green-soft: #f0fdf4;
    --sc-link: #2563eb;
}

body[data-layout="shopclone"] {
    background: var(--sc-body-bg);
    overflow-x: hidden;
}

.sc-app {
    display: flex;
    min-height: 100vh;
}

.sc-sidebar {
    width: var(--sc-sidebar-w);
    background: var(--sc-sidebar-bg);
    border-right: 1px solid #e5e7eb;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform .25s ease;
}

.sc-sidebar-profile {
    padding: 1.25rem 1rem;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.sc-sidebar-profile .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
    margin-bottom: .5rem;
}

.sc-sidebar-profile .username {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
    margin-bottom: .15rem;
}

.sc-sidebar-profile .role {
    font-size: .75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .5rem;
}

.sc-sidebar-profile .balance {
    display: inline-block;
    background: #fef3c7;
    color: #b45309;
    font-weight: 700;
    padding: .25rem .75rem;
    border-radius: 999px;
    font-size: .85rem;
}

.sc-menu-label {
    font-size: .7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 1rem 1.25rem .35rem;
}

.sc-menu-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem 1.25rem;
    color: #334155;
    text-decoration: none !important;
    font-weight: 500;
    font-size: .925rem;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}

.sc-menu-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

.sc-menu-item.active {
    background: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 600;
}

.sc-menu-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    opacity: .85;
}

.sc-menu-cat-icon-wrap {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    max-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    line-height: 1;
}

.sc-menu-cat-icon {
    flex-shrink: 0;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    max-width: 20px !important;
    max-height: 20px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: .9;
    line-height: 1;
    vertical-align: middle;
}

.sc-menu-cat-iconfont {
    font-size: 16px !important;
    line-height: 1 !important;
    font-style: normal;
}

.sc-menu-cat-iconfont::before {
    font-size: 16px !important;
    line-height: 1 !important;
}

.sc-menu-cat-img {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    max-width: 20px !important;
    max-height: 20px !important;
    object-fit: contain;
    border-radius: 3px;
    display: block;
}

.sc-menu-item--category {
    align-items: center;
    overflow: hidden;
}

.sc-main {
    flex: 1;
    margin-left: var(--sc-sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sc-topbar {
    height: var(--sc-topbar-h);
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.sc-topbar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none !important;
    color: #0f172a;
}

.sc-topbar-brand img {
    height: 36px;
    width: auto;
}

.sc-topbar-brand .title {
    font-weight: 700;
    font-size: 1.05rem;
}

.sc-topbar-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.sc-content {
    padding: 1.25rem;
    flex: 1;
}

.sc-category-banner {
    background: linear-gradient(90deg, var(--sc-primary-soft) 0%, #fff 55%);
    color: var(--sc-text);
    text-align: left;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid var(--sc-border);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .55rem;
    position: relative;
}

.sc-category-banner::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--sc-primary), var(--sc-primary-dark));
    border-radius: 0 2px 2px 0;
}

.sc-category-banner i {
    color: var(--sc-primary);
    font-size: 1.15rem;
    opacity: .9;
}

.sc-category-banner-icon {
    height: 22px;
    width: 22px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--sc-border);
}

.sc-category-block {
    margin-bottom: 1.25rem;
    background: #fff;
    border-radius: .75rem;
    border: 1px solid var(--sc-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.sc-goods-table {
    width: 100%;
    margin-bottom: 0;
    font-size: .875rem;
}

.sc-goods-table thead th {
    background: var(--sc-table-head);
    color: var(--sc-table-head-text);
    font-weight: 600;
    font-size: .8125rem;
    border: none;
    border-bottom: 1px solid var(--sc-border);
    padding: .6rem .75rem;
    white-space: nowrap;
}

.sc-goods-table tbody td {
    vertical-align: middle;
    padding: .7rem .75rem;
    border-top: 1px solid #f1f5f9;
    color: var(--sc-text);
}

.sc-goods-table tbody tr {
    transition: background-color .15s ease;
}

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

.sc-goods-table thead th + th::before,
.sc-goods-table tbody td + td::before {
    content: '|';
    position: absolute;
    left: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    color: #e2e8f0;
    font-weight: 400;
    pointer-events: none;
}

.sc-goods-table thead th + th,
.sc-goods-table tbody td + td {
    position: relative;
    padding-left: 1.15rem;
}

.sc-goods-table .sc-col-name {
    width: 25rem;
    max-width: 25rem;
    min-width: 25rem;
}

.sc-goods-table .sc-col-name .sc-product-link {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-goods-table .home-description-cell {
    color: var(--sc-text-muted) !important;
    font-weight: 700;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.sc-goods-table .sc-after-sales-col {
    color: var(--sc-text-muted) !important;
}

.sc-product-link {
    color: var(--sc-link);
    font-weight: 600;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    transition: color .15s ease;
}

.sc-product-link:hover {
    color: var(--sc-primary-dark);
}

.sc-goods-table .sc-after-sales-col {
    width: 9.5rem;
    max-width: 9.5rem;
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
    white-space: nowrap;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.sc-goods-logo-cell {
    width: 3rem;
    padding-left: .75rem !important;
    padding-right: .35rem !important;
}

.sc-goods-logo-cell::before {
    display: none !important;
}

.sc-product-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

.sc-product-logo img,
.sc-product-link img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--sc-border);
    background: #fff;
}

.sc-stock-badge {
    display: inline-block;
    background: var(--sc-green-soft);
    color: var(--sc-green);
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    min-width: 2rem;
    text-align: center;
    border: 1px solid #bbf7d0;
}

.sc-stock-badge.is-out {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.sc-price {
    color: #e11d48;
    font-weight: 700;
    white-space: nowrap;
    font-size: .9rem;
}

.sc-buy-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--sc-primary-soft);
    color: var(--sc-primary);
    border: 1px solid #bfdbfe;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: background .15s, color .15s, transform .15s, border-color .15s;
}

.sc-buy-btn i {
    font-size: 1.125rem;
    line-height: 1;
}

.sc-buy-btn:hover {
    background: var(--sc-primary);
    color: #fff;
    border-color: var(--sc-primary);
    transform: translateY(-1px);
}

.sc-notice-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.sc-notice-box .home-notice {
    line-height: 1.65;
    word-break: break-word;
}

.sc-sidebar-toggle {
    display: none;
    border: none;
    background: transparent;
    font-size: 1.35rem;
    color: #334155;
    padding: .25rem .5rem;
}

.sc-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.45);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .sc-sidebar {
        transform: translateX(-100%);
    }
    .sc-sidebar.open {
        transform: translateX(0);
    }
    .sc-main {
        margin-left: 0;
    }
    .sc-sidebar-toggle {
        display: inline-flex;
    }
    .sc-overlay.show {
        display: block;
    }
}

/* 内页兼容：隐藏旧版顶栏留白 */
body[data-layout="shopclone"] .content-page .content {
    padding-top: 0 !important;
}

body[data-layout="shopclone"] .site-header-stack {
    display: none !important;
}

body[data-layout="shopclone"] .wrapper > .content-page > .content > .container {
    max-width: 100%;
    padding: 0;
}

.sc-main .footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    font-size: .85rem;
}
