:root {
    color-scheme: light;
    --page-bg: #edf2ff;
    --surface: #ffffff;
    --surface-soft: #f7f9ff;
    --surface-muted: #f5f7fb;
    --border: #d7def0;
    --border-strong: #c8d3ed;
    --text-main: #22304a;
    --text-secondary: #5d6b86;
    --primary: #3b78f6;
    --shadow: 0 12px 28px rgba(31, 60, 113, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 1360px;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text-main);
    background: linear-gradient(180deg, var(--page-bg) 0%, #f7f9ff 100%);
}

.page-shell {
    min-height: 100vh;
    padding: 18px 20px 24px;
}

.page-tabs > .el-tabs__header {
    margin: 0;
    padding: 0 20px;
    border-radius: 12px 12px 0 0;
    background: #fff;
    border: 1px solid rgba(199, 211, 237, 0.78);
    border-bottom: none;
}

.page-tabs > .el-tabs__header .el-tabs__nav-wrap::after {
    height: 1px;
    background-color: #e7ebf3;
}

.page-tabs > .el-tabs__header .el-tabs__item {
    height: 54px;
    padding: 0 28px;
    line-height: 54px;
    font-size: 15px;
    font-weight: 600;
}

.page-tabs > .el-tabs__content {
    padding-top: 16px;
}

.workspace {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.tree-panel,
.content-panel {
    min-height: calc(100vh - 112px);
}

.panel-card,
.attribute-card {
    border-radius: 16px;
    border: 1px solid rgba(199, 211, 237, 0.78) !important;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tree-card,
.hero-card,
.info-card {
    background: var(--surface);
}

.tree-card {
    height: calc(100vh - 112px);
}

.tree-card > .el-card__body {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.content-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tree-toolbar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.tree-toolbar .el-button {
    align-self: flex-end;
    padding: 4px 0;
}

.panel-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.panel-tip,
.tree-legend,
.breadcrumb,
.field-help {
    color: var(--text-secondary);
    font-size: 13px;
}

.panel-tip {
    margin-top: 6px;
}

.tree-container {
    flex: 1;
    overflow: auto;
    padding-right: 4px;
}

.entity-tree {
    background: transparent;
}

.entity-tree .el-tree-node__content {
    height: 38px;
    border-radius: 10px;
    margin-bottom: 4px;
}

.entity-tree .el-tree-node__content:hover {
    background: rgba(59, 120, 246, 0.08);
}

.entity-tree .el-tree-node.is-current > .el-tree-node__content {
    background: rgba(59, 120, 246, 0.14);
    color: #173365;
}

.custom-tree-node {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-right: 8px;
}

.tree-node-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-node-icon {
    width: 18px;
    text-align: center;
    flex: 0 0 18px;
    color: #73809a;
}

.tree-node-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-node-count {
    min-width: 22px;
    color: #9aa5b8;
    font-size: 12px;
    text-align: right;
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.model-summary-card {
    border-left: 3px solid var(--primary) !important;
}

.model-caption {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

.model-title {
    margin: 0;
    font-size: 22px;
}

.breadcrumb {
    margin-top: 10px;
    line-height: 1.7;
}

.content-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.product-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.meta-item {
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface-muted);
    border: 1px solid rgba(207, 216, 233, 0.9);
}

.meta-label {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 12px;
}

.meta-value {
    min-height: 22px;
    line-height: 1.7;
    word-break: break-word;
}

.sku-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.product-sku-grid {
    margin-top: 16px;
}

.disabled-action {
    display: inline-block;
}

.attribute-icon {
    color: #f59e0b;
}

.attribute-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.attribute-title-wrap {
    min-width: 0;
    flex: 1;
}

.attribute-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.attribute-name {
    font-weight: 600;
}

.attribute-desc {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

.attribute-actions,
.value-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.attribute-icon-button {
    width: 28px;
    height: 28px;
    padding: 0 !important;
    font-size: 16px;
}

.value-list {
    margin-top: 4px;
}

.value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(211, 220, 237, 0.92);
}

.value-row:last-child {
    border-bottom: none;
}

.value-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.value-name {
    line-height: 1.6;
    word-break: break-word;
}

.value-remark {
    color: var(--text-secondary);
    font-size: 12px;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.8;
}

.empty-state-small {
    min-height: 110px;
}

.product-placeholder {
    min-height: calc(100vh - 112px);
}

.product-placeholder > .el-card__body {
    min-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
}

.placeholder-tip {
    max-width: 520px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
}

.sku-table-card {
    min-height: calc(100vh - 112px);
}

.sku-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.sku-table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sku-table-actions .el-input {
    width: 280px;
}

.sku-table {
    width: 100%;
}

.sku-table th {
    background: #f7f8fa !important;
    color: #303b52;
    text-align: center;
}

.sku-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
}

.pagination-total {
    color: var(--text-secondary);
    font-size: 13px;
}

.sku-pagination .el-pagination.is-background .el-pager li:not(.disabled).active {
    color: var(--primary);
    background: #fff;
    border-color: var(--primary);
}

.sku-pagination .el-pagination.is-background .btn-next,
.sku-pagination .el-pagination.is-background .btn-prev,
.sku-pagination .el-pagination.is-background .el-pager li {
    border: 1px solid #d9e1f2;
    border-radius: 4px;
    background: #fff;
}

.dialog-form .el-form-item {
    margin-bottom: 16px;
}

.dialog-number,
.dialog-select {
    width: 100%;
}

.dialog-footer {
    display: inline-flex;
    gap: 12px;
}

.field-help {
    margin-top: 6px;
    line-height: 1.6;
}

.danger-text {
    color: #ef4444 !important;
}

.el-card__header {
    border-bottom: 1px solid rgba(207, 216, 233, 0.92) !important;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.el-card__body {
    background: transparent;
}

.panel-card > .el-card__body {
    padding: 18px;
}

.hero-card > .el-card__body {
    padding: 18px;
}

.attribute-card > .el-card__body {
    padding: 14px 16px 10px;
}

.el-dialog {
    border-radius: 18px;
    overflow: hidden;
}

.el-dialog__header {
    border-bottom: 1px solid rgba(207, 216, 233, 0.92);
}

.el-dialog__footer {
    border-top: 1px solid rgba(207, 216, 233, 0.92);
    padding-top: 16px;
}

.el-input__inner,
.el-textarea__inner,
.el-input-number__decrease,
.el-input-number__increase {
    border-radius: 10px !important;
}

.el-button {
    border-radius: 8px !important;
}

@media (max-width: 1600px) {
    .product-meta-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
