:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --sub: #64748b;
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --border: #e5eaf2;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ==================== Web 插件市场登录页 ==================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 20%, rgba(59, 130, 246, 0.16), transparent 42%),
    radial-gradient(circle at 82% 80%, rgba(124, 58, 237, 0.14), transparent 42%),
    linear-gradient(135deg, #f4f7ff 0%, #f7f5ff 100%);
}
.auth-card {
  width: min(760px, 100%);
  min-height: 440px;
  display: flex;
  background: #ffffff;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}
.auth-brand {
  width: 300px;
  flex: 0 0 300px;
  padding: 36px 30px;
  color: #fff;
  background: linear-gradient(145deg, #2563eb 0%, #4338ca 55%, #6d28d9 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-brand::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  top: -70px;
  left: -60px;
  filter: blur(12px);
}
.auth-brand::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.2);
  bottom: -60px;
  right: -50px;
  filter: blur(18px);
}
.auth-brand > * { position: relative; z-index: 1; }
.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
}
.auth-brand h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand .tagline { margin: 8px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.82); line-height: 1.5; }
.brand-features { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.brand-feature { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: rgba(255, 255, 255, 0.9); }
.brand-feature-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.brand-feature small { display: block; color: rgba(255, 255, 255, 0.72); font-size: 11.5px; margin-top: 2px; }

.auth-form {
  flex: 1;
  padding: 38px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-form h2 { margin: 0 0 6px; font-size: 22px; color: #0f172a; }
.auth-form .sub { margin: 0 0 24px; font-size: 13px; color: #64748b; }
.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.auth-input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.auth-input:focus {
  border-color: #3b82f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.auth-captcha-row { display: flex; gap: 10px; align-items: center; }
.auth-captcha-img {
  height: 42px;
  width: 120px;
  flex: 0 0 120px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  object-fit: contain;
}
.auth-submit {
  width: 100%;
  height: 44px;
  margin-top: 6px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #2563eb 0%, #4f46e5 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  transition: opacity 0.15s, transform 0.1s;
}
.auth-submit:hover { opacity: 0.95; }
.auth-submit:active { transform: translateY(1px); }
.auth-err {
  color: #dc2626;
  font-size: 12.5px;
  margin-top: 12px;
  min-height: 18px;
}

/* ==================== 顶部导航栏 ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.brand-sub {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--brand);
}
.search-box {
  position: relative;
  flex: 1;
  max-width: 460px;
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.55;
  pointer-events: none;
}
.search {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: all 0.15s;
}
.search:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.user-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 5px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* ==================== 主内容与 Hero ==================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 28px 72px;
}
.hero-banner {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 34px 38px;
  margin-bottom: 26px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: linear-gradient(130deg, #1d4ed8 0%, #4338ca 55%, #6d28d9 100%);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.18);
}
.hero-banner::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.35), transparent 65%);
  top: -120px;
  left: -80px;
  pointer-events: none;
}
.hero-banner::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 181, 253, 0.3), transparent 65%);
  bottom: -140px;
  right: -60px;
  pointer-events: none;
}
.hero-left, .hero-stats { position: relative; z-index: 1; }
.hero-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 14px;
}
.hero-banner h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-banner p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 560px;
  line-height: 1.65;
}
.hero-stats {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}
.stat-item {
  min-width: 102px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  text-align: center;
}
.stat-num { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat-label { margin-top: 6px; font-size: 12px; color: rgba(255, 255, 255, 0.8); }

/* ==================== 分类筛选与排序 ==================== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-pill:hover {
  border-color: #bfdbfe;
  color: var(--brand);
  background: #f8fbff;
}
.cat-pill.active {
  background: linear-gradient(90deg, #2563eb, #4f46e5);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}
.cat-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: inherit;
}
.cat-pill.active .cat-count {
  background: rgba(255, 255, 255, 0.22);
}

.sort-group {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #e9eef6;
  gap: 2px;
}
.sort-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.sort-btn.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.list-count { font-size: 13px; color: var(--sub); }

/* ==================== 插件卡片网格 ==================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #bfdbfe;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.1);
}
.card .logo {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  flex: 0 0 60px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.card .meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.card .name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card .name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
}
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--brand);
}
.badge-cat {
  background: #f1f5f9;
  color: #475569;
}
.card .desc {
  margin-top: 7px;
  font-size: 13px;
  color: var(--sub);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.card .foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 12px;
}
.card .foot .detail-hint {
  margin-left: auto;
  color: var(--brand);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
}
.card:hover .foot .detail-hint { opacity: 1; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 20px;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--sub);
}
.empty-state .emoji { font-size: 38px; margin-bottom: 10px; }

/* ==================== 插件详情抽屉 ==================== */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(520px, 94vw);
  height: 100%;
  background: #fff;
  padding: 30px;
  overflow-y: auto;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.16);
}
.drawer-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.drawer-head img {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid var(--border);
}
.drawer-head h2 { margin: 0 0 6px; font-size: 20px; }
.drawer-head .sub { font-size: 12.5px; color: var(--sub); }
.drawer .btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(90deg, #2563eb, #4f46e5);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}
.drawer .section-title {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.drawer .feature-row {
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* ==================== 弹窗与按钮 ==================== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-box {
  width: 380px;
  max-width: 92vw;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}
.modal-box h3 { margin: 0 0 16px; font-size: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.btn-outline {
  padding: 7px 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-logout:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.btn-accent {
  padding: 8px 16px;
  border: none;
  background: #2563eb;
  color: #fff;
  border-radius: 9px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

@media (max-width: 860px) {
  .hero-banner { flex-direction: column; align-items: flex-start; padding: 26px; }
  .hero-stats { width: 100%; }
  .stat-item { flex: 1; }
}
@media (max-width: 700px) {
  .auth-card { flex-direction: column; }
  .auth-brand { width: 100%; flex: none; padding: 26px 24px; }
  .brand-features { display: none; }
  .topbar-inner { flex-wrap: wrap; padding: 12px 16px; }
  .search-box { order: 3; max-width: none; width: 100%; }
  .container { padding: 18px 16px 48px; }
}
