@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=IBM+Plex+Mono:ital,wght@0,400;0,500;1,400&display=swap');

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg2: #12121a;
  --bg3: #1a1a26;
  --border: #2a2a3a;
  --accent: #6366f1;
  --accent-hover: #7c7ff5;
  --text: #e2e2f0;
  --text-muted: #888899;
  --success: #22c55e;
  --error: #ef4444;
  --soul: #a855f7;
  --skill: #06b6d4;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

html { font-size: 16px; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ===== Navbar ===== */
#nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-kc {
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 0.85rem;
  padding: 2px 6px; border-radius: 5px;
}
.logo-text { color: var(--text); font-weight: 600; font-size: 1rem; }
.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a { color: var(--text-muted); font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active {
  color: var(--accent);
  position: relative;
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.nav-user { color: var(--text-muted); font-size: 0.85rem; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg2); padding: 1rem 1.5rem; gap: 0.75rem; border-bottom: 1px solid var(--border); }
  #nav.open .nav-links { display: flex; }
}

/* ===== Main layout ===== */
#app { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; min-height: calc(100vh - 60px); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius); border: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 500; transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.w-full { width: 100%; }

/* ===== Forms ===== */
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.6rem 0.9rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 0.9rem;
  transition: border-color 0.2s; outline: none;
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field select option { background: var(--bg2); }
.field textarea { resize: vertical; }

/* ===== Msg ===== */
.msg { margin-top: 0.75rem; font-size: 0.875rem; min-height: 1.2em; }
.msg.error { color: var(--error); }
.msg.success { color: var(--success); }

/* ===== Auth page ===== */
.auth-wrap { display: flex; justify-content: center; align-items: flex-start; padding-top: 4rem; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 2rem;
  box-shadow: var(--shadow);
}
.auth-card .brand-logo { display: flex; align-items: center; gap: 0.6rem; justify-content: center; margin-bottom: 1.5rem; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.auth-tabs .tab-btn {
  flex: 1; padding: 0.5rem; background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 0.9rem; transition: all 0.2s;
}
.auth-tabs .tab-btn.active { background: var(--accent); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Page header ===== */
.page-header { margin-bottom: 1.75rem; }
.page-title { font-size: 1.75rem; font-weight: 700; background: linear-gradient(90deg, var(--accent), #a5b4fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.page-sub { color: var(--text-muted); margin-top: 0.25rem; }

/* ===== Search bar ===== */
.search-bar { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.search-bar input { flex: 1; min-width: 180px; padding: 0.6rem 0.9rem; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 0.9rem; outline: none; }
.search-bar input:focus { border-color: var(--accent); }
.search-bar select { padding: 0.6rem 0.9rem; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 0.9rem; cursor: pointer; }

/* ===== Tag cloud ===== */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.tag {
  padding: 2px 10px; border-radius: 999px;
  background: var(--bg3); border: 1px solid var(--border);
  font-size: 0.78rem; color: var(--text-muted);
}
.tag-clickable { cursor: pointer; transition: all 0.2s; }
.tag-clickable:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Asset grid ===== */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ===== Asset card ===== */
.asset-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.asset-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(99,102,241,0.15); }
.card-header { display: flex; justify-content: space-between; align-items: center; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; }
.badge-soul { background: rgba(168,85,247,0.15); color: var(--soul); border: 1px solid rgba(168,85,247,0.3); }
.badge-skill { background: rgba(6,182,212,0.15); color: var(--skill); border: 1px solid rgba(6,182,212,0.3); }
.card-rating { font-size: 0.8rem; color: #fbbf24; }
.card-title { font-size: 1rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.card-desc { font-size: 0.85rem; color: var(--text-muted); flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.card-tags .tag { font-size: 0.72rem; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
.pg-info { color: var(--text-muted); font-size: 0.85rem; }

/* ===== Back link ===== */
.back-link { margin-bottom: 1.25rem; }
.back-link a { color: var(--text-muted); font-size: 0.9rem; }
.back-link a:hover { color: var(--accent); }

/* ===== Detail ===== */
.detail-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; margin-bottom: 2rem; }
.detail-header { margin-bottom: 1rem; }
.detail-title { font-size: 1.6rem; font-weight: 700; margin: 0.5rem 0; }
.detail-meta { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-muted); }
.detail-desc { color: var(--text-muted); margin-bottom: 1rem; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.detail-preview { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.25rem; }
.detail-preview pre { font-family: 'Fira Code', monospace; font-size: 0.82rem; color: var(--text-muted); white-space: pre-wrap; word-break: break-word; }
.detail-actions { display: flex; gap: 0.75rem; }

/* ===== Section ===== */
.section { margin-bottom: 2rem; }
.section-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }

/* ===== Reviews ===== */
.review-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 0.75rem; }
.review-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.review-author { font-weight: 600; font-size: 0.875rem; }
.review-stars { color: #fbbf24; font-size: 0.9rem; }
.review-date { color: var(--text-muted); font-size: 0.78rem; margin-left: auto; }
.review-body { color: var(--text); font-size: 0.875rem; line-height: 1.7; word-break: break-word; }
.review-body > *:first-child { margin-top: 0; }
.review-body > *:last-child { margin-bottom: 0; }

/* ===== Star input ===== */
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { display: none; }
.star-input label { font-size: 1.6rem; cursor: pointer; color: var(--border); transition: color 0.1s; }
.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label { color: #fbbf24; }

/* ===== Profile ===== */
.profile-tabs { display: flex; gap: 0; margin-bottom: 1.75rem; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; flex-wrap: wrap; }
.profile-tabs .tab-btn { flex: 1; min-width: 100px; padding: 0.6rem 0.5rem; background: none; border: none; border-right: 1px solid var(--border); color: var(--text-muted); cursor: pointer; font-size: 0.85rem; transition: all 0.2s; }
.profile-tabs .tab-btn:last-child { border-right: none; }
.profile-tabs .tab-btn.active { background: var(--bg3); color: var(--accent); }
.profile-card { text-align: center; padding: 1.5rem; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.75rem; }
.avatar-circle { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--soul)); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: #fff; margin: 0 auto 0.75rem; }
.profile-type { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.25rem; }
.profile-bio { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* ===== Notifications ===== */
.notif-actions { margin-bottom: 0.75rem; }
.notif-list { display: flex; flex-direction: column; gap: 0.75rem; }
.notif-item { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; cursor: pointer; transition: all 0.2s; }
.notif-item:hover { border-color: var(--accent); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-type { font-size: 0.75rem; color: var(--accent); font-weight: 600; margin-bottom: 0.25rem; text-transform: uppercase; }
.notif-msg { font-size: 0.875rem; color: var(--text); }
.notif-date { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ===== Utilities ===== */
.spinner {
  width: 36px; height: 36px; margin: 3rem auto; display: block;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); border-radius: var(--radius); padding: 1rem; color: var(--error); font-size: 0.875rem; }
.empty-state { text-align: center; color: var(--text-muted); padding: 3rem 1rem; font-size: 0.9rem; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  #app { padding: 1.25rem 1rem; }
  .asset-grid { grid-template-columns: 1fr; }
  .detail-actions { flex-direction: column; }
  .profile-tabs .tab-btn { font-size: 0.78rem; padding: 0.5rem 0.25rem; }
}

/* GitHub OAuth button */
.btn-github {
  background: #24292e;
  color: #fff;
  border: 1px solid #444;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-github:hover { background: #1a1e22; }

/* Divider between login methods */
.divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: var(--text-secondary, #888);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #e2e8f0);
}
.divider::before { margin-right: 12px; }
.divider::after { margin-left: 12px; }


/* List layout with sidebar */
.list-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.list-main { min-width: 0; }

/* Sidebar */
.sidebar { position: sticky; top: 80px; }
.sidebar-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar-title {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text);
}
.hot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: .875rem;
  transition: color .15s;
}
.hot-item:last-child { border-bottom: none; }
.hot-item:hover { color: var(--accent); }
.hot-name {
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hot-meta {
  color: var(--text-muted);
  font-size: .75rem;
  white-space: nowrap;
}

/* Install command box */
.install-cmd {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.install-cmd h3 {
  font-size: 1rem;
  margin-bottom: 6px;
  color: var(--text);
}
.install-cmd p {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.cmd-box {
  background: #0d0d14;
  color: #a5b4fc;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: .875rem;
  word-break: break-all;
  margin-bottom: 8px;
  user-select: all;
}

/* Responsive: stack sidebar below on narrow screens */
@media (max-width: 768px) {
  .list-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

/* Landing page */
.hero {
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg3) 50%, rgba(99,102,241,0.12) 100%);
  color: var(--text);
  padding: 36px 20px 32px;
  text-align: center;
  border-radius: 16px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
.hero-inner { max-width: 700px; margin: 0 auto; }
.hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-lg { padding: 10px 24px; font-size: 0.9rem; }
.btn-primary.btn-lg { background: var(--accent); color: #fff; }
.btn-primary.btn-lg:hover { background: var(--accent-hover); }
.btn-outline.btn-lg { border-color: var(--border); color: var(--text); }
.btn-outline.btn-lg:hover { border-color: var(--accent); color: var(--accent); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 0;
}
.stat { text-align: center; }
.stat-num {
  display: inline;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  display: inline;
  font-size: .85rem;
  color: var(--text-muted);
}

/* Landing sections */
.landing-sections { max-width: 960px; margin: 0 auto; padding: 0 20px 32px; }
.landing-section { padding: 20px 0; }
.landing-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .landing-two-col { grid-template-columns: 1fr; }
}
.section-inner { max-width: 100%; }
.landing-cta {
  text-align: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  margin-top: 20px;
}
.landing-cta h2 { font-size: 1.3rem; margin-bottom: 8px; color: var(--text); }
.landing-cta p { color: var(--text-muted); margin-bottom: 16px; }
.landing-cta .cmd-box { display: inline-block; text-align: left; }

@media (max-width: 600px) {
  .hero { padding: 24px 16px 20px; border-radius: 12px; }
  .hero-title { font-size: 1.2rem; }
  .hero-stats { gap: 16px; }
  .stat-num { font-size: 1rem; }
}

/* User profile page (public) */
.profile-header-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--soul));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}
.profile-info h1 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}
.profile-info .profile-bio {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 8px;
}
.profile-meta {
  display: flex;
  gap: 16px;
  font-size: .85rem;
  color: var(--text-muted);
}
.card-author a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.card-author a:hover {
  color: var(--accent);
}

/* Status filter tabs */
.status-filter {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.status-filter .tab-btn {
  flex: 1;
  padding: 0.5rem;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.status-filter .tab-btn:last-child { border-right: none; }
.status-filter .tab-btn.active { background: var(--accent); color: #fff; }

/* Upload page */
.upload-page { max-width: 600px; margin: 0 auto; padding: 20px; }
.upload-form {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.upload-form .field { margin-bottom: 16px; }
.upload-form label { display: block; font-size: .875rem; color: var(--text-muted); margin-bottom: 4px; }
.upload-form input[type="text"],
.upload-form input[type="number"],
.upload-form textarea,
.upload-form select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  font-family: inherit;
}
.upload-form input:focus,
.upload-form textarea:focus {
  border-color: var(--accent);
}
.file-drop {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  color: var(--text-muted);
}
.file-drop:hover { border-color: var(--accent); background: var(--bg3); }
.file-drop.dragover { border-color: var(--accent); background: rgba(99,102,241,0.1); }
.file-drop input[type="file"] { display: none; }
.file-drop p { margin: 0; }

/* Responsive fixes for mobile */
@media (max-width: 600px) {
  .nav-inner { flex-wrap: wrap; gap: 8px; }
  .nav-links { flex-wrap: wrap; gap: 8px; }
  .search-bar { flex-wrap: wrap; }
  .search-bar input { width: 100%; }
  .search-bar select { flex: 1; }
  .asset-grid { grid-template-columns: 1fr; }
  .detail-actions { flex-wrap: wrap; }
  .detail-actions .btn { flex: 1; min-width: 120px; }
  .hero-title { font-size: 1.3rem; }
  .profile-header-card { flex-direction: column; text-align: center; }
  .profile-meta { justify-content: center; }
}

/* How it works */
.section-title-center {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}
.how-it-works {
  max-width: 960px;
  margin: 0 auto 24px;
  padding: 0 20px;
}
.hiw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;
}
.hiw-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.hiw-icon {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}
.hiw-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.hiw-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.hiw-card .cmd-box {
  margin-top: 6px;
  font-size: 0.75rem;
  padding: 8px 10px;
}
.hiw-note {
  font-size: 0.72rem !important;
  color: var(--text-muted);
  margin-top: 6px;
  opacity: 0.7;
}

@media (max-width: 768px) {
  .hiw-grid { grid-template-columns: 1fr; }
}


/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  color: var(--text);
}
.modal-box p { margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* Button danger */
.btn-danger { background: #e53e3e; color: #fff; border: none; }
.btn-danger:hover { background: #c53030; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }

/* Reject reason */
.reject-reason {
  background: #fee2e2;
  color: #991b1b;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 8px;
}

/* Card actions */
.card-actions {
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
}

/* Review dimension scores */
.review-scores { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.dim-score { font-size: 0.75rem; color: var(--text-muted); background: var(--bg3); padding: 0.15rem 0.5rem; border-radius: 999px; }
.dim-scores-input { display: flex; flex-direction: column; gap: 0.5rem; }
.dim-row { display: flex; align-items: center; gap: 0.75rem; }
.dim-row label:first-child { min-width: 60px; font-size: 0.85rem; }
.dim-row .star-input { display: flex; gap: 0.15rem; }

/* ── Dashboard ──────────────────────────────────────── */
.dashboard-page { max-width: 1200px; margin: 0 auto; }
.dashboard-page .page-header { margin-bottom: 2rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-card--warn { border-color: var(--warning, #d29922); }
.stat-card.loading { opacity: 0.5; }

.stat-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--text); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.stat-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }

.text-warning { color: #d29922; }
.text-muted { color: var(--text-muted); }

.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
  .dashboard-row { grid-template-columns: 1fr; }
}

.chart-container { padding: 1.25rem; }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.chart-title { font-size: 1rem; font-weight: 600; margin: 0; }
.chart-controls { display: flex; gap: 0.4rem; }
.chart-controls .trend-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.review-queue { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.queue-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.queue-item:last-of-type { border-bottom: none; }
.queue-label { font-size: 0.9rem; color: var(--text-muted); }
.queue-value { font-size: 1.2rem; font-weight: 700; }

.recent-reviews { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.5rem 0; }
.review-record { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.review-record:last-child { border-bottom: none; }
.review-name { flex: 1; font-size: 0.9rem; color: var(--text); }
.review-date { font-size: 0.78rem; color: var(--text-muted); }

.nav-admin-link { color: #58a6ff; font-weight: 500; }

/* Lucide inline icons */
.inline-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.inline-icon svg {
  width: 100%;
  height: 100%;
}

/* ===================================================
   Landing Page v2 — Terminal Bloom
   All classes prefixed lp-* to avoid collision
   =================================================== */

/* ── Keyframes ── */
@keyframes lp-orb-drift-a {
  0%,100% { transform: translate(0,0) scale(1); }
  30%     { transform: translate(55px,-40px) scale(1.06); }
  65%     { transform: translate(-35px, 50px) scale(0.94); }
}
@keyframes lp-orb-drift-b {
  0%,100% { transform: translate(0,0) scale(1); }
  45%     { transform: translate(-60px,-50px) scale(1.1); }
}
@keyframes lp-orb-drift-c {
  0%,100% { transform: translate(0,0); }
  38%     { transform: translate(35px,30px); }
  75%     { transform: translate(-20px,-25px); }
}
@keyframes lp-dot-pulse {
  0%,100% { opacity:1; box-shadow:0 0 6px var(--success); }
  50%     { opacity:.4; box-shadow:0 0 14px var(--success),0 0 28px var(--success); }
}
@keyframes lp-stat-in {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes lp-card-in {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ── Hero wrapper — bleeds to #app edges ── */
.lp-hero {
  position: relative;
  overflow: hidden;
  margin: -2rem calc(-50vw + 50%) 4.5rem;
  min-height: 100vh;
  padding: 8rem 2rem 5.5rem;
  background: var(--bg);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Gradient border at hero bottom */
.lp-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(99,102,241,.5) 25%,
    rgba(168,85,247,.7) 50%,
    rgba(99,102,241,.5) 75%,
    transparent
  );
}

/* Subtle dot-grid texture */
.lp-bg-grid {
  position: absolute;
  inset: 0; z-index: 0;
  background-image:
    radial-gradient(circle, rgba(99,102,241,.18) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 0%, black 20%, transparent 100%);
  pointer-events: none;
}

/* Scanline overlay */
.lp-bg-scanlines {
  position: absolute;
  inset: 0; z-index: 1;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,.06) 3px,
    rgba(0,0,0,.06) 4px
  );
  pointer-events: none;
}

/* Glowing orbs */
.lp-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  will-change: transform;
}
.lp-orb-1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(99,102,241,.22), transparent 70%);
  top: -180px; left: -120px;
  animation: lp-orb-drift-a 18s ease-in-out infinite;
}
.lp-orb-2 {
  width: 440px; height: 440px;
  background: radial-gradient(circle, rgba(168,85,247,.18), transparent 70%);
  top: -60px; right: -80px;
  animation: lp-orb-drift-b 24s ease-in-out infinite;
}
.lp-orb-3 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(6,182,212,.15), transparent 70%);
  bottom: 60px; left: 35%;
  animation: lp-orb-drift-c 16s ease-in-out infinite 2s;
}

/* Content inside hero */
.lp-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 680px;
  width: 100%;
}

/* Eyebrow pill */
.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: .3rem .9rem;
  border: 1px solid rgba(99,102,241,.3);
  border-radius: 999px;
  background: rgba(99,102,241,.07);
  backdrop-filter: blur(4px);
  margin-bottom: 1.75rem;
}
.lp-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  flex-shrink: 0;
  animation: lp-dot-pulse 2.2s ease-in-out infinite;
}

/* Main title */
.lp-title {
  font-family: 'Syne', system-ui, sans-serif;
  font-size: clamp(2.1rem, 5.5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.lp-title-em {
  font-style: normal;
  background: linear-gradient(130deg, var(--accent) 0%, var(--soul) 52%, var(--skill) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Subtitle */
.lp-subtitle {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.85;
  letter-spacing: .02em;
  margin-bottom: 2.5rem;
}

/* Stats row */
.lp-stats-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin-bottom: 2.75rem;
  flex-wrap: wrap;
  gap: 0;
}
.lp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .25rem 2.25rem;
  border-right: 1px solid var(--border);
  animation: lp-stat-in .5s ease both;
}
.lp-stat:last-child { border-right: none; }
.lp-stat:nth-child(2) { animation-delay: .1s; }
.lp-stat:nth-child(3) { animation-delay: .2s; }
.lp-stat-num {
  font-family: 'Syne', system-ui, sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -.02em;
  display: block;
}
.lp-stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .63rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-top: .3rem;
  display: block;
}

/* Hero CTAs */
.lp-hero-ctas {
  display: flex;
  gap: .875rem;
  justify-content: center;
  flex-wrap: wrap;
}
.lp-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.75rem;
  background: var(--accent);
  color: #fff;
  border: 1px solid rgba(99,102,241,.6);
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 0 24px rgba(99,102,241,.35), inset 0 1px 0 rgba(255,255,255,.1);
}
.lp-btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  box-shadow: 0 0 40px rgba(99,102,241,.6), inset 0 1px 0 rgba(255,255,255,.15);
  transform: translateY(-2px);
}
.lp-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.75rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
}
.lp-btn-outline:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(99,102,241,.06);
  transform: translateY(-2px);
}

/* ── Landing sections ── */
.lp-section { margin-bottom: 5rem; }

.lp-section-hd {
  text-align: center;
  margin-bottom: 3rem;
}
.lp-kicker {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: .65rem;
}
.lp-section-h2 {
  font-family: 'Syne', system-ui, sans-serif;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.025em;
}

/* ── How it works ── */
.lp-steps {
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  gap: 1.25rem;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}
.lp-step-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2.75rem;
  color: var(--text-muted);
  opacity: .35;
}
.lp-step-connector svg { width: 22px; height: 22px; }

.lp-step {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  position: relative;
  transition: border-color .3s, box-shadow .3s, transform .3s;
  animation: lp-card-in .5s ease both;
}
.lp-step:hover {
  border-color: rgba(99,102,241,.45);
  box-shadow: 0 14px 52px rgba(99,102,241,.1);
  transform: translateY(-4px);
}
.lp-step:nth-child(3) { animation-delay: .12s; }

.lp-step-badge {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .05em;
  padding: .2rem .45rem;
  border-radius: 5px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  opacity: .7;
}
.lp-step-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.lp-step-icon svg { width: 24px; height: 24px; }
.lp-step-icon-ai {
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.25);
  color: var(--accent);
}
.lp-step-icon-human {
  background: rgba(168,85,247,.1);
  border: 1px solid rgba(168,85,247,.25);
  color: var(--soul);
}
.lp-step h3 {
  font-family: 'Syne', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .65rem;
  letter-spacing: -.01em;
}
.lp-step p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: .75rem;
}
.lp-step p:last-child { margin-bottom: 0; }
.lp-step .cmd-box {
  font-size: .76rem;
  padding: .65rem .875rem;
  margin: .75rem 0;
}
.lp-hiw-note {
  font-size: .75rem !important;
  color: var(--text-muted) !important;
  opacity: .6;
  margin-top: .5rem !important;
  margin-bottom: 0 !important;
  line-height: 1.5 !important;
}

/* ── Asset columns ── */
.lp-assets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}
.lp-col-header {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: 'Syne', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.lp-col-icon { width: 1.1em; height: 1.1em; flex-shrink: 0; }
.lp-icon-hot { color: #fb923c; }
.lp-icon-new { color: var(--skill); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .lp-hero {
    margin: -1.25rem -1rem 3.5rem;
    min-height: auto;
    padding: 4rem 1.25rem 3.5rem;
    display: block;
  }
  .lp-steps {
    grid-template-columns: 1fr;
  }
  .lp-step-connector { display: none; }
  .lp-assets-grid { grid-template-columns: 1fr; gap: 2rem; }
  .lp-stat { padding: .25rem 1.5rem; }
  .lp-stat-num { font-size: 1.85rem; }
}
@media (max-width: 480px) {
  .lp-title { font-size: 2.1rem; }
  .lp-stat { padding: .25rem 1rem; }
  .lp-stat-num { font-size: 1.6rem; }
  .lp-btn-primary, .lp-btn-outline { padding: .7rem 1.25rem; font-size: .875rem; }
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  color: var(--text);
}
.footer-powered strong {
  color: var(--accent);
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s;
}
.footer-links a:hover {
  color: var(--accent);
}
@media (max-width: 600px) {
  .footer-inner { flex-direction: column; gap: .5rem; }
}

/* ========== Markdown 渲染（评论、详情描述等） ========== */

/* 标题 — 评论内标题必须降级，不能比 section-title 大 */
.review-body h1 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 1.2em 0 0.5em; }
.review-body h2 { font-size: 0.95rem; font-weight: 600; color: var(--text); margin: 1em 0 0.4em; padding-bottom: 0.3em; border-bottom: 1px solid var(--border); }
.review-body h3 { font-size: 0.9rem; font-weight: 600; color: var(--text); margin: 0.8em 0 0.3em; }
.review-body h4, .review-body h5, .review-body h6 { font-size: 0.875rem; font-weight: 600; color: var(--text); margin: 0.6em 0 0.3em; }

/* 段落 */
.review-body p { margin: 0.5em 0; line-height: 1.7; }

/* 列表 */
.review-body ul, .review-body ol { padding-left: 1.5em; margin: 0.5em 0; }
.review-body li { margin-bottom: 0.2em; line-height: 1.6; }
.review-body li > ul, .review-body li > ol { margin: 0.2em 0; }

/* 行内代码 */
.review-body code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.8rem;
  background: rgba(99,102,241,0.1);
  color: var(--accent);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

/* 代码块包装 */
.code-block {
  margin: 0.75em 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0d0d14;
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.75rem;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.code-lang {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.code-copy-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.code-copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.code-block pre {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.8rem;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  line-height: 1.5;
}
.code-block pre code {
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  color: var(--text);
  font-size: inherit;
}

/* 引用块 */
.review-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 0.75em 0;
  padding: 0.4em 0.8em;
  background: rgba(99,102,241,0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}
.review-body blockquote p { margin: 0.3em 0; }

/* 链接 */
.review-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.review-body a:hover { color: var(--accent-hover); }

/* 表格 */
.review-body table { width: 100%; border-collapse: collapse; margin: 0.75em 0; font-size: 0.82rem; }
.review-body th, .review-body td { border: 1px solid var(--border); padding: 0.4em 0.6em; text-align: left; color: var(--text); }
.review-body th { background: var(--bg3); font-weight: 600; }

/* 分割线 */
.review-body hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }

/* 图片 */
.review-body img { max-width: 100%; border-radius: var(--radius); margin: 0.5em 0; }

/* Relay instance cards */
.relay-card {
  background: var(--card-bg, #1a1a2e);
  border: 1px solid var(--border, #2a2a4a);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.relay-card:hover {
  border-color: var(--accent, #8B5CF6);
}
.relay-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.relay-card-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text, #e2e8f0);
}
.relay-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 0.5rem;
}
.relay-card-meta code {
  background: rgba(255,255,255,0.06);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
  word-break: break-all;
}
.relay-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.relay-online {
  color: #22c55e;
}
.relay-offline {
  color: #64748b;
}
.relay-creation-modal {
  max-width: 500px;
}
.relay-creation-modal .secret-display {
  background: rgba(255,255,255,0.05);
  border: 1px dashed var(--border, #2a2a4a);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  font-family: monospace;
  font-size: 0.85rem;
  word-break: break-all;
  line-height: 1.6;
}
.relay-creation-modal .secret-display .label {
  color: var(--text-muted, #94a3b8);
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
}
.relay-creation-modal .warning {
  color: #f59e0b;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}
.relay-copy-btn {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  background: none;
  border: none;
  color: var(--text, #e2e8f0);
  padding: 2px 6px;
  border-radius: 4px;
}
.relay-copy-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
}
/* Relay 折叠面板 */
.relay-section {
  border-bottom: 1px solid var(--border, #2a2a4a);
  padding: 0.1rem 0;
}
.relay-section-last {
  border-bottom: none;
}
.relay-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  cursor: pointer;
  user-select: none;
  gap: 0.5rem;
}
.relay-section-header:hover {
  color: var(--accent, #8B5CF6);
}
.relay-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text, #e2e8f0);
}
.relay-section-header .chevron {
  transition: transform 0.2s ease;
  transform: rotate(180deg);
  flex-shrink: 0;
  color: var(--text-muted, #94a3b8);
}
.relay-section-body {
  padding-bottom: 0.75rem;
}
/* 密钥卡片 */
.relay-key-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  background: rgba(255,255,255,0.03);
  transition: background 0.15s;
  flex-wrap: wrap;
}
.relay-key-card:hover {
  background: rgba(255,255,255,0.07);
}
.relay-key-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.relay-key-name {
  font-size: 0.88rem;
  color: var(--text, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.relay-key-status {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
  flex-shrink: 0;
}
.relay-key-status-active {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}
.relay-key-status-disabled {
  background: rgba(100,116,139,0.15);
  color: #94a3b8;
}
.relay-key-status-expired {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}
.relay-key-value-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.relay-key-value {
  font-family: monospace;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.06);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--text-muted, #94a3b8);
}
.relay-key-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

/* ===================================================
   个人中心 — Sidebar Layout
   =================================================== */

/* Outer container: sidebar + content */
.user-page {
  display: flex;
  align-items: flex-start;
  gap: 0;
  min-height: calc(100vh - 120px);
  /* Pull out of #app's padding to fill width properly */
  margin: -2rem -1.5rem;
}

/* ── Sidebar ── */
.user-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: rgba(18, 18, 26, 0.85);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  /* Subtle dot noise texture */
  background-image:
    radial-gradient(circle, rgba(99,102,241,.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(18,18,26,0.95) 0%, rgba(10,10,15,0.95) 100%);
  background-size: 24px 24px, 100% 100%;
  scrollbar-width: none;
}
.user-sidebar::-webkit-scrollbar { display: none; }

/* Sidebar profile card */
.user-sidebar-profile {
  padding: 1.75rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
}
.sidebar-avatar {
  width: 56px !important;
  height: 56px !important;
  font-size: 1.5rem !important;
  margin: 0 0 0.5rem !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2), 0 0 0 6px rgba(99,102,241,0.07);
  flex-shrink: 0;
}
.sidebar-username {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.sidebar-type-badge {
  font-size: 0.7rem !important;
  padding: 2px 9px !important;
}
.badge-muted {
  background: rgba(136,136,153,0.12);
  color: var(--text-muted);
  border: 1px solid rgba(136,136,153,0.25);
}
.sidebar-bio {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.15rem;
}

/* Nav list */
.user-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
}
.nav-group-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 1.1rem 1.5rem 0.3rem;
  pointer-events: none;
  opacity: 0.7;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 1.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
  font-family: inherit;
}
.nav-item:hover {
  background: rgba(255,255,255,0.035);
  color: var(--text);
}
.nav-item.active {
  background: rgba(99,102,241,0.1);
  border-left-color: var(--accent);
  color: var(--accent);
}
.nav-item svg {
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.nav-item.active svg,
.nav-item:hover svg {
  opacity: 1;
}

/* Logout at sidebar bottom */
.sidebar-footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.sidebar-logout {
  width: 100%;
  justify-content: center;
  color: var(--text-muted) !important;
  font-size: 0.82rem !important;
}
.sidebar-logout:hover {
  color: var(--error) !important;
  border-color: var(--error) !important;
}

/* ── Content area ── */
.user-content {
  flex: 1;
  min-width: 0;
  padding: 2rem;
  max-width: 900px;
  /* Subtle gradient */
  background: linear-gradient(160deg, rgba(99,102,241,0.03) 0%, transparent 40%);
}

/* Hide mobile profile card on desktop */
@media (min-width: 769px) {
  .profile-card-mobile {
    display: none;
  }
}

/* ── Mobile: sidebar → horizontal scrollable tab bar ── */
@media (max-width: 768px) {
  .user-page {
    flex-direction: column;
    margin: -1.25rem -1rem 0;
  }
  .user-sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    background-image: none;
    background: var(--bg2);
    overflow-x: auto;
    overflow-y: visible;
    backdrop-filter: none;
    padding: 0;
  }
  .user-sidebar-profile,
  .sidebar-footer {
    display: none;
  }
  .user-sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    padding: 0;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .user-sidebar-nav::-webkit-scrollbar { display: none; }
  .nav-group-label {
    display: none;
  }
  .nav-item {
    flex-shrink: 0;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    gap: 0.4rem;
    white-space: nowrap;
  }
  .nav-item.active {
    border-bottom-color: var(--accent);
    border-left-color: transparent;
    background: rgba(99,102,241,0.08);
  }
  .nav-item svg {
    width: 15px;
    height: 15px;
  }
  .user-content {
    padding: 1.25rem 1rem;
  }
  .profile-card-mobile {
    display: block;
  }
}

/* ── My Assets UI Enhancements ── */
.status-tabs-badge .tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  padding: 0 0.4em;
  height: 1.4em;
  border-radius: 999px;
  background: rgba(99,102,241,0.15);
  color: var(--text-muted);
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
}
.tab-btn.active .tab-count-badge {
  background: rgba(99,102,241,0.3);
  color: var(--accent);
}
.my-assets-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 1rem;
}
.my-assets-empty .empty-hint {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.my-asset-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.my-asset-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.asset-version {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 0.1em 0.45em;
  margin-left: auto;
}
.card-metrics {
  display: flex;
  gap: 1rem;
  margin: 0.5rem 0 0.25rem;
}
.metric-item {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.metric-item strong {
  color: var(--text-primary);
  font-weight: 600;
}
.metric-rating strong {
  color: #f0a130;
}
.modal-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--text-primary);
}
/* Auth page simplified */
.auth-title {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  margin: 1rem 0 0.5rem;
  color: var(--text-primary);
}
.auth-hint {
  font-size: 0.83rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Sidebar */
.nav-group-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: #6b7280; padding: 16px 16px 4px; opacity: 0.5; }
.nav-item.active { background: rgba(139,92,246,0.08); border-left: 2px solid #7c3aed; }
.avatar-img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border, #2a2a3a); }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border, #2a2a3a); margin-bottom: 20px; }
.page-title { font-size: 1.1rem; color: #e2e2f0; }
.page-desc { font-size: 0.8rem; color: #6b7280; }

/* Instance Card */
.instance-card { background: rgba(255,255,255,0.02); border: 1px solid var(--border, #2a2a3a); border-radius: 10px; padding: 1.25rem; transition: all 0.2s; }
.instance-card:hover { border-color: rgba(139,92,246,0.3); box-shadow: 0 4px 20px rgba(139,92,246,0.06); }
.instance-name { font-size: 1rem; font-weight: 600; color: #e2e2f0; }
.instance-id { font-family: monospace; font-size: 0.8rem; color: #6b7280; word-break: break-all; }
.instance-actions { display: flex; gap: 8px; margin-top: 12px; }
.instance-actions a, .instance-actions button { font-size: 0.8rem; padding: 4px 12px; border-radius: 6px; }

/* Status Badge */
.status-online { background: rgba(34,197,94,0.1); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; }
.status-offline { background: rgba(100,116,139,0.1); color: #64748b; border: 1px solid rgba(100,116,139,0.2); padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; }

.badge-observer { background: rgba(56,189,248,0.1); color: #38bdf8; border: 1px solid rgba(56,189,248,0.2); padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; }

/* Card hover */
.asset-card:hover { border-color: rgba(139,92,246,0.3); box-shadow: 0 0 0 1px rgba(139,92,246,0.15); }

/* ===== Assets List View ===== */
.assets-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border, #2a2a3a); border-radius: 10px; overflow: hidden; }
.asset-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border, #2a2a3a); transition: background 0.15s; cursor: pointer; }
.asset-row:last-child { border-bottom: none; }
.asset-row:hover { background: rgba(255,255,255,0.02); }
.asset-row:hover .asset-row-actions { opacity: 1; }
.asset-row-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.asset-row-info { min-width: 0; }
.asset-row-name { font-size: 0.9rem; font-weight: 600; color: #e2e2f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-row-desc { font-size: 0.78rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.asset-row-meta { display: flex; align-items: center; gap: 14px; font-size: 0.8rem; color: #6b7280; }
.asset-row-meta span { display: flex; align-items: center; gap: 4px; }
.asset-row-actions { opacity: 0; transition: opacity 0.15s; display: flex; align-items: center; gap: 6px; }
.asset-row-actions .btn-row-link,
.asset-row-actions .btn-danger { font-size: 0.78rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; background: none; border: 1px solid transparent; color: #6b7280; text-decoration: none; display: inline-block; }
.asset-row-actions .btn-row-link:hover { background: rgba(255,255,255,0.05); border-color: var(--border, #2a2a3a); color: #e2e2f0; }
.asset-row-actions .btn-danger:hover { color: #ef4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.05); }
.reject-reason-inline { font-size: 0.75rem; color: #f87171; margin-top: 4px; }

/* Status tabs — underline indicator */
.status-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border, #2a2a3a); margin-bottom: 16px; }
.status-tabs .tab-btn { padding: 8px 16px; font-size: 0.82rem; color: #6b7280; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.15s; margin-bottom: -1px; }
.status-tabs .tab-btn:hover { color: #e2e2f0; }
.status-tabs .tab-btn.active { color: #a78bfa; border-bottom-color: #7c3aed; }
.tab-count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 0.7rem; background: rgba(255,255,255,0.06); color: #6b7280; margin-left: 6px; }
.tab-btn.active .tab-count-badge { background: rgba(124,58,237,0.15); color: #a78bfa; }

/* Improved empty state */
.assets-empty { text-align: center; padding: 60px 20px; }
.assets-empty i { color: #3b3b4b; margin-bottom: 16px; display: block; margin-left: auto; margin-right: auto; }
.assets-empty h3 { font-size: 1rem; color: #e2e2f0; margin-bottom: 6px; }
.assets-empty p { font-size: 0.85rem; color: #6b7280; margin-bottom: 20px; }
