/* ============================================================
   wzxe.cn 个人主页 · 样式
   深色为默认，右上角按钮可切浅色（记忆在本机）
   ============================================================ */

:root {
  --bg: #0b1220;
  --bg-soft: #101a2c;
  --card: #131c2e;
  --border: #24334d;
  --text: #e8eefc;
  --text-dim: #9fb0cc;
  --accent: #60a5fa;
  --accent-strong: #2563eb;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 16px;
}

html[data-theme="light"] {
  --bg: #f4f7fc;
  --bg-soft: #eaf0fa;
  --card: #ffffff;
  --border: #dde5f0;
  --text: #0f172a;
  --text-dim: #5b6b85;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 15% -10%, rgba(37, 99, 235, 0.20), transparent 65%),
    radial-gradient(700px 420px at 95% 5%, rgba(56, 189, 248, 0.14), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ---------------- 主题切换按钮 ---------------- */
.theme-btn {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: 14px;
  z-index: 50;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.theme-btn:active { transform: scale(0.9); }

.theme-btn__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset -6px -4px 0 0 var(--card);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
html[data-theme="light"] .theme-btn__icon {
  box-shadow: inset 0 0 0 0 var(--card), 0 0 0 2px var(--accent) inset;
}

/* ---------------- 页面骨架 ---------------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 20px calc(48px + env(safe-area-inset-bottom, 0px));
}

/* ---------------- 头部 ---------------- */
.hero { text-align: center; margin-bottom: 44px; }

.avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 26px;
  background: linear-gradient(145deg, var(--accent-strong), #38bdf8);
  color: #fff;
  font-size: 38px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  user-select: none;
}

.greet {
  margin: 0 0 6px;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.name {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.tagline {
  margin: 0 auto 14px;
  min-height: 1.75em;
  max-width: 30em;
  font-size: 17px;
  color: var(--text);
}

.tagline::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.16em;
  background: var(--accent);
  animation: caret 1s steps(1) infinite;
}
.tagline.is-done::after { animation: none; opacity: 0; }

@keyframes caret { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.meta {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
}

/* ---------------- 内容块 ---------------- */
.block { margin-bottom: 30px; }

.block__title {
  margin: 0 0 14px;
  padding-left: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-left: 3px solid var(--accent);
}

.text {
  margin: 0;
  color: var(--text);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

/* ---------------- 方向卡片 ---------------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.mini-card {
  background: color-mix(in srgb, var(--card) 78%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.mini-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.mini-card__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.mini-card__text {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ---------------- 技能标签 ---------------- */
.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--text-dim);
  font-size: 13.5px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.tag:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
}

/* ---------------- 联系 ---------------- */
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.contact__mail {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 78%, transparent);
  color: var(--text);
  text-decoration: none;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.18s ease;
}

.contact__mail:hover { border-color: var(--accent); }

.copy-btn {
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--accent-strong);
  color: #fff;
  font-size: 14.5px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.copy-btn:active { transform: scale(0.96); }
.copy-btn.is-done { background: #16a34a; }

.hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------------- 页脚 ---------------- */
.foot {
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13.5px;
  color: var(--text-dim);
}

.foot .dot { margin: 0 8px; opacity: 0.6; }

/* ---------------- 入场动画 ----------------
   默认完全可见；只有 JS 可用（html.js-anim）时才先隐藏再点亮，
   保证脚本失效时内容不会消失 */
.reveal { opacity: 1; transform: none; }

html.js-anim .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

html.js-anim .reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js-anim .reveal { opacity: 1; transform: none; transition: none; }
  .tagline::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- 宽屏 ---------------- */
@media (min-width: 640px) {
  .page { padding-top: 72px; }
  .name { font-size: 40px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .hero { margin-bottom: 52px; }
}
