/* ===================================================
   我的作品集 — 样式表
   一般不需要修改；改配置请看 index.html 里的 CONFIG
   =================================================== */

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

:root {
  --icon-size: 72px;
  --icon-radius: 18px;
  --grid-gap: 30px;
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-smooth: cubic-bezier(.25, .8, .25, 1);
}

html { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.4); }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  min-height: 100vh;
  color: #fff;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ===== 壁纸层 ×2（轮换淡入淡出）+ 暗化遮罩 ===== */
.wallpaper {
  position: fixed; inset: 0; z-index: -2;
  background: linear-gradient(135deg, #0f2027 0%, #203a43 45%, #2c5364 100%);
  background-size: cover; background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.wallpaper.active { opacity: 1; }
.wallpaper-scrim {
  position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% 30%, rgba(0,0,0,.18) 0%, rgba(0,0,0,.5) 100%);
  pointer-events: none;
}

.desktop {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 64px 20px 36px;
}

/* ===== 状态栏（锁屏式时钟） ===== */
.status-bar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; justify-content: center; align-items: center;
  padding: 12px 24px; font-size: 13px; font-weight: 500;
  z-index: 100; pointer-events: none;
}
.status-bar .time { text-shadow: 0 1px 4px rgba(0,0,0,.6); }

/* ===== 左上角返回主页按钮（子页面用） ===== */
.back-btn {
  position: fixed; top: 12px; left: 16px;
  display: flex; align-items: center; gap: 4px;
  padding: 6px 14px 6px 8px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  color: rgba(255,255,255,.9);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  transition: background .2s, transform .2s var(--ease-spring);
}
.back-btn:hover { background: rgba(255,255,255,.22); transform: scale(1.05); }
.back-btn:active { transform: scale(.95); }
.back-btn svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

/* ===== 头部：标题 + 副标题 ===== */
.header {
  text-align: center;
  margin-bottom: 52px;
  opacity: 0;
  animation: fadeDown .8s var(--ease-smooth) forwards;
}
.header .title {
  font-size: 30px; font-weight: 700; letter-spacing: 4px;
  text-shadow: 0 2px 16px rgba(0,0,0,.5);
}
.header .subtitle {
  margin-top: 12px; font-size: 13px; font-weight: 400;
  letter-spacing: 2px; color: rgba(255,255,255,.55);
}
.header .divider {
  width: 40px; height: 2px; margin: 18px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== 分组小标题（资源站等分组页面用） ===== */
.section-heading {
  font-size: 15px; font-weight: 600;
  letter-spacing: 4px;
  color: rgba(255,255,255,.82);
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
  margin: 34px 0 18px;
  display: flex; align-items: center; gap: 14px;
  width: 100%; max-width: 580px;
  opacity: 0;
  animation: fadeDown .5s var(--ease-spring) forwards;
}
.section-heading::before,
.section-heading::after {
  content: '';
  height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28));
}
.section-heading::after {
  background: linear-gradient(90deg, rgba(255,255,255,.28), transparent);
}

/* ===== 图标网格 ===== */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--grid-gap);
  width: 100%; max-width: 580px;
  justify-items: center;
}

.icon-item {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: #fff; cursor: pointer;
  opacity: 0;
  animation: iconIn .55s var(--ease-spring) forwards;
  transition: transform .3s var(--ease-spring);
  position: relative;
}
.icon-item:hover { transform: scale(1.12) translateY(-4px); }
.icon-item:active { transform: scale(.94); }

@keyframes iconIn {
  from { opacity: 0; transform: scale(.7) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== macOS 质感图标：顶部高光 + 内阴影 + 悬停彩光 ===== */
.icon-box {
  width: var(--icon-size); height: var(--icon-size);
  border-radius: var(--icon-radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
  position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow:
    0 1px 0 rgba(255,255,255,.25) inset,   /* 顶部高光线 */
    0 -8px 16px rgba(255,255,255,.12) inset, /* 顶部光泽 */
    0 8px 20px rgba(0,0,0,.35),            /* 投影 */
    0 2px 5px rgba(0,0,0,.25);
  transition: box-shadow .35s var(--ease-smooth), filter .35s var(--ease-smooth);
}
/* 玻璃反光斜面 —— iOS 图标质感的关键（盖在自定义图片之上、SVG 之下） */
.icon-box::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,.32) 0%, rgba(255,255,255,.06) 42%, transparent 55%);
  pointer-events: none;
  z-index: 2;
}
.icon-item:hover .icon-box {
  filter: saturate(1.25) brightness(1.08);
  box-shadow:
    0 1px 0 rgba(255,255,255,.35) inset,
    0 -8px 16px rgba(255,255,255,.15) inset,
    0 14px 34px var(--glow, rgba(0,0,0,.5)),  /* 图标同色光晕 */
    0 20px 44px rgba(0,0,0,.45);
}

.icon-box svg {
  width: 32px; height: 32px;
  fill: none; stroke: #fff;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
  position: relative; z-index: 3;
}

/* ===== 自定义图标图片（icon 字段填图片 URL 时生效） ===== */
.icon-box img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}

.icon-label {
  font-size: 12px; text-align: center;
  max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 5px rgba(0,0,0,.75), 0 0 12px rgba(0,0,0,.4);
}

/* ===== 悬停提示气泡（桌面端） ===== */
.icon-item .tooltip {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(6px) scale(.9);
  padding: 7px 14px;
  background: rgba(30, 30, 36, .78);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  font-size: 12px; letter-spacing: .5px; white-space: nowrap;
  color: rgba(255,255,255,.92);
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease-smooth), transform .25s var(--ease-spring);
  z-index: 50;
}
.icon-item .tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: rgba(255,255,255,.12);
}
@media (hover: hover) {
  .icon-item:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* ===== Dock：毛玻璃 + macOS 放大效果 ===== */
.dock-wrapper { margin-top: auto; margin-bottom: 18px; }
.dock {
  padding: 10px 18px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 22px;
  display: flex; gap: 14px; align-items: flex-end;
  max-width: 90vw; overflow-x: auto; overflow-y: visible;
  box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.2) inset;
}
.dock::-webkit-scrollbar { height: 0; }
.dock .icon-item { animation: none; opacity: 1; transform: none; transition: transform .22s var(--ease-spring); }
.dock .icon-item:hover { transform: scale(1.28) translateY(-6px); }
.dock .icon-label { display: none; }
.dock .tooltip { bottom: calc(100% + 18px); }
.dock .icon-box {
  width: 54px; height: 54px; border-radius: 14px; margin: 0;
}
.dock .icon-box svg { width: 25px; height: 25px; }

/* ===== 页脚 ===== */
.footer {
  margin-top: 40px; margin-bottom: 8px;
  font-size: 12px; letter-spacing: 1px;
  color: rgba(255,255,255,.4);
  text-align: center;
  opacity: 0;
  animation: fadeDown 1s .6s var(--ease-smooth) forwards;
}
.footer a { color: rgba(255,255,255,.55); text-decoration: none; transition: color .2s; }
.footer a:hover { color: rgba(255,255,255,.9); }

/* ===== "关于我"弹窗：毛玻璃介绍卡 ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity .28s var(--ease-smooth);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.about-card {
  position: relative;
  width: 100%; max-width: 420px;
  max-height: 80vh; overflow-y: auto;
  padding: 34px 30px 30px;
  border-radius: 26px;
  background: rgba(30,30,40,.55);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 24px 70px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.22) inset;
  text-align: center;
  color: #fff;
  transform: scale(.88) translateY(14px);
  transition: transform .32s var(--ease-spring);
}
.modal-overlay.open .about-card { transform: scale(1) translateY(0); }
.about-card::-webkit-scrollbar { width: 0; }

.about-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.75);
  font-size: 16px; line-height: 32px;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.about-close:hover { background: rgba(255,255,255,.25); transform: rotate(90deg); }

.about-avatar {
  width: 88px; height: 88px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D4537E, #534AB7);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 10px 30px rgba(212,83,126,.4);
  overflow: hidden;
}
.about-avatar svg { width: 42px; height: 42px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.about-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 头像已是完整图片（如 cai.png）时，不再套紫色圆环，直接原样展示 */
.about-avatar.has-img {
  background: transparent;
  border: none;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
}
.about-avatar.has-img img { object-fit: cover; }

.about-name { font-size: 20px; font-weight: 700; letter-spacing: 2px; margin-bottom: 6px; }
.about-tagline {
  font-size: 13px; color: rgba(255,255,255,.65);
  letter-spacing: 1px; margin-bottom: 18px;
}
.about-text { text-align: left; }
.about-text p {
  font-size: 14px; line-height: 1.9;
  color: rgba(255,255,255,.85);
  margin: 0 0 12px;
}
.about-links {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.about-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
  font-size: 13px; text-decoration: none;
  transition: background .2s, transform .2s;
}
.about-links a:hover { background: rgba(255,255,255,.24); transform: translateY(-2px); }

/* 复制邮箱成功后的轻提示 */
.toast {
  position: fixed; left: 50%; bottom: 44px;
  transform: translate(-50%, 16px);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 22, 30, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; font-size: 13px; letter-spacing: .5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  :root { --icon-size: 62px; --grid-gap: 22px; }
  .icon-grid { grid-template-columns: repeat(3, 1fr); max-width: 330px; }
  .header { margin-bottom: 38px; }
  .header .title { font-size: 24px; letter-spacing: 3px; }
  .desktop { padding: 52px 16px 28px; }
  .dock-wrapper, .footer { display: none; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .icon-grid { grid-template-columns: repeat(4, 1fr); max-width: 460px; }
}

@media (min-width: 1025px) {
  .icon-grid { grid-template-columns: repeat(5, 1fr); max-width: 580px; }
}

/* 动效偏好：用户系统关闭动画时尊重之 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .icon-item, .header, .footer { opacity: 1; }
}
