:root {
  font-family: "Microsoft YaHei", Arial, sans-serif;
  color: #17212b;
  background: #f3f5f7;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f3f5f7; }
button, input, select, textarea { border: 1px solid #cbd3dc; border-radius: 5px; background: #fff; color: inherit; font: inherit; letter-spacing: 0; }
button, select, input { min-height: 38px; }
button { padding: 0 13px; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:hover:not(:disabled) { border-color: #168168; }
button.primary { border-color: #08755e; background: #08755e; color: #fff; }
button.accent { border-color: #4a60d8; background: #4a60d8; color: #fff; }
button.danger { border-color: #d9b1b1; color: #a93131; }
a { color: inherit; }

.loginView { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: #e8edf1; }
.loginPanel { width: min(420px, 100%); padding: 34px; border: 1px solid #d2d9df; background: #fff; box-shadow: 0 18px 55px #17212b1c; }
.loginPanel h1 { margin: 4px 0 8px; font-size: 27px; }
.loginPanel p { color: #657382; line-height: 1.6; }
.loginPanel .eyebrow { margin: 0; color: #08755e; font-size: 12px; font-weight: 800; }
.loginPanel label { display: grid; gap: 6px; margin: 16px 0; font-size: 13px; font-weight: 700; }
.loginPanel input { width: 100%; padding: 0 11px; }
.loginPanel .primary { width: 100%; }
.formMessage { min-height: 20px; margin-top: 10px; color: #08755e; font-size: 12px; }
.formMessage.error, .error { color: #ae3434; }

.appShell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; background: #0b2934; color: #dcebf0; }
.brand { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 20px; border-bottom: 1px solid #ffffff1a; font-size: 17px; }
.brandMark { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 5px; background: #fff; color: #0b6655; font-size: 11px; font-weight: 900; }
.sidebar nav { display: grid; gap: 4px; padding: 16px 10px; }
.sidebar nav a { padding: 12px 14px; border-radius: 5px; color: #c7d9df; text-decoration: none; }
.sidebar nav a:hover, .sidebar nav a.active { background: #0f806b; color: #fff; }
.sidebarFoot { margin-top: auto; padding: 18px 20px; color: #86a5af; font-size: 11px; }
.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 12; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 26px; border-bottom: 1px solid #d9dfe5; background: #fff; }
.topbar > div { display: flex; align-items: center; gap: 12px; }.topbar > div strong { font-size: 19px; }.topbar > div span { color: #778392; font-size: 12px; }
.topbar nav { display: flex; align-items: center; gap: 8px; }.topbar nav > span { margin-right: 8px; color: #53616e; font-size: 12px; }
main { max-width: 1580px; margin: 0 auto; padding: 22px 24px 90px; }

.bridgePanel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; margin-bottom: 14px; padding: 11px 13px; border: 1px solid #d9dfe5; border-radius: 6px; background: #fff; }
.bridgePanel > div { min-width: 0; }
.bridgePanel strong, .bridgePanel span { display: block; }
.bridgePanel strong { font-size: 13px; }
.bridgePanel > div span { margin-top: 3px; color: #687583; font-size: 11px; overflow-wrap: anywhere; }
.bridgeIndicator { width: 10px; height: 10px; border-radius: 50%; background: #98a3ad; box-shadow: 0 0 0 4px #98a3ad24; }
.bridgeIndicator.online { background: #08755e; box-shadow: 0 0 0 4px #08755e24; }
.bridgeIndicator.offline { background: #c47a23; box-shadow: 0 0 0 4px #c47a2324; }

.filterPanel, .sectionBand { border: 1px solid #d9dfe5; border-radius: 6px; background: #fff; }
.filterPanel { padding: 18px; }
.filterGrid { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); gap: 16px; }
.filterGrid label, .filterGrid fieldset { min-width: 0; margin: 0; padding: 0; border: 0; color: #52606d; font-size: 12px; font-weight: 700; }
.filterGrid label { display: grid; gap: 7px; }
.filterGrid input { width: 100%; padding: 0 10px; font-weight: 400; }
.filterGrid fieldset { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 7px; }
.filterGrid legend { grid-column: 1 / -1; margin-bottom: 7px; }
.filterGrid fieldset span { align-self: center; padding-top: 20px; color: #8b96a2; }
.actionBar { display: flex; align-items: center; gap: 9px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #edf0f2; }
.actionBar select { padding: 0 9px; }.barSpacer { flex: 1; }

.statusTabs { display: flex; gap: 10px; margin: 18px 0 12px; padding: 12px; overflow-x: auto; border: 1px solid #dce2e7; border-radius: 6px; background: #fff; }
.statusTabs button { min-width: 126px; border-color: transparent; background: #f3f5f7; font-weight: 700; white-space: nowrap; }
.statusTabs button span { display: inline-grid; min-width: 24px; height: 22px; margin-left: 6px; place-items: center; border-radius: 11px; background: #dfe5ea; font-size: 11px; }
.statusTabs button.active { border-color: #4a60d8; background: #eef0ff; color: #3348bd; }
.statusTabs button.active span { background: #4a60d8; color: #fff; }
.listHeader { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; color: #687583; font-size: 12px; }
.listHeader nav { display: flex; align-items: center; gap: 8px; }.listHeader strong { min-width: 56px; text-align: center; }

.productList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.productCard { display: grid; grid-template-columns: 156px minmax(0, 1fr); min-width: 0; overflow: hidden; border: 1px solid #d5dce3; border-radius: 6px; background: #fff; }
.productCard.isSelected { outline: 2px solid #4a60d8; outline-offset: -2px; }
.productCard.isNegative { border-color: #e4bbbb; }
.cardRail { padding: 14px; border-right: 1px solid #e2e6ea; background: #f8fafb; }
.imageWrap { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid #dfe4e8; border-radius: 5px; background: #eef1f3; }
.imageWrap img { width: 100%; height: 100%; object-fit: cover; }.imageWrap input { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; accent-color: #4a60d8; }
.railActions { display: grid; gap: 7px; margin-top: 10px; }.railActions button { width: 100%; min-height: 34px; font-size: 12px; }
.railActions button.active[data-status="favorite"] { border-color: #e7a53d; background: #fff5df; color: #9b6511; }
.railActions button.active[data-status="blacklist"] { border-color: #db6c6c; background: #fff0f0; color: #a52f2f; }
.railActions button.active[data-status="no_profit"] { border-color: #74869a; background: #edf1f5; color: #405366; }
.cardBody { min-width: 0; padding: 14px; }
.cardTitleRow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.cardTitleRow h3 { margin: 0; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }.cardTitleRow a { color: #1d68b3; text-decoration: none; }
.iconButton { width: 34px; min-height: 34px; padding: 0; font-size: 17px; }
.metaLine { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.pill, .tag { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 4px; background: #edf1f4; color: #4c5b69; font-size: 11px; }
.pill.blue { background: #e8f3ff; color: #1e66a8; }.tag.good { background: #ddf3ea; color: #08755e; }.tag.bad { background: #fde7e7; color: #a93030; }
.pipelineFlow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.pipelineStage { min-width: 0; padding: 7px 8px; border: 1px solid #dfe4e8; border-top-width: 3px; border-radius: 5px; background: #f8f9fa; }
.pipelineStage span, .pipelineStage strong, .pipelineStage small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipelineStage span { color: #74808c; font-size: 9px; }
.pipelineStage strong { margin-top: 3px; font-size: 11px; }
.pipelineStage small { margin-top: 3px; color: #a93030; font-size: 9px; }
.pipelineStage.success, .pipelineStage.ready, .pipelineStage.published { border-top-color: #08755e; background: #f3faf7; }
.pipelineStage.running { border-top-color: #316dc2; background: #f2f7fd; }
.pipelineStage.partial, .pipelineStage.action_required, .pipelineStage.draft { border-top-color: #c47a23; background: #fff8ef; }
.pipelineStage.failed, .pipelineStage.rejected { border-top-color: #b73737; background: #fff5f5; }
.pipelineStage.pending, .pipelineStage.blocked { border-top-color: #98a3ad; }
.comparison { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; margin-top: 12px; padding: 10px; border: 1px solid #e4e1d7; border-radius: 5px; background: #fffdf8; }
.comparison > div { min-width: 0; }.comparison strong, .comparison span { display: block; }.comparison strong { margin-bottom: 5px; font-size: 12px; }.comparison span { color: #667380; font-size: 11px; }
.compareArrow { align-self: center; color: #a36a19; font-weight: 800; }
.metricGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 11px; overflow: hidden; border: 1px solid #e1e5e9; border-radius: 5px; background: #e1e5e9; }
.metric { min-width: 0; padding: 9px; background: #f8f9fa; }.metric span, .metric strong { display: block; }.metric span { color: #73808d; font-size: 10px; }.metric strong { margin-top: 4px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.profitEditor { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-top: 11px; }
.profitEditor label { display: grid; gap: 4px; color: #6b7784; font-size: 10px; }.profitEditor input { width: 100%; min-width: 0; min-height: 34px; padding: 0 7px; font-size: 12px; }
.profitResult { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 8px; }
.profitResult div { padding: 8px; border: 1px solid #dfe4e8; border-radius: 5px; }.profitResult span, .profitResult strong { display: block; }.profitResult span { color: #77838f; font-size: 10px; }.profitResult strong { margin-top: 3px; font-size: 13px; }.profitResult .positive strong { color: #08755e; }.profitResult .negative strong { color: #b23434; }
.cardActions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }.cardActions button { min-height: 34px; font-size: 11px; }
.sourceList { display: grid; gap: 6px; margin-top: 10px; }.sourceItem { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid #e1e5e9; border-radius: 5px; font-size: 11px; }.sourceItem b { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 12px; background: #f0d26c; }.sourceItem a { overflow: hidden; color: #24659c; text-overflow: ellipsis; white-space: nowrap; }.sourceItem span { color: #6b7784; }
.remarkInput { width: 100%; min-height: 36px; margin-top: 9px; padding: 8px; resize: vertical; }
.emptyState { padding: 70px 20px; border: 1px dashed #cbd3da; border-radius: 6px; background: #fff; color: #73808c; text-align: center; }

.sectionBand { margin-top: 18px; padding: 17px; scroll-margin-top: 80px; }
.sectionTitle { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }.sectionTitle h2 { margin: 0; font-size: 16px; }.sectionTitle span { color: #75818d; font-size: 11px; }
.task { display: grid; grid-template-columns: 100px 170px 130px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid #edf0f2; font-size: 12px; }
.userForm { display: grid; grid-template-columns: minmax(160px, 240px) minmax(180px, 260px) 130px; gap: 10px; align-items: end; }.userForm label { display: grid; gap: 5px; color: #5c6979; font-size: 12px; }.userForm input { padding: 0 10px; }.userList { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.selectionBar { position: fixed; z-index: 20; right: 28px; bottom: 20px; left: 248px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid #ccd3da; border-radius: 6px; background: #17212bf2; color: #fff; box-shadow: 0 10px 30px #17212b33; }.selectionBar strong { margin-right: auto; }.selectionBar button { border-color: #4d5a66; background: #26333e; color: #fff; }

dialog { width: min(620px, calc(100% - 30px)); padding: 0; border: 1px solid #ccd4db; border-radius: 6px; box-shadow: 0 24px 80px #17212b42; }dialog::backdrop { background: #17212b80; }
.dialogForm header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #e1e5e8; }.dialogForm header span { color: #08755e; font-size: 10px; font-weight: 800; }.dialogForm h2 { margin: 3px 0 0; font-size: 18px; }.dialogForm header button { width: 34px; padding: 0; border: 0; font-size: 23px; }
.dialogGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 18px; }.dialogGrid label { display: grid; gap: 6px; color: #53616e; font-size: 12px; font-weight: 700; }.dialogGrid .full { grid-column: 1 / -1; }.dialogGrid input, .dialogGrid textarea { width: 100%; padding: 9px 10px; font-weight: 400; }
.dialogForm footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid #e1e5e8; }.dialogForm.wide { min-width: 0; }.notice { margin: 0 18px 16px; padding: 10px; border-left: 3px solid #d8a13a; background: #fff8e8; color: #72541c; font-size: 11px; line-height: 1.5; }
.toast { position: fixed; z-index: 40; top: 20px; left: 50%; max-width: min(520px, calc(100% - 30px)); padding: 11px 16px; transform: translateX(-50%); border-radius: 5px; background: #17212b; color: #fff; box-shadow: 0 8px 25px #17212b40; font-size: 12px; }

@media (max-width: 1180px) {
  .appShell { grid-template-columns: 76px minmax(0, 1fr); }.brand { justify-content: center; padding: 0; }.brand strong, .sidebarFoot { display: none; }.sidebar nav a { padding: 12px 8px; text-align: center; font-size: 11px; }.selectionBar { left: 104px; }
  .filterGrid { grid-template-columns: 1fr 1fr; }.productList { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .appShell { display: block; }.sidebar { position: static; display: block; height: auto; }.brand { height: 54px; }.brand strong { display: block; }.sidebar nav { display: flex; padding: 7px; overflow-x: auto; }.sidebar nav a { flex: 1 0 100px; }
  .topbar { position: static; align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px 14px; }.topbar nav { width: 100%; }.topbar nav > span { margin-right: auto; }
  main { padding: 12px 10px 100px; }.filterPanel { padding: 12px; }.filterGrid { grid-template-columns: 1fr; }.actionBar { align-items: stretch; flex-direction: column; }.barSpacer { display: none; }.actionBar button, .actionBar select { width: 100%; }
  .bridgePanel { grid-template-columns: auto minmax(0, 1fr); }.bridgePanel button { grid-column: 1 / -1; width: 100%; }
  .statusTabs { padding: 8px; }.statusTabs button { min-width: 112px; }.productCard { grid-template-columns: 112px minmax(0, 1fr); }.cardRail { padding: 9px; }.cardBody { padding: 10px; }.pipelineFlow { grid-template-columns: 1fr 1fr; }.comparison { grid-template-columns: 1fr; }.compareArrow { display: none; }.metricGrid { grid-template-columns: 1fr 1fr; }.profitEditor { grid-template-columns: 1fr 1fr; }.profitResult { grid-template-columns: 1fr; }
  .task { grid-template-columns: 1fr 1fr; }.userForm { grid-template-columns: 1fr; }.selectionBar { right: 10px; bottom: 10px; left: 10px; flex-wrap: wrap; }.selectionBar strong { width: 100%; }.dialogGrid { grid-template-columns: 1fr; }.dialogGrid .full { grid-column: auto; }
}
