@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');

:root {
  --canvas: #f2f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #15171b;
  --muted: #8590a2;
  --line: #e7ecf2;
  --primary: #5478df;
  --primary-deep: #4266d0;
  --danger: #df1033;
  --warning: #ffc91b;
  --shadow-soft: 0 8px 24px rgba(38, 51, 77, 0.08);
  --shadow-modal: 0 28px 70px rgba(25, 34, 53, 0.2);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 86% 8%, rgba(84, 120, 223, 0.08), transparent 23rem),
    var(--canvas);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.app-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 86px;
  padding: 0 48px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 26px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(229, 234, 241, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  width: max-content;
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.brand-title {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-subtitle { font-size: 15px; font-weight: 700; }

.brand-logo {
  justify-self: end;
  width: 142px;
  height: 48px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.filters { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.filter {
  position: relative;
  height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 24px;
  color: #25272c;
  background: transparent;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.filter:hover { color: var(--primary); background: #f4f7ff; }
.filter:active { transform: translateY(1px); }
.filter.is-active { color: #fff; background: var(--primary); box-shadow: 0 7px 18px rgba(84, 120, 223, 0.3); }

.count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  margin-left: 4px;
  padding: 0 7px;
  color: #0b0d12;
  background: #dbe4ff;
  border-radius: 99px;
  font-size: 14px;
}

.filter.is-active .count { color: var(--primary-deep); background: #fff; }

.content { padding: 18px 48px 54px; }

.result-bar {
  min-height: 34px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-bar p { margin: 0; color: #687488; font-size: 13px; font-weight: 600; }
.result-bar p span { color: #a2aaba; font-weight: 500; }

.refresh-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #8a96a8;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color 160ms, background 160ms, transform 300ms;
}

.refresh-button:hover { color: var(--primary); background: #fff; }
.refresh-button.is-spinning { transform: rotate(360deg); }
.refresh-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.gallery {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 22px;
}

.card {
  position: relative;
  aspect-ratio: 1.05 / 1;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(229, 234, 240, 0.85);
  border-radius: 16px;
  background:
    linear-gradient(45deg, #f7f9fc 25%, transparent 25%, transparent 75%, #f7f9fc 75%),
    linear-gradient(45deg, #f7f9fc 25%, #fff 25%, #fff 75%, #f7f9fc 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  isolation: isolate;
  animation: card-in 460ms both cubic-bezier(.2,.7,.2,1);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.card:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(38, 51, 77, 0.14); }
.card:focus-visible { outline: 3px solid rgba(84, 120, 223, 0.36); outline-offset: 3px; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 12px;
  transition: transform 280ms ease;
}

.card:hover img { transform: scale(1.035); }

.status-badge {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  min-width: 76px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(29, 39, 58, 0.12);
  font-size: 14px;
  font-weight: 800;
}

.status-approved { color: #fff; background: var(--danger); }
.status-pending { color: #191919; background: var(--warning); }
.status-rejected { color: var(--primary); background: #fff; }

.card-id {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 5px 9px;
  color: #7e899a;
  background: rgba(255,255,255,.88);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 180ms, transform 180ms;
}

.card:hover .card-id { opacity: 1; transform: none; }

.empty-state { padding: 15vh 20px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-icon { width: 62px; height: 62px; margin: 0 auto 18px; display: grid; place-items: center; color: #fff; background: var(--primary); border-radius: 50%; font-size: 28px; box-shadow: 0 10px 24px rgba(84,120,223,.25); }
.empty-state h2 { margin: 0 0 8px; font-size: 21px; }
.empty-state p { margin: 0; color: var(--muted); }

.modal[hidden] { display: none; }
.modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 4.5vh 8vw; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.84); backdrop-filter: blur(4px); animation: fade-in 180ms both; }

.modal-panel {
  position: relative;
  width: min(1640px, 100%);
  height: min(920px, 91vh);
  display: grid;
  grid-template-rows: 82px 1fr 100px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(230, 235, 241, 0.96);
  border-radius: 19px;
  box-shadow: var(--shadow-modal);
  animation: modal-in 260ms both cubic-bezier(.2,.78,.25,1);
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.99); } }

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 0 24px 0 34px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 2px 0 0; font-size: 20px; }
.eyebrow { margin: 0; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.close-button {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #777b82;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: transform 160ms, background 160ms;
}
.close-button:hover { transform: rotate(5deg) scale(1.05); background: #50545c; }

.preview-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, #fff 0, #fbfcfe 45%, #f5f7fa 100%);
}

.preview-stage::before {
  content: "";
  position: absolute;
  width: min(56vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(84, 120, 223, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(84, 120, 223, 0.025), 0 0 0 140px rgba(84, 120, 223, 0.02);
}

.preview-media {
  position: absolute;
  z-index: 1;
  inset: 42px 56px 34px;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
}

.preview-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 16px 25px rgba(34, 44, 64, 0.12));
}
.preview-index { position: absolute; z-index: 2; top: 22px; right: 26px; color: #a1aaba; font-size: 12px; font-weight: 700; }

.modal-actions { display: flex; align-items: center; justify-content: space-between; padding: 0 36px; border-top: 1px solid var(--line); background: #fff; }
.decision-actions { display: flex; gap: 18px; }
.button { height: 54px; padding: 0 30px; border-radius: 10px; font-weight: 800; font-size: 16px; cursor: pointer; transition: transform 160ms, box-shadow 160ms, background 160ms; }
.button:hover { transform: translateY(-2px); }
.button-delete { display: inline-flex; align-items: center; gap: 10px; color: #fff; border: 1px solid var(--primary); background: var(--primary); text-decoration: none; }
.button-delete svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.button-delete:hover { box-shadow: 0 8px 18px rgba(84,120,223,.24); }
.button-reject { min-width: 120px; color: var(--primary); border: 2px solid var(--primary); background: #fff; }
.button-reject:hover { background: #f5f8ff; }
.button-approve { min-width: 138px; color: #fff; border: 2px solid var(--danger); background: var(--danger); }
.button-approve:hover { box-shadow: 0 8px 18px rgba(223,16,51,.2); }

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 30px;
  padding: 12px 20px;
  color: #fff;
  background: #222731;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15,20,30,.22);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms, transform 180ms;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1500px) {
  .topbar { padding-inline: 30px; grid-template-columns: 220px 1fr 160px; gap: 14px; }
  .content { padding-inline: 30px; }
  .gallery { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
  .filter { padding-inline: 15px; font-size: 14px; }
}

@media (max-width: 1180px) {
  .topbar { grid-template-columns: 1fr auto; padding-top: 15px; }
  .filters { grid-column: 1 / -1; grid-row: 2; padding-bottom: 14px; justify-content: center; overflow-x: auto; }
  .brand-logo { grid-column: 2; grid-row: 1; }
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .topbar { padding-inline: 18px; }
  .content { padding: 14px 18px 40px; }
  .brand-title { font-size: 22px; }
  .brand-subtitle { display: none; }
  .brand-logo { width: 112px; height: 40px; }
  .filters { justify-content: flex-start; margin-inline: -18px; padding-inline: 18px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; height: 42px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .status-badge { top: 10px; left: 10px; min-width: 66px; height: 31px; padding-inline: 11px; font-size: 12px; }
  .modal { padding: 0; }
  .modal-panel { width: 100%; height: 100%; border-radius: 0; grid-template-rows: 72px 1fr 150px; }
  .modal-actions { padding: 15px 18px; align-items: stretch; flex-direction: column-reverse; gap: 12px; }
  .decision-actions { width: 100%; gap: 10px; }
  .decision-actions .button { flex: 1; }
  .button { height: 50px; padding-inline: 18px; }
  .button-delete { justify-content: center; }
  .preview-media { inset: 48px 18px 24px; }
}

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