/* ===== Desktop System Styles =====
 * Desktop, File Manager, Previewer, Context Menu, Start Menu
 * Phase 3: Minimalist line-art / letterform icon system
 * No Font Awesome — pure CSS/SVG/unicode icons
 */

/* ================================================================
 *  0. SHARED DESIGN TOKENS
 * ================================================================ */

:root {
  /* File type colors */
  --clr-folder: #e8a838;
  --clr-folder-bg: rgba(232, 168, 56, 0.12);
  --clr-link: #4a9eff;
  --clr-link-bg: rgba(74, 158, 255, 0.12);
  --clr-image: #4caf50;
  --clr-image-bg: rgba(76, 175, 80, 0.12);
  --clr-pdf: #e53935;
  --clr-pdf-bg: rgba(229, 57, 53, 0.12);
  --clr-word: #9c27b0;
  --clr-word-bg: rgba(156, 39, 176, 0.12);
  --clr-code: #e91e63;
  --clr-code-bg: rgba(233, 30, 99, 0.12);

  /* Desktop background */
  --dt-bg-start: #eef1f5;
  --dt-bg-end: #dce1e8;
  --dt-bg-glow-1: rgba(74, 144, 217, 0.03);
  --dt-bg-glow-2: rgba(100, 200, 255, 0.02);
}

[data-theme="dark"] {
  --clr-folder: #f0b849;
  --clr-folder-bg: rgba(240, 184, 73, 0.15);
  --clr-link: #5ba0ff;
  --clr-link-bg: rgba(91, 160, 255, 0.15);
  --clr-image: #66bb6a;
  --clr-image-bg: rgba(102, 187, 106, 0.15);
  --clr-pdf: #ef5350;
  --clr-pdf-bg: rgba(239, 83, 80, 0.15);
  --clr-word: #ab47bc;
  --clr-word-bg: rgba(171, 71, 188, 0.15);
  --clr-code: #ec407a;
  --clr-code-bg: rgba(236, 64, 122, 0.15);

  --dt-bg-start: #14161c;
  --dt-bg-end: #1a1d23;
  --dt-bg-glow-1: rgba(74, 144, 217, 0.05);
  --dt-bg-glow-2: rgba(100, 200, 255, 0.03);
}

/* ================================================================
 *  1. DESKTOP (full-screen)
 * ================================================================ */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.dt-desktop {
  position: fixed;
  inset: 0;
  bottom: 42px; /* taskbar height */
  background: linear-gradient(135deg, var(--dt-bg-start) 0%, var(--dt-bg-end) 100%);
  background-image:
    radial-gradient(ellipse at 15% 40%, var(--dt-bg-glow-1) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, var(--dt-bg-glow-2) 0%, transparent 50%);
  padding: 16px;
  overflow-y: auto;
}

/* ================================================================
 *  2. DESKTOP SHORTCUT ICONS (letter-form style)
 * ================================================================ */

.dt-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 84px);
  gap: 8px;
  padding: 8px;
  align-content: start;
}

.dt-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 4px 4px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s;
  width: 84px;
  user-select: none;
}

.dt-shortcut:hover {
  background: rgba(128, 128, 128, 0.06);
}

.dt-shortcut:active {
  background: rgba(128, 128, 128, 0.10);
}

/* Letter-form icon — first letter of item name, large, colored circle bg */
.dt-shortcut-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
  border-radius: 12px;
  color: var(--clr-link);
  background: var(--clr-link-bg);
  position: relative;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  transition: transform 0.15s;
}

.dt-shortcut:hover .dt-shortcut-icon {
  transform: scale(1.05);
}

/* Type-specific icon backgrounds */
.dt-shortcut[data-type="folder"] .dt-shortcut-icon {
  color: var(--clr-folder);
  background: var(--clr-folder-bg);
}
.dt-shortcut[data-type="link"] .dt-shortcut-icon {
  color: var(--clr-link);
  background: var(--clr-link-bg);
}
.dt-shortcut[data-type="image"] .dt-shortcut-icon {
  color: var(--clr-image);
  background: var(--clr-image-bg);
}
.dt-shortcut[data-type="pdf"] .dt-shortcut-icon {
  color: var(--clr-pdf);
  background: var(--clr-pdf-bg);
}
.dt-shortcut[data-type="word"] .dt-shortcut-icon {
  color: var(--clr-word);
  background: var(--clr-word-bg);
}
.dt-shortcut[data-type="code"] .dt-shortcut-icon {
  color: var(--clr-code);
  background: var(--clr-code-bg);
}

/* Unicode/emoji fallback for icons inside shortcuts */
.dt-shortcut-icon .si-char {
  line-height: 1;
}

/* SVG icon inside shortcut icon area */
.dt-shortcut-icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.dt-shortcut-label {
  font-size: 11px;
  color: var(--text-secondary, #b0b3b8);
  line-height: 1.3;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Shortcut delete button (appears on hover) */
.dt-shortcut-delete {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(200, 60, 60, 0.75);
  color: #fff;
  border: none;
  font-size: 10px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  z-index: 2;
}

.dt-shortcut:hover .dt-shortcut-delete {
  display: flex;
}

/* ================================================================
 *  3. CONTEXT MENU (right-click) — frosted glass
 * ================================================================ */

.dt-context-menu {
  position: fixed;
  z-index: 100000;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  padding: 4px 0;
  display: none;
}

[data-theme="dark"] .dt-context-menu {
  background: rgba(34, 37, 45, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.dt-context-menu.dt-visible {
  display: block;
}

.dt-context-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-primary, #333);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

[data-theme="dark"] .dt-context-item {
  color: var(--text-primary, #e4e6eb);
}

.dt-context-item:hover {
  background: var(--accent-color, #4a90d9);
  color: #fff;
}

.dt-context-item .dt-ctx-icon {
  width: 20px;
  margin-right: 10px;
  font-size: 14px;
  text-align: center;
  opacity: 0.7;
}

.dt-context-item:hover .dt-ctx-icon {
  opacity: 1;
}

.dt-context-separator {
  height: 1px;
  background: var(--border-color, #e0e0e0);
  margin: 4px 8px;
}

[data-theme="dark"] .dt-context-separator {
  background: var(--border-color, #363a45);
}

.dt-context-item.dt-disabled {
  opacity: 0.4;
  cursor: default;
}

.dt-context-item.dt-disabled:hover {
  background: none;
  color: var(--text-primary, #333);
}

[data-theme="dark"] .dt-context-item.dt-disabled:hover {
  color: var(--text-primary, #e4e6eb);
}

/* ================================================================
 *  4. START MENU — frosted glass
 * ================================================================ */

.dt-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: var(--wm-taskbar-text, #ddd);
  cursor: pointer;
  transition: background 0.12s;
  flex-shrink: 0;
}

.dt-start-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.dt-start-btn.dt-active {
  background: var(--accent-color, #4a90d9);
  color: #fff;
}

/* Start button — four squares (田字格) */
.dt-start-icon {
  width: 18px;
  height: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
}

.dt-start-icon span {
  display: block;
  background: currentColor;
  border-radius: 1.5px;
}

/* Start menu panel */
.dt-start-menu {
  position: fixed;
  bottom: 48px;
  left: 8px;
  width: 320px;
  max-height: 420px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

[data-theme="dark"] .dt-start-menu {
  background: rgba(30, 32, 38, 0.95);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.dt-start-menu.dt-visible {
  display: flex;
}

.dt-start-header {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #333);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

[data-theme="dark"] .dt-start-header {
  color: var(--text-primary, #e4e6eb);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.dt-start-header .dsh-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--accent-color, #4a90d9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.dt-start-items {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.dt-start-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text-secondary, #666);
  font-size: 13px;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

[data-theme="dark"] .dt-start-item {
  color: var(--text-secondary, #b0b3b8);
}

.dt-start-item:hover {
  background: rgba(128, 128, 128, 0.06);
  color: var(--text-primary, #333);
}

[data-theme="dark"] .dt-start-item:hover {
  color: var(--text-primary, #e4e6eb);
}

.dt-start-item .dt-start-item-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(128, 128, 128, 0.06);
  flex-shrink: 0;
  color: var(--accent-color);
}

.dt-start-item .dt-start-item-label {
  flex: 1;
}

/* ================================================================
 *  5. FILE MANAGER WINDOW
 * ================================================================ */

.dt-filemgr {
  display: flex;
  height: 100%;
  background: var(--wm-bg, #fff);
}

/* ---- File Manager Tree (VS Code style, connector lines) ---- */

.dt-filemgr-tree {
  width: 220px;
  min-width: 180px;
  border-right: 1px solid var(--wm-border, #d0d0d0);
  overflow-y: auto;
  background: var(--wm-titlebar-bg, #f0f0f0);
  padding: 4px 0;
  flex-shrink: 0;
}

/* Tree item with connector lines */
.dt-fm-tree-item {
  display: flex;
  align-items: center;
  padding: 4px 12px 4px 0;
  cursor: pointer;
  font-size: 12px;
  color: var(--wm-text, #666);
  white-space: nowrap;
  transition: background 0.1s;
  position: relative;
}

.dt-fm-tree-item:hover {
  background: rgba(128, 128, 128, 0.06);
}

.dt-fm-tree-item.dt-selected {
  background: rgba(74, 144, 217, 0.10);
  color: var(--wm-title-color, #333);
}

[data-theme="dark"] .dt-fm-tree-item.dt-selected {
  background: rgba(74, 144, 217, 0.20);
}

/* Tree connector lines — VS Code style */
.dt-fm-tree-item::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 50%;
  width: 1px;
  background: var(--wm-border, #d0d0d0);
}

.dt-fm-tree-item::after {
  content: '';
  position: absolute;
  left: 20px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: var(--wm-border, #d0d0d0);
}

/* Hide connector for root-level items (level-1) */
.dt-fm-tree-item.level-1::before,
.dt-fm-tree-item.level-1::after {
  display: none;
}

/* Indentation: each level adds left padding (aligned with connector lines) */
.dt-fm-tree-item.level-1 { padding-left: 8px; }
.dt-fm-tree-item.level-2 { padding-left: 28px; }
.dt-fm-tree-item.level-3 { padding-left: 48px; }
.dt-fm-tree-item.level-4 { padding-left: 68px; }
.dt-fm-tree-item.level-5 { padding-left: 88px; }

/* Hide connector for items at level 2+ when they are NOT first child (handled by .dt-tree-children spacing) */
.dt-fm-tree-item.level-2::before,
.dt-fm-tree-item.level-3::before,
.dt-fm-tree-item.level-4::before,
.dt-fm-tree-item.level-5::before {
  display: none;
}

/* Tree item arrow */
.dt-fm-tree-arrow {
  width: 14px;
  margin-right: 2px;
  font-size: 8px;
  flex-shrink: 0;
  text-align: center;
  transition: transform 0.12s;
  opacity: 0.45;
  color: var(--wm-text, #666);
}

.dt-fm-tree-arrow.dt-expanded {
  transform: rotate(90deg);
}

.dt-fm-tree-arrow.dt-hidden {
  visibility: hidden;
}

/* Tree item icon — CSS-drawn minimal shapes instead of Font Awesome */
.dt-fm-tree-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Folder icon: folded-corner rectangle (CSS) */
.dt-fm-tree-icon .si-folder,
.dt-fm-item-icon .si-folder {
  display: inline-block;
  width: 14px;
  height: 11px;
  border: 1.5px solid var(--clr-folder);
  border-radius: 1px 3px 2px 2px;
  position: relative;
  background: transparent;
}
.dt-fm-tree-icon .si-folder::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 1px;
  width: 6px;
  height: 3px;
  border: 1.5px solid var(--clr-folder);
  border-bottom: none;
  border-radius: 2px 2px 0 0;
}

/* Link icon: arrow ↗ */
.dt-fm-tree-icon .si-link,
.dt-fm-item-icon .si-link {
  display: inline-block;
  width: 14px;
  height: 14px;
  position: relative;
}
.dt-fm-tree-icon .si-link::before,
.dt-fm-item-icon .si-link::before {
  content: '→';
  font-size: 12px;
  font-weight: 600;
  color: var(--clr-link);
  line-height: 1;
}

/* Image icon: landscape rectangle */
.dt-fm-tree-icon .si-image,
.dt-fm-item-icon .si-image {
  display: inline-block;
  width: 14px;
  height: 11px;
  border: 1.5px solid var(--clr-image);
  border-radius: 2px;
  position: relative;
}
.dt-fm-tree-icon .si-image::before,
.dt-fm-item-icon .si-image::before {
  content: '';
  position: absolute;
  bottom: 1.5px;
  left: 1.5px;
  width: 4px;
  height: 3px;
  background: var(--clr-image);
  clip-path: polygon(0 100%, 100% 100%, 50% 0);
  opacity: 0.5;
}

/* PDF icon: rect with text */
.dt-fm-tree-icon .si-pdf,
.dt-fm-item-icon .si-pdf {
  display: inline-block;
  width: 12px;
  height: 14px;
  border: 1.5px solid var(--clr-pdf);
  border-radius: 1px 3px 2px 2px;
  position: relative;
}
.dt-fm-tree-icon .si-pdf::before,
.dt-fm-item-icon .si-pdf::before {
  content: 'PDF';
  position: absolute;
  font-size: 5px;
  font-weight: 700;
  color: var(--clr-pdf);
  top: 2px;
  left: 1px;
  line-height: 1;
  letter-spacing: 0.5px;
}

/* Word icon: W */
.dt-fm-tree-icon .si-word,
.dt-fm-item-icon .si-word {
  display: inline-block;
  width: 12px;
  height: 14px;
  border: 1.5px solid var(--clr-word);
  border-radius: 1px 3px 2px 2px;
  position: relative;
}
.dt-fm-tree-icon .si-word::before,
.dt-fm-item-icon .si-word::before {
  content: 'W';
  position: absolute;
  font-size: 9px;
  font-weight: 700;
  color: var(--clr-word);
  top: 1px;
  left: 2px;
  line-height: 1;
}

/* Code icon: </> brackets */
.dt-fm-tree-icon .si-code,
.dt-fm-item-icon .si-code {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--clr-code);
  line-height: 1;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
}

/* File fallback icon: small square */
.dt-fm-tree-icon .si-file,
.dt-fm-item-icon .si-file {
  display: inline-block;
  width: 12px;
  height: 14px;
  border: 1.5px solid var(--wm-text, #999);
  border-radius: 1px 3px 2px 2px;
}

/* ---- File Manager Content Area ---- */

.dt-filemgr-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dt-filemgr-toolbar {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  border-bottom: 1px solid var(--wm-border, #d0d0d0);
  background: var(--wm-titlebar-bg, #f0f0f0);
  gap: 6px;
  flex-shrink: 0;
  min-height: 34px;
}

.dt-filemgr-toolbar .dt-fm-path {
  flex: 1;
  font-size: 12px;
  color: var(--wm-text, #666);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 8px;
  background: var(--wm-bg, #fff);
  border-radius: 4px;
  border: 1px solid var(--wm-border, #d0d0d0);
}

.dt-filemgr-toolbar .dt-fm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--wm-text, #666);
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  transition: background 0.12s;
}

.dt-filemgr-toolbar .dt-fm-btn:hover {
  background: var(--wm-border, #d0d0d0);
}

/* ---- File List View ---- */

.dt-filemgr-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.dt-fm-list-header {
  display: flex;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--wm-text, #666);
  border-bottom: 1px solid var(--wm-border, #d0d0d0);
  background: var(--wm-titlebar-bg, #f0f0f0);
  position: sticky;
  top: 0;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dt-fm-list-col-icon { width: 32px; flex-shrink: 0; }
.dt-fm-list-col-name { flex: 1; }
.dt-fm-list-col-type { width: 80px; flex-shrink: 0; }
.dt-fm-list-col-size { width: 80px; flex-shrink: 0; text-align: right; }
.dt-fm-list-col-date { width: 140px; flex-shrink: 0; text-align: right; }

.dt-fm-list-item {
  display: flex;
  align-items: center;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.06s;
  font-size: 13px;
  border-bottom: 1px solid transparent;
}

.dt-fm-list-item:not(:last-child) {
  border-bottom-color: var(--wm-border, #e8e8e8);
}

[data-theme="dark"] .dt-fm-list-item:not(:last-child) {
  border-bottom-color: rgba(255,255,255,0.03);
}

.dt-fm-list-item:hover {
  background: rgba(128, 128, 128, 0.03);
}

.dt-fm-list-item.dt-selected {
  background: rgba(74, 144, 217, 0.08);
}

/* File manager item icon area */
.dt-fm-list-item .dt-fm-item-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
}

/* Type-specific coloring for file manager icons */
.dt-fm-list-item[data-type="folder"] .dt-fm-item-icon {
  color: var(--clr-folder);
}
.dt-fm-list-item[data-type="link"] .dt-fm-item-icon {
  color: var(--clr-link);
}
.dt-fm-list-item[data-type="image"] .dt-fm-item-icon {
  color: var(--clr-image);
}
.dt-fm-list-item[data-type="pdf"] .dt-fm-item-icon {
  color: var(--clr-pdf);
}
.dt-fm-list-item[data-type="word"] .dt-fm-item-icon {
  color: var(--clr-word);
}
.dt-fm-list-item[data-type="code"] .dt-fm-item-icon {
  color: var(--clr-code);
}

/* Type label colored dot */
.dt-fm-list-item[data-type="folder"] .dt-fm-item-type { color: var(--clr-folder); }
.dt-fm-list-item[data-type="link"] .dt-fm-item-type { color: var(--clr-link); }
.dt-fm-list-item[data-type="image"] .dt-fm-item-type { color: var(--clr-image); }
.dt-fm-list-item[data-type="pdf"] .dt-fm-item-type { color: var(--clr-pdf); }
.dt-fm-list-item[data-type="word"] .dt-fm-item-type { color: var(--clr-word); }
.dt-fm-list-item[data-type="code"] .dt-fm-item-type { color: var(--clr-code); }

.dt-fm-list-item .dt-fm-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--wm-title-color, #333);
}

.dt-fm-list-item .dt-fm-item-type,
.dt-fm-list-item .dt-fm-item-size,
.dt-fm-list-item .dt-fm-item-date {
  color: var(--wm-text, #666);
  font-size: 12px;
}

.dt-fm-list-item .dt-fm-item-type { width: 80px; flex-shrink: 0; }
.dt-fm-list-item .dt-fm-item-size { width: 80px; flex-shrink: 0; text-align: right; }
.dt-fm-list-item .dt-fm-item-date { width: 140px; flex-shrink: 0; text-align: right; }

.dt-fm-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--wm-muted, #999);
  font-size: 14px;
}

/* Tree children container (collapsible) */
.dt-tree-children {
  overflow: hidden;
}

.dt-tree-children.dt-collapsed {
  max-height: 0 !important;
}

/* ================================================================
 *  6. FILE PREVIEWERS (inside virtual windows)
 * ================================================================ */

/* --- Image Previewer --- */
.dt-preview-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.03);
}

[data-theme="dark"] .dt-preview-image {
  background: rgba(0,0,0,0.15);
}

.dt-preview-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
}

/* --- PDF Previewer --- */
.dt-preview-pdf {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dt-preview-pdf embed,
.dt-preview-pdf iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.dt-preview-pdf .dt-pdf-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--wm-text, #666);
  padding: 30px;
  text-align: center;
}

.dt-preview-pdf .dt-pdf-fallback .dt-preview-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dt-preview-pdf .dt-pdf-fallback .dt-preview-icon svg {
  width: 48px;
  height: 48px;
}

.dt-preview-pdf .dt-pdf-fallback a {
  margin-top: 12px;
  padding: 8px 24px;
  background: var(--accent-color, #4a90d9);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
}

/* --- Word Previewer --- */
.dt-preview-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 30px;
  text-align: center;
  color: var(--wm-text, #666);
}

.dt-preview-word .dt-preview-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  opacity: 0.25;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--clr-word);
}

.dt-preview-word h3 {
  margin: 0 0 8px;
  color: var(--wm-title-color, #333);
  font-size: 18px;
}

.dt-preview-word p {
  font-size: 14px;
  margin: 0 0 16px;
  max-width: 360px;
  line-height: 1.5;
}

.dt-preview-word .dt-word-actions {
  display: flex;
  gap: 10px;
}

.dt-preview-word .dt-word-btn {
  padding: 9px 22px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.dt-preview-word .dt-word-btn-primary {
  background: var(--accent-color, #4a90d9);
  color: #fff;
}

.dt-preview-word .dt-word-btn-primary:hover {
  background: var(--accent-hover, #357abd);
}

.dt-preview-word .dt-word-btn-secondary {
  background: var(--wm-border, #d0d0d0);
  color: var(--wm-title-color, #333);
}

.dt-preview-word .dt-word-btn-secondary:hover {
  background: var(--wm-text, #aaa);
}

/* --- Code Previewer --- */
.dt-preview-code {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #1e1e2e;
}

.dt-preview-code pre {
  margin: 0;
  padding: 16px 20px;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #cdd6f4;
  overflow: visible;
  tab-size: 2;
}

.dt-preview-code .dt-code-header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: #181825;
  border-bottom: 1px solid #313244;
  font-size: 12px;
  color: #a6adc8;
  gap: 8px;
}

.dt-preview-code .dt-code-lines {
  counter-reset: line;
}

.dt-preview-code .dt-code-line {
  display: flex;
  counter-increment: line;
  padding: 0 16px;
  min-height: 21px;
}

.dt-preview-code .dt-code-line::before {
  content: counter(line);
  width: 40px;
  text-align: right;
  padding-right: 16px;
  color: #585b70;
  user-select: none;
  flex-shrink: 0;
}

.dt-preview-code .dt-code-line:hover {
  background: rgba(255,255,255,0.02);
}

/* Basic syntax highlighting */
.dt-preview-code .kw { color: #cba6f7; }
.dt-preview-code .str { color: #a6e3a1; }
.dt-preview-code .cm { color: #6c7086; }
.dt-preview-code .fn { color: #89b4fa; }
.dt-preview-code .num { color: #fab387; }
.dt-preview-code .tag { color: #f38ba8; }
.dt-preview-code .attr { color: #89dceb; }
.dt-preview-code .sel { color: #f5c2e7; }
.dt-preview-code .prop { color: #94e2d5; }
.dt-preview-code .val { color: #f9e2af; }

/* ================================================================
 *  7. THEME ADAPTATIONS (light theme overrides)
 * ================================================================ */

:root .dt-context-menu {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.08);
}

:root .dt-context-item {
  color: #333;
}

:root .dt-context-item:hover {
  color: #fff;
}

:root .dt-context-separator {
  background: #e8e8e8;
}

:root .dt-disabled:hover {
  color: #333;
}

:root .dt-start-menu {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

:root .dt-start-header {
  color: #333;
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

:root .dt-start-item {
  color: #555;
}

:root .dt-start-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #333;
}

:root .dt-start-item .dt-start-item-icon {
  background: rgba(0, 0, 0, 0.04);
}

:root .dt-start-btn {
  color: #555;
  background: rgba(0, 0, 0, 0.04);
}

:root .dt-start-btn:hover {
  background: rgba(0, 0, 0, 0.10);
}

/* Desktop light theme background */
:root .dt-desktop {
  background: linear-gradient(135deg, #eef1f5 0%, #dce1e8 100%);
  background-image:
    radial-gradient(ellipse at 15% 40%, rgba(74, 144, 217, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(100, 200, 255, 0.02) 0%, transparent 50%);
}

:root .dt-shortcut-icon {
  color: var(--clr-link);
  background: var(--clr-link-bg);
}

:root .dt-shortcut:hover {
  background: rgba(0, 0, 0, 0.04);
}

:root .dt-shortcut[data-type="folder"] .dt-shortcut-icon {
  color: var(--clr-folder);
  background: var(--clr-folder-bg);
}

:root .dt-shortcut-label {
  color: #666;
}

/* ================================================================
 *  8. TASKBAR ENHANCEMENTS — frosted glass refinements
 * ================================================================ */

.wm-taskbar .dt-taskbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  flex-shrink: 0;
}

.wm-taskbar .dt-taskbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
}

.wm-taskbar .dt-taskbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Taskbar clock */
.dt-taskbar-clock {
  font-size: 12px;
  color: var(--wm-taskbar-text, #ddd);
  padding: 0 8px;
  white-space: nowrap;
  cursor: default;
  opacity: 0.85;
}

/* ================================================================
 *  9. RESPONSIVE
 * ================================================================ */

@media (max-width: 768px) {
  .dt-desktop {
    padding: 8px;
  }

  .dt-shortcuts-grid {
    grid-template-columns: repeat(auto-fill, 72px);
    gap: 6px;
  }

  .dt-shortcut {
    width: 72px;
    padding: 6px 4px 4px;
  }

  .dt-shortcut-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 10px;
  }

  .dt-shortcut-icon svg {
    width: 22px;
    height: 22px;
  }

  .dt-shortcut-label {
    font-size: 10px;
    max-width: 68px;
  }

  .dt-filemgr-tree {
    width: 160px;
    min-width: 120px;
  }

  .dt-fm-list-col-date {
    display: none;
  }

  .dt-fm-list-item .dt-fm-item-date {
    display: none;
  }

  .dt-start-menu {
    width: 280px;
    left: 4px;
    max-height: 360px;
  }

  .dt-context-menu {
    min-width: 150px;
  }
}
