:root {
  --red: #a82532;
  --deep: #741925;
  --gold: #c69b5b;
  --ink: #222631;
  --muted: #7b808c;
  --line: #e9e9ec;
  --bg: #f6f7fa;
}
html {
  scroll-behavior: smooth;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  font:
    14px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    sans-serif;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 10px 17px;
  background: #f0f1f5;
  color: var(--ink);
  transition:
    transform 0.16s ease,
    filter 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
  touch-action: manipulation;
}
button:hover {
  filter: brightness(0.96);
  box-shadow: 0 4px 14px #22263112;
}
button:active {
  transform: translateY(1px) scale(0.99);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
  transform: none;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.primary {
  background: var(--red);
  color: white;
}
.ghost {
  background: white;
  border: 1px solid var(--line);
}
.danger {
  color: var(--red);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 29px;
  line-height: 1.4;
  letter-spacing: 1px;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 16px;
}
small,
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 700;
}
.pill {
  display: inline-block;
  padding: 3px 10px;
  background: #f2f3f6;
  border-radius: 5px;
  font-size: 12px;
  color: #626878;
}
.pill.red {
  background: #fff0f0;
  color: var(--red);
}
.pill.green {
  background: #eaf6ee;
  color: #2b7850;
}
.pill.gold {
  background: #fff6e7;
  color: #987238;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff55;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}
.brand b {
  display: block;
  letter-spacing: 1px;
}
.brand small {
  font-size: 11px;
}
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-art {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #5d1422, #ad2936);
  color: #fff;
  padding: 65px 9%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-art:after {
  content: "";
  position: absolute;
  width: 580px;
  height: 580px;
  border: 70px solid #ffffff06;
  border-radius: 50%;
  right: -250px;
  bottom: -120px;
}
.login-art h1 {
  font-size: 48px;
  margin: 24px 0;
}
.login-art p {
  color: #eed6da;
  max-width: 400px;
}
.art-line {
  width: 65px;
  height: 3px;
  background: var(--gold);
  margin-bottom: 24px;
}
.login-panel {
  padding: 50px 10%;
  align-self: center;
}
.login-panel h2 {
  font-size: 28px;
}
.field {
  display: block;
  margin: 16px 0;
  min-width: 0;
}
fieldset.field {
  min-inline-size: 0;
}
.field span {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  color: #5c6270;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 14px;
  margin-top: 10px;
}
.check-grid label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.check-grid input {
  width: auto;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #dfe1e7;
  background: white;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px #a825320b;
}
textarea {
  min-height: 95px;
  resize: vertical;
}
.account-box {
  margin-top: 27px;
  padding: 17px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.account-box button {
  padding: 6px 10px;
  margin: 4px;
  font-size: 12px;
}
.demo-note {
  font-size: 12px;
  color: #846d4a;
  background: #fff9ed;
  padding: 11px 16px;
  border-radius: 8px;
  margin: 18px 0;
}
.shell {
  display: grid;
  grid-template-columns: 246px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 27px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  padding: 0 7px 26px;
  flex-shrink: 0;
}
.sidebar .mark {
  border-color: #e3ccd0;
  color: var(--red);
}
.sidebar .brand small {
  font-size: 10px;
}
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  text-align: left;
  width: 100%;
  background: none;
  margin: 5px 0;
  padding: 13px 16px;
  color: #69707e;
}
.sidebar nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: #d6d8de transparent;
  padding-right: 4px;
}
.sidebar nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar nav::-webkit-scrollbar-thumb {
  background: #d6d8de;
  border-radius: 99px;
}
.sidebar nav button.active {
  background: #f9ecee;
  color: var(--red);
  font-weight: 700;
}
.nav-icon {
  font-size: 19px;
  width: 23px;
}
.side-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 20px 8px 0;
  flex-shrink: 0;
}
.avatar {
  display: inline-grid;
  place-items: center;
  background: #f4e5e8;
  color: var(--red);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .side-bottom button {
  margin-top: 15px;
  width: 100%;
}
.main {
  min-width: 0;
}
.topbar {
  height: 76px;
  padding: 0 36px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.topbar b {
  font-size: 13px;
}
.workspace {
  padding: 28px 36px;
  max-width: 1450px;
  margin: auto;
  transition: opacity 0.18s ease;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  gap: 14px;
}
.heading p {
  margin: 5px 0;
  color: var(--muted);
}
.hero {
  background: linear-gradient(115deg, #7e1d29, #ae2a38);
  color: white;
  border-radius: 14px;
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 15px;
}
.hero h2 {
  font-size: 26px;
  margin: 8px 0;
}
.hero p {
  color: #ecd5d8;
  margin: 0;
}
.hero-number {
  font: 56px Georgia;
  color: #e8cb99;
  align-self: center;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
  margin: 23px 0;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.stat strong {
  display: block;
  font-size: 30px;
  font-weight: 650;
  margin: 7px 0;
}
.stat small {
  font-size: 12px;
}
.two {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 23px;
  margin-bottom: 20px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-header h3 {
  margin: 0;
}
.card-header button {
  font-size: 12px;
  padding: 5px 10px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 13px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child {
  border: 0;
}
.row p {
  margin: 3px 0;
  font-size: 12px;
  color: var(--muted);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  min-width: 0;
}
.toolbar input {
  max-width: 320px;
}
.toolbar select {
  width: auto;
  min-width: 140px;
}
.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 12px;
  color: #858a95;
  font-weight: 500;
  background: #f8f9fb;
  padding: 13px 15px;
}
td {
  padding: 17px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
td:first-child {
  white-space: normal;
  min-width: 180px;
}
td button {
  padding: 6px 12px;
  font-size: 12px;
}
.dept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.dept-card {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  border-top: 3px solid var(--red);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
@media (hover: hover) {
  .stat:hover,
  .dept-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px #2226310d;
  }
}
.dept-card h3 {
  font-size: 19px;
  margin: 12px 0;
}
.dept-card p {
  color: var(--muted);
  font-size: 12px;
}
.dept-meta {
  display: flex;
  gap: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}
.account-table {
  font-size: 12px;
}
.footer {
  margin: 26px 0;
  text-align: center;
  font-size: 11px;
  color: #969aa4;
}
dialog {
  border: 0;
  border-radius: 15px;
  padding: 0;
  width: min(600px, calc(100vw - 32px));
  max-height: 88vh;
  box-shadow: 0 20px 90px #0003;
  overflow: hidden;
}
dialog[open] {
  animation: dialog-in 0.2s ease-out;
}
dialog::backdrop {
  background: #17192366;
  backdrop-filter: blur(2px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 21px 25px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 4;
}
.modal-head h3 {
  margin: 0;
}
.modal-body {
  padding: 23px 25px;
  max-height: calc(88vh - 70px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.modal-body p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.modal-body img {
  max-width: 100%;
  border-radius: 8px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 23px;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.inline-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.inline-actions input {
  flex: 1 1 auto;
  min-width: 0;
}
.inline-actions button {
  flex: 0 0 auto;
}
.error {
  color: var(--red);
  font-size: 12px;
  min-height: 20px;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #222631;
  color: #fff;
  padding: 12px 22px;
  border-radius: 9px;
  display: none;
  z-index: 100;
  max-width: calc(100vw - 32px);
  text-align: center;
  box-shadow: 0 10px 32px #0003;
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.notice {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.notice:last-child {
  border: 0;
}
.notice h3 {
  margin-bottom: 5px;
}
.notice p {
  white-space: pre-wrap;
  color: #646b78;
}
.badge {
  border: 1px solid #ffffff44;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 11px;
}
.scope {
  font-size: 12px;
  background: #fff;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #6c7280;
}
.scope b {
  color: var(--red);
}
@media (max-width: 1050px) {
  .shell {
    grid-template-columns: 200px 1fr;
  }
  .workspace {
    padding: 23px;
  }
  .sidebar {
    padding: 20px 12px;
  }
  .dept-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .two {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .topbar {
    padding: 0 23px;
  }
}
@media (max-width: 700px) {
  .login {
    grid-template-columns: 1fr;
  }
  .login-art {
    padding: 30px;
    min-height: 260px;
  }
  .login-art h1 {
    font-size: 30px;
    margin: 16px 0;
  }
  .login-art > small {
    display: none;
  }
  .login-panel {
    padding: 30px 24px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: relative;
    padding: 14px;
  }
  .sidebar .brand {
    padding: 0 4px 12px;
  }
  .sidebar nav {
    display: flex;
    flex: none;
    min-height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 4px;
    padding-right: 0;
    touch-action: pan-x;
  }
  .sidebar nav button {
    white-space: nowrap;
    width: auto;
    font-size: 12px;
    padding: 8px 11px;
    gap: 6px;
  }
  .nav-icon {
    font-size: 15px;
    width: auto;
  }
  .side-bottom {
    display: none;
  }
  .topbar {
    height: 58px;
    padding: 0 17px;
  }
  .workspace {
    padding: 16px;
  }
  .heading {
    margin: 14px 0;
  }
  h1 {
    font-size: 23px;
  }
  .hero {
    padding: 23px;
  }
  .hero h2 {
    font-size: 21px;
  }
  .hero-number {
    display: none;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat strong {
    font-size: 27px;
  }
  .dept-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 17px;
  }
  .pair {
    grid-template-columns: 1fr;
  }
  .inline-actions {
    align-items: stretch;
  }
  .toolbar input {
    max-width: none;
  }
  .toolbar select {
    flex: 1;
  }
  .heading button {
    white-space: nowrap;
    padding: 9px 12px;
  }
  .topbar .identity small {
    display: none;
  }
}
.saving .workspace {
  pointer-events: none;
  opacity: 0.65;
}
.saving::after {
  content: "正在保存到服务器…";
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 110;
  background: #222631;
  color: #fff;
  padding: 9px 20px;
  border-radius: 8px;
}
code {
  overflow-wrap: anywhere;
}
.reminder-card {
  border-left: 4px solid var(--gold);
}
.reminder-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: #fff;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.event-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.event-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0;
}
.qr-box {
  text-align: center;
}
.qr-box svg {
  width: min(320px, 100%);
  height: auto;
}
.qr-box code {
  display: block;
  padding: 10px;
  background: #f5f5f7;
  border-radius: 8px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.calendar-day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.calendar-day.overdue {
  border-top: 3px solid var(--red);
}
.calendar-date {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
.calendar-task {
  display: block;
  width: 100%;
  text-align: left;
  background: #f8f9fb;
  margin: 8px 0;
}
.calendar-task small {
  display: block;
  margin: 3px 0;
}
.meter {
  width: 90px;
  height: 6px;
  background: #eee;
  border-radius: 99px;
  overflow: hidden;
  display: inline-block;
  margin-right: 8px;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--red);
}
.batch-toolbar {
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 10px;
}
.batch-record {
  width: auto;
}
.notice a,
.modal-body a {
  color: var(--red);
}
@media (max-width: 900px) {
  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .event-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }
  button {
    min-height: 44px;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 3px 12px #0001;
    padding: 8px 10px;
  }
  .sidebar .brand {
    display: none;
  }
  .sidebar nav {
    scroll-snap-type: x proximity;
    gap: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar nav::-webkit-scrollbar {
    display: none;
  }
  .sidebar nav button {
    scroll-snap-align: start;
    min-height: 42px;
    padding: 9px 12px;
    flex: 0 0 auto;
  }
  .calendar-grid {
    grid-template-columns: 1fr;
  }
  .event-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .event-card button {
    width: 100%;
  }
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .topbar > button {
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 8px 10px;
  }
  .workspace {
    padding: 12px;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow: hidden;
  }
  .main,
  .card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .scope {
    line-height: 1.5;
    padding: 9px 12px;
  }
  .heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .heading > button {
    width: 100%;
  }
  .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .toolbar > input,
  .toolbar > select {
    grid-column: 1 / -1;
    width: 100%;
  }
  .toolbar > button,
  .toolbar > a {
    width: 100%;
    text-align: center;
    min-width: 0;
    max-width: 100%;
    padding-left: 8px;
    padding-right: 8px;
  }
  .card-header {
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }
  .check-grid {
    grid-template-columns: 1fr;
  }
  dialog {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    inset: auto 0 0;
    margin: 0;
    border-radius: 18px 18px 0 0;
  }
  .modal-head {
    padding: 16px 18px;
  }
  .modal-body {
    padding: 18px;
    max-height: calc(100dvh - 61px);
    width: 100%;
  }
  .modal-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
  .modal-actions button {
    width: 100%;
    min-width: 0;
  }
  .table-wrap {
    margin-left: -5px;
    margin-right: -5px;
    max-width: calc(100vw - 14px);
  }
  .table-wrap table {
    min-width: 680px;
  }
  td,
  th {
    padding-left: 12px;
    padding-right: 12px;
  }
  .topbar b {
    max-width: 55%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #toast {
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
