/* =========================================================
   Private Cloud Storage - Modern, Minimalist CSS Theme
   ========================================================= */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Light Theme Palette */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-active: #e2e8f0;
  --border: #e2e8f0;
  --border-focus: #3b82f6;

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-text: #ffffff;

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;

  --success: #10b981;
  --warning: #f59e0b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.15), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --transition: all 0.18s ease-in-out;
}

/* Dark Theme Palette */
[data-theme="dark"] {
  --bg-main: #0b0f17;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-hover: #1f2937;
  --bg-active: #374151;
  --border: #1f2937;
  --border-focus: #60a5fa;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #1e293b;
  --primary-text: #ffffff;

  --danger: #f87171;
  --danger-hover: #ef4444;
  --danger-light: #450a0a;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* User Pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background-color: var(--bg-hover);
  padding: 0.35rem 0.5rem 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background-color: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.user-storage {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-text);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

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

.icon-btn.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--border);
}

.icon-btn.danger-hover:hover {
  color: var(--danger);
  background-color: var(--danger-light);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ==================== AUTH VIEW ==================== */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  flex: 1;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.8rem;
}

.auth-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.auth-logo svg {
  width: 28px;
  height: 28px;
}

.auth-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.auth-tabs {
  display: flex;
  background-color: var(--bg-hover);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input,
.form-select {
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-footer {
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.alert-box {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.alert-box.error {
  background-color: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-box.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ==================== STORAGE VIEW ==================== */
.storage-view {
  padding: 1.25rem 1.5rem 3rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  flex: 1;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.toolbar-primary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toolbar-secondary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  justify-content: flex-end;
}

.hidden-input {
  display: none;
}

/* Search Box */
.search-box {
  position: relative;
  max-width: 260px;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 0.55rem 2rem 0.55rem 2.2rem;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--border-focus);
}

.search-clear {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
}

.view-toggle {
  display: flex;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2px;
}

/* Breadcrumbs */
.breadcrumbs-container {
  margin-bottom: 1.25rem;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 0.25rem;
}

.breadcrumbs-list {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
}

.breadcrumb-item a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.breadcrumb-item a:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 700;
}

.breadcrumb-separator {
  color: var(--text-muted);
}

/* Upload Progress Card */
.upload-status-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.upload-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.upload-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.upload-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-bar-bg {
  height: 6px;
  background-color: var(--bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #38bdf8);
  border-radius: var(--radius-full);
  transition: width 0.15s ease;
}

/* Drag & Drop Overlay */
.drag-drop-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dropzone-box {
  background-color: var(--bg-surface);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-lg);
  padding: 3rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  color: var(--primary);
  margin-bottom: 1rem;
  animation: bounce 1.2s infinite ease-in-out;
}

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

.dropzone-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.dropzone-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==================== EXPLORER GRID & LIST ==================== */
.explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

/* Explorer Item Card (Grid View) */
.file-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.file-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.file-icon-wrapper {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
}

.file-icon-wrapper svg {
  width: 36px;
  height: 36px;
}

/* Category icon styles */
.cat-folder { color: #eab308; }
.cat-image { color: #3b82f6; }
.cat-text { color: #10b981; }
.cat-document { color: #f97316; }
.cat-archive { color: #8b5cf6; }
.cat-executable { color: #ec4899; }
.cat-media { color: #06b6d4; }
.cat-other { color: var(--text-secondary); }

.file-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0.3rem;
}

.file-meta {
  font-size: 0.74rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Card Menu */
.card-menu-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.card-menu-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* ==================== LIST VIEW STYLES ==================== */
.explorer-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.explorer-list .file-card {
  flex-direction: row;
  align-items: center;
  text-align: left;
  padding: 0.75rem 1rem;
}

.explorer-list .file-card:hover {
  transform: none;
}

.explorer-list .file-icon-wrapper {
  width: 32px;
  height: 32px;
  margin-bottom: 0;
  margin-right: 0.85rem;
  flex-shrink: 0;
}

.explorer-list .file-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.explorer-list .file-info {
  flex: 1;
  min-width: 0;
  margin-right: 1rem;
}

.explorer-list .file-meta-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-right: 2.5rem;
}

.explorer-list .card-menu-btn {
  position: static;
}

/* Context Dropdown Menu */
.context-menu {
  position: absolute;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  z-index: 100;
  min-width: 140px;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.context-menu-item:hover {
  background-color: var(--bg-hover);
}

.context-menu-item.danger {
  color: var(--danger);
}

.context-menu-item.danger:hover {
  background-color: var(--danger-light);
}

.context-menu-item svg {
  width: 15px;
  height: 15px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
}

.empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.2rem;
  color: var(--text-muted);
}

.empty-icon svg {
  width: 100%;
  height: 100%;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.88rem;
}

/* ==================== MODALS ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-header h3.danger-title {
  color: var(--danger);
}

.modal-close-btn {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.modal-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Preview Modal Specialization */
.modal-preview {
  padding: 0;
}

.preview-container {
  width: 92vw;
  height: 88vh;
  max-width: 1100px;
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--bg-surface);
}

.preview-title-group {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  overflow: hidden;
}

.preview-title {
  font-weight: 700;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.preview-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.preview-body {
  flex: 1;
  overflow: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-main);
}

.image-preview-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-sm);
}

.text-preview-body {
  padding: 0;
  align-items: stretch;
}

.code-editor {
  width: 100%;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  border: none;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  padding: 1.25rem;
  resize: none;
  outline: none;
  tab-size: 2;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--text-primary);
  color: var(--bg-main);
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toastFade 0.2s ease-out;
}

@keyframes toastFade {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Utility */
.hidden {
  display: none !important;
}

/* ==================== RESPONSIVE RULES ==================== */
@media (max-width: 768px) {
  .storage-view {
    padding: 1rem 0.85rem 3rem;
  }

  .topbar {
    padding: 0.65rem 0.85rem;
  }

  .brand-title {
    font-size: 1.05rem;
  }

  .user-name {
    display: none;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .toolbar-primary {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toolbar-secondary {
    justify-content: space-between;
  }

  .search-box {
    max-width: none;
    flex: 1;
  }

  .explorer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .file-card {
    padding: 0.85rem 0.65rem;
  }

  .dropzone-box {
    padding: 2rem 1.5rem;
  }

  .preview-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

/* =====================================================================
   加载动画与视觉打磨
   ===================================================================== */

@keyframes cs-spin { to { transform: rotate(360deg); } }
@keyframes cs-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cs-pop-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cs-toast-in {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes cs-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes cs-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 通用转圈 */
.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  vertical-align: -3px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  animation: cs-spin .7s linear infinite;
}
.spinner.dark {
  border-color: rgba(37, 99, 235, .22);
  border-top-color: var(--primary);
}

/* 全屏加载遮罩 */
#pageLoader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(248, 250, 252, .78);
  animation: cs-fade-in .16s ease-out;
}
[data-theme="dark"] #pageLoader { background: rgba(11, 18, 32, .78); }
#pageLoader .ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: cs-spin .8s linear infinite;
}
#pageLoader .loader-text { font-size: .84rem; color: var(--text-secondary); }

/* 文件区骨架屏 */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  padding: 4px 0;
}
.skeleton-card {
  height: 134px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-active) 37%, var(--bg-hover) 63%);
  background-size: 300% 100%;
  animation: cs-shimmer 1.5s ease-in-out infinite;
}

/* 内容进入动画 */
.file-card { animation: cs-rise .18s ease-out; }

/* 模态框 / 预览层动画 */
.modal-backdrop { animation: cs-fade-in .16s ease-out; }
.modal-card, .preview-container { animation: cs-pop-in .22s cubic-bezier(.22, 1, .36, 1); }

/* Toast 弹入 */
.toast { animation: cs-toast-in .22s cubic-bezier(.22, 1, .36, 1); }

/* 上传进度条：流光动效 */
.progress-bar-fill {
  position: relative;
  overflow: hidden;
  transition: width .25s ease;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  background-size: 200% 100%;
  animation: cs-shimmer 1.1s linear infinite;
}
.upload-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  animation: cs-spin .75s linear infinite;
}

/* 按钮：按下反馈与阴影 */
.btn {
  transition: transform .12s ease, box-shadow .2s ease, background .18s ease, border-color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  box-shadow: 0 1px 2px rgba(37, 99, 235, .22), 0 8px 18px -12px rgba(37, 99, 235, .8);
}
.btn-primary:hover {
  box-shadow: 0 2px 6px rgba(37, 99, 235, .26), 0 12px 24px -14px rgba(37, 99, 235, .9);
}
.icon-btn { transition: transform .12s ease, background .18s ease, color .18s ease; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.spinning svg { animation: cs-spin .9s linear infinite; }

/* 文件卡片悬浮 */
.file-card { transition: transform .16s ease, box-shadow .22s ease, border-color .22s ease; }
.file-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -20px rgba(15, 23, 42, .55);
}

/* 顶栏与登录卡片的层次 */
.topbar { box-shadow: 0 1px 0 var(--border); }
.auth-card {
  box-shadow: 0 24px 50px -34px rgba(15, 23, 42, .5), 0 2px 10px -8px rgba(15, 23, 42, .2);
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; background-clip: content-box; }

/* 复制直链弹窗 */
.share-row { display: flex; gap: 8px; align-items: stretch; }
.share-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: .78rem;
  background: var(--bg-hover);
}
.share-hint {
  margin-top: 10px;
  font-size: .78rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* 移动端：内容不要贴着状态栏 */
@media (max-width: 767px) {
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
  .app-container { padding-bottom: env(safe-area-inset-bottom); }
}

/* =====================================================================
   公告横幅 / 验证码 / 忘记密码
   ===================================================================== */

.notice-bar {
  background: linear-gradient(135deg, rgba(37, 99, 235, .10), rgba(99, 102, 241, .10));
  border-bottom: 1px solid var(--border);
  animation: cs-rise .22s ease-out;
}
.notice-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: .7rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: .7rem;
}
.notice-icon { font-size: 1.1rem; line-height: 1.5; }
.notice-body { flex: 1; min-width: 0; }
.notice-body strong { display: block; font-size: .9rem; color: var(--text-primary); }
.notice-content {
  font-size: .82rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 2px;
}
.notice-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.notice-close:hover { color: var(--text-primary); }

.field-hint { margin-top: 6px; font-size: .76rem; color: var(--text-secondary); }

.auth-links { margin-top: .75rem; text-align: center; }
.auth-links a { font-size: .82rem; color: var(--primary); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

.share-row .btn { white-space: nowrap; }
