/* =========================================================
   小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: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  max-width: 1080px;
  margin: 0 auto;
  pointer-events: none;
}
.topbar > .weather-widget,
.topbar > .music-widget { pointer-events: auto; }

/* ----- 天气组件 ----- */
.weather-widget { padding: 12px 14px; min-width: 210px; }
.weather-main { display: flex; align-items: center; gap: 10px; }

/* ----- 悬停 / 轻点提示小窗 ----- */
.weather-widget, .music-widget { position: relative; }

.tip-pop {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 270px;
  padding: 11px 13px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(29, 58, 82, 0.13);
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  pointer-events: none;
  z-index: 60;
}
.tip-pop::before {
  content: "";
  position: absolute;
  top: -5.5px;
  left: 18px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
/* 右侧的播放器，小窗和箭头都右对齐，免得戳出屏幕 */
.music-widget .tip-pop { left: auto; right: 0; }
.music-widget .tip-pop::before { left: auto; right: 18px; }

.tip-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--accent);
  margin-bottom: 4px;
}
.tip-row { display: block; }
.tip-row b { font-weight: 600; color: var(--ink); }
.tip-note {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  color: #8aa7bd;
}

.weather-widget:hover .tip-pop,
.music-widget:hover .tip-pop,
.tip-pop.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 触屏设备上别让 hover 卡住，只认点击 */
@media (hover: none) {
  .weather-widget:hover .tip-pop,
  .music-widget:hover .tip-pop {
    opacity: 0; visibility: hidden; transform: translateY(-5px);
  }
  .weather-widget .tip-pop.is-open,
  .music-widget .tip-pop.is-open {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
}

@media (max-width: 560px) {
  .tip-pop { width: min(270px, calc(100vw - 40px)); }
}.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;
}
/* 占位头像：小7 奶牛猫黑白斑 / 21 纯黑 */
span.cat-avatar {
  display: grid;
  place-items: center;
  font-weight: 800;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
}
.avatar-7 {
  font-size: 27px;
  color: #fff;
  background-color: #17171c;
  background-image:
    radial-gradient(circle 0.46em at 24% 26%, #fff 99%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 0.28em at 37% 17%, #fff 99%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 0.40em at 78% 44%, #fff 99%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 0.26em at 86% 58%, #fff 99%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 0.30em at 17% 72%, #fff 99%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(circle 0.42em at 62% 80%, #fff 99%, rgba(255, 255, 255, 0) 100%);
  -webkit-text-stroke: 2.5px #111116;
  paint-order: stroke fill;
}
.avatar-21 {
  font-size: 21px;
  letter-spacing: -0.5px;
  color: #fff;
  background: #0c0c10;
  -webkit-text-stroke: 1.2px #fff;
  text-shadow: 0 0 7px rgba(255, 255, 255, 0.5);
}
.avatar-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.avatar-name {
  font-size: 11.5px;
  line-height: 1;
  letter-spacing: .6px;
  color: var(--ink-soft);
  opacity: .78;
  transition: color .18s ease, opacity .18s ease;
}
.avatar-link:hover .avatar-name { color: var(--accent); opacity: 1; }
.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);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 12px 30px rgba(47, 155, 216, 0.18);
}
.album-track { display: flex; transition: transform .5s ease; }
.album-slide { flex: 0 0 100%; display: flex; flex-direction: column; background: #fff; }
.album-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
  display: grid;
  place-items: center;
}
.album-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* 完整显示，留白边，不裁切 */
}
.album-caption {
  background: #f6fbfe;
  border-top: 1px solid #e8f3fb;
  padding: 11px 16px 13px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-soft);
  min-height: 42px;
}
.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); }

/* ===== 大标题下的快捷跳转 ===== */
.quick-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  max-width: 760px;
  margin: 18px auto 2px;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}
.quick-nav::-webkit-scrollbar { display: none; }
.quick-nav a {
  flex: 0 0 auto;
  font-size: 12.5px;
  padding: 6px 15px;
  border-radius: 999px;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color .18s ease, transform .18s ease;
}
.quick-nav a:nth-child(1) { background: #dceefb; }
.quick-nav a:nth-child(2) { background: #ddf2ea; }
.quick-nav a:nth-child(3) { background: #f7e9cf; }
.quick-nav a:hover { color: var(--accent); transform: translateY(-1px); }
@media (max-width: 620px) {
  .quick-nav { justify-content: flex-start; }
}

/* 锚点跳转时避开吸顶工具栏 */
html { scroll-behavior: smooth; }
.section { scroll-margin-top: 116px; }

/* ===== 游戏入口 ===== */
.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; }

/* ===== 个人随笔 ===== */
.essay-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}
.essay-item {
  display: block;
  padding: 15px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease;
}
.essay-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-2);
}
.essay-title { font-size: 15px; font-weight: 700; }
.essay-meta { font-size: 11.5px; color: var(--ink-soft); margin-top: 5px; }
.essay-summary { font-size: 13px; color: var(--ink-soft); line-height: 1.7; margin-top: 7px; }
.essay-empty {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 22px 12px;
  background: #f6fbfe;
  border: 1px dashed var(--border);
  border-radius: 14px;
}

/* ===== 近期感兴趣的事（滚动） ===== */
.ticker-box { max-width: 760px; margin: 24px auto 0; }
.ticker-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  padding-left: 2px;
}
.ticker {
  position: relative;
  height: 86px;
  overflow: hidden;
  background: #f6fbfe;
  border: 1px solid var(--border);
  border-radius: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ticker-track {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  gap: 30px;
  white-space: nowrap;
  will-change: transform;
}
.ticker-row1 { top: 16px; animation: tickerScroll 30s linear infinite; }
.ticker-row2 { top: 50px; animation: tickerScroll 40s linear infinite; animation-delay: -12s; }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-item { font-size: 13px; color: var(--ink-soft); display: inline-flex; align-items: center; }
.ticker-item::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  margin-right: 9px;
  flex: 0 0 auto;
}
@media (prefers-reduced-motion: reduce) {
  .ticker-row1, .ticker-row2 { animation: none; }
}

/* ===== 随笔详情页 ===== */
.essay-page { max-width: 720px; margin: 0 auto; padding: 24px 16px 60px; }
.essay-h1 { font-size: 25px; line-height: 1.45; margin: 16px 0 8px; letter-spacing: -0.2px; }
.essay-page-meta {
  font-size: 12px;
  color: var(--ink-soft);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.essay-body { font-size: 15px; line-height: 2; color: var(--ink); }
.essay-body p { margin-bottom: 16px; }
.essay-body h2 { font-size: 17px; margin: 26px 0 10px; color: var(--accent); }
.essay-body h3 { font-size: 15px; margin: 22px 0 8px; }
.essay-body img { max-width: 100%; border-radius: 12px; margin: 14px 0; }
.essay-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 14px;
  color: var(--ink-soft);
  margin: 16px 0;
}
.essay-body ul, .essay-body ol { margin: 0 0 16px 22px; }
.essay-body li { margin-bottom: 6px; }
.essay-body code { background: #f0f7fc; border-radius: 5px; padding: 1px 6px; font-size: 13px; }

/* ===== 游戏页通用 ===== */
.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-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-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 22px;
}
.cat-meta span {
  font-size: 12px;
  color: var(--ink-soft);
  background: #f5fbff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  line-height: 1.6;
}
.cat-meta span.warn {
  color: #b8791f;
  background: #fffaf0;
  border-color: #f0dfc0;
}
.cat-intro h3 {
  font-size: 13.5px;
  color: var(--accent);
  letter-spacing: .5px;
  margin: 20px 0 8px;
}
.cat-intro p { margin-bottom: 10px; }
.cat-intro p { margin-bottom: 6px; }
.cat-intro strong { color: var(--ink); }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .topbar {
    position: static;
    pointer-events: auto;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 0;
  }
  .topbar > .music-widget { order: -1; }   /* 手机上播放器排在天气前面 */
  .section { scroll-margin-top: 16px; }
  body { padding-top: 0 !important; }
  .weather-widget, .music-widget { width: 100%; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .title-row { gap: 10px; }
  .cat-avatar { width: 48px; height: 48px; border-width: 2px; }
  .avatar-name { font-size: 10px; }
  .avatar-7 { font-size: 18px; -webkit-text-stroke-width: 1.6px; }
  .avatar-21 { font-size: 14px; -webkit-text-stroke-width: 0.8px; }
  .site-title { font-size: 22px; letter-spacing: 0; }
}
