:root {
  --bg: #f6f7fb;
  --bg-soft: #eef1f7;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --border: rgba(31, 36, 48, 0.08);
  --text: #1f2430;
  --text-secondary: #6b7280;
  --text-muted: #9aa1ae;
  --accent-1: #ff8a3d;
  --accent-2: #f55ba0;
  --accent-soft: rgba(245, 91, 160, 0.1);
  --shadow-sm: 0 2px 10px rgba(31, 36, 48, 0.05);
  --shadow-md: 0 12px 30px rgba(31, 36, 48, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --header-height: 66px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--header-height);
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-height);
  z-index: 100;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 900px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark { display: flex; }

.brand-text {
  font-size: 1.25rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-dot { color: var(--accent-2); }

.brand-tagline {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.header-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid rgba(245, 91, 160, 0.18);
  border-radius: 999px;
  padding: 5px 11px;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.hero {
  position: relative;
  padding: 46px 0 22px;
  text-align: center;
}

.hero-glow {
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: 420px;
  height: 260px;
  background: radial-gradient(ellipse at center, rgba(255, 138, 61, 0.16), rgba(245, 91, 160, 0.1) 45%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ff8a3d 0%, #f55ba0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0 0 26px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.hero-subtitle b { color: var(--accent-2); font-weight: 700; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 620px;
  margin: 0 auto 20px;
  padding: 7px 7px 7px 16px;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: rgba(245, 91, 160, 0.45);
  box-shadow: 0 14px 34px rgba(245, 91, 160, 0.14);
}

.search-icon { color: var(--text-muted); flex-shrink: 0; }

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-btn {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 11px 24px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 650;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 6px 16px rgba(245, 91, 160, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}

.search-btn:active { transform: scale(0.97); }

.filter-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-row.secondary { margin-bottom: 0; }

.chip {
  border: 1px solid var(--border);
  background: var(--card-solid);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 0.82rem;
  font-weight: 550;
  transition: all 0.18s;
  box-shadow: var(--shadow-sm);
}

.chip:hover { color: var(--text); transform: translateY(-1px); }

.chip.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 6px 14px rgba(245, 91, 160, 0.22);
}

.chip.secondary-chip {
  background: transparent;
  box-shadow: none;
  padding: 5px 12px;
  font-size: 0.78rem;
}

.stats-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  margin: 24px auto 28px;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-item { text-align: center; min-width: 72px; }
.stat-item b { display: block; font-size: 1.4rem; font-weight: 750; line-height: 1.2; }
.stat-item span { font-size: 0.74rem; color: var(--text-secondary); }
.stat-divider { width: 1px; height: 28px; background: var(--border); }

.results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.results-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.result-count { color: var(--text-muted); font-size: 0.8rem; }

.card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.resource-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 17px 18px 15px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(245, 91, 160, 0.22);
}

.card-top { display: flex; align-items: flex-start; gap: 8px; }

.card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.45;
  word-break: break-word;
  flex: 1;
}

.badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 7px;
  color: #fff;
  letter-spacing: 0.02em;
}

.badge-quark { background: linear-gradient(135deg, #6d5efc, #9d5cf6); }
.badge-baidu { background: linear-gradient(135deg, #4e7bff, #2f6bff); }
.badge-aliyun { background: linear-gradient(135deg, #ff9f43, #ff7a45); }
.badge-115 { background: linear-gradient(135deg, #36c9a3, #20a985); }
.badge-other { background: linear-gradient(135deg, #94a3b8, #64748b); }

.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.tag {
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 3px 8px;
}

.tag.pwd { color: #d97706; background: rgba(217, 119, 6, 0.1); font-weight: 650; }

.card-note {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
  word-break: break-all;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.card-time { font-size: 0.7rem; color: var(--text-muted); }

.copy-btn {
  border: 1px solid rgba(245, 91, 160, 0.25);
  background: var(--accent-soft);
  color: var(--accent-2);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 650;
  transition: all 0.15s;
}

.copy-btn:hover { background: rgba(245, 91, 160, 0.18); }
.copy-btn:active { transform: scale(0.96); }

.skeleton-card {
  height: 150px;
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, #eef1f7 30%, #f8f9fc 50%, #eef1f7 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  border: 1px solid var(--border);
}

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

.empty-state { text-align: center; padding: 54px 20px; color: var(--text-secondary); }
.empty-illustration { font-size: 2.2rem; margin-bottom: 10px; }
.empty-state p { margin: 0 0 6px; font-weight: 600; color: var(--text); }
.empty-state span { font-size: 0.82rem; }

.load-more {
  display: block;
  margin: 24px auto 0;
  padding: 11px 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-solid);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.load-more:hover { color: var(--accent-2); border-color: rgba(245, 91, 160, 0.3); }
.load-more:disabled { opacity: 0.55; cursor: default; }

.app-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 26px 20px 36px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.76rem;
}

.app-footer p { margin: 4px 0; }
.footer-note { color: var(--text-muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  background: rgba(31, 36, 48, 0.92);
  color: #fff;
  font-size: 0.85rem;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  :root { --header-height: 60px; }
  .header-inner { padding: 0 16px; }
  .brand-tagline { display: none; }
  .header-badge { margin-left: auto; }
  .page { padding: 0 14px 40px; }
  .hero { padding-top: 34px; }
  .hero-subtitle { font-size: 0.85rem; }
  .search-box { padding-left: 14px; }
  .search-btn { padding: 10px 18px; }
  .stats-strip { gap: 14px; padding: 14px 10px; }
  .stat-item { min-width: 64px; }
  .stat-item b { font-size: 1.2rem; }
  .card-list { grid-template-columns: 1fr; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --bg-soft: #222733;
    --card: rgba(31, 36, 48, 0.72);
    --card-solid: #1c212b;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8ebf2;
    --text-secondary: #a3abb9;
    --text-muted: #7c8593;
  }
  body { background: var(--bg); }
  .app-header { background: rgba(20, 24, 32, 0.78); }
}
