/* ════════════════════════════════════════════════════════════════
 * cyane279.xyz — 个人网站大厅样式（Bento 刊物网格 + 丝滑交互）
 * ════════════════════════════════════════════════════════════════ */

.site-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: transform 0.36s var(--ease-spring), filter 0.36s var(--ease-smooth);
  transform-origin: center top;
}

body.is-drawer-open .site-shell {
  transform: scale(0.986);
}

/* ─────────────────────────── 顶部极简固定栏 ─────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 62px;
  border-bottom: 1px solid var(--c-border);
  background: color-mix(in srgb, var(--c-bg) 84%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--c-text);
  flex-shrink: 0;
}

.brand-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--c-accent-soft-border);
  background: var(--c-accent-soft);
  color: var(--c-accent);
  transition: transform 0.35s var(--ease-spring);
}

.brand-mark:hover .brand-glyph {
  transform: rotate(-10deg);
}

.brand-glyph svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* 滑动胶囊分类导航 */
.filter-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  background: var(--c-surface);
}

.nav-pill {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  border-radius: var(--radius-pill);
  background: var(--c-accent-soft);
  border: 1px solid var(--c-accent-soft-border);
  transition:
    transform 0.36s var(--ease-spring),
    width 0.36s var(--ease-spring),
    opacity 0.2s ease;
  pointer-events: none;
}

.filter-tab {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  color: var(--c-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease-smooth);
}

.filter-tab:hover {
  color: var(--c-text);
}

.filter-tab.is-active {
  color: var(--c-accent);
  font-weight: 600;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ─────────────────────────── 主体网格容器 ─────────────────────────── */

.portal-main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

/* 卡片公共基底与指针微光 */
.bento-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-surface);
  padding: 24px;
  box-shadow: var(--c-shadow-sm);
  transition:
    border-color 0.24s var(--ease-smooth),
    box-shadow 0.28s var(--ease-smooth),
    transform 0.3s var(--ease-spring),
    opacity 0.24s var(--ease-smooth);
}

.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    var(--c-halo),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease-smooth);
  pointer-events: none;
}

@media (hover: hover) {
  .bento-card:hover {
    border-color: var(--c-accent-soft-border);
    box-shadow: var(--c-shadow-md);
    transform: translateY(-2px);
  }

  .bento-card:hover::before {
    opacity: 1;
  }
}

.bento-card.is-hidden-card {
  display: none;
}

.bento-card.is-entering {
  animation: card-enter 0.36s var(--ease-spring) both;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ─────────────────────────── 个人名片卡 ─────────────────────────── */

.profile-card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  background:
    radial-gradient(circle at 100% 0%, var(--c-accent-soft) 0%, transparent 56%),
    var(--c-surface);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--c-accent-soft-border);
  background: var(--c-accent-soft);
  color: var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-avatar svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--c-text);
}

.profile-tagline {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--c-text-muted);
}

.profile-bio {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-text-secondary);
}

.profile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--c-border);
  font-size: 12px;
  color: var(--c-text-muted);
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.status-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-sage);
}

.domain-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-accent);
}

/* ─────────────────────────── 主推游戏活体卡 ─────────────────────────── */

.featured-game-card {
  grid-column: span 8;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(170px, 0.65fr);
  gap: 22px;
  align-items: center;
}

.featured-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--c-text);
}

.badge-live {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--c-accent-soft);
  border: 1px solid var(--c-accent-soft-border);
  color: var(--c-accent);
  white-space: nowrap;
}

.card-summary {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--c-text-secondary);
}

.hub-stats-row {
  display: flex;
  gap: 24px;
  padding: 10px 0;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}

.hub-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-stat-label {
  font-size: 11px;
  color: var(--c-text-muted);
}

.hub-stat-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text);
}

.featured-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-accent);
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.24s var(--ease-spring);
}

.btn-primary svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.24s var(--ease-spring);
}

.btn-primary:hover {
  background: var(--c-accent-hover);
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-primary:active {
  transform: scale(0.97);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--c-surface-soft);
  color: var(--c-text-muted);
}

/* 迷宫线稿预览 */
.featured-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  max-height: 196px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface-soft);
  padding: 12px;
}

.maze-sketch {
  width: 100%;
  height: 100%;
}

.maze-frame {
  fill: var(--c-surface);
  stroke: var(--c-border-strong);
  stroke-width: 1.5;
}

.maze-path {
  fill: none;
  stroke: var(--c-accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 4 5;
  opacity: 0.72;
}

.maze-walls {
  fill: none;
  stroke: var(--c-text);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.45;
}

.maze-car {
  fill: var(--c-accent);
  transition: transform 0.5s var(--ease-spring);
}

.featured-game-card:hover .maze-car {
  transform: translateY(-10px);
}

.maze-goal {
  stroke: var(--c-sage);
  stroke-width: 3;
  stroke-linecap: round;
}

/* ─────────────────────────── 扩展区标准卡片 ─────────────────────────── */

.catalog-card {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.catalog-card.is-wide {
  grid-column: span 6;
}

.catalog-card.is-full {
  grid-column: span 12;
  flex-direction: row;
  align-items: center;
  padding: 18px 24px;
}

.catalog-card.is-full .card-bottom {
  padding-top: 0;
  border-top: 0;
  flex-shrink: 0;
}

.catalog-card.is-placeholder {
  border-style: dashed;
  border-color: var(--c-border-strong);
  background: transparent;
  box-shadow: none;
  cursor: default;
}

.catalog-card.is-placeholder:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--c-accent-soft-border);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-soft);
  color: var(--c-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.22s ease, border-color 0.22s ease;
}

.catalog-card:hover .card-icon {
  background: var(--c-accent-soft);
  border-color: var(--c-accent-soft-border);
}

.card-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-kind-label {
  font-size: 11px;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
}

.catalog-card .card-title {
  font-size: 18px;
  margin-bottom: 6px;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
}

.card-action-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-accent);
  white-space: nowrap;
}

.card-action-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.24s var(--ease-spring);
}

.catalog-card:hover .card-action-link svg {
  transform: translateX(3px);
}

/* ─────────────────────────── 页脚 ─────────────────────────── */

.site-footer {
  border-top: 1px solid var(--c-border);
  padding: 20px 24px;
  font-size: 12px;
  color: var(--c-text-muted);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
}

/* ─────────────────────────── 丝滑毛玻璃抽屉 ─────────────────────────── */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--c-backdrop);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease-smooth);
}

.drawer-backdrop[hidden],
.drawer[hidden] {
  display: none;
  pointer-events: none;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 80;
  width: min(500px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-border);
  border-radius: 20px;
  background: var(--c-surface);
  box-shadow: var(--c-shadow-md);
  transform: translateX(28px) scale(0.985);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.36s var(--ease-spring),
    opacity 0.24s var(--ease-smooth);
}

.drawer.is-open {
  transform: translateX(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--c-border);
}

.drawer-kind {
  display: block;
  font-size: 11px;
  color: var(--c-accent);
  font-family: var(--font-mono);
  margin-bottom: 2px;
}

.drawer-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--c-text);
}

.drawer-close {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--c-border);
  background: var(--c-surface-soft);
  color: var(--c-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, transform 0.2s var(--ease-spring);
}

.drawer-close:hover {
  color: var(--c-text);
  background: var(--c-accent-soft);
}

.drawer-close:active {
  transform: scale(0.92);
}

.drawer-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 28px;
}

/* ─────────────────────────── 工具抽屉内部样式 ─────────────────────────── */

.tool-box {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tool-note {
  margin: 0;
  font-size: 13px;
  color: var(--c-text-secondary);
}

.pomo-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 0 8px;
}

.pomo-ring-wrap {
  position: relative;
  width: 196px;
  height: 196px;
  display: grid;
  place-items: center;
}

.pomo-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pomo-ring-bg {
  fill: none;
  stroke: var(--c-border);
  stroke-width: 4;
}

.pomo-ring-fg {
  fill: none;
  stroke: var(--c-accent);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s linear;
}

.pomo-clock {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 36px;
  font-weight: 600;
  color: var(--c-text);
}

.pill-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.btn-soft {
  appearance: none;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  background: var(--c-surface-soft);
  color: var(--c-text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-soft:hover {
  border-color: var(--c-accent-soft-border);
  color: var(--c-text);
}

.btn-soft.is-active {
  background: var(--c-accent-soft);
  border-color: var(--c-accent-soft-border);
  color: var(--c-accent);
  font-weight: 600;
}

/* 签筒 & 字数镜输入框 */
.tool-textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface-soft);
  color: var(--c-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.65;
  resize: vertical;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.tool-textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  background: var(--c-surface);
}

.decider-result {
  min-height: 76px;
  padding: 16px;
  border: 1px solid var(--c-accent-soft-border);
  border-radius: var(--radius-md);
  background: var(--c-accent-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.decider-result-label {
  font-size: 11px;
  color: var(--c-accent);
}

.decider-result-value {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--c-text);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-cell {
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface-soft);
}

.metric-cell span {
  display: block;
  font-size: 11px;
  color: var(--c-text-muted);
}

.metric-cell strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 20px;
  color: var(--c-text);
}

/* 文章阅读样式 */
.article-prose {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--c-text-secondary);
}

.article-prose p {
  margin: 0;
}

.bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.bookmark-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-surface-soft);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s var(--ease-spring);
}

.bookmark-item:hover {
  border-color: var(--c-accent-soft-border);
  transform: translateY(-1px);
}

.bookmark-item strong {
  display: block;
  font-size: 14px;
  color: var(--c-text);
}

.bookmark-item span {
  display: block;
  font-size: 12px;
  color: var(--c-text-muted);
}

.bookmark-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--c-accent);
  fill: none;
  stroke-width: 1.5;
  flex-shrink: 0;
}

/* ─────────────────────────── 响应式断点 ─────────────────────────── */

@media (max-width: 960px) {
  .profile-card {
    grid-column: span 12;
  }

  .featured-game-card {
    grid-column: span 12;
  }

  .catalog-card,
  .catalog-card.is-wide {
    grid-column: span 6;
  }

  .catalog-card.is-full {
    grid-column: span 12;
  }
}

@media (max-width: 680px) {
  .site-header {
    height: auto;
    padding: 10px 0;
  }

  .header-inner {
    flex-wrap: wrap;
    padding: 0 16px;
  }

  .filter-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .filter-tab {
    flex: 1;
    padding: 5px 10px;
    font-size: 12px;
    text-align: center;
  }

  .portal-main {
    padding: 18px 16px 36px;
  }

  .featured-game-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .featured-visual {
    max-height: 150px;
  }

  .catalog-card,
  .catalog-card.is-wide,
  .catalog-card.is-full {
    grid-column: span 12;
    flex-direction: column;
    align-items: stretch;
  }

  .drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 88dvh;
    border-radius: 20px 20px 0 0;
    transform: translateY(24px);
  }

  .drawer.is-open {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-shell,
  .nav-pill,
  .bento-card,
  .drawer,
  .drawer-backdrop,
  .btn-primary svg,
  .card-action-link svg,
  .maze-car {
    transition: none;
  }
  .bento-card.is-entering {
    animation: none;
  }
}
