:root {
  --bg: #0b0f1a;
  --surface: #12182a;
  --surface2: #1a2238;
  --border: #2a3555;
  --text: #e8ecf4;
  --muted: #8b96b0;
  --primary: #5b8cff;
  --primary-dim: #3d6ae0;
  --accent: #00d4aa;
  --warn: #ffb020;
  --danger: #ff5c6c;
  --success: #2dd4a0;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(91,140,255,.15), transparent),
              radial-gradient(ellipse 60% 40% at 100% 50%, rgba(0,212,170,.08), transparent);
  pointer-events: none;
  z-index: 0;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }

.header {
  border-bottom: 1px solid var(--border);
  background: rgba(18,24,42,.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 20px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
}
.brand h1 { font-size: 1.35rem; font-weight: 700; }
.brand p { font-size: .82rem; color: var(--muted); }

.nav { display: flex; gap: 8px; }
.nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .92rem;
  transition: all .2s;
}
.nav-btn:hover { border-color: var(--primary); color: var(--text); }
.nav-btn.active {
  background: linear-gradient(135deg, var(--primary-dim), var(--primary));
  border-color: transparent;
  color: #fff;
}

main { padding: 28px 0 60px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.hero-card h2 { font-size: 1.4rem; margin-bottom: 8px; }
.hero-card > p { color: var(--muted); margin-bottom: 20px; font-size: .95rem; }

.input-row { display: flex; gap: 12px; flex-wrap: wrap; }
.input-row input {
  flex: 1;
  min-width: 260px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text);
  font-size: .95rem;
}
.input-row input:focus { outline: none; border-color: var(--primary); }

.platform-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 14px;
}
.platform-tags span {
  font-size: .75rem;
  padding: 3px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: .95rem;
  cursor: pointer;
  transition: all .2s;
  font-weight: 600;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary-dim), var(--primary));
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-block { width: 100%; margin-top: 8px; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-bottom: 12px; }
.muted { color: var(--muted); font-size: .9rem; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: .88rem; color: var(--muted); }
.form-group .req { color: var(--danger); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: .92rem;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.hint { font-size: .75rem; color: var(--muted); margin-top: 4px; display: block; }

.advanced { margin: 16px 0; }
.advanced summary {
  cursor: pointer;
  color: var(--primary);
  font-size: .9rem;
  margin-bottom: 12px;
  user-select: none;
}

.tips { list-style: none; }
.tips li {
  padding: 8px 0 8px 20px;
  position: relative;
  font-size: .88rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.tips li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); }
.match-summary { margin-top: 16px; padding: 12px; background: var(--surface2); border-radius: 8px; font-size: .88rem; }

/* Analysis result */
.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.result-header h2 { font-size: 1.3rem; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-blue { background: rgba(91,140,255,.2); color: var(--primary); }
.badge-green { background: rgba(45,212,160,.2); color: var(--success); }
.badge-yellow { background: rgba(255,176,32,.2); color: var(--warn); }
.badge-red { background: rgba(255,92,108,.2); color: var(--danger); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.stat-card .label { font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.stat-card .value { font-size: 1.25rem; font-weight: 700; }
.stat-card .value.gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-title {
  font-size: .95rem;
  font-weight: 600;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-bar {
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s ease;
}
.score-high { background: linear-gradient(90deg, var(--success), var(--accent)); }
.score-mid { background: linear-gradient(90deg, var(--warn), #ffcc44); }
.score-low { background: linear-gradient(90deg, var(--danger), #ff8a96); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .8rem;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  font-size: .88rem;
}
.kv-grid div { padding: 6px 0; }
.kv-grid strong { color: var(--muted); font-weight: 500; }

.contact-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
}
.contact-box code {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .88rem;
  color: var(--accent);
}

.creator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  transition: border-color .2s;
}

.match-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.match-pagination .btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.creator-card:hover { border-color: var(--primary); }
.creator-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.profile-link-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.profile-link {
  flex: 1;
  min-width: 180px;
  color: var(--accent);
  font-size: .84rem;
  text-decoration: none;
  word-break: break-all;
}
.profile-link:hover {
  color: var(--primary);
  text-decoration: underline;
}
.profile-link-row.visited {
  background: rgba(91, 140, 255, 0.06);
  border-color: rgba(139, 150, 176, 0.45);
}
.profile-link.visited {
  color: var(--muted);
  opacity: 0.85;
}
.profile-link.visited:hover {
  color: #a8b4cc;
}
.badge-visited {
  background: rgba(139, 150, 176, 0.25);
  color: #a8b4cc;
}
.btn-visited {
  background: linear-gradient(135deg, #4a5568, #5d6b7f);
  color: #c5cdd9;
  cursor: pointer;
}
.btn-visited:hover {
  filter: brightness(1.05);
  color: #dce3ec;
}
.profile-link-row.visited .btn-outline {
  border-color: rgba(139, 150, 176, 0.5);
  color: var(--muted);
}
.creator-card-body {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.match-reasons {
  font-size: .82rem;
  color: var(--muted);
  margin: 8px 0;
}
.match-reasons span {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 4px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}
.loading::after {
  content: '';
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer {
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: .82rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: .9rem;
  opacity: 0;
  transition: all .3s;
  z-index: 200;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

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