/* ============================================
   小说创作台 - Q版修仙梦幻游戏化主题
   ============================================ */

/* === 色彩变量 === */
:root {
  --xg-bg1: #1a0533;
  --xg-bg2: #0d1b2a;
  --xg-panel: rgba(30,10,60,0.85);
  --xg-panel-light: rgba(50,20,90,0.7);
  --xg-gold: #ffd700;
  --xg-gold-dim: #b8960f;
  --xg-green: #00e676;
  --xg-pink: #ff4081;
  --xg-purple: #b388ff;
  --xg-blue: #64b5f6;
  --xg-text: #f5f0e8;
  --xg-text-dim: #a89ec8;
  --xg-border: rgba(255,215,0,0.3);
  --xg-glow: rgba(255,215,0,0.15);
  --xg-radius: 16px;
}

/* === 统一游戏容器 === */
.xg-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: linear-gradient(135deg, var(--xg-bg1) 0%, var(--xg-bg2) 50%, #0a0f1a 100%);
  color: var(--xg-text);
  font-family: 'Microsoft YaHei', sans-serif;
  overflow: hidden;
  position: relative;
}

/* 星空背景粒子 */
.xg-stars {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(255,215,0,0.4), transparent),
    radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(179,136,255,0.4), transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 15% 85%, rgba(255,215,0,0.3), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(255,255,255,0.5), transparent);
  animation: xg-stars-twinkle 4s ease-in-out infinite alternate;
}
@keyframes xg-stars-twinkle {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* === 顶部修仙者状态栏 === */
.xg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(90deg, rgba(30,10,60,0.95), rgba(13,27,42,0.95));
  border-bottom: 2px solid var(--xg-border);
  position: relative;
  z-index: 10;
  min-height: 60px;
}
.xg-topbar::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--xg-gold), transparent);
}

/* 左侧：洞府名称 + 修仙者信息 */
.xg-topbar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}
.xg-author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--xg-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: radial-gradient(circle, rgba(255,215,0,0.2), rgba(30,10,60,0.8));
  box-shadow: 0 0 12px rgba(255,215,0,0.3);
}
.xg-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.xg-author-name {
  font-size: 15px;
  font-weight: bold;
  color: var(--xg-gold);
  text-shadow: 0 0 8px rgba(255,215,0,0.4);
}
.xg-author-realm {
  font-size: 12px;
  color: var(--xg-purple);
  display: flex;
  align-items: center;
  gap: 5px;
}
.xg-realm-badge {
  background: linear-gradient(135deg, rgba(179,136,255,0.3), rgba(100,181,246,0.2));
  border: 1px solid rgba(179,136,255,0.5);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
}

/* 中间：灵力条 */
.xg-topbar-center {
  flex: 1;
  max-width: 400px;
  margin: 0 20px;
}
.xg-spirit-bar {
  position: relative;
  height: 22px;
  background: rgba(0,0,0,0.4);
  border-radius: 11px;
  border: 1px solid rgba(255,215,0,0.3);
  overflow: hidden;
}
.xg-spirit-fill {
  height: 100%;
  border-radius: 11px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7, #ffd700);
  transition: width 0.8s ease;
  position: relative;
}
.xg-spirit-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: xg-spirit-shine 2s ease-in-out infinite;
}
@keyframes xg-spirit-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.xg-spirit-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  white-space: nowrap;
}

/* 右侧：统计数据 */
.xg-topbar-right {
  display: flex;
  gap: 12px;
}
.xg-stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--xg-text-dim);
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  padding: 3px 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.xg-stat-item .xg-stat-icon {
  font-size: 14px;
}
.xg-stat-item .xg-stat-val {
  color: var(--xg-gold);
  font-weight: bold;
}

/* === 主体布局 === */
.xg-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 5;
}

/* === 左侧设施导航栏 === */
.xg-sidebar {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 0;
  gap: 8px;
  background: linear-gradient(180deg, rgba(30,10,60,0.9), rgba(13,27,42,0.9));
  border-right: 1px solid var(--xg-border);
  overflow-y: auto;
  z-index: 8;
}
.xg-sidebar::-webkit-scrollbar { width: 0; }

/* 设施按钮 */
.xg-facility {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  width: 68px;
  border: 1px solid transparent;
}
.xg-facility:hover {
  background: rgba(255,215,0,0.08);
  border-color: rgba(255,215,0,0.2);
  transform: scale(1.05);
}
.xg-facility.active {
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(179,136,255,0.1));
  border-color: var(--xg-gold);
  box-shadow: 0 0 15px rgba(255,215,0,0.2), inset 0 0 10px rgba(255,215,0,0.05);
}
.xg-facility.active::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: 14px;
  border: 1px solid var(--xg-gold);
  animation: xg-facility-glow 2s ease-in-out infinite alternate;
}
@keyframes xg-facility-glow {
  0% { box-shadow: 0 0 5px rgba(255,215,0,0.2); }
  100% { box-shadow: 0 0 15px rgba(255,215,0,0.4); }
}
.xg-facility-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: radial-gradient(circle, rgba(255,215,0,0.15), rgba(30,10,60,0.6));
  border: 1px solid rgba(255,215,0,0.3);
  transition: all 0.3s ease;
}
.xg-facility.active .xg-facility-icon {
  background: radial-gradient(circle, rgba(255,215,0,0.3), rgba(179,136,255,0.2));
  border-color: var(--xg-gold);
  box-shadow: 0 0 10px rgba(255,215,0,0.3);
  transform: scale(1.1);
}
.xg-facility-name {
  font-size: 10px;
  color: var(--xg-text-dim);
  text-align: center;
  line-height: 1.2;
}
.xg-facility.active .xg-facility-name {
  color: var(--xg-gold);
  font-weight: bold;
}
/* 未解锁状态 */
.xg-facility.locked {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.xg-facility.locked .xg-facility-icon {
  filter: grayscale(1);
}
.xg-facility-lock {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 10px;
}
/* 有未完成项角标 */
.xg-facility-badge {
  position: absolute;
  top: 2px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--xg-pink);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(255,64,129,0.5);
}

/* ★ 核心4步 - 大图标+序号 */
.xg-facility-core {
  padding: 10px 6px;
  background: rgba(255,215,0,0.03);
  border: 1px solid rgba(255,215,0,0.1);
  margin-bottom: 4px;
}
.xg-facility-core .xg-facility-icon {
  width: 40px;
  height: 40px;
  font-size: 20px;
}
.xg-facility-core .xg-facility-name {
  font-size: 11px;
  color: var(--xg-text-secondary, #ccc);
}
.xg-facility-step {
  font-size: 9px;
  color: var(--xg-gold);
  opacity: 0.7;
  margin-top: -2px;
}
.xg-facility-core.active .xg-facility-step {
  opacity: 1;
}
/* ★ 分割线 */
.xg-sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,215,0,0.3), transparent);
  margin: 8px 4px;
}
/* ★ 辅助功能 - 小图标 */
.xg-facility-aux {
  padding: 5px 4px;
  opacity: 0.75;
}
.xg-facility-aux .xg-facility-icon {
  width: 28px;
  height: 28px;
  font-size: 14px;
}
.xg-facility-aux .xg-facility-name {
  font-size: 9px;
}
.xg-facility-aux:hover {
  opacity: 1;
}

/* === 右侧操作面板 === */
.xg-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  position: relative;
}
.xg-main::-webkit-scrollbar { width: 6px; }
.xg-main::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.xg-main::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--xg-gold-dim), var(--xg-purple));
  border-radius: 3px;
}

/* === 修仙主题面板 === */
.xg-panel {
  background: var(--xg-panel);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,215,0,0.1);
  animation: xg-panel-in 0.4s ease-out;
}
@keyframes xg-panel-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.xg-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 20px; right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--xg-gold), transparent);
}
.xg-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,215,0,0.15);
}
.xg-panel-title-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.4));
}
.xg-panel-title-text {
  font-size: 18px;
  font-weight: bold;
  color: var(--xg-gold);
  text-shadow: 0 0 10px rgba(255,215,0,0.3);
}
.xg-panel-title-extra {
  margin-left: auto;
  font-size: 12px;
  color: var(--xg-text-dim);
}

/* === 修仙主题按钮 === */
.xg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--xg-gold);
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(179,136,255,0.1));
  color: var(--xg-gold);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.25s ease;
  text-shadow: 0 0 6px rgba(255,215,0,0.3);
}
.xg-btn:hover {
  background: linear-gradient(135deg, rgba(255,215,0,0.25), rgba(179,136,255,0.2));
  box-shadow: 0 0 15px rgba(255,215,0,0.3);
  transform: scale(1.03);
}
.xg-btn:active {
  transform: scale(0.97);
  box-shadow: 0 0 8px rgba(255,215,0,0.2);
}
.xg-btn-primary {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a0533;
  border: none;
  text-shadow: none;
  font-weight: bold;
}
.xg-btn-primary:hover {
  background: linear-gradient(135deg, #ffe44d, #ffa033);
  box-shadow: 0 0 20px rgba(255,215,0,0.5);
}
.xg-btn-ai {
  background: linear-gradient(135deg, rgba(255,64,129,0.2), rgba(179,136,255,0.2));
  border-color: var(--xg-pink);
  color: var(--xg-pink);
}
.xg-btn-ai:hover {
  background: linear-gradient(135deg, rgba(255,64,129,0.35), rgba(179,136,255,0.35));
  box-shadow: 0 0 15px rgba(255,64,129,0.3);
}
.xg-btn-success {
  background: linear-gradient(135deg, rgba(0,230,118,0.2), rgba(0,200,83,0.15));
  border-color: var(--xg-green);
  color: var(--xg-green);
}
.xg-btn-sm {
  padding: 5px 14px;
  font-size: 12px;
}
.xg-btn-lg {
  padding: 12px 30px;
  font-size: 15px;
}

/* === 修仙主题输入框 === */
.xg-input, .xg-textarea, .xg-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,215,0,0.25);
  border-radius: 10px;
  color: var(--xg-text);
  font-size: 13px;
  transition: all 0.3s ease;
  outline: none;
}
.xg-input:focus, .xg-textarea:focus, .xg-select:focus {
  border-color: var(--xg-gold);
  box-shadow: 0 0 12px rgba(255,215,0,0.2), inset 0 0 6px rgba(255,215,0,0.05);
  background: rgba(0,0,0,0.4);
}
.xg-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}
.xg-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffd700' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}
.xg-select option {
  background: #1a0533;
  color: var(--xg-text);
}

/* === 表单组 === */
.xg-form-group {
  margin-bottom: 14px;
}
.xg-form-label {
  display: block;
  font-size: 13px;
  color: var(--xg-gold);
  margin-bottom: 6px;
  font-weight: bold;
}
.xg-form-hint {
  font-size: 11px;
  color: var(--xg-text-dim);
  margin-top: 4px;
}

/* === 修为飘字动画 === */
.xg-xp-float {
  position: fixed;
  top: 80px;
  right: 30px;
  font-size: 18px;
  font-weight: bold;
  color: var(--xg-gold);
  text-shadow: 0 0 10px rgba(255,215,0,0.6);
  pointer-events: none;
  z-index: 9999;
  animation: xg-xp-rise 1.5s ease-out forwards;
}
@keyframes xg-xp-rise {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  50% { opacity: 1; transform: translateY(-30px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}

/* === 境界升级弹窗 === */
.xg-levelup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: xg-fade-in 0.3s ease;
}
@keyframes xg-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.xg-levelup-modal {
  background: linear-gradient(135deg, #1a0533, #2d1b69);
  border: 2px solid var(--xg-gold);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 0 60px rgba(255,215,0,0.3);
  animation: xg-levelup-pop 0.5s ease-out;
  max-width: 360px;
}
@keyframes xg-levelup-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}
.xg-levelup-icon {
  font-size: 60px;
  margin-bottom: 16px;
  animation: xg-levelup-spin 1s ease-out;
}
@keyframes xg-levelup-spin {
  0% { transform: rotateY(0deg) scale(0.5); }
  100% { transform: rotateY(360deg) scale(1); }
}
.xg-levelup-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--xg-gold);
  text-shadow: 0 0 15px rgba(255,215,0,0.5);
  margin-bottom: 8px;
}
.xg-levelup-desc {
  font-size: 14px;
  color: var(--xg-text-dim);
  margin-bottom: 20px;
}

/* === 世界树节点卡片 === */
.xg-tree-node {
  background: var(--xg-panel);
  border: 1px solid var(--xg-border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.xg-tree-node::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--xg-gold), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.xg-tree-node:hover::before { opacity: 1; }
.xg-tree-node:hover {
  border-color: var(--xg-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,215,0,0.15);
}
.xg-tree-node.completed {
  border-color: var(--xg-green);
}
.xg-tree-node.completed::before {
  background: linear-gradient(90deg, transparent, var(--xg-green), transparent);
  opacity: 1;
}
.xg-tree-node-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.xg-tree-node-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: radial-gradient(circle, rgba(255,215,0,0.2), transparent);
  border: 1px solid rgba(255,215,0,0.3);
}
.xg-tree-node.completed .xg-tree-node-icon {
  background: radial-gradient(circle, rgba(0,230,118,0.2), transparent);
  border-color: var(--xg-green);
}
.xg-tree-node-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--xg-gold);
}
.xg-tree-node.completed .xg-tree-node-name {
  color: var(--xg-green);
}
.xg-tree-node-status {
  margin-left: auto;
  font-size: 11px;
  color: var(--xg-text-dim);
}

/* === 英灵殿角色卡 === */
.xg-hero-card {
  background: var(--xg-panel);
  border: 1px solid var(--xg-border);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}
.xg-hero-card:hover {
  border-color: var(--xg-gold);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(255,215,0,0.2);
}
.xg-hero-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 8px;
  border: 2px solid var(--xg-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: radial-gradient(circle, rgba(255,215,0,0.15), rgba(30,10,60,0.8));
}
.xg-hero-name {
  font-size: 13px;
  font-weight: bold;
  color: var(--xg-gold);
  margin-bottom: 4px;
}
.xg-hero-role {
  font-size: 11px;
  color: var(--xg-text-dim);
}
.xg-hero-stars {
  margin-top: 6px;
  font-size: 12px;
  color: var(--xg-gold);
}

/* === 炼丹炉 === */
.xg-furnace {
  position: relative;
  background: linear-gradient(180deg, rgba(30,10,60,0.9), rgba(50,20,20,0.8));
  border: 2px solid var(--xg-gold);
  border-radius: 20px;
  padding: 24px;
  overflow: hidden;
}
.xg-furnace::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(0deg, rgba(255,100,0,0.15), transparent);
  animation: xg-furnace-glow 2s ease-in-out infinite alternate;
}
@keyframes xg-furnace-glow {
  0% { opacity: 0.3; }
  100% { opacity: 0.8; }
}
.xg-furnace-fire {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 40px;
  animation: xg-fire-flicker 0.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px rgba(255,100,0,0.6));
}
@keyframes xg-fire-flicker {
  0% { transform: translateX(-50%) scale(1); }
  100% { transform: translateX(-50%) scale(1.1); }
}

/* === 传送阵法阵 === */
.xg-array {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid var(--xg-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.xg-array::before {
  content: '';
  position: absolute;
  top: -5px; left: -5px; right: -5px; bottom: -5px;
  border-radius: 50%;
  border: 1px dashed rgba(255,215,0,0.3);
  animation: xg-array-rotate 20s linear infinite;
}
@keyframes xg-array-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.xg-array-icon {
  font-size: 48px;
  filter: drop-shadow(0 0 15px rgba(255,215,0,0.4));
}
.xg-array.active {
  border-color: var(--xg-green);
  box-shadow: 0 0 30px rgba(0,230,118,0.3);
}
.xg-array.active::before {
  border-color: var(--xg-green);
  animation-duration: 5s;
}

/* === 功德簿成就徽章 === */
.xg-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid var(--xg-border);
  background: radial-gradient(circle, rgba(30,10,60,0.8), rgba(0,0,0,0.6));
  transition: all 0.3s ease;
}
.xg-badge.unlocked {
  border-color: var(--xg-gold);
  background: radial-gradient(circle, rgba(255,215,0,0.2), rgba(30,10,60,0.8));
  box-shadow: 0 0 15px rgba(255,215,0,0.3);
}
.xg-badge.locked {
  filter: grayscale(1) brightness(0.5);
}

/* === 坊市定价天平 === */
.xg-scale {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 30px;
  padding: 20px;
}
.xg-scale-side {
  text-align: center;
}
.xg-scale-icon {
  font-size: 36px;
  margin-bottom: 8px;
}
.xg-scale-val {
  font-size: 20px;
  font-weight: bold;
  color: var(--xg-gold);
}

/* === 响应式 === */
@media (max-width: 768px) {
  .xg-sidebar { width: 60px; }
  .xg-facility { width: 52px; padding: 6px 4px; }
  .xg-facility-icon { width: 30px; height: 30px; font-size: 15px; }
  .xg-facility-name { font-size: 9px; }
  .xg-topbar { padding: 8px 12px; flex-wrap: wrap; }
  .xg-topbar-center { max-width: 200px; margin: 0 10px; order: 3; flex-basis: 100%; }
  .xg-main { padding: 12px; }
  .xg-panel { padding: 14px; }
}

/* === 工作流步骤修仙主题 === */
.wf-step {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.wf-step:hover {
  border-color: rgba(255,215,0,0.3);
  background: rgba(0,0,0,0.3);
}
.wf-step.wf-done {
  border-color: rgba(0,230,118,0.3);
  background: rgba(0,230,118,0.05);
}
.wf-step.wf-current {
  border-color: var(--xg-gold);
  background: rgba(255,215,0,0.08);
  box-shadow: 0 0 10px rgba(255,215,0,0.1);
}
.wf-step.wf-locked {
  opacity: 0.5;
  cursor: not-allowed;
}
.wf-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.wf-step-icon { font-size: 18px; }
.wf-step-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--xg-gold);
}
.wf-step-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}
.wf-step-badge.done {
  background: rgba(0,230,118,0.2);
  color: var(--xg-green);
}
.wf-step-badge.current {
  background: rgba(255,215,0,0.2);
  color: var(--xg-gold);
}
.wf-step-badge.locked {
  color: var(--xg-text-dim);
}
.wf-step-body { padding-left: 26px; }
.wf-step-desc {
  font-size: 12px;
  color: var(--xg-text-dim);
  margin-bottom: 4px;
}
.wf-step-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wf-item {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
}
.wf-item.ok {
  background: rgba(0,230,118,0.1);
  color: var(--xg-green);
}
.wf-item.no {
  background: rgba(255,255,255,0.05);
  color: var(--xg-text-dim);
}
.wf-step-lock-hint {
  font-size: 11px;
  color: var(--xg-text-dim);
  margin-top: 4px;
}

/* === 全局暗色背景覆盖 === */
.novel-ws-game {
  background: linear-gradient(135deg, var(--xg-bg1), var(--xg-bg2)) !important;
}

/* === 节点详情面板修仙主题 === */
.ws-world-detail-panel {
  background: var(--xg-panel);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  padding: 16px;
  margin-top: 12px;
}

/* === 章节列表项修仙主题 === */
.ws-chapter-item {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,215,0,0.1);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}
.ws-chapter-item:hover {
  border-color: rgba(255,215,0,0.3);
  background: rgba(0,0,0,0.3);
}

/* === 可见性面板修仙主题 === */
.ws-vis-panel {
  background: var(--xg-panel);
  border: 1px solid var(--xg-border);
  border-radius: var(--xg-radius);
  padding: 16px;
  margin-top: 12px;
}

/* === 多主题星空背景变体 === */
/* 科技族 - 蓝绿粒子 */
.xg-stars-scifi {
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(0,229,255,0.6), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(118,255,3,0.4), transparent),
    radial-gradient(1px 1px at 50% 10%, rgba(0,229,255,0.5), transparent),
    radial-gradient(2px 2px at 70% 80%, rgba(0,229,255,0.3), transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(118,255,3,0.4), transparent),
    radial-gradient(2px 2px at 15% 85%, rgba(0,229,255,0.3), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(255,255,255,0.5), transparent);
}

/* 言情族 - 粉色花瓣 */
.xg-stars-romance {
  background:
    radial-gradient(2px 2px at 10% 20%, rgba(255,64,129,0.5), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(255,128,171,0.4), transparent),
    radial-gradient(2px 2px at 50% 10%, rgba(255,64,129,0.3), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(255,128,171,0.5), transparent),
    radial-gradient(2px 2px at 90% 40%, rgba(255,64,129,0.4), transparent),
    radial-gradient(1px 1px at 15% 85%, rgba(255,128,171,0.3), transparent),
    radial-gradient(2px 2px at 85% 15%, rgba(255,64,129,0.5), transparent);
}

/* 武侠族 - 棕金剑气 */
.xg-stars-wuxia {
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(212,165,116,0.5), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(201,168,76,0.4), transparent),
    radial-gradient(2px 2px at 50% 10%, rgba(212,165,116,0.3), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(201,168,76,0.5), transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(212,165,116,0.4), transparent),
    radial-gradient(2px 2px at 15% 85%, rgba(201,168,76,0.3), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(212,165,116,0.5), transparent);
}

/* 悬疑族 - 暗红粒子 */
.xg-stars-suspense {
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(255,23,68,0.4), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(255,82,82,0.3), transparent),
    radial-gradient(2px 2px at 50% 10%, rgba(255,23,68,0.3), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(255,82,82,0.4), transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(255,23,68,0.3), transparent),
    radial-gradient(2px 2px at 15% 85%, rgba(255,82,82,0.3), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(255,23,68,0.4), transparent);
}

/* 都市族 - 蓝金城市光 */
.xg-stars-urban {
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(68,138,255,0.5), transparent),
    radial-gradient(1px 1px at 30% 60%, rgba(255,215,64,0.4), transparent),
    radial-gradient(1px 1px at 50% 10%, rgba(68,138,255,0.3), transparent),
    radial-gradient(2px 2px at 70% 80%, rgba(255,215,64,0.3), transparent),
    radial-gradient(1px 1px at 90% 40%, rgba(68,138,255,0.4), transparent),
    radial-gradient(2px 2px at 15% 85%, rgba(255,215,64,0.3), transparent),
    radial-gradient(1px 1px at 85% 15%, rgba(68,138,255,0.5), transparent);
}

/* === 主题特有装饰动画 === */
/* 科技族脉冲效果 */
.xg-stars-scifi::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,229,255,0.02) 2px,
    rgba(0,229,255,0.02) 4px
  );
  animation: xg-scanline 8s linear infinite;
}
@keyframes xg-scanline {
  0% { transform: translateY(0); }
  100% { transform: translateY(100px); }
}

/* 言情族花瓣飘落 */
.xg-stars-romance::after {
  content: '🌸';
  position: absolute;
  top: -20px;
  left: 20%;
  font-size: 12px;
  opacity: 0.3;
  animation: xg-petal-fall 12s linear infinite;
}
@keyframes xg-petal-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* 武侠族剑气扫过 */
.xg-stars-wuxia::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  width: 200%;
  background: linear-gradient(90deg, transparent 0%, rgba(201,168,76,0.03) 50%, transparent 100%);
  animation: xg-sword-sweep 10s ease-in-out infinite;
}
@keyframes xg-sword-sweep {
  0% { transform: translateX(-50%); }
  50% { transform: translateX(50%); }
  100% { transform: translateX(-50%); }
}

/* 悬疑族雾气效果 */
.xg-stars-suspense::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30%;
  background: linear-gradient(to top, rgba(255,23,68,0.05), transparent);
  animation: xg-fog-pulse 6s ease-in-out infinite alternate;
}
@keyframes xg-fog-pulse {
  0% { opacity: 0.3; }
  100% { opacity: 0.8; }
}

/* ===== 全参数体系手风琴样式 ===== */
.xg-param-sections {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.xg-param-section {
  border: 1px solid var(--xg-border, rgba(255,255,255,0.1));
  border-radius: 10px;
  overflow: hidden;
  background: var(--xg-panel, rgba(20,10,40,0.6));
  transition: border-color 0.3s;
}
.xg-param-section:hover {
  border-color: var(--xg-accent, rgba(102,126,234,0.4));
}
.xg-param-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(102,126,234,0.02));
  transition: background 0.3s;
}
.xg-param-section-header:hover {
  background: linear-gradient(135deg, rgba(102,126,234,0.15), rgba(102,126,234,0.05));
}
.xg-param-section-header.expanded {
  background: linear-gradient(135deg, rgba(102,126,234,0.18), rgba(102,126,234,0.06));
  border-bottom: 1px solid var(--xg-border, rgba(255,255,255,0.08));
}
.xg-param-section-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.xg-param-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--xg-text, #e0e0ff);
  flex: 1;
}
.xg-param-section-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(102,126,234,0.2);
  color: #a0b4ff;
  flex-shrink: 0;
}
.xg-param-section-arrow {
  font-size: 10px;
  color: var(--xg-text-dim, #888);
  transition: transform 0.3s;
  flex-shrink: 0;
}
.xg-param-section-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 70vh;
  overflow-y: auto;
}
.xg-param-group {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  transition: border-color 0.3s, background 0.3s;
}
.xg-param-group.filled {
  border-color: rgba(102,200,100,0.25);
  background: rgba(102,200,100,0.04);
}
.xg-param-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.xg-param-group-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--xg-text, #d0d0ff);
}
.xg-param-group-status {
  font-size: 12px;
  margin-left: auto;
}
.xg-param-hint {
  font-size: 11px;
  color: var(--xg-text-dim, #888);
  line-height: 1.5;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(102,126,234,0.06);
  border-radius: 6px;
  border-left: 2px solid rgba(102,126,234,0.3);
}
.xg-param-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  color: var(--xg-text, #e0e0ff);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.3s;
}
.xg-param-textarea:focus {
  outline: none;
  border-color: var(--xg-accent, rgba(102,126,234,0.5));
  box-shadow: 0 0 8px rgba(102,126,234,0.15);
}
.xg-param-textarea::placeholder {
  color: rgba(255,255,255,0.2);
}
@media (max-width: 768px) {
  .xg-param-section-header {
    padding: 10px 12px;
  }
  .xg-param-section-title {
    font-size: 14px;
  }
  .xg-param-section-body {
    padding: 8px;
    max-height: 60vh;
  }
  .xg-param-group {
    padding: 10px;
  }
  .xg-param-textarea {
    min-height: 60px;
    font-size: 12px;
  }
}

/* ===== 全参数字段化表单样式 ===== */
.xg-pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.xg-pf-grid.has-complex {
  grid-template-columns: 1fr;
}
.xg-pf-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.xg-pf-row.wide {
  grid-column: 1 / -1;
}
.xg-pf-label {
  font-size: 12px;
  color: var(--xg-text-dim, #8888aa);
  font-weight: 500;
}
.xg-pf-input {
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  background: rgba(0,0,0,0.25);
  color: var(--xg-text, #e0e0ff);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 100%;
  box-sizing: border-box;
}
.xg-pf-input:focus {
  outline: none;
  border-color: var(--xg-accent, rgba(102,126,234,0.5));
  box-shadow: 0 0 6px rgba(102,126,234,0.15);
}
.xg-pf-input::placeholder {
  color: rgba(255,255,255,0.2);
}
textarea.xg-pf-input {
  min-height: 50px;
  resize: vertical;
  line-height: 1.5;
}
select.xg-pf-input {
  cursor: pointer;
  appearance: auto;
}
.xg-pf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--xg-text, #d0d0ff);
  padding: 4px 0;
}
.xg-pf-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--xg-accent, #667eea);
  cursor: pointer;
}
.xg-pf-range {
  display: flex;
  align-items: center;
  gap: 10px;
}
.xg-pf-range input[type="range"] {
  flex: 1;
  accent-color: var(--xg-accent, #667eea);
  cursor: pointer;
}
.xg-pf-range-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--xg-accent, #667eea);
  min-width: 24px;
  text-align: center;
}

/* ===== combo 组件样式 ===== */
.xg-pf-max {
  font-size: 10px;
  color: var(--xg-text-dim, #888);
  margin-left: 6px;
  font-weight: 400;
}
.xg-pf-combo-wrap {
  position: relative;
}
.xg-pf-combo-wrap.inline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.xg-pf-combo-wrap.inline .xg-pf-combo-input {
  flex: 1;
}
.xg-pf-combo-btns {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.xg-pf-btn {
  padding: 3px 8px;
  border: 1px solid var(--xg-border, rgba(255,255,255,0.1));
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--xg-text, #e0e0e0);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.xg-pf-btn:hover {
  background: rgba(102,126,234,0.2);
  border-color: var(--xg-accent, #667eea);
}
.xg-pf-ai-btn:hover { background: rgba(72,199,142,0.2); border-color: #48c78e; }
.xg-pf-db-btn:hover { background: rgba(255,183,77,0.2); border-color: #ffb74d; }
.xg-pf-char-count {
  font-size: 10px;
  color: var(--xg-text-dim, #888);
  margin-top: 2px;
  text-align: right;
}
.xg-pf-opts-panel {
  margin-top: 6px;
  padding: 8px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--xg-border, rgba(255,255,255,0.1));
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
}
.xg-pf-opts-title {
  font-size: 11px;
  color: var(--xg-text-dim, #888);
  margin-bottom: 6px;
}
.xg-pf-opt-item {
  display: inline-block;
  padding: 3px 8px;
  margin: 2px;
  border: 1px solid var(--xg-border, rgba(255,255,255,0.1));
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: var(--xg-text, #e0e0e0);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}
.xg-pf-opt-item:hover {
  background: rgba(102,126,234,0.3);
  border-color: var(--xg-accent, #667eea);
}
.xg-pf-ai-out {
  margin-top: 6px;
  padding: 8px;
  background: rgba(72,199,142,0.08);
  border: 1px solid rgba(72,199,142,0.3);
  border-radius: 8px;
}
.xg-pf-ai-loading {
  font-size: 12px;
  color: #48c78e;
}
.xg-pf-ai-stream {
  font-size: 12px;
  color: var(--xg-text, #e0e0e0);
  white-space: pre-wrap;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
}
.xg-pf-ai-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.xg-pf-ai-accept { background: rgba(72,199,142,0.2); border-color: #48c78e; }
.xg-pf-ai-accept:hover { background: rgba(72,199,142,0.4); }
.xg-pf-ai-reject { background: rgba(255,80,80,0.1); border-color: rgba(255,80,80,0.3); }
.xg-pf-ai-reject:hover { background: rgba(255,80,80,0.2); }
.xg-pf-ai-error {
  font-size: 12px;
  color: #ff5050;
}

@media (max-width: 768px) {
  .xg-pf-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .xg-pf-input {
    font-size: 12px;
    padding: 6px 8px;
  }
}

/* ===== 小说状态引擎 (Novel State Engine) ===== */
.nse-panel {
  margin-top: 16px;
  padding: 16px;
  background: var(--xg-card-bg, #1e1e2e);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 12px;
}
.nse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(139,92,246,0.2);
}
.nse-header h3 {
  margin: 0;
  font-size: 16px;
  color: #8b5cf6;
}
.nse-chapter {
  font-size: 12px;
  color: var(--xg-text-secondary, #a0a0a0);
  background: rgba(139,92,246,0.1);
  padding: 4px 10px;
  border-radius: 12px;
}
.nse-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.nse-tab {
  padding: 6px 14px;
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 8px;
  background: transparent;
  color: var(--xg-text-secondary, #a0a0a0);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.nse-tab:hover {
  background: rgba(139,92,246,0.1);
  color: #8b5cf6;
}
.nse-tab.active {
  background: rgba(139,92,246,0.2);
  border-color: #8b5cf6;
  color: #8b5cf6;
}
.nse-card {
  background: rgba(139,92,246,0.05);
  border: 1px solid rgba(139,92,246,0.15);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}
.nse-card-header {
  font-weight: 600;
  font-size: 14px;
  color: var(--xg-text, #e0e0e0);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nse-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.nse-badge.alive {
  background: rgba(72,199,142,0.2);
  color: #48c78e;
}
.nse-badge.dead {
  background: rgba(255,80,80,0.2);
  color: #ff5050;
}
.nse-attrs {
  font-size: 13px;
  line-height: 1.6;
}
.nse-attr-row {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.nse-attr-row span {
  color: var(--xg-text-secondary, #a0a0a0);
  min-width: 50px;
}
.nse-attr-row strong {
  color: #8b5cf6;
}
.nse-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.nse-bar-label {
  font-size: 12px;
  color: var(--xg-text-secondary, #a0a0a0);
  min-width: 40px;
}
.nse-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.nse-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.nse-bar-val {
  font-size: 11px;
  color: var(--xg-text-secondary, #a0a0a0);
  min-width: 50px;
  text-align: right;
}
.nse-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.nse-table th {
  background: rgba(139,92,246,0.15);
  padding: 8px;
  text-align: left;
  color: #8b5cf6;
  border-bottom: 1px solid rgba(139,92,246,0.2);
}
.nse-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--xg-text, #e0e0e0);
}
.nse-table tr:hover td {
  background: rgba(139,92,246,0.05);
}
.nse-log-entry {
  font-size: 12px;
  padding: 4px 0;
  color: var(--xg-text-secondary, #a0a0a0);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nse-empty {
  text-align: center;
  padding: 20px;
  color: var(--xg-text-secondary, #a0a0a0);
  font-size: 13px;
}

@media (max-width: 768px) {
  .nse-tabs {
    gap: 2px;
  }
  .nse-tab {
    padding: 4px 10px;
    font-size: 12px;
  }
  .nse-card {
    padding: 10px;
  }
}

/* ★ 状态引擎 v2 - 可编辑/存档/检查 */
.nse-header-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nse-btn-sm {
  padding: 4px 12px;
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 6px;
  background: rgba(139,92,246,0.1);
  color: #8b5cf6;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.nse-btn-sm:hover {
  background: rgba(139,92,246,0.25);
}
.nse-btn-tiny {
  padding: 2px 8px;
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 4px;
  background: transparent;
  color: #8b5cf6;
  cursor: pointer;
  font-size: 11px;
  margin-top: 4px;
}
.nse-btn-tiny:hover {
  background: rgba(139,92,246,0.15);
}
/* 可编辑属性 */
.nse-editable {
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}
.nse-editable:hover {
  background: rgba(139,92,246,0.1);
}
.nse-edit-hint {
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.15s;
}
.nse-editable:hover .nse-edit-hint {
  opacity: 1;
}
/* 角色最后变更时间 */
.nse-last-ch {
  font-size: 11px;
  color: var(--xg-text-secondary, #a0a0a0);
  margin-left: auto;
}
/* 值高亮 */
.nse-val-high { color: #48c78e; font-weight: 600; }
.nse-val-mid { color: var(--xg-text, #e0e0e0); }
.nse-val-low { color: #ff5050; font-weight: 600; }
/* 逻辑检查结果 */
.nse-check-card {
  border-color: rgba(139,92,246,0.4) !important;
  margin-top: 12px;
}
.nse-check-error {
  padding: 6px 10px;
  background: rgba(255,80,80,0.1);
  border-left: 3px solid #ff5050;
  border-radius: 0 4px 4px 0;
  margin-bottom: 4px;
  font-size: 13px;
}
.nse-check-warn {
  padding: 6px 10px;
  background: rgba(255,180,0,0.1);
  border-left: 3px solid #ffb400;
  border-radius: 0 4px 4px 0;
  margin-bottom: 4px;
  font-size: 13px;
}
.nse-check-ok {
  padding: 6px 10px;
  background: rgba(72,199,142,0.1);
  border-left: 3px solid #48c78e;
  border-radius: 0 4px 4px 0;
  margin-bottom: 4px;
  font-size: 13px;
}
/* 章节存档时间轴 */
.nse-timeline {
  position: relative;
  padding-left: 16px;
  border-left: 2px solid rgba(139,92,246,0.2);
}
.nse-snapshot-card {
  position: relative;
}
.nse-snapshot-card::before {
  content: '';
  position: absolute;
  left: -21px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #8b5cf6;
  border: 2px solid var(--xg-card-bg, #1e1e2e);
}
.nse-snap-time {
  font-size: 11px;
  color: var(--xg-text-secondary, #a0a0a0);
  font-weight: 400;
}
.nse-snap-body {
  font-size: 12px;
  line-height: 1.6;
}
.nse-snap-char {
  padding: 2px 0;
  color: var(--xg-text, #e0e0e0);
}
.nse-snap-char strong {
  color: #8b5cf6;
}
.nse-snap-world {
  color: var(--xg-text-secondary, #a0a0a0);
  padding: 2px 0;
}
.nse-snap-plots {
  color: var(--xg-text-secondary, #a0a0a0);
  padding: 2px 0;
}
.nse-snap-detail {
  margin-top: 12px;
  border-color: rgba(139,92,246,0.4) !important;
}
.nse-snap-detail h4 {
  font-size: 13px;
  color: #8b5cf6;
  margin: 8px 0 4px;
}
.nse-snap-char-detail {
  font-size: 12px;
  white-space: pre-line;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nse-snap-world-detail,
.nse-snap-plots-detail {
  font-size: 12px;
  white-space: pre-line;
}

/* ★ 状态引擎 v3 - 结构化表单/实体添加 */
.nse-form-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(139,92,246,0.15);
}
.nse-form-section h4 {
  font-size: 14px;
  color: #8b5cf6;
  margin: 0 0 10px;
}
.nse-form-char {
  background: rgba(139,92,246,0.05);
  border: 1px solid rgba(139,92,246,0.12);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.nse-form-char-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--xg-text, #e0e0e0);
  margin-bottom: 8px;
}
.nse-form-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.nse-form-row label {
  font-size: 12px;
  color: var(--xg-text-secondary, #a0a0a0);
  min-width: 45px;
  text-align: right;
}
.nse-form-row span {
  font-size: 12px;
  color: var(--xg-text-secondary, #a0a0a0);
}
.nse-form-row input[type="text"],
.nse-form-row input[type="number"] {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 4px;
  color: var(--xg-text, #e0e0e0);
  padding: 4px 8px;
  font-size: 12px;
  flex: 1;
  min-width: 60px;
  max-width: 150px;
}
.nse-form-row input:focus {
  border-color: #8b5cf6;
  outline: none;
  background: rgba(139,92,246,0.08);
}
.nse-form-row select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 4px;
  color: var(--xg-text, #e0e0e0);
  padding: 4px 8px;
  font-size: 12px;
}
.nse-form-section textarea {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 6px;
  color: var(--xg-text, #e0e0e0);
  padding: 8px;
  font-size: 13px;
  resize: vertical;
  box-sizing: border-box;
}
.nse-form-section textarea:focus {
  border-color: #8b5cf6;
  outline: none;
}
.nse-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(139,92,246,0.15);
}
