:root {
  color-scheme: light;
  --ink: #20242d;
  --muted: #60646e;
  --gold: #dfb95b;
  --paper: #fffdf8;
  --line: #e7decb;
  font: 15px/1.55 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: #f7f2e7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(22px, 4vw, 28px); }
h2 { font-size: 19px; }
a { color: #694a17; }
button, input, select { font: inherit; }
button, .button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 40px; padding: 6px 12px;
  border: 1px solid #c8b48b; border-radius: 7px; color: #65491b; background: var(--paper);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .button:hover { background: #f4ead5; }
.primary { background: var(--gold); color: #30240e; border-color: transparent; font-weight: 700; }
.quiet { border-color: transparent; background: transparent; }
.danger { color: #9a2027; }
:focus-visible { outline: 2px solid #815b1e; outline-offset: 3px; }
.top, .toolbar, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.top, .toolbar { justify-content: space-between; }
.top { background: var(--paper); padding: 11px clamp(12px, 4vw, 42px); border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); font-size: 19px; font-weight: 800; text-decoration: none; }
.status { padding: 8px clamp(12px, 4vw, 42px); background: #f1e7cd; }
.error, .dialog-error { color: #9a2027; }
.auth, .panel, dialog {
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper); padding: clamp(14px, 4vw, 28px);
}
.auth { width: min(430px, calc(100% - 24px)); margin: clamp(20px, 9vw, 100px) auto; }
.auth p, .files p, .panel p, dialog p, .meta { color: var(--muted); font-size: 13px; }
form { display: grid; gap: 8px; margin-top: 12px; }
form button { justify-self: start; }
input:not([type="checkbox"]), select {
  width: 100%; min-height: 40px; border: 1px solid #c8b48b; border-radius: 7px;
  padding: 6px 8px; background: #fff; color: var(--ink);
}
label { font-size: 13px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 5px; min-height: 36px; }
.workspace { display: grid; grid-template-columns: minmax(150px, 19%) minmax(0, 1fr); min-height: calc(100vh - 65px); }
.workspace nav { display: flex; flex-direction: column; gap: 5px; padding: 14px 10px; border-right: 1px solid var(--line); }
.workspace nav button { justify-content: flex-start; border-color: transparent; background: transparent; }
.workspace nav [aria-pressed="true"] { background: #ecdfc0; font-weight: 700; }
.files { background: var(--paper); min-width: 0; padding: clamp(12px, 4vw, 32px); }
.files .toolbar { margin-bottom: 14px; }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: center;
  min-height: 60px; padding: 9px 0; border-top: 1px solid var(--line);
}
.row strong, li, h1, h2 { overflow-wrap: anywhere; }
.row .actions { gap: 3px; }
.row .actions > * { font-size: 13px; padding-inline: 8px; }
.settings { max-width: 1050px; margin: auto; padding: clamp(12px, 4vw, 32px); }
.settings-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.departments-panel { grid-column: 1 / -1; }
.employee-details dl { display: grid; gap: 7px; margin: 12px 0; }
.employee-details dl div { display: grid; grid-template-columns: 4em minmax(0, 1fr); gap: 8px; }
.employee-details dt { color: var(--muted); }
.employee-details dd { margin: 0; overflow-wrap: anywhere; }
.issued-password { padding: 9px 12px; margin-bottom: 9px; border-radius: 7px; background: #f4ead5; }
.issued-password code { overflow-wrap: anywhere; font-size: 16px; }
#employee-delete, #employee-details-feedback:not(:empty) { margin-top: 10px; }
.employee-roster { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.employee-roster h3 { margin: 0; font-size: 15px; }
.employee-roster ul { max-height: 20rem; overflow-y: auto; margin-top: 6px; }
.employee-roster li { display: block; }
.employee-roster-button {
  display: grid; gap: 2px; justify-content: stretch; width: 100%; text-align: left; white-space: normal;
  overflow-wrap: anywhere;
}
.employee-roster-button[aria-pressed="true"] { background: #f4ead5; border-color: #c8b48b; }
ul { list-style: none; padding: 0; margin: 10px 0 0; }
li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding: 4px 0; }
dialog { width: min(530px, calc(100% - 24px)); max-height: calc(100vh - 22px); color: var(--ink); }
dialog::backdrop { background: #17120b65; }
dialog.preview { width: min(800px, calc(100% - 24px)); }
dialog .dialog-error { color: #9a2027; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f7f0df; padding: 12px; }
.preview img { display: block; max-width: 100%; max-height: 65vh; margin: 8px auto 0; }
.preview iframe { display: block; width: 100%; height: 60vh; border: 0; }
@media (max-width: 660px) {
  .workspace, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .workspace nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 5px 8px; }
  .row { grid-template-columns: minmax(0, 1fr); }
}
