/* CRM-L01：全站排版收口。只调整布局、字号、行距与溢出，不改变业务功能。 */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body:not(.loginMode) .main{font-size:15px;line-height:1.6}
.main,#appPanel,#dashboardPanel,#dataPanel,.specialPanel,.card,.tableWrap{min-width:0}
.main :where(h2,h3,h4,p,small,dd),.specialPanel :where(span,b,strong,em){overflow-wrap:anywhere}
.main :where(h2,h3,h4){line-height:1.35}
.main :where(p,.muted,small,dd){line-height:1.6}
.topbar,.cardHead,.inventorySummaryHead,.peoplePanelHead,.supplierHead,.pricingHealthHead,.costHistoryHead,.staffSectionHead{min-width:0}
.topbar>*,.cardHead>*,.inventorySummaryHead>*,.peoplePanelHead>*,.supplierHead>*,.pricingHealthHead>*,.costHistoryHead>*,.staffSectionHead>*{min-width:0}
.actions,.cardActions,.filters,.dashboardFilterControls,.pricingStats{min-width:0;flex-wrap:wrap}
.actions button,.cardActions button{max-width:100%}

/* 登录页：以整个浏览器窗口为基准居中，不再被隐藏侧栏或页面高度带偏。 */
body.loginMode{display:grid;grid-template-columns:minmax(0,1fr);height:100vh;height:100dvh;min-height:0;overflow:hidden}
body.loginMode .sidebar{display:none!important}
body.loginMode .main{position:fixed;inset:0;display:grid;place-items:center;width:100%;min-width:0;height:100vh;height:100dvh;min-height:0;padding:clamp(20px,5vw,64px);overflow:auto;overscroll-behavior:contain}
body.loginMode .login-card{align-self:center;justify-self:center;box-sizing:border-box;width:min(100%,470px);max-width:470px;margin:0;padding:clamp(24px,4vw,34px)}
.login-card h2{margin:0 0 8px;font-size:clamp(24px,3vw,29px);line-height:1.25}
.login-card>p{margin:0;line-height:1.7}
.login-card .grid2{grid-template-columns:minmax(0,1fr);gap:12px;margin:20px 0 12px}
.login-card input,.login-card>button{width:100%;min-height:48px}
.login-card>button{margin:0;font-size:15px}
.login-card #loginMsg{min-height:20px;margin-top:10px}

/* 经营看板：所有一级板块各占一整行，内部再按内容分栏。 */
#dashboardPanel.dashboard{grid-template-columns:minmax(0,1fr);align-items:start;gap:14px}
#dashboardPanel.dashboard>*{width:100%;min-width:0;margin-bottom:0;grid-column:1/-1}
#dashboardPanel.dashboard>.card{align-self:start}
#dashboardPanel.dashboard>.card>h3{margin:0 0 8px;font-size:20px}
#dashboardPanel.dashboard>.card>p.muted{margin:0 0 12px;font-size:13px;line-height:1.65}
.dashboardFilter{align-items:flex-start}
.dashboardFilter>div:first-child{flex:1 1 300px}
.dashboardFilterControls{flex:2 1 650px;justify-content:flex-end}
.dashboardFilterControls select,.dashboardFilterControls input{width:auto;min-width:150px;flex:0 1 180px}
.dashboardFilterControls button{flex:0 0 auto}
.dashboardMetricGrid{grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch}
.dashboardMetricGrid .metric{display:flex;min-height:138px;min-width:0;flex-direction:column}
.dashboardMetricGrid .metric span{line-height:1.45}
.dashboardMetricGrid .metric b{font-size:clamp(26px,2.2vw,32px);line-height:1.15;overflow-wrap:anywhere}
.dashboardMetricGrid .metric small{margin-top:auto;line-height:1.5}
.dashboardOperationsCard,.pnlCard{width:100%}
.dashboardOperationsCard .inventorySummaryHead{margin-bottom:12px}
.dashboardOperationsCard .pricingStats{justify-content:flex-start;margin-bottom:12px}
.dashboardOperationsCard .financeGrid{grid-template-columns:minmax(0,1fr);gap:10px;align-items:start}
.dashboardOperationsCard .statusBox{width:100%;min-width:0;margin:0}
.dashboardOperationsCard .statusBox>.mini{margin:10px 0 0}
.dashboardOperationsCard .dashboardReminderLink{border-radius:999px;padding:7px 10px;background:#fff;color:var(--ink);border:1px solid var(--line);font-size:13px;font-weight:800;box-shadow:none}
.dashboardOperationsCard .dashboardReminderLink:hover,.dashboardOperationsCard .dashboardReminderLink:focus-visible{transform:translateY(-1px);box-shadow:0 5px 14px rgba(56,42,31,.12);outline:2px solid rgba(139,103,79,.2)}
.dashboardOperationsCard .dashboardDrillRow{width:100%;color:var(--ink);text-align:left;font:inherit;box-shadow:none}
.dashboardOperationsCard .dashboardDrillRow:hover,.dashboardOperationsCard .dashboardDrillRow:focus-visible{border-color:#b99478;background:#fffaf4;transform:translateY(-1px);outline:none}
.dashboardOperationsCard .listLine,#dashboardPanel.dashboard>.card>.listLine{display:grid;grid-template-columns:minmax(220px,1fr) minmax(280px,1.5fr) max-content;align-items:start;gap:10px}
.dashboardOperationsCard .listLine b,#dashboardPanel.dashboard>.card>.listLine b,
.dashboardOperationsCard .listLine span,#dashboardPanel.dashboard>.card>.listLine span{min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.55}
.dashboardOperationsCard .listLine em,#dashboardPanel.dashboard>.card>.listLine em{align-self:start;white-space:nowrap}
.pnlRows>div{min-width:0;align-items:center;line-height:1.55}
.pnlRows span{min-width:0;white-space:normal}
.pnlRows b{flex:none;white-space:nowrap}

/* 其它 CRM 板块：卡片和栅格统一从顶部对齐，长标题、日期、状态不再相互挤压。 */
:where(.taskEntryGrid,.financeStatementGrid,.supplierOverviewGrid,.dataSettingGrid,.dataTemplateGrid,.dataSafetyGrid,.peopleMetrics,.peopleModuleGrid,.peopleMainGrid,.payrollMetrics,.shootingMetrics,.marketRecordMetrics,.marketRecordGrid,.readinessGrid)>*{min-width:0}
:where(.taskEntryGrid,.financeStatementGrid,.supplierOverviewGrid,.dataSettingGrid,.dataTemplateGrid,.dataSafetyGrid,.peopleMetrics,.peopleModuleGrid,.peopleMainGrid,.payrollMetrics,.shootingMetrics,.marketRecordMetrics,.marketRecordGrid,.readinessGrid){align-items:start}
:where(.taskEntryCard,.financeStatementCard,.dataSettingCard,.peopleModuleCard,.peopleRoleCard,.payrollRoleCard,.staffWorkCard,.staffSopCard,.marketRecordCard,.shootingExecutionCard,.readinessStep){min-width:0}
:where(.taskEntryCard,.financeStatementCard,.dataSettingCard,.peopleModuleCard,.peopleRoleCard,.payrollRoleCard,.staffWorkCard,.staffSopCard,.marketRecordCard,.shootingExecutionCard,.readinessStep) :where(h3,h4,p,span,small,b){white-space:normal;overflow-wrap:anywhere}
.taskDetailSheet{grid-column:1/-1;width:100%;min-width:0}
.taskDetailGrid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.taskDetailGrid section,.taskDetailGrid p{min-width:0;overflow-wrap:anywhere;word-break:break-word}
.assignedTaskDetailSheet{display:grid;gap:14px}
.assignedTaskDetailSheet .taskDetailHead{margin-bottom:0}
.assignedTaskReadOnly{display:flex;align-items:flex-start;gap:12px;padding:12px 15px;border:1px solid #dcc4a9;border-left:5px solid #b67a42;border-radius:13px;background:#fff8ee}
.assignedTaskReadOnly b{flex:0 0 auto;color:#8a582e}
.assignedTaskReadOnly span{color:#6f5e51;line-height:1.65}
#dataPanel[data-detail-only="true"]{padding:0;border:0;background:transparent;box-shadow:none}
#dataPanel[data-detail-only="true"]>:not(#formPanel){display:none!important}
#dataPanel[data-detail-only="true"] #formPanel{margin:0;width:100%}
.reviewAction{background:#fff4d8!important;color:#8c6200!important;border:1px solid #ead08a!important}
.taskTimelinePanel{margin:14px;padding:15px;border:1px solid var(--line);border-radius:15px;background:#fff}
.taskTimelineHead{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.taskTimelineHead b,.taskTimelineHead span{display:block}.taskTimelineHead b{color:var(--brown);font-size:16px}.taskTimelineHead span{margin-top:4px;color:var(--muted);font-size:12px;line-height:1.5}
.taskTimelineList{display:grid;gap:0;margin-top:12px}.taskTimelineList article{position:relative;display:grid;grid-template-columns:18px minmax(0,1fr);gap:8px;padding:0 0 14px}.taskTimelineList article:not(:last-child):before{content:"";position:absolute;left:6px;top:13px;bottom:0;width:2px;background:#eadfd5}
.taskTimelineDot{position:relative;z-index:1;width:12px;height:12px;margin-top:4px;border-radius:50%;background:var(--brown);box-shadow:0 0 0 4px #f6ede4}.taskTimelineList article b{font-size:14px}.taskTimelineList article p{margin:4px 0;color:var(--muted);font-size:12px;line-height:1.45}.taskTimelineList article small{display:block;padding:8px 10px;border-radius:10px;background:#fff8ee;color:#5d5148;line-height:1.55;white-space:pre-wrap}
.shootingExecutionTitle,.shootingExecutionTitle>div,.shootingExecutionPanel{min-width:0}
.shootingExecutionTitle h3,.shootingExecutionTitle p{white-space:normal;overflow-wrap:anywhere}
.shootingExecutionHeadActions{flex-wrap:wrap;justify-content:flex-end}
.taskMetricStats{align-items:center}
.pricingStats .taskMetricLink{min-height:34px;padding:7px 11px;border:1px solid var(--line);border-radius:999px;color:var(--ink);background:#fff;font-size:13px;font-weight:800;line-height:1.35;box-shadow:none}
.pricingStats .taskMetricLink:hover,.pricingStats .taskMetricLink:focus-visible{border-color:#9a7963;background:#f7eee7;transform:translateY(-1px)}
.pricingStats .taskMetricLink.activePill{border-color:var(--brown);color:#fff;background:var(--brown)}
.pricingStats .taskMetricLink.lowMargin.activePill{color:#fff!important;background:#b64743!important;border-color:#b64743!important}
.bulkSelectToggle{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:0 10px;border:1px solid var(--line);border-radius:10px;color:var(--ink);background:#fff;font-size:12px;font-weight:800;white-space:nowrap;cursor:pointer}
.bulkSelectToggle input,.taskBulkCheck input,.shootingBulkCheck input{width:16px!important;min-width:16px!important;height:16px!important;min-height:16px!important;margin:0;padding:0;accent-color:var(--brown)}
.taskFocusToolbar>div:last-child{align-items:center}
.taskFocusToolbar .bulkSelectToggle span{color:inherit;font-size:12px}
.taskCardHeading{display:flex;align-items:flex-start;gap:8px;min-width:0}
.taskCardHeading>b{min-width:0;overflow-wrap:anywhere}
.taskBulkCheck{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto;padding:3px 6px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--muted);font-size:11px;line-height:1.2;cursor:pointer}
.taskBulkCheck span{white-space:nowrap}
button:disabled{cursor:not-allowed;opacity:.5;transform:none!important}
.procurementHero>*,.procurementMetrics article,.procurementToolbar>*{min-width:0}
:where(.pricingHero,.supplyHero,.peopleHero,.payrollHero,.staffWorkbenchHero,.marketRecordHero,.dataSettingsHero,.purchaseReconHero,.procurementHero)>*{min-width:0}
:where(.financeStatementHead,.staffWorkCardHead,.marketRecordCard>header,.supplierOverviewCard>header,.dataPanelTitle)>*{min-width:0}
:where(.main,.specialPanel) :where(h2,h3,h4){text-wrap:balance;word-break:normal}
:where(.staffWorkCardHead,.marketRecordCard>header,.supplierOverviewCard>header) :where(em,.tag,.staffTag){flex:0 0 auto;writing-mode:horizontal-tb;white-space:nowrap}

@media(max-width:1280px){
  .topbar,.cardHead,.inventorySummaryHead,.peoplePanelHead,.supplierHead{align-items:flex-start;flex-wrap:wrap}
  .dashboardMetricGrid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .dashboardOperationsCard .listLine,#dashboardPanel.dashboard>.card>.listLine{grid-template-columns:minmax(190px,1fr) minmax(230px,1.35fr) max-content}
  .peopleMetrics,.peopleModuleGrid,.dataTemplateGrid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:1100px){
  :where(.financeStatementGrid,.supplierOverviewGrid,.dataSettingGrid,.marketRecordGrid){grid-template-columns:minmax(0,1fr)!important}
  :where(.pricingHero,.supplyHero,.staffWorkbenchHero,.marketRecordHero,.dataSettingsHero,.purchaseReconHero){flex-direction:column;align-items:stretch}
  :where(.pricingStats,.marketRecordActions){justify-content:flex-start}
}
@media(max-width:900px){
  .dashboardMetricGrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboardOperationsCard .listLine,#dashboardPanel.dashboard>.card>.listLine{grid-template-columns:minmax(0,1fr) auto}
  .dashboardOperationsCard .listLine span,#dashboardPanel.dashboard>.card>.listLine span{grid-column:1/-1}
  .dashboardOperationsCard .listLine em,#dashboardPanel.dashboard>.card>.listLine em{grid-column:2;grid-row:1;justify-self:end}
  .dashboardFilter{flex-direction:column;align-items:stretch}
  .dashboardFilter>div:first-child,.dashboardFilterControls{flex:0 1 auto}
  .dashboardFilterControls{width:100%;justify-content:flex-start}
  .dashboardFilterControls select,.dashboardFilterControls input{flex:1 1 180px;min-width:0}
  :where(.staffWorkCardHead,.marketRecordCard>header,.supplierOverviewCard>header,.financeStatementHead){flex-wrap:wrap;align-items:flex-start}
}
@media(max-width:760px){
  body.loginMode .main{padding:18px}
  body.loginMode .login-card{padding:24px 20px;border-radius:16px}
  body:not(.loginMode) .main{font-size:14px;line-height:1.6}
  .main{padding:14px}
  .card{padding:15px}
  .topbar,.cardHead,.inventorySummaryHead,.peoplePanelHead,.supplierHead,.pricingHealthHead,.costHistoryHead,.staffSectionHead{flex-direction:column;align-items:stretch}
  .topbar .actions,.cardHead .actions,.inventorySummaryHead .cardActions{width:100%}
  .topbar .actions button,.cardHead .actions button,.inventorySummaryHead .cardActions button{flex:1 1 140px}
  .dashboardFilterControls select,.dashboardFilterControls input,.dashboardFilterControls button{width:100%;min-width:0;min-height:44px;flex:0 0 auto}
  .dashboardMetricGrid,.peopleMetrics,.peopleModuleGrid,.dataTemplateGrid{grid-template-columns:minmax(0,1fr)!important}
  .dashboardMetricGrid .metric{min-height:auto}
  .dashboardOperationsCard .listLine,#dashboardPanel.dashboard>.card>.listLine{grid-template-columns:minmax(0,1fr)}
  .dashboardOperationsCard .listLine span,.dashboardOperationsCard .listLine em,#dashboardPanel.dashboard>.card>.listLine span,#dashboardPanel.dashboard>.card>.listLine em{grid-column:auto;grid-row:auto;justify-self:start}
  .pnlRows>div{align-items:flex-start;flex-direction:column;gap:4px}
  .taskDetailGrid{grid-template-columns:minmax(0,1fr)}
  .taskTimelinePanel{margin:10px;padding:12px}.taskTimelineHead{flex-direction:column}.taskTimelineHead button{width:100%}
  .shootingExecutionHeadActions{width:100%;justify-content:flex-start}
  .taskFocusToolbar>div:last-child{align-items:stretch}
  .taskFocusToolbar .bulkSelectToggle{justify-content:center;flex:1 1 150px}
  .taskMetricStats{width:100%;justify-content:flex-start}
}

/* CRM-PORTION-02C：菜品成本列与成本追溯面板排版收口，仅调整显示，不改变计算和数据。 */
.menuPricingTable table{min-width:1600px!important}
.menuPricingTable th:nth-child(4){width:230px!important}
.menuPricingTable th:nth-child(5),
.menuPricingTable th:nth-child(6),
.menuPricingTable th:nth-child(7){width:88px!important}
.menuPricingTable th:nth-child(8){width:140px!important}
.menuPricingTable th:nth-child(9){width:150px!important}
.menuPricingTable th:nth-child(10){width:226px!important}
.menuPricingTable td:nth-child(4){white-space:normal!important}
.menuPricingTable td:nth-child(5),
.menuPricingTable td:nth-child(6),
.menuPricingTable td:nth-child(7){white-space:nowrap!important}
.menuCostCompare{display:grid;grid-template-columns:minmax(0,1fr);justify-items:start;gap:7px;min-width:0}
.menuCostCompare>span{display:block;min-width:0;font-weight:800;line-height:1.35}
.menuCostCompare>small{display:block;max-width:100%;margin:0!important;line-height:1.45!important}
.menuCostCompare .recipePreviewStatus{margin:0}
.menuCostCompare .completeAction{max-width:100%;margin:1px 0 0!important}
#formPanel>.costHistorySheet{grid-column:1/-1;width:100%;min-width:0}
.costHistoryHead>div{flex:1 1 auto;min-width:0}
.costHistoryHead>.ghost{flex:0 0 auto;align-self:flex-start}
.costHistoryList{grid-template-columns:minmax(0,1fr)}
.costHistoryItem>div:first-child{flex:1 1 auto;min-width:0}
.costHistoryDiff{justify-content:flex-end}

@media(max-width:900px){
  .costHistoryItem{align-items:flex-start;flex-direction:column}
  .costHistoryDiff{justify-content:flex-start;flex-wrap:wrap}
}

@media(max-width:760px){
  .menuPricingTable table{min-width:1520px!important}
  .costHistoryHead>.ghost{width:100%;margin-top:10px}
}

/* WEB-FILING-02：网站首页同时悬挂 ICP 与公安备案信息。 */
.siteFiling{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:7px;
  min-width:0;
  padding:14px 12px 4px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
  text-align:center;
}
.siteFilingLink{display:inline-flex;align-items:center;gap:5px;min-width:0;color:inherit;text-decoration:none}
.siteFilingLink:hover,.siteFilingLink:focus-visible{color:var(--brown);text-decoration:underline}
.sitePoliceFiling img{display:block;flex:0 0 20px;width:20px;height:20px}
.siteFilingDivider{color:var(--line)}
body.loginMode .siteFiling{position:fixed;right:12px;bottom:8px;left:12px;z-index:3;padding:0}

@media(max-width:760px){
  .siteFiling{padding-bottom:86px}
  body.loginMode .siteFiling{bottom:8px;padding:0}
  .siteFilingDivider{display:none}
}

/* CRM-TASK-MULTI-01：任务多人分发保持与现有CRM卡片一致，不使用拥挤宽表。 */
.taskAssignmentSheet{
  grid-column:1/-1;
  width:min(100%,960px);
  min-width:0;
  box-sizing:border-box;
  margin:0 auto;
  padding:24px;
  border:1px solid var(--line);
  border-radius:22px;
  background:#fffdfa;
  box-shadow:0 18px 45px rgba(58,42,31,.08);
}
.taskAssignmentSheet>header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding-bottom:18px;
  border-bottom:1px solid var(--line);
}
.taskAssignmentSheet>header span{
  color:var(--brown);
  font-size:13px;
  font-weight:800;
  letter-spacing:.08em;
}
.taskAssignmentSheet>header h3{margin:5px 0 7px;font-size:25px}
.taskAssignmentSheet>header p{margin:0;color:var(--muted);line-height:1.7}
.taskAssignmentGrid{display:grid;grid-template-columns:minmax(250px,.8fr) minmax(0,1.2fr);gap:18px;min-width:0;padding:20px 0}
.taskAssignmentGrid>label,.taskAssignmentGrid>section{
  min-width:0;
  padding:18px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fbf8f3;
}
.taskAssignmentGrid b{display:block;margin-bottom:8px}
.taskAssignmentGrid small{display:block;color:var(--muted);line-height:1.55}
.taskOwnerSelect select{width:100%;margin:5px 0 10px}
.taskAssigneeOptions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-width:0;margin-top:12px}
.taskAssigneeOption{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  cursor:pointer;
}
.taskAssigneeOption:has(input:checked){border-color:#9a7158;background:#f8eee5}
.taskAssigneeOption input{width:18px;height:18px;flex:0 0 auto}
.taskAssigneeOption span{min-width:0;writing-mode:horizontal-tb}
.taskAssigneeOption b{margin:0;word-break:normal;overflow-wrap:anywhere}
.taskFormAssignees{grid-column:1/-1;border:1px solid var(--line);border-radius:14px;padding:16px;background:#fffdf9}
.taskFormAssignees>div:first-child{display:flex;justify-content:space-between;gap:12px;align-items:baseline;margin-bottom:12px}
.taskFormAssignees small{color:var(--muted);line-height:1.5}
.taskAssignmentSheet>footer{display:flex;justify-content:flex-end;gap:10px}
@media(max-width:760px){
  .taskAssignmentSheet{padding:17px;border-radius:17px}
  .taskAssignmentSheet>header{display:block}
  .taskAssignmentSheet>header>button{margin-top:12px}
  .taskAssignmentGrid{grid-template-columns:1fr;padding:15px 0}
  .taskAssigneeOptions{grid-template-columns:1fr}
  .taskAssignmentSheet>footer{display:grid;grid-template-columns:1fr 1fr}
  .taskAssignmentSheet>footer button{width:100%}
}
