:root {
    --bg: #f7f6ff;
    --panel: #ffffff;
    --line: #deddf8;
    --ink: #0b1644;
    --muted: #58648a;
    --brand: #6547ff;
    --brand-soft: #eeebff;
    --accent: #008f88;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, "Microsoft YaHei", sans-serif;
    font-size: 14px;
    overflow-x: hidden;
}

.layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    align-self: start;
    background: rgba(255, 255, 255, 0.86);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 14px;
    position: sticky;
    top: 0;
}

.brand {
    align-items: center;
    display: flex;
    gap: 11px;
    margin: 0 6px 24px;
}

.logo {
    align-items: center;
    background: #fff;
    border-radius: 9px;
    color: #fff;
    display: flex;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    width: 40px;
    overflow: hidden;
}

.logo img {
    border-radius: inherit;
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.brand span,
.menu-item small,
.scope-note,
.hero p,
.overview-title p,
.summary-card small,
.message {
    color: var(--muted);
}

.brand strong,
.brand span,
.menu-item strong,
.menu-item small {
    display: block;
}

.brand span,
.menu-item small {
    font-size: 12px;
    margin-top: 2px;
}

.menu {
    display: grid;
    gap: 8px;
}

.sidebar-logout {
    margin-top: auto;
    padding: 18px 6px 0;
}

.sidebar-logout button {
    width: 100%;
    height: 34px;
    color: var(--muted);
    background: transparent;
    border: 1px solid #e4e5eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.sidebar-logout button:hover {
    color: var(--ink);
    background: #f4f5f8;
}

.menu-item {
    align-items: center;
    background: #fff;
    border: 1px solid #ecebff;
    border-radius: 10px;
    color: var(--ink);
    display: grid;
    gap: 10px;
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 10px;
    text-decoration: none;
}

.menu-item.active {
    background: var(--brand-soft);
    border-color: #d7d0ff;
}

.menu-item span {
    align-items: center;
    background: #f4f3ff;
    border-radius: 7px;
    display: flex;
    height: 30px;
    justify-content: center;
    width: 30px;
}

.main {
    min-width: 0;
    overflow-x: hidden;
    padding: 18px;
}

.top-filter,
.overview-card,
.table-panel {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.top-filter {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(170px, 200px) minmax(190px, 240px) minmax(0, 1fr);
    padding: 12px 16px;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    gap: 5px;
}

select,
input {
    background: #fff;
    border: 1px solid #dcdaf6;
    border-radius: 8px;
    color: var(--ink);
    font-size: 13px;
    height: 36px;
    min-width: 0;
    padding: 0 11px;
    width: 100%;
}

.hero {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 18px 4px 14px;
}

.eyebrow {
    color: #40538f;
    font-size: 14px;
    font-weight: 700;
}

h1 {
    font-size: 32px;
    letter-spacing: 0;
    margin: 6px 0;
}

h2 {
    margin: 0 0 8px;
}

button {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    height: 38px;
    padding: 0 14px;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.primary {
    background: var(--brand);
    color: #fff;
}

.secondary {
    background: var(--brand-soft);
    color: var(--brand);
}

.overview-card {
    padding: 16px;
}

.overview-title {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

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

.summary-card {
    border: 1px solid #e2e0fb;
    border-radius: 10px;
    padding: 14px;
}

.summary-card strong {
    display: block;
    font-size: 28px;
    margin: 6px 0;
}

.table-panel {
    margin-top: 0;
    min-width: 0;
    padding: 12px;
}

.sample-toolbar {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(160px, 200px) minmax(180px, 220px) minmax(240px, 1fr);
    margin-bottom: 12px;
}

.sample-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.filters {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 8px;
}

.filter-input {
    min-width: 0;
    position: relative;
}

.filter-input input {
    padding-right: 34px;
}

.clear-filter {
    align-items: center;
    background: transparent;
    border-radius: 50%;
    color: #717785;
    display: none;
    font-size: 19px;
    font-weight: 400;
    height: 24px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 6px;
    top: 6px;
    width: 24px;
}

.filter-input.has-value .clear-filter {
    display: flex;
}

.clear-filter:hover {
    background: #eef0f3;
    color: #111827;
}

.status-view-row {
    align-items: flex-end;
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    min-width: 0;
}

.status-tabs {
    border-bottom: 1px solid var(--line);
    display: flex;
    flex: 1 1 auto;
    gap: 24px;
    margin: 0;
    min-width: 0;
    padding: 6px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.status-tab {
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: #626978;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 500;
    height: 40px;
    padding: 0 8px;
    position: relative;
    transition: color 180ms ease, background-color 180ms ease;
}

.status-tab::after {
    background: #3657d6;
    bottom: -1px;
    content: "";
    height: 2px;
    left: 8px;
    opacity: 0;
    position: absolute;
    right: 8px;
    transform: scaleX(0.35);
    transform-origin: center;
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.status-tab:not(:disabled):hover {
    background: #f6f7fb;
    color: #30384b;
}

.status-tab:disabled {
    opacity: 1;
}

.status-tab span {
    color: var(--muted);
    font-weight: 600;
    transition: color 180ms ease;
}

.status-tab.active {
    color: #111827;
    font-weight: 700;
}

.status-tab.active::after {
    opacity: 1;
    transform: scaleX(1);
}

.status-tab.active span {
    color: #3657d6;
}

.view-menu {
    flex: 0 0 auto;
    margin-bottom: 7px;
    position: relative;
    z-index: 4;
}

.view-menu summary {
    align-items: center;
    background: #fff;
    border: 1px solid #dcdaf6;
    border-radius: 6px;
    color: #30384b;
    cursor: pointer;
    display: flex;
    font-size: 12px;
    font-weight: 600;
    height: 30px;
    justify-content: space-between;
    list-style: none;
    min-width: 92px;
    padding: 0 9px;
}

.view-menu summary::-webkit-details-marker {
    display: none;
}

.view-menu summary::after {
    border-bottom: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #687086;
    content: "";
    margin-left: 12px;
}

.view-menu[open] summary::after {
    border-bottom: 5px solid #687086;
    border-top: 0;
}

.view-menu-option {
    align-items: center;
    background: #fff;
    border: 1px solid #dcdaf6;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(23, 31, 64, 0.14);
    color: #30384b;
    display: flex;
    font-size: 12px;
    gap: 8px;
    min-width: 132px;
    padding: 10px;
    position: absolute;
    right: 0;
    top: 35px;
}

.view-menu-option input {
    accent-color: var(--accent);
    height: 16px;
    margin: 0;
    padding: 0;
    width: 16px;
}

.data-view-panel {
    min-width: 0;
    position: relative;
}

#listViewPanel,
.data-view-panel {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#listViewPanel.content-transition-out,
.data-view-panel.content-transition-out,
#listViewPanel.content-transition-in,
.data-view-panel.content-transition-in {
    opacity: 0.28;
    pointer-events: none;
    transform: translateY(5px);
}

.data-view-header {
    align-items: center;
    display: flex;
    min-height: 34px;
    padding: 2px 8px 0;
}

.data-view-header strong {
    color: #30384b;
    font-size: 12px;
}

.creator-product-chart {
    height: min(72vh, 760px);
    min-height: 480px;
    width: 100%;
}

.data-view-empty {
    color: var(--muted);
    font-size: 13px;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}

.table-scroll {
    max-width: 100%;
    overflow: auto;
}

table {
    border-collapse: collapse;
    min-width: 100%;
    table-layout: fixed;
    width: 1735px;
}

th:nth-child(1), td:nth-child(1) { width: 380px; }
th:nth-child(2), td:nth-child(2) { width: 85px; }
th:nth-child(3), td:nth-child(3) { width: 120px; }
th:nth-child(4), td:nth-child(4) { width: 80px; }
th:nth-child(5), td:nth-child(5) { width: 80px; }
th:nth-child(6), td:nth-child(6) { width: 180px; }
th:nth-child(7), td:nth-child(7) { width: 220px; }
th:nth-child(8), td:nth-child(8) { width: 95px; }
th:nth-child(9), td:nth-child(9) { width: 110px; }
th:nth-child(10), td:nth-child(10) { width: 75px; }
th:nth-child(11), td:nth-child(11) { width: 90px; }
th:nth-child(12), td:nth-child(12) { width: 220px; }

th,
td {
    border-bottom: 1px solid #ebeafd;
    padding: 9px 8px;
    text-align: left;
    vertical-align: top;
}

tbody tr {
    transition: background-color 120ms ease;
}

tbody tr:hover {
    background: #f3f4f5;
}

th {
    color: var(--muted);
    font-size: 12px;
}

.sort-header {
    align-items: center;
    background: transparent;
    border-radius: 0;
    color: inherit;
    display: inline-flex;
    font: inherit;
    gap: 5px;
    height: auto;
    padding: 0;
}

.sort-header:hover,
.sort-header:focus-visible {
    color: #343946;
}

.sort-header:disabled {
    cursor: wait;
}

.sort-arrows {
    display: inline-flex;
    flex-direction: column;
    gap: 0;
    line-height: 7px;
}

.sort-arrow {
    color: #b5bac4;
    font-size: 7px;
}

.sort-ascending .sort-arrow-up,
.sort-descending .sort-arrow-down {
    color: #343946;
}

.sample-note {
    background: #f3f4f6;
    border: 1px solid #dfe2e8;
    border-radius: 4px;
    color: #111827;
    display: block;
    font: inherit;
    height: 32px;
    line-height: 30px;
    padding: 0 8px;
    transition: border-color 120ms ease, background-color 120ms ease;
    width: 100%;
}

.sample-note:focus {
    border-color: #7d88a0;
    outline: 1px solid #7d88a0;
}

.sample-note.saving {
    background: #eceef1;
}

.sample-note.saved {
    border-color: #5c9f74;
}

.sample-note.save-error {
    border-color: #c75b5b;
}

td {
    font-size: 12px;
    line-height: 1.45;
}

.tag {
    border-radius: 3px;
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    max-width: 100%;
    padding: 0 6px;
}

.tag-review {
    background: #fff3cf;
    color: #a66300;
}

.tag-progress {
    background: #e6f2ff;
    color: #1765a3;
}

.tag-completed {
    background: #e5f6e9;
    color: #24733c;
}

.tag-canceled,
.tag-neutral {
    background: #eef0f3;
    color: #59616e;
}

.product-info,
.creator-info {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.product-info > div,
.creator-info > div {
    min-width: 0;
    width: 100%;
}

.product-name {
    display: -webkit-box;
    line-height: 16px;
    margin-bottom: 2px;
    max-height: 32px;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-info img,
.creator-info img {
    border: 1px solid var(--line);
    border-radius: 6px;
    flex: 0 0 auto;
    height: 44px;
    object-fit: cover;
    width: 44px;
}

.creator-info img {
    border-radius: 50%;
}

.creator-avatar {
    align-items: center;
    background: #e8eeed;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: #315653;
    display: flex;
    flex: 0 0 44px;
    font-size: 15px;
    font-weight: 700;
    height: 44px;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 44px;
}

.creator-avatar img {
    inset: 0;
    position: absolute;
}

.creator-display-name {
    color: #111827;
    line-height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-line {
    align-items: center;
    display: flex;
    gap: 4px;
    line-height: 18px;
    min-width: 0;
}

.data-label {
    color: #8a92a3;
    flex: 0 0 auto;
}

.data-label::after {
    content: ":";
}

.data-value {
    color: #111827;
    min-width: 0;
}

.campaign-period {
    color: #6b7280;
    line-height: 18px;
}

.sku-value {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-button {
    background: transparent;
    border-radius: 4px;
    flex: 0 0 auto;
    height: 22px;
    padding: 0;
    position: relative;
    width: 22px;
}

.copy-button span,
.copy-button span::after {
    border: 1.5px solid #8a92a3;
    border-radius: 2px;
    content: "";
    height: 8px;
    position: absolute;
    width: 7px;
}

.copy-button span {
    left: 8px;
    top: 6px;
}

.copy-button span::after {
    left: -4px;
    top: 3px;
}

.copy-button:hover {
    background: #eef1f5;
}

.copy-button.copied span,
.copy-button.copied span::after {
    border-color: #16865a;
}

.sample-status {
    color: var(--muted);
    display: inline-block;
    margin-top: 5px;
}

.pagination {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    min-height: 42px;
    padding-top: 8px;
}

.pagination-pages {
    align-items: center;
    display: flex;
    gap: 6px;
}

.page-button,
.pagination-number {
    align-items: center;
    background: #f3f4f7;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #30384b;
    display: inline-flex;
    font-size: 12px;
    font-weight: 600;
    height: 28px;
    justify-content: center;
    padding: 0;
    width: 28px;
}

.page-button {
    color: #8a92a3;
    font-size: 20px;
}

.page-button:hover:not(:disabled),
.pagination-number:hover:not(.active):not(:disabled) {
    background: #e9ebf0;
}

.pagination-number.active {
    background: #fff;
    border-color: var(--accent);
    color: #111827;
}

.pagination-ellipsis {
    align-items: center;
    color: #6b7280;
    display: inline-flex;
    font-size: 12px;
    height: 28px;
    justify-content: center;
    min-width: 28px;
}

.page-button:disabled,
.pagination-number:disabled {
    cursor: default;
    opacity: 0.45;
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        height: auto;
        overflow-y: visible;
        position: static;
    }

    .top-filter,
    .filters,
    .summary-grid,
    .sample-toolbar {
        grid-template-columns: 1fr;
    }

    .sample-actions {
        justify-content: flex-start;
    }

    .status-view-row {
        align-items: stretch;
        flex-direction: column;
    }

    .view-menu {
        align-self: flex-end;
        margin-bottom: 0;
    }

    .creator-product-chart {
        height: 68vh;
        min-height: 420px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .status-tab,
    .status-tab::after,
    .status-tab span,
    #listViewPanel,
    .data-view-panel {
        transition: none;
    }
}
