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

:root {
  --bg: #0a0e1a;
  --bg-card: #111827;
  --card: var(--bg-card);
  --text: #f0ede6;
  --purple: #a78bfa;
  --pink: #f9a8d4;
  --muted: #9ca3af;
  --border: rgba(167,139,250,0.15);
  --blue: #7dd3fc;
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
}

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

a:hover {
  color: var(--blue);
}

nav:not(.sidebar-nav) {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  height: 60px;
  background: var(--bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--purple);
}

.logo span {
  color: var(--pink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-btn {
  padding: 6px 16px;
  border: 1px solid var(--purple);
  border-radius: 6px;
  color: var(--purple) !important;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--purple);
  color: #fff !important;
}

.nav-btn-primary {
  background: var(--purple);
  color: #fff !important;
  border-color: var(--purple);
}

.nav-btn-primary:hover {
  background: #8b5cf6;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), #8b5cf6);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(167,139,250,0.3);
  color: #fff;
}

.btn-ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--purple);
}

.btn-ghost:hover {
  border-color: var(--purple);
}

.btn-pink {
  background: linear-gradient(135deg, #f9a8d4, #ec4899);
}

.section {
  padding: 80px 5%;
}

.section-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.section h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.section .sub {
  color: var(--muted);
  margin-bottom: 2rem;
}

.section-center {
  text-align: center;
}

.graph-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s;
  cursor: pointer;
}

.graph-card:hover {
  border-color: var(--purple);
  transform: translateY(-3px);
}

.graph-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.graph-card .meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.graph-card .stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.8rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.graph-card .stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.graph-card .author-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.6rem;
}

.graph-card .author-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #fff;
  flex-shrink: 0;
  line-height: 1;
}

.graph-card .author-name {
  font-size: 0.78rem;
  color: var(--purple);
}

.graph-card .author-name:hover {
  color: var(--pink);
}

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

footer {
  padding: 2rem 5%;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.create-form {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.create-form.show {
  display: block;
}

.create-form input,
.create-form textarea,
.create-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.create-form textarea {
  min-height: 80px;
  resize: vertical;
}

.create-form button {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: var(--purple);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  border-radius: 2px;
  margin: 0 auto 1.5rem;
}
