:root {
  --ink: #172036;
  --muted: #6d7487;
  --line: #e7e9f0;
  --panel: #ffffff;
  --canvas: #f5f6fa;
  --navy: #15233b;
  --accent: #7057e8;
  --accent-soft: #eeeaff;
  --green: #15946c;
  --orange: #d97826;
  --red: #d94b58;
  --blue: #2f70d0;
  --radius: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); min-width: 1024px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--navy); color: #dce3ef; padding: 26px 18px 18px; display: flex; flex-direction: column; }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; color: white; }
.brand-lockup strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand-lockup small { display: block; color: #8f9aaf; margin-top: 3px; font-size: 10px; letter-spacing: .08em; }
.brand-mark { width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(145deg,#8d74ff,#5368df); font-weight: 800; box-shadow: 0 8px 24px #0b1222; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a, .sidebar-bottom > a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; color: #aab4c6; font-size: 14px; transition: .15s ease; }
.sidebar nav a span, .sidebar-bottom > a span { width: 20px; text-align: center; font-size: 17px; }
.sidebar nav a .nav-badge { width: auto; min-width: 23px; margin-left: auto; padding: 2px 7px; border-radius: 999px; background: #f8c85e; color: #3f3110; font-size: 10px; line-height: 17px; text-align: center; }
.sidebar nav a:hover, .sidebar-bottom > a:hover { color: white; background: #1e304e; }
.sidebar nav a.active, .sidebar-bottom > a.active { color: white; background: linear-gradient(90deg,#624ee0,#745cea); box-shadow: 0 7px 20px rgba(95,74,220,.25); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 15px; }
.account-card { border-top: 1px solid #2d405f; padding: 14px 12px 0; }
.account-card b, .account-card small { display: block; }
.account-card b { color: #f4f7fb; font-size: 13px; }
.account-card small { color: #8390a6; margin-top: 3px; font-size: 11px; }
.text-button { border:0; padding:4px 0 0; color:#aeb8ca; background:transparent; cursor:pointer; font-size:11px; }
.login-body { min-height:100vh; display:grid; place-items:center; background:linear-gradient(145deg,#f4f2ff,#eef3fb); }
.login-card { width:min(420px,92vw); padding:34px; background:white; border:1px solid var(--line); border-radius:18px; box-shadow:0 20px 60px rgba(40,50,80,.12); }
.login-card h1 { margin:8px 0; font-size:24px; }.login-card form { display:grid; gap:15px; margin-top:25px; }.login-card label { display:grid; gap:7px; }.checkbox { display:flex !important; align-items:center; gap:8px; }.checkbox input { width:auto; }
.muted { color:var(--muted); }.danger { color:var(--red); }.permission-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-top:12px; }.permission-grid label { display:grid; grid-template-columns:150px 1fr; align-items:center; gap:8px; }.inline-json { white-space:pre-wrap; max-width:360px; font-size:10px; margin:0; }
.environment-card { border: 1px solid #2d405f; border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: center; background: #192a45; }
.environment-card b, .environment-card small { display: block; }
.environment-card b { color: #d9fff1; font-size: 12px; letter-spacing: .08em; }
.environment-card small { color: #8390a6; margin-top: 2px; font-size: 11px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.12); }
.main-area { min-width: 0; }
.topbar { height: 92px; padding: 20px 34px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.88); backdrop-filter: blur(12px); }
.topbar h1 { margin: 2px 0 0; font-size: 23px; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: #9299a8; font-size: 9px; letter-spacing: .14em; font-weight: 700; }
.topbar-status { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 12px; }
.env-pill { color: #563ed0; background: var(--accent-soft); border: 1px solid #ddd5ff; padding: 7px 10px; border-radius: 999px; font-weight: 800; letter-spacing: .08em; }
.page-content { position: relative; padding: 28px 34px 50px; max-width: 1680px; margin: auto; }
.page-content[aria-busy="true"]::before {
  content: "";
  position: absolute;
  z-index: 10;
  top: 0;
  left: 34px;
  right: 34px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: loading-sweep 1.1s linear infinite;
}
.page-content[aria-busy="true"] .table-wrap { opacity: .58; transition: opacity .12s ease; }
@keyframes loading-sweep { to { background-position: -200% 0; } }
.loading-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 50px; color: var(--muted); text-align: center; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #ddd8ff; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.flash { margin: 18px 34px 0; padding: 12px 15px; border-radius: 10px; background: #e8f8f1; color: #17694f; border: 1px solid #bde8d7; font-size: 13px; }
.flash.error { background: #fff0f1; color: #a52d3a; border-color: #f4c7cd; }
.metric-grid { display: grid; grid-template-columns: repeat(5,minmax(140px,1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(27,39,68,.035); }
.metric-card { padding: 18px; min-height: 112px; }
.metric-button { display: block; width: 100%; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.metric-button:hover { border-color: #b9acf5; box-shadow: 0 6px 20px rgba(71,52,157,.1); }
.metric-button .label, .metric-button .value { display: block; }
.metric-card .label { font-size: 12px; color: var(--muted); }
.metric-card .value { font-size: 29px; font-weight: 760; margin-top: 14px; letter-spacing: -.04em; }
.metric-card .hint { margin-top: 4px; color: #999fac; font-size: 11px; }
.panel { padding: 20px; margin-bottom: 18px; overflow: hidden; }
.panel-heading, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.panel-heading h2, .panel-heading h3 { margin: 0; font-size: 16px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.split-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.three-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.bar-list { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 105px 1fr 42px; gap: 10px; align-items: center; font-size: 12px; }
.bar-track { background: #f0f1f5; border-radius: 99px; height: 8px; overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#6b57e6,#9b85ff); }
.toolbar { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; align-items: end; flex-wrap: wrap; }
.toolbar.compact { align-items: center; padding: 10px 14px; }
.saved-view-list { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.column-picker { margin-left: auto; }
.column-picker summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.column-picker .chip-list { max-width: 620px; margin-top: 10px; }
.column-picker label { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.filter-group { display: grid; gap: 5px; min-width: 120px; }
.filter-group.grow { flex: 1; min-width: 230px; }
.material-filters { display: grid; align-items: stretch; gap: 12px; }
.filter-row { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; width: 100%; }
.filter-row-primary .material-search { flex: 1 1 360px; max-width: 520px; }
.material-search input, .material-filters input, .material-filters select, .material-filters .button { height: 42px; }
.search-control { position: relative; display: flex; align-items: center; }
.search-control > span { position: absolute; left: 12px; color: var(--muted); font-size: 18px; pointer-events: none; }
.search-control input { padding-left: 37px; padding-right: 38px; }
.search-clear { position: absolute; right: 7px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: #f0f1f5; color: #646b79; cursor: pointer; font-size: 18px; }
.material-filters .multi-filter { min-width: 170px; flex: 0 1 210px; }
.material-filters details { position: relative; padding: 0; border: 0; }
.material-filters details > summary { display: flex; align-items: center; min-height: 42px; padding: 0 34px 0 12px; border: 1px solid #dfe2ea; border-radius: 9px; background: white; cursor: pointer; color: var(--ink); font-size: 12px; list-style: none; }
.material-filters details > summary::after { content: '⌄'; position: absolute; right: 12px; color: var(--muted); }
.material-filters details[open] > summary { border-color: #8d7bea; box-shadow: 0 0 0 3px rgba(112,87,232,.1); }
.dropdown-panel { z-index: 20; display: grid; gap: 8px; min-width: 260px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: 0 14px 34px rgba(28,38,66,.14); }
.material-filters details > .dropdown-panel { position: absolute; top: calc(100% + 6px); left: 0; }
.material-filters select[multiple] { min-height: 170px; height: 170px; padding: 4px; }
.material-filters select[multiple] option { padding: 6px 7px; border-radius: 5px; }
.selected-option-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.selected-option-chips:empty { display: none; }
.date-filter { min-width: 170px; position: relative; }
.date-filter .dropdown-panel { min-width: 360px; }
.date-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 7px; }
.date-pair span { color: var(--muted); font-size: 11px; }
.range-shortcuts { display: flex; gap: 9px; flex-wrap: wrap; }
.range-shortcuts .text-button { color: var(--accent); padding-top: 2px; }
.active-filter-list { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.filter-chip { border: 1px solid #dcd6ff; background: #f5f2ff; color: #5542b8; border-radius: 999px; padding: 6px 9px; cursor: pointer; font-size: 11px; }
.content-type-filter { flex: 1 1 360px; }
.check-chip-list { display: flex; align-items: center; gap: 7px; min-height: 42px; flex-wrap: wrap; }
.check-chip { cursor: pointer; }
.check-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-chip span { display: inline-flex; align-items: center; height: 34px; padding: 0 11px; border: 1px solid #dfe2ea; border-radius: 999px; background: white; color: #606778; font-size: 11px; }
.check-chip input:checked + span { border-color: #9d8ff0; background: #eeeaff; color: #5542b8; font-weight: 750; }
.status-filter { width: 150px; }
.advanced-filter { width: 130px; }
.advanced-filter .dropdown-panel { right: 0; left: auto !important; min-width: 330px; }
.scope-note { margin: 0 0 16px; padding: 11px 13px; border-left: 3px solid var(--accent); background: #f8f7ff; color: var(--muted); font-size: 12px; line-height: 1.6; }
label, .filter-group label { color: var(--muted); font-size: 11px; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #dfe2ea; border-radius: 9px; background: #fff; color: var(--ink); padding: 9px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #8d7bea; box-shadow: 0 0 0 3px rgba(112,87,232,.1); }
textarea { min-height: 82px; resize: vertical; }
.button { border: 0; border-radius: 9px; padding: 9px 13px; cursor: pointer; font-weight: 700; font-size: 12px; white-space: nowrap; }
.button.primary { background: var(--accent); color: white; }
.button.secondary { background: #f0f1f5; color: #444c5d; }
.button.danger { background: #fff0f1; color: var(--red); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: white; font-size: 12px; }
th { text-align: left; color: #7b8291; background: #fafafc; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid #eff0f4; vertical-align: middle; }
tbody tr:hover { background: #fafaff; }
tbody tr:last-child td { border-bottom: 0; }
.cover { width: 96px; height: 128px; object-fit: cover; border-radius: 10px; background: linear-gradient(145deg,#edeafc,#e3e6ee); display: block; }
.cover.fallback { display: grid; place-items: center; color: #9587d8; font-size: 18px; }
.cover-slot { display: inline-block; width: 96px; height: 128px; padding: 0; border: 0; border-radius: 10px; background: transparent; cursor: zoom-in; }
.cover[hidden] { display: none !important; }
.title-cell { max-width: 360px; min-width: 220px; }
.title-cell a { font-weight: 650; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.material-table { min-width: 1320px; table-layout: fixed; }
.material-table .cover-cell { width: 120px; }
.material-table .title-cell { width: 280px; min-width: 280px; max-width: 280px; }
.material-table .published-cell { width: 128px; white-space: nowrap; }
.material-table .creator-cell { width: 112px; }
.material-table .brand-cell { width: 132px; }
.material-table .product-cell { width: 220px; max-width: 220px; }
.material-table .content-type-cell { width: 104px; }
.material-table .classification-cell { width: 104px; }
.material-table .action-cell { width: 210px; min-width: 210px; white-space: nowrap; }
.product-cell .chip-list { min-width: 0; }
.product-cell .badge { display: -webkit-box; max-width: 100%; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; line-height: 1.45; }
.row-actions { display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; white-space: nowrap; }
.row-actions .button { flex: 0 0 auto; white-space: nowrap; }
.subtext { color: var(--muted); font-size: 11px; margin-top: 4px; }
.badge { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; background: #f0f1f5; color: #5f6676; font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge.CONFIRMED, .badge.CLASSIFIED, .badge.SUCCESS, .badge.RETRY_SUCCESS { background: #e7f7f1; color: #147656; }
.badge.SUGGESTED, .badge.PARTIALLY_CLASSIFIED, .badge.FALLBACK_SUCCESS { background: #fff3df; color: #a75f17; }
.badge.UNMAPPED, .badge.UNCLASSIFIED { background: #f1f2f6; color: #6e7480; }
.badge.CONFLICT, .badge.FAILED, .badge.FAILED_PROVIDER, .badge.FAILED_PROFILE { background: #ffebed; color: #bc3544; }
.badge.video { background: #e9efff; color: #315fb5; }.badge.image { background: #f4eaff; color: #7943a9; }.badge.live_photo { background: #e8f8f1; color: #177153; }
.chip-list { display: flex; flex-wrap: wrap; gap: 5px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.empty { padding: 42px; text-align: center; color: var(--muted); }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.detail-header h2 { margin: 5px 0 8px; font-size: 24px; }
.detail-cover { width: 180px; height: 230px; object-fit: cover; border-radius: 14px; background: #ececf3; }
.definition-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.definition { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfbfd; }
.definition dt { color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.definition dd { margin: 0; font-size: 13px; word-break: break-all; }
details { border: 1px solid var(--line); border-radius: 11px; padding: 12px; }
details pre { max-height: 380px; overflow: auto; background: #172036; color: #dfe7f5; padding: 13px; border-radius: 8px; font-size: 11px; white-space: pre-wrap; }
.tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
.tab { border: 0; background: none; padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 750; }
.source-product-table { min-width: 1380px; table-layout: fixed; }
.source-product-table .source-id-cell { width: 150px; max-width: 150px; overflow-wrap: anywhere; word-break: break-all; }
.review-title { width: 300px; max-width: 300px; }
.review-title > a { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-weight: 650; line-height: 1.5; }
.review-product, .review-brand { width: 170px; max-width: 170px; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.review-product { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.review-action { min-width: 124px; white-space: nowrap; vertical-align: middle; }
.evidence { font-size: 11px; color: var(--muted); max-width: 390px; }
.mapping-dialog { width: min(620px,92vw); border: 0; border-radius: 17px; padding: 0; box-shadow: 0 24px 80px rgba(20,28,48,.28); }
.mapping-dialog::backdrop { background: rgba(20,28,48,.45); backdrop-filter: blur(3px); }
.mapping-dialog form { padding: 24px; display: grid; gap: 13px; }
.creator-dialog { width: min(680px,94vw); }
.creator-preview { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfd; }
.creator-preview img, .creator-avatar-fallback { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #eeeaff; }
.creator-avatar-fallback { display: grid; place-items: center; color: var(--accent); font-size: 28px; }
.range-picker { display: grid; grid-template-columns: repeat(3,minmax(135px,1fr)); gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.range-picker legend { color: var(--muted); font-size: 11px; font-weight: 700; padding: 0 5px; }
.range-picker label { display: flex; align-items: center; gap: 7px; color: var(--ink); }
.range-picker input { width: auto; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; }.dialog-heading h2 { margin: 4px 0 0; }
.icon-button { border: 0; background: #f0f1f5; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 20px; }
.dialog-product { margin: 0; color: var(--muted); padding: 10px; border-left: 3px solid var(--accent); background: #f8f7ff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.mapping-dialog label { display: grid; gap: 6px; }
.mapping-advanced { background: #fbfbfd; }
.mapping-advanced summary { color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.mapping-advanced[open] { display: grid; gap: 12px; }
.mapping-advanced[open] summary { margin-bottom: 2px; }
.mapping-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.mapping-summary dl { margin: 0; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbfd; }
.mapping-summary dt { color: var(--muted); font-size: 10px; }
.mapping-summary dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 5px; }
.detail-actions { display: flex; align-items: flex-start; gap: 12px; }
.run-status { padding: 14px; border-radius: 11px; background: #f8f7ff; border: 1px solid #e2ddff; }
.form-stack { display:grid; gap:14px; padding-top:14px; }.form-stack label { display:grid; gap:6px; }.form-stack select[multiple] { min-height:220px; }
.code-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.cover-preview-dialog { width: fit-content; border: 0; border-radius: 16px; padding: 42px 22px 22px; background: #111827; box-shadow: 0 24px 90px rgba(8,12,24,.5); }
.cover-preview-dialog::backdrop { background: rgba(8,12,24,.68); backdrop-filter: blur(4px); }
.cover-preview-dialog img { display: block; width: 240px; height: 320px; object-fit: cover; border-radius: 11px; background: #242b3a; }
.cover-preview-dialog .icon-button { position: absolute; top: 8px; right: 8px; color: white; background: rgba(255,255,255,.13); }
@media (max-width: 1180px) { .metric-grid { grid-template-columns: repeat(3,1fr); }.split-grid { grid-template-columns: 1fr; }.definition-grid { grid-template-columns: repeat(2,1fr); }.filter-row-primary .material-search{max-width:none}.material-filters .multi-filter{flex:1 1 190px}.content-type-filter{flex-basis:100%} }
