:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: #202e27;
  background: #f5f7f3;
  --ink: #202e27;
  --muted: #5a6b61;
  --green: #245c47;
  --green-dark: #173b30;
  --line: #dce5dd;
  --white: #fff;
  --radius: 18px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-height: 100vh; margin: 0; }
h1, h2, p { margin: 0; }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: var(--green); text-underline-offset: 4px; }
button:disabled { cursor: wait; opacity: .66; }
:focus-visible { outline: 3px solid #367c60; outline-offset: 3px; }
input, textarea, select {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 1px solid #bfcfc5;
  border-radius: 9px;
  background: var(--white);
  color: var(--ink);
  padding: 9px 12px;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #647168; }
input:focus, textarea:focus, select:focus { border-color: var(--green); }
input[type="checkbox"] { width: 17px; min-height: 0; height: 17px; margin: 0; accent-color: var(--green); }
select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #47594f 50%), linear-gradient(135deg, #47594f 50%, transparent 50%);
  background-position: calc(100% - 17px) center, calc(100% - 12px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 650;
  font-size: .875rem;
  text-decoration: none;
  white-space: nowrap;
}
.button-primary { background: var(--green); color: white; }
.button-primary:hover:not(:disabled) { background: #194936; }
.button-secondary { border-color: var(--line); background: var(--white); color: var(--green-dark); }
.button-secondary:hover:not(:disabled) { background: #eef5ef; border-color: #baccc0; }
.button-small { min-height: 38px; padding: 6px 11px; }
.icon-button {
  min-width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
}
.icon-button:hover { background: #f0f5f0; color: var(--ink); }
.field { display: block; min-width: 0; font-size: .875rem; font-weight: 650; }
.field input, .field textarea, .field select { margin-top: 6px; font-weight: 400; font-size: 1rem; }
.optional { color: var(--muted); font-size: .75rem; font-weight: 400; margin-left: 3px; }
.message {
  border: 1px solid #c9decc;
  border-radius: 10px;
  padding: 10px 12px;
  color: #24523d;
  background: #edf7ee;
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.message.error { color: #842d29; background: #fff2ef; border-color: #efcbc5; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; }
.brand strong, .brand small { display: block; }
.brand strong { line-height: 1.25; font-size: 1rem; }
.brand small { color: #c5d9cd; font-size: .8rem; margin-top: 4px; }
.brand-mark {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e0edc4;
  color: #254635;
  font-size: 1.05rem;
  font-weight: 800;
}
.startup { min-height: 100vh; display: grid; align-content: center; justify-items: center; gap: 16px; color: var(--muted); padding: 24px; }
.login-view {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1fr);
  width: min(960px, calc(100% - 48px));
  min-height: 565px;
  margin: max(36px, calc((100vh - 565px) / 2)) auto;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d7e2d8;
  border-radius: 25px;
  box-shadow: 0 22px 64px #21453215;
}
.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  min-width: 0;
  padding: clamp(35px, 5vw, 58px);
  background: radial-gradient(ellipse at 90% 105%, #37634b 0, transparent 56%), #183e32;
  color: #f5f8f4;
}
.login-brand-copy h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.25; letter-spacing: -.045em; }
.login-brand-copy p { margin-top: 14px; color: #d8e7db; }
.login-diagram { display: flex; gap: 11px; flex-wrap: wrap; color: #e6f0e8; }
.login-diagram span { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid #bad1c45c; border-radius: 99px; font-size: .875rem; white-space: nowrap; }
.login-diagram i { width: 7px; height: 7px; border-radius: 50%; background: #c0d590; }
.login-diagram span:nth-child(2) i { background: #e3bd78; }
.login-diagram span:nth-child(3) i { background: #88c8a6; }
.login-content { display: grid; align-content: center; padding: clamp(34px, 6vw, 76px); }
.login-form { display: grid; gap: 17px; }
.form-heading { margin-bottom: 8px; }
.form-heading h2 { font-size: 1.9rem; letter-spacing: -.025em; }
.form-heading p { margin-top: 5px; color: var(--muted); }
.login-submit { margin-top: 4px; min-height: 48px; font-size: 1rem; }
.store-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px 22px; margin-top: 5px; font-size: .875rem; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 26px 18px 20px;
  background: #173b30;
}
.sidebar .brand { padding: 0 9px; }
.navigation { display: grid; gap: 5px; }
.navigation button {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  color: #e1ede4;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  text-align: left;
  font-size: .94rem;
  white-space: nowrap;
}
.navigation button:hover { background: #ffffff12; }
.navigation button[aria-current="page"] { background: #dce9d9; color: #183e31; font-weight: 750; }
.navigation button:focus-visible, .store-links a:focus-visible { outline-offset: 2px; }
.navigation svg { width: 18px; height: 18px; flex: none; }
.sidebar-foot { margin-top: auto; padding: 16px 9px 0; border-top: 1px solid #ffffff26; color: #d8e6da; display: flex; align-items: center; gap: 8px; font-size: .875rem; }
.location-dot { width: 7px; height: 7px; display: block; border-radius: 50%; background: #b6cf8f; }
.main-shell { min-width: 0; }
.topbar { min-height: 65px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px clamp(18px, 4vw, 52px); }
.topbar-title { color: var(--muted); font-size: .875rem; }
.account { position: relative; margin-left: auto; }
.account summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; padding: 5px 6px; border-radius: 8px; font-size: .875rem; list-style: none; }
.account summary:hover { background: #f2f6f2; }
.account summary::-webkit-details-marker { display: none; }
.account-avatar { display: grid; place-items: center; width: 30px; height: 30px; background: #e4efe3; color: #21523e; border-radius: 50%; font-weight: 750; }
.chevron { display: block; width: 7px; height: 7px; margin: -3px 3px 0 4px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg); }
.account-actions { position: absolute; z-index: 3; right: 0; top: calc(100% + 6px); width: 146px; display: grid; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 10px 28px #183b281b; }
.account-actions button { border: 0; border-radius: 6px; min-height: 42px; background: none; color: var(--ink); text-align: left; padding: 8px 10px; font-size: .875rem; }
.account-actions button:hover { background: #eff5ef; }
.main-content { max-width: 1540px; margin: 0 auto; padding: 35px clamp(18px, 4vw, 52px) 64px; }
.workspace-message { margin-bottom: 16px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 27px; }
.page-heading h1 { font-size: clamp(1.6rem, 3.5vw, 2.15rem); letter-spacing: -.035em; line-height: 1.22; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: .9375rem; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 3px 11px #163e2710; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 22px 17px; border-bottom: 1px solid #edf0ed; }
.panel-heading h2, .editor-heading h2 { font-size: 1.14rem; line-height: 1.25; }
.panel-heading p, .editor-heading p { margin-top: 6px; color: var(--muted); font-size: .875rem; }
.request-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(246px, 295px); align-items: start; gap: 20px; }
.form-main { display: grid; gap: 20px; min-width: 0; }
.request-summary { position: sticky; top: 16px; }
.summary-fields { display: grid; gap: 16px; padding: 19px 22px 22px; }
.selection-count { color: var(--muted); font-size: .875rem; }
.mobile-submit { display: none; }
.store-summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid #edf0ed; padding-bottom: 13px; font-size: .875rem; color: var(--muted); }
.store-summary strong { color: var(--green-dark); }
.catalog-group h3 { margin: 0; padding: 10px 22px; font-size: .875rem; color: var(--green-dark); background: #edf4ee; }
.catalog-row { min-height: 60px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(82px, 96px) 40px; align-items: center; gap: 10px; padding: 9px 22px; border-bottom: 1px solid #eff2ef; }
.catalog-row:last-child { border-bottom: 0; }
.catalog-row .material-meta { margin-top: 2px; }
.catalog-row input { text-align: right; }
.catalog-unit { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.temporary-list { display: grid; }
.temporary-row { display: grid; position: relative; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(64px, .65fr) minmax(60px, .6fr) 40px; align-items: end; gap: 10px; min-inline-size: 0; border: 0; margin: 0; padding: 16px 22px; }
.temporary-row + .temporary-row { border-top: 1px solid #edf0ed; }
.temporary-row .icon-button { margin-bottom: 2px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric-card { width: 100%; min-height: 102px; display: grid; justify-items: start; align-content: center; gap: 7px; text-align: left; border: 1px solid var(--line); border-radius: 15px; padding: 15px 18px; background: #fff; color: var(--muted); font-weight: 650; font-size: .875rem; }
.metric-card:hover, .metric-card[aria-pressed="true"] { background: #eaf3e9; border-color: #a8c8b0; }
.metric-card strong { font-size: 1.65rem; line-height: 1; color: #213d2e; font-variant-numeric: tabular-nums; }
.metric-label { display: inline-flex; align-items: center; gap: 8px; }
.metric-label::before { content: ""; width: 7px; height: 7px; background: #a06b0d; border-radius: 50%; }
.metric-ordered .metric-label::before { background: #4a7394; }
.metric-received .metric-label::before { background: #408760; }
.request-controls { display: flex; justify-content: space-between; align-items: center; gap: 13px; padding: 15px 19px; border-bottom: 1px solid var(--line); }
.tab-list { display: flex; gap: 4px; flex-wrap: wrap; }
.tab-list button { display: inline-flex; align-items: center; justify-content: center; min-height: 41px; padding: 7px 13px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #43574b; font-size: .875rem; font-weight: 650; white-space: nowrap; }
.tab-list button:hover { background: #f1f6f1; }
.tab-list button[aria-pressed="true"] { border-color: #c6dbca; background: #e8f2e8; color: #1d553a; }
.filter-fields { display: flex; align-items: center; gap: 8px; }
.filter-fields input, .filter-fields select { font-size: .875rem; }
.filter-fields select { width: auto; }
.filter-fields input { min-width: 175px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
.data-table th, .data-table td { padding: 13px 15px; vertical-align: middle; border-bottom: 1px solid #edf1ed; }
.data-table th { color: #4d6153; font-weight: 700; background: #f6f8f5; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td:first-child, .data-table th:first-child { padding-left: 21px; }
.data-table td:last-child, .data-table th:last-child { padding-right: 21px; }
.data-table tbody tr:hover { background: #fafcf9; }
.data-table .cell-action { text-align: right; }
.material-name { display: block; font-weight: 750; overflow-wrap: anywhere; }
.material-meta { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 4px 9px; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.status-badge::before { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-submitted { background: #f8eed7; color: #77500b; }
.status-ordered { background: #e8f0f8; color: #315b79; }
.status-received { background: #e6f1e6; color: #23593c; }
.status-off { background: #edf0ed; color: #4f5d53; }
.history-list { display: grid; gap: 15px; }
.history-list .panel-heading { align-items: start; }
.history-notes { padding: 10px 22px 14px; color: var(--muted); font-size: .875rem; border-top: 1px solid #edf0ed; overflow-wrap: anywhere; }
.empty { padding: 34px 22px; text-align: center; color: var(--muted); font-size: .9375rem; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.temporary-list .empty { padding-block: 18px; }
.editor { width: min(510px, calc(100% - 26px)); max-height: calc(100dvh - 26px); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 20px 85px #10291e43; overflow: auto; }
.editor::backdrop { background: #132b22a0; }
.editor-heading, .editor-footer { padding: 17px 21px; background: #fff; }
.editor-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; border-bottom: 1px solid var(--line); }
.editor-heading h2 { margin-top: 6px; }
.editor-footer { border-top: 1px solid var(--line); }
.editor-footer .message { margin-bottom: 12px; }
.editor-content { padding: 18px 21px; display: grid; gap: 14px; }
.editor-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.checkbox-group { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px 12px; margin: 0; }
.checkbox-group legend { padding: 0 4px; font-weight: 650; font-size: .875rem; }
.checkbox-row { display: flex; gap: 12px 22px; flex-wrap: wrap; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: .875rem; min-height: 32px; }
.detail-list { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr; gap: 10px 13px; margin: 0; font-size: .875rem; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 1130px) {
  .workspace { grid-template-columns: 187px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .request-controls { flex-wrap: wrap; }
  .temporary-row { grid-template-columns: 1fr 1fr; padding-right: 67px; }
  .temporary-row .icon-button { position: absolute; top: 16px; right: 17px; }
}
@media (max-width: 830px) {
  .workspace { display: block; }
  .sidebar { position: static; height: auto; gap: 15px; padding: 14px 16px; }
  .sidebar .brand { padding: 0; }
  .sidebar .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .sidebar .brand small { margin-top: 2px; }
  .navigation { display: flex; gap: 5px; flex-wrap: wrap; }
  .navigation button { min-height: 40px; padding: 7px 11px; font-size: .875rem; }
  .navigation svg { width: 16px; height: 16px; }
  .sidebar-foot { display: none; }
  .topbar { min-height: 53px; padding: 4px 16px; }
  .main-content { padding: 23px 16px 40px; }
  .page-heading { margin-bottom: 19px; }
}
@media (max-width: 620px) {
  .login-view { display: block; width: min(450px, calc(100% - 28px)); min-height: 0; margin: 14px auto 24px; border-radius: 18px; }
  .login-brand { gap: 23px; padding: 23px; }
  .login-brand-copy h1 { font-size: 1.55rem; }
  .login-brand-copy p { font-size: .9rem; margin-top: 6px; }
  .login-diagram { display: none; }
  .login-content { padding: 25px 23px; }
  .form-heading h2 { font-size: 1.5rem; }
  .request-layout { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .form-main { gap: 13px; }
  .request-summary { position: static; }
  #staff-new { padding-bottom: 66px; }
  .summary-fields > .selection-count, .summary-fields > button { display: none; }
  .mobile-submit { position: fixed; z-index: 2; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -3px 16px #163e2710; }
  .panel-heading { padding: 15px 15px 13px; }
  .catalog-group h3 { padding-inline: 15px; }
  .catalog-row { padding-inline: 15px; }
  .summary-fields { padding: 16px 15px; }
  .page-heading { align-items: start; }
  .page-heading p { font-size: .875rem; }
  .page-heading .button { min-height: 40px; padding-inline: 10px; }
  .metric-grid { gap: 7px; margin-bottom: 13px; }
  .metric-card { min-height: 77px; padding: 10px 9px; }
  .metric-card strong { font-size: 1.4rem; }
  .metric-label { gap: 5px; }
  .request-controls { padding: 11px; gap: 9px; }
  .tab-list { gap: 2px; }
  .tab-list button { min-height: 38px; padding: 6px 9px; }
  .filter-fields { width: 100%; }
  .filter-fields input { min-width: 0; }
  .filter-fields select { max-width: 42%; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
  .data-table tbody tr { border-bottom: 1px solid var(--line); padding: 11px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
  .data-table tbody tr:last-child { border-bottom: 0; }
  .data-table td, .data-table td:first-child, .data-table td:last-child { border: 0; padding: 0; text-align: left; min-width: 0; }
  .data-table td:first-child { grid-column: 1 / -1; padding-bottom: 4px; }
  .data-table td:not(:first-child):not(.cell-action)::before { content: attr(data-label); display: block; color: var(--muted); font-size: .75rem; margin-bottom: 2px; }
  .data-table .cell-action { display: flex; justify-content: end; align-items: end; }
  .history-notes { padding-inline: 15px; }
}
@media (max-width: 375px) {
  .page-heading { flex-wrap: wrap; gap: 9px; }
  .temporary-row { padding-inline: 13px 58px; gap: 7px; }
  .temporary-row .icon-button { right: 10px; }
  .form-columns { grid-template-columns: 1fr; }
}
