/* =========================================================
   小7和21都超可爱 · 统一样式（天蓝色主题）
   ========================================================= */

:root {
  --bg-1: #eef7ff;
  --bg-2: #d9ecfb;
  --card: #ffffff;
  --ink: #1d3a52;
  --ink-soft: #5a7d99;
  --accent: #2f9bd8;
  --accent-2: #57c2f5;
  --border: #cfe6f7;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(47, 155, 216, 0.14);
  --shadow-hover: 0 10px 28px rgba(47, 155, 216, 0.24);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ===== 顶部工具栏 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  max-width: 1080px;
  margin: 0 auto;
}

/* ----- 天气组件 ----- */
.weather-widget { padding: 12px 14px; min-width: 210px; }
.weather-main { display: flex; align-items: center; gap: 10px; }
.weather-icon { font-size: 34px; line-height: 1; }
.weather-city { font-weight: 700; font-size: 15px; }
.weather-temp { font-size: 22px; font-weight: 800; color: var(--accent); }
.weather-text { font-size: 12px; color: var(--ink-soft); }
.weather-note { margin-top: 6px; font-size: 11px; color: var(--ink-soft); }

/* ----- 音乐播放器 ----- */
.music-widget { padding: 12px 14px; min-width: 230px; }
.music-head { font-size: 13px; font-weight: 700; }
.music-track-name {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 4px 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music-controls { display: flex; align-items: center; gap: 10px; }
.music-time { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ===== 按钮 ===== */
.btn {
  border: none;
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 13px;
  background: #e3eef7;
  color: var(--ink);
  transition: transform .12s ease, background .2s ease;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* 难度选择按钮 */
.diff-label { font-size: 13px; color: var(--ink-soft); }
.diff-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 13px;
  transition: all .2s;
}
.diff-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}

/* ===== 主容器 ===== */
.container { max-width: 1080px; margin: 0 auto; padding: 8px 16px 32px; }

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 24px 0 20px;
}
.site-title {
  text-align: center;
  font-size: clamp(28px, 5.5vw, 52px);
  margin: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 1px;
}
.cat-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: var(--shadow);
  display: block;
  transition: transform .15s ease;
}
.avatar-link:hover .cat-avatar { transform: scale(1.08); }

.section { margin-top: 28px; }
.section-title {
  font-size: 20px;
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
}

/* ===== 相册轮播（16:9，居中，不那么宽） ===== */
.album { position: relative; max-width: 760px; margin: 0 auto; }
.album-viewport { overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.album-track { display: flex; transition: transform .5s ease; }
.album-slide { flex: 0 0 100%; aspect-ratio: 16 / 9; }
.album-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* CSS 自动裁剪适配 */
}
.album-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
  box-shadow: var(--shadow);
}
.album-arrow.prev { left: 10px; }
.album-arrow.next { right: 10px; }
.album-arrow:hover { background: #fff; }
.album-dots { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.album-dot {
  width: 9px; height: 9px;
  border: none; border-radius: 50%;
  background: #c9e5f7;
  transition: background .2s, transform .2s;
}
.album-dot.active { background: var(--accent); transform: scale(1.3); }

/* ===== 游戏入口 ===== */
.games-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 700;
  transition: transform .15s ease, box-shadow .2s ease;
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.game-emoji { font-size: 32px; }
.game-card small { font-weight: 400; color: var(--ink-soft); }

/* ===== 底部 ===== */
.footer { text-align: center; padding: 24px 16px 40px; color: var(--ink-soft); font-size: 13px; }
.footer-stats { display: flex; justify-content: center; gap: 8px; margin-bottom: 6px; }
.footer .dot { color: #a9c6dc; }
#busuanzi_value_site_pv, #busuanzi_value_site_uv { font-weight: 700; color: var(--accent); }

/* ===== 加载态 ===== */
.loading { color: var(--ink-soft); font-size: 13px; padding: 10px 4px; }

/* ===== 游戏页通用 ===== */
.game-page { max-width: 900px; margin: 0 auto; padding: 20px 16px 48px; }
.game-header { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.back-link { color: var(--accent); font-size: 14px; }
.back-link:hover { text-decoration: underline; }
.game-title { font-size: 26px; }
.game-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.game-status { text-align: center; font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--ink); }
.game-notice { text-align: center; font-size: 13px; color: #d9534f; min-height: 20px; margin: -4px 0 10px; }
.game-score { text-align: center; font-size: 14px; color: var(--ink-soft); margin-bottom: 12px; }
.game-tools { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.board-wrap { display: flex; justify-content: center; }
.board-canvas { max-width: 100%; height: auto; touch-action: none; border-radius: 8px; cursor: pointer; }

/* 21点专用 */
.cards-row { display: flex; flex-wrap: wrap; gap: 8px; min-height: 88px; justify-content: center; }
.card-mini {
  width: 62px; height: 86px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d5e6f2;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 18px;
}
.card-mini .suit { font-size: 20px; }
.card-mini.red { color: #d53a4e; }
.card-mini.black { color: #2b2b2b; }
.card-mini.back { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.hand-label { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 14px 0 6px; }
.hand-value { text-align: center; font-size: 15px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.bet-area { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.bet-area input {
  width: 110px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  text-align: center;
  outline: none;
}
.bet-area input:focus { border-color: var(--accent); }
.bet-chip {
  border: 1px solid var(--border);
  background: #eaf6ff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  transition: background .15s;
}
.bet-chip:hover { background: #d6ecfb; }
.bet-chip:disabled { opacity: .45; cursor: not-allowed; }
.game-message { text-align: center; font-size: 16px; font-weight: 700; color: var(--accent); min-height: 26px; margin: 10px 0; }
.credits-line { text-align: center; font-size: 15px; margin-bottom: 4px; }
.credits-line b { color: var(--accent); font-size: 20px; }

/* ===== 猫猫个人介绍页 ===== */
.cat-page { max-width: 720px; }
.cat-panel { text-align: center; }
.cat-photo {
  max-width: 100%;
  max-height: 62vh;
  width: auto;
  margin: 0 auto 18px;
  display: block;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: contain;
}
.cat-intro { text-align: left; font-size: 15px; line-height: 1.9; }
.cat-intro h2 { text-align: center; font-size: 22px; color: var(--accent); margin-bottom: 10px; }
.cat-intro p { margin-bottom: 6px; }
.cat-intro strong { color: var(--ink); }

/* ===== 扫雷 ===== */
.ms-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}
.ms-controls input {
  width: 56px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 13px;
  text-align: center;
  outline: none;
}
.ms-controls input:focus { border-color: var(--accent); }
.ms-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ms-presets .btn { font-size: 12px; padding: 5px 12px; }
#ms-flag-toggle.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
}
.ms-hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
}
.ms-wrap {
  display: block;
  overflow-x: auto;
  padding: 4px 0 8px;
}
.ms-board {
  display: grid;
  gap: 2px;
  margin: 0 auto;
  width: max-content;
  touch-action: manipulation;
}
.ms-cell {
  width: var(--cell, 34px);
  height: var(--cell, 34px);
  border: none;
  border-radius: 5px;
  padding: 0;
  background: #d6ecfb;
  color: #1d3a52;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background .1s;
}
.ms-cell:hover { background: #c3e2f7; }
.ms-cell.revealed {
  background: #f4faff;
  cursor: default;
  font-size: 14px;
}
.ms-cell.flagged { background: #ffe9c9; }
.ms-cell.mine { background: #ffd6d6; }
.ms-cell.n1 { color: #1e6fd9; }
.ms-cell.n2 { color: #1a8a3a; }
.ms-cell.n3 { color: #d23b3b; }
.ms-cell.n4 { color: #6a2fa0; }
.ms-cell.n5 { color: #a0522d; }
.ms-cell.n6 { color: #0f8a8a; }
.ms-cell.n7 { color: #333; }
.ms-cell.n8 { color: #777; }

/* ===== 占卜入口 ===== */
.fortune-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 640px;
  margin: 0 auto;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .topbar { flex-direction: column; }
  .weather-widget, .music-widget { width: 100%; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .fortune-grid { grid-template-columns: 1fr; }
  .news-date { display: none; }
  .title-row { gap: 10px; }
  .cat-avatar { width: 48px; height: 48px; border-width: 2px; }
  .site-title { font-size: 22px; letter-spacing: 0; }
}
