/* ============================================================
   Pluto 情报智斗番 · 全局设计系统
   slogan: The Fire controls the Edge / 你以星火淬我锋芒
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 背景层 */
  --bg-deep:    #0d0b1a;
  --bg-panel:   #16132b;
  --bg-card:    #1e1a38;
  --bg-hover:   #262042;
  --bg-input:   #120f24;

  /* 边框 */
  --border:      #2d2647;
  --border-soft: #231d3d;
  --border-glow: #7c3aed;

  /* 主色 */
  --purple:     #a855f7;
  --purple-dim: #7c3aed;
  --blue:       #3b82f6;
  --cyan:       #06b6d4;
  --orange:     #f97316;
  --gold:       #fbbf24;
  --red:        #ef4444;
  --green:      #22c55e;

  /* 文字 */
  --text-main: #e2e8f0;
  --text-sub:  #94a3b8;
  --text-dim:  #64748b;

  /* 阵营色 */
  --camp-self:    #3b82f6;
  --camp-enemy:   #f97316;
  --camp-neutral: #64748b;

  /* 尺寸 */
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --sidebar-w: 56px;
  --topbar-h:  56px;

  /* 字体 */
  --font-title: 'ZCOOL KuaiLe', 'YouSheBiaoTiHei', 'Noto Sans SC', sans-serif;
  --font-body:  'Noto Sans SC', -apple-system, 'PingFang SC', system-ui, sans-serif;

  /* 阴影/发光 */
  --shadow-glow:   0 0 20px rgba(168,85,247,.35);
  --shadow-card:   0 4px 20px rgba(0,0,0,.45);
  --shadow-orange: 0 0 18px rgba(249,115,22,.4);
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html, body { height:100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  /* 深空底纹：暗紫径向渐变 + 扫描线 */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124,58,237,.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(59,130,246,.08), transparent),
    repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px);
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--gold); }

::-webkit-scrollbar { width:8px; height:8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius:4px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-dim); }

/* ---------- 布局骨架 ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "side top"
    "side main";
  height: 100vh;
  overflow: hidden;
}

/* 顶栏 */
.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: rgba(22,19,43,.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 50;
}
.topbar::after {
  content:'';
  position:absolute; left:0; right:0; bottom:-1px; height:1px;
  background: linear-gradient(90deg, transparent, var(--purple), var(--cyan), transparent);
  opacity:.6;
}
.topbar-logo {
  font-family: var(--font-title);
  font-size: 18px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 1px;
  white-space: nowrap;
}
.topbar-slogan {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: .5px;
  white-space: nowrap;
}
.topbar-spacer { flex:1; }

/* 心跳灯 */
.heartbeat {
  display: inline-flex; align-items:center; gap:6px;
  font-size: 12px; color: var(--text-sub);
}
.heartbeat-dot {
  width:8px; height:8px; border-radius:50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%     { opacity:.45; transform:scale(.8); }
}

/* 报警数 */
.alert-badge {
  display: inline-flex; align-items:center; gap:6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.4);
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.alert-badge:hover { background: rgba(239,68,68,.22); box-shadow: 0 0 14px rgba(239,68,68,.5); }
.alert-dot {
  width:6px; height:6px; border-radius:50%;
  background: var(--red); box-shadow:0 0 6px var(--red);
  animation: pulse 1.2s infinite;
}

/* token 条 */
.token-bar {
  width: 120px; height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.token-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--gold));
  border-radius: 3px;
  transition: width .6s;
}
.token-label { font-size:11px; color: var(--text-dim); white-space:nowrap; }

/* 侧栏 */
.sidenav {
  grid-area: side;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  background: rgba(13,11,26,.9);
  border-right: 1px solid var(--border);
  z-index: 60;
}
.nav-item {
  width: 40px; height: 40px;
  display: flex; align-items:center; justify-content:center;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  position: relative;
  transition: all .2s;
}
.nav-item:hover { background: var(--bg-hover); color: var(--purple); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(168,85,247,.25), rgba(6,182,212,.15));
  color: var(--purple);
  box-shadow: inset 0 0 0 1px rgba(168,85,247,.4);
}
.nav-item.active::before {
  content:''; position:absolute; left:-10px; top:50%; transform:translateY(-50%);
  width:3px; height:20px; border-radius:2px;
  background: var(--purple); box-shadow: 0 0 10px var(--purple);
}
.nav-item .nav-tip {
  position:absolute; left:48px; top:50%; transform:translateY(-50%) scale(.9);
  background: var(--bg-card); border:1px solid var(--border);
  padding:4px 10px; border-radius:6px; font-size:12px; color:var(--text-main);
  white-space:nowrap; opacity:0; pointer-events:none; transition:all .18s;
  box-shadow: var(--shadow-card);
}
.nav-item:hover .nav-tip { opacity:1; transform:translateY(-50%) scale(1); }

/* 主内容区 */
.main {
  grid-area: main;
  overflow-y: auto;
  padding: 20px;
  position: relative;
}

/* ---------- 通用面板 ---------- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  box-shadow: var(--shadow-card);
}
.panel-glow { box-shadow: var(--shadow-card), var(--shadow-glow); }
.panel-title {
  font-family: var(--font-title);
  font-size: 15px;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex; align-items:center; gap:8px;
  letter-spacing: .5px;
}
.panel-title::before {
  content:''; width:3px; height:14px; border-radius:2px;
  background: linear-gradient(var(--purple), var(--cyan));
  box-shadow: 0 0 8px var(--purple);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items:center; justify-content:center; gap:6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer; border: 1px solid transparent;
  transition: all .18s;
  white-space: nowrap;
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border);
}
.btn:hover { border-color: var(--purple); color: var(--purple); transform: translateY(-1px); box-shadow: 0 0 14px rgba(168,85,247,.25); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--purple-dim), var(--purple));
  color: #fff; border-color: transparent;
  box-shadow: 0 0 16px rgba(168,85,247,.35);
}
.btn-primary:hover { color:#fff; box-shadow: 0 0 24px rgba(168,85,247,.55); }

.btn-blue   { background: linear-gradient(135deg,#2563eb,var(--blue)); color:#fff; border:0; }
.btn-orange { background: linear-gradient(135deg,#ea580c,var(--orange)); color:#fff; border:0; box-shadow: var(--shadow-orange); }
.btn-danger { background: rgba(239,68,68,.12); color: var(--red); border-color: rgba(239,68,68,.4); }
.btn-danger:hover { background: rgba(239,68,68,.22); color: var(--red); border-color: var(--red); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { width:34px; height:34px; padding:0; }
.btn:disabled { opacity:.4; cursor:not-allowed; transform:none!important; box-shadow:none!important; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items:center; gap:4px;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px; font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}
.tag-support { color:#22c55e; border-color:rgba(34,197,94,.45); background:rgba(34,197,94,.1); }
.tag-oppose  { color:#f97316; border-color:rgba(249,115,22,.45); background:rgba(249,115,22,.1); }
.tag-malice  { color:#ef4444; border-color:rgba(239,68,68,.5);  background:rgba(239,68,68,.12); }
.tag-persona-neg { color:#c084fc; border-color:rgba(192,132,252,.45); background:rgba(192,132,252,.1); }
.tag-persona-pos { color:#fbbf24; border-color:rgba(251,191,36,.45); background:rgba(251,191,36,.1); }
.tag-neutral { color:#94a3b8; border-color:rgba(148,163,184,.4); background:rgba(148,163,184,.08); }
.tag-purple  { color:#a855f7; border-color:rgba(168,85,247,.45); background:rgba(168,85,247,.1); }

/* ---------- 用户卡牌 ---------- */
.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  position: relative;
  transition: all .22s;
  overflow: hidden;
}
.user-card:hover { transform: translateY(-4px); border-color: var(--purple); box-shadow: var(--shadow-card), var(--shadow-glow); }
.user-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:2px;
  background: var(--camp-self);
}
.user-card[data-camp="enemy"]::before   { background: var(--camp-enemy); }
.user-card[data-camp="neutral"]::before { background: var(--camp-neutral); }
.user-card[data-camp="self"]    { box-shadow: var(--shadow-card), 0 0 18px rgba(59,130,246,.25); }

.user-card-head { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.user-avatar {
  width: 46px; height: 46px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--bg-input);
}
.user-card[data-camp="self"]  .user-avatar { border-color: var(--camp-self); }
.user-card[data-camp="enemy"] .user-avatar { border-color: var(--camp-enemy); }
.user-avatar-fallback {
  width:46px; height:46px; border-radius:10px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-title); font-size:18px; color:#fff;
  background: linear-gradient(135deg, var(--purple-dim), var(--cyan));
}
.user-name { font-weight:700; font-size:14px; color:var(--text-main); }
.user-sub  { font-size:11px; color:var(--text-dim); }

.user-threat { display:flex; align-items:center; gap:2px; font-size:12px; color:var(--gold); }
.user-threat .star-dim { color: var(--border); }

.stat-bar {
  height:6px; border-radius:3px; background:var(--bg-input);
  overflow:hidden; margin-top:6px; border:1px solid var(--border-soft);
}
.stat-bar-fill {
  height:100%; border-radius:3px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  transition: width .5s;
}
.stat-bar-fill.warn   { background: linear-gradient(90deg, var(--gold), var(--orange)); }
.stat-bar-fill.danger { background: linear-gradient(90deg, var(--orange), var(--red)); }

/* ---------- 输入 ---------- */
.input, .textarea, .select {
  width:100%;
  background: var(--bg-input);
  border:1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-body);
  outline:none;
  transition: border-color .18s, box-shadow .18s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(168,85,247,.15);
}
.textarea { resize: vertical; min-height: 80px; line-height:1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }

/* 开关 */
.switch { position:relative; display:inline-block; width:42px; height:22px; flex-shrink:0; }
.switch input { opacity:0; width:0; height:0; }
.switch-slider {
  position:absolute; inset:0; cursor:pointer;
  background: var(--bg-input); border:1px solid var(--border);
  border-radius:22px; transition:.25s;
}
.switch-slider::before {
  content:''; position:absolute; height:16px; width:16px; left:2px; top:2px;
  background: var(--text-sub); border-radius:50%; transition:.25s;
}
.switch input:checked + .switch-slider { background: rgba(168,85,247,.3); border-color: var(--purple); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); background: var(--purple); box-shadow:0 0 8px var(--purple); }

/* ---------- 战报卡 ---------- */
.battle-card {
  background: linear-gradient(135deg, rgba(30,26,56,.95), rgba(22,19,43,.95));
  border:1px solid var(--border);
  border-left: 3px solid var(--purple);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.battle-card[data-urgency="high"]   { border-left-color: var(--red);    box-shadow: 0 0 18px rgba(239,68,68,.2); }
.battle-card[data-urgency="medium"] { border-left-color: var(--orange); box-shadow: 0 0 14px rgba(249,115,22,.15); }
.battle-card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.battle-card-title { font-family: var(--font-title); font-size:14px; color:var(--text-main); }
.battle-card-period { font-size:11px; color:var(--text-dim); }

/* ---------- 时间线 ---------- */
.timeline { position:relative; padding-left: 24px; }
.timeline::before {
  content:''; position:absolute; left:7px; top:4px; bottom:4px; width:2px;
  background: linear-gradient(var(--purple), var(--cyan), transparent);
  opacity:.5;
}
.timeline-item { position:relative; padding: 8px 0 14px; }
.timeline-item::before {
  content:''; position:absolute; left:-21px; top:14px;
  width:10px; height:10px; border-radius:50%;
  background: var(--bg-card); border:2px solid var(--purple);
  box-shadow: 0 0 8px var(--purple);
}
.timeline-item[data-type="join"]::before   { border-color: var(--cyan); box-shadow:0 0 8px var(--cyan); }
.timeline-item[data-type="report"]::before { border-color: var(--gold); box-shadow:0 0 8px var(--gold); }
.timeline-time { font-size:11px; color:var(--text-dim); margin-bottom:2px; }
.timeline-content { font-size:13px; color:var(--text-sub); }

/* ---------- AI 气泡 ---------- */
.ai-bubble {
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(6,182,212,.08));
  border:1px solid rgba(168,85,247,.3);
  border-radius: var(--radius);
  padding: 12px 14px;
  position: relative;
}
.ai-bubble::before {
  content:'AI'; position:absolute; top:-8px; left:12px;
  font-size:10px; font-weight:700; letter-spacing:1px;
  background: linear-gradient(135deg, var(--purple), var(--cyan));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.ai-bubble .typing::after {
  content:'▍'; animation: blink 1s step-end infinite; color: var(--purple);
}
@keyframes blink { 50% { opacity:0; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); border:1px solid var(--purple);
  color: var(--text-main); padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 13px; opacity:0; pointer-events:none;
  transition: all .3s; z-index: 9999;
  box-shadow: var(--shadow-glow);
}
.toast.show { opacity:1; transform: translateX(-50%) translateY(0); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset:0; background: rgba(8,6,18,.75);
  backdrop-filter: blur(4px);
  display:none; align-items:center; justify-content:center;
  z-index: 9998;
}
.modal-mask.show { display:flex; }
.modal {
  background: var(--bg-panel); border:1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  width: min(560px, 92vw); max-height: 86vh; overflow-y:auto;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { opacity:0; transform: scale(.96) translateY(8px); } }
.modal-title { font-family: var(--font-title); font-size:17px; margin-bottom:16px; color:var(--text-main); }

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 空状态 ---------- */
.empty-state {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding: 48px 20px; color: var(--text-dim); text-align:center; gap:10px;
}
.empty-state .icon { font-size: 40px; opacity:.4; }

/* ---------- 网格 ---------- */
.card-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

/* ---------- 工具类 ---------- */
.flex { display:flex; }
.items-center { align-items:center; }
.justify-between { justify-content:space-between; }
.gap-6 { gap:6px; } .gap-8 { gap:8px; } .gap-12 { gap:12px; } .gap-16 { gap:16px; }
.mt-8 { margin-top:8px; } .mt-12 { margin-top:12px; } .mt-16 { margin-top:16px; }
.text-sub { color: var(--text-sub); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size:12px; }
.hidden { display:none!important; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 0 1fr; }
  .sidenav { position:fixed; bottom:0; left:0; right:0; top:auto; flex-direction:row; height:56px; justify-content:space-around; border-right:0; border-top:1px solid var(--border); z-index:100; }
  .main { padding: 12px; }
  .topbar-slogan { display:none; }
}