
/* ==========================================================================
   Design System Tokens - Mobile-First & Bento Box Modern Palette
   ========================================================================== */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* 明亮通透背景与便当盒卡片 (Soft, Light Mode & Bento Surface) */
  --bg-stage: #f8fafc;
  --header-bg: rgba(255, 255, 255, 0.82);
  --header-border: rgba(226, 232, 240, 0.85);
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-border-hover: rgba(14, 165, 233, 0.4);
  
  --text-title: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* 活力双核霓虹色彩 (Brand Warm Orange & Electric Sky Blue) */
  --warm-orange: #f97316;
  --warm-orange-glow: rgba(249, 115, 22, 0.45);
  --warm-orange-light: #fff7ed;
  
  --primary-blue: #0ea5e9;
  --primary-blue-hover: #0284c7;
  --primary-blue-glow: rgba(14, 165, 233, 0.35);
  --primary-blue-light: rgba(14, 165, 233, 0.08);

  --danger-color: #ef4444;
  --success-color: #10b981;

  /* 超圆滑平滑圆角 (Hyper-Smooth Rounded Radii) */
  --radius-bento: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --radius-pill: 9999px;

  /* 深度与弥散霓虹阴影 (Depth Shadows & Soft Glass Glow) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-bento: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.02);
  --shadow-bento-hover: 0 16px 36px -6px rgba(15, 23, 42, 0.09), 0 6px 14px -3px rgba(14, 165, 233, 0.12);
  --shadow-fab: 0 12px 28px -4px rgba(249, 115, 22, 0.45), 0 6px 16px -2px rgba(2, 132, 199, 0.3);
  --shadow-glass: 0 10px 30px -5px rgba(0, 0, 0, 0.05);

  /* 兼容旧组件的变量映射 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --border-color: #e2e8f0;
  --border-subtle: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent-color: #0ea5e9;
  --primary-teal: #0ea5e9;
}

[data-theme="dark"] {
  --bg-stage: #090d16;
  --header-bg: rgba(15, 23, 42, 0.85);
  --header-border: rgba(30, 41, 59, 0.85);
  --card-bg: #111827;
  --card-border: #1f2937;
  --card-border-hover: rgba(56, 189, 248, 0.45);
  
  --text-title: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-bento: 0 4px 20px -2px rgba(0, 0, 0, 0.3);
  --shadow-bento-hover: 0 16px 36px -6px rgba(0, 0, 0, 0.6), 0 0 20px rgba(14, 165, 233, 0.2);

  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --border-color: #1f2937;
  --border-subtle: #1f2937;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body, .app-body {
  font-family: var(--font-sans);
  background-color: var(--bg-stage);
  color: var(--text-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   1. 悬浮毛玻璃顶部导航条 (Floating Frosted Top Navbar)
   ========================================================================== */
.bento-app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bento-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

/* 左侧品牌与火焰矢量图标 */
.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-flame-svg {
  filter: drop-shadow(0 2px 8px rgba(249, 115, 22, 0.45));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-link:hover .brand-flame-svg {
  transform: rotate(-8deg) scale(1.1);
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-title);
}

.bento-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(14, 165, 233, 0.15));
  color: var(--warm-orange);
  border: 1px solid rgba(249, 115, 22, 0.3);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

/* 中部：居中大号毛玻璃搜索框 */
.header-center {
  flex: 1;
  max-width: 620px;
  display: flex;
  justify-content: center;
}

.bento-search-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.bento-search-input {
  width: 100%;
  height: 46px;
  padding: 0 3.2rem 0 2.8rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--text-title);
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .bento-search-input {
  background-color: rgba(17, 24, 39, 0.7);
}

.bento-search-input:focus {
  background-color: var(--card-bg);
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--primary-blue-glow), 0 4px 12px rgba(14, 165, 233, 0.1);
}

.search-lens-svg {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-kbd-pill {
  position: absolute;
  right: 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-dim);
  background: var(--bg-stage);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  pointer-events: none;
}

/* 右上角：显式用户登录/头像入口 (Explicit Top-Right) */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.theme-circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-circle-btn:hover {
  color: var(--text-title);
  background: var(--bg-stage);
  transform: rotate(15deg);
}

.nav-login-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  min-height: 40px;
}

.nav-login-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35);
}

.user-top-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-blue);
  background: var(--primary-blue-light);
  border: 1px solid rgba(14, 165, 233, 0.25);
  text-decoration: none;
  transition: all 0.2s;
}

.admin-badge-pill:hover {
  background: rgba(14, 165, 233, 0.18);
  border-color: var(--primary-blue);
}

.avatar-ring {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
  border: 2px solid var(--card-bg);
}

.avatar-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-title);
}

.quick-logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  transition: all 0.2s;
}

.quick-logout-btn:hover {
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   2. 主体舞台与控制中枢 (Bento Stage & Control Hub)
   ========================================================================== */
.bento-main-stage {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 6rem;
  width: 100%;
}

.bento-control-hub {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* 一级分类横向滚动胶囊条 (Mobile-Friendly Horizontal Ribbon) */
.category-scroll-ribbon {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 0.5rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-scroll-ribbon::-webkit-scrollbar {
  display: none;
}

.category-ribbon-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-body);
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  min-height: 42px;
  cursor: pointer;
}

.category-ribbon-pill:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  transform: translateY(-2px);
}

.category-ribbon-pill.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
  font-weight: 600;
}

.ribbon-icon {
  font-size: 0.95rem;
}

.category-add-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--card-border);
  cursor: pointer;
  white-space: nowrap;
  min-height: 42px;
  transition: all 0.2s;
}

.category-add-pill:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: var(--primary-blue-light);
}

/* 二级子分类智能展开行 */
.sub-ribbon-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.sub-ribbon-hint {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
}

.sub-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-stage);
  border: 1px solid var(--card-border);
  text-decoration: none;
  transition: all 0.15s;
}

.sub-chip:hover {
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.sub-chip.active {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: transparent;
  font-weight: 600;
}

/* 过滤行与排序分段控制器 */
.bento-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.25rem;
}

.filter-row-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stage-tag {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-title);
  letter-spacing: -0.02em;
}

.doc-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.doc-counter strong {
  color: var(--text-title);
  font-weight: 700;
}

.bento-sort-toggle {
  display: inline-flex;
  padding: 0.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.sort-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-pill:hover {
  color: var(--text-title);
}

.sort-pill.active {
  background: var(--bg-stage);
  color: var(--text-title);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   3. 便当盒非对称网格 (Asymmetric Bento Box Grid)
   ========================================================================== */
.bento-viewport {
  width: 100%;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  grid-auto-flow: dense;
}

/* 便当盒卡片基底 (Bento Base Card) */
.bento-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-bento);
  padding: 1.6rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-bento);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  min-height: 220px;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-bento-hover);
  border-color: var(--card-border-hover);
}

/* 非对称尺寸规则 */
/* 1. Hero 黄金主角卡片：跨 2 列，配有微渐变底光与丰富文案 */
.bento-card.bento-hero {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-bg) 70%, rgba(14, 165, 233, 0.04) 100%);
  border: 1px solid rgba(14, 165, 233, 0.22);
}

.bento-hero .card-title {
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.bento-hero-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.4rem;
}

/* 2. Wide 宽幅卡片：跨 2 列，杂志横版体验 */
.bento-card.bento-wide {
  grid-column: span 2;
}

.bento-wide .card-title {
  font-size: 1.25rem;
}

/* 3. Square 精致正方卡片：跨 1 列 */
.bento-card.bento-square {
  grid-column: span 1;
}

/* 卡片内部元素 */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
}

.file-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 0.76rem;
  font-family: var(--font-mono);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

.card-status-badges {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
}

.status-public {
  background-color: rgba(14, 165, 233, 0.1);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.25);
}

.status-guest {
  background-color: rgba(100, 116, 139, 0.1);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.2);
}

.status-private {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.card-delete-icon-btn,
.card-share-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  opacity: 0.65;
}

.bento-card:hover .card-delete-icon-btn,
.bento-card:hover .card-share-icon-btn {
  opacity: 1;
}

.card-delete-icon-btn:hover {
  background-color: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  transform: scale(1.12);
}

.card-share-icon-btn:hover {
  background-color: rgba(14, 165, 233, 0.15);
  color: var(--accent-color);
  border-color: rgba(14, 165, 233, 0.3);
  transform: scale(1.12);
}

.card-body-content {
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.4;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  transition: color 0.15s;
}

.bento-card:hover .card-title {
  color: var(--primary-blue);
}

.card-footer-row {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.78rem;
}

.footer-left-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  background-color: var(--bg-stage);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-views {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--warm-orange);
  font-weight: 600;
  background: var(--warm-orange-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.views-count strong {
  font-weight: 800;
  color: var(--warm-orange);
}

.fire-vector-icon {
  filter: drop-shadow(0 1px 3px rgba(249, 115, 22, 0.4));
}

.card-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  white-space: nowrap;
}

.meta-dot { color: var(--card-border); }

/* ==========================================================================
   4. 右下角呼吸高能光晕悬浮按钮 (Floating Action Button - FAB)
   ========================================================================== */
.fab-upload {
  position: fixed;
  bottom: 2.25rem;
  right: 2.25rem;
  z-index: 99;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  height: 56px;
  padding: 0 1.6rem 0 1.35rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #f97316 0%, #ea580c 45%, #0284c7 100%);
  color: #ffffff;
  border: none;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: var(--shadow-fab);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.fab-upload:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 18px 36px -4px rgba(249, 115, 22, 0.55), 0 8px 18px -2px rgba(2, 132, 199, 0.35);
}

.fab-upload:active {
  transform: scale(0.96);
}

.fab-label {
  letter-spacing: -0.01em;
}

/* 未登录状态下的暗门模式：常态 100% 透明隐藏，鼠标悬停时平滑浮现 */
.fab-upload.fab-stealth {
  opacity: 0;
  box-shadow: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

.fab-upload.fab-stealth:hover {
  opacity: 1;
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 18px 36px -4px rgba(249, 115, 22, 0.55), 0 8px 18px -2px rgba(2, 132, 199, 0.35);
}

.fab-upload.fab-stealth:active {
  transform: scale(0.96);
}

/* ==========================================================================
   AI 灵感随想对话浮窗与操作中枢 (AI Chat Drawer & Distillation)
   ========================================================================== */
.fab-ai-chat {
  position: fixed;
  bottom: 2.25rem;
  right: 13.5rem;
  z-index: 99;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  height: 56px;
  padding: 0 1.5rem 0 1.25rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #0284c7 0%, #3b82f6 50%, #8b5cf6 100%);
  color: #ffffff;
  border: none;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 0 10px 25px -4px rgba(59, 130, 246, 0.45), 0 4px 10px -2px rgba(139, 92, 246, 0.3);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

.fab-ai-chat:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 18px 36px -4px rgba(59, 130, 246, 0.55), 0 8px 18px -2px rgba(139, 92, 246, 0.4);
}

.fab-ai-chat:active {
  transform: scale(0.96);
}

.ai-chat-panel-container {
  position: fixed;
  bottom: 6.5rem;
  right: 2.25rem;
  width: 440px;
  max-width: calc(100vw - 2.5rem);
  height: 600px;
  max-height: calc(100vh - 8rem);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  animation: panelSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes panelSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.4), 0 0 0 1px rgba(14, 165, 233, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}

.ai-panel-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.06), rgba(139, 92, 246, 0.06));
}

.ai-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ai-spark-badge {
  font-size: 1.3rem;
  line-height: 1;
}

.ai-panel-title {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--text-title);
  line-height: 1.2;
}

.ai-panel-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ai-action-btn {
  background: transparent;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.ai-action-btn:hover {
  background: var(--bg-surface);
  color: var(--text-title);
}

.ai-messages-flow {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-msg-bubble {
  display: flex;
  gap: 0.65rem;
  max-width: 90%;
  animation: fadeInMsg 0.2s ease;
}

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

.ai-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-user .ai-msg-content {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.ai-msg-bot {
  align-self: flex-start;
}

.ai-avatar-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-top: 0.25rem;
}

.ai-msg-bot .ai-msg-content {
  background-color: var(--bg-surface);
  border: 1px solid var(--card-border);
  color: var(--text-body);
  border-radius: 16px 16px 16px 4px;
  padding: 0.85rem 1.1rem;
  font-size: 0.92rem;
  line-height: 1.6;
}

.ai-msg-bot .ai-msg-content strong {
  color: var(--text-title);
}

.ai-msg-bot .ai-msg-content code {
  font-family: var(--font-mono);
  background: rgba(14, 165, 233, 0.1);
  color: var(--primary-blue);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
}

.ai-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.25rem 0.5rem;
}

.ai-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s infinite ease-in-out;
}

.ai-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.ai-distill-feedback {
  margin: 0 1.25rem 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-distill-feedback.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.view-note-link {
  font-weight: 700;
  color: #10b981;
  text-decoration: underline;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.ai-panel-footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background-color: var(--card-bg);
}

.ai-quick-tools {
  display: flex;
  justify-content: flex-end;
}

.btn-distill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: var(--warm-orange);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-distill:hover {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.22), rgba(14, 165, 233, 0.22));
  transform: translateY(-1px);
}

.btn-distill:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ai-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
  padding: 0.45rem 0.6rem;
  transition: border-color 0.2s;
}

.ai-input-row:focus-within {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.ai-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-title);
  max-height: 100px;
  line-height: 1.4;
  padding: 0.25rem 0.25rem;
}

.btn-ai-send {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary-blue);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-ai-send:hover {
  background: #0284c7;
  transform: scale(1.05);
}

/* ==========================================================================
   5. 沉浸式单篇文档阅读器 (Reader View)
   ========================================================================== */
.reader-stage-center {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
  width: 100%;
}

.reader-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  transition: all 0.2s;
}

.reader-back-btn:hover {
  color: var(--primary-blue);
  border-color: var(--primary-blue);
  background: var(--primary-blue-light);
}

.reader-view-container {
  width: 100%;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--card-border);
}

.viewer-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.viewer-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.markdown-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-body);
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: var(--text-title);
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.markdown-body p { margin-bottom: 1.25rem; }
.markdown-body code {
  font-family: var(--font-mono);
  background: var(--bg-stage);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.88em;
  border: 1px solid var(--card-border);
}

.markdown-body pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 1.4rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.markdown-body pre code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
}

/* ==========================================================================
   6. 模态框与通用表单 (Modals & Forms)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-content {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-bento);
  max-width: 760px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.25rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--card-border);
}

/* ==========================================================================
   Master 极客暗门与解锁模态框 (Stealth Unlock Modal & Triggers)
   ========================================================================== */
.stealth-gate-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0.28;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stealth-gate-btn:hover {
  opacity: 0.95;
  color: var(--warm-orange);
  background: var(--card-bg);
  border-color: rgba(249, 115, 22, 0.35);
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.2);
  transform: scale(1.05);
}

.stealth-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 1.5rem;
}

.stealth-modal-sheet {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-bento);
  max-width: 480px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.4);
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.stealth-sheet-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
}

.stealth-lock-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(14, 165, 233, 0.15));
  border: 1px solid rgba(249, 115, 22, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warm-orange);
  flex-shrink: 0;
}

.stealth-sheet-titles {
  flex: 1;
}

.stealth-sheet-title {
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--text-title);
  margin-bottom: 0.25rem;
}

.stealth-sheet-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.stealth-close-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.15s;
}

.stealth-close-btn:hover {
  color: var(--text-title);
}

.stealth-sheet-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stealth-input-group {
  position: relative;
  width: 100%;
}

.stealth-password-input {
  width: 100%;
  height: 48px;
  padding: 0 3.2rem 0 1rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--text-title);
  background-color: var(--bg-surface);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stealth-password-input:focus {
  border-color: var(--warm-orange);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
  background-color: var(--card-bg);
}

.stealth-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.stealth-eye-btn:hover {
  color: var(--text-title);
}

.stealth-sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.stealth-btn-cancel {
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.stealth-btn-cancel:hover {
  background: var(--bg-surface);
  color: var(--text-title);
}

.stealth-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: none;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stealth-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249, 115, 22, 0.45);
}

.stealth-sheet-tip {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.25rem;
}

.stealth-sheet-tip code {
  font-family: var(--font-mono);
  background: rgba(14, 165, 233, 0.1);
  color: var(--primary-blue);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.bento-footer {
  text-align: center;
  padding: 3rem 1rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-stealth-dot {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 6px;
  font-weight: 900;
  opacity: 0.35;
  transition: opacity 0.2s, color 0.2s;
}

.footer-stealth-dot:hover {
  opacity: 1;
  color: var(--warm-orange);
}

/* 纯粹极简伪装空屏 (Guest Zen Stealth Hero) */
.stealth-empty-hero {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: default;
  user-select: none;
}

.stealth-ambient-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.08) 0%, rgba(14, 165, 233, 0.04) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
}

.stealth-center-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 1;
}

.stealth-logo-svg {
  filter: drop-shadow(0 4px 16px rgba(249, 115, 22, 0.25));
  margin-bottom: 1.25rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stealth-empty-hero:hover .stealth-logo-svg {
  transform: scale(1.08) rotate(-4deg);
}

.stealth-title {
  font-size: 2.2rem;
  font-weight: 850;
  letter-spacing: -0.04em;
  color: var(--text-title);
  margin-bottom: 0.6rem;
}

.stealth-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.6;
}

.dropzone {
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background-color: var(--bg-stage);
  cursor: pointer;
  transition: all 0.2s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary-blue);
  background-color: var(--primary-blue-light);
}

.form-control {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  color: var(--text-title);
  font-size: 0.9rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--primary-blue-glow);
}

/* 按钮规范 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  color: var(--text-title);
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  min-height: 40px;
}

.btn:hover { background-color: var(--bg-stage); border-color: var(--card-border); }
.btn-primary { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); border-color: transparent; color: #ffffff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3); }
.btn-danger { color: var(--danger-color); }
.btn-danger:hover { background-color: rgba(239, 68, 68, 0.1); border-color: var(--danger-color); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; min-height: 32px; }

/* 权限中心管理页 */
.admin-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

.table-wrapper {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--bg-stage);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--card-border);
}

.data-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-body);
}

.data-table tr:hover td {
  background: var(--bg-stage);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary { background: var(--primary-blue-light); color: var(--primary-blue); border: 1px solid rgba(14, 165, 233, 0.25); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success-color); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger-color); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-muted { background: var(--bg-stage); color: var(--text-muted); border: 1px solid var(--card-border); }

/* 空状态 */
.empty-state-card {
  text-align: center;
  padding: 4.5rem 2rem;
  color: var(--text-muted);
  background-color: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-bento);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  grid-column: span 3;
}

.empty-icon-wrap {
  display: inline-flex;
  padding: 1.25rem;
  border-radius: 50%;
  background: var(--bg-stage);
  color: var(--primary-blue);
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 0.5rem;
}

.empty-subtitle {
  font-size: 0.9rem;
  max-width: 440px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   7. Mobile-First 响应式断点规则 (@media)
   ========================================================================== */
@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .bento-card.bento-hero,
  .bento-card.bento-wide {
    grid-column: span 2;
  }
  .bento-card.bento-square {
    grid-column: span 1;
  }
  .empty-state-card {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .bento-header {
    padding: 0.65rem 1rem;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  /* 移动端搜索框占据次行全宽 */
  .header-center {
    order: 3;
    max-width: 100%;
    width: 100%;
  }

  .bento-search-input {
    height: 44px;
    font-size: 0.9rem;
  }

  /* 移动端 Bento 网格平滑降维为单列触摸 Feed */
  .bento-main-stage {
    padding: 1rem 1rem 5.5rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .bento-card,
  .bento-card.bento-hero,
  .bento-card.bento-wide,
  .bento-card.bento-square {
    grid-column: span 1 !important;
    min-height: auto;
    padding: 1.35rem;
  }

  .empty-state-card {
    grid-column: span 1;
  }

  .fab-upload {
    bottom: 1.5rem;
    right: 1.5rem;
    height: 52px;
    padding: 0 1.25rem 0 1.1rem;
  }

  .category-scroll-ribbon {
    gap: 0.5rem;
  }

  .category-ribbon-pill {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-height: 40px;
  }

  .bento-filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .filter-row-right {
    width: 100%;
  }

  .bento-sort-toggle {
    width: 100%;
    justify-content: space-around;
  }

  .sort-pill {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   8. 极简现代 Auth 认证页面 (Login & Register Bento Aesthetic)
   ========================================================================== */
.auth-page-stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 15% 20%, rgba(249, 115, 22, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 85% 80%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
              var(--bg-stage);
  padding: 1.5rem;
}

.auth-top-bar {
  max-width: 520px;
  width: 100%;
  margin: 0 auto 1.5rem;
}

.auth-card-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-bento-card {
  max-width: 460px;
  width: 100%;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-bento);
  padding: 2.5rem 2.2rem;
  box-shadow: var(--shadow-bento-hover);
  position: relative;
  overflow: hidden;
}

.auth-bento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f97316 0%, #0ea5e9 100%);
}

.auth-brand-center {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.025em;
  margin-top: 1rem;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.5;
}

.auth-mode-segmented {
  display: flex;
  background: var(--bg-stage);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 0.25rem;
  margin-bottom: 1.75rem;
}

.auth-mode-tab {
  flex: 1;
  text-align: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: all 0.2s;
}

.auth-mode-tab:hover {
  color: var(--text-title);
}

.auth-mode-tab.active {
  background: var(--card-bg);
  color: var(--text-title);
  box-shadow: var(--shadow-sm);
}

.auth-error-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger-color);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-title);
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 1rem 0 2.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background-color: var(--bg-stage);
  color: var(--text-title);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s;
}

.auth-input:focus {
  background-color: var(--card-bg);
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--primary-blue-glow);
}

.auth-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 48px;
  width: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  margin-top: 0.75rem;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.auth-footer-hint {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-hint-link {
  color: var(--primary-blue);
  font-weight: 600;
  text-decoration: none;
}

.auth-hint-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   9. Snowflake RBAC 权限中心 (Modern Bento Dashboard)
   ========================================================================== */
.rbac-page-stage {
  min-height: 100vh;
  background-color: var(--bg-stage);
  padding: 1.5rem 2rem 5rem;
}

.rbac-top-header {
  max-width: 1400px;
  margin: 0 auto 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.rbac-header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.rbac-header-titles {
  display: flex;
  flex-direction: column;
}

.rbac-main-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -0.025em;
}

.rbac-main-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.rbac-bento-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.rbac-bento-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .rbac-bento-grid-2 {
    grid-template-columns: 1fr;
  }
}

.rbac-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-bento);
  padding: 2rem;
  box-shadow: var(--shadow-bento);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rbac-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
}

.rbac-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.rbac-card-icon {
  font-size: 1.25rem;
}

.rbac-card-title {
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--text-title);
}

.rbac-pill-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--bg-stage);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
}

.rbac-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.rbac-form-row {
  display: flex;
  gap: 1rem;
}

@media (max-width: 600px) {
  .rbac-form-row {
    flex-direction: column;
  }
}

.rbac-select {
  height: 44px;
  padding: 0 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background-color: var(--bg-stage);
  color: var(--text-title);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all 0.2s;
  width: 100%;
}

.rbac-select:focus {
  background-color: var(--card-bg);
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px var(--primary-blue-glow);
}

.rbac-table-wrapper {
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.rbac-cell-title {
  font-weight: 600;
  color: var(--text-title);
}

.rbac-cell-sub {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.rbac-actor-tag {
  font-size: 0.82rem;
  color: var(--text-body);
}

.rbac-time-cell {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.btn-revoke-pill {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-revoke-pill:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--danger-color);
}

/* 诊断器样式 */
.diagnostic-empty-box {
  padding: 2.2rem 1.5rem;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: var(--bg-stage);
}

.diagnostic-active-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.diagnostic-header-bar {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-stage);
  border: 1px solid var(--card-border);
}

.diagnostic-subject-line {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.diagnostic-subject-line strong {
  color: var(--text-title);
}

.diagnostic-roles-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.role-group-title {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}

.diagnostic-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 600px) {
  .diagnostic-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.metric-quad-card {
  padding: 1rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  text-align: center;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

.metric-quad-card.granted {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.metric-quad-card.denied {
  background: var(--bg-stage);
  border-color: var(--card-border);
}

.metric-quad-card.owner {
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.3);
}

.metric-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-val {
  font-size: 1.15rem;
  font-weight: 800;
}

.metric-quad-card.granted .metric-val {
  color: var(--success-color);
}

.metric-quad-card.denied .metric-val {
  color: var(--text-dim);
}

.metric-quad-card.owner .metric-val {
  color: var(--warm-orange);
}

.metric-sub-tip {
  font-size: 0.68rem;
  color: var(--primary-blue);
  font-weight: 500;
}

.rbac-role-name {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-title);
}

.rbac-desc-cell {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   AI 经验摘要、智能标签集与 Skill 复用样式
   ========================================================================== */
.card-ai-summary {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-top: 0.45rem;
  padding: 0.45rem 0.65rem;
  background: rgba(14, 165, 233, 0.05);
  border: 1px dashed rgba(14, 165, 233, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-body);
}

.ai-spark-icon {
  font-size: 0.82rem;
  flex-shrink: 0;
}

.card-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.card-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  background: var(--bg-stage);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--primary-blue);
  text-decoration: none;
  transition: all 0.18s ease;
}

.card-tag-pill:hover {
  background: var(--primary-blue-light);
  border-color: var(--primary-blue);
}

.tags-ribbon-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding: 0.5rem 0.8rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
}

.tags-ribbon-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.3rem;
}

.tag-pill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  background: var(--bg-stage);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-body);
  text-decoration: none;
  transition: all 0.18s ease;
}

.tag-pill-chip:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: var(--primary-blue-light);
}

.tag-pill-chip.active-tag-pill {
  background: var(--primary-blue);
  color: #ffffff;
  border-color: var(--primary-blue);
  font-weight: 600;
}

.tag-count {
  font-size: 0.68rem;
  opacity: 0.75;
}

.tag-close-x {
  font-size: 0.7rem;
  margin-left: 0.2rem;
}

.ai-expansion-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(14, 165, 233, 0.08));
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
}

.banner-sparkle {
  font-size: 0.95rem;
}

.banner-title {
  font-weight: 600;
  color: var(--text-title);
}

.banner-keyword-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.expanded-kw-pill {
  padding: 0.15rem 0.45rem;
  background: var(--card-bg);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  color: var(--primary-blue);
  font-weight: 500;
}

.viewer-ai-summary-box {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  background: rgba(14, 165, 233, 0.05);
  border-left: 3px solid var(--primary-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-title);
}

.viewer-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.btn-copy-skill {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff !important;
  font-weight: 600;
  border: none;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-copy-skill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.45);
}

.btn-copy-skill.btn-copied,
.btn.btn-copied {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   个人网盘与极客 Master 徽章专属样式
   ========================================================================== */
.master-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(14, 165, 233, 0.15));
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.35);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.15);
  letter-spacing: 0.02em;
}

.card-download-btn:hover {
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  background: rgba(16, 185, 129, 0.08) !important;
}

.btn-primary-action {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}

.btn-primary-action:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
  transform: translateY(-1px);
}

/* 多文件格式色彩标识 */
.badge-fmt-ppt {
  color: #ea580c !important;
  background: rgba(234, 88, 12, 0.1) !important;
  border: 1px solid rgba(234, 88, 12, 0.25) !important;
}

.badge-fmt-pdf {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
}

.badge-fmt-word {
  color: #2563eb !important;
  background: rgba(37, 99, 235, 0.1) !important;
  border: 1px solid rgba(37, 99, 235, 0.25) !important;
}

.badge-fmt-excel {
  color: #059669 !important;
  background: rgba(5, 150, 105, 0.1) !important;
  border: 1px solid rgba(5, 150, 105, 0.25) !important;
}

.badge-fmt-archive {
  color: #8b5cf6 !important;
  background: rgba(139, 92, 246, 0.1) !important;
  border: 1px solid rgba(139, 92, 246, 0.25) !important;
}

/* ==========================================================================
   画廊轮播伪装系统 (Zen Photography Gallery Carousel)
   ========================================================================== */
.gallery-immersive-mode {
  min-height: 100vh;
  overflow: hidden;
}

.gallery-immersive-mode .bento-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 50;
  background: linear-gradient(to bottom, rgba(11, 15, 25, 0.75) 0%, rgba(11, 15, 25, 0.2) 60%, transparent 100%);
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 1.2rem 2.5rem;
}

.gallery-immersive-mode .header-inner {
  max-width: 100%;
}

.gallery-immersive-mode .brand-name {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.gallery-immersive-mode .bento-badge {
  background: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
}

.gallery-immersive-mode .theme-circle-btn {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.gallery-immersive-mode .bento-main-stage {
  max-width: 100%;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
}

.gallery-immersive-mode .gallery-hero-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.gallery-hero-viewport {
  position: relative;
  width: 100%;
  max-width: 1400px;
  height: calc(100vh - 140px);
  min-height: 580px;
  max-height: 860px;
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.45);
  background-color: #0b0f19;
  user-select: none;
}

.gallery-slides-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.gallery-slide-item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(1);
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 9s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-slide-item.active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1.04);
}

.gallery-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 15, 25, 0.92) 0%, rgba(11, 15, 25, 0.45) 45%, rgba(11, 15, 25, 0.15) 100%);
}

.gallery-photo-meta {
  position: absolute;
  bottom: 3.5rem;
  left: 3.5rem;
  max-width: 720px;
  z-index: 2;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: slideMetaIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.gallery-location-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.15);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(8px);
  width: fit-content;
}

.gallery-photo-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.gallery-photo-quote {
  font-size: 1.05rem;
  font-weight: 400;
  color: rgba(241, 245, 249, 0.88);
  font-style: italic;
  line-height: 1.6;
  max-width: 600px;
}

.gallery-exif-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: rgba(203, 213, 225, 0.8);
  background: rgba(15, 23, 42, 0.6);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: fit-content;
  backdrop-filter: blur(6px);
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-nav-btn:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav-prev { left: 2rem; }
.gallery-nav-next { right: 2rem; }

.gallery-controls-bar {
  position: absolute;
  bottom: 3.5rem;
  right: 3.5rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.gallery-dots-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gallery-dot-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.gallery-dot-btn .dot-inner {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-dot-btn.active .dot-inner {
  width: 24px;
  background: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.gallery-counter-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.counter-slash {
  opacity: 0.4;
}

@media (max-width: 768px) {
  .gallery-hero-viewport {
    height: 72vh;
    border-radius: 18px;
  }
  .gallery-immersive-mode .bento-header {
    padding: 0.75rem 1rem;
  }
  .gallery-immersive-mode .gallery-hero-viewport {
    height: 100vh;
    border-radius: 0;
  }
  .gallery-photo-meta {
    bottom: 2rem;
    left: 1.5rem;
    right: 1.5rem;
  }
  .gallery-photo-title {
    font-size: 1.5rem;
  }
  .gallery-controls-bar {
    bottom: 1.5rem;
    right: 1.5rem;
  }
  .gallery-nav-btn {
    display: none;
  }
}
