:root {
  --bg: #0b0f17;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-2: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --border: rgba(255, 255, 255, 0.12);
  --primary: #4f8cff;
  --primary-2: #3b72ff;
  --danger: #ff5c7a;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 900px at 20% 0%, rgba(79, 140, 255, 0.25), transparent 60%),
    radial-gradient(1000px 700px at 80% 10%, rgba(255, 92, 122, 0.18), transparent 60%),
    radial-gradient(900px 700px at 50% 90%, rgba(80, 255, 208, 0.12), transparent 55%);
}

.app {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  padding: 28px 16px 18px;
  gap: 16px;
  overflow: hidden;
}

.header {
  width: min(920px, 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 2px;
}

.headerLeft {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gearBtn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.gearBtn:hover {
  color: rgba(255, 255, 255, 0.6);
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.subtitle {
  font-size: 14px;
  color: var(--muted);
}

.card {
  width: min(920px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(10px);
}

.label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.inputRow {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 10px;
  align-items: center;
}

.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
}

.input:focus {
  border-color: rgba(79, 140, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.16);
}

.noteRow {
  margin-top: 8px;
}

.noteInput {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 44px;
  line-height: 1.5;
}

.noteInput::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.noteInput:focus {
  border-color: rgba(79, 140, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.16);
}

.btn {
  height: 44px;
  padding: 0 14px;
  font-size: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btnPrimary {
  border-color: rgba(79, 140, 255, 0.55);
  background: linear-gradient(180deg, rgba(79, 140, 255, 0.95), rgba(59, 114, 255, 0.95));
}

.btnPrimary:hover {
  border-color: rgba(79, 140, 255, 0.85);
}

.btnSecondary:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.btnSave {
  border-color: rgba(80, 255, 208, 0.45);
  background: linear-gradient(180deg, rgba(80, 255, 208, 0.22), rgba(60, 200, 170, 0.22));
}

.btnSave:hover {
  border-color: rgba(80, 255, 208, 0.7);
}

.status {
  margin-top: 12px;
  min-height: 20px;
  font-size: 13px;
  color: var(--muted);
}

.status.rich {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
}

.statusTitle {
  font-size: 14px;
  font-weight: 750;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 6px;
}

.statusLine {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 3px;
}

.statusHint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.46);
  margin-top: 6px;
}

.status.error {
  color: rgba(255, 92, 122, 0.92);
}

.result {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.16);
}

.trending {
  width: min(920px, 100%);
  padding: 0 2px;
  opacity: 0.9;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.trendingHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 10px;
}

.trendingCategoryTabs {
  display: flex;
  gap: 0;
}

.trendingCategoryTab {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  transition: color 0.15s;
  position: relative;
}

.trendingCategoryTab:hover {
  color: rgba(255, 255, 255, 0.7);
}

.trendingCategoryTab.active {
  color: var(--text);
}

.trendingCategoryTab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.trendingControls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trendingTabs {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 2px;
}

.trendingTab {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.2;
}

.trendingTab:hover {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
}

.trendingTab.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.trendingMeta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  white-space: nowrap;
}

.trendingList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.trendingList::-webkit-scrollbar {
  width: 10px;
}

.trendingList::-webkit-scrollbar-track {
  background: transparent;
}

.trendingList::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.trendingList:hover::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.40);
}

.trendingItem {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.trendingItem:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.trendingLeft {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  padding: 10px 0 10px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.trendingCopyBtn {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 10px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.trendingCopyBtn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.trendingCopyBtn:active {
  background: rgba(255, 255, 255, 0.1);
}

.trendingRank {
  font-weight: 800;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  padding-top: 2px;
}

.trendingItemTitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
}

.trendingItemMeta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.44);
  margin-top: 3px;
}

.trendingEmpty {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.42);
  padding: 6px 2px;
}

.resultTitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.resultLinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fileIcon {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  background: rgba(0, 0, 0, 0.18);
  user-select: none;
}

.fileIcon:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.fileIconTxt {
  border-color: rgba(79, 140, 255, 0.38);
  background: linear-gradient(180deg, rgba(79, 140, 255, 0.16), rgba(0, 0, 0, 0.18));
}

.fileIconJson {
  border-color: rgba(80, 255, 208, 0.30);
  background: linear-gradient(180deg, rgba(80, 255, 208, 0.12), rgba(0, 0, 0, 0.18));
}

.fileIconSrt {
  border-color: rgba(255, 200, 92, 0.30);
  background: linear-gradient(180deg, rgba(255, 200, 92, 0.12), rgba(0, 0, 0, 0.18));
}

.fileIconBadge {
  font-weight: 800;
  letter-spacing: 0.6px;
  font-size: 13px;
  white-space: nowrap;
}

.fileIconHint {
  font-size: 12px;
  color: var(--muted);
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  background: rgba(0, 0, 0, 0.18);
}

.link:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.linkMeta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.linkName {
  font-weight: 650;
  font-size: 14px;
}

.linkUrl {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}


.platformIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.platformIcon:hover {
  background: rgba(255, 255, 255, 0.07);
}

.platformIconImg {
  width: 20px;
  height: 20px;
  display: block;
}

.footer {
  width: min(920px, 100%);
  margin-top: auto;
  padding: 10px 2px;
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footerInner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footerPlatforms {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.8;
}

.footerPlatformsLabel {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

.footerIcon {
  width: 16px;
  height: 16px;
  display: inline-block;
}

/* ====== File Manager Modal ====== */

.fmOverlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.fmOverlay[hidden] {
  display: none;
}

.fmPanel {
  width: min(680px, 100%);
  max-height: 80vh;
  background: #141822;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fmHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

.fmTitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.fmCloseBtn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.fmCloseBtn:hover {
  color: var(--text);
}

.fmBody {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 18px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.fmLoading, .fmEmpty {
  font-size: 13px;
  color: var(--muted);
  padding: 16px 0;
  text-align: center;
}

.fmItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fmItem:last-child {
  border-bottom: none;
}

.fmItemInfo {
  flex: 1;
  min-width: 0;
}

.fmItemTitle {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fmItemMeta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fmTag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
}

.fmTagBlob {
  background: rgba(79, 140, 255, 0.15);
  color: rgba(79, 140, 255, 0.8);
}

.fmTagLocal {
  background: rgba(80, 255, 208, 0.12);
  color: rgba(80, 255, 208, 0.75);
}

.fmDeleteBtn {
  flex: 0 0 auto;
  background: none;
  border: 1px solid rgba(255, 92, 122, 0.25);
  border-radius: 8px;
  color: rgba(255, 92, 122, 0.7);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.fmDeleteBtn:hover {
  background: rgba(255, 92, 122, 0.1);
  border-color: rgba(255, 92, 122, 0.5);
  color: rgba(255, 92, 122, 0.9);
}

.fmDeleteBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .inputRow {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }

  .btn {
    width: auto;
    padding: 0 12px;
  }

  .input {
    height: 44px;
  }

  .resultLinks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
  }

  .fileIcon {
    padding: 6px 12px;
  }

  .app {
    padding: 18px 12px 14px;
  }
}

@media (hover: none) and (pointer: coarse) {
  #pasteBtn {
    display: none;
  }

  .trendingList {
    scrollbar-width: none;
  }

  .trendingList::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}
