/* ============================================================
   MySoftSite — 个人软件作品集
   设计：深色为主 / 可切换浅色，渐变网格背景 + 玻璃卡片
   ============================================================ */

:root {
  --bg: #08080d;
  --bg-2: #0d0d16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ECECF4;
  --muted: #9a9ab0;
  --faint: #6b6b82;

  --accent-1: #6366f1;   /* indigo  */
  --accent-2: #22d3ee;   /* cyan    */
  --accent-3: #ec4899;   /* pink    */
  --grad: linear-gradient(120deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));

  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1140px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.65);
  --font: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-2: #eef0f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(255, 255, 255, 0.9);
  --border: rgba(15, 15, 40, 0.10);
  --border-strong: rgba(15, 15, 40, 0.18);
  --text: #14141f;
  --muted: #56566e;
  --faint: #8a8a9e;
  --shadow: 0 18px 50px -24px rgba(40, 40, 90, 0.30);
  --accent-2: #0891b2;   /* 亮色下加深青，避免发虚 */
}

/* 流光边框用的可动画角度 */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

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

html { scroll-behavior: smooth; }

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

/* ---------- 动态渐变网格背景 ---------- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg);
  overflow: hidden;
}
.bg-mesh::before,
.bg-mesh::after {
  content: "";
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  will-change: transform;
}
.bg-mesh::before {
  background: radial-gradient(circle at 30% 30%, var(--accent-1), transparent 60%);
  top: -10vw; left: -8vw;
  animation: float1 22s ease-in-out infinite alternate;
}
.bg-mesh::after {
  background: radial-gradient(circle at 70% 70%, var(--accent-3), transparent 60%);
  bottom: -12vw; right: -10vw;
  animation: float2 26s ease-in-out infinite alternate;
}
.blob {
  position: absolute;
  width: 45vw; height: 45vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .4;
  background: radial-gradient(circle at 50% 50%, var(--accent-2), transparent 60%);
  top: 30vh; left: 40vw;
  animation: float3 30s ease-in-out infinite alternate;
}
@keyframes float1 { to { transform: translate(8vw, 10vh) scale(1.15); } }
@keyframes float2 { to { transform: translate(-10vw, -6vh) scale(1.1); } }
@keyframes float3 { to { transform: translate(-6vw, 8vh) scale(1.2); } }

/* ---------- 布局容器 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- 导航 ---------- */
header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  font-weight: 700; font-size: 19px; letter-spacing: .2px;
  text-decoration: none; color: var(--text);
}
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad);
  display: grid; place-items: center;
  color: #fff; font-size: 16px; font-weight: 800;
  box-shadow: 0 6px 18px -6px var(--accent-1);
}
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  padding: 8px 14px;
  border-radius: 10px;
  transition: .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.theme-toggle {
  margin-left: 8px;
  width: 40px; height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: grid; place-items: center;
  transition: .2s;
  flex: none;
}
.theme-toggle:hover { border-color: var(--border-strong); background: var(--surface-2); }
.theme-toggle svg { width: 19px; height: 19px; }

/* 语言切换下拉框 */
.lang {
  margin-left: 8px;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0 30px 0 12px;
  height: 40px;
  cursor: pointer;
  flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9ab0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: .2s;
}
.lang:hover { border-color: var(--border-strong); background-color: var(--surface-2); }
.lang:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.lang option { background: var(--bg-2); color: var(--text); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 34px; text-align: center; position: relative; }
.hero .badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 12px; color: var(--muted);
  margin-bottom: 18px;
}
.hero .badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.hero h1 {
  font-size: clamp(30px, 5.2vw, 54px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.hero h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  font-size: clamp(13px, 1.7vw, 17px);
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto 20px;
}
.hero-cta { display: flex; gap: 11px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .25s ease, background .2s;
}
.btn-primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 14px 34px -14px var(--accent-1);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -14px var(--accent-1); }
.btn-ghost {
  background: var(--surface); color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-2px); }

/* ---------- 区块标题 ---------- */
.section { padding: 64px 0; }
.section-head { margin-bottom: 38px; }
.section-head .eyebrow {
  font-size: 13px; font-weight: 800; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent-2);
  margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; letter-spacing: -.5px; }
.section-head p { color: var(--muted); margin-top: 10px; max-width: 560px; }

/* ---------- 软件网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px 22px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.7,.3,1), border-color .3s, box-shadow .3s;
  --glow: var(--accent-1);
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%),
              color-mix(in srgb, var(--glow) 22%, transparent), transparent 60%);
  opacity: 0; transition: opacity .35s; pointer-events: none;
}
.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--glow) 55%, var(--border));
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--glow) 30%, transparent);
}
.card:hover::before { opacity: 1; }

/* 流光描边：旋转的渐变描边，静止时淡、悬停时亮，颜色跟随卡片主题 */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--angle),
    transparent 0deg,
    var(--glow) 35deg,
    var(--accent-2) 70deg,
    transparent 110deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: .4;
  transition: opacity .4s ease;
  pointer-events: none;
  animation: border-flow 4.5s linear infinite;
  z-index: 2;
}
.card:hover::after { opacity: 1; }
@keyframes border-flow { to { --angle: 360deg; } }

.card-top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.card-logo {
  width: 64px; height: 64px; border-radius: 17px;
  flex: none; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5);
}
.card-title { min-width: 0; }
.card-title h3 { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.card-title .cat {
  display: inline-block; margin-top: 5px;
  font-size: 12px; color: var(--muted);
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.card-desc { color: var(--muted); font-size: 14.5px; min-height: 44px; margin-bottom: 18px; }

.platforms { display: flex; gap: 7px; margin-bottom: 20px; flex-wrap: wrap; }
.pf {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  padding: 5px 10px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.pf svg { width: 13px; height: 13px; opacity: .85; }

.card-foot { display: flex; align-items: center; gap: 10px; }
.card-foot .ver { margin-left: auto; font-size: 12.5px; color: var(--faint); }
.btn-sm {
  padding: 9px 16px; border-radius: 11px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: .2s; display: inline-flex; align-items: center; gap: 6px;
}
.btn-sm.main { background: color-mix(in srgb, var(--glow) 18%, transparent); color: var(--text); border-color: color-mix(in srgb, var(--glow) 45%, transparent); }
.btn-sm.main:hover { background: color-mix(in srgb, var(--glow) 30%, transparent); }
.btn-sm.ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-sm.ghost:hover { color: var(--text); border-color: var(--border-strong); }
.btn-sm .btn-ico-inline { width: 16px; height: 16px; object-fit: contain; opacity: .9; }

.tag-soon {
  position: absolute; top: 16px; right: 16px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 4px 10px; border-radius: 999px;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent);
}
.tag-online {
  position: absolute; top: 16px; right: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 4px 10px; border-radius: 999px;
  color: #16a34a;
  background: color-mix(in srgb, #22c55e 16%, transparent);
  border: 1px solid color-mix(in srgb, #22c55e 45%, transparent);
}
.tag-online .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 color-mix(in srgb, #22c55e 60%, transparent);
  animation: online-pulse 1.6s ease-out infinite;
}
@keyframes online-pulse {
  0%   { box-shadow: 0 0 0 0   color-mix(in srgb, #22c55e 55%, transparent); }
  70%  { box-shadow: 0 0 0 6px color-mix(in srgb, #22c55e 0%,  transparent); }
  100% { box-shadow: 0 0 0 0   color-mix(in srgb, #22c55e 0%,  transparent); }
}

/* ---------- 关于 ---------- */
.about {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  backdrop-filter: blur(10px);
}
.about h2 { font-size: 26px; font-weight: 800; margin-bottom: 14px; }
.about p { color: var(--muted); margin-bottom: 14px; }
.about .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: center; }
.stat {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.stat .n { font-size: 30px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- 留言板 ---------- */
.msg-board {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.msg-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.msg-input, .msg-textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 13px 15px;
  transition: border-color .2s, background .2s;
  resize: vertical;
}
.msg-input:focus, .msg-textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-1) 55%, var(--border));
  background: var(--surface);
}
.msg-textarea { min-height: 84px; line-height: 1.6; }
.msg-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.msg-count { font-size: 13px; color: var(--faint); }
.msg-list { display: flex; flex-direction: column; gap: 12px; }
.msg-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.msg-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.msg-name { font-weight: 700; font-size: 14.5px; color: var(--text); }
.msg-time { font-size: 12px; color: var(--faint); }
.msg-content { color: var(--muted); font-size: 14.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.msg-empty, .msg-loading { color: var(--faint); font-size: 14px; text-align: center; padding: 22px 0; }
.msg-form .btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- 右侧悬浮留言入口 ---------- */
.float-msg {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: #fff;
}
.float-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--accent-1);
  border-radius: 16px 0 0 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  transition: transform .18s ease, background .18s ease;
}
.float-msg:hover .float-avatar { transform: scale(1.06); background: color-mix(in srgb, var(--accent-1) 88%, #fff 12%); }
.float-msg:active .float-avatar { transform: scale(.96); }
.float-bubble {
  position: absolute;
  right: 60px;
  white-space: nowrap;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  opacity: 1;
  transform: translateX(0);
  pointer-events: none;
  animation: float-bubble-pulse 2s ease-in-out infinite;
}
.float-bubble::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: var(--surface);
}
@keyframes float-bubble-pulse {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-4px); }
}

/* ---------- 留言模态窗口 ---------- */
.msg-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.msg-modal.open { display: flex; }
.msg-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.msg-modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: rgba(13,13,22,.96);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 26px 28px;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  animation: msg-pop .22s cubic-bezier(.2,.7,.3,1);
}
[data-theme="light"] .msg-modal-card { background: rgba(255,255,255,.96); }
@keyframes msg-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.msg-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.msg-modal-close:hover { background: var(--bg-2); color: var(--text); }
.msg-modal .msg-board {
  padding: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* ---------- 页脚 ---------- */
footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 40px 0 56px;
  color: var(--muted);
  font-size: 14px;
}
.foot-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; }
.foot-inner a { color: var(--muted); text-decoration: none; }
.foot-inner a:hover { color: var(--text); }
.foot-links { display: flex; gap: 20px; }

/* ---------- 滚动入场 ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .45s ease, transform .45s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .wrap { padding: 0 12px; }
  .nav-inner { padding: 14px 12px; }
  .about { grid-template-columns: 1fr; padding: 28px; }
  .hero { padding: 46px 0 30px; }
  .grid { grid-template-columns: 1fr; }
  .msg-board { padding: 22px 18px; }
  .msg-form-foot { flex-direction: column; align-items: stretch; }
  .msg-form-foot .btn { width: 100%; justify-content: center; }
  .float-avatar { width: 46px; height: 46px; border-radius: 14px 0 0 14px; }
  .float-bubble { display: none; }
}
@media (max-width: 380px) {
  .wrap { padding: 0 10px; }
  .nav-inner { padding: 14px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-mesh::before, .bg-mesh::after, .blob { animation: none; }
  .card::after { animation: none; opacity: .25; }
  .reveal { transition: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
