:root {
  --bg: #f3f6f4;
  --panel: #ffffff;
  --ink: #14211c;
  --muted: #66746d;
  --line: #dce4df;
  --nav: #082b4c;
  --nav-deep: #031b32;
  --nav-soft: rgba(255, 255, 255, .10);
  --green: #1f7657;
  --green-deep: #103f30;
  --blue: #1167e8;
  --blue-deep: #0b4fc4;
  --amber: #a66c22;
  --red: #a9443b;
  --soft-green: #e7f2ec;
  --soft-blue: #e7eff5;
  --soft-amber: #f7edde;
  --steel: #33423f;
  --shadow: 0 14px 30px rgba(20, 33, 28, .08);
  --shadow-crisp: 0 10px 22px rgba(20, 33, 28, .06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7f9fc, #eef3f7);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

a {
  color: inherit;
}

button,
select,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.login-view,
.workspace {
  width: min(1680px, calc(100% - 24px));
  margin: 0 auto;
}

.login-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  align-items: stretch;
  padding: 72px 0;
}

.login-panel,
.login-aside,
.module-card,
.resource-link,
.build-status,
.status-metrics {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .95);
  box-shadow: var(--shadow-crisp);
}

.login-panel {
  min-height: 560px;
  padding: clamp(28px, 6vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kicker {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

.lede,
.hero-strip p,
.login-aside p,
.module-card p,
.resource-link small,
.build-status p {
  color: var(--muted);
  line-height: 1.7;
}

.lede {
  max-width: 620px;
  margin-bottom: 32px;
  font-size: 18px;
}

.primary-action,
.secondary-action,
.icon-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  color: white;
  background: linear-gradient(180deg, var(--blue), var(--blue-deep));
  box-shadow: 0 8px 18px rgba(17, 103, 232, .16);
}

.secondary-action {
  padding: 0 14px;
  color: var(--green-deep);
  border-color: rgba(29, 110, 79, .28);
  background: var(--soft-green);
}

.primary-action:hover,
.secondary-action:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(20, 33, 28, .10);
}

.config-note {
  margin: 12px 0 0;
  color: var(--amber);
  font-size: 13px;
}

.dev-login {
  max-width: 460px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.dev-login label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dev-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
}

input,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: white;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(36, 94, 131, .52);
  box-shadow: 0 0 0 3px rgba(36, 94, 131, .10);
  outline: 0;
}

.login-aside {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(29, 110, 79, .12), transparent),
    rgba(255, 255, 255, .84);
}

.login-aside div {
  padding: 18px;
  border: 1px solid rgba(214, 222, 216, .86);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.login-aside span {
  display: block;
  margin-bottom: 12px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
}

.login-aside strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.workspace {
  padding: 16px 0 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 10px 14px;
  border: 1px solid #e6ebf0;
  border-radius: 4px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-crisp);
}

.brand,
.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.user-box strong {
  display: block;
  line-height: 1.2;
  font-size: 15px;
}

.brand span,
.user-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  border: 8px solid var(--blue);
  border-right-color: var(--blue);
  border-bottom-color: var(--amber);
  border-radius: 7px;
  background: white;
}

.brand-mark::after {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(15, 66, 48, .22);
  content: "";
}

.user-box {
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  color: white;
  background: linear-gradient(135deg, var(--green-deep), var(--blue));
  font-weight: 900;
}

.icon-button {
  width: 34px;
  min-height: 34px;
  color: var(--red);
  border-color: rgba(164, 71, 58, .22);
  background: #fbefed;
}

.hero-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: stretch;
  padding: 30px;
  border: 1px solid rgba(220, 228, 223, .96);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255,255,255,.97), rgba(255,255,255,.86)),
    linear-gradient(135deg, rgba(36,95,126,.08), rgba(29,110,79,.06));
  box-shadow: var(--shadow-crisp);
}

.hero-strip h1 {
  max-width: 820px;
  font-size: clamp(30px, 4.8vw, 56px);
}

.status-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  overflow: hidden;
}

.status-metrics div {
  display: grid;
  place-items: center;
  padding: 18px 8px;
  border-right: 1px solid var(--line);
}

.status-metrics div:last-child {
  border-right: 0;
}

.status-metrics dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.status-metrics dd {
  margin: 0;
  font-size: 32px;
  font-weight: 900;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 14px;
}

.section-head.compact {
  margin-top: 0;
}

.workflow-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(220, 228, 223, .96);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .86)),
    linear-gradient(135deg, rgba(29, 110, 79, .10), rgba(36, 95, 126, .07));
  box-shadow: var(--shadow-crisp);
}

.workflow-hero::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 220px), rgba(36, 95, 126, .06)),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(29, 110, 79, .035) 23px 24px);
  content: "";
  pointer-events: none;
}

.workflow-hero > * {
  position: relative;
}

.workflow-hero h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.05;
}

.workflow-hero p:not(.kicker) {
  max-width: 520px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.workflow-hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 8px;
}

.workflow-hero-metrics span {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(214, 222, 216, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .74);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.workflow-hero-metrics strong {
  color: var(--green-deep);
  font-size: 18px;
  line-height: 1;
}

.order-flow-map {
  position: relative;
  min-width: 0;
  margin-bottom: 18px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(220, 228, 223, .96);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(250, 252, 250, .86));
  box-shadow: var(--shadow-crisp);
}

.flow-map-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.flow-map-head h2 {
  font-size: 20px;
}

.flow-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, minmax(108px, 1fr));
  gap: 10px;
  max-width: 100%;
}

.flow-track::before {
  position: absolute;
  top: 26px;
  right: 22px;
  left: 22px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--amber));
  content: "";
  opacity: .26;
}

.flow-node {
  position: relative;
  display: grid;
  min-height: 116px;
  align-content: start;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(214, 222, 216, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.flow-node:hover,
.flow-node:focus {
  border-color: rgba(29, 110, 79, .38);
  box-shadow: 0 12px 24px rgba(20, 33, 28, .08);
  outline: 0;
}

.flow-node span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: var(--steel);
  font-size: 11px;
  font-weight: 900;
}

.flow-node.active span {
  background: var(--green);
}

.flow-node.done span {
  background: var(--amber);
}

.flow-node strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.flow-node small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(29, 110, 79, .22);
  border-radius: 999px;
  color: var(--green-deep);
  background: var(--soft-green);
  font-size: 12px;
  font-weight: 900;
}

.module-grid {
  display: grid;
  gap: 16px;
}

.module-section {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(214, 222, 216, .78);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(250, 252, 250, .86));
  box-shadow: var(--shadow-crisp);
}

.module-section::before {
  position: absolute;
  top: 44px;
  right: 16px;
  left: 16px;
  height: 1px;
  background: linear-gradient(90deg, rgba(29, 110, 79, .34), transparent);
  content: "";
}

.module-section-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.module-section-head h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.module-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.module-subgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.module-card {
  position: relative;
  display: flex;
  min-height: 132px;
  flex-direction: column;
  padding: 14px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.module-card-primary {
  border-color: rgba(29, 110, 79, .34);
  background:
    linear-gradient(180deg, #ffffff, #f3faf6);
}

.module-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  content: "";
  opacity: .22;
}

.module-card-primary::before {
  opacity: .68;
}

.module-card:hover {
  border-color: rgba(29, 110, 79, .42);
  box-shadow: 0 12px 26px rgba(20, 33, 28, .10);
}

.module-code {
  width: fit-content;
  margin-bottom: 12px;
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--green-deep);
  background: rgba(229, 240, 234, .96);
  font-size: 11px;
  font-weight: 900;
}

.module-card strong {
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.25;
}

.module-card p {
  margin-bottom: auto;
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.module-card small {
  margin-top: 10px;
  color: var(--amber);
  font-weight: 900;
}

.quick-actions,
.action-panel,
.workflow-ready-note {
  margin-top: 18px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(169, 108, 33, .18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, .95), rgba(255, 255, 255, .86));
  box-shadow: var(--shadow-crisp);
}

.quick-actions .section-head {
  display: grid;
  align-content: space-between;
  margin: 0;
}

.quick-actions .section-head.compact {
  margin: 0;
}

.quick-actions .section-head h2 {
  font-size: 20px;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quick-action-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(169, 108, 33, .24);
  border-radius: 8px;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf9, var(--soft-amber));
  box-shadow: 0 8px 20px rgba(20, 33, 28, .06);
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.quick-action-card::after {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(169, 108, 33, .48);
  content: "OPEN";
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.quick-action-card:hover,
.quick-action-card:focus {
  border-color: rgba(169, 108, 33, .46);
  box-shadow: 0 12px 28px rgba(20, 33, 28, .10);
  outline: 0;
}

.quick-action-card strong,
.quick-action-card small {
  display: block;
}

.quick-action-card strong {
  font-size: 16px;
  line-height: 1.25;
}

.quick-action-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.workflow-ready-note {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(29, 110, 79, .22);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(229, 240, 234, .86), rgba(229, 238, 243, .68));
  box-shadow: 0 12px 28px rgba(23, 33, 29, .055);
}

.workflow-ready-note h2 {
  font-size: 20px;
}

.workflow-ready-note p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.7;
}

.cost-calculator-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}

.calculator-note {
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.7;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .8fr);
  gap: 14px;
}

.product-cost-target {
  grid-column: 1 / -1;
}

.calculator-block,
.calculator-result {
  border: 1px solid rgba(214, 222, 216, .9);
  border-radius: 8px;
  background: #fbfcfb;
}

.calculator-block {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.calculator-block-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.calculator-block h3,
.calculator-block-head h3 {
  margin: 0;
  font-size: 16px;
}

.cost-material-list,
.calculator-fields {
  display: grid;
  gap: 10px;
}

.cost-material-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 110px 110px 96px 34px;
  gap: 8px;
  align-items: end;
}

.cost-material-row label,
.calculator-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.cost-material-row input,
.cost-material-row select,
.calculator-fields input,
.calculator-fields select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.calculator-save-row {
  display: flex;
  grid-column: 1 / -1;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

#costSaveNotice {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

#costSaveNotice.ok {
  color: var(--green);
}

#costSaveNotice.error {
  color: var(--red);
}

.cost-material-total {
  display: grid;
  min-height: 38px;
  place-items: center end;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 900;
}

.calculator-result {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.calculator-result div {
  padding: 16px;
  border-right: 1px solid var(--line);
}

.calculator-result div:last-child {
  border-right: 0;
  background: var(--soft-green);
}

.calculator-result span,
.calculator-result strong {
  display: block;
}

.calculator-result span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.calculator-result strong {
  color: var(--green-deep);
  font-size: 24px;
  line-height: 1.2;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 30px;
}

.link-list {
  display: grid;
  gap: 10px;
}

.resource-link {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  text-decoration: none;
  box-shadow: none;
}

.resource-link span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: var(--soft-blue);
  font-size: 12px;
  font-weight: 900;
}

.resource-link strong,
.resource-link small {
  display: block;
}

.build-status {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  margin-top: 30px;
  padding: 20px;
}

.status-lanes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.status-lanes article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.status-lanes strong {
  display: block;
  margin-bottom: 8px;
}

.status-lanes p {
  margin-bottom: 0;
  font-size: 13px;
}

/* --- 工作台主体（侧边栏 + 内容区） --- */
.workspace-body {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}

.sidebar-container,
.workspace-content {
  min-width: 0;
}

.workspace-content .section-head {
  margin-top: 0;
}

/* --- 侧边栏 --- */
.sidebar {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 2px;
  padding: 14px 10px;
  border: 1px solid rgba(2, 20, 38, .68);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(8, 43, 76, .98), rgba(3, 27, 50, .98));
  box-shadow: 0 18px 42px rgba(3, 27, 50, .18);
  max-height: calc(100vh - 112px);
  overflow-y: auto;
}

.sidebar-section {
  padding: 6px 8px 2px;
}

.sidebar-section .kicker {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, .74);
}

.sidebar-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 4px;
  border-left: 3px solid transparent;
  text-decoration: none;
  color: rgba(255, 255, 255, .84);
  transition: background .14s ease, border-color .14s ease;
}

.sidebar-item:hover {
  background: var(--nav-soft);
}

.sidebar-item.active {
  background: linear-gradient(90deg, #0f6af2, #0a56d1);
  border-left-color: #7db4ff;
  color: white;
}

.sidebar-text strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
}

.sidebar-text small {
  display: block;
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
  font-weight: 600;
}

.sidebar-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .86);
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-item.active .sidebar-icon {
  background: rgba(255, 255, 255, .18);
  color: white;
}

/* --- 占位区域（暂无更多模块时显示） --- */
.placeholder-section {
  margin-top: 30px;
}

.placeholder-card {
  padding: 48px 32px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  text-align: center;
}

.placeholder-icon {
  display: block;
  margin-bottom: 16px;
  font-size: 40px;
}

.placeholder-card h2 {
  margin-bottom: 12px;
  font-size: 22px;
  color: var(--ink);
}

.placeholder-card p {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.approval-query-panel {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}

.base-link {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(36, 95, 126, .22);
  border-radius: 7px;
  color: var(--blue);
  background: var(--soft-blue);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.approval-query-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
}

.approval-query-form.wide {
  grid-template-columns: 220px minmax(0, 1fr) 96px;
}

.approval-query-form input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.approval-query-form select {
  min-height: 42px;
}

.suggest-field {
  position: relative;
  min-width: 0;
}

.suggest-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 20;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 42px rgba(23, 33, 29, .16);
}

.suggest-item {
  display: grid;
  width: 100%;
  min-height: auto;
  gap: 3px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: white;
  text-align: left;
}

.suggest-item:last-child {
  border-bottom: 0;
}

.suggest-item:hover,
.suggest-item:focus {
  background: var(--soft-green);
  outline: 0;
}

.suggest-item strong,
.suggest-item span {
  display: block;
  overflow-wrap: anywhere;
}

.suggest-item strong {
  font-size: 14px;
}

.suggest-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.approval-query-form input:focus {
  border-color: var(--green);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(29, 110, 79, .14);
}

.query-notice {
  margin: 12px 0 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.query-notice.error {
  color: var(--red);
}

.approval-result {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

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

.result-summary div,
.field-grid div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
}

.result-summary span,
.field-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.result-summary strong,
.field-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.45;
}

.field-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(36, 95, 126, .24);
  border-radius: 7px;
  color: var(--blue);
  background: var(--soft-blue);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.field-links a:hover,
.field-links a:focus {
  border-color: rgba(36, 95, 126, .48);
  background: #d9e9f1;
  outline: 0;
}

.approval-records {
  display: grid;
  gap: 12px;
}

.approval-record-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
}

.approval-record-card.compact {
  box-shadow: 0 10px 24px rgba(23, 33, 29, .06);
}

.record-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, var(--soft-green), rgba(255,255,255,.76));
}

.record-card-head h3 {
  margin: 0;
  font-size: 16px;
}

.record-card-head span {
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 900;
}

.record-flat-fields {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.record-flat-fields div {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.record-flat-fields div:last-child {
  border-right: 0;
}

.record-flat-fields span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.record-flat-fields strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.record-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(36, 95, 126, .24);
  border-radius: 7px;
  color: var(--blue);
  background: var(--soft-blue);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.record-actions a:hover,
.record-actions a:focus {
  border-color: rgba(36, 95, 126, .48);
  background: #d9e9f1;
  outline: 0;
}

.record-details summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 900;
}

.record-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .login-view,
  .hero-strip,
  .two-column,
  .build-status,
  .workflow-hero {
    grid-template-columns: 1fr;
  }

  .workflow-hero {
    align-items: start;
  }

  .workflow-hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .module-grid {
    gap: 16px;
  }

  .module-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-action-grid,
  .quick-actions,
  .workflow-ready-note {
    grid-template-columns: 1fr;
  }

  .flow-track {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .flow-node {
    flex: 0 0 132px;
  }

  .flow-track::before {
    right: 30px;
    left: 16px;
    width: 980px;
  }

  .status-metrics,
  .status-lanes,
  .calculator-layout,
  .result-summary,
  .field-grid,
  .record-flat-fields {
    grid-template-columns: 1fr;
  }

  .calculator-result {
    grid-template-columns: 1fr;
  }

  .calculator-result div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .calculator-result div:last-child {
    border-bottom: 0;
  }

  .record-flat-fields div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-metrics div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-metrics div:last-child {
    border-bottom: 0;
  }

  /* 侧边栏变为水平标签导航 */
  .workspace-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding: 8px;
    max-width: 100%;
    max-height: none;
    border-radius: 8px;
  }

  .sidebar-section {
    display: none;
  }

  .sidebar-item {
    grid-template-columns: auto;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 10px;
  }

  .sidebar-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--green);
  }

  .sidebar-item .sidebar-text small {
    display: none;
  }

  .sidebar-icon {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
}

@media (max-width: 620px) {
  .login-view,
  .workspace {
    width: min(100% - 20px, 1220px);
  }

  .login-view {
    padding: 28px 0;
  }

  .login-panel,
  .hero-strip {
    padding: 20px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    border-radius: 9px;
  }

  .user-box {
    justify-content: space-between;
  }

  .module-grid {
    gap: 12px;
  }

  .workflow-hero {
    padding: 14px;
    gap: 10px;
  }

  .workflow-hero h2 {
    font-size: 28px;
  }

  .workflow-hero-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workflow-hero-metrics span {
    min-height: 44px;
    padding: 8px;
    font-size: 10px;
  }

  .workflow-hero-metrics strong {
    font-size: 15px;
  }

  .module-section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .module-subgrid {
    grid-template-columns: 1fr;
  }

  .module-section {
    padding: 12px;
  }

  .module-card {
    min-height: 112px;
    padding: 12px;
  }

  .module-card p {
    -webkit-line-clamp: 1;
  }

  .quick-actions {
    margin-top: 14px;
    padding: 12px;
  }

  .order-flow-map {
    padding: 12px;
  }

  .flow-map-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .flow-track {
    display: flex;
  }

  .flow-node {
    flex-basis: 124px;
    min-height: 104px;
    padding: 10px;
  }

  .quick-action-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .quick-action-card {
    min-height: 74px;
    padding: 10px;
  }

  .quick-action-card .module-code {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .quick-action-card strong {
    font-size: 13px;
  }

  .quick-action-card small,
  .quick-action-card::after {
    display: none;
  }

  .workflow-ready-note {
    padding: 14px;
  }

  .cost-material-row {
    grid-template-columns: 1fr;
  }

  .calculator-save-row {
    align-items: stretch;
    flex-direction: column;
  }

  .cost-material-total {
    place-items: center start;
  }

  .dev-row {
    grid-template-columns: 1fr;
  }

  .approval-query-form {
    grid-template-columns: 1fr;
  }

  .approval-query-form.wide {
    grid-template-columns: 1fr;
  }

  /* 侧边栏更紧凑 */
  .sidebar {
    gap: 4px;
    padding: 6px;
  }

  .sidebar-item {
    padding: 6px 8px;
  }

  .sidebar-item .sidebar-text strong {
    font-size: 12px;
  }
}
