:root {
  --bg: #eef4ff;
  --text: #192235;
  --muted: #6b7890;
  --line: rgba(112, 132, 174, 0.24);
  --line-strong: rgba(111, 119, 176, 0.36);
  --glass: rgba(255, 255, 255, 0.54);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --accent: #6e70df;
  --accent-two: #4d9be8;
  --accent-soft: rgba(110, 112, 223, 0.12);
  --danger: #c44758;
  --success: #2b8b68;
  --shadow: 0 22px 60px rgba(72, 86, 128, 0.16);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  background:
    radial-gradient(circle at 12% 8%, rgba(157, 198, 255, 0.48), transparent 30%),
    radial-gradient(circle at 86% 14%, rgba(225, 183, 246, 0.42), transparent 28%),
    linear-gradient(135deg, #f7fbff 0%, #edf3ff 44%, #f9f1ff 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(24px);
  opacity: 0.36;
  pointer-events: none;
}

.ambient-one {
  width: 260px;
  height: 260px;
  right: 8%;
  top: 18%;
  background: #c9b4ff;
}

.ambient-two {
  width: 220px;
  height: 220px;
  left: 8%;
  bottom: 16%;
  background: #a5d7ff;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 28px;
}

.glass {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 28px;
  border-radius: var(--radius);
}

.brand {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

h1 {
  margin: 10px 0 8px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.health,
.version,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: #46516a;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}

.version {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-two));
  border: 0;
}

.workspace {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab,
.source,
.secondary,
.primary,
.copy-button,
.open-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.tab:hover,
.source:hover,
.secondary:hover,
.copy-button:hover,
.open-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.82);
}

.tab.active,
.source.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, rgba(110, 112, 223, 0.92), rgba(77, 155, 232, 0.88));
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.form-grid {
  display: grid;
  gap: 12px;
  align-items: center;
}

.aggregate-grid {
  grid-template-columns: minmax(240px, 1fr) auto;
}

.yingshi-grid {
  grid-template-columns: auto auto;
  justify-content: start;
}

.doubao-grid {
  grid-template-columns: minmax(260px, 1fr) auto;
}

input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

input:focus {
  border-color: rgba(110, 112, 223, 0.58);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-row {
  margin-top: 12px;
}

.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #7778e5, #4d9be8);
  font-weight: 750;
}

.primary:hover {
  transform: translateY(-1px);
}

.secondary {
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.message {
  min-height: 28px;
  margin: 14px 4px;
  color: var(--muted);
  font-size: 14px;
}

.message.error {
  color: var(--danger);
}

.results {
  display: grid;
  gap: 12px;
}

.result-card,
.image-card,
.json-card,
.empty,
.skeleton-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.result-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.result-title {
  margin: 8px 0 6px;
  font-size: 17px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.meta,
.short-link {
  color: var(--muted);
  font-size: 13px;
}

.short-link {
  max-width: min(620px, 100%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge.quark {
  color: #375f8f;
  background: rgba(180, 220, 255, 0.62);
}

.badge.baidu {
  color: #6262a3;
  background: rgba(217, 210, 255, 0.66);
}

.badge.aliyun,
.badge.tianyi,
.badge.uc,
.badge.mobile,
.badge.pikpak,
.badge.xunlei,
.badge.magnet,
.badge.ed2k {
  color: #596070;
  background: rgba(255, 255, 255, 0.66);
}

.badge.\31 15,
.badge.\31 23 {
  color: #596070;
  background: rgba(255, 255, 255, 0.66);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.open-button,
.copy-button {
  text-decoration: none;
  font-weight: 700;
  min-width: 90px;
  justify-content: center;
}

.empty {
  padding: 44px 18px;
  text-align: center;
  color: var(--muted);
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 18px;
}

.skeleton-card {
  height: 92px;
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.image-card {
  padding: 12px;
}

.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.54);
}

.image-card .actions {
  margin-top: 10px;
  justify-content: stretch;
}

.image-card .actions a,
.image-card .actions button {
  flex: 1;
}

.json-card {
  padding: 16px;
  overflow: auto;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #2a3347;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  min-width: 150px;
  max-width: calc(100vw - 44px);
  padding: 12px 16px;
  border-radius: 16px;
  color: #fff;
  background: rgba(42, 50, 76, 0.88);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

footer {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 18px;
  }

  .hero {
    display: block;
    padding: 22px;
  }

  .hero-meta {
    justify-content: flex-start;
    margin-top: 18px;
  }

  .aggregate-grid,
  .yingshi-grid,
  .doubao-grid,
  .result-card {
    grid-template-columns: 1fr;
  }

  .tabs,
  .segmented,
  .actions {
    width: 100%;
  }

  .tab,
  .source,
  .primary,
  .secondary,
  .open-button,
  .copy-button {
    flex: 1 1 auto;
  }

  .result-card .actions {
    justify-content: stretch;
  }
}

@media (max-width: 460px) {
  .workspace,
  .hero {
    border-radius: 18px;
  }

  .workspace {
    padding: 12px;
  }

  .tab,
  .source,
  .primary,
  .secondary {
    width: 100%;
  }

  .short-link {
    white-space: normal;
  }
}
