:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #172033;
  background: #edf1f5;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

button, input { font: inherit; }

.toolbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid #d7dee7;
  background: rgba(255, 255, 255, .96);
}

.toolbar h1 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: 0; }
.toolbar p { margin: 4px 0 0; color: #667085; font-size: 13px; }
.actions { display: flex; gap: 10px; flex: none; }

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #cfd7e3;
  border-radius: 6px;
  color: #263247;
  background: #fff;
  cursor: pointer;
}

button:hover:not(:disabled) { background: #f4f6f8; }
button:disabled { cursor: not-allowed; opacity: .48; }
button.primary { border-color: #087f5b; color: #fff; background: #087f5b; }
button.primary:hover:not(:disabled) { background: #066e4e; }

.viewport { overflow-x: auto; padding: 28px 24px 52px; }

.report {
  width: 812px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #d4dce7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(24, 34, 51, .09);
}

.report-head {
  position: relative;
  padding: 26px 28px 22px;
  border-bottom: 1px solid #e1e6ed;
  background: #f7f9fb;
}

.report-head::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  content: "";
  background: #087f5b;
}

.eyebrow { margin-bottom: 7px; color: #087f5b; font-size: 11px; font-weight: 800; }
.report-title { font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: 0; }
.generated-at { margin-top: 8px; color: #6b7483; font-size: 12px; }

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 18px 24px;
  border-bottom: 1px solid #e1e6ed;
}

.summary-item {
  min-height: 76px;
  padding: 12px;
  border: 1px solid #dde3eb;
  border-radius: 6px;
  background: #fafbfc;
}

.label { color: #697386; font-size: 12px; }
.summary-value { margin-top: 7px; overflow-wrap: anywhere; font-size: 18px; font-weight: 800; }
.table-wrap { padding: 0 24px 22px; }

.table-row {
  display: grid;
  grid-template-columns: 138px 108px 78px 78px 78px 78px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 74px;
  border-bottom: 1px solid #e9edf2;
}

.table-head { min-height: 46px; color: #697386; font-size: 11px; font-weight: 800; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 800; }
.user-id, .muted { margin-top: 3px; color: #778195; font-size: 11px; }
.num { font-size: 13px; font-weight: 700; }
.share-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.share-value { color: #087f5b; font-size: 17px; font-weight: 900; }
.bar { height: 8px; margin-top: 7px; overflow: hidden; border-radius: 4px; background: #d9e3ed; }
.fill { height: 100%; border-radius: 4px; background: #087f5b; }
.loading-row { padding: 42px 0; color: #6b7483; text-align: center; }
.error-row { padding: 34px 20px; color: #b42318; text-align: center; }

dialog { width: min(400px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 24px 60px rgba(20, 29, 43, .25); }
dialog::backdrop { background: rgba(20, 29, 43, .5); }
dialog form { padding: 24px; }
dialog h2 { margin: 0; font-size: 20px; }
dialog p { margin: 8px 0 20px; color: #667085; font-size: 14px; }
dialog label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
dialog input { width: 100%; height: 42px; padding: 0 10px; border: 1px solid #cbd3df; border-radius: 5px; }
dialog button { width: 100%; margin-top: 16px; }
.form-error { min-height: 18px; margin-top: 7px; color: #b42318; font-size: 12px; }

@media (max-width: 620px) {
  .toolbar { align-items: flex-start; padding: 11px 14px; }
  .toolbar h1 { font-size: 17px; }
  .toolbar p { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .actions button { width: 40px; padding: 0; }
  .actions button span:last-child { display: none; }
  .viewport { padding: 18px 14px 38px; }
  .report { margin: 0; }
}

@media print {
  .toolbar { display: none; }
  .viewport { overflow: visible; padding: 0; }
  .report { box-shadow: none; }
}
