/* V空间：只显示图标和名称，并使每张卡片的图标列对齐。 */
.app-icon .item-card-info {
  min-height: 74px;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px;
  padding: 0 18px;
  box-sizing: border-box;
}

.app-icon .app-icon-info-icon {
  width: 48px !important;
  height: 48px !important;
  flex: 0 0 48px;
}

.app-icon .app-icon-info-icon > div {
  width: 48px !important;
  height: 48px !important;
}

.app-icon .item-icon,
.app-icon .item-icon > div {
  width: 44px !important;
  height: 44px !important;
}

.app-icon .item-icon img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.app-icon .item-card-info > .text-white {
  max-width: none !important;
  width: auto !important;
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.app-icon .app-icon-info-text-box {
  width: 100% !important;
  min-width: 0;
}

.app-icon .app-icon-info-text-box-description {
  display: none !important;
}

.app-icon .app-icon-info-text-box-title {
  text-align: left;
  line-height: 1.25;
}

@media (max-width: 640px) {
  .app-icon .item-card-info {
    gap: 8px;
    padding: 0 12px;
  }

  .app-icon .app-icon-info-text-box-title .n-ellipsis {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.15;
  }
}

/* V空间品牌标志。 */
.logo.vzone-site-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vzone-site-logo-mark {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.14));
}

/* ── AI chat panel ── */
#vzone-ai-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.vzone-ai-launcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.vzone-ai-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.vzone-ai-launcher img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.vzone-ai-launcher span {
  font-size: 14px;
  font-weight: 600;
}

.vzone-ai-panel {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 420px;
  max-height: 600px;
  background: #1a1a2e;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 480px) {
  .vzone-ai-panel {
    width: calc(100vw - 32px);
    right: -8px;
    max-height: calc(100vh - 100px);
  }
}

.vzone-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vzone-ai-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vzone-ai-title img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.vzone-ai-title strong {
  display: block;
  color: white;
  font-size: 15px;
}

.vzone-ai-title small {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  margin-top: 2px;
}

.vzone-ai-actions {
  display: flex;
  gap: 8px;
}

.vzone-ai-actions button {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}

.vzone-ai-actions button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Sessions panel */
.vzone-ai-sessions {
  background: #16213e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 200px;
  overflow-y: auto;
}

.vzone-ai-sessions-header {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px;
}

.vzone-ai-session-new {
  background: rgba(102, 126, 234, 0.3);
  border: 1px solid rgba(102, 126, 234, 0.5);
  color: #667eea;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.vzone-ai-session-new:hover {
  background: rgba(102, 126, 234, 0.5);
}

.vzone-ai-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.vzone-ai-session-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.vzone-ai-session-item.active {
  background: rgba(102, 126, 234, 0.2);
}

.vzone-ai-session-info {
  flex: 1;
  min-width: 0;
}

.vzone-ai-session-title {
  color: white;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vzone-ai-session-time {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  margin-top: 2px;
}

.vzone-ai-session-delete {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.vzone-ai-session-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Messages */
.vzone-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 300px;
  max-height: 400px;
}

.vzone-ai-message {
  display: flex;
  gap: 8px;
}

.vzone-ai-message-user {
  justify-content: flex-end;
}

.vzone-ai-message-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.vzone-ai-message-user .vzone-ai-message-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.vzone-ai-message-assistant .vzone-ai-message-bubble {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-bottom-left-radius: 4px;
}

.vzone-ai-message-error .vzone-ai-message-bubble {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.vzone-ai-msg-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 8px;
}

/* Image preview */
.vzone-ai-image-preview {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}

.vzone-ai-preview-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.vzone-ai-preview-remove {
  background: rgba(239, 68, 68, 0.2);
  border: none;
  color: #ef4444;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

/* Form */
.vzone-ai-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vzone-ai-form textarea {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  color: white;
  font-size: 14px;
  resize: none;
  font-family: inherit;
}

.vzone-ai-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.vzone-ai-form textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.vzone-ai-send {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.vzone-ai-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.vzone-ai-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Markdown styles ── */
.vzone-markdown {
  font-size: 14px;
  line-height: 1.6;
}

.vzone-paragraph {
  margin: 0 0 8px 0;
}

.vzone-paragraph:last-child {
  margin-bottom: 0;
}

.vzone-heading {
  margin: 12px 0 8px 0;
  font-weight: 600;
}

.vzone-heading:first-child {
  margin-top: 0;
}

.vzone-h1 { font-size: 1.25em; }
.vzone-h2 { font-size: 1.15em; }
.vzone-h3 { font-size: 1.05em; }
.vzone-h4 { font-size: 1em; }

.vzone-list {
  margin: 8px 0;
  padding-left: 24px;
}

.vzone-list li {
  margin: 4px 0;
}

.vzone-inline-code {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.vzone-markdown a {
  color: #60a5fa;
  text-decoration: none;
}

.vzone-markdown a:hover {
  text-decoration: underline;
}

.vzone-markdown hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 12px 0;
}

/* ── Code block styles ── */
.vzone-code-block {
  margin: 12px 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0d1117;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.vzone-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vzone-code-lang {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
}

.vzone-code-copy {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}

.vzone-code-copy:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.vzone-code-copy.copied {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
  color: #4ade80;
}

.vzone-code-content {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #e6edf3;
}

.vzone-code-content code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* Syntax highlighting colors */
.vzone-hl-keyword {
  color: #ff7b72;
}

.vzone-hl-string {
  color: #a5d6ff;
}

.vzone-hl-comment {
  color: #8b949e;
  font-style: italic;
}

.vzone-hl-number {
  color: #79c0ff;
}

/* ── Loading spinner ── */
.vzone-loading-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: vzone-spin 0.8s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes vzone-spin {
  to { transform: rotate(360deg); }
}

/* ── Approval card (future) ── */
.vzone-approval-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  margin: 8px 0;
}

.vzone-approval-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fbbf24;
}

.vzone-approval-buttons {
  display: flex;
  gap: 8px;
}

.vzone-approval-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.vzone-approval-btn.approve {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.vzone-approval-btn.approve:hover {
  background: rgba(34, 197, 94, 0.3);
}

.vzone-approval-btn.deny {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.vzone-approval-btn.deny:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* ── Login-only software update history ── */
.vzone-update-launcher {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: 108px;
  height: 44px;
  border: 1px solid rgba(125, 211, 252, 0.38);
  border-radius: 15px;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.38);
  color: #e2e8f0;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.vzone-update-launcher span {
  margin-right: 6px;
  color: #38bdf8;
  font-size: 18px;
}

.vzone-update-panel {
  position: absolute;
  right: 0;
  bottom: 120px;
  width: min(520px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 155px));
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(24px) saturate(130%);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.58);
}

.vzone-update-panel[hidden] {
  display: none;
}

.vzone-update-header {
  min-height: 70px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.3), rgba(30, 64, 175, 0.18));
}

.vzone-update-header > div,
.vzone-update-header strong,
.vzone-update-header small {
  display: block;
}

.vzone-update-header small,
.vzone-update-count {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
}

.vzone-update-header > div:last-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vzone-update-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 24px;
}

.vzone-update-list {
  max-height: min(480px, calc(100vh - 225px));
  overflow-y: auto;
}

.vzone-update-entry {
  min-height: 70px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr) 68px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.72);
}

.vzone-update-entry:last-child {
  border-bottom: 0;
}

.vzone-update-entry time,
.vzone-update-entry span {
  color: #94a3b8;
  font-size: 11px;
}

.vzone-update-entry strong {
  display: block;
  overflow: hidden;
  margin-bottom: 5px;
  color: #f8fafc;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vzone-update-entry em {
  justify-self: end;
  color: #7dd3fc;
  font-size: 10px;
  font-style: normal;
}

.vzone-update-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 13px;
}

.vzone-update-empty.error {
  color: #fca5a5;
}

@media (max-width: 640px) {
  .vzone-update-launcher {
    bottom: 60px;
    width: 98px;
    height: 40px;
  }

  .vzone-update-panel {
    position: fixed;
    inset: 12px;
    width: auto;
    max-height: none;
    border-radius: 20px;
  }

  .vzone-update-list {
    max-height: calc(100vh - 106px);
  }

  .vzone-update-entry {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
  }

  .vzone-update-entry time {
    grid-column: 1 / -1;
  }
}
