:root {
  color-scheme: light dark;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --accent: #ff8a2a;
  --glass: rgba(20, 20, 30, 0.55);
  --glass-light: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: #111 url("https://api.dujin.org/bing/1920.php") center/cover
    fixed;
  color: #f5f5f5;
}

.page {
  min-height: 100vh;
  padding: 32px clamp(16px, 5vw, 72px) 80px;
  backdrop-filter: saturate(1.3);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  flex: 1;
  text-align: center;
  font-size: clamp(28px, 4vw, 40px);
  color: var(--accent);
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.avatar-button {
  background: transparent;
  border: none;
  cursor: pointer;
}

.avatar-button img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  object-fit: cover;
}

.toolbar {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.28);
}

button.primary {
  background: var(--accent);
  color: #1b1207;
}

button.danger {
  background: rgba(255, 90, 90, 0.8);
}

.cards {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--glass-light);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.card-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.donut {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) calc(var(--percent) * 1%),
    rgba(255, 255, 255, 0.2) 0
  );
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 12px;
  background: rgba(14, 14, 24, 0.85);
  border-radius: 50%;
}

.donut span {
  position: relative;
  z-index: 1;
}

.card-meta {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.card-meta strong {
  font-size: 16px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red {
  background: #ff5b5b;
}

.dot-green {
  background: #26de81;
}

.dot-yellow {
  background: #f7b731;
}

.dot-gray {
  background: #7f8c8d;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 20, 0.55);
  z-index: 10;
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(400px, 90vw);
  background: var(--glass);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(18px);
}

.modal-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-card h2 {
  font-size: 20px;
}

.modal-card label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 14px;
}

.modal-card input {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 15, 30, 0.7);
  padding: 10px 12px;
  color: #fff;
}

.close {
  background: transparent;
  font-size: 24px;
  line-height: 1;
  padding: 0;
}

.helper {
  margin-top: 10px;
  color: #ffd36a;
  font-size: 12px;
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
  }

  .toolbar {
    flex-direction: column;
    gap: 16px;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: center;
  }
}
