:root {
  --bg: #f5f5f7;
  --bg-glow-1: rgba(37, 99, 235, 0.06);
  --bg-glow-2: rgba(16, 185, 129, 0.05);
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-pill: rgba(255, 255, 255, 0.78);
  --border: rgba(15, 23, 42, 0.075);
  --border-hover: rgba(15, 23, 42, 0.16);
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --accent-blue: #2563eb;
  --accent-blue-soft: rgba(37, 99, 235, 0.09);
  --accent-teal: #0d9488;
  --accent-teal-soft: rgba(16, 185, 129, 0.1);
  --accent-teal-border: rgba(13, 148, 136, 0.28);
  --accent-green: #10b981;
  --btn-dark-bg: #111827;
  --btn-dark-text: #ffffff;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.03);
  --shadow-card-hover: 0 4px 12px rgba(15, 23, 42, 0.06), 0 12px 28px rgba(15, 23, 42, 0.05);
  --toast-bg: rgba(17, 24, 39, 0.92);
  --toast-text: #ffffff;
  --radius-card: 22px;
  --radius-sub: 14px;
  --radius-pill: 999px;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0b0f19;
    --bg-glow-1: rgba(59, 130, 246, 0.13);
    --bg-glow-2: rgba(16, 185, 129, 0.1);
    --surface: #131a29;
    --surface-subtle: #1a2336;
    --surface-pill: rgba(19, 26, 41, 0.78);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-blue: #60a5fa;
    --accent-blue-soft: rgba(96, 165, 250, 0.14);
    --accent-teal: #2dd4bf;
    --accent-teal-soft: rgba(45, 212, 191, 0.12);
    --accent-teal-border: rgba(45, 212, 191, 0.3);
    --accent-green: #34d399;
    --btn-dark-bg: #f8fafc;
    --btn-dark-text: #0f172a;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.28), 0 8px 24px rgba(0, 0, 0, 0.22);
    --shadow-card-hover: 0 6px 18px rgba(0, 0, 0, 0.35), 0 16px 34px rgba(0, 0, 0, 0.28);
    --toast-bg: rgba(248, 250, 252, 0.94);
    --toast-text: #0f172a;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0f19;
  --bg-glow-1: rgba(59, 130, 246, 0.13);
  --bg-glow-2: rgba(16, 185, 129, 0.1);
  --surface: #131a29;
  --surface-subtle: #1a2336;
  --surface-pill: rgba(19, 26, 41, 0.78);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-blue: #60a5fa;
  --accent-blue-soft: rgba(96, 165, 250, 0.14);
  --accent-teal: #2dd4bf;
  --accent-teal-soft: rgba(45, 212, 191, 0.12);
  --accent-teal-border: rgba(45, 212, 191, 0.3);
  --accent-green: #34d399;
  --btn-dark-bg: #f8fafc;
  --btn-dark-text: #0f172a;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.28), 0 8px 24px rgba(0, 0, 0, 0.22);
  --shadow-card-hover: 0 6px 18px rgba(0, 0, 0, 0.35), 0 16px 34px rgba(0, 0, 0, 0.28);
  --toast-bg: rgba(248, 250, 252, 0.94);
  --toast-text: #0f172a;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg);
  background-image:
    radial-gradient(640px circle at 12% 8%, var(--bg-glow-1), transparent 65%),
    radial-gradient(640px circle at 88% 10%, var(--bg-glow-2), transparent 65%);
  background-attachment: fixed;
  line-height: 1.6;
  transition: background-color 220ms ease, color 220ms ease;
}

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

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

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 520px;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.9) 68%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.9) 68%, rgba(0, 0, 0, 0) 100%);
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 44px;
}

/* 顶部状态栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-pill);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.domain-pill {
  color: var(--text-primary);
  font-weight: 600;
}

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

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  flex-shrink: 0;
}

.primary-pill {
  background: var(--btn-dark-bg);
  color: var(--btn-dark-text);
  border-color: transparent;
  font-weight: 600;
}

.primary-pill:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.primary-pill .arrow {
  transition: transform 180ms ease;
}

.primary-pill:hover .arrow {
  transform: translate(1px, -1px);
}

.clock-pill {
  color: var(--text-muted);
}

.clock-pill #shanghai-clock {
  color: var(--text-primary);
  font-weight: 600;
}

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

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
  animation: fadeUp 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--delay, 0ms);
}

.hero-card,
.social-card {
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.card-kicker {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

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

/* 个人简介卡 */
.hero-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
}

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

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

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

.name-row h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-teal);
  background: var(--accent-teal-soft);
}

.mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
}

.hero-subtitle {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.hero-bio {
  margin: 18px 0 20px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.hero-btn.primary {
  background: linear-gradient(135deg, #0f766e 0%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.24);
}

.hero-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.3);
}

.hero-btn.outline {
  border: 1px solid var(--accent-teal-border);
  color: var(--accent-teal);
  background: var(--accent-teal-soft);
}

.hero-btn.outline:hover {
  transform: translateY(-1px);
}

.hero-btn .btn-arrow {
  transition: transform 180ms ease;
}

.hero-btn:hover .btn-arrow {
  transform: translateX(2px);
}

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

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

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

/* 社交与联系卡 */
.social-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

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

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

.social-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.social-info {
  min-width: 0;
}

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

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

.social-arrow {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
  transition: transform 180ms ease, color 180ms ease;
}

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

/* 标签与兴趣卡 */
.tag-group + .tag-group {
  margin-top: 18px;
}

.group-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

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

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

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

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

/* 常用网站收藏 */
.bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bookmark-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 15px;
  border-radius: var(--radius-sub);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  transition: transform 180ms ease, border-color 180ms ease;
}

.bookmark-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

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

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

.bookmark-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  flex-shrink: 0;
}

.bookmark-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 作品与学习记录 */
.showcase-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.showcase-desc {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.filter-tab {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.filter-tab:hover {
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--surface);
  color: var(--text-primary);
  font-weight: 600;
  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: 12px;
  padding: 18px;
  border-radius: 16px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  transition: transform 180ms ease, border-color 180ms ease;
}

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

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

.showcase-cat {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  color: var(--accent-teal);
  background: var(--accent-teal-soft);
}

.showcase-cat.note {
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

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

.showcase-title {
  margin: 8px 0 6px;
  font-size: 16px;
  font-weight: 650;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

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

.mini-tag {
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* 页脚 */
.footer {
  margin-top: 26px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  transition: opacity 200ms ease, transform 200ms ease;
  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);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
  }
  * {
    transition-duration: 0.01ms !important;
  }
}

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

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

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

  .hero-header {
    gap: 14px;
  }

  .avatar-box {
    width: 60px;
    height: 60px;
    font-size: 22px;
    border-radius: 16px;
  }

  .name-row h1 {
    font-size: 25px;
  }

  .hero-highlights,
  .bookmarks-grid,
  .showcase-grid {
    grid-template-columns: 1fr;
  }
}
