* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  background: #f5f7fb;
  color: #0f172a;
  min-height: 100vh;
}

.app {
  width: min(1200px, 95vw);
  margin: 24px auto;
  display: grid;
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 16px;
}

.hidden {
  display: none !important;
}

h1, h2, h3 {
  margin: 0 0 12px;
}

form {
  display: grid;
  gap: 8px;
}

input, select, button {
  height: 36px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0 10px;
  font-size: 14px;
}

button {
  cursor: pointer;
  background: #111827;
  color: #fff;
  border-color: #111827;
}

button.ghost {
  background: #fff;
  color: #0f172a;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: #eef2ff;
  border-color: #dbeafe;
  color: #1e3a8a;
}

.tab-btn-active {
  background: #1e3a8a;
  color: #fff;
  border-color: #1e3a8a;
}

.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th, td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 8px;
  font-size: 13px;
  vertical-align: top;
}

.expand-row td {
  background: #f8fafc;
}

.expand-panel {
  padding: 8px 0;
}

.user-work-list {
  display: grid;
  gap: 10px;
}

.work-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: flex-start;
}

.work-thumb {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}

.work-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #64748b;
}

.work-main {
  display: grid;
  gap: 4px;
}

.work-title {
  font-size: 14px;
  font-weight: 600;
}

.work-meta {
  color: #475569;
  font-size: 12px;
}

.hint {
  color: #64748b;
  margin: 8px 0 0;
  font-size: 13px;
}

.site-footer {
  width: min(1200px, 95vw);
  margin: 0 auto 24px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}

.filing-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer a {
  color: #475569;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

pre {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.modal {
  width: min(1100px, 96vw);
  max-height: 92vh;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-body {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 14px;
  padding: 14px;
  overflow: auto;
}

.modal-left,
.modal-right {
  display: grid;
  gap: 12px;
}

.modal-right section {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
}

.modal-right h4 {
  margin: 0 0 8px;
}

.user-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #cbd5e1;
}

.avatar-hidden {
  visibility: hidden;
}

.user-meta {
  display: grid;
  gap: 6px;
}

.meta-title {
  font-size: 16px;
  font-weight: 600;
}

.meta-sub {
  font-size: 12px;
  color: #475569;
  word-break: break-all;
}

.points-box {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.points-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.points-actions {
  display: flex;
  gap: 8px;
}

.points-form {
  display: grid;
  gap: 8px;
}

.modal-list {
  display: grid;
  gap: 8px;
}

.log-row {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  color: #334155;
}

.log-time {
  margin-top: 4px;
  color: #64748b;
}

@media (max-width: 900px) {
  .modal-body {
    grid-template-columns: 1fr;
  }

  .site-footer {
    display: grid;
  }
}
