/* ═══════════════════════════════════════════════════════════════
   藏经阁 · 布局与组件
   结构继承「东风」AppSidebar / AppHeader / AppLayout，
   配色与材质走藏经阁「墨玉青 + 碧玉 + 朱砂」体系。
   ═══════════════════════════════════════════════════════════════ */

/* ── 应用骨架 ── */
.app-layout { display: flex; height: 100vh; position: relative; z-index: 1; }

/* ═══════════════ 侧栏（v1.1 浮动画板）═══════════════
   四边留 16px 外边距，圆角 20，低透明度柔和投影；
   主内容区 margin-left 联动（展开/折叠各一组） */
.sidebar {
  position: fixed;
  top: 16px; left: 16px; bottom: 16px;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(233, 190, 150, 0.12);
  border-radius: 20px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.30), 0 2px 10px rgba(0, 0, 0, 0.18);
  z-index: 10;
  transition: width .30s cubic-bezier(.25,.46,.45,.94), min-width .30s cubic-bezier(.25,.46,.45,.94);
  overflow: hidden;
}
/* 环境柔光斑：两团柔光在面板上极缓慢漂移 + 明暗呼吸（东风同款机制） */
.sidebar::after {
  content: '';
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(46% 34% at 32% 24%, rgba(255, 224, 180, 0.085), transparent 72%),
    radial-gradient(42% 36% at 74% 68%, rgba(240, 190, 140, 0.05), transparent 76%),
    radial-gradient(56% 30% at 50% 96%, rgba(255, 224, 180, 0.04), transparent 78%);
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
  animation: ambientGlow 19s ease-in-out infinite alternate;
}
@keyframes ambientGlow {
  from { transform: translate3d(-1.2%, -2.2%, 0) scale(1);    opacity: .55; }
  to   { transform: translate3d(2.4%, 2.8%, 0) scale(1.08);   opacity: 1; }
}
.sidebar.collapsed { width: var(--sidebar-width-collapsed); min-width: var(--sidebar-width-collapsed); }

/* ── 阁名（铭牌镌刻，东风 .metal-plaque 位置）── */
.gate-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 16px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(233, 190, 150, 0.14);
  position: relative;
  z-index: 1;
}
.gate-seal {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: linear-gradient(160deg, rgba(191,70,56,.30), rgba(135,42,34,.16));
  border: 1px solid rgba(233, 190, 150, 0.30);
  box-shadow: inset 0 1px 0 rgba(210,255,235,.28), 0 6px 20px rgba(0,0,0,.42), 0 0 26px rgba(191,70,56,.18);
  margin-bottom: 10px;
  transition: transform var(--transition-spring), box-shadow var(--transition-normal);
}
.gate-seal:hover { transform: scale(1.06) rotate(-3deg); box-shadow: inset 0 1px 0 rgba(210,255,235,.34), 0 8px 26px rgba(0,0,0,.5), 0 0 34px rgba(191,70,56,.28); }
.gate-plaque {
  display: flex; align-items: baseline; justify-content: center; width: 100%;
}
.gate-plaque .plaque-jade { font-size: 25px; }
.gate-plaque .plaque-cinnabar { font-size: 13px; margin-left: 5px; vertical-align: 1px; }
.gate-sub {
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: 3.5px;
  color: rgba(240, 255, 250, 0.42);
  text-transform: uppercase;
}

/* ── 导航 ── */
.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  z-index: 1;
}
.sidebar-group-label {
  padding: 18px 12px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
  color: rgba(240, 255, 250, 0.34);
  user-select: none;
}
.sidebar-group-label:first-child { padding-top: 6px; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: color .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
  color: #dcc4ad;                      /* 东风 #d9c9b2 暖砂 → 藏经阁 青砂 */
  border: 1px solid transparent;
  user-select: none;
}
/* hover：不加背景高亮，只做文字波浪跳动（东风招牌"兴奋感"交互） */
.nav-item:hover { background: transparent; border-color: transparent; box-shadow: none; color: #ffe9d4; }
.nav-item:hover .wave-char,
.nav-item:hover .nav-icon { animation: waveJump .55s ease-in-out infinite; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(191,70,56,.26) 0%, rgba(163,54,43,.14) 55%, rgba(107,32,26,.10) 100%);
  border-color: rgba(221, 101, 87, 0.42);
  color: #effff8;
  box-shadow: inset 0 1px 0 rgba(210,255,235,.22), inset 0 -1px 0 rgba(0,0,0,.30), 0 3px 16px rgba(191,70,56,.18);
}
.nav-icon { font-size: 18px; width: 26px; text-align: center; flex-shrink: 0; }
.nav-label { font-size: 14.5px; font-weight: 500; white-space: nowrap; letter-spacing: .4px; overflow: hidden; }
.wave-char { display: inline-block; will-change: transform; }
.active-indicator {
  position: absolute;
  left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  background: linear-gradient(180deg, #f0cf8a, #d9a441 55%, #94671f);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px rgba(217, 164, 65, 0.65);
}
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-group-label,
.sidebar.collapsed .quick-panel,
.sidebar.collapsed .gate-sub,
.sidebar.collapsed .gate-plaque .plaque-cinnabar { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .gate-logo { padding: 16px 8px 12px; }
.sidebar.collapsed .gate-plaque .plaque-jade { font-size: 15px; letter-spacing: 1px; }
.sidebar.collapsed .gate-seal { width: 40px; height: 40px; font-size: 19px; border-radius: 11px; }

/* ── 快捷操作面板（东风 4 格快捷面板）── */
.quick-panel {
  padding: 10px 12px;
  border-top: 1px solid rgba(233, 190, 150, 0.12);
  position: relative;
  z-index: 1;
}
.quick-panel-title {
  font-size: 10.5px; letter-spacing: 2.5px; font-weight: 700;
  color: rgba(240, 255, 250, 0.36); margin-bottom: 8px;
}
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px;
  border-radius: 9px;
  border: 1px solid rgba(233, 190, 150, 0.14);
  background: rgba(255, 232, 208, 0.04);
  color: #f0d9c2;
  font-size: 11px;
  cursor: pointer;
  transition: all .2s ease;
  font-family: inherit;
}
.quick-btn:hover { background: rgba(191,70,56,.20); border-color: rgba(221,101,87,.42); color: #f0fff9; transform: translateY(-1px); }
.quick-btn i { font-style: normal; font-size: 15px; }

/* ── 侧栏底部（东风状态条 + 版本号 + 雾气时钟）── */
.sidebar-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid rgba(233, 190, 150, 0.12);
  position: relative;
  z-index: 1;
  font-size: 11px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-error); flex-shrink: 0;
}
.status-dot.online { background: var(--color-success); box-shadow: 0 0 8px rgba(63,157,110,.5); animation: breathe 3s ease-in-out infinite; }
.version-script {
  font-family: var(--font-brush);
  font-size: 17px;
  letter-spacing: 1.2px;
  line-height: 1;
  background: linear-gradient(178deg, #f7e6b4 0%, #e3c374 35%, #c99a41 62%, #9c7627 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.65)) drop-shadow(0 0 9px rgba(217,164,65,.25));
  transform: rotate(-1.5deg);
  display: inline-block;
}
.footer-clock {
  margin-left: auto;
  display: inline-flex; align-items: baseline; gap: 1px;
  font-family: 'Segoe UI', 'Noto Sans SC', sans-serif;
  font-weight: 200; font-size: 13px; letter-spacing: 1.2px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 232, 205, 0.45);
  text-shadow: 0 0 6px rgba(255, 224, 180, 0.30), 0 0 16px rgba(191,70,56,.16);
  pointer-events: none; user-select: none;
}

/* 侧栏开合扣（东风白玉扣 → 藏经阁碧玉扣） */
.toggle-btn {
  position: absolute; right: -12px; top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 48px;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(168deg, rgba(216,255,238,.22) 0%, rgba(180,244,214,.11) 52%, rgba(233,190,150,.06) 100%);
  border: 1px solid rgba(200,255,230,.26);
  border-left: none;
  box-shadow: inset 0 1px 0 rgba(230,255,244,.40), inset 0 -4px 8px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.28);
  color: rgba(230,255,244,.92);
  cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
  z-index: 12;
}
.toggle-btn:hover { filter: brightness(1.15); color: #fff; }

/* ═══════════════ 主内容区 ═══════════════ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: calc(var(--sidebar-width) + 32px);   /* 16px 左外边距 + 面板宽 + 16px 间隙 */
  transition: margin-left .30s cubic-bezier(.25,.46,.45,.94);
}
body.sb-collapsed .main-content { margin-left: calc(var(--sidebar-width-collapsed) + 32px); }

/* ── 顶栏 ── */
.topbar {
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid rgba(233, 190, 150, 0.10);
  background: rgba(42, 16, 13, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  z-index: 5;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { font-size: 18px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.topbar-crumb { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-time {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-secondary); font-variant-numeric: tabular-nums;
}
.topbar-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(233, 190, 150, 0.16);
  background: rgba(255, 232, 208, 0.05);
  color: var(--text-secondary);
  cursor: pointer; font-size: 14px;
  transition: all .2s ease;
}
.topbar-btn:hover { background: rgba(191,70,56,.18); border-color: rgba(221,101,87,.42); color: #f0fff9; transform: translateY(-1px); }

/* ── 页面容器（东风 max-width 1400 / padding 32）── */
.page-container {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 56px;
}
.page-inner { max-width: 1400px; margin: 0 auto; }
.page-enter { animation: springUp .45s cubic-bezier(.34,1.56,.64,1) both; }

/* ── 页头 ── */
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 26px; font-weight: 700; letter-spacing: .5px; display: flex; align-items: center; gap: 10px; }
.page-head p { margin-top: 6px; color: var(--text-secondary); font-size: 13.5px; max-width: 900px; }
.page-head .head-tag {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(191,70,56,.16); color: var(--color-primary-200);
  border: 1px solid rgba(221,101,87,.28);
}

/* ── 卡片 ── */
.card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-rim);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  padding: 20px;
  transition: transform .3s cubic-bezier(.34,1.4,.64,1), box-shadow .3s ease, border-color .3s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--panel-shadow-lift); border-color: var(--panel-rim-strong); }
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15.5px; font-weight: 700; margin-bottom: 4px;
}
.card-sub { font-size: 12.5px; color: var(--text-secondary); }
.card-grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1240px) { .cols-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 900px)  { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* ── 统计卡 ── */
.stat-card { display: flex; flex-direction: column; gap: 2px; }
.stat-value {
  font-size: 34px; font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.5px; line-height: 1.15;
  background: var(--gradient-jade);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 12px; color: var(--text-secondary); letter-spacing: .5px; }
.stat-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* ── 徽章 ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
  background: rgba(255, 232, 208, 0.08); color: var(--text-secondary);
  border: 1px solid rgba(255, 232, 208, 0.10);
  white-space: nowrap;
}
.badge-success { background: rgba(63,157,110,.14);  color: #6ee7b7; border-color: rgba(63,157,110,.28); }
.badge-warning { background: rgba(217,154,43,.14);  color: #f3c877; border-color: rgba(217,154,43,.30); }
.badge-error   { background: rgba(226,86,74,.15);   color: #f6a196; border-color: rgba(226,86,74,.30); }
.badge-info    { background: rgba(79,159,212,.15);  color: #9fd0f0; border-color: rgba(79,159,212,.30); }
.badge-jade    { background: rgba(191,70,56,.16);  color: var(--color-primary-200); border-color: rgba(221,101,87,.30); }
.badge-cinnabar{ background: rgba(226,86,74,.16);   color: #f3a294; border-color: rgba(226,86,74,.32); }

/* ── 玉质按钮（东风 GlassButton 结构，藏经阁配色）── */
.glass-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--jade-rim);
  border-radius: 13px;
  font-weight: 600; font-size: 14px;
  letter-spacing: .3px;
  padding: 10px 20px;
  cursor: pointer;
  position: relative; overflow: hidden;
  font-family: inherit; white-space: nowrap;
  text-shadow: 0 1px 1px rgba(0,0,0,.30);
  transition: transform .2s cubic-bezier(.34,1.4,.64,1), box-shadow .26s ease, filter .26s ease, border-color .26s ease;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.40),
    inset 0 -7px 14px rgba(0,0,0,.22),
    inset 0 0 16px rgba(255,255,255,.05),
    0 3px 10px rgba(0,0,0,.38);
}
.glass-btn::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(58% 46% at 24% 8%, rgba(255,255,255,.32), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 44%);
  mix-blend-mode: screen;
}
.glass-btn > * { position: relative; z-index: 1; }
.glass-btn:active { transform: translateY(1px) scale(.985); }
.glass-btn.sm { padding: 6px 14px;  font-size: 13px; }
.glass-btn.lg { padding: 14px 28px; font-size: 16px; }

/* 碧玉（主操作）——东风紫玉 */
.glass-btn.primary {
  background: linear-gradient(168deg, #d97a62 0%, #b8463a 34%, #93332a 68%, #6e241d 100%);
  border-color: rgba(255, 214, 196, 0.34);
  color: #fff1ec;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 214, .48),
    inset 0 -7px 14px rgba(58, 10, 8, .46),
    inset 0 0 18px rgba(255, 180, 150, .12),
    0 4px 14px rgba(40, 10, 8, .48),
    0 0 18px rgba(191, 70, 56, .20);
}
.glass-btn.primary:hover { transform: translateY(-1px); filter: brightness(1.07); }

/* 朱砂（强调/CTA）——东风黄玉 */
.glass-btn.accent {
  background: linear-gradient(168deg, #f4dca4 0%, #dcae5e 34%, #b98636 68%, #8f651f 100%);
  border-color: rgba(255, 238, 200, 0.42);
  color: #43300a;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 224, .68),
    inset 0 -7px 14px rgba(80, 55, 10, .34),
    inset 0 0 18px rgba(255, 232, 156, .20),
    0 4px 14px rgba(72, 48, 8, .42),
    0 0 18px rgba(222, 182, 92, .22);
}
.glass-btn.accent:hover { transform: translateY(-1px); filter: brightness(1.06); }

/* 白玉（次要操作）——同东风 */
.glass-btn.ghost {
  background:
    radial-gradient(64% 52% at 24% 8%, rgba(255,255,255,.22), transparent 62%),
    linear-gradient(168deg, rgba(246,252,248,.20) 0%, rgba(226,238,231,.11) 52%, rgba(206,222,214,.06) 100%);
  border-color: rgba(238, 248, 242, 0.26);
  color: rgba(240, 250, 246, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.40),
    inset 0 -6px 12px rgba(0,0,0,.18),
    inset 0 0 14px rgba(255,255,255,.05),
    0 2px 8px rgba(0,0,0,.30);
}
.glass-btn.ghost:hover { filter: brightness(1.10); transform: translateY(-1px); }

/* 血玉（危险操作）——同东风 */
.glass-btn.danger {
  background: linear-gradient(168deg, #d0726a 0%, #ac453d 42%, #822e28 100%);
  border-color: rgba(255, 196, 186, 0.32);
  color: #fff3f1;
  box-shadow:
    inset 0 1px 0 rgba(255,216,208,.42),
    inset 0 -6px 12px rgba(58,10,8,.42),
    inset 0 0 16px rgba(255,170,158,.10),
    0 3px 10px rgba(60,10,10,.42),
    0 0 14px rgba(198,72,62,.20);
}
.glass-btn.danger:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* 亮翠玉（原东风「亮黄玉」的藏经阁版：由下打光的透亮玉体） */
.glass-btn.neon {
  border: 1px solid rgba(255, 246, 205, 0.48);
  color: #3d2a06;
  letter-spacing: .5px;
  text-shadow: 0 1px 0 rgba(255, 252, 230, 0.60);
  background: linear-gradient(to top,
    #fff6d2 1px, #ffeeb4 2px, #ffe7a2 3px, #f8db8b 5px, #eecb6d 7px,
    #e2ba52 9px, #d5aa3c 12px, #c69a2c 16px, #b58a20 20px,
    #a2791b 26px, #8c6817 34px, #7d5c14 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 244, .78),
    inset 0 -12px 20px rgba(255, 226, 150, .22),
    inset 1px 0 0 rgba(255, 250, 220, .35),
    inset -1px 0 0 rgba(255, 250, 220, .35),
    0 4px 14px rgba(74, 50, 8, .45),
    0 0 22px rgba(238, 198, 96, .28);
}
.glass-btn.neon::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none; z-index: 1;
  background:
    linear-gradient(90deg, rgba(255, 246, 208, 0.70), rgba(225, 255, 244, 0) 13px),
    linear-gradient(270deg, rgba(255, 246, 208, 0.70), rgba(225, 255, 244, 0) 13px);
  -webkit-mask: linear-gradient(to top, #000 0, #000 6px, rgba(0,0,0,.40) 12px,
    rgba(0,0,0,.15) 18px, rgba(0,0,0,.09) 24px, rgba(0,0,0,.02) 30px, rgba(0,0,0,.02) 100%);
          mask: linear-gradient(to top, #000 0, #000 6px, rgba(0,0,0,.40) 12px,
    rgba(0,0,0,.15) 18px, rgba(0,0,0,.09) 24px, rgba(0,0,0,.02) 30px, rgba(0,0,0,.02) 100%);
}
.glass-btn.neon > * { position: relative; z-index: 2; }
.glass-btn.neon:hover {
  transform: translateY(-1px); filter: brightness(1.08);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 248, .85),
    inset 1px 0 0 rgba(255, 244, 205, .45),
    inset -1px 0 0 rgba(255, 244, 205, .45),
    0 6px 20px rgba(74, 50, 8, .5),
    0 0 30px rgba(240, 200, 100, .42);
}

/* ── 诸葛 .btn 体系（实心渐变，用于浅底/表单场景）── */
.zg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: 8px;
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap; position: relative; overflow: hidden;
  transition: transform .2s cubic-bezier(.25,.46,.45,.94), box-shadow .2s ease, background .2s ease;
}
.zg-btn:active { transform: scale(.96); }
.zg-btn:hover { transform: translateY(-1px); }
.zg-btn.primary { background: var(--gradient-primary); color: #fff; box-shadow: 0 4px 16px rgba(191,70,56,.30); }
.zg-btn.accent  { background: var(--gradient-accent);  color: #fff; box-shadow: 0 4px 20px rgba(217,164,65,.30); }
.zg-btn.ghost   { background: rgba(255,232,208,.08); color: var(--text-primary); backdrop-filter: blur(12px); border: 1px solid rgba(255,232,208,.14); }
.zg-btn.danger  { background: rgba(226,86,74,.15); color: #f6a196; border: 1px solid rgba(226,86,74,.22); }

/* ── 圆形玻璃按钮（来福控制条，42px / 控制条内 40px）── */
.orb-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.45);
  background: linear-gradient(160deg, rgba(255,255,255,0.22), rgba(255,255,255,0.06));
  backdrop-filter: blur(10px) saturate(1.5);
  -webkit-backdrop-filter: blur(10px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -1px 0 rgba(255,255,255,0.08), 0 5px 16px rgba(0,0,0,0.28);
  color: rgba(255,255,255,0.96);
  opacity: .75;
  cursor: pointer;
  display: grid; place-items: center;
  transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
}
.orb-btn:hover { opacity: 1; transform: translateY(-1px); }
.orb-btn svg { width: 19px; height: 19px; }

/* ── 胶囊切换器（诸葛 .lumora-switcher）── */
.pill-switcher {
  display: inline-flex; gap: 4px; padding: 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pill-switcher button {
  border: none; background: transparent;
  color: rgba(255,255,255,0.5);
  font-size: 11px; padding: 7px 13px;
  border-radius: 999px; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .25s;
  font-family: inherit;
}
.pill-switcher button:hover { color: rgba(255,255,255,0.8); }
.pill-switcher button.active { color: #fff; background: rgba(255,255,255,0.18); border-bottom-color: #fff; }

/* ── 代码块 + 复制 ── */
.code-wrap {
  position: relative;
  border-radius: 12px;
  border: 1px solid rgba(233, 190, 150, 0.14);
  background: rgba(26, 8, 6, 0.62);
  overflow: hidden;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px 7px 12px;
  border-bottom: 1px solid rgba(233, 190, 150, 0.10);
  background: rgba(255, 232, 208, 0.03);
}
.code-lang { font-size: 11px; letter-spacing: 1.4px; color: var(--text-tertiary); text-transform: uppercase; font-family: var(--font-mono); }
.code-wrap pre {
  margin: 0; padding: 13px 14px;
  overflow-x: auto;
  font-size: 12.4px; line-height: 1.65;
  color: #f2d9b8;
  max-height: 420px;
}
.copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(221, 101, 87, 0.34);
  background: rgba(191, 70, 56, 0.14);
  color: var(--color-primary-200);
  font-size: 11.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all .2s ease;
  white-space: nowrap;
}
.copy-btn:hover { background: rgba(191,70,56,.28); color: #eafff8; transform: translateY(-1px); }
.copy-btn.copied { background: rgba(63,157,110,.34); color: #d9ffee; border-color: rgba(110,231,183,.55); }

/* ── 表格 ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; font-weight: 700; font-size: 12px;
  letter-spacing: .6px; color: var(--text-secondary);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(233, 190, 150, 0.20);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(233, 190, 150, 0.07);
  vertical-align: top;
}
.data-table tbody tr { transition: background .18s ease; }
.data-table tbody tr:hover { background: rgba(191, 70, 56, 0.07); }
.data-table .mono { font-size: 12px; color: #eccb96; }

/* ── 搜索框 / 过滤器 ── */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.search-input {
  flex: 1; min-width: 220px;
  padding: 10px 14px 10px 36px;
  border-radius: 11px;
  border: 1px solid rgba(233, 190, 150, 0.18);
  background: rgba(26, 8, 6, 0.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23c99a41' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
  color: var(--text-primary);
  font-family: inherit; font-size: 13.5px;
  outline: none;
  transition: all .2s ease;
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-input:focus { border-color: rgba(221, 101, 87, 0.55); box-shadow: 0 0 0 3px rgba(191,70,56,.14); }
.filter-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(233, 190, 150, 0.16);
  background: rgba(255, 232, 208, 0.04);
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all .2s ease;
  white-space: nowrap;
}
.filter-chip:hover { border-color: rgba(221,101,87,.45); color: #eafff8; transform: translateY(-1px); }
.filter-chip.active { background: rgba(191,70,56,.24); border-color: rgba(221,101,87,.55); color: #effff8; }

/* ── 列表行 ── */
.row-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(233, 190, 150, 0.09);
  background: rgba(255, 232, 208, 0.025);
  transition: all .22s ease;
}
.row-item:hover { border-color: var(--panel-rim-strong); background: rgba(191,70,56,.07); transform: translateY(-1px); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 13.8px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-desc { font-size: 12.4px; color: var(--text-secondary); margin-top: 4px; line-height: 1.6; }
.row-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

/* ── 色板 ── */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.swatch {
  border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(233, 190, 150, 0.14);
  background: rgba(255, 232, 208, 0.03);
}
.swatch-chip { height: 56px; }
.swatch-meta { padding: 8px 10px; }
.swatch-name { font-size: 12px; font-weight: 700; }
.swatch-hex { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.swatch-use { font-size: 10.5px; color: var(--text-secondary); margin-top: 3px; }

/* ── 演示区（按钮/菜单预览的舞台）── */
.stage {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 18px;
  border-radius: 12px;
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(191,70,56,.10), transparent 60%),
    rgba(26, 8, 6, 0.42);
  border: 1px solid rgba(233, 190, 150, 0.10);
}

/* ── 密钥面板 ── */
.vault-warn {
  display: flex; gap: 10px;
  padding: 12px 15px;
  border-radius: 12px;
  background: rgba(226,86,74,.10);
  border: 1px solid rgba(226,86,74,.30);
  color: #f7c3ba;
  font-size: 12.6px;
  line-height: 1.65;
  margin-bottom: 16px;
}
.vault-value {
  font-family: var(--font-mono);
  font-size: 12.4px;
  color: #eccb96;
  word-break: break-all;
  line-height: 1.55;
}
.vault-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(233, 190, 150, 0.09);
  background: rgba(255, 232, 208, 0.025);
}
@media (max-width: 900px) { .vault-row { grid-template-columns: 1fr; } }
.vault-label { font-size: 13px; font-weight: 700; }
.vault-tag { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.vault-actions { display: flex; gap: 6px; }

/* ── 弹层（新增密钥 / 详情）── */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 6, 4, 0.68);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-mask.open { display: flex; animation: fadeIn .2s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(720px, 100%);
  max-height: 86vh; overflow-y: auto;
  background: var(--panel-bg-overlay);
  border: 1px solid var(--panel-rim-strong);
  border-radius: 20px;
  box-shadow: var(--panel-shadow-overlay);
  padding: 22px;
  animation: springIn .38s cubic-bezier(.34,1.56,.64,1) both;
}
.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 5px; font-weight: 600; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(233, 190, 150, 0.18);
  background: rgba(26, 8, 6, 0.5);
  color: var(--text-primary);
  font-family: inherit; font-size: 13px;
  outline: none;
}
.form-textarea { min-height: 74px; resize: vertical; font-family: var(--font-mono); font-size: 12.4px; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: rgba(221,101,87,.55); box-shadow: 0 0 0 3px rgba(191,70,56,.14); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ── Toast ── */
.toast-host {
  position: fixed; right: 20px; bottom: 22px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 220px; max-width: 380px;
  padding: 12px 15px;
  border-radius: 12px;
  background: var(--panel-bg-overlay);
  border: 1px solid var(--panel-rim-strong);
  border-left: 3px solid var(--color-primary-400);
  box-shadow: var(--panel-shadow-overlay);
  font-size: 13px;
  animation: toastIn .45s cubic-bezier(.34,1.4,.64,1) both;
}
.toast.error { border-left-color: var(--color-error); }
@keyframes toastIn {
  0%   { transform: translateX(100%) scale(.8); opacity: 0; }
  60%  { transform: translateX(-5%) scale(1.02); }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}

/* ── 章节锚点小标题 ── */
.sec-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700;
  margin: 30px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--color-primary-500);
}
.sec-title .sec-hint { font-size: 12px; font-weight: 400; color: var(--text-tertiary); }
.sec-title:first-child { margin-top: 0; }

/* ── 空状态 ── */
.empty-state {
  padding: 46px 20px; text-align: center;
  color: var(--text-tertiary); font-size: 13.5px;
}
.empty-state .es-icon { font-size: 34px; display: block; margin-bottom: 10px; opacity: .6; }

/* ── 智能体卡 ── */
.agent-card { position: relative; overflow: hidden; }
.agent-num {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--agent-dim-bg, rgba(255,232,208,.08));
  color: var(--agent-dim-fg, #f0d9c2);
  border: 1px solid var(--agent-dim-bd, rgba(255,232,208,.14));
}
.dim-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ── 响应式 ── */
@media (max-width: 900px) {
  .page-container { padding: 20px 16px 48px; }
  .sidebar { transform: translateX(-120%); transition: transform .3s ease; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content, body.sb-collapsed .main-content { margin-left: 0; }
  .topbar { padding: 0 14px; }
  .topbar-crumb { display: none; }
}

/* ═══════════════ 特效库（v1.2）═══════════════ */
/* 演示舞台通用盒 */
.demo-box {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 232, 208, 0.07);
  border: 1px solid rgba(233, 190, 150, 0.22);
  font-size: 13px;
}
/* 各特效演示类（keyframes 定义在 theme.css / 此处） */
.demo-spring   { animation: springIn .6s cubic-bezier(.34,1.56,.64,1) both; }
.demo-up       { animation: springUp .6s cubic-bezier(.34,1.56,.64,1) both; }
.demo-stagger  { animation: staggerIn .5s ease-out both; }
.demo-breathe  { animation: breathe 3s ease-in-out infinite; }
.demo-glow     { animation: glowPulse 2s ease-in-out infinite; }
.demo-toastlike{ animation: toastIn 1.8s cubic-bezier(.34,1.4,.64,1) infinite; }
.demo-ambient  {
  width: 120px; height: 80px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,214,160,.18), transparent);
  animation: ambientGlow 9s ease-in-out infinite alternate;
}
.fx-dot { width: 12px; height: 12px; border-radius: 50%; background: #e6bd6f; display: inline-block; }
@keyframes stampIn {
  0%   { transform: scale(.92) rotate(-1.5deg); opacity: 0; }
  60%  { transform: scale(1.02) rotate(1deg);   opacity: 1; }
  100% { transform: scale(1) rotate(0);         opacity: 1; }
}
.demo-stamp {
  animation: stampIn 2.2s ease-out infinite;
  color: #f3a294; border-color: rgba(226,86,74,.4);
  background: rgba(226,86,74,.08); font-weight: 800; letter-spacing: 2px;
}
/* 用户录入特效的沙箱预览 */
.fx-frame {
  width: 100%; height: 130px;
  border: 0; border-radius: 10px;
  background: #0b1e1a;
}

/* ── 诸葛 care-btn 关怀按钮组（v1.3 补：特效/按钮预览渲染用）── */
.care-btn { display:inline-flex; align-items:center; gap:5px; padding:6px 14px; border-radius:10px; border:1px solid transparent; font-size:12.5px; font-weight:600; cursor:pointer; white-space:nowrap; font-family:inherit; transition: all .2s ease; }
.care-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.care-btn:active { transform: translateY(0) scale(.97); }
.care-btn-primary { background: linear-gradient(135deg,#bf4638,#a1362b); color:#fff; box-shadow: 0 3px 10px rgba(191,70,56,.25); }
.care-btn-success { background: linear-gradient(135deg,#3f9d6e,#2f7d56); color:#fff; box-shadow: 0 3px 10px rgba(63,157,110,.25); }
.care-btn-warn { background: rgba(217,154,43,.10); border-color: rgba(217,154,43,.28); color:#d9a441; }
.care-btn-ghost { background: rgba(255,232,208,.72); border-color: rgba(191,70,56,.20); color:#872a22; }
.care-btn-lg { padding: 9px 22px; font-size: 13.5px; border-radius: 12px; }

/* ── 代码块折叠（v1.3.2：默认折叠，点击展开）── */
.code-wrap.collapsed pre { display: none; }
.code-head { cursor: pointer; user-select: none; }
.code-head-actions { display: inline-flex; align-items: center; gap: 8px; }
.code-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; background: transparent;
  color: var(--text-tertiary);
  font-size: 11.5px; cursor: pointer; font-family: inherit; padding: 2px 4px;
}
.code-toggle:hover { color: var(--color-primary-200); }
.code-toggle .chev { display: inline-block; transition: transform .2s ease; font-size: 10px; }
.code-wrap:not(.collapsed) .code-toggle .chev { transform: rotate(90deg); }
