:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --quiet: #86868b;
  --blue: #0066cc;
  --blue-hover: #0077ed;
  --page: #f5f5f7;
  --surface: #ffffff;
  --soft: #e8e8ed;
  --line: rgba(0, 0, 0, 0.08);
  --shell: min(1080px, calc(100vw - 48px));
  --ease: cubic-bezier(.28, .11, .32, 1);
  --spring: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
.shell { width: var(--shell); margin-inline: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  z-index: 200;
  top: -80px;
  left: 20px;
  padding: 10px 16px;
  color: white;
  background: var(--ink);
  border-radius: 10px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  height: 48px;
  background: rgba(250, 250, 252, .78);
  border-bottom: 1px solid rgba(0, 0, 0, .045);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.topbar-inner {
  width: var(--shell);
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
}
.brand-mark {
  position: relative;
  width: 17px;
  height: 17px;
  border: 1.5px solid currentColor;
  border-radius: 5px;
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
}
.brand-mark::before { top: 5px; }
.brand-mark::after { top: 9px; }
.report-total { color: var(--quiet); font-size: 12px; }
.report-total span { color: var(--ink); font-weight: 600; }

main { min-height: calc(100vh - 145px); }
.search-panel {
  padding-top: 64px;
  animation: reveal .7s var(--ease) both;
}
.search-box {
  position: relative;
  max-width: 760px;
  margin-inline: auto;
}
.search-box input {
  width: 100%;
  height: 58px;
  padding: 0 124px 0 55px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 18px;
  outline: none;
  font-size: 17px;
  letter-spacing: -.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .055);
  transition: border-color .25s ease, box-shadow .35s var(--ease), transform .35s var(--ease);
}
.search-box input:hover { box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 34px rgba(0, 0, 0, .075); }
.search-box input:focus {
  border-color: rgba(0, 102, 204, .4);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, .1), 0 14px 36px rgba(0, 0, 0, .08);
  transform: translateY(-1px);
}
.search-box input::placeholder { color: #86868b; }
.search-icon {
  position: absolute;
  z-index: 2;
  top: 19px;
  left: 21px;
  width: 17px;
  height: 17px;
  border: 1.7px solid var(--quiet);
  border-radius: 50%;
  pointer-events: none;
}
.search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 1.7px;
  background: var(--quiet);
  border-radius: 2px;
  transform: rotate(45deg);
}
.search-box kbd {
  position: absolute;
  top: 17px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: var(--quiet);
  background: var(--page);
  border: 0;
  border-radius: 7px;
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.search-clear {
  position: absolute;
  z-index: 3;
  top: 15px;
  right: 54px;
  height: 28px;
  padding: 0 9px;
  color: var(--blue);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.search-clear:hover { background: rgba(0, 102, 204, .08); }

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 28px;
}
.filter-tags {
  min-width: 0;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}
.filter-tags::-webkit-scrollbar { display: none; }
.filter-tag {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 15px;
  color: #515154;
  background: #e8e8ed;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .25s var(--spring);
}
.filter-tag:hover { color: var(--ink); background: #dedee3; transform: scale(1.025); }
.filter-tag.is-active { color: white; background: var(--ink); }
.filter-tag span { margin-left: 5px; opacity: .64; font-size: 11px; }
.sort-control { flex: 0 0 auto; }
.sort-control select {
  height: 36px;
  padding: 0 34px 0 14px;
  color: #515154;
  background: #e8e8ed;
  border: 0;
  border-radius: 999px;
  outline: none;
  font-size: 13px;
  cursor: pointer;
}
.sort-control select:hover { background-color: #dedee3; }

.library { padding: 38px 0 96px; }
.result-bar {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.result-bar p { margin: 0; color: var(--quiet); font-size: 12px; }
.result-bar strong { color: var(--ink); font-weight: 600; }
.result-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.result-bar button {
  padding: 7px 9px;
  color: var(--blue);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.result-bar button:hover { color: var(--blue-hover); background: rgba(0, 102, 204, .07); }
.result-bar .restore-hidden {
  color: var(--muted);
  background: rgba(0, 0, 0, .035);
}
.result-bar .restore-hidden:hover { color: var(--ink); background: rgba(0, 0, 0, .07); }

.report-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  min-height: 280px;
}
.report-card {
  --card-order: 0;
  position: relative;
  min-width: 0;
  min-height: 260px;
  display: grid;
  grid-template-columns: minmax(240px, 31%) 1fr;
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, .045);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .025);
  transform: translateZ(0);
  animation: card-in .62s var(--ease) both;
  animation-delay: calc(var(--card-order) * 55ms);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s ease;
}
.report-card:hover {
  transform: translateY(-3px) scale(1.006);
  border-color: rgba(0, 0, 0, .065);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .09);
}
.report-card.is-pinned {
  border-color: rgba(0, 102, 204, .3);
  box-shadow: 0 10px 34px rgba(0, 102, 204, .1);
}
.card-cover {
  position: relative;
  min-height: 240px;
  margin: 10px;
  padding: 22px;
  overflow: hidden;
  background: linear-gradient(145deg, #dce8ff 0%, #b8ccff 52%, #91b2ff 100%);
  border-radius: 22px;
  isolation: isolate;
}
.card-cover::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 230px;
  height: 230px;
  right: -92px;
  bottom: -118px;
  background: rgba(255, 255, 255, .55);
  border-radius: 50%;
  filter: blur(2px);
  transition: transform .65s var(--ease);
}
.card-cover::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 110px;
  height: 110px;
  top: -54px;
  left: -46px;
  background: rgba(255, 255, 255, .34);
  border-radius: 50%;
  filter: blur(1px);
  transition: transform .65s var(--ease);
}
.report-card:hover .card-cover::before { transform: translate(-12px, -8px) scale(1.08); }
.report-card:hover .card-cover::after { transform: translate(8px, 10px) scale(1.08); }
.report-card[data-accent="rose"] .card-cover { background: linear-gradient(145deg, #ffe4ed 0%, #fac4d7 52%, #f29cbc 100%); }
.report-card[data-accent="teal"] .card-cover { background: linear-gradient(145deg, #ddf8f4 0%, #a9e7dd 52%, #70cdbd 100%); }
.report-card[data-accent="gold"] .card-cover { background: linear-gradient(145deg, #fff5d6 0%, #f7dda0 52%, #eec36b 100%); }
.cover-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.status-chip,
.category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.status-chip { color: white; background: rgba(29, 29, 31, .82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.category-chip { color: rgba(29, 29, 31, .72); background: rgba(255, 255, 255, .56); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.cover-code {
  position: absolute;
  z-index: 2;
  left: 22px;
  right: 22px;
  bottom: 21px;
  overflow: hidden;
  color: rgba(29, 29, 31, .64);
  font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 34px 40px 32px;
}
.card-headline-row {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}
.card-date { margin: 0; color: var(--quiet); font-size: 12px; }
.card-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-action {
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--page);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .25s var(--spring);
}
.card-action:hover { color: var(--blue); background: #edf5ff; transform: translateY(-1px); }
.card-pin[aria-pressed="true"] {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}
.card-pin[aria-pressed="true"]:hover { color: white; background: var(--blue-hover); }
.card-delete:hover {
  color: #b42318;
  background: #fff0ee;
  border-color: rgba(180, 35, 24, .12);
}
.card-body h3 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.14;
  font-weight: 650;
  letter-spacing: -.035em;
}
.card-body > p {
  max-width: 670px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}
.card-tags button {
  min-height: 27px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--page);
  border: 0;
  border-radius: 999px;
  font-size: 10px;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s var(--spring);
}
.card-tags button:hover { color: var(--blue); background: #edf5ff; transform: translateY(-1px); }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: auto;
  padding-top: 22px;
}
.read-time { color: var(--quiet); font-size: 11px; }
.open-report {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--blue);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.open-report::after { content: "›"; font-size: 20px; line-height: 1; transition: transform .3s var(--spring); }
.open-report:hover { color: var(--blue-hover); text-decoration: underline; text-underline-offset: 3px; }
.open-report:hover::after { transform: translateX(3px); }

.skeleton-card {
  min-height: 260px;
  display: grid;
  grid-template-columns: minmax(240px, 31%) 1fr;
  padding: 10px;
  background: var(--surface);
  border-radius: 30px;
  overflow: hidden;
}
.skeleton-card div { min-height: 240px; background: #e8e8ed; border-radius: 22px; }
.skeleton-card span {
  grid-column: 2;
  display: block;
  height: 12px;
  margin: 25px 38px -10px;
  background: linear-gradient(90deg, #ececef 25%, #f7f7f8 50%, #ececef 75%);
  background-size: 200% 100%;
  border-radius: 99px;
  animation: shimmer 1.6s linear infinite;
}
.skeleton-card span:nth-of-type(1) { width: 28%; }
.skeleton-card span:nth-of-type(2) { width: 72%; height: 24px; }
.skeleton-card span:nth-of-type(3) { width: 52%; }

.empty-state,
.load-error {
  padding: 76px 20px;
  text-align: center;
  background: var(--surface);
  border-radius: 28px;
}
.empty-state > span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  color: var(--quiet);
  background: var(--page);
  border-radius: 50%;
  font-size: 20px;
}
.empty-state h2,
.load-error h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.empty-state p,
.load-error p { margin: 9px 0 22px; color: var(--muted); font-size: 14px; }
.empty-state button,
.load-error button {
  min-height: 38px;
  padding: 0 17px;
  color: white;
  background: var(--blue);
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.empty-state button:hover,
.load-error button:hover { background: var(--blue-hover); }

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-top: 44px;
  padding-top: 25px;
  border-top: 1px solid rgba(0, 0, 0, .08);
}
.pagination button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .25s var(--spring);
}
.pagination button:hover:not(:disabled) { color: var(--blue); background: var(--surface); transform: scale(1.035); }
.pagination button:disabled { color: #b6b6ba; cursor: not-allowed; }
.page-direction:first-child { justify-self: start; }
.page-direction:last-child { justify-self: end; }
.page-numbers { display: flex; align-items: center; gap: 5px; }
.page-numbers button { min-width: 38px; padding: 0; }
.page-numbers button.is-current { color: white; background: var(--ink); }
.page-ellipsis { display: grid; place-items: center; width: 26px; color: var(--quiet); }
.noscript { margin: 28px 0 0; padding: 14px; background: #fff5d6; border-radius: 12px; }

footer { padding: 26px 0; background: #ececef; border-top: 1px solid rgba(0, 0, 0, .055); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-inner p { margin: 0; color: var(--quiet); font-size: 11px; }
.footer-inner > div { display: flex; gap: 20px; }
.footer-inner a { color: var(--muted); font-size: 11px; text-decoration: none; }
.footer-inner a:hover { color: var(--ink); text-decoration: underline; }

:focus-visible { outline: 3px solid rgba(0, 102, 204, .3); outline-offset: 3px; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(16px) scale(.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 820px) {
  .report-card,
  .skeleton-card { grid-template-columns: minmax(200px, 36%) 1fr; }
  .card-body { padding: 30px 28px 28px; }
  .card-tags { margin-top: 16px; }
}

@media (max-width: 640px) {
  :root { --shell: min(100% - 28px, 1080px); }
  .topbar-inner { width: calc(100% - 28px); }
  .search-panel { padding-top: 36px; }
  .search-box input { height: 54px; padding-left: 51px; padding-right: 105px; font-size: 16px; border-radius: 16px; }
  .search-icon { top: 18px; left: 20px; width: 16px; height: 16px; }
  .search-box kbd { top: 15px; right: 15px; }
  .search-clear { top: 13px; right: 50px; }
  .filter-row { align-items: stretch; flex-direction: column; gap: 12px; margin-top: 21px; }
  .sort-control select { width: 100%; }
  .library { padding-top: 28px; padding-bottom: 66px; }
  .result-bar { align-items: flex-start; }
  .result-actions { flex-wrap: wrap; }
  .report-card,
  .skeleton-card { grid-template-columns: 1fr; border-radius: 25px; }
  .card-cover { min-height: 175px; margin-bottom: 0; border-radius: 18px; }
  .card-body { padding: 25px 24px 26px; }
  .card-headline-row { align-items: flex-start; margin-bottom: 13px; }
  .card-actions { gap: 5px; }
  .card-action { min-height: 44px; padding: 0 12px; }
  .card-body h3 { font-size: 25px; }
  .card-body > p { font-size: 13px; }
  .skeleton-card div { min-height: 175px; }
  .skeleton-card span { grid-column: 1; margin-inline: 18px; }
  .pagination { grid-template-columns: 1fr 1fr; }
  .page-numbers { grid-row: 1; grid-column: 1 / -1; justify-content: center; }
  .page-direction:first-child { grid-row: 2; }
  .page-direction:last-child { grid-row: 2; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
