/* ===== Cloudrive - 云盘 UI 原型 ===== */

:root {
  /* 白色背景主题 */
  --bg-primary: #FFFFFF;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F7F7F4;
  --bg-hover: #EFEFEC;
  --text-primary: #185A56;
  --text-secondary: #4A5957;
  --text-tertiary: #8A9492;
  --border-color: #E4E7E6;
  --border-light: #EFF1F0;
  /* 主色：深灰绿 */
  --accent: #185A56;
  --accent-light: #236B67;
  --accent-dark: #0F4240;
  --accent-bg: #E6EFEA;
  --accent-glow: rgba(24, 90, 86, 0.12);
  /* 强调色：旭日黄 - 撞色 */
  --sun: #FDEB55;
  --sun-dark: #E8D43C;
  --sun-bg: #FEF9D2;
  --sun-glow: rgba(253, 235, 85, 0.4);
  --warning: #F59E0B;
  --error: #E85D4A;
  --success: #10B981;
  --purple: #8B5CF6;
  --blue: #3B82F6;
  --orange: #F97316;
  --pink: #EC4899;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --sidebar-width: 260px;
  --detail-width: 320px;
  --topbar-height: 64px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  height: 100%;
  width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
  outline: none;
  border: none;
  background: none;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 3px;
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

/* ===== 应用布局 ===== */
.app-container {
  display: flex;
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.content-area {
  flex: 1;
  overflow: auto;
  padding: 24px 32px;
  position: relative;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  transition: width var(--transition-normal), transform var(--transition-normal);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 24px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.logo-mark::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--sun);
  border-radius: 4px 0 0 0;
  transform: rotate(45deg) translate(2px, 2px);
}

.logo-mark::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
  animation: logo-shine 3s ease-in-out infinite;
}

@keyframes logo-shine {
  0%, 100% { transform: translateX(-100%) rotate(45deg); }
  50% { transform: translateX(100%) rotate(45deg); }
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 16px 12px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
  user-select: none;
}

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

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

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

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* ===== 顶栏 ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 24px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.breadcrumb-item {
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

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

.breadcrumb-separator {
  color: var(--text-tertiary);
  font-size: 16px;
}

.search-box {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  transition: all var(--transition-fast);
  border: 1.5px solid transparent;
}

.search-input-wrapper:focus-within {
  background: var(--bg-secondary);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  background: transparent;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

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

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.avatar:hover {
  transform: scale(1.05);
}

.avatar::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

/* ===== 页面标题区 ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

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

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

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

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

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}

/* ===== 视图切换 ===== */
.view-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border-color);
}

.view-toggle-btn {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
  color: var(--text-primary);
}

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

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.filter-chip:hover {
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-secondary);
}

.filter-chip .count {
  font-size: 11px;
  opacity: 0.7;
}

/* ===== 文件网格 ===== */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.file-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  animation: card-enter 0.4s var(--spring) backwards;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.file-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.file-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.file-card-checkbox {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: 2;
}

.file-card:hover .file-card-checkbox,
.file-card.selected .file-card-checkbox {
  opacity: 1;
}

.file-card.selected .file-card-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.file-card-preview {
  height: 120px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.file-icon-large {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.file-icon-large svg {
  width: 28px;
  height: 28px;
  color: white;
}

.file-icon-bg-folder { background: linear-gradient(135deg, #F59E0B, #F97316); }
.file-icon-bg-image { background: linear-gradient(135deg, #EC4899, #8B5CF6); }
.file-icon-bg-doc { background: linear-gradient(135deg, #3B82F6, #6366F1); }
.file-icon-bg-video { background: linear-gradient(135deg, #EF4444, #F97316); }
.file-icon-bg-audio { background: linear-gradient(135deg, #10B981, #0EA5A0); }
.file-icon-bg-code { background: linear-gradient(135deg, #6366F1, #8B5CF6); }
.file-icon-bg-zip { background: linear-gradient(135deg, #F59E0B, #84CC16); }
.file-icon-bg-pdf { background: linear-gradient(135deg, #EF4444, #DC2626); }

.file-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 2;
}

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

.file-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.file-action-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  transform: scale(1.1);
}

/* 缩略图模式 */
.file-card.has-thumbnail .file-card-preview {
  background-size: cover;
  background-position: center;
}

.thumbnail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.3));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.file-card:hover .thumbnail-overlay {
  opacity: 1;
}

/* ===== 列表视图 ===== */
.files-list {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.list-header {
  display: grid;
  grid-template-columns: 1fr 120px 160px 100px 40px;
  padding: 12px 20px;
  background: var(--bg-tertiary);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
}

.list-item {
  display: grid;
  grid-template-columns: 1fr 120px 160px 100px 40px;
  padding: 14px 20px;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition-fast);
  gap: 16px;
  animation: row-enter 0.3s ease-out backwards;
}

@keyframes row-enter {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:hover {
  background: var(--bg-tertiary);
}

.list-item.selected {
  background: var(--accent-bg);
}

.list-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon-small {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-icon-small svg {
  width: 18px;
  height: 18px;
  color: white;
}

.list-file-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
}

.list-cell {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 详情面板 ===== */
.detail-panel {
  width: var(--detail-width);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition-normal), width var(--transition-normal);
  position: relative;
  z-index: 5;
  overflow: hidden;
}

.detail-panel.closed {
  width: 0;
  border-left: none;
  transform: translateX(100%);
}

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

.detail-title {
  font-size: 16px;
  font-weight: 600;
}

.detail-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

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

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.detail-preview {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
}

.detail-preview .file-icon-large {
  width: 80px;
  height: 80px;
  border-radius: 20px;
}

.detail-preview .file-icon-large svg {
  width: 40px;
  height: 40px;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.detail-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.detail-info-row:last-child {
  border-bottom: none;
}

.detail-info-label {
  color: var(--text-secondary);
}

.detail-info-value {
  color: var(--text-primary);
  font-weight: 500;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-action-btn {
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.detail-action-btn:hover {
  background: var(--bg-hover);
}

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

/* ===== 存储组件 ===== */
.storage-widget {
  margin-top: auto;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
}

.storage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.storage-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.storage-amount {
  font-size: 13px;
  color: var(--text-secondary);
}

.storage-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.storage-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--sun) 100%);
  position: relative;
  transition: width 1s var(--spring);
  overflow: hidden;
}

.storage-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: storage-shine 2.5s ease-in-out infinite;
}

@keyframes storage-shine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

.storage-cta {
  width: 100%;
  padding: 8px 12px;
  background: var(--text-primary);
  color: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.storage-cta:hover {
  background: var(--text-secondary);
}

/* ===== 上传弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: overlay-fade 0.2s ease-out;
}

@keyframes overlay-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  width: 480px;
  max-width: calc(100vw - 48px);
  box-shadow: var(--shadow-xl);
  animation: modal-enter 0.35s var(--spring);
  overflow: hidden;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.modal-body {
  padding: 24px;
}

.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  background: var(--bg-tertiary);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.upload-zone.dragover {
  transform: scale(1.02);
}

.upload-icon-wrapper {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--accent-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.upload-zone.dragover .upload-icon-wrapper {
  animation: pulse 0.6s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

.upload-icon-wrapper svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.upload-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.upload-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.upload-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

.upload-hint strong {
  color: var(--accent);
  font-weight: 600;
}

.upload-list {
  margin-top: 20px;
  max-height: 200px;
  overflow-y: auto;
}

.upload-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  animation: upload-item-enter 0.3s ease-out;
}

@keyframes upload-item-enter {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.upload-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upload-item-info {
  flex: 1;
  min-width: 0;
}

.upload-item-name {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-progress {
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.upload-progress-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  transition: width 0.3s ease-out;
  position: relative;
}

.upload-progress-bar.liquid::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,255,255,0.4) 50%,
    transparent 100%);
  animation: liquid-flow 1s linear infinite;
}

@keyframes liquid-flow {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.upload-item-status {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
}

.upload-item-status.done {
  color: var(--success);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

/* ===== 小部件区 ===== */
.widgets-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-normal);
  animation: card-enter 0.4s var(--spring) backwards;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
  color: white;
}

.stat-icon.files { background: linear-gradient(135deg, #3B82F6, #6366F1); }
.stat-icon.photos { background: linear-gradient(135deg, #EC4899, #8B5CF6); }
.stat-icon.videos { background: linear-gradient(135deg, #EF4444, #F97316); }
.stat-icon.shared { background: linear-gradient(135deg, #10B981, #0EA5A0); }

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--error); }

/* ===== 最近活动 ===== */
.recent-section {
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.section-link {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.section-link:hover {
  color: var(--accent-dark);
}

/* ===== 拖拽遮罩 ===== */
.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 165, 160, 0.1);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: drop-overlay-enter 0.2s ease-out;
}

@keyframes drop-overlay-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.drop-overlay-content {
  width: 400px;
  padding: 48px;
  background: var(--bg-secondary);
  border: 3px dashed var(--accent);
  border-radius: var(--radius-xl);
  text-align: center;
  animation: drop-bounce 0.5s var(--spring);
}

@keyframes drop-bounce {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.drop-overlay-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: var(--accent-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 1.5s ease-in-out infinite alternate;
}

@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.drop-overlay-icon svg {
  width: 36px;
  height: 36px;
  color: var(--accent);
}

.drop-overlay-text {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.drop-overlay-sub {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== Toast 通知 ===== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  animation: toast-enter 0.4s var(--spring);
  border-left: 3px solid var(--success);
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.exit {
  animation: toast-exit 0.3s ease-in forwards;
}

@keyframes toast-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-icon svg {
  width: 14px;
  height: 14px;
  color: white;
}

.toast-text {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.toast-close {
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}

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

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .detail-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
    box-shadow: var(--shadow-xl);
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 30;
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .widgets-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    padding: 0 16px;
  }

  .content-area {
    padding: 16px;
  }
}

@media (max-width: 600px) {
  .files-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .widgets-row {
    grid-template-columns: 1fr;
  }

  .search-box {
    display: none;
  }

  .page-title {
    font-size: 22px;
  }

  .modal {
    width: calc(100vw - 32px);
  }
}

/* ===== 深色主题 ===== */
body.theme-dark {
  --bg-primary: #0B0D12;
  --bg-secondary: #13161D;
  --bg-tertiary: #1A1F29;
  --bg-hover: #242A36;
  --text-primary: #E6E9EF;
  --text-secondary: #9AA4B2;
  --text-tertiary: #6B7483;
  --border-color: #2A303C;
  --border-light: #1E232D;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.6);
}

body.theme-dark .sidebar {
  background: linear-gradient(180deg, #10131A 0%, #0D1016 100%);
  border-right-color: var(--border-light);
}

body.theme-dark .topbar {
  background: var(--bg-secondary);
  border-bottom-color: var(--border-light);
}

body.theme-dark .stat-card,
body.theme-dark .file-card,
body.theme-dark .files-list,
body.theme-dark .modal {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

body.theme-dark .file-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.theme-dark .search-input-wrapper {
  background: var(--bg-tertiary);
}

body.theme-dark .search-input-wrapper:focus-within {
  background: var(--bg-secondary);
}

body.theme-dark .filter-chip {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

body.theme-dark .filter-chip:hover {
  border-color: var(--text-tertiary);
}

body.theme-dark .filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

body.theme-dark .storage-widget {
  background: var(--bg-tertiary);
}

body.theme-dark .storage-bar-container {
  background: var(--bg-secondary);
}

body.theme-dark .upload-zone {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

body.theme-dark .upload-item {
  background: var(--bg-tertiary);
}

body.theme-dark .upload-progress {
  background: var(--border-color);
}

body.theme-dark .modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

body.theme-dark .toast {
  background: var(--bg-secondary);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

body.theme-dark .view-toggle {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

body.theme-dark .view-toggle-btn.active {
  background: var(--bg-tertiary);
}

/* ===== AI 入口卡片 ===== */
.ai-entry-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin: 0 4px 16px;
  background: linear-gradient(135deg, var(--accent-bg), transparent);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.ai-entry-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, var(--accent-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.ai-entry-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.ai-entry-card:hover::before {
  opacity: 1;
}

.ai-entry-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--sun);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.ai-entry-content {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.ai-entry-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ai-entry-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

.ai-entry-arrow {
  color: var(--text-tertiary);
  transition: all var(--transition-fast);
  position: relative;
  z-index: 1;
}

.ai-entry-card:hover .ai-entry-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

/* ===== 仓库卡片 ===== */
.repo-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.repo-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.repo-preview {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 14px;
  position: relative;
}

.repo-icon-large {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.repo-icon-small {
  width: 36px;
  height: 36px;
  borderRadius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 9px;
}

.repo-star-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  background: var(--bg-secondary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FBBF24;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.repo-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.repo-desc {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 14px;
}

.repo-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.repo-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-tertiary);
}

.repo-stat-text {
  font-size: 12px;
  font-weight: 500;
}

.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 卡片上的 AI 按钮 */
.ai-btn:hover {
  color: var(--accent) !important;
}

/* ===== 详情面板 - 仓库版 ===== */
.repo-detail-preview {
  aspect-ratio: auto;
  height: auto;
  padding: 24px 0;
  flex-direction: column;
  gap: 12px;
  background: transparent;
}

.repo-detail-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.repo-detail-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* AI 快速按钮 */
.ai-quick-row {
  margin-bottom: 20px;
}

.ai-quick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--sun);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.ai-quick-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-glow);
}

.recent-commit {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 12px;
  border-left: 3px solid var(--accent);
}

.commit-hash {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
}

.commit-msg {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.commit-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ===== 统计卡片更新 ===== */
.stat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.stat-icon-photos { background: linear-gradient(135deg, #185A56, #2A7B76); }
.stat-icon-videos { background: linear-gradient(135deg, #0F4240, #1A6B66); }
.stat-icon-audio { background: linear-gradient(135deg, #2A7B76, #185A56); }
.stat-icon-code { background: linear-gradient(135deg, #185A56, #0F4240); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-desc {
  color: var(--text-tertiary);
  font-weight: 400;
  font-size: 12px;
}

/* ===== 排序下拉 ===== */
.sort-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-select {
  padding: 6px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

.sort-select:focus {
  border-color: var(--accent);
}

/* ===== AI 助手面板 ===== */
.ai-panel {
  width: 380px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform var(--transition-normal), width var(--transition-normal);
  position: relative;
  z-index: 6;
  overflow: hidden;
}

.ai-panel.closed {
  width: 0;
  border-left: none;
  transform: translateX(100%);
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, var(--accent-bg), transparent);
}

.ai-logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--sun);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--accent-glow);
  position: relative;
}

.ai-logo-mark::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  border: 2px solid var(--accent);
  opacity: 0.3;
  animation: ai-pulse 2s ease-in-out infinite;
}

@keyframes ai-pulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.1); opacity: 0.1; }
}

.ai-title {
  font-size: 15px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.ai-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ai-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ai-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.ai-quick-actions {
  padding: 20px 20px 0;
}

.ai-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ai-quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  animation: card-enter 0.4s var(--spring) backwards;
}

.ai-quick-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.ai-quick-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-quick-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ai-quick-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ai-messages {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: msg-enter 0.3s ease-out;
}

@keyframes msg-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: var(--sun);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-msg-bubble {
  background: var(--bg-tertiary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.ai-msg.user .ai-msg-bubble {
  background: var(--accent);
  color: white;
}

.ai-msg-bubble.typing {
  display: flex;
  gap: 4px;
  padding: 14px 16px;
  align-items: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.ai-input-wrapper {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border-light);
}

.ai-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 8px 8px 8px 14px;
  border: 1.5px solid transparent;
  transition: all var(--transition-fast);
}

.ai-input-box:focus-within {
  background: var(--bg-secondary);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.ai-input {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  padding: 4px 0;
}

.ai-input::placeholder {
  color: var(--text-tertiary);
}

.ai-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.ai-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

.ai-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ai-input-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 10px;
}

/* ===== 上传弹窗 - 代码版 ===== */
.upload-modal-body {
  max-height: 60vh;
  overflow-y: auto;
}

/* 响应式 - AI面板 */
@media (max-width: 1200px) {
  .ai-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 25;
    box-shadow: var(--shadow-xl);
  }
}

/* ===== 瀑布流视图 ===== */
.waterfall-container {
  columns: 4;
  column-gap: 14px;
}

.waterfall-item {
  break-inside: avoid;
  margin-bottom: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-light);
  animation: card-enter 0.5s var(--spring) backwards;
}

.waterfall-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(24, 90, 86, 0.12);
  border-color: var(--accent);
}

.waterfall-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.waterfall-media {
  position: relative;
  background: var(--bg-tertiary);
  overflow: hidden;
  width: 100%;
}

.waterfall-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.waterfall-item:hover .waterfall-img {
  transform: scale(1.06);
}

.waterfall-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(24, 90, 86, 0.6) 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.waterfall-item:hover .waterfall-overlay {
  opacity: 1;
}

.waterfall-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.waterfall-play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: rgba(24, 90, 86, 0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
  backdrop-filter: blur(4px);
  transition: all var(--transition-normal);
}

.waterfall-item:hover .waterfall-play-badge {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--sun);
  color: var(--accent);
}

.waterfall-star {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sun);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: all var(--transition-normal);
}

.waterfall-item:hover .waterfall-star,
.waterfall-item.type-folder .waterfall-star {
  opacity: 1;
}

.waterfall-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  transition: all var(--transition-fast);
}

.waterfall-item:hover .waterfall-checkbox,
.waterfall-item.selected .waterfall-checkbox {
  opacity: 1;
}

.waterfall-item.selected .waterfall-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.waterfall-fallback {
  height: 160px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.waterfall-info {
  padding: 12px 14px;
}

.waterfall-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.waterfall-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* 瀑布流响应式 */
@media (max-width: 1600px) {
  .waterfall-container { columns: 4; }
}
@media (max-width: 1200px) {
  .waterfall-container { columns: 3; }
}
@media (max-width: 900px) {
  .waterfall-container { columns: 2; }
}
@media (max-width: 600px) {
  .waterfall-container { columns: 1; }
}

/* ===== 卡片上的时长和星标 ===== */
.card-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
}

.card-star {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FDEB55;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: all var(--transition-fast);
}

.file-card:hover .card-star {
  opacity: 1;
}

/* ===== 视图切换三按钮 ===== */
.view-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border-light);
}

.view-toggle-btn {
  width: 32px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
  color: var(--text-primary);
}

.view-toggle-btn.active {
  background: var(--bg-secondary);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ===== 风格配色选择器 ===== */
.style-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 12px;
}

.style-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  background: var(--bg-tertiary);
}

.style-swatch:hover {
  transform: translateY(-2px);
  background: var(--bg-hover);
}

.style-swatch.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.style-swatch-colors {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
}

.swatch-dot-accent {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.style-swatch-split {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.style-swatch-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.style-swatch.active .style-swatch-name {
  color: var(--accent);
  font-weight: 600;
}

/* ===== CloudVault 实用版补充样式 ===== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.btn-danger {
  background: var(--error);
  color: white;
  box-shadow: 0 4px 14px rgba(232, 93, 74, 0.25);
}
.btn-danger:hover { background: #D14A38; }
.file-card-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.waterfall-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}
