:root {
  --ink: #203644;
  --muted: #617887;
  --teal: #137c75;
  --teal-dark: #09645e;
  --blue: #3d5fa3;
  --surface: #fff;
  --canvas: #f2f6f8;
  --line: #dce6ec;
  --orange: #a25712;
  --danger: #b43b4a;
  --radius: 12px;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 15px;
  transition: background 0.12s;
}
button:hover {
  background: #edf4f6;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #c6d5de;
  background: #fff;
  border-radius: 8px;
  padding: 11px;
  color: var(--ink);
}
textarea {
  min-height: 95px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #399d96;
  outline-offset: 2px;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #3d5fa3;
  outline-offset: 3px;
}
label {
  display: block;
  font-weight: 600;
  line-height: 1.7;
}
label input,
label select,
label textarea {
  margin-top: 5px;
  font-weight: 400;
}
form > label {
  margin: 15px 0;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h2 {
  font-size: 24px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 17px;
}
p {
  line-height: 1.8;
}
small,
.muted {
  color: var(--muted);
}
.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}
.primary:hover {
  background: var(--teal-dark);
}
.danger {
  color: var(--danger);
  border-color: #ebc6cd;
}
.ghost {
  background: transparent;
}
.full {
  width: 100%;
}
.tag {
  color: var(--teal);
  font-size: 13px;
  font-weight: 600;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 700;
  font-size: 20px;
}
.brand-icon {
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 34px;
  line-height: 1;
}
.brand-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 5px;
}
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.login-story {
  background: #e4f0f1;
  padding: 42px 7%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.story-center {
  padding: 70px 0 20px;
}
.story-center h1 {
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.3;
  letter-spacing: -1px;
  margin-top: 20px;
}
.story-center p {
  color: #486672;
}
.dice-scene {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 30px 0;
  color: var(--teal);
}
.dice-scene span {
  font-size: 100px;
  line-height: 1;
  background: white;
  border-radius: 22px;
  padding: 12px;
  box-shadow: 0 10px 25px #146b6710;
}
.dice-scene span:nth-child(2) {
  transform: rotate(12deg);
  color: var(--blue);
}
.dice-scene span:nth-child(3) {
  transform: rotate(-8deg);
  font-size: 76px;
  color: #af7e2d;
}
.story-footer {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 30px;
  background: #fff;
}
.login-card {
  max-width: 360px;
  width: 100%;
}
.login-card h2 {
  margin-top: 15px;
  font-size: 28px;
}
.login-card form {
  margin-top: 26px;
}
.link-button {
  border: 0;
  background: none;
  color: var(--teal);
  padding: 15px 0;
}
.demo-details {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
  font-size: 12px;
}
.demo-details summary {
  cursor: pointer;
}
.demo-details p {
  margin: 12px 0;
}
.workspace {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 234px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  font-size: 18px;
}
nav {
  margin-top: 38px;
  display: grid;
  gap: 6px;
}
nav button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 13px 15px;
  color: var(--muted);
}
nav button.active {
  background: #e7f3f0;
  color: var(--teal-dark);
  font-weight: 700;
}
nav .nav-symbol {
  display: inline-block;
  width: 27px;
  font-size: 16px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
#identity {
  font-weight: 700;
  margin-bottom: 18px;
}
#identity small {
  display: block;
  font-weight: 400;
  margin-top: 6px;
}
.work-area {
  margin-left: 234px;
  min-width: 0;
  flex: 1;
}
.topbar {
  height: 70px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 38px;
  background: #ffffffb8;
  color: var(--muted);
  font-size: 12px;
}
main {
  max-width: 1500px;
  margin: auto;
  padding: 34px 38px;
  min-height: calc(100vh - 120px);
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 24px;
}
.page-heading h1 {
  font-size: 27px;
  margin: 0 0 9px;
}
.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.heading-actions {
  display: flex;
  gap: 8px;
}
.welcome-strip {
  background: #deeeee;
  border-left: 4px solid var(--teal);
  padding: 25px 28px;
  border-radius: 0 14px 14px 0;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.welcome-strip h2 {
  font-size: 22px;
  margin-bottom: 10px;
}
.welcome-strip p {
  margin-bottom: 0;
  color: #476570;
}
.welcome-strip .welcome-die {
  font-size: 68px;
  color: var(--teal);
  line-height: 1;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat small {
  display: block;
}
.stat strong {
  display: block;
  font-size: 32px;
  margin: 12px 0 8px;
  font-weight: 600;
}
.stat span {
  font-size: 12px;
  color: var(--muted);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.panel-header h3 {
  margin: 0;
}
.chart {
  display: flex;
  align-items: flex-end;
  height: 180px;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.chart-column {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: flex-end;
  height: 100%;
  font-size: 11px;
  color: var(--muted);
}
.chart-column progress {
  width: 100%;
  height: 16px;
  accent-color: var(--teal);
}
.chart-column strong {
  font-size: 20px;
  color: var(--ink);
}
.rank-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #edf2f5;
}
.rank-row:last-child {
  border: 0;
}
.rank-number {
  color: var(--teal);
  font-weight: 700;
}
.filters {
  display: flex;
  gap: 12px;
  align-items: end;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.filters label {
  font-size: 12px;
  flex: 1;
  min-width: 130px;
}
.filters label.search-field {
  flex: 2;
}
.filters button {
  height: 42px;
}
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}
th {
  background: #f8fafb;
  color: var(--muted);
  font-weight: 500;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 18px 20px;
  border-bottom: 1px solid #edf2f5;
}
tr:last-child td {
  border-bottom: 0;
}
td .cell-title {
  font-weight: 600;
}
td small {
  display: block;
  margin-top: 7px;
}
.cell-note {
  white-space: normal;
  min-width: 180px;
  max-width: 350px;
  line-height: 1.6;
}
.row-actions {
  display: flex;
  gap: 6px;
}
.row-actions button {
  padding: 7px 10px;
  font-size: 12px;
}
.badge {
  display: inline-block;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 11px;
  white-space: nowrap;
}
.badge.pending {
  background: #fff0d9;
  color: #87571b;
}
.badge.borrowed {
  background: #e8edfa;
  color: #3c58a2;
}
.badge.returning {
  background: #dfefef;
  color: #126961;
}
.badge.returned,
.badge.good {
  background: #e3f2e8;
  color: #2c744c;
}
.badge.rejected,
.badge.damaged,
.badge.overdue {
  background: #fae6ea;
  color: #a73b4a;
}
.badge.cancelled {
  background: #edf1f4;
  color: #586f7f;
}
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.game-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.game-art {
  height: 130px;
  background: #e2eef1;
  color: #337c82;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px;
}
.game-art.strategy {
  background: #e7eafa;
  color: #5367a5;
}
.game-art.party {
  background: #f7ecd9;
  color: #a47b2b;
}
.game-art.puzzle {
  background: #e3f1e8;
  color: #48896a;
}
.game-art strong {
  font-size: 26px;
  letter-spacing: 1px;
}
.game-art span {
  font-size: 58px;
}
.game-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.game-info h3 {
  margin-bottom: 9px;
}
.game-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0;
}
.game-description {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  flex: 1;
}
.game-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 12px;
}
.game-foot button {
  padding: 8px 12px;
}
.loan-cards {
  display: grid;
  gap: 16px;
}
.loan-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.loan-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
}
.loan-card-head h3 {
  margin: 0;
}
.loan-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0;
}
.loan-card .row-actions {
  margin-top: 15px;
}
.notice {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}
.notice h3 {
  margin-bottom: 10px;
}
.notice p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  margin: 0;
}
.notice-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}
.empty {
  padding: 55px 25px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #c5d7df;
  border-radius: 12px;
  background: #fff;
}
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}
.workspace-footer {
  padding: 18px 38px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  width: min(560px, 94vw);
  max-height: 90vh;
  color: var(--ink);
}
dialog::backdrop {
  background: #18354170;
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
  margin-bottom: 20px;
}
.dialog-header h2 {
  font-size: 20px;
  margin: 0;
}
.icon-button {
  border: 0;
  font-size: 24px;
  padding: 3px 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #203644;
  color: #fff;
  padding: 15px 22px;
  border-radius: 10px;
  z-index: 10;
  max-width: 90vw;
  box-shadow: 0 5px 20px #0002;
}
.toast.error {
  background: #9d3341;
}
.loading {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.detail-list {
  padding: 16px;
  background: #f2f6f8;
  border-radius: 8px;
  line-height: 1.8;
  margin-bottom: 18px;
}
.detail-list p {
  margin: 0 0 8px;
  font-size: 13px;
  white-space: pre-wrap;
}
@media (max-width: 1100px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  main {
    padding: 25px;
  }
  .sidebar {
    width: 205px;
  }
  .work-area {
    margin-left: 205px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .login-screen {
    grid-template-columns: 1fr;
  }
  .login-story {
    padding: 24px;
  }
  .story-center {
    padding: 28px 0 0;
  }
  .story-center h1 {
    font-size: 30px;
  }
  .dice-scene,
  .story-footer {
    display: none;
  }
  .login-panel {
    padding: 35px 25px;
  }
  .workspace {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 18px;
  }
  .sidebar .brand {
    font-size: 17px;
  }
  nav {
    display: flex;
    overflow-x: auto;
    margin-top: 20px;
    gap: 5px;
  }
  nav button {
    white-space: nowrap;
    padding: 10px;
  }
  .sidebar-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    padding-top: 15px;
    margin-top: 0;
  }
  #identity {
    margin: 0;
    font-size: 12px;
  }
  #identity small {
    display: none;
  }
  .sidebar-bottom button {
    width: auto;
    padding: 6px 12px;
  }
  .work-area {
    margin-left: 0;
  }
  .topbar {
    height: 45px;
    padding: 0 20px;
  }
  main {
    padding: 22px 16px;
  }
  .page-heading {
    flex-wrap: wrap;
  }
  .page-heading h1 {
    font-size: 24px;
  }
  .stats-grid {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .stat strong {
    font-size: 27px;
  }
  .game-grid {
    grid-template-columns: 1fr;
  }
  .welcome-strip {
    padding: 20px;
  }
  .welcome-die {
    display: none;
  }
  .panel {
    padding: 20px;
  }
  .filters {
    padding: 15px;
    gap: 10px;
  }
  .filters label {
    min-width: 100px;
  }
  .filters .search-field {
    min-width: 100%;
  }
  .form-grid {
    gap: 10px;
  }
  .workspace-footer {
    padding: 18px 16px;
    text-align: center;
  }
  .game-art {
    height: 110px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
