/* ================================================
   EchoBlog — Global Styles
   ================================================ */

/* ---- Reset & Variables ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #eef2ff;
  --primary-glow:   rgba(99,102,241,.18);
  --accent:         #f59e0b;
  --bg:             #f1f5f9;
  --bg2:            #e8edf5;
  --card:           #ffffff;
  --text:           #0f172a;
  --text2:          #334155;
  --muted:          #64748b;
  --border:         #e2e8f0;
  --border2:        #cbd5e1;
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --success:        #10b981;
  --success-light:  #d1fae5;
  --radius:         14px;
  --radius-sm:      8px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.07);
  --shadow:         0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.12);
  --nav-h:          64px;
  --transition:     .2s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ================================================
   Toast Notifications
   ================================================ */
#toast-container {
  position: fixed; top: 1.25rem; right: 1.25rem;
  z-index: 9999; display: flex; flex-direction: column; gap: .5rem;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: .65rem;
  padding: .75rem 1.2rem; border-radius: 10px;
  color: #fff; font-size: .875rem; font-weight: 500;
  box-shadow: var(--shadow-lg); pointer-events: all;
  animation: toastIn .3s var(--transition);
  max-width: 320px;
}
.toast.success { background: linear-gradient(135deg,#10b981,#059669); }
.toast.error   { background: linear-gradient(135deg,#ef4444,#dc2626); }
.toast.info    { background: linear-gradient(135deg,#6366f1,#4f46e5); }
.toast.warning { background: linear-gradient(135deg,#f59e0b,#d97706); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
@keyframes toastIn {
  from { transform: translateX(110%) scale(.9); opacity: 0; }
  to   { transform: translateX(0) scale(1);    opacity: 1; }
}

/* ================================================
   Loading Spinner
   ================================================ */
.spinner-wrap { display: flex; justify-content: center; padding: 4rem 0; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================
   Navbar
   ================================================ */
#navbar {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(226,232,240,.8);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 1.5rem;
  height: 100%; display: flex; align-items: center; gap: 1rem;
}
.nav-logo {
  display: flex; align-items: center; gap: .6rem;
  font-size: 1.3rem; font-weight: 800; color: var(--primary);
  cursor: pointer; letter-spacing: -.5px; flex-shrink: 0;
  transition: opacity var(--transition);
}
.nav-logo:hover { opacity: .8; }
.nav-logo-icon {
  width: 34px; height: 34px; background: var(--primary);
  border-radius: 9px; display: flex; align-items: center;
  justify-content: center; font-size: 1rem;
}
.nav-links { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.nav-btn {
  padding: .45rem 1rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  border: 1.5px solid transparent; background: transparent;
  color: var(--muted); transition: var(--transition);
}
.nav-btn:hover  { background: var(--primary-light); color: var(--primary); }
.nav-btn.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-btn.solid  {
  background: var(--primary); color: #fff;
  border-color: var(--primary); font-weight: 600;
}
.nav-btn.solid:hover { background: var(--primary-dark); }
.nav-btn.outline { border-color: var(--border2); }
.nav-btn.outline:hover { border-color: var(--primary); }

/* Nav avatar */
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  overflow: hidden; border: 2px solid var(--primary-light);
  cursor: pointer; transition: var(--transition);
  flex-shrink: 0;
}
.nav-avatar:hover { border-color: var(--primary); transform: scale(1.05); }
.nav-avatar img  { width: 100%; height: 100%; object-fit: cover; }
.nav-avatar-text {
  width: 100%; height: 100%; background: linear-gradient(135deg,var(--primary),var(--primary-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}

/* ================================================
   Page Container
   ================================================ */
.page { display: none; animation: pageFade .25s ease; }
.page.active { display: block; }
@keyframes pageFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.container { max-width: 1160px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ================================================
   Hero Banner (Home)
   ================================================ */
.hero {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  padding: 3.5rem 1.5rem;
  text-align: center; color: #fff;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 600px; margin: 0 auto; }
.hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: .75rem; letter-spacing: -.5px; }
.hero p  { font-size: 1.1rem; opacity: .88; margin-bottom: 1.75rem; }
.hero-search {
  display: flex; gap: .5rem; max-width: 480px; margin: 0 auto;
}
.hero-search input {
  flex: 1; padding: .75rem 1.25rem; border-radius: 10px;
  border: none; font-size: .95rem; outline: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.hero-search button {
  padding: .75rem 1.5rem; background: white; color: var(--primary);
  border: none; border-radius: 10px; font-weight: 700; font-size: .9rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); transition: var(--transition);
}
.hero-search button:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }

/* ================================================
   Home Layout
   ================================================ */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 900px) {
  .home-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
}

/* Category chips */
.section-title {
  font-size: 1rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 1rem;
}
.cat-chips {
  display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem;
}
.cat-chip {
  padding: .4rem 1rem; border-radius: 99px; font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--card); color: var(--muted);
  cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.cat-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cat-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ================================================
   Post Cards
   ================================================ */
.posts-grid { display: flex; flex-direction: column; gap: 1.25rem; }

.post-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex; flex-direction: column;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.post-card-cover {
  width: 100%; height: 180px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, var(--primary-light), var(--bg2));
  flex-shrink: 0;
}
.post-card-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.post-card:hover .post-card-cover img { transform: scale(1.04); }
.post-card-cover-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--primary); opacity: .3;
}

.post-card-body { padding: 1.4rem 1.5rem 1.25rem; flex: 1; display: flex; flex-direction: column; }

.post-card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  font-size: .78rem; color: var(--muted); margin-bottom: .65rem;
}
.post-card-cat {
  background: var(--primary-light); color: var(--primary);
  padding: .2rem .65rem; border-radius: 5px; font-size: .75rem; font-weight: 700;
}
.meta-dot { color: var(--border2); }

.post-card-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  margin-bottom: .55rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-excerpt {
  font-size: .875rem; color: var(--muted); line-height: 1.7; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 1rem;
}
.post-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: .85rem; border-top: 1px solid var(--border);
}
.post-author {
  display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted);
}
.post-author-avatar {
  width: 24px; height: 24px; border-radius: 50%; overflow: hidden;
  background: var(--primary-light); flex-shrink: 0;
}
.post-author-avatar img  { width: 100%; height: 100%; object-fit: cover; }
.post-author-avatar span {
  width: 100%; height: 100%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 700;
}
.post-tags { display: flex; gap: .35rem; flex-wrap: wrap; }
.tag-badge {
  padding: .18rem .55rem; background: var(--bg); border: 1px solid var(--border);
  border-radius: 5px; font-size: .72rem; color: var(--muted);
  transition: var(--transition);
}
.tag-badge:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-light); }

/* ================================================
   Sidebar
   ================================================ */
.sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.sidebar-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.sidebar-card-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
  font-size: .875rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: .5rem;
}
.sidebar-card-header .icon { font-size: 1rem; }
.sidebar-card-body { padding: .5rem; }

.sidebar-cat-item {
  padding: .6rem .75rem; border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .875rem; cursor: pointer; transition: var(--transition);
  color: var(--text2);
}
.sidebar-cat-item:hover { background: var(--primary-light); color: var(--primary); }
.sidebar-cat-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.cat-count {
  background: var(--bg); border: 1px solid var(--border);
  padding: .1rem .5rem; border-radius: 99px; font-size: .72rem; color: var(--muted);
}

/* Stats */
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem .75rem; font-size: .85rem;
}
.stat-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.stat-label { color: var(--muted); }
.stat-value { font-weight: 700; color: var(--primary); }

/* ================================================
   Pagination
   ================================================ */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: .4rem; margin-top: 2.5rem;
}
.page-btn {
  min-width: 38px; height: 38px; padding: 0 .5rem;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--card); font-size: .875rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); color: var(--text2);
}
.page-btn:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.page-btn:disabled { opacity: .35; pointer-events: none; }
.page-ellipsis { padding: 0 .25rem; color: var(--muted); line-height: 38px; }

/* ================================================
   Post Detail
   ================================================ */
.post-detail-wrap { max-width: 820px; margin: 0 auto; }

.back-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--card);
  font-size: .875rem; color: var(--muted); margin-bottom: 1.5rem;
  transition: var(--transition); box-shadow: var(--shadow-sm);
}
.back-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

.post-detail-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow);
}
.post-detail-cover {
  width: 100%; max-height: 380px; overflow: hidden;
  background: linear-gradient(135deg, var(--primary-light), var(--bg2));
}
.post-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-detail-body { padding: 2.5rem 3rem; }
@media (max-width: 600px) { .post-detail-body { padding: 1.5rem 1.25rem; } }

.post-detail-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  font-size: .82rem; color: var(--muted); margin-bottom: 1rem;
}
.post-detail-title {
  font-size: 2rem; font-weight: 800; line-height: 1.3;
  margin-bottom: 1.25rem; color: var(--text);
}
@media (max-width: 600px) { .post-detail-title { font-size: 1.5rem; } }

.post-detail-divider {
  height: 1px; background: var(--border); margin: 1.5rem 0;
}
.post-detail-content {
  font-size: 1rem; line-height: 2; color: var(--text2);
  white-space: pre-wrap; word-break: break-word;
}
.post-detail-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* ================================================
   Auth Page
   ================================================ */
.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 60%);
}
.auth-card {
  background: var(--card); border-radius: 20px;
  padding: 2.5rem 2.25rem; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo-icon {
  width: 56px; height: 56px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 16px; margin: 0 auto .75rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; box-shadow: 0 4px 16px var(--primary-glow);
}
.auth-logo h2 { font-size: 1.5rem; font-weight: 800; }
.auth-logo p  { font-size: .875rem; color: var(--muted); margin-top: .25rem; }

.auth-tabs { display: flex; gap: .4rem; margin-bottom: 2rem; background: var(--bg); padding: .3rem; border-radius: 10px; }
.auth-tab {
  flex: 1; padding: .6rem; border-radius: 8px; border: none;
  background: transparent; font-size: .9rem; font-weight: 600; color: var(--muted);
  transition: var(--transition);
}
.auth-tab.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ================================================
   Forms (shared)
   ================================================ */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block; font-size: .82rem; font-weight: 700; color: var(--muted);
  margin-bottom: .4rem; letter-spacing: .02em;
}
.form-control {
  width: 100%; padding: .7rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: .9rem;
  outline: none; transition: var(--transition);
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-glow); }
.form-control::placeholder { color: var(--border2); }
textarea.form-control { min-height: 220px; resize: vertical; line-height: 1.7; }
select.form-control { cursor: pointer; }

/* ================================================
   Buttons
   ================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; border: 1.5px solid transparent;
  transition: var(--transition); white-space: nowrap;
}
.btn-full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 16px var(--primary-glow); }
.btn-primary:active { transform: none; }
.btn-outline {
  background: var(--card); color: var(--text2); border-color: var(--border2);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: .35rem .85rem; font-size: .8rem; border-radius: 6px; }
.btn:disabled { opacity: .55; pointer-events: none; }

/* ================================================
   My Posts Page
   ================================================ */
.my-posts-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.75rem;
}
.page-title { font-size: 1.6rem; font-weight: 800; }
.page-subtitle { font-size: .875rem; color: var(--muted); margin-top: .2rem; }

.my-post-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.4rem; display: flex; align-items: center; gap: 1.1rem;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--transition);
  margin-bottom: .9rem;
}
.my-post-item:hover { box-shadow: var(--shadow); }
.my-post-thumb {
  width: 70px; height: 52px; border-radius: 8px; overflow: hidden;
  background: var(--primary-light); flex-shrink: 0;
}
.my-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-post-thumb-ph {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 1.3rem; color: var(--primary); opacity: .5;
}
.my-post-info { flex: 1; min-width: 0; }
.my-post-title {
  font-size: .95rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: .25rem;
}
.my-post-meta { font-size: .78rem; color: var(--muted); display: flex; gap: .75rem; }
.my-post-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* ================================================
   Profile Page
   ================================================ */
.profile-layout {
  max-width: 860px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 780px) {
  .profile-layout { grid-template-columns: 1fr; }
}

.profile-card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden; box-shadow: var(--shadow);
}
.profile-cover {
  height: 160px; background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 50%, #a78bfa 100%);
  position: relative; overflow: hidden;
}
.profile-cover-img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover-upload {
  position: absolute; inset: 0; background: rgba(0,0,0,.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; opacity: 0; transition: var(--transition); cursor: pointer;
  font-size: .8rem; gap: .35rem;
}
.profile-cover:hover .profile-cover-upload { opacity: 1; }
.profile-cover-upload span { font-size: 1.5rem; }

.profile-info-wrap { padding: 1.5rem 2rem 2rem; }
.profile-avatar-wrap {
  position: relative; width: 90px; margin-top: -56px; margin-bottom: 1rem;
}
.profile-avatar {
  width: 90px; height: 90px; border-radius: 50%; overflow: hidden;
  border: 4px solid #fff; box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  cursor: pointer; transition: var(--transition);
}
.profile-avatar:hover { transform: scale(1.05); }
.profile-avatar img  { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-text {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-size: 2rem; font-weight: 800; color: #fff;
}
.avatar-upload-hint {
  position: absolute; bottom: 2px; right: 2px;
  width: 24px; height: 24px; background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; color: #fff; border: 2px solid #fff;
  pointer-events: none;
}
.profile-name { font-size: 1.4rem; font-weight: 800; }
.profile-uid  { font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.profile-bio {
  font-size: .9rem; color: var(--text2); line-height: 1.7;
  margin-top: .75rem; padding: .75rem 1rem;
  background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-height: 40px;
}
.profile-bio-empty {
  color: var(--muted); font-style: italic; font-size: .85rem;
  cursor: pointer;
}
.profile-bio-empty:hover { color: var(--primary); }

.profile-location {
  display: flex; align-items: center; gap: .35rem;
  font-size: .82rem; color: var(--muted); margin-top: .6rem;
}

/* Social links */
.profile-socials {
  display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap;
}
.social-link {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem; border-radius: 99px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: .78rem; color: var(--muted);
  transition: var(--transition); text-decoration: none;
}
.social-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.social-link .social-icon { font-size: .9rem; }

.profile-actions { display: flex; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* Profile sidebar card */
.profile-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

/* Profile edit form in modal */
.profile-edit-group { margin-bottom: 1rem; }
.profile-edit-group label {
  display: block; font-size: .8rem; font-weight: 700; color: var(--muted);
  margin-bottom: .35rem; letter-spacing: .02em;
}
.profile-edit-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: .75rem;
}
@media (max-width: 500px) { .profile-edit-row { grid-template-columns: 1fr; } }

/* Join date badge */
.profile-join-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .65rem; background: var(--primary-light);
  border-radius: 99px; font-size: .75rem; color: var(--primary); font-weight: 600;
  margin-top: .5rem;
}

/* ================================================
   Modal
   ================================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 400; align-items: center; justify-content: center;
  padding: 1rem; backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; animation: overlayIn .2s ease; }
@keyframes overlayIn { from { opacity:0; } to { opacity:1; } }

.modal {
  background: var(--card); border-radius: 18px;
  width: 100%; max-width: 660px; max-height: 92vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: modalIn .25s var(--transition);
}
@keyframes modalIn { from { transform: scale(.96) translateY(8px); opacity:0; } to { transform:none; opacity:1; } }

.modal-header {
  padding: 1.5rem 1.75rem 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 1.2rem; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--bg); color: var(--muted); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body   { padding: 1.5rem 1.75rem; }
.modal-footer { padding: 0 1.75rem 1.5rem; display: flex; justify-content: flex-end; gap: .75rem; }

/* Cover image upload in modal */
.cover-upload-area {
  width: 100%; height: 140px; border-radius: var(--radius-sm);
  border: 2px dashed var(--border2); background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; cursor: pointer; transition: var(--transition);
  overflow: hidden; position: relative;
}
.cover-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.cover-upload-area img  { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-upload-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.4);
  display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: .4rem; color: #fff; font-size: .8rem;
}
.cover-upload-area:hover .cover-upload-overlay { display: flex; }
.cover-upload-icon { font-size: 2rem; color: var(--muted); }
.cover-upload-text { font-size: .82rem; color: var(--muted); }
.cover-upload-hint { font-size: .75rem; color: var(--border2); }

/* ================================================
   Empty State
   ================================================ */
.empty-state {
  text-align: center; padding: 4rem 1.5rem; color: var(--muted);
}
.empty-state-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: .6; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; color: var(--text2); }
.empty-state p   { font-size: .875rem; }

/* ================================================
   Footer
   ================================================ */
footer {
  margin-top: 4rem;
  padding: 2.5rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .82rem; color: var(--muted);
  background: var(--card);
}
.footer-inner {
  max-width: 1160px; margin: 0 auto;
}
.footer-brand {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  font-size: 1rem; font-weight: 800; color: var(--primary);
  margin-bottom: .75rem;
}
.footer-links {
  display: flex; justify-content: center; gap: 1.5rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.footer-links a {
  color: var(--muted); font-size: .82rem; transition: var(--transition);
}
.footer-links a:hover { color: var(--primary); }
.footer-copy { font-size: .78rem; color: var(--border2); }

/* ================================================
   404 Page
   ================================================ */
.page-404 {
  min-height: calc(100vh - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 2rem;
}
.page-404 h1 {
  font-size: 6rem; font-weight: 900; color: var(--primary);
  line-height: 1; margin-bottom: .5rem;
}
.page-404 h2 {
  font-size: 1.3rem; font-weight: 700; color: var(--text);
  margin-bottom: .5rem;
}
.page-404 p { color: var(--muted); margin-bottom: 2rem; }

/* ================================================
   Utilities
   ================================================ */
.hidden { display: none !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: .5rem; }
.text-muted { color: var(--muted); font-size: .85rem; }
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }
