:root {
  --bg: #f6f2ff;
  --card: rgba(255, 255, 255, 0.82);
  --text: #18122b;
  --text-inverse: #fff;
  --muted: #766f8f;
  --line: rgba(35, 22, 72, 0.1);
  --primary: #7c3aed;
  --primary-2: #06b6d4;
  --shadow: 0 20px 60px rgba(67, 38, 130, 0.16);
  --page-grad-1: rgba(124, 58, 237, .22);
  --page-grad-2: rgba(6, 182, 212, .18);
  --page-grad-bg: linear-gradient(180deg, #fbfaff 0%, #f4efff 48%, #eefbff 100%);
  --grid-line: rgba(124, 58, 237, .06);
  --tab-bg: rgba(255,255,255,.72);
  --tab-active: #18122b;
  --title-col: #3a3157;
}

[data-theme="dark"] {
  --bg: #090a18;
  --card: rgba(255, 255, 255, 0.08);
  --text: #f8fbff;
  --text-inverse: #18122b;
  --muted: #aeb8d8;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --page-grad-1: rgba(124, 58, 237, .15);
  --page-grad-2: rgba(6, 182, 212, .12);
  --page-grad-bg: linear-gradient(180deg, #090a18 0%, #151126 48%, #0f1524 100%);
  --grid-line: rgba(255, 255, 255, .04);
  --tab-bg: rgba(255,255,255,.08);
  --tab-active: #fff;
  --title-col: #aeb8d8;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 12%, var(--page-grad-1), transparent 28%),
    radial-gradient(circle at 86% 6%, var(--page-grad-2), transparent 26%),
    var(--page-grad-bg);
  transition: color .3s ease, background .3s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.bio-page {
  position: relative;
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 28px;
}

.profile-card,
.search-box,
.share-link,
.footer-info,
.empty-state {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.profile-card {
  padding: 24px;
  border-radius: 30px;
  text-align: left;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 15px;
}

.author-avatar {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  border-radius: 24px;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 32px rgba(124, 58, 237, .26);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.bio-text {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.theme-btn {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: transform .2s ease;
}
.theme-btn:hover {
  transform: scale(1.05);
}

.copy-page-btn {
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 16px 34px rgba(6, 182, 212, .18);
}

.filter-tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-btn {
  flex: 1 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 13px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  background: var(--tab-bg);
  transition: .2s ease;
}

.tab-btn.active {
  color: var(--text-inverse);
  border-color: transparent;
  background: var(--tab-active);
}

.search-section { margin-bottom: 16px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 18px;
}

.search-box span { color: var(--primary); font-weight: 800; }

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
}

.search-box input::placeholder { color: #a199b8; }

.section-title {
  margin: 18px 4px 12px;
  color: var(--title-col);
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.share-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.share-item { margin: 0; }

.share-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 74px;
  padding: 13px 14px;
  border-radius: 22px;
  color: var(--text);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  overflow: hidden;
}

.share-link::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent, var(--primary));
}

.share-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 17px;
  background: color-mix(in srgb, var(--accent, var(--primary)) 16%, white);
  font-size: 22px;
}

.share-content {
  min-width: 0;
  flex: 1;
}

.share-title {
  display: block;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-desc {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-arrow {
  color: var(--accent, var(--primary));
  font-size: 22px;
  font-weight: 800;
}

.share-link:hover,
.copy-page-btn:hover,
.tab-btn:hover {
  transform: translateY(-2px);
}

.share-link:hover {
  border-color: color-mix(in srgb, var(--accent, var(--primary)) 45%, transparent);
  box-shadow: 0 22px 55px rgba(67, 38, 130, .2);
}

.empty-state {
  margin-top: 14px;
  padding: 34px 18px;
  border-radius: 22px;
  text-align: center;
}
.empty-state div { font-size: 36px; }
.empty-state h2 { margin-bottom: 6px; font-size: 20px; }
.empty-state p { margin: 0; color: var(--muted); }

.footer-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 12px;
}
.footer-info strong { color: var(--text); }
.footer-info a { color: var(--primary); text-decoration: none; font-weight: 700; transition: .2s ease; }
.footer-info a:hover { color: var(--primary-2); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  padding: 12px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(24, 18, 43, .9);
  opacity: 0;
  transform: translate(-50%, 18px);
  transition: .24s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  .bio-page { width: min(100% - 24px, 560px); padding-top: 18px; }
  .profile-card { padding: 20px; border-radius: 26px; }
  .footer-info { flex-direction: column; }
}
