:root {
  --bg-body: #0d0d10;
  --bg-card: #1a1a1f;
  --bg-card-hover: #202027;
  --bg-header: #121212;
  --bg-sidebar: #0f0f14;
  --bg-input: #141418;
  --bg-overlay: rgba(0, 0, 0, 0.75);

  --border-card: #2a2a30;
  --border-input: #2e2e36;
  --border-divider: #1f1f24;

  --text-heading: #ffffff;
  --text-body: #b5b5be;
  --text-muted: #7a7a85;
  --text-invert: #0d0d10;

  --accent-primary: #2dd4bf;
  --accent-primary-hover: #2cbba9;
  --accent-gold: #eab308;
  --accent-gold-hover: #ca9c0a;
  --accent-danger: #ef4444;
  --accent-success: #10b981;
  --accent-info: #3b82f6;

  --grad-header-top: linear-gradient(90deg, #8b5a5c 0%, #6b7a99 100%);
  --grad-gold: linear-gradient(135deg, #fcd34d 0%, #eab308 50%, #a16207 100%);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.45);
  --shadow-card: 0 8px 24px rgba(0,0,0,0.35);

  --sidebar-width: 220px;
  --header-height: 62px;
  --container-max: 1400px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-body);
  min-height: 100%;
  line-height: 1.55;
  font-size: 14px;
  overflow-x: hidden;
}
a { color: var(--accent-primary); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--accent-primary-hover); }
img { max-width: 100%; display: block; border: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
h1,h2,h3,h4,h5,h6 { color: var(--text-heading); font-weight: 700; line-height: 1.25; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 15px; }
p { margin-bottom: 0.75em; }
ul, ol { list-style: none; }
hr { border: 0; border-top: 1px solid var(--border-divider); margin: 20px 0; }

/* ============================================
   LAYOUT: PanedWindow (左侧栏 + 主内容)
   ============================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-divider);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 30;
}
.app-sidebar::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--grad-header-top);
  flex-shrink: 0;
}
.sidebar-logo {
  padding: 18px 18px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-divider);
}
.sidebar-logo-mark {
  width: 34px; height: 34px;
  border-radius: var(--radius-md);
  background: var(--grad-gold);
  display: inline-flex; align-items: center; justify-content: center;
  color: #1a1300;
  font-weight: 900;
  font-size: 16px;
  box-shadow: var(--shadow-md);
  letter-spacing: -0.5px;
}
.sidebar-logo-text {
  color: var(--text-heading);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.2px;
}
.sidebar-logo-text span { color: var(--accent-gold); }

.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.sidebar-nav .nav-section-title {
  padding: 10px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-muted);
}
.sidebar-nav a.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-weight: 500;
  margin-bottom: 2px;
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav a.nav-link:hover { background: var(--bg-card); color: var(--text-heading); }
.sidebar-nav a.nav-link.active {
  background: linear-gradient(90deg, rgba(45,212,191,0.14), rgba(45,212,191,0));
  color: var(--accent-primary);
}
.sidebar-nav a.nav-link.active::before {
  content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px;
  width: 3px; background: var(--accent-primary); border-radius: 0 3px 3px 0;
}
.sidebar-nav .nav-ico { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.sidebar-nav .badge-count {
  margin-left: auto;
  background: var(--accent-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 18px; height: 18px;
  line-height: 18px; text-align: center;
  padding: 0 6px;
}
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-divider);
  font-size: 12px;
  color: var(--text-muted);
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============================================
   HEADER (顶部导航)
   ============================================ */
.app-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-divider);
  display: flex;
  align-items: center;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 25;
}
.app-header::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--grad-header-top);
}
.hamburger {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-input);
  color: var(--text-body);
  font-size: 18px;
  cursor: pointer;
  align-items: center; justify-content: center;
  margin-right: 12px;
}
.hamburger:hover { color: var(--text-heading); border-color: var(--border-card); }
.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
  margin-right: 16px;
}
.header-search input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-full);
  color: var(--text-heading);
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
  font-size: 13px;
}
.header-search input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(45,212,191,0.12);
}
.header-search .search-ico {
  position: absolute;
  left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 15px;
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-premium {
  display: inline-flex;
  align-items: center; gap: 6px;
  padding: 7px 13px;
  background: var(--grad-gold);
  color: #1a1300;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}
.header-premium svg { width: 14px; height: 14px; }
.header-user {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 11px 5px 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.15s;
}
.header-user:hover { background: var(--bg-card-hover); }
.header-user .avatar-sm {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--border-card);
  object-fit: cover;
  border: 2px solid var(--border-card);
}
.header-user .who {
  line-height: 1.1;
  font-size: 12px;
  text-align: left;
}
.header-user .who b { display: block; color: var(--text-heading); font-size: 13px; }
.header-user .who small { color: var(--text-muted); }

/* ============================================
   CONTENT & CONTAINER
   ============================================ */
.app-content { flex: 1; padding: 26px 28px 40px; min-width: 0; }
.container { max-width: var(--container-max); margin: 0 auto; }
.page-heading {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.page-heading h1 { font-size: 24px; }
.page-heading p { color: var(--text-muted); margin: 4px 0 0; }
.breadcrumbs { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent-primary); }
.breadcrumbs .sep { margin: 0 6px; }

/* ============================================
   CARD
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-divider);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .sub { color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  background: transparent;
  line-height: 1.25;
}
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; }
.btn-primary {
  background: var(--accent-primary);
  color: var(--text-invert);
  border-color: var(--accent-primary);
}
.btn-primary:hover { background: var(--accent-primary-hover); border-color: var(--accent-primary-hover); color: var(--text-invert); }
.btn-gold {
  background: var(--grad-gold);
  color: #1a1300;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(234,179,8,0.25);
}
.btn-gold:hover { transform: translateY(-1px); color: #1a1300; }
.btn-ghost {
  background: transparent;
  color: var(--text-body);
  border-color: var(--border-input);
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-heading); border-color: var(--border-card); }
.btn-danger {
  background: var(--accent-danger);
  color: #fff;
  border-color: var(--accent-danger);
}
.btn-danger:hover { opacity: 0.9; color: #fff; }
.btn-text {
  background: transparent;
  border: 0;
  color: var(--accent-primary);
  padding: 6px 8px;
}
.btn-text:hover { color: var(--accent-primary-hover); text-decoration: underline; }
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 16px;
}
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   FORMS & INPUTS
   ============================================ */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text-heading);
  font-size: 13px;
}
.form-row label .req { color: var(--accent-danger); margin-left: 3px; }
.form-row .hint { margin-top: 6px; color: var(--text-muted); font-size: 11px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
}
.input, .textarea, .select {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--text-heading);
  outline: none;
  transition: border 0.15s, box-shadow 0.15s, background 0.15s;
  font-size: 13.5px;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(45,212,191,0.12);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.select { appearance: none; cursor: pointer; padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7a85' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 13px center;
}
.input[type="file"] { padding: 8px; cursor: pointer; }
.input::placeholder { color: var(--text-muted); }
.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.form-errors, .flash-list { margin-bottom: 18px; }
.checkbox, .radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.checkbox input, .radio input { width: 16px; height: 16px; accent-color: var(--accent-primary); }

/* ============================================
   FLASH / ALERT
   ============================================ */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}
.flash-success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.25); color: #6ee7b7; }
.flash-error   { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.25); color: #fca5a5; }
.flash-info    { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.25); color: #93c5fd; }
.flash .ico { flex-shrink: 0; font-size: 16px; line-height: 1.4; }

/* ============================================
   STATS GRID (Home)
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  top: 0; right: 0; width: 90px; height: 90px;
  border-radius: 50%;
  opacity: 0.06;
  transform: translate(30px, -30px);
}
.stat-card.c1::after { background: var(--accent-primary); }
.stat-card.c2::after { background: var(--accent-gold); }
.stat-card.c3::after { background: var(--accent-info); }
.stat-card.c4::after { background: var(--accent-success); }
.stat-ico {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card.c1 .stat-ico { background: rgba(45,212,191,0.14); color: var(--accent-primary); }
.stat-card.c2 .stat-ico { background: rgba(234,179,8,0.14); color: var(--accent-gold); }
.stat-card.c3 .stat-ico { background: rgba(59,130,246,0.14); color: var(--accent-info); }
.stat-card.c4 .stat-ico { background: rgba(16,185,129,0.14); color: var(--accent-success); }
.stat-info .num { display: block; color: var(--text-heading); font-size: 22px; font-weight: 800; }
.stat-info .lbl { color: var(--text-muted); font-size: 12px; font-weight: 500; }

/* ============================================
   GALLERY GRID — Pinterest/Masonry style
   ============================================ */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 0 16px; gap: 12px; flex-wrap: wrap;
}
.section-head h2 { font-size: 18px; }
.section-head .more { font-size: 12px; }

.gallery-grid {
  columns: 4 230px;
  column-gap: 16px;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  position: relative;
  display: block;
}
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0,0,0,0.5);
  border-color: #3a3a42;
}
.gi-cover {
  position: relative;
  background: #0a0a0c;
  aspect-ratio: auto;
  overflow: hidden;
}
.gi-cover img {
  width: 100%; height: auto; display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover .gi-cover img { transform: scale(1.04); }
.gi-overlay-top {
  position: absolute; left: 10px; top: 10px;
  display: flex; gap: 6px;
  z-index: 2;
}
.gi-chip {
  background: rgba(15,15,20,0.78);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(255,255,255,0.08);
}
.gi-chip.gold { color: var(--accent-gold); }
.gi-chip.like { background: rgba(239,68,68,0.3); border-color: rgba(239,68,68,0.45); }
.gi-body {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border-divider);
}
.gi-title {
  color: var(--text-heading);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 9px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.45;
}
.gi-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.gi-meta img {
  width: 26px; height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border-card);
  border: 2px solid var(--border-card);
  flex-shrink: 0;
}
.gi-meta .uname { color: var(--text-heading); font-weight: 600; font-size: 12.5px; }
.gi-meta .sp { margin-left: auto; }

/* ============================================
   USER CARD GRID
   ============================================ */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 18px 18px;
  text-align: center;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.user-card:hover { transform: translateY(-2px); border-color: #3a3a42; background: var(--bg-card-hover); }
.user-card .crown {
  position: absolute; top: 10px; right: 10px;
  color: var(--accent-gold); font-size: 14px;
}
.user-card .avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid var(--border-card);
  object-fit: cover;
  background: var(--border-card);
}
.user-card h4 { font-size: 15px; margin-bottom: 3px; }
.user-card .sub { color: var(--text-muted); font-size: 12px; min-height: 17px; margin-bottom: 10px; }
.user-card .tags { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; min-height: 22px; margin-bottom: 12px; }
.user-card .tag {
  padding: 2px 8px;
  background: rgba(45,212,191,0.1);
  color: var(--accent-primary);
  font-size: 10.5px;
  font-weight: 600;
  border-radius: var(--radius-full);
}
.user-card .action-row { display: flex; gap: 8px; justify-content: center; }

/* ============================================
   AVATAR
   ============================================ */
.avatar-lg { width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--border-card); background: var(--bg-input);
  box-shadow: var(--shadow-md);
}
.avatar-md { width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border-card); background: var(--bg-input);
}
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--border-card); background: var(--bg-input);
}
.avatar-placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2a2a30, #3a3a44);
  color: var(--text-body); font-weight: 700;
}

/* ============================================
   PROFILE (Public)
   ============================================ */
.profile-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-2xl);
  padding: 26px 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  display: flex; gap: 24px; flex-wrap: wrap; align-items: center;
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 90px;
  background: linear-gradient(120deg, rgba(45,212,191,0.08), rgba(234,179,8,0.05), transparent);
  z-index: 0;
}
.profile-hero > * { position: relative; z-index: 1; }
.profile-hero .info { flex: 1; min-width: 240px; }
.profile-hero .info h1 { margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.profile-hero .verified { color: var(--accent-primary); font-size: 18px; }
.profile-hero .gold-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  background: var(--grad-gold);
  color: #1a1300;
  font-weight: 800;
  font-size: 11px;
  border-radius: var(--radius-full);
}
.profile-hero .loc { color: var(--text-muted); font-size: 13px; margin: 4px 0 10px; }
.profile-hero .bio { color: var(--text-body); font-size: 13.5px; margin-bottom: 12px; }
.profile-hero .info-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.profile-hero .info-stats .k b { display: block; color: var(--text-heading); font-size: 18px; }
.profile-hero .info-stats .k span { color: var(--text-muted); font-size: 11px; }
.profile-hero .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================
   GALLERY DETAIL
   ============================================ */
.detail-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: 20px;
}
@media (max-width: 960px) { .detail-wrap { grid-template-columns: 1fr; } }
.carousel-main {
  background: #000;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-card);
  position: relative;
  min-height: 300px;
  display: flex; align-items: center; justify-content: center;
}
.carousel-main img { width: 100%; height: auto; max-height: 72vh; object-fit: contain; }
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: background 0.15s;
}
.carousel-nav:hover { background: rgba(45,212,191,0.65); }
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.carousel-thumbs .thumb {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, opacity 0.15s;
  opacity: 0.6;
  background: var(--bg-input);
}
.carousel-thumbs .thumb:hover { opacity: 1; }
.carousel-thumbs .thumb.active { border-color: var(--accent-primary); opacity: 1; }

.detail-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.post-actions {
  display: flex; align-items: center; gap: 8px; padding: 10px 0;
  border-bottom: 1px solid var(--border-divider);
}
.post-actions .spacer { flex: 1; }
.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: var(--bg-input);
  color: var(--text-body);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.15s;
}
.like-btn:hover { border-color: var(--accent-danger); }
.like-btn.liked { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.like-btn .heart { transition: transform 0.15s; }
.like-btn.liked .heart { transform: scale(1.1); }

.comment-form { margin-top: 12px; }
.comment-list { margin-top: 10px; }
.comment-item {
  padding: 13px 0;
  border-bottom: 1px dashed var(--border-divider);
  display: flex; gap: 11px;
}
.comment-item:last-child { border-bottom: 0; }
.comment-item .avatar-sm { flex-shrink: 0; width: 34px; height: 34px; }
.comment-item .body { flex: 1; min-width: 0; }
.comment-item .head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 3px; flex-wrap: wrap; }
.comment-item .head b { color: var(--text-heading); font-size: 13px; }
.comment-item .head small { color: var(--text-muted); font-size: 11px; }
.comment-item .txt { color: var(--text-body); font-size: 13px; line-height: 1.55; word-break: break-word; }
.comment-item .reply-link { font-size: 11px; margin-top: 3px; display: inline-block; }
.comment-item .replies { margin-top: 10px; margin-left: 10px; padding-left: 12px; border-left: 2px solid var(--border-divider); }
.comment-item .replies .comment-item { padding: 9px 0; }

/* ============================================
   INBOX / MESSAGE CENTER — PanedWindow 风格 (Folder list + Thread pane)
   ============================================ */
.msg-panes {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 820px) { .msg-panes { grid-template-columns: 1fr; } }
.msg-folders {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 10px;
  position: sticky; top: calc(var(--header-height) + 12px);
}
.msg-folders a {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 2px;
}
.msg-folders a:hover { background: var(--bg-card-hover); color: var(--text-heading); }
.msg-folders a.active { background: rgba(45,212,191,0.12); color: var(--accent-primary); }
.msg-folders a .n {
  margin-left: auto;
  background: var(--accent-danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.msg-list { display: flex; flex-direction: column; gap: 10px; }
.msg-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  align-items: center;
  transition: background 0.15s, border-color 0.15s;
}
.msg-row:hover { background: var(--bg-card-hover); border-color: #3a3a42; }
.msg-row.unread { border-left: 3px solid var(--accent-primary); }
.msg-row.unread .subject, .msg-row.unread .who { font-weight: 700; }
.msg-row .avatar-md { width: 46px; height: 46px; border-width: 2px; }
.msg-row .meta { min-width: 0; }
.msg-row .meta .who-row { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 3px; }
.msg-row .meta .who { color: var(--text-heading); font-size: 14px; }
.msg-row .meta .when { color: var(--text-muted); font-size: 11px; }
.msg-row .meta .subject { color: var(--text-heading); font-size: 13px; margin-bottom: 2px; }
.msg-row .meta .snippet { color: var(--text-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row .row-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

.message-detail-card .from-row {
  display: flex; gap: 14px; align-items: center; padding-bottom: 16px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border-divider);
  flex-wrap: wrap;
}
.message-detail-card .from-row .avatar-lg { width: 60px; height: 60px; }
.message-detail-card .from-row h3 { font-size: 16px; margin-bottom: 2px; }
.message-detail-card .from-row .sub { color: var(--text-muted); font-size: 12px; }
.message-detail-card .from-row .date { margin-left: auto; color: var(--text-muted); font-size: 12px; }
.message-detail-card .subject-line {
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.message-detail-card .subject-line .tag {
  display: inline-block;
  background: rgba(45,212,191,0.1);
  color: var(--accent-primary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  margin-right: 8px;
  font-weight: 600;
}
.message-body {
  padding: 16px 2px 20px;
  color: var(--text-body);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.reply-card {
  margin-top: 20px;
  padding: 16px 18px;
  background: rgba(16,185,129,0.05);
  border: 1px dashed rgba(16,185,129,0.3);
  border-radius: var(--radius-lg);
}
.reply-card .reply-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.reply-card .reply-head .pill {
  padding: 4px 10px;
  background: var(--accent-success);
  color: #03211a;
  font-weight: 700;
  font-size: 11px;
  border-radius: var(--radius-full);
}
.reply-card .reply-head small { color: var(--text-muted); }
.reply-card .reply-body {
  white-space: pre-wrap; line-height: 1.7; color: var(--text-body); font-size: 14px;
}

/* ============================================
   UPLOAD DRAG DROP ZONE
   ============================================ */
.upload-zone {
  border: 2px dashed var(--border-input);
  border-radius: var(--radius-xl);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-input);
  transition: all 0.2s;
}
.upload-zone:hover { border-color: var(--accent-primary); background: rgba(45,212,191,0.04); }
.upload-zone.dragover { border-color: var(--accent-primary); background: rgba(45,212,191,0.08); }
.upload-zone .up-ico { font-size: 38px; margin-bottom: 8px; color: var(--accent-primary); }
.upload-zone h4 { margin-bottom: 5px; font-size: 15px; }
.upload-zone p { color: var(--text-muted); font-size: 12.5px; margin: 0; }
.upload-preview {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 16px;
}
.upload-preview .prev-item {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-card);
  background: var(--bg-input);
}
.upload-preview .prev-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview .prev-item .remove {
  position: absolute; top: 5px; right: 5px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: 0; cursor: pointer;
  font-size: 14px;
}
.upload-preview .prev-item .remove:hover { background: var(--accent-danger); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty .ico {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px;
  margin-bottom: 14px;
}
.empty h3 { margin-bottom: 5px; font-size: 16px; }
.empty p { font-size: 13px; margin-bottom: 16px; }

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  margin-top: 28px; flex-wrap: wrap;
}
.pagination a, .pagination span {
  min-width: 36px; height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-body);
}
.pagination a:hover { color: var(--accent-primary); border-color: var(--accent-primary); }
.pagination .current { background: var(--accent-primary); border-color: var(--accent-primary); color: var(--text-invert); }
.pagination .dots { background: transparent; border: 0; color: var(--text-muted); }

/* ============================================
   404 PAGE (参考FINEVOICE风格)
   ============================================ */
.nf-wrap {
  min-height: 80vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.nf-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 28px;
  padding: 50px 40px;
  max-width: 500px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.nf-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: var(--grad-header-top);
}
.nf-card .planet {
  width: 160px; height: 160px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15), transparent 45%),
    radial-gradient(circle at 70% 70%, #1a2332 0%, #0e131a 60%, #07090d 100%);
  box-shadow:
    inset -20px -25px 60px rgba(0,0,0,0.55),
    inset 18px 18px 40px rgba(80,90,110,0.25),
    0 20px 50px rgba(0,0,0,0.5);
  position: relative;
}
.nf-card .planet::after {
  content: "";
  position: absolute;
  top: 22px; right: 22px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #e7c27a, #b78e3e);
  box-shadow: 0 0 20px rgba(234,179,8,0.35);
}
.nf-card h1 {
  font-size: 42px;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #fff, #cdd5e0);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nf-card h1 .gold { color: var(--accent-gold); -webkit-text-fill-color: var(--accent-gold); }
.nf-card .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.nf-card .nf-code {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--accent-primary);
  margin-bottom: 22px;
  letter-spacing: 0.5px;
}

/* ============================================
   AUTH PAGES (register/login): split 2 column
   ============================================ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } }
.auth-side {
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(45,212,191,0.1), transparent 60%),
    radial-gradient(900px 500px at 100% 100%, rgba(234,179,8,0.08), transparent 55%),
    linear-gradient(160deg, #0a0a0f, #12121a);
  padding: 60px 50px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border-divider);
  position: relative; overflow: hidden;
}
.auth-side::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-header-top);
}
.auth-side .logo { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 50px; }
.auth-side .logo .mark {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--grad-gold);
  color: #1a1300;
  font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 8px 20px rgba(234,179,8,0.3);
}
.auth-side .logo .t { color: #fff; font-weight: 800; font-size: 20px; }
.auth-side h1 { font-size: 36px; line-height: 1.15; margin-bottom: 18px; letter-spacing: -0.5px; }
.auth-side h1 span { color: var(--accent-gold); }
.auth-side .desc { color: var(--text-muted); font-size: 15px; line-height: 1.7; margin-bottom: 30px; }
.auth-side .features { display: flex; flex-direction: column; gap: 14px; margin-top: auto; }
.auth-side .ft {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: rgba(26,26,31,0.65);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
}
.auth-side .ft .ico {
  width: 34px; height: 34px;
  background: rgba(45,212,191,0.15);
  color: var(--accent-primary);
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.auth-side .ft h4 { font-size: 13px; margin-bottom: 2px; }
.auth-side .ft p { color: var(--text-muted); font-size: 12px; margin: 0; }

.auth-form {
  padding: 50px 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-body);
}
.auth-form .box { max-width: 420px; width: 100%; }
.auth-form h2 { font-size: 24px; margin-bottom: 6px; }
.auth-form .box > .sub { color: var(--text-muted); margin-bottom: 26px; font-size: 13px; }
.auth-form .alt {
  text-align: center; margin-top: 20px;
  font-size: 13px; color: var(--text-muted);
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px; align-items: center;
}
@media (max-width: 640px) { .filter-bar { grid-template-columns: 1fr; } }

/* ============================================
   TABLE (generic)
   ============================================ */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-divider); }
.table th { background: var(--bg-input); color: var(--text-heading); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.table tbody tr:hover { background: rgba(45,212,191,0.03); }

/* ============================================
   MODAL / LIGHTBOX
   ============================================ */
.lightbox {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox .close {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  border: 0; cursor: pointer;
  font-size: 20px; display: inline-flex; align-items: center; justify-content: center;
  z-index: 3;
}
.lightbox .close:hover { background: var(--accent-danger); }
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff; border: 0; cursor: pointer;
  font-size: 20px; display: inline-flex; align-items: center; justify-content: center;
  z-index: 3;
}
.lightbox .lb-prev { left: 20px; }
.lightbox .lb-next { right: 20px; }
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }

/* ============================================
   RESPONSIVE — 折叠侧栏
   ============================================ */
@media (max-width: 860px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .app-sidebar.open { transform: translateX(0); box-shadow: 20px 0 40px rgba(0,0,0,0.6); }
  .app-main { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .app-content { padding: 18px 16px 32px; }
  .header-search { display: none; }
}

/* Scrollbar 美化 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #2e2e36; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a44; }

/* Utility */
.text-accent { color: var(--accent-primary); }
.text-gold { color: var(--accent-gold); }
.text-muted { color: var(--text-muted); }
.text-heading { color: var(--text-heading); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
