/* ============================================================
   GcpFileUploader — 主样式表
   设计：暗黑模式 + 玻璃拟态 + 流光渐变
   ============================================================ */

/* ── 设计令牌 ─────────────────────────────────────── */
:root {
  --bg-base:      #0a0b14;
  --bg-card:      rgba(255, 255, 255, 0.045);
  --bg-card-hover:rgba(255, 255, 255, 0.075);
  --border:       rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.6);

  --text-primary: #f1f2ff;
  --text-secondary: #9094b8;
  --text-muted:   #555a7a;
  --text-code:    #a5b4fc;

  --accent:       #6366f1;
  --accent-light: #818cf8;
  --accent-glow:  rgba(99, 102, 241, 0.35);
  --purple:       #8b5cf6;
  --purple-glow:  rgba(139, 92, 246, 0.3);

  --success:      #34d399;
  --success-bg:   rgba(52, 211, 153, 0.1);
  --error:        #f87171;
  --error-bg:     rgba(248, 113, 113, 0.1);
  --warning:      #fbbf24;

  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    28px;

  --shadow-card:  0 4px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow:  0 0 48px rgba(99, 102, 241, 0.18);

  --transition:   0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.45s cubic-bezier(0.4, 0, 0.2, 1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── 重置 & 基础 ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── 背景光晕 ─────────────────────────────────────── */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: floatGlow 8s ease-in-out infinite alternate;
}
.glow-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(99,102,241,0.4), transparent 70%);
  top: -180px; left: -120px;
  animation-delay: 0s;
}
.glow-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.35), transparent 70%);
  bottom: -100px; right: -80px;
  animation-delay: -3s;
}
.glow-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(99,102,241,0.2), transparent 70%);
  top: 50%; left: 55%;
  animation-delay: -5s;
}
@keyframes floatGlow {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}

/* ── 容器布局 ─────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 84px 24px 80px; /* Increased top padding to avoid overlap with sticky navbar */
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── 导航栏 Nav Bar ────────────────────────────────── */
.nav-bar {
  position: sticky;
  top: 24px;
  left: 0;
  width: 100%;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none; /* Let clicks pass through empty areas */
}

.nav-container {
  pointer-events: auto; /* Enable clicks inside the pill */
  display: flex;
  align-items: center;
  gap: 24px;
  background: rgba(18, 20, 32, 0.7);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-link {
  white-space: nowrap;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 24px;
  border-radius: 999px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 8px;
}

/* 导航栏状态徽章 (简化为一个小点) */
.status-badge {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  cursor: help;
  margin-left: 8px;
}

/* 隐藏文本 */
.status-text {
  display: none;
}

/* 登录状态展示区域 */
.auth-section {
  display: flex;
  align-items: center;
  min-height: 32px;
}

.user-info {
  display: grid;
  grid-template-areas: 
    "avatar logout"
    "name logout";
  align-items: center;
  gap: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.user-avatar {
  grid-area: avatar;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.1);
  justify-self: center;
}

.user-name {
  grid-area: name;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  max-width: 60px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.btn-logout {
  grid-area: logout;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-logout:hover {
  color: var(--error);
  background: var(--error-bg);
}

/* 覆盖原有的 status-badge 类影响（防止和旧代码冲突） */
.status-dot {
  width: 8px; 
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}
.status-badge.online .status-dot { background: var(--success); box-shadow: 0 0 8px var(--success); animation: pulse 2s infinite; }
.status-badge.offline .status-dot { background: var(--error); box-shadow: 0 0 8px var(--error); }

/* ── 顶部 Header ──────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-icon {
  width: 48px; height: 48px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px var(--accent-glow));
}
.logo-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #e0e7ff, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
}
.logo-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  margin-top: 2px;
}

/* 服务状态徽章 */
.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  font-size: 0.78rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: var(--transition);
}
.status-badge.online .status-dot  { background: var(--success); box-shadow: 0 0 8px var(--success); animation: pulse 2s infinite; }
.status-badge.online .status-text { color: var(--success); }
.status-badge.offline .status-dot { background: var(--error); }
.status-badge.offline .status-text{ color: var(--error); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── 拖拽上传区 ───────────────────────────────────── */
.upload-section { width: 100%; }

.drop-zone {
  position: relative;
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  padding: 64px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(255,255,255,0.04);
  outline: none;
}
.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: rgba(99, 102, 241, 0.65);
  background: rgba(99, 102, 241, 0.06);
  box-shadow: var(--shadow-card), var(--shadow-glow), inset 0 0 0 1px rgba(255,255,255,0.06);
  transform: translateY(-2px);
}
.drop-zone.dragging {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(99, 102, 241, 0.12);
  box-shadow: var(--shadow-card), 0 0 64px rgba(99, 102, 241, 0.28);
  transform: translateY(-4px) scale(1.01);
}
.drop-zone.dragging .drop-icon {
  animation: bounceUp 0.6s ease infinite alternate;
}
@keyframes bounceUp {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

.drop-zone-inner {
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.drop-icon-wrap {
  margin-bottom: 8px;
}
.drop-icon {
  width: 80px; height: 80px;
  transition: var(--transition);
}
.drop-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}
.drop-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.drop-link {
  color: var(--accent-light);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(129, 140, 248, 0.4);
  cursor: pointer;
}
.drop-hint {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.drop-hint code {
  color: var(--text-code);
  background: rgba(99,102,241,0.12);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
}

/* ── 文件队列 ─────────────────────────────────────── */
.queue-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  animation: slideDown var(--transition-slow) both;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.queue-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.queue-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px; height: 22px;
  padding: 0 7px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 99px;
}
.queue-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── 文件列表项 ───────────────────────────────────── */
.file-list {
  list-style: none;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.3) transparent;
}
.file-list::-webkit-scrollbar { width: 5px; }
.file-list::-webkit-scrollbar-track { background: transparent; }
.file-list::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 4px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  animation: fadeInItem 0.2s both;
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--bg-card-hover); }
.file-item.uploading { pointer-events: none; }
.file-item.done .file-name { opacity: 0.7; }

@keyframes fadeInItem {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* 文件类型图标 */
.file-icon-wrap {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: rgba(255,255,255,0.05);
}

/* 文件信息 */
.file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.file-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.file-status {
  font-size: 0.75rem;
  font-weight: 500;
}
.file-status.success { color: var(--success); }
.file-status.error   { color: var(--error); }
.file-status.uploading { color: var(--accent-light); }

/* 进度条 */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}
.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 99px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -150%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  100% { left: 150%; }
}
.progress-label {
  font-size: 0.7rem;
  color: var(--accent-light);
  min-width: 32px;
  text-align: right;
}

/* 移除按钮 */
.file-remove-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-remove-btn:hover {
  color: var(--error);
  background: var(--error-bg);
}

/* ── 按钮 ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
}
.btn:focus-visible { box-shadow: 0 0 0 3px var(--border-focus); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(99,102,241,0.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.14);
}

.btn-sm { padding: 6px 13px; font-size: 0.8rem; }

/* ── 汇总结果卡片 ─────────────────────────────────── */
.summary-section {
  animation: slideDown var(--transition-slow) both;
}
.summary-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}
.summary-icon-wrap {
  font-size: 2rem;
  flex-shrink: 0;
}
.summary-text { flex: 1; min-width: 0; }
.summary-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.summary-detail {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* 汇总卡片状态 */
.summary-card.all-success {
  border-color: rgba(52, 211, 153, 0.3);
  background: linear-gradient(135deg, rgba(52,211,153,0.07), rgba(6,78,59,0.1));
}
.summary-card.has-error {
  border-color: rgba(248, 113, 113, 0.3);
  background: linear-gradient(135deg, rgba(248,113,113,0.07), rgba(127,29,29,0.1));
}

/* ── 快速文本上传区 ─────────────────────────────────── */
.text-upload-section {
  width: 100%;
}
.text-card-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: var(--transition);
}
.text-card-wrap:focus-within {
  border-color: var(--border-focus);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.02);
}
.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-icon { font-size: 1.1rem; }
.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-top: 1px solid var(--border);
  animation: slideDown 0.3s ease both;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.input-group label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding-left: 2px;
}
.input-group input,
.input-group textarea {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.input-group input:focus,
.input-group textarea:focus {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.input-group textarea {
  resize: vertical;
  min-height: 100px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 16px;
}
.text-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── 隐藏工具 ─────────────────────────────────────── */
[hidden] { display: none !important; }

/* ── 响应式 ───────────────────────────────────────── */
@media (max-width: 700px) {
  /* 导航栏移动端优化 */
  .nav-bar { top: 8px; }
  .nav-container { 
    padding: 3px 6px; 
    gap: 2px; 
    border-radius: 20px; 
  }
  .nav-link { 
    padding: 4px 6px; 
    font-size: 0.65rem; 
  }
  .nav-link svg { 
    display: none; /* 在手机上隐藏图标，只显示文字以节约空间 */
  }
  .nav-right { gap: 2px; padding-right: 0; }
  .auth-section { min-height: 24px; }
  .user-info { 
    padding: 2px 6px; 
    gap: 2px 4px;
    grid-template-areas: 
      "name logout";
  }
  .user-avatar { display: none; } /* 移动端隐藏头像 */
  .user-name { max-width: 50px; font-size: 0.6rem; }
  
  .container { padding: 64px 12px 60px; } /* Increased top padding on mobile */
  .drop-zone { padding: 32px 16px; }
  .drop-title { font-size: 1.05rem; }
  .queue-header { flex-direction: column; align-items: flex-start; }
  .summary-card { flex-direction: column; text-align: center; }
}



/* ── 筛选工具栏 (Phse 14 Toolbar) ───────────────────────── */
.filter-toolbar {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.main-filter {
    flex-wrap: wrap;
}

.search-bar {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    transition: var(--transition);
}
.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.search-bar svg {
    color: var(--text-muted);
}
.search-bar input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px 10px;
    font-size: 0.85rem;
    outline: none;
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.date-controls input[type="date"] {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 0;
    width: 95px; /* 固定宽度减少抖动 */
    outline: none;
    cursor: pointer;
}

/* 移除/美化 Webkit 默认日历图标 */
.date-controls input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(1) brightness(1.5); /* 变成白色且更亮 */
    margin-left: 2px;
    padding: 2px;
}

.date-controls .sep {
    color: var(--text-muted);
    font-size: 0.7rem;
    opacity: 0.5;
}

.btn-refresh {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
}
.btn-refresh:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.shortcuts {
    gap: 8px;
    flex-wrap: wrap;
}
.shortcut-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.btn-shortcut {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-shortcut:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-light);
    border-color: var(--accent-light);
}
.btn-shortcut.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}


@media (max-width: 768px) {
    .filter-toolbar { padding: 8px; }
    .main-filter { flex-direction: column; align-items: stretch; }
    .date-controls { justify-content: space-between; }
    .search-bar { min-width: 0; }
}

/* ── 文件列表 (极简 List) ───────────────────────── */
.file-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
    cursor: pointer;
}

.file-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.file-card-main {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 12px;
}

.file-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    color: var(--accent-light);
}

.file-info-primary {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.file-display-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1; /* Allow to shrink to view space */
    min-width: 0; /* Important for ellipsis to work inside flex */
}

.file-owner-pill {
    font-size: 0.6rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 0px 6px;
    border-radius: 4px;
    opacity: 0.7;
}

.file-meta-pill {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    margin-left: auto;
    padding-right: 15px;
}

.btn-preview {
    font-size: 0.75rem;
    color: var(--accent-light);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}
.btn-preview:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
}

/* 详情展开区 */
.file-card-details {
    max-height: 0;
    opacity: 0;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.1);
    padding: 0 12px 0 52px;
    overflow: hidden;
}

.file-card.expanded .file-card-details {
    max-height: 800px;
    opacity: 1;
    padding: 8px 12px 14px 52px;
}

.detail-section {
    margin-bottom: 12px;
}

.detail-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent-light);
    opacity: 0.6;
    text-transform: uppercase;
}

.inline-edit-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    min-height: 1.25em; /* 确保空值也有高度 */
    cursor: text;
    transition: var(--transition);
}
.inline-edit-desc:hover {
    color: #fff;
}
.inline-edit-desc:empty::before {
    content: "点击添加描述...";
    opacity: 0.3;
    font-style: italic;
}.tag-input-inline {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent);
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 3px;
    width: 60px;
    outline: none;
}


.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.65rem;
    padding: 1px 2px 1px 6px;
    border-radius: 4px;
    gap: 4px;
    transition: var(--transition);
}

.tag-text {
    cursor: text;
}
.tag-text:hover {
    color: var(--accent-light);
}

.btn-tag-remove {
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.4;
    font-size: 0.8rem;
    line-height: 1;
    border-radius: 2px;
}
.btn-tag-remove:hover {
    opacity: 1;
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.btn-add-tag-inline {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 3px;
    cursor: pointer;
}

.inline-input-compact {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent);
    color: #fff;
    font-size: 0.8rem;
    padding: 1px 4px;
    border-radius: 3px;
    outline: none;
}

.btn-add-tag-inline {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 3px;
    cursor: pointer;
}

.inline-input-compact {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent);
    color: #fff;
    font-size: 0.8rem;
    padding: 1px 4px;
    border-radius: 3px;
    outline: none;
}

/* 微型状态点 (用于文件列表已记账标记) */
.status-dot-tiny {
    width: 5px;
    height: 5px;
    background-color: var(--success);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px var(--success);
    margin-right: 4px;
}

/* ── 弹窗 Modal (通用组件) ───────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #121420;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    padding: 32px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
    background: linear-gradient(120deg, #e0e7ff, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .file-meta-pill { display: none; }
    .file-display-name { max-width: 150px; }
}
