:root {
  --bg: #0a0c14;
  --panel: rgba(20, 24, 38, 0.78);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1ff;
  --muted: #8d95b8;
  --accent: #7c5cff;
  --accent-2: #00e0c6;
}
body.t-mint { --bg:#06120f; --accent:#34e0a1; --accent-2:#7cf0ff; }
body.t-sunset { --bg:#170a12; --accent:#ff6b9d; --accent-2:#ffc857; }

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  transition: background .4s ease;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: .55;
  pointer-events: none;
}

.nav {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(10, 12, 20, .72);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  background-color: rgba(20,18,24,.72);
}

.brand {
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}
.brand span {
  margin-left: 6px;
  font-weight: 500;
  font-size: 12px;
  color: var(--accent);
}

.links { display: flex; gap: 6px; margin-left: auto; }

.links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: .18s;
}
.links a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.links a.active {
  color: #0b0d17;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  font-weight: 700;
}

.chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { background: rgba(255,255,255,.09); }

.wrap {
  position: relative;
  z-index: 1;
  width: min(980px, 94vw);
  margin: 0 auto;
  padding: 34px 0 60px;
}

.hero { padding: 42px 0 26px; }
.hero h1 { margin: 0 0 10px; font-size: 32px; }
.clock {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 40px;
  letter-spacing: 3px;
  margin: 18px 0 0;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title { margin: 0 0 6px; font-size: 26px; }
.muted { color: var(--muted); font-size: 13px; margin: 0 0 18px; line-height: 1.7; }

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 8px;
}

.tile {
  display: block;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  color: var(--text);
  transition: transform .18s ease, border-color .18s ease, background .18s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--accent); }
.tile h2 { margin: 0 0 8px; font-size: 17px; }
.tile p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.tile .go { font-size: 12px; color: var(--accent); }
.tile.static { cursor: default; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  margin-bottom: 14px;
}

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.field input[type="color"] {
  width: 34px; height: 26px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: transparent;
}
.field input[type="range"] { width: 110px; accent-color: var(--accent); }

.btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: 13px;
  padding: 8px 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: .15s;
}
.btn:hover { background: rgba(255,255,255,.1); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #0b0d17;
  font-weight: 700;
}

.canvas-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #0f1320;
  line-height: 0;
}
#board { width: 100%; height: auto; touch-action: none; cursor: crosshair; display: block; }

.hud {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.hud b { color: var(--text); font-size: 16px; }
.hud .btn { margin-left: auto; }

.arena {
  position: relative;
  height: 420px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(124,92,255,.16), transparent 62%), #0d1018;
  overflow: hidden;
}

.target {
  position: absolute;
  font-size: 44px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: transform .12s ease;
  filter: drop-shadow(0 0 12px rgba(0,224,198,.45));
}
.target:active { transform: scale(.86); }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--muted);
  background: rgba(8,10,16,.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.overlay.hide { display: none; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* ---- 浏览器兼容层 ---- */
*{ -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
html{ -webkit-overflow-scrolling: touch; }
button,input,select,textarea{
  font-family: inherit; -webkit-appearance: none; appearance: none;
}
canvas{ display:block; max-width:100%; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))){
  .nav, .card, .tile { background-color: rgba(28,25,34,.92); }
}
@media (prefers-color-scheme: light){ html{ color-scheme: light dark; } }


/* ============ 手机/平板适配 ============ */
@media (max-width: 900px){
  .wrap { width: min(980px, 92vw); padding: 24px 0 44px; }
  .hero { padding: 26px 0 18px; }
  .hero h1 { font-size: 27px; }
  .clock { font-size: 34px; }
}
@media (max-width: 760px){
  .nav { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  .brand { font-size: 15px; }
  .links { order: 3; width: 100%; margin-left: 0; gap: 6px; }
  .links a { flex: 1 1 0; display: flex; align-items: center; justify-content: center;
             min-height: 44px; padding: 10px 6px; font-size: 13px; }
  .chip { min-height: 40px; padding: 9px 15px; }
  .wrap { padding: 16px 0 calc(40px + env(safe-area-inset-bottom)); }
  .hero { padding: 16px 0 12px; }
  .hero h1 { font-size: 23px; line-height: 1.32; }
  .clock { font-size: 28px; letter-spacing: 2px; margin-top: 12px; }
  .title { font-size: 20px; }
  .muted { font-size: 12.5px; }
  .grid { grid-template-columns: 1fr; gap: 10px; }
  .tile { padding: 16px; }
  .toolbar { gap: 8px; padding: 10px; border-radius: 12px; }
  .field { width: 100%; }
  .field input[type="range"] { width: 100%; }
  .field input[type="color"] { width: 44px; height: 34px; }
  .btn { min-height: 44px; padding: 11px 14px; font-size: 14px; }
  .btn, .chip { -webkit-tap-highlight-color: transparent; }
}
@media (max-width: 400px){
  .hero h1 { font-size: 20px; }
  .clock { font-size: 24px; letter-spacing: 1px; }
  .btn { font-size: 13px; padding: 10px 11px; }
  .links a { font-size: 12px; }
}

/* ============ 按钮细节：实心底 + 内描边，圆角处不漏底下的颜色 ============ */
.chip, .btn {
  background-color: #16192a;
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 1px 0 rgba(0,0,0,.35);
  transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.chip:hover, .btn:hover { background-color: #1e223a; }
.chip:active, .btn:active { transform: translateY(1px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.links a.active { box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

html, body { overflow-x: hidden; }
img, canvas, svg { max-width: 100%; }
.wrap { max-width: 100%; }

/* 画布/小游戏在手机上别超出屏宽 */
#board, #arena, canvas:not(#bg) { max-width: 100%; height: auto; touch-action: none; }

/* 首页主按钮 */
.cta-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
.cta{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:12px 22px;
     border-radius:14px;font-weight:800;font-size:15px;text-decoration:none;color:#0b0d17;
     background:linear-gradient(120deg,var(--accent),var(--accent-2));
     background-clip:padding-box;box-shadow:0 6px 22px rgba(124,92,255,.32)}
.cta.ghost{background:#16192a;color:var(--text);font-weight:600;
     box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
.cta:active{transform:translateY(1px)}
@media (max-width:760px){
  .cta-row{flex-direction:column}
  .cta{width:100%;min-height:52px;font-size:16px}
}

/* ===== 音乐角 ===== */
.music{margin:26px 0 10px;padding:16px;border:1px solid rgba(255,255,255,.09);border-radius:16px;
       background:rgba(20,24,38,.78)}
.m-title{margin:0 0 6px;font-size:17px}
.mp-now{display:flex;align-items:center;gap:12px;justify-content:space-between;flex-wrap:wrap;margin:8px 0 10px}
.mp-info{min-width:0;flex:1 1 200px;display:flex;flex-direction:column;gap:3px}
.mp-info b{font-size:15px;line-height:1.35;word-break:break-word}
.mp-info .muted{font-size:12px}
.mp-ctrl{display:flex;align-items:center;gap:8px}
.mp-btn{background:#16192a;border:1px solid rgba(255,255,255,.12);color:#eef1ff;border-radius:10px;
        min-width:44px;min-height:44px;font-size:13px;cursor:pointer;font-family:inherit}
.mp-btn.big{min-width:74px;font-weight:700;background:rgba(124,92,255,.22);border-color:#7c5cff}
.mp-btn:active{transform:translateY(1px)}
.mp-seek{display:flex;align-items:center;gap:8px;font-size:11.5px;color:#8d95b8}
.mp-seek input[type="range"]{flex:1 1 auto;min-width:0;accent-color:#7c5cff;height:4px}
.mp-seek .mp-vol{flex:0 0 84px}
.mp-list{list-style:none;margin:12px 0 0;padding:0;max-height:260px;overflow-y:auto;
         -webkit-overflow-scrolling:touch}
.mp-item{display:flex;gap:10px;align-items:center;padding:9px 8px;border-radius:10px;cursor:pointer}
.mp-item:hover,.mp-item.on{background:rgba(124,92,255,.14)}
.mp-item .mp-n{color:#8d95b8;font-size:12px;width:18px;text-align:right;flex:0 0 18px}
.mp-item .mp-t{display:flex;flex-direction:column;min-width:0}
.mp-item b{font-size:13.5px;font-weight:600;color:#eef1ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mp-item i{font-style:normal;font-size:11.5px;color:#8d95b8}
.mp-empty{color:#8d95b8;font-size:13px;padding:8px}
@media (max-width:760px){
  .music{padding:13px}
  .mp-ctrl{width:100%;justify-content:space-between}
  .mp-btn{flex:1 1 0}
  .mp-seek{flex-wrap:wrap}
  .mp-seek .mp-vol{flex:1 1 100%;margin-top:6px}
}

/* ===== 固定音乐播放器（全站常驻） ===== */
#mpRoot{position:fixed;left:0;right:0;bottom:0;z-index:9999;font-family:inherit}
.mp-local{display:flex;align-items:center;gap:8px;width:100%}
.mp-online{position:relative;width:100%}
.mp-close{position:absolute;right:0;top:-8px;min-width:26px;min-height:26px;min-width:26px;
  font-size:12px;border-radius:50%;z-index:2}
.mp-bar{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));
  background:rgba(14,16,26,.94);border-top:1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.mp-i{min-width:40px;min-height:40px;background:#1b1f31;border:1px solid rgba(255,255,255,.14);
  color:#eef1ff;border-radius:10px;font-size:15px;cursor:pointer;font-family:inherit;flex:0 0 auto}
.mp-i.go{background:rgba(124,92,255,.28);border-color:#7c5cff;min-width:46px}
.mp-i:active{transform:translateY(1px)}
.mp-mid{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;line-height:1.25}
.mp-mid b{font-size:13px;color:#eef1ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mp-mid span{font-size:11px;color:#8d95b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mp-btns{display:flex;gap:6px;flex:0 0 auto}
#mpBar{flex:0 0 96px;height:4px;accent-color:#7c5cff}
.mp-panel{display:none;max-height:56vh;overflow-y:auto;background:#0c0e16;
  border-top:1px solid rgba(255,255,255,.1);padding:10px 12px 14px}
.mp-panel.on{display:block}
#mpSearch{width:100%;background:#16192a;color:#eef1ff;border:1px solid rgba(255,255,255,.14);
  border-radius:10px;padding:10px 12px;font-size:14px;font-family:inherit;margin-bottom:8px}
.mp-hint{font-size:12px;color:#8d95b8;margin-bottom:6px}
.mp-list{list-style:none;margin:0;padding:0}
.mp-item{padding:9px 8px;border-radius:9px;cursor:pointer;display:flex;flex-direction:column;gap:2px;
  background:#111524}
.mp-item:hover,.mp-item.on{background:rgba(124,92,255,.16)}
.mp-item b{font-size:13.5px;color:#eef1ff;font-weight:600}
.mp-item i{font-style:normal;font-size:11.5px;color:#8d95b8}
.mp-empty{color:#8d95b8;font-size:13px;padding:8px}
body{padding-bottom:72px}
@media (max-width:520px){
  .mp-local{flex-wrap:wrap;row-gap:6px}
  .mp-mid{flex:1 1 calc(100% - 52px)}
  .mp-btns{order:2}
  #mpBar{order:3;flex:1 1 100%;height:6px}
  .mp-mid b{font-size:12.5px}
  .mp-mid span{font-size:10.5px}
}

.mp-tabs{display:flex;gap:8px;margin-bottom:8px}
.mp-tabs button{flex:1 1 0;min-height:38px;background:#16192a;border:1px solid rgba(255,255,255,.12);
  color:#cbc6dd;border-radius:10px;font-size:13px;font-family:inherit;cursor:pointer}
.mp-tabs button.on{background:rgba(124,92,255,.25);border-color:#7c5cff;color:#fff}
.mp-row{display:flex;gap:8px;margin-bottom:8px}
.mp-row input{flex:1 1 auto;min-width:0}
.mp-frame{margin-top:10px}
.mp-frame iframe{width:100%;border-radius:10px;border:1px solid rgba(255,255,255,.12)}

.mp-online{position:absolute;left:-9999px;top:0;width:1px;height:1px;overflow:hidden;opacity:0}
