/* ===== 引入 Gunar 字体 ===== */
@font-face {
  font-family: 'Gunar';
  src: url('Gunar.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===== 核心变量 ===== */
:root {
  --bg: #f7f8fa; 
  --fg: #1f2328; 
  --muted: #6b7280; 
  --line: #e5e7eb;
  --link: #1a73e8; 
  --card-bg: rgba(255, 255, 255, 0.85); 
  --box-bg: #fafafa;
  --glow: rgba(26, 115, 232, 0.15);
  --border-gradient: conic-gradient(from 0deg, var(--line) 0%, var(--link) 25%, var(--line) 50%, var(--link) 75%, var(--line) 100%);
  --font-stack: 'Gunar', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212; 
    --fg: #e5e7eb; 
    --muted: #9ca3af; 
    --line: #374151;
    --link: #60a5fa; 
    --card-bg: rgba(31, 41, 55, 0.85); 
    --box-bg: #111827;
    --glow: rgba(96, 165, 250, 0.15);
    --border-gradient: conic-gradient(from 0deg, var(--line) 0%, var(--link) 25%, var(--line) 50%, var(--link) 75%, var(--line) 100%);
  }
}

/* ===== 基础排版 ===== */
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg); line-height: 1.75;
  font-family: var(--font-stack);
  -webkit-user-select: none; user-select: none; 
  transition: background-color .3s, color .3s;
  display: flex; justify-content: center; min-height: 100vh; overflow-x: hidden;
}
.wrap { width: 100%; max-width: 560px; padding: 24px 16px 48px; }
h1 { font-size: 22px; font-weight: 600; text-align: center; margin: 8px 0 20px; letter-spacing: .5px; }

/* ===== 0. 主题颜色选择器 ===== */
.color-picker { position: fixed; top: 20px; right: 20px; z-index: 10000; }
.color-toggle {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--link); cursor: pointer;
  border: 3px solid var(--card-bg);
  box-shadow: 0 0 0 1px var(--line), 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}
/* 彩虹专属右上角圆点 */
.color-toggle.rainbow-theme {
  background: conic-gradient(from 0deg, #ff0000, #ffa500, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}
.color-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 1px var(--link), 0 4px 12px rgba(0,0,0,0.15);
}
.color-options {
  position: absolute; top: 100%; right: 0; margin-top: 12px; padding: 10px;
  background: var(--card-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 20px; box-shadow: 0 8px 30px rgba(0,0,0,0.1), 0 0 0 1px var(--line);
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0; pointer-events: none; transform: translateY(-10px) scale(0.95);
  transform-origin: top right; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.color-options.show { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }

.color-item {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; 
  transition: all 0.2s;
  box-sizing: border-box;
}
.color-item:hover { transform: scale(1.15); border-color: rgba(128,128,128,0.3); }
.color-item.rainbow-bg {
  background: conic-gradient(from 0deg, #ff0000, #ffa500, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000) border-box;
}
.color-item.active {
  border-color: var(--fg);
  transform: scale(1.1);
}

/* ===== 1. 入场动画 ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeUp .8s cubic-bezier(0.16, 1, 0.3, 1) both; }
.d-1 { animation-delay: .1s; } .d-2 { animation-delay: .2s; } .d-3 { animation-delay: .3s; } .d-4 { animation-delay: .4s; }

/* ===== 2. 流光边框 ===== */
.card-wrapper { position: relative; border-radius: 16px; padding: 2px; overflow: hidden; isolation: isolate; }
.card-wrapper::before {
  content: ''; position: absolute; top: 50%; left: 50%; width: 300%; padding-bottom: 300%; 
  background: var(--border-gradient); animation: rotateBorder 4s linear infinite; z-index: -1; 
}
@keyframes rotateBorder { 
  0% { transform: translate(-50%, -50%) rotate(0deg); } 
  100% { transform: translate(-50%, -50%) rotate(360deg); } 
}
.card {
  position: relative; background: var(--card-bg); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); border-radius: 14px; padding: 20px;
  overflow: hidden; transition: background-color .3s; z-index: 1; 
}

/* ===== 光晕跟随层 ===== */
.card::before {
  content: ''; position: absolute; top: var(--mouse-y, 50%); left: var(--mouse-x, 50%);
  width: 400px; height: 400px; background: radial-gradient(circle, var(--glow) 0%, transparent 60%);
  transform: translate(-50%, -50%); pointer-events: none; z-index: 0; transition: opacity .3s, background .3s;
}
.card > * { position: relative; z-index: 1; }

/* ===== 内容与图标排版 ===== */
.info { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.info-item { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.icon { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; }

.entry {
  color: var(--link); text-decoration: underline; text-decoration-color: rgba(128,128,128,.3);
  text-underline-offset: 3px; font-weight: 500; word-break: break-all; transition: color 0.3s;
}
hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; opacity: .6; }
.section { margin-top: 20px; }

/* ===== 3. 二维码微动效 ===== */
.imgbox {
  background: var(--box-bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  text-align: center; margin-bottom: 12px; cursor: pointer;
  transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .2s, border-color .3s;
  touch-action: manipulation; 
}
.imgbox:hover, .imgbox:active { 
  transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,.1); border-color: var(--link); 
}
.imgbox img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 6px; pointer-events: none; }
.alipay-row { display: flex; gap: 10px; align-items: flex-start; }
.alipay-row .imgbox { flex: 1 1 0; min-width: 0; margin-bottom: 0; }
footer { text-align: center; font-size: 13px; color: var(--muted); margin-top: 24px; font-weight: 500; }

/* ===== 4. 打击特效 ===== */
.touch-effect {
  position: fixed; width: 120px; height: 120px; pointer-events: none; z-index: 9999;
  background: url('Click.png') no-repeat; background-size: 400% 400%;
  transform: translate(-50%, -50%); animation: play .6s step-end forwards;
}
@keyframes play {
  0% { background-position: 0% 0%; } 6.25% { background-position: 33.33% 0%; }
  12.5% { background-position: 66.66% 0%; } 18.75% { background-position: 100% 0%; }
  25% { background-position: 0% 33.33%; } 31.25% { background-position: 33.33% 33.33%; }
  37.5% { background-position: 66.66% 33.33%; } 43.75% { background-position: 100% 33.33%; }
  50% { background-position: 0% 66.66%; } 56.25% { background-position: 33.33% 66.66%; }
  62.5% { background-position: 66.66% 66.66%; } 68.75% { background-position: 100% 66.66%; }
  75% { background-position: 0% 100%; } 81.25% { background-position: 33.33% 100%; }
  87.5% { background-position: 66.66% 100%; } 93.75% { background-position: 100% 100%; }
  100% { background-position: 100% 100%; opacity: 0; }
}

/* ===== 5. 双击放大灯箱 ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 92vw; max-height: 92vh; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  transform: scale(0.85); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.lightbox.active img { transform: scale(1); }