/* 应用市场 — 对齐 https://opc1.wenzhou-ai.com/apps */

.page-apps {
  --app-blue: #2563eb;
  --app-blue-600: #2563eb;
  --app-text: #111827;
  --app-muted: #64748b;
  --app-border: #e2e8f0;
  --app-card-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  --app-card-shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.1);
}

body.page-apps.page-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.apps-page-wrap {
  flex: 1;
}

body.page-apps {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8f9fc 100%);
  color: var(--app-text);
  -webkit-font-smoothing: antialiased;
}

body.page-apps .container {
  width: min(1400px, 94vw);
}

/* ========== 顶栏 ========== */
body.page-apps .sz-top.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--app-border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

body.page-apps .sz-top-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 12px 0;
}

body.page-apps .sz-site-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--app-text);
  text-decoration: none;
}

body.page-apps .sz-top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  flex: 1;
  min-width: 0;
}

body.page-apps .sz-top-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--app-muted);
  text-decoration: none;
}

body.page-apps .sz-top-nav a:hover {
  color: var(--app-text);
  background: #f1f5f9;
}

body.page-apps .sz-top-nav a.is-active {
  color: var(--app-blue);
  font-weight: 600;
  background: rgba(37, 99, 235, 0.1);
}

body.page-apps .sz-login-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  font-size: 14px;
}

body.page-apps .sz-login-pill a {
  color: var(--app-blue);
  text-decoration: none;
  font-weight: 500;
}

body.page-apps .sz-login-sep {
  color: #93c5fd;
  user-select: none;
}

/* ========== Hero 横幅 ========== */
.apps-hero {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  max-height: 270px;
  height: 22vh;
}

.apps-hero-bg {
  position: absolute;
  inset: 0;
}

.apps-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apps-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.55) 45%, transparent 100%);
}

.apps-hero-inner {
  position: relative;
  z-index: 1;
  padding: 2.5rem 0 2rem;
}

.apps-hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 800;
  color: #111827;
}

.apps-hero-sub {
  margin: 0;
  font-size: 15px;
  color: #4b5563;
}

.apps-main {
  padding: 24px 0 48px;
}

.apps-loading {
  text-align: center;
  padding: 48px 16px;
  color: var(--app-muted);
}

/* ========== 精选 / 全部 pill ========== */
.apps-mode-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

.apps-mode-pill {
  display: inline-flex;
  padding: 4px;
  background: #fff;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.apps-mode-btn {
  padding: 10px 32px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  transition:
    background 0.2s,
    color 0.2s;
}

.apps-mode-btn:hover {
  color: var(--app-blue);
}

.apps-mode-btn.is-active {
  background: var(--app-blue);
  color: #fff;
}

/* ========== 精选区标题行 ========== */
.apps-featured-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.apps-featured-head-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
}

.apps-featured-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
}

.apps-featured-title span {
  color: var(--app-blue);
}

.apps-region {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.apps-region-label {
  color: #64748b;
}

.apps-region-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #475569;
}

.apps-region-txt {
  white-space: nowrap;
}

.apps-region input {
  width: 16px;
  height: 16px;
  accent-color: var(--app-blue);
}

.apps-aicpb {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  align-self: center;
}

.apps-aicpb a {
  color: #3b82f6;
  margin-left: 4px;
  text-decoration: none;
}

.apps-aicpb a:hover {
  text-decoration: underline;
}

/* ========== 卡片网格 ========== */
.apps-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 1200px) {
  .apps-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .apps-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .apps-card-grid {
    grid-template-columns: 1fr;
  }
}

.app-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--app-card-shadow);
  overflow: hidden;
  transition:
    box-shadow 0.3s,
    transform 0.3s;
}

.app-card:hover {
  box-shadow: var(--app-card-shadow-hover);
  transform: translateY(-4px);
}

.app-card-topline {
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #22d3ee);
  opacity: 0.75;
}

.app-card:hover .app-card-topline {
  opacity: 1;
}

.app-card-body {
  padding: 20px;
}

.app-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.app-card-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-card-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card-icon.is-hidden {
  display: none;
}

.app-card-icon-fallback {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.app-card-icon-fallback:not(.is-hidden) {
  display: flex;
}

.app-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.app-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

.app-card:hover .app-card-title {
  color: var(--app-blue);
}

.app-top-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.app-top-badge--1 {
  background: linear-gradient(90deg, #fbbf24, #f97316);
  color: #fff;
}

.app-top-badge--2 {
  background: linear-gradient(90deg, #cbd5e1, #94a3b8);
  color: #fff;
}

.app-top-badge--3 {
  background: linear-gradient(90deg, #d97706, #b45309);
  color: #fff;
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.app-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.app-tag--0 {
  background: #eff6ff;
  color: #2563eb;
}
.app-tag--1 {
  background: #fef2f2;
  color: #ef4444;
}
.app-tag--2 {
  background: #f5f3ff;
  color: #7c3aed;
}
.app-tag--3 {
  background: #ecfdf5;
  color: #059669;
}
.app-tag--4 {
  background: #fff7ed;
  color: #ea580c;
}
.app-tag--5 {
  background: #ecfeff;
  color: #0891b2;
}
.app-tag--6 {
  background: #fdf2f8;
  color: #db2777;
}
.app-tag--7 {
  background: #eef2ff;
  color: #4f46e5;
}

.app-metrics {
  display: flex;
  gap: 32px;
  margin-bottom: 12px;
}

.app-metric-k {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 2px;
}

.app-metric-v {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
}

.app-metric-v.is-up {
  color: #10b981;
}

.app-metric-v.is-down {
  color: #ef4444;
}

.app-intro-label,
.app-fit-label {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 4px;
}

.app-intro-text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.55;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-fit-text {
  margin: 0 0 16px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.app-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-btn {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition:
    background 0.2s,
    color 0.2s;
}

.app-btn--primary {
  background: var(--app-blue);
  color: #fff;
}

.app-btn--primary:hover {
  background: #1d4ed8;
}

.app-btn--outline {
  background: #fff;
  color: var(--app-blue);
  border: 1px solid #bfdbfe;
}

.app-btn--outline:hover {
  background: #eff6ff;
}

.app-btn-star {
  flex: 0 0 auto;
  padding: 8px;
  border: none;
  background: none;
  color: #cbd5e1;
  cursor: pointer;
  border-radius: 8px;
}

.app-btn-star:hover {
  color: #fbbf24;
}

.app-btn-star svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ========== 全部应用：侧栏 + 主区 ========== */
.apps-all-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .apps-all-shell {
    grid-template-columns: 1fr;
  }
}

.apps-sidebar {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  box-shadow: var(--app-card-shadow);
  padding: 24px;
  position: sticky;
  top: 80px;
}

.apps-sidebar-h {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 800;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

.apps-sidebar-h::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--app-blue);
}

.apps-search-wrap {
  position: relative;
  margin-bottom: 24px;
}

.apps-search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #9ca3af;
  pointer-events: none;
}

.apps-search-input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
}

.apps-search-input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.apps-filter-block {
  margin-bottom: 24px;
}

.apps-filter-block:last-child {
  margin-bottom: 0;
}

.apps-filter-h {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

.apps-filter-h::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--app-blue);
}

.apps-filter-h.apps-filter-h--emerald::before {
  background: #10b981;
}
.apps-filter-h.apps-filter-h--purple::before {
  background: #a855f7;
}
.apps-filter-h.apps-filter-h--orange::before {
  background: #f97316;
}

.apps-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.apps-chip-grid--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.apps-filter-chip {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
  background: #f8fafc;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}

.apps-filter-chip:hover {
  border-color: #bfdbfe;
  color: var(--app-blue);
}

.apps-filter-chip.is-active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--app-blue);
  font-weight: 600;
}

.apps-all-count {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 20px;
}

.apps-all-count strong {
  color: #111827;
  font-weight: 700;
}

.apps-empty {
  text-align: center;
  padding: 64px 24px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  color: #94a3b8;
  font-size: 16px;
}

.is-hidden-panel {
  display: none !important;
}

/* ========== 深色页脚 ========== */
.page-apps .apps-foot-dark {
  background: #111827;
  color: #e5e7eb;
  border-top: 1px solid #1f2937;
  margin-top: auto;
}

.page-apps .apps-foot-dark .foot-brand-desc,
.page-apps .apps-foot-dark .foot-list a {
  color: #9ca3af;
}

.page-apps .apps-foot-dark .foot-list a:hover {
  color: #fff;
}

.page-apps .apps-foot-dark .foot-h {
  color: #f3f4f6;
}

.page-apps .apps-foot-dark .foot-bottom {
  border-top-color: #374151;
  color: #6b7280;
}

.page-apps .apps-foot-dark .foot-legal a {
  color: #9ca3af;
}

.page-apps .apps-foot-dark .foot-legal a:hover {
  color: #e5e7eb;
}

.apps-foot-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #3b82f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.apps-foot-logo span {
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.page-apps .foot-brand {
  margin-bottom: 8px;
}

@media (max-width: 720px) {
  body.page-apps .sz-top-inner {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-apps .sz-login-pill {
    align-self: flex-end;
  }
}
