/* ============================================================
 * style.css —— 全局样式（现代、清爽、响应式）
 * ============================================================ */

:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --text: #1a1d26;
  --text-2: #5b6272;
  --text-3: #8b91a3;
  --accent: #4f6ef7;
  --accent-2: #7c5cff;
  --accent-soft: #eef1ff;
  --border: #e6e8f0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(30, 40, 90, 0.08);
  --shadow-lg: 0 18px 50px rgba(30, 40, 90, 0.16);
  /* --- 主题可切换项（深色模式会覆盖这几个） --- */
  --topbar-bg: rgba(255, 255, 255, 0.85);
  --hero-bg: linear-gradient(135deg, #ffffff 0%, #f3f6ff 100%);
  --tagline-bg: linear-gradient(135deg, #eef1ff 0%, #ffffff 55%, #f3f0ff 100%);
  --banner-fade: #f7f8fb;
  --banner-fade-from: rgba(247, 248, 251, 0);
  --overlay: rgba(23, 28, 45, 0.55);
  --wm-color: rgba(79, 110, 247, 0.09);
  --wm-quote: rgba(79, 110, 247, 0.1);
  --chip-hover: #e0e7ff;
  --err-bg: #fcebeb;
  --err-text: #a32d2d;
  /* 「联系我」页渐变转场遮罩 */
  --wipe-from: #4f6ef7;
  --wipe-to: #7c5cff;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ============================================================
 * 深色主题：只覆盖变量，不逐条改样式
 * 由 theme.js 通过 <html data-theme="dark"> 触发
 * ============================================================ */
html[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #20242e;
  --text: #e8eaf0;
  --text-2: #a8afc0;
  --text-3: #6f7688;
  --accent: #6b86ff;
  --accent-2: #9b83ff;
  --accent-soft: #1e2440;
  --border: #262b36;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.6);
  --topbar-bg: rgba(15, 17, 21, 0.82);
  --hero-bg: linear-gradient(135deg, #171a21 0%, #1a1f2e 100%);
  --tagline-bg: linear-gradient(135deg, #1a1f2e 0%, #171a21 55%, #201b2e 100%);
  --banner-fade: #0f1115;
  --banner-fade-from: rgba(15, 17, 21, 0);
  --overlay: rgba(0, 0, 0, 0.62);
  --wm-color: rgba(107, 134, 255, 0.06);
  --wm-quote: rgba(107, 134, 255, 0.07);
  --chip-hover: #26304d;
  --err-bg: #3a1d1f;
  --err-text: #ff8f8b;
  --wipe-from: #0f1115;
  --wipe-to: #1b2030;
}

/* 切换瞬间的过渡：只在 html.theme-anim 期间挂上，:where() 零优先级，
   所以 .btn / .nav-link 等自己定义的 transition 不会被覆盖 */
html.theme-anim :where(
  body, .topbar, .card, .hero, .tagline-band, .modal-card,
  .modal-mask, .chat-panel, .chat-head, .chat-foot, .search-dropdown,
  .contact-logo, .contact-qr-card, .strength-item, .msg, .site-search, .f-input, .chat-input,
  .search-item, .footer, .chip, .skill-tag, .timeline-item
) {
  transition: background-color 0.22s ease, background 0.22s ease,
    color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.nav { display: flex; gap: 4px; }
.nav-link {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px rgba(79, 110, 247, 0.35);
}

/* ---------- 导航「夜间」按钮：悬停预览深色 ---------- */
.nav-theme {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 0.18s ease;
}
.nav-theme:hover,
.nav-theme:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}
.nav-theme svg { width: 14px; height: 14px; flex: none; }
.nav-theme .icon-sun { display: none; }
/* 深色态：按钮自身反色，图标换成太阳，文案变「日间」 */
html[data-theme="dark"] .nav-theme {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}
html[data-theme="dark"] .nav-theme .icon-moon { display: none; }
html[data-theme="dark"] .nav-theme .icon-sun { display: block; }
/* 文案：浅色显示「夜间」，深色显示「日间」 */
.nav-theme .lbl-day { display: none; }
html[data-theme="dark"] .nav-theme .lbl-night { display: none; }
html[data-theme="dark"] .nav-theme .lbl-day { display: inline; }

/* ---------- 页面容器 ---------- */
.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 22px 60px;
  animation: fadeUp 0.35s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}
.section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 4px; height: 20px; border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* ---------- 首页 Hero ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 40px 32px;
  background: var(--hero-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.hero-avatar {
  flex-shrink: 0;
  width: 96px; height: 96px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 700;
  box-shadow: 0 12px 30px rgba(79, 110, 247, 0.4);
  overflow: hidden;
}
.hero-avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hero-info h1 { font-size: 30px; font-weight: 800; letter-spacing: 0.5px; }
.hero-role { color: var(--accent); font-weight: 600; margin: 4px 0 8px; }
.hero-motto { color: var(--text-2); font-size: 15px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
}
.chip-link { transition: background 0.15s ease, transform 0.15s ease; }
.chip-link:hover { background: var(--chip-hover); transform: translateY(-1px); }

/* ---------- 教育时间轴 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 24px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute; left: -26px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.tl-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.tl-school { font-size: 17px; font-weight: 700; }
.tl-degree { color: var(--accent); font-weight: 600; font-size: 14px; }
.tl-period {
  margin-left: auto;
  color: var(--text-3);
  font-size: 13px;
  background: var(--surface-2);
  padding: 2px 10px; border-radius: 999px;
}
.tl-major { color: var(--text-2); font-size: 14px; margin-top: 2px; }
.tl-desc { color: var(--text-2); font-size: 14px; margin-top: 6px; }

/* ---------- 技能标签 ---------- */
.skill-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag {
  padding: 9px 18px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 个人优势 ---------- */
.section-title.collapsible {
  cursor: pointer;
  user-select: none;
  justify-content: flex-start;
}
.collapse-arrow {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 14px;
  transition: all 0.2s ease;
}
.collapse-arrow.open { background: var(--accent); color: #fff; }
.collapse-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.28s ease, opacity 0.22s ease;
  opacity: 1;
}
/* 收起状态：隐藏第 3 条及以后，默认露出前两条个人优势 */
.collapse-wrap.collapsed .strength-item:nth-child(n+3) { display: none; }
.collapse-wrap.collapsed {
  opacity: 1;
}
.collapse-wrap > * {
  overflow: hidden;
  min-height: 0;
}
.strength-list { display: flex; flex-direction: column; gap: 12px; }
.strength-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.strength-item:hover { background: var(--accent-soft); }
.strength-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.strength-text { font-size: 14.5px; line-height: 1.7; color: var(--text); }

/* ---------- 项目卡片 ---------- */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.project-name { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.project-desc { color: var(--text-2); font-size: 13.5px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: 11.5px; padding: 2px 9px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; font-weight: 500;
}

/* ---------- 瞬间流 ---------- */
.moments-list { display: flex; flex-direction: column; gap: 16px; }
.moment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.moment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.moment-date { color: var(--text-3); font-size: 13px; }
.moment-tag {
  font-size: 12px; padding: 2px 10px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; font-weight: 500;
}
.moment-content { font-size: 15.5px; color: var(--text); }

/* ---------- 关于页 ---------- */
.about-intro { font-size: 16px; color: var(--text-2); }
.about-interests { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.interest {
  padding: 8px 16px;
  background: var(--surface-2);
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
  color: var(--text);
}
.contact-list { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.contact-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.contact-item:hover { background: var(--accent-soft); }
.contact-label { font-size: 13px; color: var(--text-3); width: 60px; }
.contact-value { font-size: 14.5px; font-weight: 500; color: var(--accent); }

/* ---------- P3：顶栏站内搜索 ---------- */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
  margin: 0 18px;
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.site-search {
  width: 100%;
  padding: 8px 16px 8px 36px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  font-family: var(--font);
  outline: none;
  transition: all 0.18s ease;
}
.site-search::placeholder { color: var(--text-3); }
.site-search:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 60;
}
.search-dropdown[hidden] { display: none; }
.search-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--accent-soft); }
.search-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-item-title mark { background: none; color: var(--accent); }
.search-item-badge {
  flex: none;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 1px 6px;
}
.search-item-snippet {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-empty {
  padding: 16px 14px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

/* ---------- P2：Hero 价值定位与双按钮 ---------- */
.hero-value {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}
.hero-actions { display: flex; gap: 12px; margin-top: 16px; }
.btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 110, 247, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79, 110, 247, 0.45); }
.btn-ghost {
  background: var(--surface);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-ghost:hover { background: var(--accent-soft); transform: translateY(-2px); }

/* ---------- 首页 Banner 大图（通栏铺满上半屏） ---------- */
.banner {
  position: relative;
  /* 跳出 1000px 内容容器，左右铺满整个视口（body 已 overflow-x:hidden，不会出横向滚动条） */
  margin: -30px calc(50% - 50vw) 18px;
  overflow: hidden;
}
.banner img {
  display: block;
  width: 100%;
  height: 74vh;
  min-height: 420px;
  max-height: 780px;
  object-fit: cover;
  object-position: center 55%;
}
/* 底部柔和过渡到页面背景色 */
.banner::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 70px;
  background: linear-gradient(180deg, var(--banner-fade-from) 0%, var(--banner-fade) 100%);
  pointer-events: none;
}

/* ---------- P2：一句话定位横幅（徽章 + 宣言） ---------- */
.tagline-band {
  position: relative;
  background: var(--tagline-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px 32px;
  text-align: center;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tagline-band::before {
  content: "\201C";
  position: absolute;
  left: 24px;
  top: 0;
  font-size: 96px;
  font-weight: 700;
  line-height: 1;
  color: var(--wm-quote);
  font-family: Georgia, "Times New Roman", serif;
  pointer-events: none;
}
.tagline-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.tagline-badge {
  padding: 5px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(79, 110, 247, 0.35);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(79, 110, 247, 0.10);
}
.tagline-statement {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
}
.tagline-band .tagline-strong { color: var(--accent); }

/* 半透明 AI 工具 Logo 水印层 */
.tagline-watermarks {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
.tagline-watermarks span,
.tagline-watermarks svg {
  position: absolute;
  color: var(--wm-color);
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.tagline-watermarks svg { stroke-width: 2.2; }
.tagline-badges,
.tagline-statement { position: relative; z-index: 1; }

/* ---------- 咨询合作弹窗表单 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }
.modal-card {
  position: relative;
  width: 420px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-lg);
}
.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.modal-x:hover { background: var(--accent-soft); color: var(--accent); }
.modal-title { font-size: 21px; font-weight: 700; color: var(--text); }
.modal-sub { font-size: 13.5px; color: var(--text-3); margin-top: 4px; }
.modal-head { margin-bottom: 20px; }

.f-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin: 14px 0 6px;
}
.f-label .req { color: #e24b4a; }
.f-label .opt { color: var(--text-3); font-weight: 400; font-size: 12px; }
.f-input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: all 0.18s ease;
  resize: vertical;
}
.f-input:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.f-err {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--err-bg);
  color: var(--err-text);
  font-size: 13px;
}
.f-submit { width: 100%; margin-top: 16px; }
.f-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.f-privacy {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}
.f-success { text-align: center; padding: 18px 0 8px; }
.f-success .s-title { font-size: 19px; font-weight: 700; color: var(--text); margin-top: 12px; }
.f-success .s-text { font-size: 14px; color: var(--text-2); margin: 8px 0 20px; }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center;
  padding: 26px 20px 40px;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- AI 悬浮气泡 ---------- */
#chat-widget { position: fixed; right: 22px; bottom: 22px; z-index: 100; }
.chat-toggle {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(79, 110, 247, 0.5);
  transition: transform 0.18s ease;
}
.chat-toggle:hover { transform: scale(1.06); }
.chat-toggle-close { display: none; }
#chat-widget.open .chat-toggle-icon { display: none; }
#chat-widget.open .chat-toggle-close { display: block; }

.chat-panel {
  position: absolute;
  right: 0; bottom: 70px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeUp 0.25s ease;
}
/* 关键修复：display:flex 会覆盖 hidden 属性的默认 display:none，
   导致面板常开（手机端主页被挡一半）。显式声明才能真正隐藏 */
.chat-panel[hidden] { display: none; }
.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.chat-head-avatar {
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.25);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.chat-head-title { font-weight: 700; font-size: 15px; }
.chat-head-sub { font-size: 12px; opacity: 0.85; }
.ch-close, .chat-clear {
  background: rgba(255, 255, 255, 0.2);
  border: none; color: #fff;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ch-close:hover, .chat-clear:hover { background: rgba(255, 255, 255, 0.32); }
/* 关闭按钮：靠在最右 */
.ch-close {
  margin-left: auto;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
/* 清空按钮：跟在关闭按钮后面 */
.chat-clear {
  margin-left: 0;
  padding: 5px 12px;
  font-size: 12px;
  flex-shrink: 0;
}

.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 5px; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-bottom-right-radius: 5px; }
.msg.error { align-self: flex-start; background: var(--err-bg); color: var(--err-text); font-size: 13px; }
.msg .cursor { display: inline-block; width: 2px; height: 14px; background: var(--accent); vertical-align: middle; animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.chat-foot {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  resize: none;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s ease;
}
.chat-input::placeholder { color: var(--text-3); }
.chat-input:focus { border-color: var(--accent); }

/* ---------- 图片问答：附件按钮 / 预览条 / 消息图片 / 大图 ---------- */
.chat-attach {
  flex: none;
  width: 34px; height: 40px;
  border: none;
  background: transparent;
  color: var(--text-3);
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}
.chat-attach:hover:not(:disabled) { color: var(--accent); background: var(--accent-soft); }
.chat-attach:disabled { opacity: 0.45; cursor: not-allowed; }
.chat-attach[hidden] { display: none; }

.chat-preview {
  padding: 10px 12px 8px;
  border-top: 1px solid var(--border);
}
.chat-preview[hidden] { display: none; }
.chat-preview-item {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.chat-preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.chat-preview-del {
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-preview-del:hover { background: rgba(0, 0, 0, 0.78); }
.chat-preview-size {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2px 4px;
  font-size: 10.5px;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
}
.chat-preview-tip {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}

.msg-img-wrap { margin-bottom: 6px; }
.msg-img {
  display: block;
  max-width: 220px;
  max-height: 220px;
  width: auto;
  border-radius: 12px;
  cursor: zoom-in;
  object-fit: cover;
}
.msg-text { white-space: pre-wrap; word-break: break-word; }

.chat-panel.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.chat-send {
  width: 40px; height: 40px;
  border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.chat-send:hover { transform: scale(1.05); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  /* 防止任何横向溢出 */
  .page { padding: 20px 14px 96px; }
  .topbar-inner { padding: 12px 14px; }
  .card { padding: 20px 16px; }
  .hero { flex-direction: column; text-align: center; gap: 16px; padding: 28px 18px; }
  .hero-avatar { width: 84px; height: 84px; border-radius: 24px; }
  .hero-info h1 { font-size: 26px; }
  .hero-meta { justify-content: center; }
  .project-grid { grid-template-columns: 1fr; }
  .tl-period { margin-left: 0; }
  .footer { padding: 22px 16px 96px; }

  /* 移动端 Banner：通栏铺满上半屏，高度收窄聚焦人物 */
  .banner { margin: -20px calc(50% - 50vw) 14px; }
  .banner img { height: 60vh; min-height: 300px; max-height: 480px; object-position: 30% 55%; }
  .banner::after { height: 46px; }

  /* 移动端 P2：定位横幅字号收敛，Hero 按钮自适应 */
  .tagline-band { padding: 26px 18px 24px; }
  .tagline-badge { font-size: 12.5px; padding: 4px 13px; }
  .tagline-statement { font-size: 15.5px; }
  .hero-actions { flex-wrap: wrap; }
  .hero-value { font-size: 12.5px; }

  /* 移动端咨询弹窗：贴底卡片式 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 86vh;
    border-radius: 18px 18px 0 0;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  }

  /* 移动端搜索框：换行占满一整行 */
  .topbar-inner { flex-wrap: wrap; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; margin: 10px 0 0; }

  /* 移动端「夜间」按钮：只留图标，避免导航换行 */
  .nav-theme { padding: 7px 9px; gap: 0; }
  .nav-theme .lbl-night,
  .nav-theme .lbl-day { display: none !important; }

  /* 移动端 AI 对话：底部抽屉式，可关闭、可再打开 */
  #chat-widget {
    right: 14px;
    bottom: 14px;
  }
  .chat-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    height: 68vh;
    max-height: 68vh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
  .chat-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* ============================================================
 * 「联系我」页面（#/contact）· v1.3
 * 壁纸背景 + 顶部 tabs + 玻璃面板（见需求文档 §16）
 * ============================================================ */

/* 该路由下隐去顶栏和页脚（#consult 区块已整体移除） */
body.is-contact .topbar,
body.is-contact .footer { display: none; }
body.is-contact { background: var(--bg); }

/* 壁纸层：用 fixed 定位而非 background-attachment（iOS 上后者会错位） */
.contact-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("./banner.jpg?v=20261031b") center 55% / cover no-repeat;
}
/* 主题色遮罩 + 轻模糊：壁纸可辨认，文字与二维码始终可读 */
.contact-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /* 顶部/底部偏实（托住标题与快捷行），中段偏透（让星空透出来） */
  background: linear-gradient(
    180deg,
    rgba(247, 248, 251, 0.86) 0%,
    rgba(247, 248, 251, 0.6) 20%,
    rgba(247, 248, 251, 0.26) 55%,
    rgba(247, 248, 251, 0.7) 100%
  );
  -webkit-backdrop-filter: blur(2px) saturate(1.08);
  backdrop-filter: blur(2px) saturate(1.08);
}
html[data-theme="dark"] .contact-bg::after {
  background: linear-gradient(
    180deg,
    rgba(10, 12, 18, 0.78) 0%,
    rgba(10, 12, 18, 0.52) 20%,
    rgba(10, 12, 18, 0.4) 55%,
    rgba(10, 12, 18, 0.72) 100%
  );
}

/* 顶部对齐：不再垂直居中（垂直居中是 v1.2 大面积空白的直接原因） */
.page.is-contact-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 84px 20px 56px;
  /* .page 自带的 fadeUp 会带 transform，会让子元素 fixed 定位失效 */
  animation: none;
}

/* 内容壳：唯一主轴，桌面限宽 680 */
.contact-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 左上角返回 */
.contact-back {
  position: fixed;
  left: 20px;
  top: 18px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.contact-back:hover {
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(-2px);
}

.contact-head { text-align: center; margin-bottom: 2px; }
.contact-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text);
  /* 壁纸透出后靠白色光晕兜住标题对比度 */
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.85), 0 0 2px rgba(255, 255, 255, 0.5);
}
.contact-sub {
  margin-top: 8px;
  font-size: 14.5px;
  /* 比常规 --text-2 深一档：壁纸透出后仍要读得清 */
  color: #474e63;
  text-shadow: 0 1px 12px rgba(255, 255, 255, 0.9);
}
html[data-theme="dark"] .contact-title,
html[data-theme="dark"] .contact-sub {
  color: var(--text);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.68);
}
/* 「通常当天回复」小徽标：填充头部，避免两行孤字 */
.contact-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 12.5px;
  color: var(--text-2);
}
.contact-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

/* 玻璃面板：包住 tabs + 二维码，桌面不散 */
.contact-panel {
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px 14px 18px;
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(24px) saturate(1.06);
  backdrop-filter: blur(24px) saturate(1.06);
}

/* 顶部 tabs：logo 行在标题下方紧接 */
.contact-logos {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 4px;
}
.contact-tabs { display: flex; align-items: flex-start; gap: 10px; }
.contact-logo-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* 右侧小提示：桌面填充 logo 行，移动端隐藏 */
.contact-logos-hint {
  margin-left: auto;
  align-self: center;
  font-size: 12.5px;
  color: var(--text-2);
}
.contact-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.contact-logo:hover { transform: translateY(-3px); color: var(--accent); }
.contact-logo:active { transform: scale(0.96); }
.contact-logo:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* 选中态（tabs） */
.contact-logo[aria-selected="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* 未配置地址的渠道：视觉降级、不可点 */
.contact-logo[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.contact-logo[aria-disabled="true"]:hover {
  transform: none;
  color: var(--text-2);
}
/* 选中指示条 */
.contact-logo-mark {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.2s ease, width 0.2s ease;
}
.contact-logo-cell[data-active="true"] .contact-logo-mark {
  width: 22px;
  background: var(--accent);
}

/* 面板常开（tabs 语义，永不收起）：切换时只做淡出淡入 */
.contact-qr-panel {
  width: 100%;
  opacity: 1;
  transition: opacity 0.12s ease;
}
.contact-qr-panel.is-swapping { opacity: 0.35; }
.contact-qr-inner {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* 桌面两栏：二维码左 / 说明与账号右 */
.contact-qr-body {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
}
.contact-qr-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

/* 二维码卡片：强制白底（深色模式下也要白，否则手机扫不出来） */
.contact-qr-card {
  width: 100%;
  max-width: 300px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  cursor: zoom-in;
}
.contact-qr-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  image-rendering: -webkit-optimize-contrast;
}
.contact-qr-tip {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.contact-qr-steps {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
}
.contact-qr-account {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}
.contact-qr-account b { font-weight: 700; letter-spacing: 0.3px; user-select: all; }
.contact-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.contact-copy:hover { color: var(--accent); border-color: var(--accent); }
.contact-copy.done { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* 底部快捷行：撑住页面下沿 */
.contact-quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.contact-quick-btn {
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--text-2);
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.contact-quick-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.contact-quick-btn.done {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* 二维码缺失时的占位卡 */
.contact-qr-empty {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 34px 20px;
  border-radius: 18px;
  background: #fff;
  color: #5b6272;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.7;
}

/* 渐变转场遮罩 */
.page-wipe {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(135deg, var(--wipe-from), var(--wipe-to));
  transition: opacity 260ms ease;
}
.page-wipe.show { opacity: 1; }

/* 页面内容入场 */
.contact-enter { animation: contact-in 320ms ease both; }
@keyframes contact-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 899px) {
  /* 单列：二维码在上，说明与账号在下 */
  .contact-qr-body {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
  }
  .contact-qr-meta {
    align-items: center;
    text-align: center;
  }
  .contact-qr-account { justify-content: center; }
  .contact-logos-hint { display: none; }
}

@media (max-width: 720px) {
  .page.is-contact-page { padding: 68px 16px calc(32px + env(safe-area-inset-bottom)); }
  .contact-title { font-size: 24px; }
  .contact-sub { font-size: 13.5px; }
  .contact-logos,
  .contact-tabs { gap: 8px; }
  .contact-logo { width: 52px; height: 52px; border-radius: 15px; }
  .contact-back { left: 14px; top: 14px; height: 36px; font-size: 13px; }
  .contact-panel { padding: 12px 12px 16px; border-radius: 20px; }
  /* 壁纸跟着首页的裁切走，人物不被切掉 */
  .contact-bg { background-position: 30% 55%; }
  .contact-quick-btn { flex: 1 1 0; min-width: 0; padding: 0 10px; font-size: 12.5px; white-space: nowrap; }
}

@media (max-width: 360px) {
  .contact-logo { width: 48px; height: 48px; border-radius: 14px; }
  .contact-qr-card { padding: 12px; }
  .contact-quick-btn { font-size: 12px; }
}

/* 不支持 backdrop-filter 的老浏览器：用不透明遮罩/卡片兜底，版式不变 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .contact-bg::after {
    background: linear-gradient(180deg, rgba(247, 248, 251, 0.94), rgba(247, 248, 251, 0.97));
  }
  html[data-theme="dark"] .contact-bg::after {
    background: linear-gradient(180deg, rgba(10, 12, 18, 0.95), rgba(10, 12, 18, 0.97));
  }
  .contact-panel,
  .contact-back,
  .contact-quick-btn,
  .contact-badge { background: var(--surface); }
}

@media (prefers-reduced-motion: reduce) {
  .page-wipe { display: none; }
  .contact-enter { animation: none; }
  .contact-qr-panel { transition: none; }
  .contact-logo { transition: none; }
  .contact-quick-btn { transition: none; }
}

