:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --border: rgba(15, 23, 42, 0.07);
  --border-hover: rgba(15, 23, 42, 0.14);
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --green: #10b981;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 8px 28px rgba(15, 23, 42, 0.07);
  --transition: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(at 15% 0%, rgba(37, 99, 235, 0.055) 0px, transparent 48%),
    radial-gradient(at 88% 8%, rgba(16, 185, 129, 0.045) 0px, transparent 42%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* Container */
.page-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

/* Top Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.domain-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: border-color var(--transition), transform var(--transition), color var(--transition);
}

.domain-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.domain-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clock-pill {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  animation: fadeUp 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-12 { grid-column: span 12; }

.card:nth-child(2) { animation-delay: 50ms; }
.card:nth-child(3) { animation-delay: 100ms; }
.card:nth-child(4) { animation-delay: 140ms; }
.card:nth-child(5) { animation-delay: 180ms; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* Profile Hero */
.profile-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.profile-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1e293b 0%, #334155 55%, #2563eb 100%);
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.16);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-heading {
  flex: 1;
  min-width: 0;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  font-size: 12px;
  font-weight: 500;
}

.profile-role {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.profile-bio {
  margin-top: 14px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 58ch;
}

.highlights-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.highlight-item {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.highlight-label {
  font-size: 12px;
  color: var(--text-muted);
}

.highlight-value {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Social List */
.social-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  text-align: left;
  width: 100%;
}

.social-item:hover {
  background: #ffffff;
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.social-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.social-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.social-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.social-handle {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition), color var(--transition);
}

.social-item:hover .social-arrow {
  transform: translateX(2px);
  color: var(--text-primary);
}

/* Tags & Hobbies */
.tag-group + .tag-group {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.tag-group-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-chip,
.hobby-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-primary);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.skill-chip:hover,
.hobby-chip:hover {
  background: #ffffff;
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.skill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Bookmarks */
.bookmark-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bookmark-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 15px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.bookmark-item:hover {
  background: #ffffff;
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.bookmark-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bookmark-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.bookmark-tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.bookmark-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Showcase & Filter Tabs */
.filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.filter-tab {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.filter-tab.active {
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.showcase-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.showcase-item:hover {
  background: #ffffff;
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.showcase-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.showcase-type {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-secondary);
}

.showcase-type.is-project {
  background: var(--accent-soft);
  color: var(--accent);
}

.showcase-date {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.showcase-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.showcase-summary {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.showcase-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-tag {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
}

/* Footer */
.footer {
  margin-top: 30px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .col-8,
  .col-7,
  .col-5,
  .col-4 {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 18px 14px 40px;
  }

  .card {
    padding: 20px;
    border-radius: 18px;
  }

  .profile-top {
    flex-direction: column;
    gap: 14px;
  }

  .profile-name {
    font-size: 24px;
  }

  .highlights-row,
  .bookmark-grid,
  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
