/* ============================================================================
 * nav-start · 起始页样式
 * 视觉语言取自 chengicli 博客（Butterfly 改版）：
 *   主题色 #FF1493、玻璃卡片 rgba(250,250,250,.97) / rgba(28,28,28,.97)、
 *   1px 灰描边、18px 圆角、霞鹜文楷、洋红斜条纹滚动条。
 * ========================================================================== */

:root {
  --theme-color: #FF1493;
  --ink: #1F2D3D;
  --muted: rgba(31, 45, 61, .58);
  --card: rgba(250, 250, 250, .97);
  --border-color: rgba(169, 169, 169, .7);
  --border: 1px solid var(--border-color);
  --chip: rgba(255, 20, 147, .11);
  --chip: color-mix(in srgb, var(--theme-color) 11%, transparent);
  --chip-strong: rgba(255, 20, 147, .2);
  --chip-strong: color-mix(in srgb, var(--theme-color) 20%, transparent);
  --accent-soft: rgba(255, 20, 147, .45);
  --accent-soft: color-mix(in srgb, var(--theme-color) 45%, transparent);
  --card-shadow: 0 2px 10px rgba(7, 17, 27, .07);
  --font: 'LXGW WenKai Screen', -apple-system, BlinkMacSystemFont, 'Segoe UI',
          'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --radius-card: 16px;
}

html[data-theme="dark"] {
  --ink: rgba(255, 255, 255, .88);
  --muted: rgba(255, 255, 255, .56);
  --card: rgba(28, 28, 28, .97);
  --border-color: rgba(169, 169, 169, .38);
  --card-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  /* 纵向 flex：内容少时页脚贴视口底部，内容长时跟着内容走 */
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15px;
  color: #fff;
  background: #1a1a1a;
  overflow-x: hidden;
  /* 页面内容禁止选中，输入框单独放开（见下方规则） */
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

input,
textarea,
select,
[contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

/* ---------- 背景壁纸 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image: url("/Background-wallpaper/computer-Daytime-background.webp");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.03);
  transition: filter .7s ease;
}
.bg-mask {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: linear-gradient(180deg,
      rgba(0, 0, 0, .42) 0%,
      rgba(0, 0, 0, .20) 32%,
      rgba(0, 0, 0, .26) 64%,
      rgba(0, 0, 0, .55) 100%);
  transition: background .7s ease;
}
html[data-theme="dark"] .bg {
  background-image: url("/Background-wallpaper/computer-Night-background.webp");
  filter: none;
}
html[data-theme="dark"] .bg-mask {
  background: linear-gradient(180deg,
      rgba(0, 0, 0, .35) 0%,
      rgba(0, 0, 0, .16) 40%,
      rgba(0, 0, 0, .48) 100%);
}
/* 手机壁纸跟博客一致：宽 ≤768px 换竖图 */
@media (max-width: 768px) {
  .bg { background-image: url("/Background-wallpaper/phone-Daytime-background.webp"); }
  html[data-theme="dark"] .bg { background-image: url("/Background-wallpaper/phone-Night-background.webp"); }
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  transition: background .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
}
.topbar.is-stuck {
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 rgba(128, 128, 128, .18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}
.brand-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .6), 0 6px 18px rgba(0, 0, 0, .28);
  transition: transform .35s ease, box-shadow .35s ease;
}
.brand:hover .brand-avatar {
  transform: rotate(-6deg) scale(1.05);
  box-shadow: 0 0 0 2px var(--theme-color), 0 0 18px color-mix(in srgb, var(--theme-color) 65%, transparent);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.brand-text strong {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: .6px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
}
.brand-text em {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 1.6px;
  opacity: .74;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .4);
}
.topbar.is-stuck .brand-text strong,
.topbar.is-stuck .brand-text em { color: var(--ink); text-shadow: none; }
.topbar.is-stuck .brand-avatar { box-shadow: 0 0 0 2px rgba(128, 128, 128, .35); }

.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  transition: background .28s ease, border-color .28s ease, transform .28s ease, color .28s ease;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, .3);
  border-color: rgba(255, 255, 255, .55);
  transform: translateY(-1px);
}
.topbar.is-stuck .icon-btn {
  color: var(--ink);
  background: rgba(128, 128, 128, .1);
  border-color: rgba(128, 128, 128, .3);
}
.topbar.is-stuck .icon-btn:hover { background: rgba(128, 128, 128, .2); }
.ico { width: 19px; height: 19px; display: block; }

.ico-sun { display: block; }
.ico-moon { display: none; }
html[data-theme="dark"] .ico-sun { display: none; }
html[data-theme="dark"] .ico-moon { display: block; }

/* ---------- 主体 ---------- */
.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) 40px;
}

/* hero：问候 + 大时钟 + 打字副标题（对应博客首页的站点名 / subtitle） */
.hero {
  padding-top: clamp(24px, 6vh, 62px);
  text-align: center;
  color: #fff;
}
.greet {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .42);
}
.clock {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  font-size: clamp(3.1rem, 9vw, 5.3rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 30px rgba(0, 0, 0, .45);
}
.clock-sec {
  margin-left: -2px;
  font-size: .4em;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--theme-color);
  text-shadow: 0 0 16px color-mix(in srgb, var(--theme-color) 70%, transparent);
}
.date {
  margin: 12px 0 0;
  font-size: 13.5px;
  letter-spacing: 1.7px;
  opacity: .9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}
.tagline {
  margin: 10px 0 0;
  min-height: 1.7em;
  font-size: 13.5px;
  letter-spacing: .5px;
  opacity: .92;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -.14em;
  border-radius: 2px;
  background: var(--theme-color);
  box-shadow: 0 0 8px var(--theme-color);
  animation: blink 1s steps(1, end) infinite;
}

/* ---------- 搜索 ---------- */
.search-area {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: clamp(22px, 3.4vh, 34px) auto clamp(34px, 6vh, 54px);
}
.search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 7px 7px 9px;
  background: var(--card);
  border: var(--border);
  border-radius: 999px;
  box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .55), var(--card-shadow);
  transition: box-shadow .3s ease, border-color .3s ease, transform .3s ease;
}
.search:focus-within {
  border-color: color-mix(in srgb, var(--theme-color) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-color) 14%, transparent),
              0 20px 46px -26px rgba(0, 0, 0, .6);
  transform: translateY(-1px);
}
.engine {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: 40px;
  padding: 0 11px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--theme-color);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  transition: background .25s ease;
}
.engine:hover { background: var(--chip-strong); }
.engine .ico { width: 14px; height: 14px; opacity: .9; }

.search-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}
.search-input::placeholder { color: var(--muted); opacity: .85; }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--theme-color);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--theme-color) 75%, transparent);
  transition: transform .25s ease, background .25s ease;
}
.search-go:hover {
  transform: scale(1.06);
  background: color-mix(in srgb, var(--theme-color) 86%, #000);
}

.engine-menu {
  position: absolute;
  top: 64px;
  left: 0;
  z-index: 30;
  min-width: 172px;
  padding: 6px;
  background: var(--card);
  border: var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.engine-menu[hidden] { display: none; }
.engine-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.engine-menu button:hover { background: var(--chip); }
.engine-menu button[aria-selected="true"] {
  color: var(--theme-color);
  font-weight: 700;
  background: color-mix(in srgb, var(--theme-color) 9%, transparent);
}
.engine-menu .tick { font-size: 12px; opacity: 0; }
.engine-menu button[aria-selected="true"] .tick { opacity: 1; }

.hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: .8px;
  color: rgba(255, 255, 255, .74);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}
kbd {
  display: inline-block;
  min-width: 19px;
  padding: 1px 5px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 5px;
  background: rgba(255, 255, 255, .14);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

/* ---------- 站点分组 ---------- */
.groups { display: flex; flex-direction: column; gap: clamp(26px, 4vh, 40px); }

.group-head {
  display: flex;
  align-items: baseline;
  /* 编辑模式下标题右边多了「编辑分组 / ＋添加 / ×」，窄屏放不下时允许整组按钮换行，
     否则最右侧的 × 会被挤出容器边界被裁掉 */
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
}
/* 分组操作按钮整体成组，空间不足时一起换行，不会被拆散 */
.group-ops {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  flex: none;
}
.group-title {
  position: relative;
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
.group-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -11px;
  width: 44px;
  height: 3px;
  border-radius: 3px;
  background: var(--theme-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--theme-color) 65%, transparent);
}
.group-desc {
  min-width: 0;
  font-size: 12px;
  letter-spacing: .4px;
  color: rgba(255, 255, 255, .7);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-count {
  flex: none;
  margin-left: auto;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(0, 0, 0, .26);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

/* 卡片：与博客 nav 页同源的紧凑小卡 */
.site {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  color: var(--ink);
  text-decoration: none;
  opacity: 0;
  animation: rise .5s cubic-bezier(.22, .68, .36, 1) forwards;
  animation-delay: calc(var(--i, 0) * 26ms);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease,
              background-color .3s ease, color .3s ease;
}
.site:hover {
  transform: translateY(-4px);
  border-color: var(--accent-soft);
  box-shadow: 0 14px 26px -18px var(--accent-soft),
              0 3px 10px -8px rgba(7, 17, 27, .3);
}
.site:active { transform: translateY(-1px); }

/* 图标：直接露出站点自己的 logo，不套圆形底板
 * 2026-11-24：上一版给每个图标垫了灰底圆盘 + 2px 外圈描边，
 * 结果是「圆环 + 小图标」两层视觉叠在一起，反而显脏。
 * 现在去掉底板/描边/内缩，图标本身铺满 38px 的占位框。 */
.site-icon {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
}
.site-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* 取不到图标时的首字母兜底：没有底板了，靠加粗 + 主题色站住位置 */
.site-initial {
  display: none;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  color: var(--theme-color);
}
.site-icon.is-broken img { display: none; }
.site-icon.is-broken .site-initial { display: block; }

.site-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}
.site-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .25s ease;
}
.site:hover .site-name { color: var(--theme-color); }
.site-note {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 页脚 ---------- */
/* ---------- 页脚（对齐博客：站点运行 / 恋爱计时 / © / 备案） ---------- */
.footer {
  flex: none;
  margin: 46px auto 26px;
  text-align: center;
  color: rgba(255, 255, 255, .66);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}
.ft-line {
  margin: 0;
  line-height: 1.9;
  letter-spacing: .6px;
}
.ft-meta {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .82);
}
.ft-meta b {
  margin: 0 1px;
  color: var(--theme-color);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ft-flower {
  margin: 0 6px;
  font-size: 11px;
  opacity: .72;
}
.ft-copy {
  margin-top: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .6);
}
.ft-dot { margin: 0 5px; opacity: .5; }
.ft-copy a.ft-icp {
  color: inherit;
  text-decoration: none;
  border-bottom: 0;
  transition: color .2s ease;
}
.ft-copy a.ft-icp:hover { color: var(--theme-color); }

/* 备案徽章：ICP 是彩色官方徽标，公安是警徽，都用背景图（不走 img，避免被懒加载替换） */
.ft-icp-icon,
.ft-police-icon {
  display: inline-block;
  width: .95em;
  height: .95em;
  margin-right: .3em;
  vertical-align: -.12em;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}
.ft-icp-icon { background-image: url("/assets/badge/icp-mii.png"); }
.ft-police-icon { background-image: url("/assets/badge/beian.png"); }

/* 爱心怦怦跳：心形 path 裁切 + 9 根彩色柱子依次弹起（同博客） */
.ft-love-heart {
  display: inline-block;
  width: 30px;
  height: 27px;
  margin-left: 8px;
  padding: 0;
  vertical-align: -6px;
  overflow: visible;
  pointer-events: none;
}
.ft-love-clip { clip-path: url(#ft-love-clip); }
.ft-love-base { fill: url(#ft-love-grad); }
.ft-love-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation-duration: 4s;
  animation-iteration-count: infinite;
  animation-timing-function: cubic-bezier(.4, 0, .2, 1);
}
.ft-love-bar.b1 { fill: #ff4d4d; animation-name: ft-love-bar1; animation-delay: 0s; }
.ft-love-bar.b2 { fill: #40e0d0; animation-name: ft-love-bar2; animation-delay: .05s; }
.ft-love-bar.b3 { fill: #e9967a; animation-name: ft-love-bar3; animation-delay: .1s; }
.ft-love-bar.b4 { fill: #ff1493; animation-name: ft-love-bar4; animation-delay: .15s; }
.ft-love-bar.b5 { fill: #ffd700; animation-name: ft-love-bar5; animation-delay: .2s; }
.ft-love-bar.b6 { fill: #ff1493; animation-name: ft-love-bar6; animation-delay: .25s; }
.ft-love-bar.b7 { fill: #e9967a; animation-name: ft-love-bar7; animation-delay: .3s; }
.ft-love-bar.b8 { fill: #40e0d0; animation-name: ft-love-bar8; animation-delay: .35s; }
.ft-love-bar.b9 { fill: #ff4d4d; animation-name: ft-love-bar9; animation-delay: .4s; }

@keyframes ft-love-bar1 {
  0%, 12% { transform: scaleY(.18); }
  30%, 72% { transform: scaleY(.3); }
  90%, 100% { transform: scaleY(.18); }
}
@keyframes ft-love-bar2 {
  0%, 12% { transform: scaleY(.18); }
  30%, 72% { transform: scaleY(.62); }
  90%, 100% { transform: scaleY(.18); }
}
@keyframes ft-love-bar3 {
  0%, 12% { transform: scaleY(.18); }
  30%, 72% { transform: scaleY(.8); }
  90%, 100% { transform: scaleY(.18); }
}
@keyframes ft-love-bar4 {
  0%, 12% { transform: scaleY(.18); }
  30%, 72% { transform: scaleY(.9); }
  90%, 100% { transform: scaleY(.18); }
}
@keyframes ft-love-bar5 {
  0%, 12% { transform: scaleY(.18); }
  30%, 72% { transform: scaleY(1); }
  90%, 100% { transform: scaleY(.18); }
}
@keyframes ft-love-bar6 {
  0%, 12% { transform: scaleY(.18); }
  30%, 72% { transform: scaleY(.9); }
  90%, 100% { transform: scaleY(.18); }
}
@keyframes ft-love-bar7 {
  0%, 12% { transform: scaleY(.18); }
  30%, 72% { transform: scaleY(.8); }
  90%, 100% { transform: scaleY(.18); }
}
@keyframes ft-love-bar8 {
  0%, 12% { transform: scaleY(.18); }
  30%, 72% { transform: scaleY(.62); }
  90%, 100% { transform: scaleY(.18); }
}
@keyframes ft-love-bar9 {
  0%, 12% { transform: scaleY(.18); }
  30%, 72% { transform: scaleY(.3); }
  90%, 100% { transform: scaleY(.18); }
}

@media (max-width: 600px) {
  .ft-love-heart {
    width: 24px;
    height: 21.6px;
    margin-left: 6px;
    vertical-align: -5px;
  }
  .ft-meta { font-size: 12px; }
  .ft-copy { font-size: 11px; line-height: 1.9; }
  .ft-flower { margin: 0 3px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ft-love-bar { animation: none !important; transform: scaleY(.62); }
}

/* ---------- 滚动条 / 选中色（博客同款洋红斜条纹） ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track {
  background-color: color-mix(in srgb, var(--theme-color) 18%, transparent);
  border-radius: 2em;
}
::-webkit-scrollbar-thumb {
  background-color: var(--theme-color);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, .45) 0 9px,
    rgba(0, 0, 0, .2) 9px 18px
  );
  border-radius: 2em;
}
::selection { color: #fff; background: var(--theme-color); }

/* 键盘焦点环只给按钮/链接；搜索输入框的焦点反馈交给整个胶囊的高亮，
   否则 input 上会多出一个方框（:focus-visible 与 .search-input 同权重，
   写在后面会盖掉上面的 outline: none）。 */
:focus-visible:not(.search-input) {
  outline: 2px solid var(--theme-color);
  outline-offset: 3px;
}
.search-input:focus,
.search-input:focus-visible { outline: none; }

@keyframes rise {
  from { opacity: 0; translate: 0 14px; }
  to   { opacity: 1; translate: 0 0; }
}
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .group-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-top: 20px; }
  .group-desc { display: none; }
}
@media (max-width: 560px) {
  .brand-text em { display: none; }
  .brand-text strong { font-size: 14px; }
  .brand-avatar { width: 34px; height: 34px; }
  .icon-btn { width: 37px; height: 37px; }

  .clock { font-size: clamp(2.9rem, 16vw, 4rem); }
  .greet { font-size: 12.5px; letter-spacing: 1.5px; }
  .date { font-size: 12px; letter-spacing: 1.2px; }
  .tagline { font-size: 12.5px; }

  .search-area { margin-bottom: 34px; }
  .engine { padding: 0 9px 0 12px; font-size: 12.5px; }
  .search-input { font-size: 16px; } /* ≥16px 防止 iOS 聚焦时自动放大 */
  .hint { display: none; }
  .engine-menu { top: 60px; }

  .group-head { margin-bottom: 12px; }
  .group-title { font-size: 1rem; }
  .group-grid { gap: 10px; }
  .site { padding: 10px; gap: 10px; }
  .site-icon { width: 34px; height: 34px; }
  .site-name { font-size: 13px; }
  .site-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .site { opacity: 1; }
  .caret { animation: none; }
}

/* ---------- 自定义右键菜单（移植自博客 cursor.js 的结构，样式按起始页重做） ---------- */
#rm-menu {
  position: fixed;
  z-index: 120;
  min-width: 176px;
  max-width: 260px;
  padding: 6px;
  background: var(--card);
  border: var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .5);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  opacity: 0;
  transform: translateY(4px) scale(.98);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
#rm-menu.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
#rm-menu[hidden] { display: none; }

.rm-group { display: flex; flex-direction: column; padding: 4px 0; }
.rm-group[hidden] { display: none; }
.rm-group + .rm-group {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}
.rm-quick { flex-direction: row; justify-content: space-between; gap: 2px; }

.rm-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.rm-item:hover { background: var(--chip); color: var(--theme-color); }
.rm-item svg { width: 15px; height: 15px; flex: none; }
.rm-quick .rm-item { width: 34px; height: 34px; padding: 0; justify-content: center; }
.rm-quick .rm-item svg { width: 16px; height: 16px; }
.rm-item .rm-txt { overflow: hidden; text-overflow: ellipsis; }

/* 轻提示（复制成功之类） */
#rm-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 130;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 12.5px;
  letter-spacing: .5px;
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
#rm-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
/* 带「撤销」按钮时才允许点击，平时别挡住下面的卡片 */
#rm-toast.has-action.is-show { pointer-events: auto; }
#rm-toast .toast-action {
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--chip);
  color: var(--theme-color);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease;
}
#rm-toast .toast-action:hover { background: var(--chip-strong); }
/* 编辑模式下底部有工具条，提示往上让开，别叠在一起 */
body.is-editing #rm-toast { bottom: 92px; }
/* 编辑工具条会压住页脚，给页脚多留一截 */
body.is-editing .footer { margin-bottom: 96px; }

.group-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 4px;
  font-size: 12.5px;
  letter-spacing: .3px;
  color: rgba(255, 255, 255, .72);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}

/* ---------- 昼夜切换过场：博客「轻」档同款 ----------
   暖色天空先盖满整屏 → 太阳/月亮交换 → 夜色层交叉淡化 → 整层淡出露出新壁纸。
   时长与博客对齐：天空 .75s、星球 1s、日月互换 .4s（500ms 时触发），总约 1.5s。 */
.Cuteen_DarkSky {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(to top, #f8cd71 0, #5bfde9 80%);
}
.Cuteen_DarkSky::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #30cfd0 0, #330867 100%);
  opacity: 0;
  transition: .75s ease all;
}
body.DarkMode .Cuteen_DarkSky::before { opacity: 1; }

.Cuteen_DarkPlanet {
  position: fixed;
  left: -50%;
  top: -50%;
  width: 200%;
  height: 200%;
  transform-origin: center bottom;
  animation: CuteenPlanetMove 1s cubic-bezier(.7, 0, 0, 1);
}

.Cuteen_Sun,
.Cuteen_Moon {
  position: absolute;
  left: 44%;
  top: 30%;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  transition: opacity .4s ease;
}
.Cuteen_Sun {
  background: #ffee94;
  box-shadow: 0 0 40px #ffee94;
}
/* 月亮用偏移的白色投影画月牙，本身透明 */
.Cuteen_Moon {
  box-shadow: -1.8em 1.8em 0 .2em #fff;
}

@keyframes CuteenPlanetMove {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .Cuteen_DarkSky::before,
  .Cuteen_Sun,
  .Cuteen_Moon { transition: none !important; }
  .Cuteen_DarkPlanet { animation: none !important; }
}

/* ---------- 站点编辑模式 ---------- */
.ico-edit { display: block; }
.ico-done { display: none; }
.icon-btn.is-active {
  background: var(--theme-color);
  border-color: var(--theme-color);
  color: #fff;
}
.icon-btn.is-active .ico-edit { display: none; }
.icon-btn.is-active .ico-done { display: block; }
.topbar.is-stuck .icon-btn.is-active {
  background: var(--theme-color);
  border-color: var(--theme-color);
  color: #fff;
}

body.is-editing .site {
  position: relative;
  cursor: pointer;
  outline: 1px dashed color-mix(in srgb, var(--theme-color) 34%, transparent);
  outline-offset: -4px;
}
body.is-editing .site:hover .site-name { color: var(--theme-color); }

.site-del {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  background: var(--theme-color);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .4);
  transition: background .2s ease, transform .2s ease;
}
.site-del:hover { transform: scale(1.1); }
.site-del.is-armed { background: #d33; }

.group-add,
.group-edit,
.group-del {
  flex: none;
  margin-left: 0;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .2s ease, border-color .2s ease;
}
.group-add:hover,
.group-edit:hover {
  background: color-mix(in srgb, var(--theme-color) 60%, transparent);
  border-color: transparent;
}
.group-del { padding: 3px 8px; font-size: 13px; }
.group-del:hover,
.group-del.is-armed {
  background: rgba(211, 51, 51, .85);
  border-color: transparent;
}

/* 底部编辑工具条 */
.edit-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 70;
  display: flex;
  gap: 6px;
  padding: 7px;
  border: var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .55);
  transform: translateX(-50%);
}
.edit-bar[hidden] { display: none; }
.edit-bar button {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.edit-bar button:hover { background: var(--chip); color: var(--theme-color); }
.edit-bar #btn-add-site {
  background: var(--theme-color);
  color: #fff;
  font-weight: 700;
}
.edit-bar #btn-add-site:hover {
  background: color-mix(in srgb, var(--theme-color) 86%, #000);
  color: #fff;
}
.edit-bar button.is-armed { background: rgba(211, 51, 51, .9); color: #fff; }
/* 完成修改：用正文色实底，和洋红的「添加站点」区分开 */
.edit-bar #btn-done {
  background: var(--ink);
  color: var(--card);
  font-weight: 700;
}
.edit-bar #btn-done:hover {
  background: var(--theme-color);
  color: #fff;
}
body.is-editing .page { padding-bottom: 96px; }

/* 添加/编辑站点弹窗 */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 20px;
}
.sheet[hidden] { display: none; }
.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .2s ease;
}
.sheet-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 20px;
  border: var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transition: opacity .2s ease, transform .24s ease;
}
.sheet.is-open .sheet-mask,
.sheet.is-open .sheet-panel { opacity: 1; }
.sheet.is-open .sheet-panel { transform: none; }
.sheet-panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
  letter-spacing: .5px;
  color: var(--ink);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.field[hidden] { display: none; }
.field > span {
  font-size: 11.5px;
  letter-spacing: .5px;
  color: var(--muted);
}
.field input,
.field select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(128, 128, 128, .35);
  border-radius: 10px;
  background: rgba(128, 128, 128, .06);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color .2s ease, background .2s ease;
}
.field input:focus,
.field select:focus {
  border-color: var(--accent-soft);
  background: rgba(128, 128, 128, .1);
}

/* 自定义分组下拉（原生 select 的弹出层改不动，所以自己画） */
.dropdown { position: relative; }
.dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(128, 128, 128, .35);
  border-radius: 10px;
  background: rgba(128, 128, 128, .06);
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.dropdown-btn:hover { background: rgba(128, 128, 128, .1); }
.dropdown-btn[aria-expanded="true"] {
  border-color: var(--accent-soft);
  background: rgba(128, 128, 128, .1);
}
.dropdown-btn .ico {
  width: 14px;
  height: 14px;
  flex: none;
  opacity: .55;
  transition: transform .2s ease;
}
.dropdown-btn[aria-expanded="true"] .ico { transform: rotate(180deg); }
.dropdown-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dropdown-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  max-height: 218px;
  overflow-y: auto;
  padding: 6px;
  border: var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 18px 36px -20px rgba(0, 0, 0, .5);
}
.dropdown-menu[hidden] { display: none; }
.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.dropdown-item:hover { background: var(--chip); color: var(--theme-color); }
.dropdown-item[aria-selected="true"] {
  color: var(--theme-color);
  font-weight: 700;
  background: color-mix(in srgb, var(--theme-color) 9%, transparent);
}
.dropdown-item[aria-selected="true"]::after {
  content: "✓";
  margin-left: auto;
  font-size: 12px;
}
.dropdown-new {
  margin-top: 4px;
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
}
.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.sheet-actions button {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s ease;
}
.btn-ghost { background: rgba(128, 128, 128, .14); color: var(--ink); }
.btn-ghost:hover { background: rgba(128, 128, 128, .22); }
.btn-primary { background: var(--theme-color); color: #fff; font-weight: 700; }
.btn-primary:hover { background: color-mix(in srgb, var(--theme-color) 86%, #000); }

@media (max-width: 560px) {
  /* 5 个按钮排不下时允许换行，别被屏幕边缘截断 */
  .edit-bar {
    flex-wrap: wrap;
    justify-content: center;
    width: calc(100vw - 24px);
    border-radius: 18px;
    gap: 2px;
    padding: 5px;
    bottom: 14px;
  }
  .edit-bar button { padding: 6px 9px; font-size: 11.5px; }
  .sheet { padding: 14px; }
  .sheet-panel { padding: 16px; }
  .group-add,
  .group-edit { padding: 3px 8px; font-size: 10.5px; }
  .group-desc { display: none; }
}
