* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --menubar-h: 26px;
  --font: -apple-system, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --accent: #0a84ff;
}
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-size: 13px;
  color: #1d1d1f;
  user-select: none;
  background:
    radial-gradient(120% 90% at 20% 0%, #6a4bc0 0%, transparent 55%),
    radial-gradient(120% 90% at 90% 20%, #d0518a 0%, transparent 50%),
    linear-gradient(160deg, #2b2361 0%, #6d3a8f 45%, #c65b8a 75%, #f0a463 100%);
}

/* ---- Menu bar ---- */
#menubar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--menubar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; z-index: 10000;
  background: rgba(255,255,255,0.22);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: #fff; font-size: 13px;
  box-shadow: 0 0.5px 0 rgba(255,255,255,0.15) inset;
}
.mb-left, .mb-right { display: flex; align-items: center; gap: 2px; }
.mb-item { padding: 2px 9px; border-radius: 5px; cursor: default; line-height: 1; }
.mb-item:hover { background: rgba(255,255,255,0.25); }
.mb-app { font-weight: 600; }
.mb-apple { display: inline-flex; align-items: center; padding: 2px 4px; }
.paw-icon { width: 16px; height: 16px; display: block; }
.mb-icon { font-size: 14px; display: inline-flex; align-items: center; padding: 3px 7px; }
#clock { font-variant-numeric: tabular-nums; }

/* ---- Desktop ---- */
#desktop { position: fixed; inset: var(--menubar-h) 0 0 0; }
#desktop-icons {
  position: absolute; top: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.desk-icon { width: 74px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: default; padding: 4px; border-radius: 6px; }
.desk-icon:hover { background: rgba(255,255,255,0.12); }
.desk-icon .glyph { font-size: 46px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35)); }
.desk-icon .glyph img { display: block; width: 60px; height: auto; }
.desk-icon .label {
  color: #fff; font-size: 12px; text-align: center; max-width: 74px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 5px; border-radius: 3px;
}

/* ---- Finder window ---- */
.window {
  position: absolute; width: 720px; height: 460px;
  min-width: 420px; min-height: 260px;
  background: #ecebeb; border-radius: 11px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 22px 60px rgba(0,0,0,0.4), 0 0 0 0.5px rgba(0,0,0,0.25);
}
.window.inactive { box-shadow: 0 14px 40px rgba(0,0,0,0.3), 0 0 0 0.5px rgba(0,0,0,0.2); }
.resize-grip { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; z-index: 20; }
.titlebar {
  height: 52px; display: flex; align-items: center; flex-shrink: 0;
  background: rgba(246,246,246,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid rgba(0,0,0,0.12);
}
.traffic { display: flex; gap: 8px; padding: 0 12px 0 14px; }
.light { width: 12px; height: 12px; border-radius: 50%; position: relative; }
.light.close { background: #ff5f57; }
.light.min { background: #febc2e; }
.light.zoom { background: #28c840; }
.traffic:hover .light::before {
  content: ""; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: 9px; color: rgba(0,0,0,0.5);
}
.title-crumb { font-weight: 600; font-size: 13px; margin-left: 6px; }
.titlebar.thin { height: 22px; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: none; }
.toolbar { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-right: 14px; color: #7d7d7d; }
.tb-btn { cursor: default; font-size: 15px; padding: 3px 6px; border-radius: 5px; }
.tb-btn:hover { background: rgba(0,0,0,0.06); }
.tb-btn.disabled { opacity: 0.32; pointer-events: none; }
.tb-btn.on { color: var(--accent); }

.body { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 176px; flex-shrink: 0; padding: 10px 8px; overflow-y: auto;
  background: rgba(232,232,232,0.72);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-right: 0.5px solid rgba(0,0,0,0.1);
}
.sb-head { font-size: 11px; font-weight: 600; color: #8a8a8a; padding: 8px 8px 3px; }
.sb-item { display: flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 6px; color: #333; cursor: default; }
.sb-item:hover { background: rgba(0,0,0,0.05); }
.sb-item.active { background: rgba(0,0,0,0.09); }
.sb-item .g { font-size: 15px; width: 18px; text-align: center; }

.pane { flex: 1; overflow-y: auto; background: #fff; position: relative; }

/* icon view */
.grid { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 14px; }
.item { width: 92px; padding: 8px 4px; border-radius: 7px; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: default; }
.item:hover { background: rgba(0,0,0,0.04); }
.item.selected { background: rgba(10,132,255,0.16); }
.item .glyph { font-size: 44px; line-height: 1; }
.item .thumb { width: 52px; height: 44px; object-fit: cover; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.item .name { font-size: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 88px; padding: 1px 6px; border-radius: 3px; }
.item.selected .name { background: var(--accent); color: #fff; }

/* list view */
.list { width: 100%; border-collapse: collapse; font-size: 13px; }
.list th { text-align: left; font-weight: 500; color: #888; font-size: 11px; padding: 5px 10px; border-bottom: 0.5px solid #e2e2e2; position: sticky; top: 0; background: #fff; }
.list td { padding: 4px 10px; border-bottom: 0.5px solid #f2f2f2; color: #333; }
.list tr.row { cursor: default; }
.list tr.row:hover td { background: rgba(0,0,0,0.03); }
.list tr.row.selected td { background: rgba(10,132,255,0.16); }
.list .nm { display: flex; align-items: center; gap: 8px; }
.list .nm .g { font-size: 17px; }
.list .nm .g-thumb { width: 20px; height: 20px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.list td.right { text-align: right; color: #999; font-variant-numeric: tabular-nums; }

.statusbar { height: 24px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #888; border-top: 0.5px solid rgba(0,0,0,0.08); background: rgba(240,240,240,0.7); }

/* preview / quicklook */
.preview-body { flex: 1; overflow: auto; background: #fff; }
.preview-body img { display: block; max-width: 100%; margin: 0 auto; }
.preview-body pre { margin: 0; padding: 18px 20px; font: 12.5px/1.55 "SF Mono", ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; color: #1d1d1f; }
.preview-body .html-render { padding: 18px 22px; }
.md-render { padding: 22px 26px; color: #1d1d1f; line-height: 1.6; font-size: 14px; max-width: 760px; margin: 0 auto; }
.md-render h1, .md-render h2, .md-render h3, .md-render h4 { line-height: 1.25; margin: 1.2em 0 0.5em; }
.md-render h1 { font-size: 1.9em; border-bottom: 1px solid #e2e2e2; padding-bottom: 0.25em; }
.md-render h2 { font-size: 1.5em; border-bottom: 1px solid #ececec; padding-bottom: 0.2em; }
.md-render h3 { font-size: 1.25em; }
.md-render p { margin: 0.7em 0; }
.md-render ul, .md-render ol { margin: 0.6em 0; padding-left: 1.6em; }
.md-render li { margin: 0.2em 0; }
.md-render li.task { list-style: none; margin-left: -1.2em; }
.md-render li.task input { margin-right: 6px; }
.md-render a { color: var(--accent); text-decoration: none; }
.md-render a:hover { text-decoration: underline; }
.md-render code { background: rgba(0,0,0,0.06); padding: 0.15em 0.4em; border-radius: 4px; font: 0.88em "SF Mono", ui-monospace, Menlo, monospace; }
.md-render pre.md-code { background: #f6f7f8; border: 1px solid #e6e6e6; border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
.md-render pre.md-code code { background: none; padding: 0; }
.md-render blockquote { margin: 0.7em 0; padding: 2px 14px; border-left: 3px solid #d0d0d0; color: #666; }
.md-render hr { border: none; border-top: 1px solid #e2e2e2; margin: 1.4em 0; }
.md-render img { max-width: 100%; }
.preview-empty { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #999; }
.preview-empty .glyph { font-size: 68px; }
.preview-body:has(.media-video), .preview-body:has(.media-audio) { background: #000; }
.media-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.media-audio { display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: #f0f0f0; }
.media-audio .glyph { font-size: 84px; }
.media-audio .media-name { font-size: 13px; color: #d0d0d0; }
.media-audio audio { width: 80%; max-width: 360px; }

/* ---- About This Project ---- */
.about { width: 300px; height: auto; min-width: 0; min-height: 0; }
.about .titlebar { height: 28px; background: rgba(236,236,236,0.9); border-bottom: none; }
.about-body { padding: 22px 28px 26px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.about-logo { width: 84px; height: 84px; margin-bottom: 10px; border-radius: 20px; background: linear-gradient(160deg, #4a4a4f, #1c1c1e); display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0,0,0,0.25); }
.about-logo img { width: 58px; height: 58px; }
.about-name { font-size: 26px; font-weight: 600; letter-spacing: -0.5px; }
.about-ver { font-size: 13px; color: #555; margin-bottom: 16px; }
.about-rows { width: 100%; display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.about-row { display: flex; justify-content: space-between; gap: 16px; }
.about-row .k { color: #6a6a6a; }
.about-row .v { color: #1d1d1f; text-align: right; }
.about-note { margin-top: 16px; font-size: 11px; color: #9a9a9a; line-height: 1.4; }

/* ---- Context menu ---- */
.context-menu {
  position: fixed; z-index: 20000; min-width: 172px; padding: 5px;
  background: rgba(245,245,245,0.82); backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 8px; box-shadow: 0 10px 34px rgba(0,0,0,0.32), 0 0 0 0.5px rgba(0,0,0,0.18);
  font-size: 13px; color: #1d1d1f;
}
.cm-item { padding: 4px 10px; border-radius: 5px; cursor: default; }
.cm-item:hover { background: var(--accent); color: #fff; }

/* ---- Browser ---- */
.br-nav {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 0; flex-shrink: 0;
  background: rgba(246,246,246,0.92); border-bottom: 0.5px solid rgba(0,0,0,0.12);
}
.br-nav .traffic { padding: 0 4px 0 14px; }
.br-btn { cursor: default; font-size: 16px; color: #555; width: 26px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.br-btn:hover { background: rgba(0,0,0,0.06); }
.br-btn.disabled { opacity: 0.3; pointer-events: none; }
.br-addr {
  flex: 1; height: 28px; border: none; border-radius: 8px; padding: 0 14px;
  background: #e7e7e7; font: 13px var(--font); color: #1d1d1f; text-align: left;
}
.br-addr:focus { outline: none; background: #fff; box-shadow: 0 0 0 3px rgba(10,132,255,0.35); }
.br-view { flex: 1; width: 100%; border: none; background: #fff; }
.app-view { flex: 1; width: 100%; border: none; background: #fff; }

/* ---- Dock ---- */
#dock {
  position: fixed; bottom: 6px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 8px; padding: 6px 10px; z-index: 9000;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 20px; box-shadow: 0 8px 30px rgba(0,0,0,0.35), 0 0 0 0.5px rgba(255,255,255,0.2) inset;
}
.dock-item { cursor: default; transition: transform 0.12s ease; position: relative; }
.dock-item:hover { transform: translateY(-8px) scale(1.12); }
.dock-icon { width: 48px; height: 48px; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
.dock-sep { width: 1px; height: 44px; background: rgba(255,255,255,0.3); margin: 0 2px; }
.finder-icon { background: linear-gradient(160deg, #1e9bff 0 50%, #0a6be0 50% 100%); position: relative; }
.finder-icon::after { content: ""; position: absolute; inset: 10px; background: radial-gradient(circle at 35% 40%, #fff 3px, transparent 4px), radial-gradient(circle at 65% 40%, #fff 3px, transparent 4px); }
.terminal-icon { background: linear-gradient(160deg, #2b2f36, #0d0f12); position: relative; }
.terminal-icon::after { content: ">_"; position: absolute; left: 9px; top: 6px; font: 700 15px "SF Mono", ui-monospace, Menlo, monospace; color: #38e07b; }
.safari-icon { background: #000 url('assets/netscape-navigator.png') center/cover no-repeat; }
.notes-icon { background: linear-gradient(180deg, #ffe082 0 22%, #fffef7 22% 100%); }
.trash-icon { background: linear-gradient(160deg, #d6dae0, #aeb4bd); }
.player-icon { background: linear-gradient(160deg, #3a3a3a, #171717); position: relative; overflow: hidden; }
.player-icon::before { content: ""; position: absolute; left: 8px; right: 8px; top: 9px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, #0a1f0a, #061206); box-shadow: inset 0 0 0 1px rgba(46,230,0,0.35); }
.player-icon::after { content: "llll"; position: absolute; left: 0; right: 0; top: 28px; text-align: center; letter-spacing: 2px; font: 700 11px/1 monospace; color: #2ee600; text-shadow: 0 0 4px #2ee600; }

/* ---- Winamp player ---- */
.wa {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #3b3b3b, #232323);
  color: #d6d6d6; font: 11px "SF Mono", ui-monospace, Menlo, monospace;
  padding: 8px; gap: 7px; user-select: none;
}
.wa-main { display: flex; gap: 8px; }
.wa-art {
  width: 58px; height: 58px; flex-shrink: 0; border-radius: 3px;
  background: #000 center/cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12), 0 1px 3px rgba(0,0,0,0.6);
}
.wa-display {
  flex: 1; min-width: 0; background: #000; border-radius: 4px; padding: 6px 8px;
  box-shadow: inset 0 0 0 1px rgba(46,230,0,0.18), inset 0 2px 8px rgba(0,0,0,0.9);
  display: flex; flex-direction: column; gap: 5px;
}
.wa-row { display: flex; align-items: center; gap: 8px; }
.wa-time {
  font: 700 22px/1 "SF Mono", ui-monospace, Menlo, monospace;
  color: #2ee600; text-shadow: 0 0 6px rgba(46,230,0,0.6);
  font-variant-numeric: tabular-nums; min-width: 62px;
}
.wa-viz { flex-shrink: 0; }
.wa-tech { font-size: 8px; line-height: 1.35; color: #2ee600; opacity: 0.85; text-align: right; margin-left: auto; }
.wa-marquee { overflow: hidden; white-space: nowrap; }
.wa-track {
  display: inline-block; padding-left: 100%;
  color: #2ee600; text-shadow: 0 0 5px rgba(46,230,0,0.5);
  animation: wa-scroll 14s linear infinite;
}
@keyframes wa-scroll { to { transform: translateX(-100%); } }

.wa-slider { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 4px; background: #111; box-shadow: inset 0 1px 3px rgba(0,0,0,0.8); outline: none; }
.wa-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 14px; border-radius: 3px; background: linear-gradient(180deg, #6a6a6a, #3a3a3a); box-shadow: 0 1px 2px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.3); cursor: pointer; }
.wa-pos { width: 100%; }
.wa-controls { display: flex; align-items: center; gap: 10px; }
.wa-btns { display: flex; gap: 3px; }
.wa-btn {
  width: 26px; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #ddd; border-radius: 4px; cursor: pointer;
  background: linear-gradient(180deg, #4a4a4a, #2c2c2c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 1px 2px rgba(0,0,0,0.5);
}
.wa-btn:hover { background: linear-gradient(180deg, #565656, #333); }
.wa-btn:active { background: #222; box-shadow: inset 0 1px 3px rgba(0,0,0,0.8); }
.wa-vol { flex: 1; }

.wa-pl { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #000; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); overflow: hidden; }
.wa-pl-head { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-bottom: 1px solid #1a1a1a; background: #1c1c1c; }
.wa-tab { font-size: 10px; padding: 2px 8px; border-radius: 3px; color: #9a9a9a; cursor: pointer; }
.wa-tab:hover { color: #ddd; }
.wa-tab.on { background: #2ee600; color: #000; }
.wa-pl-title { margin-left: auto; font-size: 9px; color: #2ee600; opacity: 0.7; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 150px; }
.wa-pl-list { flex: 1; overflow-y: auto; padding: 3px 0; }
.wa-item { display: flex; align-items: center; gap: 6px; padding: 3px 8px; color: #b7c9b7; cursor: pointer; white-space: nowrap; }
.wa-item:hover { background: rgba(46,230,0,0.08); }
.wa-item.playing { color: #2ee600; text-shadow: 0 0 5px rgba(46,230,0,0.5); }
.wa-num { color: #5a6a5a; min-width: 16px; }
.wa-tk { overflow: hidden; text-overflow: ellipsis; }
.wa-at { margin-left: auto; color: #5a6a5a; font-variant-numeric: tabular-nums; }
.wa-empty { padding: 16px; text-align: center; color: #667; font-size: 10px; }
