/* ============================================================
   🍱 梯子代理 (tizidaili.blog) - Bento Grid & Tabbed Layout Architecture
   全新居中首屏 + 交互搜索药丸 + Bento 便当盒多维排版 + Tabs 聚合
   ============================================================ */

/* --- 1. 居中沉浸式首屏 (Centered Hero) --- */
.bento-hero {
  padding: clamp(3rem, 7vw, 5rem) 1rem clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.bento-hero-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-chip-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  box-shadow: 0 4px 14px -3px rgba(236, 72, 153, 0.15);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.hero-title-giant {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 1.25rem;
  text-wrap: balance;
}

.hero-title-giant .gradient-text {
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 50%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-lead-centered {
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--fg-muted);
  line-height: 1.75;
  max-width: 660px;
  margin-bottom: 2rem;
  text-wrap: balance;
}

/* 交互搜索药丸 */
.bento-search-bar {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: 0 10px 30px -5px rgba(236, 72, 153, 0.15), 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
  margin-bottom: 1.5rem;
}

.bento-search-bar:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 16px 36px -4px rgba(236, 72, 153, 0.25);
}

.bento-search-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.bento-search-text {
  flex: 1;
  text-align: left;
  font-size: var(--text-sm);
  color: var(--fg-faint);
  font-weight: 500;
}

.bento-search-kbd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg-muted);
}

/* 快速筛选标签胶囊 */
.bento-quick-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 2rem;
  max-width: 780px;
}

.bento-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

.bento-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* 实时统计微胶囊栏 */
.bento-stats-bar {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 8px 24px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  font-size: var(--text-xs);
  color: var(--fg-muted);
  backdrop-filter: blur(8px);
}

:root[data-theme="dark"] .bento-stats-bar {
  background: rgba(22, 18, 33, 0.6);
}

.bento-stat-item strong {
  color: var(--accent);
  font-weight: 800;
}

/* --- 2. 交互式 Tab 切换导航栏 (Bento Tab Nav) --- */
.bento-tab-nav-wrapper {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: rgba(252, 250, 252, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-block: 1px solid var(--border);
  box-shadow: 0 4px 16px -4px rgba(236, 72, 153, 0.06);
  margin-bottom: 2.5rem;
}

:root[data-theme="dark"] .bento-tab-nav-wrapper {
  background: rgba(13, 11, 20, 0.9);
}

.bento-tabs-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.bento-tabs-container::-webkit-scrollbar { display: none; }

.bento-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-tab-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.bento-tab-btn.is-active {
  color: #fff !important;
  background: linear-gradient(135deg, #f43f5e, #ec4899 45%, #8b5cf6 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px -2px rgba(236, 72, 153, 0.4);
}

/* Tab 面板展示与隐藏 */
.bento-tab-pane {
  display: none;
  animation: bentoFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bento-tab-pane.is-active {
  display: block;
}

@keyframes bentoFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 3. 便当盒网格 (Bento Grid) 核心结构 --- */
.bento-grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-bottom: 2.5rem;
}

.bento-span-12 { grid-column: span 12; }
.bento-span-8  { grid-column: span 8; }
.bento-span-7  { grid-column: span 7; }
.bento-span-6  { grid-column: span 6; }
.bento-span-5  { grid-column: span 5; }
.bento-span-4  { grid-column: span 4; }
.bento-span-3  { grid-column: span 3; }

@media (max-width: 1024px) {
  .bento-span-8, .bento-span-7, .bento-span-5 { grid-column: span 12; }
  .bento-span-6, .bento-span-4 { grid-column: span 6; }
  .bento-span-3 { grid-column: span 6; }
}

@media (max-width: 640px) {
  .bento-span-6, .bento-span-4, .bento-span-3 { grid-column: span 12; }
  .bento-grid-12 { gap: 14px; }
}

/* Bento 卡片通用质感 */
.bento-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.bento-card:hover {
  transform: translateY(-3px);
  border-color: rgba(236, 72, 153, 0.38);
  box-shadow: var(--shadow-md);
}

/* 焦点高亮大卡片 (Spotlight Card) */
.bento-card--spotlight {
  border: 1.5px solid rgba(236, 72, 153, 0.3);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(253, 242, 248, 0.85));
}

:root[data-theme="dark"] .bento-card--spotlight {
  background: linear-gradient(135deg, rgba(22, 18, 33, 0.95), rgba(35, 22, 45, 0.85));
}

.bento-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1rem;
}

.bento-rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(236, 72, 153, 0.35);
}

.bento-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
  font-weight: 800;
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.bento-rating-box {
  margin-left: auto;
  text-align: right;
  line-height: 1;
}

.bento-rating-num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
}

.bento-rating-max {
  font-size: 0.75rem;
  color: var(--fg-faint);
}

.bento-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0;
}

.bento-card-title a {
  color: var(--fg);
  text-decoration: none;
}
.bento-card-title a:hover {
  color: var(--accent);
}

.bento-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.bento-summary {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: 1.25rem;
}

.bento-facts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  margin-bottom: 1.25rem;
  font-size: var(--text-sm);
}

.bento-facts-grid dt {
  font-size: var(--text-xs);
  color: var(--fg-faint);
}

.bento-facts-grid dd {
  margin: 0;
  font-weight: 600;
  color: var(--fg);
}

.bento-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 1rem;
}

.bento-coupon-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.bento-coupon-box code {
  font-family: var(--font-mono);
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 700;
}

/* AI Bento 方块 */
.ai-bento-tile {
  padding: 1.5rem;
  border-radius: var(--r-xl);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-bento-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.ai-bento-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-bento-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.ai-bento-name {
  font-size: 1.15rem;
  font-weight: 700;
}

.ai-bento-vendor {
  font-size: var(--text-xs);
  color: var(--fg-faint);
}

.ai-bento-nodes {
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.ai-bento-count {
  margin-top: auto;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--accent);
}

/* 问答 Bento 方块 */
.qc-bento {
  padding: 1.25rem 1.5rem;
  border-radius: var(--r-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg);
  text-decoration: none;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all 0.25s ease;
}

.qc-bento:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  background: var(--accent-soft);
  text-decoration: none;
}

.qc-bento-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.qc-bento-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qc-bento-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.qc-bento-desc {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* --- 🍱 Bento 异构网格特定规则 --- */

/* 1. 推荐榜首位 Spotlight 大卡片 */
#tab-ranking .grid--2 > article:first-child {
  grid-column: 1 / -1 !important;
  border: 1.5px solid rgba(236, 72, 153, 0.38) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(253, 242, 248, 0.88)) !important;
  box-shadow: 0 14px 40px -6px rgba(236, 72, 153, 0.18), 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

:root[data-theme="dark"] #tab-ranking .grid--2 > article:first-child {
  background: linear-gradient(135deg, rgba(26, 21, 38, 0.98), rgba(38, 22, 48, 0.88)) !important;
}

#tab-ranking .grid--2 > article:first-child .pc-rating {
  font-size: 2.2rem !important;
}

/* 2. AI 专区 Bento 异构便当盒排版 */
@media (min-width: 901px) {
  #tab-ai .grid--4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 18px !important;
  }

  /* Claude 旗舰大卡：跨 2 列 2 行 */
  #tab-ai .grid--4 > a:nth-child(1) {
    grid-column: span 2 !important;
    grid-row: span 2 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(254, 242, 238, 0.88)) !important;
    border: 1.5px solid rgba(217, 119, 87, 0.35) !important;
    box-shadow: 0 10px 30px -4px rgba(217, 119, 87, 0.15) !important;
  }
  :root[data-theme="dark"] #tab-ai .grid--4 > a:nth-child(1) {
    background: linear-gradient(135deg, rgba(30, 22, 33, 0.98), rgba(42, 25, 28, 0.88)) !important;
  }
  #tab-ai .grid--4 > a:nth-child(1) .aic-mark {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.25rem !important;
  }
  #tab-ai .grid--4 > a:nth-child(1) .aic-name {
    font-size: 1.35rem !important;
  }

  /* ChatGPT 重点卡：跨 2 列 */
  #tab-ai .grid--4 > a:nth-child(2) {
    grid-column: span 2 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 249, 245, 0.88)) !important;
    border: 1.5px solid rgba(16, 163, 127, 0.35) !important;
  }
  :root[data-theme="dark"] #tab-ai .grid--4 > a:nth-child(2) {
    background: linear-gradient(135deg, rgba(22, 28, 30, 0.98), rgba(20, 36, 32, 0.88)) !important;
  }

  /* Codex 重点卡：跨 2 列 */
  #tab-ai .grid--4 > a:nth-child(3) {
    grid-column: span 2 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(236, 253, 245, 0.88)) !important;
    border: 1.5px solid rgba(15, 118, 110, 0.35) !important;
  }
  :root[data-theme="dark"] #tab-ai .grid--4 > a:nth-child(3) {
    background: linear-gradient(135deg, rgba(20, 30, 32, 0.98), rgba(18, 38, 36, 0.88)) !important;
  }
}

/* 3. 问答专区 Bento 首位宽卡 */
@media (min-width: 801px) {
  #tab-questions .grid--3 > a:first-child {
    grid-column: span 2 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 249, 255, 0.88)) !important;
    border: 1.5px solid rgba(2, 132, 199, 0.3) !important;
  }
  :root[data-theme="dark"] #tab-questions .grid--3 > a:first-child {
    background: linear-gradient(135deg, rgba(22, 24, 38, 0.98), rgba(20, 32, 45, 0.88)) !important;
  }
}

/* 消除 Tab 内部的冗余大外边距与双重分割线 */
.bento-tab-pane .section {
  padding-block: var(--space-8) !important;
  background: transparent !important;
  border-block: none !important;
}
.bento-tab-pane .section-head {
  margin-bottom: var(--space-5) !important;
}

/* 🌟 光速云置顶高亮大卡响应式与动画美化 */
.bento-spotlight-hero {
  border-radius: var(--r-xl);
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.bento-spotlight-hero:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px -8px rgba(236, 72, 153, 0.38) !important;
}

.bento-chip--glow {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(139, 92, 246, 0.15)) !important;
  border-color: rgba(236, 72, 153, 0.4) !important;
  color: var(--accent) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.15);
}

.bento-chip--glow:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(139, 92, 246, 0.25)) !important;
  border-color: var(--accent) !important;
}

.copy-coupon-btn {
  transition: all 0.2s ease;
}

.copy-coupon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--amber) !important;
  background: rgba(245, 158, 11, 0.1) !important;
}

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

@media (max-width: 640px) {
  .bento-spotlight-hero {
    padding: 1.25rem;
  }
}

