:root {
  --ink: #080b10;
  --ink-2: #10161f;
  --ink-3: #182030;
  --ink-4: #1f2a3d;
  --mist: #8b9bb0;
  --paper: #eef2f7;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --cyan: #3dd6c6;
  --cyan-dim: rgba(61, 214, 198, 0.12);
  --blue: #5b9dff;
  --blue-dim: rgba(91, 157, 255, 0.14);
  --pink: #ff6b9d;
  --pink-dim: rgba(255, 107, 157, 0.14);
  --green: #3ecf8e;
  --green-dim: rgba(62, 207, 142, 0.14);
  --warn: #f0b429;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--ink);
  color: var(--paper);
  line-height: 1.55;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(61, 214, 198, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(91, 157, 255, 0.1), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(255, 107, 157, 0.05), transparent);
  pointer-events: none;
  z-index: 0;
}
a { color: var(--cyan); text-decoration: none; }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }

#app { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(8, 11, 16, 0.88);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
  display: block;
}
.brand span { color: var(--cyan); }
.topbar .spacer { flex: 1; }

.search-bar {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  height: 38px;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--cyan); }
.search-bar svg { flex-shrink: 0; opacity: 0.5; }
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--paper);
  font-size: 0.88rem;
  outline: none;
}
.search-bar input::placeholder { color: var(--mist); }

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--mist);
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  transition: background 0.2s;
}
.user-pill:hover { background: var(--ink-3); }

.nav-tabs { display: flex; gap: 4px; background: var(--ink-3); padding: 4px; border-radius: 999px; }
.nav-tabs button {
  border: none;
  background: transparent;
  color: var(--mist);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.nav-tabs button.active { background: var(--blue); color: #fff; }
.nav-tabs button:hover:not(.active) { color: var(--paper); }

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 188px 1fr 260px;
  gap: 0;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.sidebar {
  padding: 16px 10px;
  border-right: 1px solid var(--line);
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--mist);
  margin-bottom: 4px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.side-link .ico { font-size: 1.1rem; width: 22px; text-align: center; }
.side-link:hover { background: rgba(255,255,255,0.04); color: var(--paper); }
.side-link.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  font-weight: 600;
}
.side-legal {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.side-legal a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--mist);
  font-size: 0.82rem;
}
.side-legal a:hover { background: rgba(255,255,255,0.04); color: var(--paper); }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.legal-links a { color: var(--mist); font-size: 0.86rem; }
.legal-links a:hover { color: var(--cyan); }
.legal-links-stack { flex-direction: column; gap: 8px; }
.auth-legal {
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--mist);
  line-height: 1.6;
}
.main { padding: 16px 20px 80px; min-width: 0; }
.aside {
  padding: 16px 14px 80px 0;
  border-left: 1px solid var(--line);
}

@media (max-width: 1024px) {
  .aside { display: none; }
  .layout { grid-template-columns: 188px 1fr; }
}
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 8px 12px;
  }
  .side-link { white-space: nowrap; font-size: 0.85rem; padding: 8px 12px; }
  .side-link .ico { display: none; }
  .side-legal { flex-direction: row; margin-top: 0; padding-top: 0; border-top: none; gap: 4px; }
  .search-bar { max-width: none; }
  .topbar { padding: 8px 12px; gap: 8px; }
}

.card {
  background: rgba(16, 22, 31, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(8px);
}
.card-glow {
  position: relative;
  overflow: hidden;
}
.card-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(61,214,198,0.04), transparent 50%);
  pointer-events: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.post-card {
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  padding: 0;
  overflow: hidden;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.post-card-inner { padding: 12px 14px 14px; }
.post-card .thumb-wrap {
  position: relative;
  width: 100%;
  height: 110px;
  background: var(--ink-4);
  overflow: hidden;
}
.post-card .thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-card .thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.15;
}
.post-card .rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #f0b429, #ff6b9d);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}
.post-card .post-title {
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.post-card .post-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.post-meta { font-size: 0.75rem; color: var(--mist); }
.post-stats { margin-left: auto; display: flex; gap: 10px; font-size: 0.72rem; color: var(--mist); }

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink-4);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--cyan);
}
.avatar-28 { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-40 { width: 40px; height: 40px; font-size: 0.85rem; }
.avatar-64 { width: 64px; height: 64px; font-size: 1.2rem; }

.topic-badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-right: 4px;
}
.topic-求助 { background: var(--pink-dim); color: var(--pink); }
.topic-分享 { background: var(--cyan-dim); color: var(--cyan); }
.topic-讨论 { background: var(--blue-dim); color: var(--blue); }
.topic-晒图 { background: var(--green-dim); color: var(--green); }

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s, transform 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--blue), #4a7fe0); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--paper); }
.btn-follow { background: var(--blue-dim); border: 1px solid rgba(91,157,255,0.3); color: var(--blue); }
.btn-follow.on { background: var(--ink-4); border-color: var(--line); color: var(--mist); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.8rem; color: var(--mist); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink-3);
  color: var(--paper);
}
.field textarea { min-height: 100px; resize: vertical; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-box { width: 100%; max-width: 420px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; }
.msg { font-size: 0.85rem; margin-top: 8px; }
.msg.err { color: var(--pink); }
.msg.ok { color: var(--green); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 20px;
  box-shadow: var(--shadow);
}
.modal h2 { font-size: 1.1rem; margin-bottom: 12px; }

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cyan-dim);
  color: var(--cyan);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  cursor: pointer;
  background: var(--ink-3);
  transition: all 0.2s;
}
.chip.on { border-color: var(--blue); background: var(--blue-dim); color: var(--blue); }

.mall-card img.cover {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--ink-3);
  margin-bottom: 8px;
}
.empty { text-align: center; color: var(--mist); padding: 48px 16px; }
.empty .ico { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.3; }
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-3);
  border: 1px solid var(--line-2);
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 100;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 1.15rem; font-weight: 700; }
.page-head .spacer { flex: 1; }

.hero-banner {
  background: linear-gradient(135deg, rgba(91,157,255,0.15), rgba(61,214,198,0.1));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-banner .hero-ico { font-size: 1.8rem; }
.hero-banner h3 { font-size: 0.95rem; font-weight: 700; }
.hero-banner p { font-size: 0.8rem; color: var(--mist); margin-top: 2px; }

.profile-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.profile-header .info { flex: 1; min-width: 200px; }
.profile-header .name { font-size: 1.3rem; font-weight: 800; }
.profile-stats {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}
.stat-item:hover { background: rgba(255,255,255,0.04); }
.stat-item .num { font-size: 1.1rem; font-weight: 700; }
.stat-item .lbl { font-size: 0.72rem; color: var(--mist); margin-top: 2px; }

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 16px 0;
  overflow-x: auto;
}
.tab-bar button {
  border: none;
  background: none;
  color: var(--mist);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.88rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab-bar button.active { color: var(--paper); border-bottom-color: var(--cyan); font-weight: 600; }

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.user-row:hover { background: rgba(255,255,255,0.04); }
.user-row .info { flex: 1; min-width: 0; }
.user-row .name { font-weight: 600; font-size: 0.9rem; }
.user-row .bio { font-size: 0.78rem; color: var(--mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.aside-card { margin-bottom: 14px; }
.aside-card h3 { font-size: 0.85rem; font-weight: 700; margin-bottom: 10px; color: var(--mist); }
.hot-tag {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ink-3);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--mist);
  cursor: pointer;
  margin: 0 6px 6px 0;
  transition: all 0.2s;
}
.hot-tag:hover { border-color: var(--cyan); color: var(--cyan); }

.search-section { margin-bottom: 20px; }
.search-section h3 { font-size: 0.85rem; color: var(--mist); margin-bottom: 10px; }

.comment-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.comment-item:last-child { border-bottom: none; }
.comment-body { flex: 1; }
.comment-author { font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.comment-author:hover { color: var(--cyan); }
.comment-text { font-size: 0.88rem; margin-top: 4px; color: rgba(238,242,247,0.9); }

.detail-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.detail-author .author-info { flex: 1; cursor: pointer; }
.detail-author .author-name { font-weight: 700; font-size: 0.95rem; }
.detail-author .author-name:hover { color: var(--cyan); }

.fab-compose {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.fab-compose:hover { transform: scale(1.08); }
@media (min-width: 769px) { .fab-compose { display: none; } }

.legal-links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.legal-links a { color: var(--mist); font-size: 0.82rem; }
.legal-links a:hover { color: var(--cyan); }
.legal-links-stack { flex-direction: column; gap: 8px; }
.side-legal {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  padding: 12px 14px 4px;
  border-top: 1px solid var(--line);
}
.side-legal a { color: var(--mist); font-size: 0.78rem; }
.side-legal a:hover { color: var(--cyan); }
.auth-legal {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--mist);
  line-height: 1.6;
  text-align: center;
}
.auth-legal a { color: var(--cyan); }

.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.boot-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}
.boot-logo img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
}
.boot-sub { color: var(--mist); font-size: 0.9rem; }
