*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg: #060c1f;
  --bg-1: #0a1430;
  --bg-2: #0f1a3d;
  --bg-card: rgba(16, 28, 60, 0.55);
  --border: rgba(99, 145, 255, 0.18);
  --border-2: rgba(99, 145, 255, 0.32);
  --text: #d8e4ff;
  --text-2: #a0b0d8;
  --text-3: #6b7da3;
  --primary: #4f8bff;
  --primary-2: #6ea8ff;
  --cyan: #22d3ee;
  --green: #34d399;
  --orange: #fb923c;
  --pink: #f472b6;
}

html, body { width: 100%; height: 100%; overflow: hidden; }

body {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(79,139,255,0.18), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(96,165,250,0.12), transparent 50%),
    linear-gradient(180deg, #050a1a 0%, #0a1226 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
}

.app {
  width: 100vw;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.topbar,
.navbar {
  display: none !important;
}

/* ============ 顶部状态栏 ============ */
.topbar {
  height: 56px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 32px;
  background: linear-gradient(180deg, rgba(20, 35, 75, 0.9), rgba(10, 20, 48, 0.4));
  border-bottom: 1px solid var(--border);
  position: relative;
}
.topbar::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 50%; transform: translateX(-50%);
  width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.topbar-left, .topbar-right {
  display: flex; align-items: center; gap: 18px; font-size: 13px; color: var(--text-2);
}
.topbar-right { justify-content: flex-end; }
.topbar-item { display: inline-flex; align-items: center; gap: 6px; }
.topbar-item b { color: var(--primary-2); font-weight: 600; }
.topbar-item.ok { color: var(--green); }
.topbar-item.ok::before { content:''; width:6px;height:6px;border-radius:50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.topbar-center { text-align: center; }
.topbar-title {
  font-size: 30px; font-weight: 700; letter-spacing: 4px;
  background: linear-gradient(180deg, #fff 0%, #9bbcff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(79,139,255,0.5);
}
.topbar-subtitle {
  font-size: 12px; color: var(--text-3); letter-spacing: 6px; margin-top: 2px;
}

.dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.dot.live {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ============ 导航栏 ============ */
.navbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 32px;
  background: rgba(10, 20, 48, 0.5);
  border-bottom: 1px solid var(--border);
}
.nav-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 28px; border-radius: 8px;
  font-size: 15px; color: var(--text-2); cursor: pointer;
  transition: all .2s;
}
.nav-item:hover { color: var(--text); background: rgba(79,139,255,0.08); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(79,139,255,0.25), rgba(110,168,255,0.15));
  border: 1px solid var(--border-2);
  box-shadow: 0 0 20px rgba(79,139,255,0.3), inset 0 0 20px rgba(79,139,255,0.1);
  position: relative;
}
.nav-item.active::after {
  content:''; position:absolute; left:50%; bottom:-12px; transform:translateX(-50%);
  width: 30px; height: 2px; background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}
.nav-ico {
  width: 18px; height: 18px; border-radius: 4px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  display: inline-block;
}

/* ============ 主体 ============ */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: clamp(280px, 21vw, 380px) minmax(0, 1fr) clamp(280px, 21vw, 380px);
  gap: 16px;
  padding: 16px;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}
.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.col-center { min-width: 0; }

/* ============ 卡片通用 ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  backdrop-filter: blur(8px);
}
.card::before {
  content:''; position: absolute; top:0; left:16px; right:16px; height:1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: .6;
}
.card-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.card-divider {
  height: 1px;
  margin: 0 -16px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.card-ico {
  width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--cyan));
  box-shadow: 0 0 6px var(--primary);
}
.card-more { margin-left: auto; font-size: 12px; color: var(--text-3); cursor: pointer; font-weight: 400; }
.card-more:hover { color: var(--primary-2); }

/* ============ 左侧：智小喵助手 ============ */
.card-ai { flex-shrink: 0; }
.ai-body { text-align: center; padding: 4px 0 8px; }
.ai-greet { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.ai-desc { font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
.ai-avatar {
  position: relative; width: 180px; height: 180px;
  margin: 8px auto 0;
  display: flex; align-items: center; justify-content: center;
}
.ai-avatar-core {
  width: 160px; height: 160px;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  animation: float 3s ease-in-out infinite;
}
.avatar-img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(79,139,255,0.6));
  pointer-events: none;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.ai-avatar-glow {
  position: absolute; inset: 30%; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,139,255,0.5), transparent 70%);
  filter: blur(20px);
}
.ai-avatar-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px dashed var(--primary-2);
  opacity: .5;
  animation: rotate 12s linear infinite;
}
.ai-avatar-ring::after {
  content:''; position:absolute; top:-3px; left:50%; transform:translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}
@keyframes rotate { to { transform: rotate(360deg); } }

/* ============ 左侧：服务能力 4 格 ============ */
.ai-cap-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.cap-item {
  padding: 12px 8px; text-align: center;
  background: rgba(79,139,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all .2s;
  cursor: pointer;
}
.cap-item:hover {
  background: rgba(79,139,255,0.12);
  border-color: var(--border-2);
  transform: translateY(-2px);
}
.cap-icon {
  width: 36px; height: 36px; margin: 0 auto 6px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  box-shadow: 0 0 12px var(--primary);
}
.cap-img { width: 22px; height: 22px; object-fit: contain; pointer-events: none; }
.cap-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.cap-desc { font-size: 11px; color: var(--text-3); }

/* ============ QA 列表 ============ */
.qa-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.qa-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 6px;
  cursor: pointer; transition: background .15s;
  font-size: 13px; color: var(--text-2);
}
.qa-item:hover { background: rgba(79,139,255,0.08); color: var(--text); }
.qa-icon { font-size: 14px; flex-shrink: 0; }
.qa-img { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; pointer-events: none; }
.qa-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-arrow { color: var(--text-3); font-size: 16px; }
.session-list .qa-item { font-size: 13px; }
.session-list .qa-time { color: var(--text-3); font-size: 12px; flex-shrink: 0; }

/* ============ 中间：聊天 ============ */
.chat-card {
  flex: 1; display: flex; flex-direction: column;
  padding: 0; min-height: 0;
  overflow: hidden;
}
.chat-header {
  display: flex; align-items: baseline; gap: 6px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.chat-title { font-size: 16px; font-weight: 600; }
.chat-sub { font-size: 12px; color: var(--text-3); }

.chat-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

.chat-welcome-inner {
  text-align: center; padding: 40px 0;
  color: var(--text-3); font-size: 13px;
}

.msg-row { display: flex; gap: 12px; align-items: flex-start; }
.msg-row.user { justify-content: flex-end; }
.msg-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.msg-avatar.ai {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 0 12px rgba(79,139,255,0.5);
}
.msg-avatar.user {
  background: linear-gradient(135deg, #475569, #334155);
}

.msg-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px; line-height: 1.7;
  background: rgba(79,139,255,0.08);
  border: 1px solid var(--border);
}
.msg-row.user .msg-bubble {
  background: linear-gradient(135deg, rgba(79,139,255,0.25), rgba(110,168,255,0.15));
  border-color: var(--border-2);
}
.msg-bubble strong { color: var(--primary-2); }
.msg-bubble .device-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg-bubble .device-chip {
  padding: 4px 10px; font-size: 12px;
  background: rgba(34,211,238,0.1);
  border: 1px solid rgba(34,211,238,0.3);
  border-radius: 4px; color: var(--cyan);
}
.msg-bubble .device-chip b { color: #fff; margin: 0 2px; }
.msg-bubble .project-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 10px;
}
.msg-bubble .proj-card {
  padding: 8px 10px;
  background: rgba(15,26,61,0.6);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.msg-bubble .proj-card .pc-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.msg-bubble .proj-card .pc-bar {
  height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden;
  margin-bottom: 4px;
}
.msg-bubble .proj-card .pc-bar > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--cyan)); }
.msg-bubble .proj-card .pc-meta { font-size: 11px; color: var(--text-3); display: flex; justify-content: space-between; }

.msg-bubble .achv-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 10px;
}
.msg-bubble .achv-card {
  padding: 10px;
  background: rgba(15,26,61,0.6);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.msg-bubble .achv-card .ac-icon {
  font-size: 22px; margin-bottom: 6px;
}
.msg-bubble .achv-card .ac-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.msg-bubble .achv-card .ac-tag {
  display: inline-block; font-size: 11px; padding: 1px 6px;
  background: rgba(34,211,238,0.15); color: var(--cyan);
  border-radius: 3px; margin-bottom: 4px;
}
.msg-bubble .achv-card .ac-meta { font-size: 11px; color: var(--text-3); line-height: 1.5; }

.msg-time { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.typing { display: flex; gap: 4px; padding: 4px 0; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary-2);
  animation: bounce 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,100%{transform:translateY(0);opacity:.4} 50%{transform:translateY(-6px);opacity:1} }

/* ============ 输入区 ============ */
.chat-input-wrap {
  padding: 14px 20px 12px;
  border-top: 1px solid var(--border);
  background: rgba(8, 16, 36, 0.5);
}
.chat-input {
  display: flex; gap: 8px; align-items: center;
  padding: 4px 4px 4px 16px;
  background: rgba(15,26,61,0.7);
  border: 1px solid var(--border-2);
  border-radius: 24px;
  margin-bottom: 10px;
}
.chat-input input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px; font-family: inherit;
  padding: 8px 0;
}
.chat-input input::placeholder { color: var(--text-3); }
.chat-send {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 16px;
  box-shadow: 0 0 12px rgba(79,139,255,0.4);
  transition: transform .15s;
}
.chat-send:hover { transform: scale(1.08); }

.chat-tools { display: flex; gap: 16px; padding: 0 4px 8px; }
.tool-btn {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-3); font-size: 12px;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: inherit;
}
.tool-btn:hover { color: var(--primary-2); }

.chat-foot { text-align: center; font-size: 11px; color: var(--text-3); }

/* ============ 右侧：服务能力 6 格 ============ */
.service-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}
.svc-item {
  padding: 12px 6px; text-align: center;
  background: rgba(79,139,255,0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all .2s;
  cursor: pointer;
}
.svc-item:hover {
  background: rgba(79,139,255,0.12);
  border-color: var(--border-2);
  transform: translateY(-2px);
}
.svc-icon {
  width: 32px; height: 32px; margin: 0 auto 6px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  box-shadow: 0 0 10px var(--primary);
}
.svc-img { width: 20px; height: 20px; object-fit: contain; pointer-events: none; }
.svc-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.svc-desc { font-size: 11px; color: var(--text-3); }

/* ============ 右侧：联动推荐 ============ */
.link-tabs {
  display: flex; gap: 6px; margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.link-tab {
  font-size: 12px; padding: 4px 10px; border-radius: 12px;
  color: var(--text-3); cursor: pointer; transition: all .15s;
}
.link-tab:hover { color: var(--text-2); }
.link-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 8px rgba(79,139,255,0.4);
}

.room-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.room-card {
  background: rgba(15,26,61,0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.room-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.room-status {
  position: absolute; top: 8px; left: 8px;
  font-size: 11px; padding: 1px 6px; border-radius: 3px;
  background: rgba(0,0,0,0.5);
  z-index: 2;
}
.room-status.ok { color: var(--green); border: 1px solid var(--green); }
.room-status.busy { color: var(--orange); border: 1px solid var(--orange); }
.room-status.free { color: var(--cyan); border: 1px solid var(--cyan); }

.room-photo {
  height: 60px;
  background:
    linear-gradient(135deg, rgba(79,139,255,0.2), rgba(34,211,238,0.1)),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 8px);
  border-radius: 4px;
  margin-bottom: 6px;
}
.room-name { font-size: 12px; font-weight: 600; margin-bottom: 4px; text-align: center; }
.room-meta {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-3);
}
.room-meta span { display: inline-flex; align-items: center; gap: 2px; }
.room-meta span::before { content:''; width:3px;height:3px;border-radius:50%;background: var(--primary-2); }
