/* ============ 设计令牌 ============ */
:root {
  /* 背景与表面 */
  --bg: #F6F7F9;
  --bg-grad-1: #EEF2FF;
  --bg-grad-2: #FFF7ED;
  --surface: #FFFFFF;
  --surface-soft: #F3F4F6;
  --surface-tint: #FAFBFC;

  /* 边框 */
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --divider: #F1F3F5;

  /* 文本 */
  --text: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;

  /* 主品牌（深靛蓝） */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-active: #3730A3;
  --primary-soft: #EEF2FF;
  --primary-soft-2: #E0E7FF;

  /* 强调色（琥珀） */
  --accent: #F59E0B;
  --accent-hover: #D97706;
  --accent-soft: #FEF3C7;

  /* 状态色 */
  --success: #10B981;
  --offline: #EF4444;
  --info: #0EA5E9;

  /* 圆角 */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 8px 24px rgba(79, 70, 229, 0.18);

  --header-offset: 96px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ 基础重置 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-feature-settings: "tnum" on, "cv11" on;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 8% 0%, var(--bg-grad-1) 0%, transparent 35%),
    radial-gradient(circle at 92% 12%, var(--bg-grad-2) 0%, transparent 32%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 整体显示密度对齐 Chrome 75% 缩放（>= 1366px 桌面端） */
  zoom: 0.80;
}

/* 移动端窄屏不缩放，避免内容过小 */
@media (max-width: 768px) {
  body { zoom: 1; }
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

/* ============ 顶部导航栏 ============ */
.topbar-shield {
  position: fixed;
  inset: 0 0 auto 0;
  height: 88px;
  z-index: 190;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(246, 247, 249, 0.92), rgba(246, 247, 249, 0.6) 60%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 220;
  width: min(1240px, calc(100% - 32px));
  height: 60px;
  padding: 0 8px 0 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.3px;
  color: var(--text);
  white-space: nowrap;
}

.brand::before {
  content: "暴";
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-active));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: var(--shadow-glow);
}

.brand span { color: var(--primary); }

.nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.2s var(--ease);
}

.nav a:hover { color: var(--text); background: var(--surface-soft); }

.nav a.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.contact-btn {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s var(--ease);
}

.contact-btn::before {
  content: "✦";
  color: var(--accent);
  font-size: 12px;
}

.contact-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 18px;
  transition: all 0.2s var(--ease);
}

.menu-btn:hover { background: var(--primary-soft); color: var(--primary); }

/* ============ 页面容器与栅格 ============ */
.page {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 100px 0 48px;
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 360px;
  grid-template-areas:
    "left center right"
    "friends friends friends"
    "note note note"
    "footer footer footer";
  gap: 20px;
  align-items: start;
}

/* === sticky 嵌套包装：外壳负责 grid 占位，内壳负责 sticky === */
.left-column {
  grid-area: left;
  align-self: start;
  min-width: 0;
}

.left-stack {
  position: sticky;
  top: 96px;
  display: grid;
  grid-auto-rows: min-content;
  gap: 16px;
}

.main { display: contents; }

.center-column {
  grid-area: center;
  display: grid;
  grid-auto-rows: min-content;
  gap: 16px;
  min-width: 0;
}

.right-column {
  grid-area: right;
  display: grid;
  grid-auto-rows: min-content;
  gap: 16px;
  min-width: 0;
}

.friend-panel { grid-area: friends; }
.seo-panel { grid-area: note; }
.footer { grid-area: footer; }

/* 滚动锚点偏移 */
#about, #skills, #projects, #contact, #friends, #note {
  scroll-margin-top: 110px;
}

/* ============ 通用卡片 ============ */
.card,
.sidebar,
.search-card,
.friend-panel,
.seo-panel,
.quick-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card {
  padding: 22px;
  transition: box-shadow 0.25s var(--ease);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--divider);
}

.card-head h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text);
}

.label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
}

/* ============ 侧栏 - 个人卡 ============ */
.sidebar {
  padding: 24px 22px;
  display: grid;
  gap: 16px;
}

.avatar-area {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 2px auto 4px;
}

.avatar-wrap {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--primary), #818CF8 60%, var(--accent));
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.22);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  background: var(--primary-soft);
}

.verify-badge {
  position: absolute;
  right: -2px;
  bottom: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: 3px solid #fff;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.verify-badge::before { content: "V"; }

.profile-name {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.role {
  display: flex;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.typewriter {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--primary);
  animation: typingFull 2.4s steps(12, end) forwards, cursorBlink 0.72s step-end infinite;
}

@keyframes typingFull {
  from { max-width: 0; }
  to { max-width: 220px; }
}
@keyframes cursorBlink {
  50% { border-color: transparent; }
}

.status {
  position: relative;
  width: max-content;
  margin: 0 auto;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  cursor: help;
}

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

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.status-dot.offline {
  background: var(--offline);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.status-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  min-width: 168px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s var(--ease);
  z-index: 20;
}

.status-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}

.status:hover .status-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.qr-box {
  padding: 14px 12px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-tint);
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.6;
}

.qr-img {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  object-fit: cover;
  margin: 0 auto 6px;
  background: #fff;
  cursor: zoom-in;
  transition: transform 0.2s var(--ease);
}
.qr-img:hover { transform: scale(1.05); }

.side-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.side-actions a {
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.2s var(--ease);
}

.side-actions a:first-child {
  background: var(--primary);
  color: #fff;
}
.side-actions a:first-child:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.side-actions a:nth-child(2) {
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--border);
}
.side-actions a:nth-child(2):hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.side-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-3);
}

.tag-list {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}

.tag-track {
  display: flex;
  gap: 6px;
  width: max-content;
  animation: tagScroll 18s linear infinite;
}

.tag-list:hover .tag-track { animation-play-state: paused; }

.tag {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

@keyframes tagScroll {
  to { transform: translateX(-50%); }
}

/* ============ 搜索卡 ============ */
.search-card {
  padding: 20px;
  display: grid;
  gap: 12px;
}

.search-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.search-mini-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--text-3);
}

.search-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

.search-engine-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
}

.engine-select-wrap { position: relative; }
.engine-select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-65%) rotate(45deg);
  border-right: 2px solid var(--text-2);
  border-bottom: 2px solid var(--text-2);
  pointer-events: none;
}

.engine-select-wrap select,
.search-engine-row input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s var(--ease);
}

.engine-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 28px;
}

.search-engine-row input:focus,
.engine-select-wrap select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.baidu-search button[type="submit"] {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s var(--ease);
}
.baidu-search button[type="submit"]:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.hot-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hot-words button {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.18s var(--ease);
}
.hot-words button:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.search-quick {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.search-quick > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 11px;
}

.search-quick strong {
  color: var(--text);
  font-weight: 700;
  flex-shrink: 0;
}

.search-quick span {
  color: var(--text-3);
  text-align: right;
}

/* ============ About 卡 ============ */
#about {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface) 60%, var(--primary-soft) 200%);
  position: relative;
  overflow: hidden;
}

#about::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-soft) 0%, transparent 70%);
  pointer-events: none;
}

#about > * { position: relative; z-index: 1; }

#about h2 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.6px;
}

.card p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 10px;
}
.card p:last-of-type { margin-bottom: 0; }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.badge {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge.green { background: rgba(16, 185, 129, 0.10); color: #047857; border-color: rgba(16, 185, 129, 0.22); }
.badge.orange { background: var(--accent-soft); color: #B45309; border-color: rgba(245, 158, 11, 0.30); }
.badge.blue { background: rgba(14, 165, 233, 0.10); color: #0369A1; border-color: rgba(14, 165, 233, 0.24); }
.badge.purple { background: var(--primary-soft); color: var(--primary-active); border-color: rgba(79, 70, 229, 0.22); }

/* ============ 数据条带 ============ */
.quick-strip {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  background: var(--text);
  border-color: var(--text);
}

.quick-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 4px;
  transition: all 0.2s var(--ease);
}

.quick-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.quick-item strong {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.quick-item span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  line-height: 1.45;
}

/* ============ Skills 卡 ============ */
.skill-list {
  display: grid;
  gap: 12px;
}

.skill-item {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-tint);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.skill-item:hover { border-color: var(--primary-soft-2); background: var(--surface); }

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

.skill-top span:first-child {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.skill-top span:last-child {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
}

.skill-item p {
  margin: 8px 0 0;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
}

.bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  overflow: hidden;
}

.bar span {
  position: relative;
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary) 0%, #818CF8 60%, var(--accent) 100%);
  animation: chargeBar 1.2s var(--ease) forwards;
  transform-origin: left center;
}

.bar span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5) 45%, transparent 75%);
  transform: translateX(-120%);
  animation: energyMove 2.4s ease-in-out infinite;
}

@keyframes chargeBar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes energyMove {
  0% { transform: translateX(-120%); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateX(140%); opacity: 0; }
}

/* ============ Projects 卡 ============ */
#projects .project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.project {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon title arrow"
    "icon desc arrow";
  column-gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.22s var(--ease);
  cursor: pointer;
}

.project:hover {
  border-color: var(--primary-soft-2);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.project:hover .project-link {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.project-top { display: contents; }

.project-icon {
  grid-area: icon;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.project-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.project-icon-text {
  background: linear-gradient(135deg, var(--accent-soft), #FCD34D);
  color: #92400E;
  font-size: 16px;
  font-weight: 800;
  border-color: rgba(245, 158, 11, 0.3);
}

.project strong {
  grid-area: title;
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}

.project p {
  grid-area: desc;
  margin: 0;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-link {
  grid-area: arrow;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s var(--ease);
}

.project-link::after {
  content: "→";
  font-weight: 600;
}

/* ============ Contact 卡 ============ */
#contact .site-row {
  display: grid;
  gap: 10px;
}

.site-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-tint);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.site-item:hover { border-color: var(--primary-soft-2); background: var(--surface); }

.site-item strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.site-item small {
  display: block;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
}

.contact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.contact-tags span {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}

.open-btn, .open-btn-button {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

#contact .site-item:first-child .open-btn {
  background: var(--primary);
  color: #fff;
}
#contact .site-item:first-child .open-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

#contact .site-item:nth-child(2) .open-btn-button {
  background: var(--accent);
  color: #fff;
}
#contact .site-item:nth-child(2) .open-btn-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

/* ============ Friends 友链 ============ */
.friend-panel {
  padding: 22px 24px;
}

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

.friend-head h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
}

.friend-head span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
}

.friend-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.friend-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-tint);
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}

.friend-link:hover {
  transform: translateY(-1px);
  border-color: var(--primary-soft-2);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary-soft), var(--primary-soft-2));
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.friend-link strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-link small {
  display: block;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ SEO 说明 ============ */
.seo-panel {
  position: relative;
  padding: 22px 24px 22px 60px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(254, 243, 199, 0.4) 100%);
  border-color: rgba(245, 158, 11, 0.22);
}

.seo-panel::before {
  content: "i";
  position: absolute;
  left: 22px;
  top: 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  font-style: italic;
}

.seo-panel h2 {
  font-size: 16px;
  font-weight: 800;
  color: #78350F;
  margin-bottom: 8px;
}

.seo-panel p {
  font-size: 13px;
  line-height: 1.7;
  color: #92400E;
  margin-bottom: 8px;
}
.seo-panel p:last-child { margin-bottom: 0; }

/* ============ 底部 ============ */
.footer {
  margin-top: 4px;
  padding: 14px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}
.footer span {
  color: var(--text);
  font-weight: 700;
}

/* ============ 抽屉/灯箱 ============ */
.mobile-section-nav { display: none; }

.mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.mobile-drawer.active {
  opacity: 1;
  pointer-events: auto;
}

.mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.drawer {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  padding: 18px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateY(-110%);
  transition: transform 0.28s var(--ease);
}
.mobile-drawer.active .drawer { transform: translateY(0); }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

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

.drawer-links a {
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  transition: all 0.18s var(--ease);
}
.drawer-links a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox.active { display: flex; }

.lightbox-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(10px);
}

.lightbox-card {
  position: relative;
  z-index: 1;
  width: min(340px, 100%);
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.lightbox-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.lightbox-card p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: 16px;
}

.lightbox-card img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  margin: 0 auto;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--border);
}

.lightbox-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text-2);
  font-size: 20px;
  cursor: pointer;
}
.lightbox-close:hover { background: var(--surface-soft); color: var(--text); }

/* ============ 响应式 ============ */
@media (min-width: 921px) and (max-width: 1180px) {
  .layout { grid-template-columns: 280px minmax(0, 1fr) 320px; }
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "left"
      "center"
      "right"
      "friends"
      "note"
      "footer";
    gap: 14px;
  }
  .left-column {
    align-self: stretch;
  }
  .left-stack {
    position: static;
    top: auto;
  }
  .friend-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  :root { --header-offset: 84px; }

  .topbar-shield { height: 76px; }
  .topbar {
    top: 10px;
    height: 54px;
    width: min(calc(100% - 20px), 520px);
    grid-template-columns: auto 1fr auto;
    padding: 0 8px 0 10px;
  }
  .brand { font-size: 15px; padding: 4px 10px 4px 4px; }
  .brand::before { width: 28px; height: 28px; font-size: 13px; }
  .nav, .contact-btn { display: none; }
  .menu-btn { display: grid; }

  .page {
    width: min(calc(100% - 20px), 520px);
    padding: 80px 0 24px;
  }

  .layout, .left-stack, .center-column, .right-column { gap: 10px; }

  .sidebar {
    padding: 18px 16px;
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-areas:
      "avatar name"
      "avatar role"
      "avatar status"
      "actions actions"
      "tags tags";
    column-gap: 16px;
    row-gap: 8px;
    align-items: center;
  }
  .avatar-area { grid-area: avatar; width: 88px; height: 88px; margin: 0; }
  .avatar-wrap { width: 88px; height: 88px; padding: 3px; }
  .verify-badge { width: 26px; height: 26px; font-size: 11px; }
  .profile-name { grid-area: name; text-align: left; font-size: 20px; }
  .role { grid-area: role; justify-content: flex-start; }
  .status { grid-area: status; margin: 0; justify-self: start; }
  .qr-box { display: none; }
  .side-actions { grid-area: actions; margin: 4px 0 0; }
  .side-title { display: none; }
  .tag-list { grid-area: tags; max-height: 28px; }

  .mobile-section-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 0 0;
    margin-top: -2px;
  }
  .mobile-section-nav::-webkit-scrollbar { display: none; }
  .mobile-section-nav a {
    flex-shrink: 0;
    padding: 7px 12px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }
  .mobile-section-nav a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
  }

  .card { padding: 16px; }
  .card-head { margin-bottom: 12px; padding-bottom: 10px; }
  #about h2 { font-size: 19px; }
  .card p { font-size: 13px; line-height: 1.65; }
  #about p:nth-of-type(3) { display: none; }

  .quick-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }
  .quick-item { padding: 10px; }
  .quick-item strong { font-size: 14px; }
  .quick-item span { font-size: 10px; }

  .search-card { padding: 16px; }
  .search-engine-row { grid-template-columns: 80px minmax(0, 1fr); }
  .search-quick > div { font-size: 11px; }
  .hot-words button:nth-child(n+5) { display: none; }

  .friend-panel { padding: 18px; }
  .friend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .seo-panel { padding: 16px 16px 16px 50px; }
  .seo-panel::before { left: 16px; top: 18px; }

  .footer { padding: 12px 16px; font-size: 11px; }

  .project { padding: 10px 12px; column-gap: 10px; grid-template-columns: 38px minmax(0, 1fr) auto; }
  .project-icon { width: 38px; height: 38px; }
  .project-icon img { width: 22px; height: 22px; }
  .project strong { font-size: 13px; }
  .project p { font-size: 11px; }
  .project-link { padding: 5px 10px; font-size: 10px; }

  .site-item { padding: 12px 14px; }
  .open-btn, .open-btn-button { padding: 0 12px; height: 32px; font-size: 11px; }
}

@media (max-width: 420px) {
  .quick-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .friend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .tag-track { transform: none !important; }
}
