/* ============================================================
 * styles.css — 前台展示页
 * CSS 变量驱动明暗主题：body.theme-dark 时文字/按钮反白
 * ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---------- 主题变量 ---------- */
:root {
  --bg-color: #f5f5f7;
  --bg-image: none;
  --bg-size: auto;
  --bg-position: center;
  --bg-repeat: no-repeat;
  --bg-attachment: fixed;

  --text: #0a0a0a;
  --text-secondary: #1c1c1e;
  --text-tertiary: #8e8e93;

  --surface: #ffffff;           /* 链接卡片 */
  --surface-hover: #fafafa;
  --border: rgba(10, 10, 10, 0.06);
  --card-shadow: 0 0 0 1px rgba(10, 10, 10, 0.04);
  --icon-color: #0a0a0a;
  --avatar-ring: rgba(10, 10, 10, 0.08);
  --fab-bg: #0a0a0a;
  --fab-color: #ffffff;
}

body.theme-dark {
  --text: #f5f5f7;
  --text-secondary: #d2d2d7;
  --text-tertiary: #98989d;

  --surface: #1c1c1e;
  --surface-hover: #2c2c2e;
  --border: rgba(255, 255, 255, 0.09);
  --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  --icon-color: #f5f5f7;
  --avatar-ring: rgba(255, 255, 255, 0.14);
  --fab-bg: #f5f5f7;
  --fab-color: #0a0a0a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  background-image: var(--bg-image);
  background-size: var(--bg-size);
  background-position: var(--bg-position);
  background-repeat: var(--bg-repeat);
  background-attachment: var(--bg-attachment);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

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

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

img {
  max-width: 100%;
  display: block;
}

/* ---------- 布局 ---------- */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 56px 24px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- 头像 / 名称 ---------- */
.profile {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}

.avatar-wrap {
  width: 112px;
  height: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px var(--avatar-ring);
}

.avatar {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  border: 0;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  background: var(--surface-hover);
}

.name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 6px;
  text-align: center;
  color: var(--text);
  transition: color 0.3s ease;
}

.bio {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  text-align: center;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}

/* ---------- 链接卡片 ---------- */
.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 14px;
  padding: 18px 20px;
  min-height: 60px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease, color 0.2s ease;
  cursor: pointer;
  user-select: none;
  word-break: break-word;
  box-shadow: var(--card-shadow);
}

.link-card:hover {
  background: var(--surface-hover);
  box-shadow: 0 0 0 1px var(--border);
}

.link-card:active {
  transform: scale(0.985);
}

.link-card .label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.link-card .icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  color: var(--icon-color);
  transition: color 0.2s ease;
}

.link-card .icon svg {
  width: 100%;
  height: 100%;
}

/* ---------- 社交图标 ---------- */
.socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
}

.social-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-color);
  transition: transform 0.15s ease, opacity 0.15s ease, color 0.2s ease;
}

.social-icon:hover {
  transform: translateY(-1px);
  opacity: 0.75;
}

.social-icon svg {
  width: 100%;
  height: 100%;
}

.social-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* ---------- 版权 ---------- */
.footer {
  width: 100%;
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  justify-content: center;
}

.copyright {
  margin: 0;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  user-select: none;
  transition: color 0.2s ease;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg-color);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(10, 10, 10, 0.2);
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
  .page {
    padding: 40px 20px 56px;
  }

  .name {
    font-size: 24px;
  }

  .bio {
    font-size: 15px;
  }

  .avatar-wrap {
    width: 96px;
    height: 96px;
  }

  .link-card {
    padding: 16px 18px;
    font-size: 15px;
  }
}

@media (min-width: 768px) {
  .page {
    padding-top: 80px;
  }
}

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