/* ============================================================
   style.css — ishxwl 个人主页
   全新设计：居中单栏 + 重构卡片
   颜色沿用 root.css 变量，仅重做形态与布局
   ============================================================ */

/* ---------- 字体 ---------- */
@font-face {
  font-family: "body";
  src: url(../fonts/Ubuntu-Regular.ttf) format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "title";
  src: url(../fonts/Pacifico-Regular.ttf) format("truetype");
  font-display: swap;
}

/* ---------- 全局重置 ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: "body", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--main_text_color);
  background: var(--main_bg_color);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, color 0.3s;
}
.hxw-main { flex: 1 0 auto; }
footer { flex-shrink: 0; }

.iconItem, .switch, .left-tag-item,
.title, .projectItem, .onoffswitch, footer { user-select: none; }

a { text-decoration: none; color: inherit; outline: none; -webkit-tap-highlight-color: transparent; }
a:hover, a:focus, a:visited, a:active { color: inherit; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 加载遮罩 ---------- */
#hxw-loading {
  position: fixed; inset: 0; z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, #1a0a2e, #0a0a14);
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#hxw-loading-center {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, #bd34fe, #41d1ff);
  animation: loaderPulse 1.1s ease-in-out infinite;
}
@keyframes loaderPulse {
  0%   { transform: scale(0.2); opacity: 1; }
  60%  { opacity: 0.5; }
  100% { transform: scale(1.1); opacity: 0; }
}

/* ---------- 全局背景模糊层 ---------- */
.hxw-filter {
  position: fixed; inset: 0; z-index: -1;
  background: var(--back_filter_color, transparent);
  backdrop-filter: blur(var(--back_filter, 0px));
  -webkit-backdrop-filter: blur(var(--back_filter, 0px));
}

/* ============================================================
   居中单栏容器
   ============================================================ */
.hxw-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 20px 30px;
  display: flex;
  flex-direction: column;
}

/* 通用卡片外观 */
.profile-card,
.projectItem,
.panel-card {
  background: var(--item_bg_color);
  border: 1px solid rgba(255,255,255,0.09);
  backdrop-filter: blur(var(--card_filter));
  -webkit-backdrop-filter: blur(var(--card_filter));
  box-shadow: 0 10px 40px -12px rgba(0,0,0,0.5);
}

/* ============================================================
   顶部资料大卡
   ============================================================ */
.profile-card {
  position: relative;
  border-radius: 26px;
  padding: 34px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
/* 上半部：头像 + 文字信息横排 */
.profile-top {
  display: flex;
  gap: 30px;
  align-items: center;
}
/* 卡片右上角的渐变辉光装饰 */
.profile-glow {
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: var(--gradient);
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}

/* 头像：圆形。背景图靠 border-radius 裁圆，不用 overflow:hidden，
   这样溢出的挂饰(logokuang)才能完整显示 */
.profile-avatar {
  width: 128px; height: 128px;
  position: relative;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
/* 挂饰：位于头像之上、可溢出边界 */
.profile-avatar img {
  position: absolute; top: -15%; left: -10%;
  width: 120%; aspect-ratio: 1/1;
  pointer-events: none;
}
.profile-avatar:hover { transform: translateY(-4px) rotate(-2deg); }

/* 头像侧列 */
.profile-side {
  flex-shrink: 0;
}

.profile-body {
  flex: 1; min-width: 0; position: relative; z-index: 1;
}

/* 欢迎语 */
.welcome {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.gradientText {
  display: inline-block;
  font-family: "title", cursive;
  font-weight: 400;
  padding: 0 0.18em 0.12em 0.02em;
  background-image: var(--gradient);
  background-size: 200%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: gradientShift 10s ease-in-out infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 100%; }
  50%       { background-position: 0%; }
}

/* 资料 chip（地区/MBTI，横排药丸） */
.profile-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  font-size: 12.5px; font-weight: 600;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}
.meta-chip svg { width: 14px; height: 14px; fill: var(--fill); opacity: 0.85; }

.description { font-size: clamp(13px, 1.4vw, 16px); margin-top: 6px; line-height: 1.7; }
.purpleText { color: var(--purple_text_color); font-weight: 700; }
.textBackground {
  background: var(--text_bg_color);
  border-radius: 6px; padding: 2px 7px; margin: 0 2px; font-weight: 700;
}

/* ---------- 社交图标栏（资料卡内） ---------- */
.iconContainer {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-top: 18px;
  padding: 4px 0;
}
.iconItem, .switch {
  height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}
/* 图标靠左锚定：收起 42px 正好居中，展开文字向右延伸，鼠标离开不抖 */
.iconItem {
  max-width: 42px; overflow: hidden; cursor: pointer;
  justify-content: flex-start;
  padding-left: 11px;
  transition: max-width 0.45s cubic-bezier(0.34,1.4,0.64,1),
              transform 0.35s ease, background 0.35s ease, border-color 0.35s ease;
}
.iconItem i { width: 20px; font-size: 19px; fill: var(--fill); flex-shrink: 0; text-align: center; }
.iconTip { white-space: nowrap; font-size: 13px; font-weight: 600; }
.iconItem .iconTip {
  margin-left: 0; opacity: 0;
  transition: margin-left 0.45s ease, opacity 0.3s ease;
}
.iconItem:hover {
  max-width: 240px; padding-right: 14px;
  transform: translateY(-3px);
  background: var(--item_hover_color);
  border-color: rgba(255,255,255,0.22);
}
.iconItem:hover .iconTip { margin-left: 8px; opacity: 1; }

.switch { width: 54px; cursor: pointer; }
.switch:hover { background: var(--item_hover_color); }

/* ---------- 标签行（横跨整卡底部，与上半部之间有分隔线） ---------- */
.left-tag {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: flex-start;
  width: 100%;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.left-tag-item {
  display: inline-flex; align-items: center;
  padding: 4px 11px; font-size: 12px;
  border-radius: 8px;
  background: var(--left_tag_item);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.2s ease, background 0.2s ease;
  cursor: default;
}
.left-tag-item:hover { transform: translateY(-2px); background: var(--item_hover_color); }

/* ============================================================
   Section 标题
   ============================================================ */
.title {
  display: flex; align-items: center; gap: 9px;
  font-size: 19px; font-weight: 700; letter-spacing: 0.02em;
  margin: 30px 0 14px;
}
.title svg {
  height: 20px; width: 20px; flex-shrink: 0;
  fill: var(--fill);
  padding: 5px; box-sizing: content-box;
  border-radius: 9px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ============================================================
   项目卡片（重新设计：图标块 + 标题 + 悬浮箭头）
   ============================================================ */
.projectList {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.projectItem {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 18px;
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34,1.3,0.64,1),
              background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
/* 左侧竖直渐变条（hover 显现） */
.projectItem::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--gradient);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}
.projectItem:hover {
  transform: translateY(-5px);
  background: var(--item_hover_color);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 18px 40px -14px rgba(0,0,0,0.6);
}
.projectItem:hover::before { transform: scaleY(1); }
.projectItem.pressed { transform: scale(0.97); }

/* 图标块：渐变底衬 */
.projectItemRight {
  flex-shrink: 0;
  width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  transition: transform 0.4s ease;
}
.projectItem:hover .projectItemRight { transform: scale(1.06) rotate(-4deg); }
.projectItemRight img { width: 34px; height: 34px; object-fit: contain; }

.projectItemLeft { flex: 1; min-width: 0; }
.projectItemLeft h1 {
  font-size: 16px; font-weight: 700; margin-bottom: 4px;
  color: var(--item_left_title_color);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.projectItemLeft p {
  font-size: 12.5px; line-height: 1.5;
  color: var(--item_left_text_color); opacity: 0.85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 悬浮箭头 */
.card-arrow {
  flex-shrink: 0;
  font-size: 18px; font-weight: 700;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.projectItem:hover .card-arrow { opacity: 0.9; transform: translateX(0); }

/* ============================================================
   skills 面板卡（独占整行）
   ============================================================ */
.panel-card {
  border-radius: 20px;
  padding: 22px;
  margin-top: 30px;
}
.panel-card .title { margin-top: 0; margin-bottom: 16px; }

/* 技能图 */
.skill { width: 100%; }
.skill img { width: 100%; height: auto; display: block; }
.skill #skillWap { display: none; }

/* ---------- 贡献蛇 ---------- */
.tanChiShe { width: 100%; margin-top: 26px; opacity: 0.9; }
.tanChiShe img { width: 100%; height: auto; display: block; }

/* ============================================================
   页脚（整行贴底）
   ============================================================ */
footer {
  width: 100%;
  text-align: center; padding: 18px 10px; margin-top: 34px;
  font-size: 13px; color: var(--footer_text_color);
  background: var(--item_bg_color);
  backdrop-filter: blur(var(--card_filter));
  -webkit-backdrop-filter: blur(var(--card_filter));
  border-top: 1px solid rgba(255,255,255,0.06);
}
footer a {
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   赞助弹窗
   ============================================================ */
.tc {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  visibility: hidden; opacity: 0;
  background: rgba(10,10,20,0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.tc.active { visibility: visible; opacity: 1; }
.tc-main {
  width: 80%; max-width: 300px; min-height: 200px;
  border-radius: 18px; overflow: hidden; background: #fff;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  transform: translateY(24px) scale(0.9);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.tc.active .tc-main { transform: translateY(0) scale(1); }
.tc-img { width: 100%; height: auto; display: block; }

/* IP 弹窗面板 */
.tc-ip {
  padding: 28px 24px;
  color: #1a1a1a;
  text-align: center;
}
.tc-ip-title {
  font-size: 14px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #888;
  margin-bottom: 16px;
}
.tc-ip-value {
  font-family: "body", monospace;
  font-size: 17px; font-weight: 700;
  word-break: break-all;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f2f3f7;
  border: 1px solid #e2e4ea;
  margin-bottom: 18px;
}
.tc-ip-copy {
  width: 100%;
  padding: 12px;
  font-size: 15px; font-weight: 700;
  color: #fff; cursor: pointer;
  border: none; border-radius: 12px;
  background: var(--gradient);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.tc-ip-copy:hover { transform: translateY(-2px); filter: brightness(1.08); }
.tc-ip-copy:active { transform: translateY(0); }

/* ============================================================
   主题切换开关
   ============================================================ */
.onoffswitch { position: relative; width: 38px; height: 21px; }
.onoffswitch-checkbox { display: none; }
.onoffswitch-label {
  display: block; height: 100%; border-radius: 99px;
  cursor: pointer; overflow: hidden;
}
.onoffswitch-inner {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(135deg, #bd34fe, #41d1ff);
  transition: background 0.3s ease;
}
.onoffswitch-checkbox:not(:checked) + .onoffswitch-label .onoffswitch-inner {
  background: rgba(120,120,120,0.5);
}
.onoffswitch-switch {
  position: absolute; top: 3px; right: 20px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  transition: right 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { right: 3px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 720px) {
  .profile-card { flex-direction: column; align-items: center; text-align: center; padding: 28px 22px; }
  .profile-side { align-items: center; }
  .profile-avatar { width: 108px; height: 108px; }
  .profile-meta, .iconContainer { justify-content: center; }
}

@media (max-width: 520px) {
  .hxw-main { padding: 24px 14px 20px; }
  .projectList { grid-template-columns: 1fr; }
  .skill #skillPc { display: none; }
  .skill #skillWap { display: block; }
}
