:root {
  --bg: #f7f8fb;
  --text: #0f172a;
  --muted: #64748b;
  --muted2: #94a3b8;
  --border: #e8edf3;
  --border2: #edf1f6;
  --card: #ffffff;
  --shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 10px 24px rgba(15, 23, 42, 0.04);
  --shadowHover: 0 1px 0 rgba(15, 23, 42, 0.05), 0 14px 30px rgba(15, 23, 42, 0.06);
  --radius: 18px;
  --radius2: 14px;
  --max: 1120px;
  --contentW: 532px;
  --stackW: 560px;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", Arial,
    sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px 52px 72px;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 72px;
  align-items: start;
  min-height: 100dvh;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .wrap {
    padding: 40px 22px 56px;
  }
}

.profile {
  padding-top: 8px;
}

.profile__avatarWrap {
  width: 132px;
  height: 132px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border2);
  display: grid;
  place-items: center;
}

.profile__avatar {
  width: 116px;
  height: 116px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  background: #fff;
}

.profile__name {
  margin: 20px 0 6px;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.profile__title {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.content {
  min-width: 0;
  display: grid;
  justify-items: start;
  grid-auto-rows: max-content;
}

.sectionTitle {
  margin: 2px 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  text-align: left;
  width: min(var(--contentW), 100%);
}

.sectionTitle--spaced {
  margin-top: 26px;
}

.sectionTitle--center {
  text-align: center;
}

.grid {
  display: grid;
  gap: 18px;
  width: min(var(--contentW), 100%);
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 901px) {
  /* desktop: make 1x1 tiles near-square and larger */
  .grid--3 > .card {
    aspect-ratio: 1 / 1;
    align-self: start;
  }

  /* keep 2-column combo tiles same row height */
  .grid--3 > .combo {
    align-self: stretch;
  }
}

.grid--spaced {
  margin-top: 18px;
}

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

@media (max-width: 1024px) {
  /* 平板/手机：头像/姓名区域水平居中 */
  .profile {
    display: grid;
    justify-items: center;
    text-align: center;
  }

  /* 平板/手机：卡片区域居中 + 最大宽度，避免方块被拉形变 */
  .content {
    justify-items: center;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
  overflow: hidden;
  min-height: 118px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-content: start;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadowHover);
}

.card:focus-within {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10), var(--shadowHover);
  border-color: rgba(59, 130, 246, 0.22);
}

a:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.20);
  outline-offset: 3px;
  border-radius: 14px;
}

.card__icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #f5f7fb;
  border: 1px solid var(--border2);
  color: #0f172a;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.iconImg {
  width: 18px;
  height: 18px;
  display: block;
}

.card__icon--favicon {
  background: #ffffff;
}

.faviconImg {
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 4px;
}

.sitePreview {
  width: 100%;
  height: 100%;
  min-height: 118px;
  display: block;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.02) contrast(1.02);
}

.sitePreview--kb {
  object-position: top left;
}

.card__icon--twitter {
  background: rgba(29, 155, 240, 0.12);
  border-color: rgba(29, 155, 240, 0.18);
  color: #1d9bf0;
}

.card__icon--github {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.10);
  color: #0f172a;
}

.card__icon--notes {
  background: rgba(15, 23, 42, 0.05);
}

.card__icon--auv {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.16);
  color: #2563eb;
  font-weight: 800;
  text-transform: uppercase;
}

.card__icon--surf {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.18);
  color: #10b981;
}

.card__title {
  font-weight: 750;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.card__sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.card__btn {
  margin-top: 10px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  background: #f1f5f9;
  border: 1px solid var(--border2);
  width: fit-content;
  justify-self: start;
  grid-row: -1;
}

.card__btn--blue {
  color: #0b3a63;
  background: rgba(29, 155, 240, 0.14);
  border-color: rgba(29, 155, 240, 0.22);
}

.card--twitter {
  background: linear-gradient(180deg, #eef7ff, #ffffff 55%);
}

.combo {
  grid-column: span 2;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 118px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.combo:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadowHover);
}

.combo__pane {
  padding: 16px 16px 14px;
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  align-content: start;
}

.combo__pane + .combo__pane {
  border-left: 1px solid var(--border2);
}

.combo--github .combo__pane + .combo__pane {
  border-left: none;
}

.combo__pane--center {
  padding: 12px;
  display: grid;
  grid-template-rows: 1fr;
  place-items: center;
}

.combo__pane--nopad {
  padding: 0;
  display: grid;
  place-items: stretch;
  grid-template-rows: 1fr;
}

.combo__pane--nopad > .sitePreview {
  grid-row: 1 / -1;
  grid-column: 1 / -1;
}

@media (max-width: 1024px) {
  .combo {
    grid-column: auto;
    grid-template-columns: 1fr;
  }
  .combo__pane + .combo__pane {
    border-left: none;
    border-top: 1px solid var(--border2);
  }
  .combo--github .combo__pane + .combo__pane {
    border-top: none;
  }

  /* 平板/手机：每行 2 个块，1x1 尽量正方形 */
  .grid--3 > .card,
  .grid--3 > .combo {
    aspect-ratio: 1 / 1;
  }

  /* 平板/手机：2x 长的只保留左半边 */
  .combo--github .combo__pane--center,
  .combo--kb .combo__pane--nopad {
    display: none;
  }

  /* 平板/手机：我的项目里 auv.tools 高度与 1x 卡片一致（隐藏右侧预览） */
  .combo--auv .combo__pane--nopad {
    display: none;
  }
}

.card--contrib {
  padding: 14px;
  display: grid;
  place-items: center;
}

.contrib {
  width: 100%;
  height: 100%;
  max-height: 92px;
  display: grid;
  place-items: center;
}

.combo--github .combo__pane--center {
  padding: 8px;
  overflow: hidden;
  align-items: center;
  justify-items: end;
}

.combo--github .contrib {
  display: block;
  justify-self: end;
  align-self: center;
  width: auto;
  height: auto;
  max-height: none;
}

.combo--github .contrib svg {
  display: block;
  width: 158px;
  max-width: 100%;
  height: auto;
}

.card--brand {
  display: grid;
  place-items: center;
  min-height: 116px;
}

.brandMark {
  font-weight: 900;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: #b7c2d4;
  user-select: none;
}

.lists {
  margin-top: 26px;
}

.listTitle {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  color: #111827;
}

.listTitle--spaced {
  margin-top: 18px;
}

.list {
  display: grid;
  gap: 12px;
}

.row {
  background: #fff;
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.row:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.row__title {
  font-weight: 800;
}

.row__desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.row__hint {
  color: var(--muted2);
  font-size: 12px;
  white-space: nowrap;
}

.footer {
  margin-top: 18px;
  justify-content: center;
  display: grid;
  grid-auto-flow: column;
  column-gap: 10px;
  align-items: center;
  color: var(--muted2);
  font-size: 13px;
  width: 100%;
}

.sep {
  opacity: 0.6;
}

.footer--global {
  margin-top: 56px;
  padding-top: 18px;
  justify-content: center;
  border-top: 1px solid rgba(15, 23, 42, 0.14);
}

.card__btn--github {
  border-color: rgba(15, 23, 42, 0.18);
}


/* 旧的 flex-era 响应式规则已移除（避免 iPad 上把 grid 拉满导致形变） */

@media (prefers-reduced-motion: reduce) {
  .card,
  .row {
    transition: none;
  }
  .card:hover,
  .row:hover {
    transform: none;
  }
}
