:root {
  color-scheme: light;
  --bg: #eef5ff;
  --surface: rgba(255, 255, 255, 0.64);
  --surface-strong: rgba(255, 255, 255, 0.86);
  --ink: #122033;
  --muted: #64748b;
  --line: rgba(255, 255, 255, 0.48);
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #059669;
  --red: #dc2626;
  --purple: #7c3aed;
  --shadow: 0 24px 80px rgba(30, 64, 175, 0.14);
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: rgba(30, 41, 59, 0.64);
  --surface-strong: rgba(30, 41, 59, 0.86);
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --line: rgba(71, 85, 105, 0.48);
  --blue: #60a5fa;
  --blue-dark: #3b82f6;
  --green: #34d399;
  --red: #f87171;
  --purple: #a78bfa;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% 6%, rgba(59, 130, 246, 0.18), transparent 23rem),
    radial-gradient(circle at 88% 4%, rgba(139, 92, 246, 0.14), transparent 25rem),
    radial-gradient(circle at 55% 90%, rgba(52, 211, 153, 0.10), transparent 22rem),
    linear-gradient(145deg, #0b1121 0%, var(--bg) 52%, #130f1f 100%);
}

[data-theme="dark"] .result-card {
  background: rgba(30, 41, 59, 0.92);
}

[data-theme="dark"] .search-card,
[data-theme="dark"] .panel {
  background: rgba(30, 41, 59, 0.72);
}

[data-theme="dark"] .disk-tab {
  background: rgba(30, 41, 59, 0.56);
  border-color: rgba(71, 85, 105, 0.46);
}

[data-theme="dark"] .disk-tab.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(30, 41, 59, 0.7));
  border-color: rgba(96, 165, 250, 0.45);
}

[data-theme="dark"] input,
[data-theme="dark"] select {
  background: rgba(30, 41, 59, 0.74);
  border-color: rgba(71, 85, 105, 0.46);
  color: #f1f5f9;
}

[data-theme="dark"] .button.primary {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
}

[data-theme="dark"] .button.ghost {
  color: #94a3b8;
}

[data-theme="dark"] .resource-strip span {
  background: rgba(30, 41, 59, 0.58);
  border-color: rgba(71, 85, 105, 0.46);
  color: #cbd5e1;
}

[data-theme="dark"] .modal-card,
[data-theme="dark"] .account-dialog {
  background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .mini-task {
  background: rgba(30, 41, 59, 0.62);
}

[data-theme="dark"] .empty-state {
  background: rgba(30, 41, 59, 0.42);
  border-color: rgba(71, 85, 105, 0.4);
  color: #94a3b8;
}

[data-theme="dark"] .toast {
  background: #1e293b;
  border: 1px solid rgba(71, 85, 105, 0.4);
}

[data-theme="dark"] .copy-card {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(71, 85, 105, 0.4);
}

[data-theme="dark"] .disk-chip.quark {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

[data-theme="dark"] .disk-chip.baidu {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

[data-theme="dark"] .icon-button {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(71, 85, 105, 0.46);
  color: #94a3b8;
}

[data-theme="dark"] .modal-status.pending {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

[data-theme="dark"] .modal-status.success {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

[data-theme="dark"] .modal-status.error {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

[data-theme="dark"] .modal-progress {
  background: rgba(71, 85, 105, 0.4);
}

[data-theme="dark"] .loading-block span {
  background: linear-gradient(90deg, rgba(71, 85, 105, 0.4), rgba(51, 65, 85, 0.6), rgba(71, 85, 105, 0.4));
}

[data-theme="dark"] .account-row {
  border-color: rgba(71, 85, 105, 0.4);
  background: rgba(30, 41, 59, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 6%, rgba(56, 189, 248, 0.36), transparent 23rem),
    radial-gradient(circle at 88% 4%, rgba(124, 58, 237, 0.24), transparent 25rem),
    radial-gradient(circle at 55% 90%, rgba(16, 185, 129, 0.18), transparent 22rem),
    linear-gradient(145deg, #f8fbff 0%, var(--bg) 52%, #f7f0ff 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
}

button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: calc(26px + env(safe-area-inset-top)) 0 calc(34px + env(safe-area-inset-bottom));
}

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

.eyebrow {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1 {
  max-width: 780px;
  font-size: clamp(32px, 5.2vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.hero-subtitle {
  max-width: 560px;
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 700;
  line-height: 1.7;
}

.search-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.82);
}

.search-card {
  padding: 18px;
  margin-bottom: 14px;
}

.search-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.search-card-head h2 {
  margin-top: 4px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.disk-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.disk-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  cursor: pointer;
  padding: 12px;
  text-align: left;
  transition: 180ms ease;
}

.disk-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.3);
}

.disk-tab.active {
  border-color: rgba(37, 99, 235, 0.55);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(255, 255, 255, 0.7));
  box-shadow: 0 12px 36px rgba(37, 99, 235, 0.12);
}

.disk-tab.baidu.active {
  border-color: rgba(37, 99, 235, 0.55);
}

.disk-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 900;
}

.disk-tab.quark .disk-icon {
  background: var(--green);
}

.disk-tab strong,
.disk-tab small {
  display: block;
}

.disk-tab small {
  margin-top: 3px;
  color: var(--muted);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px;
}

.search-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-size: 16px;
  outline: none;
  padding: 0 16px;
}

input:focus,
select:focus {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  padding: 0 16px;
  text-decoration: none;
  white-space: nowrap;
}

.button.primary {
  border: none;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #ffffff;
  font-weight: 800;
}

.button.ghost {
  min-height: 36px;
  color: var(--muted);
}

.button.tiny {
  min-height: 32px;
  border-radius: 999px;
  font-size: 12px;
}

.button.full {
  width: 100%;
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
}







.advanced-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}



.resource-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}



.check-line input {
  width: 16px;
  min-height: auto;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.panel {
  overflow: hidden;
}

.recent-panel {
  align-self: start;
  position: sticky;
  top: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 18px;
}

.panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.results-list,
.task-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
}

.result-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.result-title-row h3 {
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.disk-chip {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.disk-chip.quark {
  background: #ecfdf5;
  color: var(--green);
}

.disk-chip.baidu {
  background: #eff6ff;
  color: var(--blue);
}

.mini-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.mini-task strong,
.mini-task span {
  display: block;
}

.mini-task strong {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.mini-task span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mini-task.failed {
  border-color: rgba(220, 38, 38, 0.22);
}

.empty-state {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
  text-align: center;
  padding: 22px;
}

.empty-state.compact {
  min-height: 130px;
}

.loading-search {
  display: grid;
  place-items: center;
  min-height: 220px;
  text-align: center;
  gap: 16px;
}

.loading-search .spinner {
  width: 48px;
  height: 48px;
  margin: 0;
  border-width: 4px;
}

.loading-search p {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}


.share-dialog,
.account-dialog {
  width: min(520px, calc(100vw - 28px));
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: transparent;
}

dialog:not([open]) {
  display: none;
}

.dialog-fallback-lock {
  overflow: hidden;
}

.share-dialog.fallback-open,
.account-dialog.fallback-open {
  display: block;
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 50;
  transform: translate(-50%, -50%);
}

.dialog-fallback-lock::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(4px);
}

.share-dialog::backdrop,
.account-dialog::backdrop {
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(4px);
}

.modal-card,
.account-dialog {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  backdrop-filter: blur(28px) saturate(160%);
}

.modal-card {
  padding: 28px;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  cursor: pointer;
}

.modal-card > .icon-button {
  position: absolute;
  top: 16px;
  right: 16px;
}

.modal-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 14px;
}

.modal-status.pending {
  background: #eff6ff;
  color: var(--blue);
}

.modal-status.success {
  background: #ecfdf5;
  color: var(--green);
}

.modal-status.error {
  background: #fef2f2;
  color: var(--red);
}

.modal-card h2 {
  max-width: 420px;
  font-size: 22px;
  line-height: 1.35;
}

.modal-muted,
.expire-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.modal-progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
  margin-top: 20px;
}

.modal-progress div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  transition: width 200ms ease;
}

.spinner {
  width: 54px;
  height: 54px;
  margin: 4px auto 20px;
  border: 5px solid rgba(37, 99, 235, 0.13);
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

.copy-card {
  display: grid;
  gap: 10px;
  margin: 18px 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.72);
}

.copy-card a {
  color: var(--blue);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.copy-card span {
  color: var(--muted);
  font-size: 13px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.account-status {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}

.account-row {
  display: grid;
  grid-template-columns: 92px 70px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.status-ok {
  color: var(--green);
  font-weight: 800;
}

.status-missing {
  color: var(--red);
  font-weight: 800;
}

.cookie-preview {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-note {
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 13px;
}

.admin-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
}

.toast {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 16px;
  color: #ffffff;
  background: #0f172a;
  box-shadow: var(--shadow);
  transform: translateY(14px);
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
}

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



/* Theme toggle */
.theme-toggle {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 20;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  font-size: 20px;
  transition: 180ms ease;
}

.theme-toggle:hover {
  transform: scale(1.08);
}

.theme-toggle:active {
  transform: scale(0.94);
}

@media (max-width: 680px) {
  .theme-toggle {
    right: 10px;
    top: 10px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

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

@media (max-width: 920px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .recent-panel {
    position: static;
  }

@media (max-width: 680px) {
  .shell {
    width: min(100vw - 18px, 1120px);
    padding: calc(14px + env(safe-area-inset-top)) 0 calc(18px + env(safe-area-inset-bottom));
  }

  .hero {
    margin-bottom: 14px;
  }

  .eyebrow {
    margin-bottom: 8px;
    font-size: 11px;
  }

  h1 {
    font-size: 34px;
  }

  .hero-subtitle {
    margin-top: 8px;
    font-size: 14px;
  }

  .search-card-head h2 {
    font-size: 18px;
  }

  .disk-tabs,
  .search-form,
  .result-card {
    grid-template-columns: 1fr;
  }

  .search-card,
  .panel {
    border-radius: 24px;
  }

  .search-card {
    padding: 12px;
  }

  .disk-tab {
    min-height: 62px;
    border-radius: 18px;
  }

  .disk-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  input,
  select,
  .button {
    min-height: 50px;
  }

  .content-grid {
    gap: 12px;
  }

  .panel-head {
    padding: 16px;
  }

  .results-list,
  .task-list {
    padding: 12px;
  }

  .result-card {
    padding: 14px;
    border-radius: 20px;
  }

  .share-dialog,
  .account-dialog {
    width: min(100vw - 18px, 520px);
  }

  .modal-card {
    padding: 26px 18px 20px;
    border-radius: 26px;
  }
}
