:root {
  color-scheme: light;
  --navy: #171613;
  --blue: #8b641e;
  --line: #e9dfcf;
  --muted: #695e4e;
  --ink: #272019;
  --gold: #e7c482;
  --gold-deep: #704d15;
  color: var(--ink);
  background: #f8f5ef;
}

[hidden] { display: none !important; }
body { min-width: 0; }
button { color: var(--ink); border-color: #e0d3be; }
button:hover { background: #fbf1dd; border-color: #bea272; }
button.primary { background: #e8c687; border-color: #c8a566; color: #241c10; font-weight: 650; }
button.primary:hover { background: #f2d7a1; color: #1f170d; border-color: #b99655; }
button:focus-visible, a:focus-visible { outline-color: #976d25; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); }

.sign-in {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(400px, .94fr);
  min-height: 100vh;
}
.login-brand {
  display: grid;
  place-items: center;
  padding: 56px 40px;
  color: #ead6b2;
  background: radial-gradient(ellipse at 35% 32%, #33281b 0%, #201c17 48%, #11100f 100%);
}
.login-brand-inner { width: min(100%, 560px); text-align: center; }
.login-logo, .sidebar-logo { aspect-ratio: 819 / 214; overflow: hidden; position: relative; }
.login-logo img, .sidebar-logo img { position: absolute; width: 118.07%; max-width: none; left: -5.74%; top: -20.56%; display: block; }
.brand-rule { width: 40px; height: 1px; margin: 33px auto 22px; background: #a88a5a; }
.login-brand p { margin: 8px 0 0; font-size: .85rem; letter-spacing: .17em; }
.login-panel { display: grid; place-items: center; background: #faf7f0; padding: 56px clamp(25px, 6vw, 90px); }
.login-card { width: min(100%, 420px); }
.auth-title { margin-bottom: 27px; }
.auth-title h1 { font: 500 clamp(2rem, 4vw, 3.1rem)/1.12 Georgia, 'Microsoft YaHei', serif; letter-spacing: -.035em; }
.auth-title p { margin-top: 9px; }
.auth-help, .auth-message { font-size: .875rem; line-height: 1.65; color: var(--muted); }
.auth-help { margin: 0 0 6px; }
.login-card form { display: grid; gap: 19px; }
.login-card .field small { margin-inline-start: 7px; font-size: .8125rem; }
.login-card .field input, .login-card .field select { min-height: 46px; }
.auth-submit { min-height: 46px; margin-top: 4px; }
.auth-submit span { margin-inline-start: .45em; font-size: .86em; }
.auth-message { margin: 17px 0 0; }
.auth-message.is-error { color: #99382f; }

#workspace { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: auto; min-width: 0; }
.brand { display: block; border-color: #3b3023; padding: 26px 18px 19px; }
.brand-caption { color: #dfc69d; font-weight: 500; font-size: .775rem; margin-top: 13px; text-align: center; }
.sidebar nav { margin-top: 13px; }
.sidebar nav button { color: #dcd2c3; }
.sidebar nav button:hover { background: #2d251c; color: #ffe7bd; }
.sidebar nav button.active { background: #3c2e1c; color: #ffe7bd; box-shadow: inset 3px 0 #d7ad65; }
.workspace-main { margin: 0; min-width: 0; }
.topbar { min-height: 65px; height: auto; gap: 14px; padding: 12px clamp(15px, 2.4vw, 30px); flex-wrap: wrap; }
.topbar, .topbar b { color: var(--ink); }
.workspace-tools, .account-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-tools { border-inline-start: 1px solid var(--line); padding-inline-start: 12px; font-size: .8125rem; }
.account-tools button { font-size: .8125rem; padding: 5px 9px; }
.content { padding: clamp(16px, 2.5vw, 32px); }
.page-heading { gap: 18px; }
.page-heading > button { flex-shrink: 0; }
.page-heading h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
#page-title:focus { outline: none; }
.filter-panel, .list-panel, dialog { border-color: var(--line); }
.field input, .field select, .field textarea, .picker-search input,
.goods-filter-form input:not([type=checkbox]) {
  border-color: #e4dac9;
  background: #fffcf8;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus, .goods-filter-form input:focus {
  border-color: #aa8650;
  box-shadow: 0 0 0 2px #f2e2c6;
}
th { background: #f3ece0; color: #594936; border-color: var(--line); }
td, .detail-grid div { border-color: #f0e9de; }
tbody tr:hover { background: #fdf8ef; }
.link, .image-card a, .filter-fold { color: var(--gold-deep); }
.category-tabs { border-color: var(--line); overflow-x: auto; }
.category-tabs button { color: var(--muted); white-space: nowrap; }
.category-tabs button.active { color: var(--gold-deep); border-color: #ae843d; }
.status, .chip, .note, .impact-goods { background: #faf2e3; border-color: var(--line); color: #664c29; }
.choice-chip span, .goods-choice-options button { background: #f8f2e8; border-color: var(--line); color: #5e4b33; }
.choice-chip input:checked + span, .goods-choice-options .selected {
  background: #f6e5c3;
  border-color: #b08c4e;
  color: #5f4014;
  box-shadow: inset 0 -2px #a7792b;
}
dialog { color: var(--ink); }
dialog > header { gap: 12px; flex-wrap: wrap; }
dialog footer { background: #faf6ee; }
dialog::backdrop { background: #22190db0; }
.language-switch { border-color: #dfd0b7; background: #fffaf1; }
.language-switch button { color: #594936; }
.language-switch button.active { background: #f1dfbc; color: #4e3510; }
.translation-status { color: #644d28; border-color: #e3d4ba; background: #fffbf1; }
#toast { left: 50%; background: #302518; }

@media (max-width: 1120px) {
  .goods-filter-layout, .finished-filter-form .goods-filter-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  #filters .goods-choice-column, #filters .goods-value-column { grid-area: auto; }
}
@media (max-width: 790px) {
  #workspace, .sign-in { grid-template-columns: minmax(0, 1fr); }
  .login-brand { padding: 31px 24px; }
  .login-brand-inner { max-width: 330px; }
  .brand-rule { margin: 16px auto 12px; }
  .login-panel { padding: 32px 20px; }
  .sidebar { position: static; height: auto; }
  .brand { padding: 13px 15px; }
  .sidebar-logo { width: 145px; }
  .brand-caption { display: none; }
  .sidebar nav { display: flex; margin: 0; gap: 3px; }
  .sidebar nav button { width: auto; flex: 1 1 auto; padding: 8px; text-align: center; }
  .sidebar nav button span { display: none; }
  .form-grid, .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goods-filter-bottom, .list-foot { flex-wrap: wrap; }
  dialog { width: calc(100vw - 24px); }
  dialog .dialog-body { padding: 14px; max-height: 62vh; }
}
@media (max-width: 460px) {
  .form-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-panel { padding: 12px; }
  #filters:not(.goods-filter-form) .field { flex: 1 1 120px; min-width: 0; }
  .goods-choice-row, .goods-value-row { gap: 6px; }
}
