:root { font: 16px/1.5 "Microsoft YaHei", system-ui, sans-serif; color: #142a3e; background: #edf2f6; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #155183; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; background: #155183; color: white; border: 1px solid #155183; border-radius: 7px; padding: .42rem .8rem; white-space: nowrap; }
button.secondary { background: #f7fbff; color: #155183; }
button:hover { filter: brightness(.93); }
:focus-visible { outline: 3px solid #147893; outline-offset: 2px; }
input, select, textarea { min-width: 0; color: inherit; background: white; border: 1px solid #aabac8; border-radius: 6px; padding: .40rem .55rem; }
[hidden] { display: none !important; }
.workspace { min-width: 0; }
.workspace.with-sidebar { margin-left: 220px; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 25; width: 220px; background: #112a40; color: #f2f8ff; display: flex; flex-direction: column; padding: 1.3rem 1rem; overflow-y: auto; }
.brand { color: #fff; text-decoration: none; font-weight: 750; font-size: 1.12rem; padding: .42rem .55rem 1.35rem; }
.sidebar nav { display: grid; gap: .24rem; }
.sidebar nav a { color: #dce9f4; display: block; padding: .55rem .72rem; border-radius: 7px; border-left: 3px solid transparent; text-decoration: none; }
.sidebar nav a:is([aria-current="page"],:hover) { background: #25465e; border-left-color: #4ac0a8; color: white; }
.sidebar .account { margin-top: auto; padding-top: 1.1rem; border-top: 1px solid #355069; }
.account, .actions { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; }
.account span { overflow-wrap: anywhere; }
.page-header { background: #f9fbfd; border-bottom: 1px solid #d6e0e8; }
.page-heading, main { width: min(1060px, calc(100% - 40px)); margin-inline: auto; }
.page-heading { min-height: 66px; display: flex; align-items: center; gap: .75rem; }
main { margin-block: 1.2rem 3rem; }
h1 { font-size: clamp(1.45rem, 3vw, 1.85rem); margin: 0; }
.menu-toggle, .drawer-scrim { display: none; }
.login-brand { color: #155183; text-decoration: none; margin-right: .7rem; }
.tabs a { padding: .42rem .70rem; border-radius: 6px; text-decoration: none; }
h2 { font-size: 1.22rem; margin: 0 0 .6rem; }
h3 { font-size: 1rem; }
section { background: white; border: 1px solid #d6e0e8; border-radius: 10px; padding: 1rem; margin: 0 0 1rem; overflow-x: auto; }
.login { max-width: 420px; }
.form { display: grid; max-width: 620px; gap: .7rem; }
.form label:not(.check) { display: grid; gap: .25rem; }
.form button { justify-self: start; }
form { margin: 0; }
form + form { margin-top: .8rem; }
.actions form { margin-top: 0; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: #28465d; background: #f3f7fa; font-size: .91rem; }
th, td { border-bottom: 1px solid #dce5ec; padding: .55rem .65rem; overflow-wrap: anywhere; vertical-align: top; }
td.actions { vertical-align: middle; }
dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .5rem; }
dl div { border-radius: 7px; padding: .5rem; background: #edf5f9; }
dd { margin: 0; font-weight: bold; }
.notice { padding: .65rem; border: 1px solid #9cc9b3; border-radius: 7px; background: #eaf7ef; }
.preview-header { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.preview-header h2 { margin: 0; }
.badge { background: #dff0e9; color: #165540; padding: .25rem .65rem; border-radius: 1rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem; border-radius: 8px; background: #f1f6fa; font: .93rem/1.65 "Microsoft YaHei", system-ui, sans-serif; }
.tabs a[aria-current="page"] { background: #dbeaf4; }
.board { display: grid; grid-template-columns: repeat(5,minmax(154px,1fr)); gap: .65rem; overflow: auto; }
article { border-bottom: 1px solid #e1e8ed; padding: .5rem 0; }
article p { margin: .3rem 0; font-size: .88rem; }
.overview-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; }
.overview-columns > section { min-width: 0; margin: 0; padding: .95rem; }
.overview-columns h2 { font-size: 1.08rem; margin-bottom: .55rem; }
.overview-facts { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; margin: 0; }
.overview-facts div { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  background: transparent; border-radius: 0; border-top: 1px solid #edf2f6; padding: .35rem 0; font-size: .82rem; }
.overview-facts dt { color: #496175; }
.overview-facts dd { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 900px) {
  .overview-columns { grid-template-columns: minmax(0,1fr); gap: .6rem; }
}
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.metric-card { display: flex; flex-direction: column; justify-content: center; gap: .2rem; border: 1px solid #d6e0e8; border-radius: 12px; background: white; padding: .95rem 1rem; }
.metric-card span, .metric-card small { color: #496175; }
.metric-card span { font-size: .88rem; }
.metric-card strong { font-size: clamp(1.65rem, 3vw, 2.2rem); line-height: 1.2; font-variant-numeric: tabular-nums; }
.metric-card small { font-size: .75rem; }
.collection-heading { display: flex; justify-content: space-between; align-items: center; gap: .7rem; margin: 1.3rem 0 .65rem; }
.collection-heading h2 { margin: 0; }
.collection-heading span { font-size: .85rem; color: #496175; white-space: nowrap; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: .85rem; }
article.product-card { display: flex; flex-direction: column; padding: 0; background: white; border: 1px solid #d6e0e8; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 5px #112a4010; min-width: 0; }
.product-photo { position: relative; flex: none; width: 100%; aspect-ratio: 1; background: #fff; border-bottom: 1px solid #e2e9ef; }
.product-photo .amazon-thumb { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; padding: .85rem; }
.product-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .4rem; color: #496175; font-size: .85rem; }
.product-body { display: flex; flex-direction: column; flex: 1; padding: .75rem .9rem .9rem; }
.product-meta, .product-figures { display: flex; align-items: center; gap: .45rem .7rem; min-width: 0; font-variant-numeric: tabular-nums; }
.product-meta { font-size: .78rem; }
.product-meta span { background: #e5f4f0; color: #155650; border-radius: .35rem; padding: .08rem .35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; line-height: 1.3; margin: .52rem 0 .44rem; }
.product-figures { font-size: .84rem; flex-wrap: wrap; }
.product-price { color: #143d61; font-weight: bold; font-size: 1.12rem; }
.product-details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .36rem; margin: .68rem 0; }
.product-details div { display: grid; border-radius: 5px; background: #f1f5f8; padding: .28rem .42rem; font-size: .76rem; }
.product-details span { color: #496175; }
.product-details strong { font-size: .88rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.margin-value { color: #166457; }
.margin-pending { color: #4d6276; }
.amazon-link { margin-top: auto; align-self: flex-start; display: inline-flex; gap: .6rem; align-items: center; padding: .32rem .66rem; border: 1px solid #b9d0df; border-radius: 6px; color: #155183; font-size: .86rem; text-decoration: none; background: #f7fbff; }
.amazon-link:hover { background: #e6f0f7; }
.dashboard-data-heading { border-top: 1px solid #cddbe6; padding-top: 1rem; margin: 1.6rem 0 .72rem; }
@media (768px <= width <= 1080px) {
  .page-heading, main { width: calc(100% - 20px); }
  .product-grid { gap: .5rem; }
}
@media (max-width: 767px) {
  .workspace.with-sidebar { margin-left: 0; }
  .page-heading, main { width: calc(100% - 24px); }
  .page-heading { min-height: 54px; }
  .sidebar { visibility: hidden; transform: translateX(-100%); transition: transform .18s ease, visibility .18s; }
  .sidebar.is-open { transform: translateX(0); visibility: visible; }
  .menu-toggle { display: inline-flex; background: #112a40; align-items: center; justify-content: center; width: 40px; min-height: 38px; padding: .2rem; }
  .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 20; border: 0; border-radius: 0; background: #112a4070; }
  .metrics { gap: .38rem; }
  .metric-card { padding: .48rem .35rem; }
  .metric-card span { font-size: .72rem; }
  .metric-card strong { font-size: 1.29rem; }
  .metric-card small { font-size: .65rem; }
  .product-grid { grid-template-columns: minmax(0,1fr); }
  .board { grid-template-columns: repeat(5,180px); }
}

.product-table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.product-table { min-width: 900px; table-layout: fixed; font-variant-numeric: tabular-nums; }
.product-col-asin { width: 113px; }
.product-col-image { width: 64px; }
.product-col-date { width: 113px; }
.product-col-sales { width: 90px; }
.product-col-rating { width: 116px; }
.product-col-price { width: 83px; }
.product-col-margin { width: 85px; }
.product-col-stage { width: 75px; }
.product-table th, .product-table td { vertical-align: middle; white-space: nowrap; padding-inline: .45rem; }
.product-listing-date small { display: block; color: #496175; white-space: normal; }
.product-table th small { font-size: .69rem; font-weight: normal; color: #496175; }
.product-table th:nth-child(2), .product-table .product-thumb-cell { padding-inline: 4px; text-align: center; }
.product-table .product-thumb-cell { padding-block: 4px; }
.product-thumb { display: block; width: 56px; height: 56px; object-fit: contain; background: #fff; border: 1px solid #e2e9ef; border-radius: 5px; }
.product-table-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; overflow-wrap: anywhere; line-height: 1.32; }

/* 选品卡片阶段快捷操作。 */
.product-details > div { min-width: 0; align-content: start; }
.stage-cell .selection-stage-form { display: block; width: 100%; min-width: 0; margin: 0; }
.stage-cell select { box-sizing: border-box; display: block; width: 100%; max-width: 100%; min-width: 0; padding: .15rem .3rem; font-size: .78rem; min-height: 26px; }
@media (max-width: 340px) {
  .product-details { grid-template-columns: minmax(0,1fr); }
}
.product-card.is-rejected { border-color: #9aa7b1; background: #f0f2f4; }
.product-card.is-rejected .product-photo { filter: grayscale(1); opacity: .65; }
.rejected-label { font-size: .76rem; color: #566675; }

/* 销售额随评分、评论自然换行。 */
.product-figures { flex-wrap: wrap; }
.product-figures > span { max-width: 100%; overflow-wrap: anywhere; }

/* 材质确认仅影响独立材质卡片。 */
.material-confirmation { display: grid; gap: .3rem; margin: .5rem 0; }
.material-confirmation select { width: 100%; max-width: 100%; min-width: 0; }

/* 材质规则阻塞与模型留档分开呈现。 */
.material-blockers { margin: .6rem 0; }
.material-blockers ul { padding-left: 1.2rem; }
.material-blockers code { overflow-wrap: anywhere; }
.material-model-note { color: #496175; font-size: .84rem; }
.material-clear { color: #166457; font-weight: 600; }

.rule-result-summary { margin: .3rem 0 .8rem; color: #667085; font-size: .8rem; line-height: 1.5; overflow-wrap: anywhere; min-width: 0; }
.rule-result-summary a { color: inherit; margin-left: .5rem; }

/* 共享产品池：抢单、72 小时跟踪、阶段徽标 */
.workflow-badge { display: inline-block; align-self: start; margin: .18rem 0 .28rem; padding: .12rem .46rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: #e8eef5; color: #29445c; }
.workflow-pending { background: #eef2f6; color: #3b5368; }
.workflow-tracking { background: #fff4d6; color: #865d00; }
.workflow-confirmed { background: #e3f1ff; color: #165a9c; }
.workflow-sampled { background: #e8f6ec; color: #1f6b3a; }
.workflow-rejected { background: #eef0f2; color: #68737d; }
.stage-cell { align-content: start; gap: .18rem; }
.stage-cell form { margin: .1rem 0 0; }
.stage-cell .workflow-owner { color: #52687b; font-size: .72rem; overflow-wrap: anywhere; }
.button-small { padding: .26rem .58rem; font-size: .74rem; border-radius: 5px; border: 1px solid #1b5f91; background: #1b5f91; color: #fff; cursor: pointer; }
.button-small.secondary { background: #f4f8fb; color: #1b5f91; }
.button-small:hover { filter: brightness(.96); }
.inline-form { display: inline-block; margin-right: .4rem; }

/* 试跑审核卡片共用证据路由，不直接访问本地路径。 */
.pilot-review-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:16px;align-items:start;}
.pilot-review-card {background:white;border:1px solid #d5e0ea;border-radius:10px;padding:18px;min-width:0;overflow-wrap:anywhere;}
.pilot-review-thumb {display:block;width:100%;height:240px;object-fit:contain;background:#f4f7fa;}
.pilot-review-card dl {grid-template-columns:repeat(2,minmax(0,1fr));}
.pilot-review-card input[type=checkbox] {width:auto;display:inline-block;margin-right:6px;}
.pilot-review-card .form {max-width:none;}

#approve-pilot:disabled {background:#d5dde5;color:#536473;cursor:not-allowed;opacity:.8;}
.pilot-review-card .form .pilot-check-toggle {display:flex;align-items:center;gap:8px;}
.pilot-review-card .form .pilot-check-toggle input {margin:0;flex:0 0 auto;}

/* 管理员更改仅在有明确override事件时显示；普通用户不获得额外写权限。 */
.admin-change {border-left:3px solid #b87d21;padding:.4rem .6rem;background:#fff8e7;overflow-wrap:anywhere;}
.admin-change>summary {cursor:pointer;color:#795413;}
.admin-change-values {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem;}
.admin-change pre {white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;font-size:.75rem;}
.admin-workflow-controls {margin-top:.7rem;font-size:.8rem;}
.admin-workflow-controls .form {max-width:100%;}
@media(max-width:600px){.admin-change-values{grid-template-columns:minmax(0,1fr);}}
