:root {
  --purple: #6c5ce7;
  --purple-dark: #5848d4;
  --purple-soft: #efeaff;
  --text: #1d2b4a;
  --muted: #6b7690;
  --line: #e6eaf2;
  --bg: #f4f7fc;
  --card: #fff;
  --danger: #e4393c;
  --ok: #2f9e44;
  --wait: #d97706;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 50% -80px, #dce8ff 0%, transparent 70%),
    linear-gradient(180deg, #eaf3ff 0%, var(--bg) 280px);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

button, input, select, textarea { font-family: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(230, 234, 242, 0.9);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-cn { font-size: 15px; font-weight: 700; }
.brand-en { font-size: 10px; color: #8a94a6; letter-spacing: 0.04em; }

.brand-divider {
  width: 1px;
  height: 22px;
  background: #d5dbe8;
  margin: 0 4px;
}

.brand-plaza {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-link {
  border: none;
  background: transparent;
  color: #334155;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.topbar-link:hover { background: #f3f5fb; }

.topbar-link-primary {
  color: var(--purple);
  font-weight: 600;
  background: var(--purple-soft);
}

.topbar-link-primary:hover { background: #e4dcff; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  color: #475569;
  font-size: 14px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8edf5;
  display: grid;
  place-items: center;
}

.hero {
  max-width: 880px;
  margin: 36px auto 18px;
  text-align: center;
  padding: 0 20px;
}

.hero h1 {
  font-size: 36px;
  letter-spacing: 0.04em;
  color: #16325c;
}

.hero h1 span { color: var(--purple); }

.hero-sub {
  margin-top: 8px;
  color: #4c7ad9;
  font-size: 15px;
  letter-spacing: 0.12em;
}

.hero-search {
  margin: 22px auto 0;
  max-width: 720px;
  height: 52px;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(80, 110, 180, 0.12);
  overflow: hidden;
  border: 1px solid #e8edf7;
}

.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 22px;
  font-size: 14px;
  background: transparent;
}

.hero-search-btn {
  width: 52px;
  border: none;
  background: linear-gradient(180deg, #7b6cf6, var(--purple));
  cursor: pointer;
}

.promo {
  margin-top: 18px;
  height: 92px;
  border-radius: 16px;
  background: linear-gradient(90deg, #d7e8ff 0%, #c9dcff 55%, #b7cfff 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  overflow: hidden;
  position: relative;
}

.promo-kicker { font-size: 12px; color: #35548a; }
.promo-title { margin-top: 4px; font-size: 18px; font-weight: 700; color: #16325c; }
.promo-actions { margin-top: 8px; display: flex; gap: 8px; align-items: center; }

.promo-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  text-decoration: none;
}

.promo-chip {
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #35548a;
  font-size: 12px;
}

.promo-art { position: relative; width: 160px; height: 80px; }
.promo-orb {
  position: absolute;
  right: 18px;
  top: 8px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #8db4ff 55%, #6c5ce7);
  opacity: 0.85;
}
.promo-orb-2 {
  right: 70px;
  top: 28px;
  width: 36px;
  height: 36px;
  opacity: 0.55;
}

.cats {
  max-width: 1280px;
  margin: 8px auto 0;
  padding: 0 28px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(90, 110, 160, 0.08);
  overflow-x: auto;
}

.cat {
  border: none;
  background: transparent;
  color: #52607a;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.cat.active {
  background: var(--purple);
  color: #fff;
  font-weight: 600;
}

.layout {
  max-width: 1280px;
  margin: 22px auto 48px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.app-card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: 0 8px 24px rgba(80, 100, 150, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 214px;
}

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

.app-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.app-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
}

.app-badge {
  font-size: 11px;
  color: var(--purple);
  background: var(--purple-soft);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.app-desc {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-meta {
  margin-top: 8px;
  font-size: 12px;
  color: #4c7ad9;
}

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

.tag {
  font-size: 11px;
  color: #667085;
  background: #f3f5fb;
  border-radius: 4px;
  padding: 2px 7px;
}

.app-foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-stats {
  display: flex;
  gap: 10px;
  color: #94a3b8;
  font-size: 12px;
}

.use-btn {
  height: 30px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: var(--purple);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.use-btn:hover { background: var(--purple-dark); }

.fav-star {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: #c5cad6;
}

.fav-star.on { color: #f5b301; }

.rank-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 16px 10px;
  box-shadow: 0 8px 24px rgba(80, 100, 150, 0.08);
  margin-bottom: 16px;
}

.rank-card h3 {
  font-size: 14px;
  margin-bottom: 10px;
}

.rank-list { list-style: none; }

.rank-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f4f9;
  font-size: 13px;
}

.rank-list li:last-child { border-bottom: none; }

.rank-no {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
  background: #94a3b8;
  flex-shrink: 0;
}

.rank-list li:nth-child(1) .rank-no { background: #f59e0b; }
.rank-list li:nth-child(2) .rank-no { background: #94a3b8; }
.rank-list li:nth-child(3) .rank-no { background: #d97706; }

.rank-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-num { color: var(--muted); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 48, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}

.overlay.hidden { display: none; }

.dialog {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(20, 28, 48, 0.22);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.dialog-wide {
  width: min(1180px, 100%);
  height: min(780px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
}
.dialog-wide .table-wrap {
  flex: 1;
  min-height: 0;
}
.dialog-record { width: min(1080px, 100%); }

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

.dialog-head h2 { font-size: 20px; }
.dialog-desc { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.dialog-head-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary { background: var(--purple); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-ghost { background: #f3f5fb; color: #334155; }

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f5fb;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
}

.table-wrap { padding: 16px 24px 24px; overflow: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #f7f9fd;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}

.data-table tbody tr:hover { background: #fafcff; }

.stage {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #fff7ed;
  color: var(--wait);
}

.stage.done { background: #ecfdf3; color: var(--ok); }
.stage.reject { background: #fef2f2; color: var(--danger); }
.stage.draft { background: var(--purple-soft); color: var(--purple); }

.link-btn {
  border: none;
  background: none;
  color: var(--purple);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

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

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .cards { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .dialog-head { flex-direction: column; }
}
