@charset "UTF-8";
/* =============================================================================
   components.css — 卡片 / 按钮 / 徽章 / 骨架屏 / 状态点 / 进度条 / 提示
   ============================================================================= */

/* ------------------------------------------------------------ 1. 玻璃卡片 */
.card {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  /* 顶部一道极细高光，让卡片「有厚度」。
     用背景层实现而不是 ::before——那个位置要留给鼠标柔光。 */
  background-color: var(--surface);
  background-image: linear-gradient(var(--hairline), var(--hairline));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: var(--shadow-2), var(--ring);
  overflow: hidden;
  isolation: isolate;
}
/* 跟随鼠标的柔光（--mx/--my 由 JS 写入）。
   z-index:-1 + isolation:isolate 让它贴在卡片背景之上、内容之下，
   透过半透明玻璃面可见；触屏设备由 JS 侧跳过。 */
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    var(--card-accent, var(--brand-soft)),
    transparent 68%
  );
  transition: opacity var(--d-base) var(--ease-out);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card--pad { padding: clamp(18px, 2.4vw, 26px); }

/* -------------------------------------------------------- 2. 入口导航卡片 */
/* 3 列主网格 + 三张「跨两列」的重点卡（MC 服务器 / 民法典 / 田园）。
   11 张卡 = 14 格 = 4 行整好铺满 + 末行一张宽卡，避免末行孤零零剩一张。
   跨列只在 ≥1001px 生效：2 列时跨列会在换行处留下空洞。 */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 20px);
}

.entry {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(18px, 2.2vw, 24px);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  /* 与 .card 一致的顶部高光（背景层，::before 已留给鼠标柔光） */
  background-color: var(--surface);
  background-image: linear-gradient(var(--hairline), var(--hairline));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  box-shadow: var(--shadow-2), var(--ring);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--d-sm) var(--ease-apple), border-color var(--d-sm) var(--ease-apple),
    box-shadow var(--d-sm) var(--ease-apple), background var(--d-sm) var(--ease-apple);
}

/* 重点卡：图标占左列、文字走右列，标题升一档，横向读起来更像「本期主推」 */
@media (min-width: 1001px) {
  .entry.is-wide {
    grid-column: span 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    column-gap: 18px;
    row-gap: 7px;
    padding: clamp(22px, 2.6vw, 30px);
  }
  .entry.is-wide .entry__icon {
    grid-row: 1 / span 3;
    width: 56px;
    height: 56px;
    border-radius: var(--r-md);
  }
  .entry.is-wide .entry__icon svg { width: 27px; height: 27px; }
  .entry.is-wide .entry__title { font-size: var(--text-2xl); }
  .entry.is-wide .entry__desc { max-width: 44ch; font-size: var(--text-md); }
  .entry.is-wide .entry__foot { margin-top: 4px; padding-top: 0; }
  /* 右侧一枚测绘罗盘：虚线环 + 中心星点，把跨列后空出来的右半边用掉。
     只描边不填充，所以不会和卡片的玻璃背景打架。 */
  .entry.is-wide::after {
    content: "";
    position: absolute;
    right: 5%;
    top: 50%;
    width: clamp(120px, 15vw, 168px);
    aspect-ratio: 1;
    border-radius: var(--r-pill);
    border: 1px dashed var(--border-hi);
    background-image: radial-gradient(circle, var(--border-hi) 1.6px, transparent 2.2px);
    background-position: center;
    background-repeat: no-repeat;
    transform: translateY(-50%);
    opacity: 0.8;
    pointer-events: none;
    transition: transform 1.1s var(--ease-out), opacity var(--d-base) var(--ease-out);
  }
  .entry.is-wide:hover::after {
    transform: translateY(-50%) rotate(28deg) scale(1.06);
    opacity: 1;
  }
  @media (prefers-reduced-motion: reduce) {
    .entry.is-wide:hover::after { transform: translateY(-50%); }
  }
}

@media (max-width: 1000px) {
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .entry-grid { grid-template-columns: 1fr; }
}
.entry:hover {
  transform: translateY(-2px);
  border-color: var(--border-hi);
  box-shadow: var(--shadow-3), var(--ring);
}
/* 按压要立刻回弹，比 hover 短得多——否则手指会觉得"粘" */
.entry:active {
  transform: translateY(0) scale(0.997);
  transition-duration: var(--d-xs);
}

/* 跟随鼠标的柔光（--mx/--my 由 JS 写入） */
.entry::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    var(--entry-accent, var(--brand-soft)),
    transparent 68%
  );
  transition: opacity var(--d-base) var(--ease-out);
}
.entry:hover::before { opacity: 1; }

.entry__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--entry-icon-fg, #fff);
  background: var(--entry-icon-bg, var(--grad-brand));
  box-shadow: 0 8px 20px -10px var(--entry-icon-bg, var(--brand));
  flex: none;
}
.entry__icon svg { width: 21px; height: 21px; }

.entry__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-lg);
  font-weight: 620;
  letter-spacing: -0.01em;
}
.entry__desc { font-size: var(--text-md); color: var(--text-dim); line-height: 1.6; }
.entry__foot {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--text-mute);
}
.entry__arrow {
  width: 16px; height: 16px;
  transition: transform var(--d-base) var(--ease-apple);
}
.entry:hover .entry__arrow { transform: translateX(5px); }

.entry.is-disabled { cursor: not-allowed; opacity: 0.72; }
.entry.is-disabled:hover { transform: none; }

/* 主题色变体（accent）：入口卡片、内容卡片、留言条共用一套色板。
   用裸属性选择器一次定义两套变量名——入口消费 --entry-*，
   卡片/留言条消费 --card-*，互不干扰，新增组件直接复用。 */
[data-accent="emerald"] {
  --entry-accent: rgba(69, 224, 138, 0.16); --entry-icon-bg: linear-gradient(135deg,#22c55e,#0ea371);
  --card-accent: rgba(69, 224, 138, 0.16); --card-avatar-bg: linear-gradient(135deg,#22c55e,#0ea371);
}
[data-accent="violet"] {
  --entry-accent: rgba(167, 139, 250, 0.18); --entry-icon-bg: linear-gradient(135deg,#8b5cf6,#6d28d9);
  --card-accent: rgba(167, 139, 250, 0.18); --card-avatar-bg: linear-gradient(135deg,#8b5cf6,#6d28d9);
}
[data-accent="amber"] {
  --entry-accent: rgba(251, 191, 36, 0.18); --entry-icon-bg: linear-gradient(135deg,#f59e0b,#d97706);
  --card-accent: rgba(251, 191, 36, 0.18); --card-avatar-bg: linear-gradient(135deg,#f59e0b,#d97706);
}
[data-accent="sky"] {
  --entry-accent: rgba(110, 168, 255, 0.18); --entry-icon-bg: linear-gradient(135deg,#3b82f6,#0ea5e9);
  --card-accent: rgba(110, 168, 255, 0.18); --card-avatar-bg: linear-gradient(135deg,#3b82f6,#0ea5e9);
}
[data-accent="rose"] {
  --entry-accent: rgba(251, 113, 133, 0.18); --entry-icon-bg: linear-gradient(135deg,#f43f5e,#be123c);
  --card-accent: rgba(251, 113, 133, 0.18); --card-avatar-bg: linear-gradient(135deg,#f43f5e,#be123c);
}
[data-accent="slate"] {
  --entry-accent: rgba(148, 163, 184, 0.16); --entry-icon-bg: linear-gradient(135deg,#64748b,#334155);
  --card-accent: rgba(148, 163, 184, 0.16); --card-avatar-bg: linear-gradient(135deg,#64748b,#334155);
}

/* --------------------------------------------------------------- 3. 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 550;
  transition: transform var(--d-fast) var(--ease-spring), background var(--d-fast) var(--ease-out),
    border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
.btn:hover { background: var(--surface-hi); border-color: var(--border-hi); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn svg { width: 16px; height: 16px; }
.btn--primary {
  background: var(--grad-brand);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px -12px var(--brand);
}
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 6px 12px; font-size: var(--text-sm); }

/* --------------------------------------------------------------- 4. 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-hi);
  font-size: var(--text-2xs);
  font-weight: 550;
  letter-spacing: 0.01em;
  color: var(--text-dim);
  white-space: nowrap;
}
.badge--live  { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 40%, transparent);   background: color-mix(in srgb, var(--ok) 12%, transparent); }
.badge--soon  { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.badge--new   { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-soft); }
.badge--muted { color: var(--text-mute); }

/* ------------------------------------------------------------ 5. 状态点 */
.dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--text-mute);
  flex: none;
}
.dot--on { background: var(--ok); }
.dot--off { background: var(--bad); }
.dot--on::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-pill);
  background: inherit;
  animation: ping 2.1s var(--ease-out) infinite;
}
@keyframes ping {
  0%   { transform: scale(1);   opacity: 0.65; }
  70%  { transform: scale(3.2); opacity: 0; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* --------------------------------------------------------------- 6. 骨架屏 */
.skeleton {
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hi) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* --------------------------------------------------------------- 7. 进度条 */
.meter {
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-hi);
  overflow: hidden;
}
.meter__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--grad-brand);
  transform-origin: left;
  transition: width var(--d-slow) var(--ease-out);
}

/* ------------------------------------------------------- 8. 数据格 / 统计 */
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat__k { font-size: var(--text-xs); color: var(--text-mute); }
.stat__v {
  font-size: var(--text-2xl);
  font-weight: 620;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat__v small { font-size: var(--text-sm); font-weight: 500; color: var(--text-mute); }

.kv-list { display: grid; gap: 12px; }
.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-sm);
}
.kv__k { color: var(--text-mute); }
.kv__v { font-variant-numeric: tabular-nums; text-align: right; }

/* ------------------------------------------------------------ 9. 提示面板 */
.note {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-dim);
}
.note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--brand); }
.note strong { color: var(--text); font-weight: 600; }
.note code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  background: var(--surface-hi);
  border: 1px solid var(--border);
}

/* ------------------------------------------------------------- 10. 开关 */
.switch {
  --w: 44px;
  position: relative;
  width: var(--w);
  height: 25px;
  border-radius: var(--r-pill);
  background: var(--surface-hi);
  border: 1px solid var(--border);
  transition: background var(--d-base) var(--ease-out);
  flex: none;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: var(--r-pill);
  background: var(--text);
  transition: transform var(--d-base) var(--ease-spring);
}
.switch[aria-checked="true"] { background: var(--brand); border-color: transparent; }
.switch[aria-checked="true"]::after { transform: translateX(19px); background: #fff; }

/* --------------------------------------------------------- 11. 分段控件 */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
}
.segmented button {
  padding: 5px 13px;
  border-radius: var(--r-pill);
  font-size: var(--text-sm);
  color: var(--text-dim);
  transition: color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.segmented button[aria-pressed="true"] {
  color: var(--text);
  background: var(--surface-hi);
  box-shadow: var(--ring);
}

/* ------------------------------------------------------- 9. 生活小提示条
   全站每页都有 tip-slot，样式必须放在所有页面都会加载的 components.css 里
   （曾经放在 pages/content.css，导致 home/mc/guestbook 三页的提示条裸奔：
   sparkle 图标无尺寸约束放大到 1084px）。 */
.tip-slot { margin-top: clamp(28px, 5vh, 44px); }
.tip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}
.tip__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex: none;
  background: var(--brand-soft);
  color: var(--brand);
}
.tip__icon svg { width: 17px; height: 17px; }
.tip__body { min-width: 0; flex: 1; }
.tip__label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 650;
  letter-spacing: 0.14em;
  color: var(--brand);
}
.tip__text {
  margin-top: 3px;
  font-size: var(--text-md);
  color: var(--text-dim);
  line-height: 1.65;
  text-wrap: pretty;
}
.tip__shuffle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface-hi);
  font-size: var(--text-sm);
  color: var(--text-dim);
  transition: color var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out);
}
.tip__shuffle:hover { color: var(--text); border-color: var(--border-hi); }
.tip__shuffle svg { width: 13px; height: 13px; }

@media (max-width: 560px) {
  .tip { flex-wrap: wrap; }
  .tip__shuffle { margin-left: auto; }
}
