/* ==========================================================================
   CXNEXUS // 聪迅枢纽 DESIGN SYSTEM
   Aesthetic: Interstellar Gravitational Minimalism & Swiss Precision
   References: USDX.money / StablesLabs.com / ClaudeFable 5.5
   ========================================================================== */

:root {
  /* Dark Mode (Default) */
  --bg-void: #060709;
  --bg-primary: #0a0c10;
  --bg-secondary: #10131a;
  --bg-tertiary: #161b24;
  --bg-card: rgba(16, 19, 26, 0.75);
  --bg-card-hover: rgba(22, 27, 36, 0.85);
  --bg-overlay: rgba(6, 7, 9, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-active: rgba(255, 255, 255, 0.28);

  --text-primary: #f1f3f7;
  --text-secondary: #94a0b2;
  --text-muted: #535f72;
  --text-inverse: #060709;

  --accent-cyan: #00e5a3;
  --accent-cyan-glow: rgba(0, 229, 163, 0.18);
  --accent-emerald: #10b981;
  --accent-blue: #38bdf8;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, Monaco, monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 35px rgba(0, 229, 163, 0.15);

  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-void: #f4f5f7;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #edf0f5;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(248, 249, 250, 0.95);
  --bg-overlay: rgba(244, 245, 247, 0.85);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.15);
  --border-active: rgba(0, 0, 0, 0.32);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  --accent-cyan: #0d9488;
  --accent-cyan-glow: rgba(13, 148, 136, 0.12);
  --accent-emerald: #059669;
  --accent-blue: #0284c7;

  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 25px rgba(13, 148, 136, 0.12);
}

/* ================= Global Reset & Typography ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Fine-line Grid Overlay (Hidden by default; centered symmetrically when active in Void Drift) */
.grid-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(to right, var(--border-subtle) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: calc(50% - 30px) calc(50% - 30px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

#app-root {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================= Header Bar ================= */
header.nexus-header {
  height: 64px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  box-shadow: 0 0 15px rgba(0, 229, 163, 0.1);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--text-primary);
}

.brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--accent-cyan);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.telemetry-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-ring 2.4s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ================= Buttons & Micro-components ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-active);
  color: var(--text-primary);
}

.btn-primary {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #060709;
  font-weight: 600;
}

.btn-primary:hover {
  background: #10f4b1;
  border-color: #10f4b1;
  box-shadow: 0 0 16px var(--accent-cyan-glow);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-active);
  background: var(--bg-tertiary);
}

/* ================= Main Container & Layout ================= */
main.nexus-main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Top Toolbar: Breadcrumbs + Actions */
.control-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

.crumb-item {
  cursor: pointer;
  transition: color var(--transition-fast);
  color: var(--text-secondary);
}

.crumb-item:hover {
  color: var(--accent-cyan);
}

.crumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
  cursor: default;
}

.crumb-separator {
  color: var(--text-muted);
  user-select: none;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Search Bar (USDX / ClaudeFable style) */
.search-wrapper {
  position: relative;
  width: 240px;
}

.search-input {
  width: 100%;
  height: 34px;
  padding: 0 32px 0 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

.search-icon-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 1px 4px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-pill {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.filter-pill.active {
  color: var(--accent-cyan);
  background: var(--bg-tertiary);
  border-color: var(--border-subtle);
  font-weight: 600;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Drag & Drop Zone Container */
.dropzone-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--accent-cyan);
  margin: 16px;
  border-radius: var(--radius-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dropzone-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.dropzone-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  color: var(--accent-cyan);
  animation: float-pulse 2s infinite ease-in-out;
}

@keyframes float-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ================= File Table & Grid ================= */
.file-view-container {
  min-height: 480px;
}

/* Single Hamburger (≡) Action Trigger & Floating Popover Menu */
.item-menu-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.item-menu-btn:hover,
.item-menu-btn.active {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.item-action-popover {
  position: fixed;
  z-index: 450;
  min-width: 176px;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  display: none;
  flex-direction: column;
  gap: 2px;
}

.item-action-popover.open {
  display: flex;
}

.item-popover-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.item-popover-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.item-popover-btn.danger {
  color: var(--accent-rose);
}

.item-popover-btn.danger:hover {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
}

.item-popover-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 6px;
}

/* Table Style */
.nexus-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.nexus-table th {
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 500;
}

.nexus-table th.sortable {
  cursor: pointer;
}

.nexus-table th.sortable:hover {
  color: var(--accent-cyan);
}

.nexus-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  vertical-align: middle;
}

.nexus-table tr.file-row {
  transition: background var(--transition-fast);
  cursor: pointer;
}

.nexus-table tr.file-row:hover {
  background: var(--bg-card-hover);
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-name-text {
  font-weight: 500;
  color: var(--text-primary);
  max-width: 480px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.nexus-table tr.file-row:hover .actions-cell {
  opacity: 1;
}

/* Grid Style */
.nexus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.grid-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.grid-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
}

.grid-card-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-card-name {
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.grid-card-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon {
  width: 54px;
  height: 54px;
  opacity: 0.35;
}

/* ================= Storage Telemetry Footer ================= */
footer.nexus-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
  padding: 16px 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.quota-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quota-bar-bg {
  width: 140px;
  height: 5px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.quota-bar-fill {
  height: 100%;
  background: var(--accent-cyan);
  transition: width 0.3s ease;
}

/* ================= Modals & Drawers ================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-secondary);
}

/* Input Fields */
.form-input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan-glow);
}

/* ================= Auth Terminal View ================= */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-terminal {
  max-width: 480px;
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.auth-terminal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid var(--border-medium);
  box-shadow: 0 0 25px rgba(0, 229, 163, 0.25);
  margin-bottom: 20px;
  object-fit: cover;
}

.auth-heading {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.qr-frame {
  padding: 16px;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  width: 220px;
  height: 220px;
}

.qr-frame svg {
  width: 100%;
  height: 100%;
}

.whitelist-display {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  width: 100%;
  text-align: left;
  margin-bottom: 20px;
}

.whitelist-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.whitelist-key {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-primary);
  word-break: break-all;
  user-select: all;
}

/* ================= Preview Modal Styling ================= */
.preview-modal-box {
  max-width: 900px;
  width: 95%;
  height: 80vh;
}

.preview-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
  overflow: hidden;
  position: relative;
}

.preview-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-content video {
  max-width: 100%;
  max-height: 100%;
  outline: none;
}

/* Code preview enhancements */
.code-preview-container {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.7;
  white-space: pre;
  background: var(--bg-primary);
  tab-size: 2;
  border-radius: var(--radius-sm);
  user-select: text;
}

/* Audio Player Custom Styling */
audio::-webkit-media-controls-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
}
audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-medium);
  border-left: 3px solid var(--accent-cyan);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  box-shadow: var(--shadow-subtle);
  animation: slideInRight 0.25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.error {
  border-left-color: var(--accent-rose);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==================== 3-STAGE LANDING & LOGIN ARCHITECTURE (USDX.money + ClaudeFable 5.5) ==================== */

/* Shared Floating Top Nav for Landing & Login */
.stage-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 60;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(6, 7, 9, 0.35);
}

[data-theme="light"] .stage-nav {
  background: rgba(255, 255, 255, 0.55);
}

.stage-nav-left, .stage-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Stage 1: Landing Hero Screen */
.landing-screen {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 96px 24px 64px;
}

.hero-svg-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
  opacity: 0.92;
}

[data-theme="light"] .hero-svg-bg {
  opacity: 0.28;
  filter: invert(0.88) hue-rotate(180deg) contrast(1.1);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 48%, rgba(6, 7, 9, 0.35) 0%, rgba(6, 7, 9, 0.85) 78%, rgba(6, 7, 9, 0.96) 100%);
  pointer-events: none;
  z-index: 1;
}

[data-theme="light"] .hero-vignette {
  background: radial-gradient(circle at 50% 48%, rgba(244, 245, 247, 0.45) 0%, rgba(244, 245, 247, 0.88) 80%, rgba(244, 245, 247, 0.98) 100%);
}

.hero-content {
  position: relative;
  z-index: 5;
  max-width: 780px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: heroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 9999px;
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent-cyan);
  margin-bottom: 24px;
}

[data-theme="light"] .hero-eyebrow {
  background: rgba(0, 0, 0, 0.04);
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(28px, 4.4vw, 48px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.18;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.hero-subtitle-1 {
  font-size: clamp(20px, 2.8vw, 30px);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero-subtitle-2 {
  font-family: var(--font-mono);
  font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent-cyan);
  margin-bottom: 24px;
}

.hero-desc {
  max-width: 620px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 38px;
}

/* Transparent Capsule Button (透明胶囊进入应用按钮) */
.btn-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 38px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .btn-capsule {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(15, 23, 42, 0.25);
  color: #0f172a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.btn-capsule:hover {
  background: rgba(0, 229, 163, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 229, 163, 0.22);
}

.btn-capsule .arrow-icon {
  transition: transform 0.25s ease;
}

.btn-capsule:hover .arrow-icon {
  transform: translateX(4px);
}

.hero-metrics-bar {
  position: relative;
  z-index: 5;
  margin-top: 64px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  padding: 14px 28px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Stage 2: Login Screen (X Planet Escape Blackhole Background) */
.login-screen {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 20px 40px;
  overflow: hidden;
}

.login-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  filter: contrast(1.08) brightness(0.72);
  animation: slowDrift 28s ease-in-out infinite alternate;
}

[data-theme="light"] .login-bg-image {
  opacity: 0.22;
  filter: contrast(1.05) brightness(1.05);
}

@keyframes slowDrift {
  0% { transform: scale(1.0); }
  100% { transform: scale(1.07); }
}

.login-bg-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(6, 7, 9, 0.45) 0%, rgba(6, 7, 9, 0.88) 100%);
  z-index: 1;
}

[data-theme="light"] .login-bg-overlay {
  background: radial-gradient(circle at 50% 50%, rgba(248, 249, 250, 0.55) 0%, rgba(244, 245, 247, 0.92) 100%);
}

.login-panel {
  position: relative;
  z-index: 5;
  max-width: 440px;
  width: 100%;
  background: rgba(12, 14, 20, 0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

[data-theme="light"] .login-panel {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.login-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.login-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0 20px;
}

.login-provider-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

[data-theme="light"] .login-provider-btn {
  background: rgba(0, 0, 0, 0.02);
}

.login-provider-btn:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.07);
}

.login-provider-btn.primary-wallet {
  border-color: rgba(0, 229, 163, 0.45);
  background: rgba(0, 229, 163, 0.08);
}

.login-provider-btn.primary-wallet:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 229, 163, 0.16);
  box-shadow: 0 0 24px var(--accent-cyan-glow);
}

.provider-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.provider-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.provider-badge.ready {
  color: var(--accent-cyan);
  border-color: rgba(0, 229, 163, 0.35);
}

/* Unified Wallet Modal Tabs */
.wallet-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.wallet-tab-btn {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wallet-tab-btn.active {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  color: var(--accent-cyan);
  font-weight: 600;
}

.wallet-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

.ext-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ext-option-btn:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-tertiary);
}

/* ==================== INTERNAL DRAG & DROP + SPREADSHEET PREVIEW + MOVE MODAL ==================== */
.drop-target-active {
  background: rgba(0, 229, 163, 0.14) !important;
  outline: 1px dashed var(--accent-cyan) !important;
  box-shadow: inset 0 0 18px rgba(0, 229, 163, 0.18);
}

.crumb-item.drop-target-active {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
}

.grid-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.grid-card-actions {
  display: flex;
  gap: 2px;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.grid-card:hover .grid-card-actions {
  opacity: 1;
}

.move-folder-item {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.move-folder-item:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-tertiary);
}

/* Spreadsheet Preview */
.sheet-preview-root {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.sheet-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  overflow-x: auto;
  flex-shrink: 0;
}

.sheet-tab-btn {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.sheet-tab-btn.active {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  color: var(--accent-cyan);
  font-weight: 600;
}

.sheet-panels-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sheet-table-wrap {
  width: 100%;
  height: 100%;
  overflow: auto;
}

.sheet-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
}

.sheet-table th,
.sheet-table td {
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  text-align: left;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.sheet-row-num {
  background: var(--bg-secondary);
  color: var(--text-muted);
  text-align: center !important;
  width: 44px;
  user-select: none;
}

/* ==================== RESPONSIVE BREAKPOINTS (PC / TABLET / MOBILE 三端自适应) ==================== */

/* Touch devices: always show action buttons */
@media (hover: none), (max-width: 960px) {
  .actions-cell {
    opacity: 1 !important;
  }
  .grid-card-actions {
    opacity: 1 !important;
  }
}

/* Tablet (<= 1024px) */
@media (max-width: 1024px) {
  header.nexus-header {
    padding: 10px 18px;
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .stage-nav {
    padding: 0 20px;
  }
  main.nexus-main {
    padding: 18px;
  }
  .brand-badge {
    display: none;
  }
  .file-name-text {
    max-width: 280px;
  }
}

/* Mobile (<= 640px) */
@media (max-width: 640px) {
  .stage-nav {
    height: 60px;
    padding: 0 14px;
  }
  .stage-nav .brand-sub {
    display: none;
  }
  .stage-nav-right {
    gap: 6px;
  }
  .landing-screen {
    padding: 84px 16px 40px;
  }
  .hero-desc {
    font-size: 13px;
    line-height: 1.65;
    margin-bottom: 28px;
  }
  .btn-capsule {
    padding: 12px 28px;
    font-size: 13px;
  }
  .hero-metrics-bar {
    margin-top: 36px;
    gap: 10px;
    padding: 12px;
    font-size: 10px;
  }
  .login-screen {
    padding: 76px 14px 28px;
  }
  .login-panel {
    padding: 26px 18px;
  }

  /* Drive Header on Mobile */
  header.nexus-header {
    padding: 10px 14px;
    gap: 8px;
  }
  .brand-section {
    gap: 10px;
  }
  .brand-title {
    font-size: 13px;
    letter-spacing: 0.08em;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }
  .telemetry-chip {
    padding: 4px 8px;
    font-size: 10px;
  }

  /* Main Toolbar & Search */
  main.nexus-main {
    padding: 14px;
    gap: 14px;
  }
  .control-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .breadcrumb-nav {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
  }
  .toolbar-right {
    flex-wrap: wrap;
    gap: 8px;
  }
  .search-wrapper {
    width: 100%;
  }
  .toolbar-right .btn {
    flex: 1;
    justify-content: center;
  }

  /* Filter Bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .filter-pills {
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .filter-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* File Table on Mobile */
  .file-view-container {
    overflow-x: auto;
  }
  .nexus-table th,
  .nexus-table td {
    padding: 10px 8px;
  }
  .nexus-table th:nth-child(4),
  .col-date-cell {
    display: none;
  }
  .file-name-text {
    max-width: 140px;
  }

  /* Grid View on Mobile */
  .nexus-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
  }
  .grid-card {
    padding: 12px 10px;
  }

  /* Modals & Drawers */
  .modal-backdrop {
    padding: 10px;
  }
  .preview-modal-box {
    width: 96vw;
    height: 86vh;
  }
  #upload-progress-drawer {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 16px;
  }
  footer.nexus-footer {
    padding: 12px 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ==================== CONGXUN.CX HEADER GLASS + BORDERLESS LOGO + FIXED SWITCHERS ==================== */
#cosmic-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.stage-nav,
header.nexus-header {
  background: rgba(10, 12, 16, 0.56) !important;
  backdrop-filter: blur(18px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(165%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
}

[data-theme="light"] .stage-nav,
[data-theme="light"] header.nexus-header {
  background: rgba(255, 255, 255, 0.72) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

/* Borderless Circular Logo (congxun.cx style - NO square box!) */
.brand-logo-clean {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

/* Fixed-size, fixed-position Language & Theme Switchers */
.lang-toggle-btn {
  width: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  height: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.theme-toggle-btn {
  width: 82px !important;
  min-width: 82px !important;
  max-width: 82px !important;
  height: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  white-space: nowrap;
  text-align: center;
}

/* Clean transparent stage containers over Cosmic ASCII canvas */
.landing-screen,
.login-screen {
  background: transparent !important;
}

/* Dynamic soft readability aura behind centered hero text (no heavy overlay mask) */
.hero-content {
  padding: 28px 24px;
  border-radius: var(--radius-lg);
}

[data-theme="light"] .hero-content {
  text-shadow: 0 1px 12px rgba(245, 246, 248, 0.85);
}

/* Ensure Dropzone is strictly hidden unless dragging external files */
#dropzone-overlay:not(.active) {
  display: none !important;
}

/* ==================== GLOBAL UNIFIED HEADER + 5-THEME AMBIENCE MENU ==================== */
.global-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  min-height: 64px;
  z-index: 120;
  background: rgba(10, 12, 16, 0.56);
  backdrop-filter: blur(18px) saturate(165%);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
}

.landing-screen .global-header,
.login-screen .global-header {
  position: fixed;
}

[data-theme="light"] .global-header {
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.global-header-inner {
  max-width: 1440px;
  width: 100%;
  height: 64px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.global-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}

.global-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.global-switchers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.drive-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drive-tool-btn {
  height: 32px;
  min-width: 82px;
  padding: 0 10px;
  justify-content: center;
  white-space: nowrap;
}

/* 5-Theme Ambience Dropdown */
.ambience-dropdown-wrap {
  position: relative;
}

.ambience-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 196px;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(20px);
  z-index: 300;
  display: none;
  flex-direction: column;
  gap: 2px;
}

.ambience-dropdown.open {
  display: flex;
}

.ambience-option {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.ambience-option:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.ambience-option.active {
  background: var(--bg-tertiary);
  border-color: rgba(0, 229, 163, 0.35);
  color: var(--accent-cyan);
  font-weight: 600;
}

.ambience-option.active::after {
  content: "✓";
  font-size: 11px;
}

.ambience-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 6px;
}

/* Unified Header Responsive Adaptation (Keep Lang/Theme Switchers locked in top-right across ALL 3 stages!) */
@media (max-width: 1024px) {
  .global-header-inner {
    padding: 0 18px;
  }
  .drive-global-header {
    height: auto;
  }
  .drive-global-header .global-header-inner {
    height: auto;
    min-height: 64px;
    padding-top: 12px;
    padding-bottom: 10px;
    flex-wrap: wrap;
  }
  .drive-global-header .global-header-right {
    display: contents;
  }
  .drive-global-header .global-switchers {
    order: 2;
  }
  .drive-global-header .drive-header-tools {
    order: 3;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .global-header-inner {
    height: 60px;
    padding: 0 14px;
  }
  .drive-global-header .global-header-inner {
    min-height: 60px;
    padding: 10px 14px;
  }
  .global-header-left .brand-sub {
    display: none;
  }
  .global-header-left .brand-title {
    font-size: 13px;
  }
  .drive-tool-btn {
    min-width: auto;
    padding: 0 8px;
    font-size: 11px;
    height: 28px;
  }
  .ambience-dropdown {
    left: 0;
    right: auto;
  }
}

/* ==================== PURE-CODE WEBGL2 CANVAS + NON-DOWNLOADABLE SVG LOGO + AUTO-FIT PREVIEW ==================== */
#cosmic-gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.brand-logo-svg {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.header-brand-btn {
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.header-brand-btn:hover {
  opacity: 0.85;
}

.brand-logo-svg.lg {
  width: 48px;
  height: 48px;
}

/* Fix Large Image & Media Auto-Fit Inside Preview Modal */
#preview-modal-body {
  overflow: hidden !important;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  background: var(--bg-void);
}

.preview-img-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  background: repeating-conic-gradient(rgba(128, 128, 128, 0.08) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}

.preview-img-wrap img,
#preview-modal-body video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}
