:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  color: #16213a;
  background: #f3f7ff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(96, 145, 255, 0.2), transparent 32%),
    radial-gradient(circle at 90% 26%, rgba(109, 226, 196, 0.15), transparent 26%),
    #f3f7ff;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 10%, rgba(77, 126, 245, 0.22), transparent 38%),
    radial-gradient(circle at 90% 80%, rgba(74, 213, 173, 0.17), transparent 34%),
    #edf3ff;
}

.login-card {
  width: min(100%, 420px);
  padding: clamp(30px, 7vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 80px rgba(34, 65, 123, 0.18);
  text-align: center;
  backdrop-filter: blur(18px);
}

.login-mark {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 23px auto 18px;
  place-items: center;
  border-radius: 20px;
  color: white;
  background: linear-gradient(145deg, #2d72fa, #2355d6);
  box-shadow: 0 14px 30px rgba(45, 107, 240, 0.3);
  font-size: 27px;
  font-weight: 850;
}

.login-card h1 {
  margin-bottom: 8px;
  font-size: 31px;
  letter-spacing: -0.025em;
}

.login-card > p {
  margin-bottom: 22px;
  color: #738097;
  font-size: 14px;
}

.login-card input {
  width: 100%;
  height: 54px;
  padding: 0 17px;
  border: 1px solid #d9e3f3;
  border-radius: 15px;
  outline: none;
  background: #f8faff;
}

.login-card input:focus {
  border-color: #6492f7;
  box-shadow: 0 0 0 4px rgba(49, 109, 245, 0.1);
}

.login-card button {
  width: 100%;
  height: 52px;
  margin-top: 12px;
  border: 0;
  border-radius: 15px;
  color: white;
  background: #2868f3;
  font-weight: 750;
}

.login-card button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.login-card .login-message {
  min-height: 19px;
  margin: 12px 0 0;
  color: #b04444;
  font-size: 12px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
  padding: 64px 0 120px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 38px;
}

.eyebrow {
  color: #316df5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 640px;
  margin-bottom: 14px;
  font-size: clamp(38px, 7vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero p {
  margin-bottom: 0;
  color: #6c7890;
  font-size: 17px;
}

.service-panel {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  border: 1px solid #e3eafa;
  border-radius: 999px;
  color: #62708a;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  box-shadow: 0 10px 35px rgba(54, 83, 137, 0.08);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #aab4c5;
}

.dot.ok {
  background: #32b979;
  box-shadow: 0 0 0 4px rgba(50, 185, 121, 0.12);
}

.dot.error {
  background: #ee6666;
}

.divider {
  width: 1px;
  height: 16px;
  margin: 0 3px;
  background: #dce3f0;
}

.logout-button {
  padding: 5px 9px;
  border: 0;
  border-radius: 8px;
  color: #68758d;
  background: #edf2fa;
  font-size: 11px;
}

.search-card,
.result-card {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(46, 82, 145, 0.11);
  backdrop-filter: blur(18px);
}

.search-card {
  padding: clamp(24px, 5vw, 42px);
  border-radius: 28px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.section-heading h2,
.results-heading h2 {
  margin-bottom: 5px;
  font-size: 25px;
}

.section-heading p {
  margin-bottom: 26px;
  color: #78839a;
  font-size: 14px;
}

.step {
  display: grid;
  flex: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #2f6df5;
  background: #edf3ff;
  font-size: 12px;
  font-weight: 800;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.search-form input {
  min-width: 0;
  height: 56px;
  padding: 0 19px;
  border: 1px solid #dce5f5;
  border-radius: 16px;
  outline: none;
  color: #15213a;
  background: #f8faff;
  transition: border-color 160ms, box-shadow 160ms;
}

.search-form input:focus {
  border-color: #6492f7;
  box-shadow: 0 0 0 4px rgba(49, 109, 245, 0.1);
}

.search-form button,
.selection-bar button {
  border: 0;
  border-radius: 16px;
  color: white;
  background: #2868f3;
  font-weight: 750;
}

.search-form button {
  min-width: 130px;
  height: 56px;
  padding: 0 24px;
}

.search-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.message {
  min-height: 20px;
  margin: 12px 2px 0;
  color: #6d7890;
  font-size: 13px;
}

.message.error {
  color: #b04444;
}

.results-section {
  margin-top: 48px;
}

.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.results-heading h2 {
  margin: 7px 0 0;
}

.count {
  color: #7c879d;
  font-size: 13px;
}

.warnings {
  margin-bottom: 14px;
  padding: 12px 15px;
  border-radius: 12px;
  color: #8b5f20;
  background: #fff6df;
  font-size: 13px;
}

.results {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.result-card {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  width: 100%;
  min-width: 0;
  padding: 16px;
  border-radius: 20px;
  transition: border-color 160ms, transform 160ms;
}

.result-card.selected {
  border-color: #4e82f4;
  transform: translateY(-2px);
}

.result-main {
  min-width: 0;
}

.result-media {
  position: relative;
  height: 132px;
  overflow: hidden;
  border-radius: 15px;
  background: linear-gradient(145deg, #e8effc, #f6f9ff);
}

.result-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 220ms ease;
}

.result-media img.loaded {
  opacity: 1;
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #5276bd;
  background:
    radial-gradient(circle at 80% 16%, rgba(104, 157, 255, 0.32), transparent 34%),
    linear-gradient(145deg, #eaf1ff, #f8faff);
}

.image-placeholder span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(91, 127, 196, 0.2);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.68);
  font-size: 21px;
  font-weight: 850;
}

.type-badge,
.source-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.result-media > .type-badge {
  position: absolute;
  right: 9px;
  bottom: 9px;
  color: white;
  background: rgba(20, 35, 65, 0.78);
  backdrop-filter: blur(8px);
}

.result-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-card h3 {
  display: -webkit-box;
  margin-bottom: 7px;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-summary {
  display: -webkit-box;
  margin-bottom: 12px;
  overflow: hidden;
  color: #78849a;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.demo-badge {
  padding: 4px 7px;
  border-radius: 7px;
  color: #805c14;
  background: #fff1c7;
  font-size: 10px;
  font-weight: 700;
}

dl {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  margin: 0 0 12px;
}

dl div {
  display: flex;
  gap: 6px;
  font-size: 12px;
}

dt {
  color: #97a0b1;
}

dd {
  margin: 0;
  color: #546078;
}

.share-link {
  display: block;
  width: 100%;
  max-width: 580px;
  overflow: hidden;
  color: #316df5;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-actions {
  display: grid;
  flex: none;
  gap: 8px;
  width: 96px;
}

.select-button,
.detail-button,
.open-link {
  flex: none;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #d7e1f5;
  border-radius: 12px;
  color: #2f68df;
  background: #f7f9ff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.detail-button {
  border-color: transparent;
  color: #fff;
  background: #2868f3;
}

.open-link {
  color: #66758e;
  background: transparent;
}

.selected .select-button {
  border-color: #316df5;
  color: white;
  background: #316df5;
}

.detail-section {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(12, 22, 42, 0.68);
  backdrop-filter: blur(14px);
}

.modal-open {
  overflow: hidden;
}

.detail-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 38%) minmax(0, 1fr);
  width: min(100%, 980px);
  max-height: min(88vh, 820px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 34px 100px rgba(7, 18, 42, 0.4);
}

.detail-section .close-button {
  z-index: 2;
  color: #263550;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 18px rgba(25, 47, 84, 0.15);
}

.detail-gallery {
  display: grid;
  grid-auto-rows: minmax(160px, 1fr);
  gap: 4px;
  min-height: 540px;
  overflow-y: auto;
  background: #eaf0fb;
}

.detail-gallery img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.detail-placeholder {
  display: grid;
  min-height: 540px;
  place-items: center;
  color: #5075bd;
  background:
    radial-gradient(circle at 75% 18%, rgba(107, 158, 255, 0.35), transparent 32%),
    linear-gradient(150deg, #e7efff, #f7f9ff);
  font-size: 64px;
  font-weight: 900;
}

.detail-content {
  min-width: 0;
  padding: 38px;
  overflow-y: auto;
}

.detail-badges {
  display: flex;
  gap: 7px;
  margin-bottom: 13px;
}

.detail-badges .type-badge {
  color: #245fd9;
  background: #eaf1ff;
}

.source-badge {
  color: #52705f;
  background: #eaf8f0;
}

.detail-content h2 {
  margin-bottom: 10px;
  padding-right: 28px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.detail-summary {
  margin-bottom: 20px;
  color: #6e7b92;
  font-size: 14px;
  line-height: 1.75;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 25px;
}

.detail-meta div {
  display: block;
  padding: 12px;
  border-radius: 12px;
  background: #f6f8fc;
}

.detail-meta dt {
  margin-bottom: 5px;
  font-size: 10px;
}

.detail-meta dd {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-block {
  padding: 18px;
  border: 1px solid #e7ecf5;
  border-radius: 17px;
  background: #fbfcfe;
}

.preview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.preview-heading h3 {
  margin: 4px 0 0;
  font-size: 17px;
}

.preview-stats {
  color: #61718d;
  font-size: 11px;
  white-space: nowrap;
}

.preview-state {
  padding: 20px 8px;
  color: #7d899e;
  font-size: 12px;
  text-align: center;
}

.preview-state.error {
  color: #a64848;
  line-height: 1.6;
}

.preview-files {
  display: grid;
  max-height: 260px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.preview-files li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 4px;
  border-bottom: 1px solid #edf0f5;
}

.preview-files li:last-child {
  border-bottom: 0;
}

.file-icon {
  display: grid;
  flex: none;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #3569d8;
  background: #eaf1ff;
  font-size: 10px;
  font-weight: 800;
}

.preview-files li > div {
  min-width: 0;
}

.preview-files strong,
.preview-files small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-files strong {
  color: #34425c;
  font-size: 12px;
}

.preview-files small {
  margin-top: 3px;
  color: #919bad;
  font-size: 10px;
}

.preview-files .preview-more {
  justify-content: center;
  color: #78869d;
  font-size: 11px;
}

.detail-link {
  display: block;
  margin-top: 16px;
  overflow: hidden;
  color: #316df5;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  margin-top: 17px;
}

.detail-actions button {
  min-height: 46px;
  border-radius: 13px;
  font-weight: 750;
}

.secondary-action {
  border: 1px solid #d8e1f2;
  color: #315fbe;
  background: #f7f9fe;
}

.primary-action {
  border: 0;
  color: white;
  background: #2868f3;
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-media,
.skeleton-content i {
  display: block;
  border-radius: 12px;
  background: linear-gradient(90deg, #edf1f7 25%, #f7f9fc 50%, #edf1f7 75%);
  background-size: 220% 100%;
  animation: shimmer 1.25s infinite linear;
}

.skeleton-media {
  width: 176px;
  height: 132px;
}

.skeleton-content {
  display: grid;
  gap: 12px;
  width: 100%;
}

.skeleton-content i {
  width: 72%;
  height: 15px;
}

.skeleton-content i:nth-child(2) {
  width: 94%;
  height: 11px;
}

.skeleton-content i:nth-child(3) {
  width: 52%;
  height: 11px;
}

.selection-bar {
  position: fixed;
  right: 24px;
  bottom: 24px;
  left: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(calc(100% - 48px), 720px);
  margin: auto;
  padding: 14px 14px 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 19px;
  background: rgba(20, 32, 58, 0.94);
  color: white;
  box-shadow: 0 20px 60px rgba(16, 29, 56, 0.28);
  backdrop-filter: blur(16px);
}

.selection-bar div {
  min-width: 0;
}

.selection-label {
  display: block;
  margin-bottom: 3px;
  color: #9eabc3;
  font-size: 10px;
}

.selection-bar strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-bar button {
  flex: none;
  padding: 10px 17px;
  cursor: not-allowed;
  opacity: 0.58;
}

.selection-bar small {
  display: block;
  margin-top: 2px;
  font-size: 8px;
  font-weight: 500;
}

.transfer-section {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(13, 23, 43, 0.62);
  backdrop-filter: blur(14px);
}

.transfer-card {
  position: relative;
  width: min(100%, 520px);
  padding: clamp(27px, 6vw, 44px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(10, 23, 51, 0.35);
  text-align: center;
}

.close-button {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #738097;
  background: #f1f4fa;
  font-size: 22px;
}

.transfer-icon {
  display: grid;
  width: 68px;
  height: 68px;
  margin: 23px auto 19px;
  place-items: center;
  border-radius: 50%;
  background: #edf3ff;
}

.transfer-icon span {
  width: 26px;
  height: 26px;
  border: 3px solid #bfd0f7;
  border-top-color: #316df5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.transfer-icon.success {
  color: #1a9b61;
  background: #e7f8ef;
}

.transfer-icon.success span,
.transfer-icon.failed span {
  width: auto;
  height: auto;
  border: 0;
  animation: none;
  font-size: 30px;
  font-weight: 800;
}

.transfer-icon.success span::before {
  content: "✓";
}

.transfer-icon.failed {
  color: #cf4c4c;
  background: #fff0f0;
}

.transfer-icon.failed span::before {
  content: "×";
}

.transfer-card h2 {
  margin-bottom: 8px;
  font-size: 27px;
}

.transfer-card > p {
  margin-bottom: 0;
  color: #718097;
}

.transfer-resource {
  overflow: hidden;
  margin-top: 7px !important;
  color: #2d3d5d !important;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-steps {
  display: grid;
  gap: 11px;
  margin: 27px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.transfer-steps li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border: 1px solid #edf0f6;
  border-radius: 14px;
  color: #93a0b4;
  background: #fafbfe;
}

.transfer-steps li > span {
  display: grid;
  flex: none;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: #edf1f7;
  font-size: 11px;
  font-weight: 800;
}

.transfer-steps strong,
.transfer-steps small {
  display: block;
}

.transfer-steps strong {
  margin-bottom: 3px;
  color: inherit;
  font-size: 13px;
}

.transfer-steps small {
  font-size: 10px;
}

.transfer-steps li.active {
  border-color: #bcd0fb;
  color: #2f69e8;
  background: #f2f6ff;
}

.transfer-steps li.done {
  color: #258b5d;
  background: #f0faf5;
}

.transfer-steps li.done > span {
  color: white;
  background: #35ad75;
}

.transfer-error {
  margin-top: 17px;
  padding: 13px;
  border-radius: 12px;
  color: #a43e3e;
  background: #fff0f0;
  font-size: 13px;
  line-height: 1.6;
}

.back-button {
  width: 100%;
  margin-top: 17px;
  padding: 13px 18px;
  border: 0;
  border-radius: 13px;
  color: white;
  background: #253452;
  font-weight: 700;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  to {
    background-position-x: -220%;
  }
}

.empty-state {
  padding: 38px 20px;
  border: 1px dashed #ccd8ec;
  border-radius: 18px;
  color: #78849b;
  text-align: center;
}

.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;
}

[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 22px, 1040px);
    padding-top: 32px;
  }

  .hero {
    display: block;
  }

  .service-panel {
    width: fit-content;
    margin-top: 22px;
    flex-wrap: wrap;
    border-radius: 18px;
  }

  h1 {
    font-size: 42px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-form button {
    width: 100%;
  }

  .result-card {
    display: block;
    padding: 13px;
  }

  .result-media {
    height: 190px;
    margin-bottom: 17px;
  }

  .result-main {
    padding: 0 3px;
  }

  .result-actions {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin-top: 17px;
  }

  .open-link {
    grid-column: 1 / -1;
  }

  .select-button {
    width: auto;
    margin-top: 0;
  }

  dl {
    display: grid;
    gap: 7px;
  }

  .detail-section {
    align-items: end;
    padding: 0;
  }

  .detail-panel {
    display: block;
    width: 100%;
    max-height: 94vh;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 25px 25px 0 0;
  }

  .detail-gallery {
    grid-auto-flow: column;
    grid-auto-columns: 86%;
    grid-auto-rows: 220px;
    min-height: 220px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }

  .detail-gallery img {
    min-height: 220px;
    scroll-snap-align: start;
  }

  .detail-placeholder {
    min-height: 220px;
  }

  .detail-content {
    padding: 25px 17px 24px;
    overflow: visible;
  }

  .detail-content h2 {
    font-size: 25px;
    overflow-wrap: anywhere;
  }

  .detail-summary {
    overflow-wrap: anywhere;
  }

  .detail-meta {
    grid-template-columns: 1fr;
  }

  .preview-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .detail-actions {
    position: sticky;
    bottom: -24px;
    margin: 17px -17px -24px;
    padding: 13px 17px calc(13px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -10px 30px rgba(27, 45, 78, 0.08);
    backdrop-filter: blur(12px);
  }

  .skeleton-media {
    width: 100%;
    height: 190px;
    margin-bottom: 17px;
  }
}
