/* ============================================
   Timeline — 文件时间轴
   Design: 继承 MdConverted 设计语言
   ============================================ */

/* CSS Variables — 与 MdConverted 完全一致 */
:root {
  --bg: #0d0e10;
  --bg-card: rgba(20, 21, 24, 0.85);
  --bg-hover: rgba(28, 29, 34, 0.85);
  --bg-field: #0a0a0a;
  --border: #25262b;
  --border-soft: rgba(255,255,255,0.05);
  --border-hover: #35363c;
  --text: #e0e0e3;
  --text-muted: #82838b;
  --text-soft: #56575e;
  --accent-gradient: linear-gradient(135deg, rgb(124, 92, 252) 0%, rgb(62, 207, 142) 50%, rgb(255, 107, 74) 100%);
  --accent: rgb(62, 207, 142);
  --accent-green: rgb(62, 207, 142);
  --accent-orange: rgb(255, 107, 74);
  --accent-purple: rgb(124, 92, 252);
  --accent-red: #ef4444;
  --accent-blue: #58a6ff;
  --accent-yellow: #e3b341;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 100px;
  --font-sans: "Inter", "SF Pro Text", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace;
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-card: rgba(255, 255, 255, 0.78);
  --bg-hover: rgba(232, 232, 237, 0.65);
  --bg-field: rgba(245, 245, 247, 0.85);
  --border: #d2d2d7;
  --border-soft: rgba(0,0,0,0.04);
  --border-hover: #c7c7cc;
  --text: #1d1d1f;
  --text-muted: #86868b;
  --text-soft: #aeaeb2;
  --accent: #3b82f6;
  --accent-green: #16a34a;
  --accent-orange: #e36209;
  --accent-purple: #8250df;
  --accent-red: #dc2626;
  --accent-blue: #0969da;
  --accent-yellow: #b08800;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 60% 40% at 25% 15%, rgba(124, 92, 252, 0.06), transparent 70%),
    radial-gradient(ellipse 50% 35% at 75% 55%, rgba(255, 150, 100, 0.05), transparent 65%),
    radial-gradient(ellipse 55% 45% at 45% 75%, rgba(62, 207, 142, 0.04), transparent 70%),
    radial-gradient(ellipse 40% 30% at 70% 20%, rgba(124, 92, 252, 0.04), transparent 60%);
}

[data-theme="light"] .header {
  background: rgba(245, 245, 247, 0.72);
}

[data-theme="light"] .btn-primary {
  background: rgba(29,29,31,0.90);
  color: #fff;
}

[data-theme="light"] .btn-primary:hover { color: #fff; }

[data-theme="light"] .header-btn:hover {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.15);
  color: #16a34a;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Ambient background — 与 MdConverted 一致 */
body::before {
  content: '';
  position: fixed;
  inset: -30%;
  background:
    radial-gradient(ellipse 60% 40% at 30% 20%, rgba(124, 92, 252, 0.12), transparent 70%),
    radial-gradient(ellipse 50% 35% at 70% 60%, rgba(62, 207, 142, 0.08), transparent 65%),
    radial-gradient(ellipse 55% 45% at 50% 80%, rgba(255, 107, 74, 0.07), transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 25%, rgba(124, 92, 252, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
  animation: bgBreathe 8s ease-in-out infinite;
}

@keyframes bgBreathe {
  0%   { opacity: 0.5; }
  50%  { opacity: 0.75; }
  100% { opacity: 0.5; }
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }

/* App Container */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   Header — Glass Morphism (与 MdConverted 一致)
   ============================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10,10,10,0.68);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
}

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

.logo-icon {
  width: 24px;
  height: 24px;
  color: var(--text);
}

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

.header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.header-btn:hover {
  border-color: var(--accent-green);
  background: rgba(62, 207, 142, 0.25);
  color: var(--accent-green);
}

.header-btn svg {
  width: 16px;
  height: 16px;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.04);
}

.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* ============================================
   Main
   ============================================ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 0;
  overflow: hidden;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  overflow-y: auto;
}

.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 48px;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
}

.empty-icon {
  width: 72px;
  height: 72px;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  margin-bottom: 24px;
}

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

.empty-title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--text);
}

.empty-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 20px;
}

#pickBtn {
  margin-bottom: 12px;
}

.subfolder-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  margin-bottom: 20px;
}

.subfolder-check input {
  display: none;
}

.subfolder-check .check-mark {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.subfolder-check input:checked + .check-mark {
  border-color: var(--accent-green);
  border-width: 2px;
}

.subfolder-check input:checked + .check-mark::after {
  content: '';
  width: 5px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.subfolder-check:hover .check-mark {
  border-color: var(--accent-green);
}

/* Header version — compact */
.subfolder-check.header-check {
  font-size: 0.8rem;
  font-weight: 500;
  gap: 6px;
  margin-bottom: 0;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  transition: all var(--transition-normal);
}

.subfolder-check.header-check:hover {
  border-color: var(--accent-green);
  background: rgba(62, 207, 142, 0.25);
  color: var(--accent-green);
}

.subfolder-check.header-check .check-mark {
  width: 16px;
  height: 16px;
}

.folder-input-row {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-bottom: 18px;
}

.folder-input {
  flex: 1;
  padding: 11px 16px;
  background: var(--bg-field);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text);
  transition: border-color var(--transition-fast);
}

.folder-input:focus {
  outline: none;
  border-color: var(--accent);
}

.folder-input::placeholder {
  color: var(--text-soft);
}

.empty-hint {
  font-size: 0.75rem;
  color: var(--text-soft);
}

/* ============================================
   Directory Browser
   ============================================ */
.browser {
  width: 100%;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}

.browser-current {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
}

.browser-path {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sm {
  padding: 7px 16px;
  font-size: 0.78rem;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.browser-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.browser-list::-webkit-scrollbar {
  width: 4px;
}

.browser-list::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 2px;
}

.browser-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

.browser-item:active {
  background: rgba(62, 207, 142, 0.08);
}

.browser-item .browser-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--text-soft);
}

.browser-item .browser-icon.folder {
  color: var(--accent-yellow);
}

.browser-item .browser-icon.drive {
  color: var(--accent-green);
}

.browser-item .browser-name {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-item .browser-arrow {
  margin-left: auto;
  color: var(--text-soft);
  flex-shrink: 0;
}

/* Drive list */
.browser-drives {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.browser-drive-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.browser-drive-item:hover {
  border-color: var(--accent-green);
  background: rgba(62, 207, 142, 0.08);
}

.browser-drive-item .browser-icon {
  color: var(--accent-green);
}

.browser-drive-item .browser-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

/* Browser back button */
.browser-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.browser-back:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.browser-back svg {
  width: 14px;
  height: 14px;
}

/* Manual path input (fallback) */
.manual-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 18px;
}

.manual-input-row .folder-input {
  flex: 1;
  font-size: 0.75rem;
}

.manual-go-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.manual-go-btn:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.manual-go-btn svg {
  width: 16px;
  height: 16px;
}

/* Recent Paths */
.recent-paths {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.recent-paths:empty {
  display: none;
}

.recent-paths-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  text-align: left;
  margin-bottom: 2px;
}

.recent-path-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.recent-path-item:hover {
  border-color: var(--accent-green);
  background: rgba(62, 207, 142, 0.06);
}

.recent-path-item:active {
  transform: scale(0.98);
}

.recent-path-item .path-folder-icon {
  width: 28px;
  height: 28px;
  padding: 5px;
  border-radius: 6px;
  background: rgba(62, 207, 142, 0.1);
  color: var(--accent-green);
  flex-shrink: 0;
}

.recent-path-item .path-folder-icon svg {
  width: 100%;
  height: 100%;
}

.recent-path-item .path-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-path-item .path-delete {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition: all var(--transition-fast);
}

.recent-path-item:hover .path-delete {
  opacity: 1;
}

.recent-path-item .path-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
}

.recent-path-item .path-delete svg {
  width: 12px;
  height: 12px;
}

/* ============================================
   Buttons (与 MdConverted 一致)
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background: rgba(255,255,255,0.90);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #0a0a0a;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.btn-primary:hover {
  transform: translateY(-2px);
  color: #fff;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary span,
.btn-primary svg {
  position: relative;
  z-index: 1;
}

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

/* ============================================
   Timeline View
   ============================================ */
.timeline-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 24px 12px;
  padding: 10px 16px;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.timeline-path {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
}

.timeline-stats {
  font-size: 0.8rem;
  color: var(--text-soft);
  flex-shrink: 0;
}

.timeline-stats strong {
  color: var(--accent-green);
  font-weight: 600;
}

/* ============================================
   Vertical Timeline — line left, grid right
   ============================================ */
.timeline {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 24px 40px 24px;
  position: relative;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.timeline::-webkit-scrollbar {
  width: 5px;
}

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

.timeline::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 3px;
}

/* Timeline inner wrapper — so the line spans full content */
.timeline-inner {
  position: relative;
}

/* Vertical timeline line — spans full content */
.timeline-inner::before {
  content: '';
  position: absolute;
  left: 172px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  z-index: 0;
}

/* ============================================
   Date Group — grid: label | dot+line | files
   ============================================ */
.timeline-group {
  display: grid;
  grid-template-columns: 172px 24px 1fr;
  gap: 0;
  align-items: center;
  margin-bottom: 36px;
  position: relative;
}

.timeline-group:last-child {
  margin-bottom: 0;
}

/* Date label — right-aligned, before the line */
.timeline-date-label {
  grid-column: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0 16px 0 0;
  z-index: 2;
}

.timeline-date-label span {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Dot — centered on the line */
.timeline-dot {
  grid-column: 2;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--accent-green);
  border: 2px solid var(--bg);
  border-radius: 50%;
  z-index: 2;
  flex-shrink: 0;
}

.timeline-group.unknown .timeline-dot {
  background: var(--text-soft);
}

.timeline-group.unknown .timeline-date-label span {
  color: var(--text-muted);
  border-style: dashed;
}

/* ============================================
   File Grid
   ============================================ */
.timeline-files {
  grid-column: 3;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

/* File Node */
.timeline-node {
  animation: nodeIn 0.35s ease backwards;
}

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

/* Remove legacy elements */
.timeline-node.right { flex-direction: row; }
.timeline-connector { display: none; }
.timeline-spacer { display: none; }

/* File Card */
.timeline-card {
  width: 100%;
  height: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 8px;
  backface-visibility: hidden;
}

.timeline-card:hover {
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(62, 207, 142, 0.1);
}

.timeline-card:active {
  transform: scale(0.97);
}

/* File Icon */
.file-icon {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.file-icon.docx  { background: rgba(88, 166, 255, 0.12);   color: var(--accent-blue); }
.file-icon.xlsx  { background: rgba(62, 207, 142, 0.12);   color: var(--accent-green); }
.file-icon.pdf   { background: rgba(239, 68, 68, 0.12);    color: var(--accent-red); }
.file-icon.md    { background: rgba(124, 92, 252, 0.12);   color: var(--accent-purple); }
.file-icon.txt   { background: rgba(130, 131, 139, 0.12);  color: var(--text-muted); }
.file-icon.html  { background: rgba(255, 107, 74, 0.12);   color: var(--accent-orange); }
.file-icon.img   { background: rgba(227, 179, 65, 0.12);   color: var(--accent-yellow); }
.file-icon.ppt   { background: rgba(255, 107, 74, 0.12);   color: var(--accent-orange); }
.file-icon.other { background: rgba(130, 131, 139, 0.08);  color: var(--text-soft); }

/* File Info */
.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.file-info-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.file-ext-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.file-ext-badge.docx  { background: rgba(88, 166, 255, 0.12);   color: var(--accent-blue); }
.file-ext-badge.xlsx  { background: rgba(62, 207, 142, 0.12);   color: var(--accent-green); }
.file-ext-badge.pdf   { background: rgba(239, 68, 68, 0.12);    color: var(--accent-red); }
.file-ext-badge.md    { background: rgba(124, 92, 252, 0.12);   color: var(--accent-purple); }
.file-ext-badge.txt   { background: rgba(130, 131, 139, 0.12);  color: var(--text-muted); }
.file-ext-badge.html  { background: rgba(255, 107, 74, 0.12);   color: var(--accent-orange); }
.file-ext-badge.other { background: rgba(130, 131, 139, 0.08);  color: var(--text-soft); }

.file-time-badge {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 1px 6px;
  background: rgba(124, 92, 252, 0.1);
  color: var(--accent-purple);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.file-size-text {
  font-size: 0.7rem;
  color: var(--text-soft);
  flex-shrink: 0;
}

/* ============================================
   Toast (与 MdConverted 一致)
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1001;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast.leaving {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(16px); }
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent-green); }
.toast.error   .toast-icon { color: var(--accent-red); }
.toast.info    .toast-icon { color: var(--accent); }

.toast-message {
  font-size: 0.88rem;
  color: var(--text);
}

/* ============================================
   Loading
   ============================================ */
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

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

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .main {
    padding: 12px 0 0;
  }

  .empty-state-card {
    padding: 32px 20px;
    margin: 0 12px;
  }

  .timeline {
    padding: 16px 12px 40px 12px;
  }

  .timeline::before {
    left: 84px;
  }

  .timeline-group {
    grid-template-columns: 60px 24px 1fr;
  }

  .timeline-date-label span {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .timeline-files {
    grid-template-columns: 1fr;
  }

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    margin: 0 8px 8px;
  }
}
