:root {
  --bg: #0b0e17;
  --bg2: #121728;
  --panel: rgba(255, 255, 255, .035);
  --line: rgba(255, 255, 255, .09);
  --fg: #e8ecf7;
  --fg2: #a9b2c7;
  --fg3: #727d95;
  --accent: #6d8cff;
  --accent2: #9d7bff;
  --ok: #56d29a;
  --err: #fb7185;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--fg);
  font: 14px/1.5 "Microsoft YaHei UI", "PingFang SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(109, 140, 255, .20), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(157, 123, 255, .16), transparent 55%),
    var(--bg);
  overflow: hidden;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 22, .55);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 18px rgba(109, 140, 255, .35);
}

.brand h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.brand p { margin: 2px 0 0; font-size: 11.5px; color: var(--fg3); }

.top-right { display: flex; align-items: center; gap: 10px; }

.pill {
  font-size: 11.5px; color: var(--fg2); padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.search {
  width: 190px; padding: 7px 12px; font-size: 12.5px; color: var(--fg);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  border-radius: 999px; outline: none;
}
.search::placeholder { color: var(--fg3); }
.search:focus { border-color: rgba(109, 140, 255, .55); background: rgba(109, 140, 255, .10); }

/* ---------------- 布局 ---------------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px; padding: 14px; height: calc(100% - 63px);
}

.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  overflow: hidden; min-height: 0;
}

.stage-panel { display: flex; flex-direction: column; }

.stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, .035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, .035) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  overflow: hidden;
  cursor: grab;
}
.stage.grabbing { cursor: grabbing; }

#pic {
  max-width: 92%; max-height: 92%;
  image-rendering: auto;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
}

.empty { text-align: center; color: var(--fg3); padding: 24px; }
.empty h2 { margin: 0 0 8px; font-size: 15px; font-weight: 500; color: var(--fg2); }
.empty p { margin: 0; font-size: 12.5px; }

.tag {
  position: absolute; top: 12px; left: 12px; max-width: 60%;
  font-size: 12px; color: var(--fg2); padding: 5px 10px; border-radius: 8px;
  background: rgba(8, 10, 18, .72); border: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag:empty { display: none; }

.badge {
  position: absolute; right: 12px; bottom: 12px;
  font-size: 11.5px; color: var(--fg2); padding: 4px 9px; border-radius: 8px;
  background: rgba(8, 10, 18, .72); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.badge:empty { display: none; }

/* ---------------- 工具条 ---------------- */
.toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--line);
  background: rgba(8, 10, 18, .45);
}

.btn {
  min-width: 34px; height: 32px; padding: 0 12px;
  font: inherit; font-size: 12.5px; color: var(--fg);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.btn:disabled { opacity: .35; cursor: default; }

.sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.spacer { flex: 1; }

.zoom {
  font-size: 12px; color: var(--fg2); min-width: 48px; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 列表 ---------------- */
.rail { display: flex; flex-direction: column; }

.rail-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--fg2);
}

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 10px var(--ok);
}

.rail-list { flex: 1; overflow-y: auto; padding: 8px; }

.rail-list::-webkit-scrollbar { width: 8px; }
.rail-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18); border-radius: 99px;
  border: 2px solid transparent; background-clip: padding-box;
}

.row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent;
}
.row:hover { background: rgba(255, 255, 255, .06); }
.row.on {
  background: linear-gradient(90deg, rgba(109, 140, 255, .22), rgba(157, 123, 255, .12));
  border-color: rgba(109, 140, 255, .45);
}

.thumb {
  width: 52px; height: 52px; flex: none; border-radius: 9px;
  background: #0a0d16; border: 1px solid var(--line);
  object-fit: contain;
}

.row-info { min-width: 0; flex: 1; }
.row-name {
  font-size: 12.8px; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-meta { font-size: 11px; color: var(--fg3); margin-top: 2px; }

.rail-note {
  padding: 10px 14px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--fg3);
}

.folder-sel {
  flex: 1; min-width: 0; padding: 6px 9px;
  font: inherit; font-size: 12.5px; color: var(--fg);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line); border-radius: 9px;
  outline: none; cursor: pointer;
}
.folder-sel:focus { border-color: rgba(109, 140, 255, .55); }
.folder-sel option { background: #121728; color: var(--fg); }

.more {
  margin: 0 12px 8px; padding: 8px; width: calc(100% - 24px);
  font: inherit; font-size: 12.5px; color: var(--fg2);
  background: rgba(255, 255, 255, .06);
  border: 1px dashed var(--line); border-radius: 9px; cursor: pointer;
}
.more:hover { background: rgba(255, 255, 255, .11); color: var(--fg); }

.thumb { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img { max-width: 100%; max-height: 100%; display: block; }
.thumb-ph {
  font-size: 10px; letter-spacing: .5px; color: var(--fg3);
  background: linear-gradient(135deg, rgba(109, 140, 255, .16), rgba(157, 123, 255, .10));
  border-style: dashed;
}

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  padding: 9px 18px; border-radius: 999px; font-size: 12.5px;
  background: rgba(12, 16, 26, .92); border: 1px solid var(--line);
  color: var(--fg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(251, 113, 133, .5); color: #ffd6dd; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 240px; }
  .search { width: 120px; }
}

.home {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 12.5px; color: var(--fg2); text-decoration: none;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s;
}
.home:hover { background: rgba(109, 140, 255, .22); color: var(--fg); border-color: rgba(109, 140, 255, .5); }

.rail-tip[hidden] { display: none; }
.rail-tip {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 10px 0; padding: 9px 12px; border-radius: 11px;
  font-size: 12.5px; line-height: 1.4; color: #ffe6b8;
  background: linear-gradient(90deg, rgba(255, 176, 64, .22), rgba(255, 130, 48, .12));
  border: 1px solid rgba(255, 176, 64, .55);
  box-shadow: 0 0 0 3px rgba(255, 176, 64, .07) inset;
  animation: tipGlow 2.4s ease-in-out infinite;
}
.rail-tip::before {
  content: "!"; flex: none;
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #2a1600;
  background: #ffb040;
}
@keyframes tipGlow {
  0%, 100% { border-color: rgba(255, 176, 64, .5); }
  50%      { border-color: rgba(255, 190, 90, .95); }
}

/* 顶栏中间的两行自定义文字（联系方式 / 说明） */
.notice {
  flex: 1; min-width: 0; text-align: center; padding: 0 18px; line-height: 1.4;
  color: var(--fg2);
}
.notice b { display: block; font-size: 13px; font-weight: 600; letter-spacing: .2px; }
.notice span { display: block; font-size: 11.5px; opacity: .8; margin-top: 2px; }
.notice b:empty, .notice span:empty { display: none; }
@media (max-width: 980px) { .notice { display: none !important; } }

:root {
  --bg: #0b0e17;
  --bg2: #121728;
  --panel: rgba(255, 255, 255, .035);
  --line: rgba(255, 255, 255, .09);
  --fg: #e8ecf7;
  --fg2: #a9b2c7;
  --fg3: #727d95;
  --accent: #6d8cff;
  --accent2: #9d7bff;
  --ok: #56d29a;
  --err: #fb7185;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--fg);
  font: 14px/1.5 "Microsoft YaHei UI", "PingFang SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(109, 140, 255, .20), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(157, 123, 255, .16), transparent 55%),
    var(--bg);
  overflow: hidden;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 13, 22, .55);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 6px 18px rgba(109, 140, 255, .35);
}

.brand h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.brand p { margin: 2px 0 0; font-size: 11.5px; color: var(--fg3); }

.top-right { display: flex; align-items: center; gap: 10px; }

.pill {
  font-size: 11.5px; color: var(--fg2); padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.search {
  width: 190px; padding: 7px 12px; font-size: 12.5px; color: var(--fg);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  border-radius: 999px; outline: none;
}
.search::placeholder { color: var(--fg3); }
.search:focus { border-color: rgba(109, 140, 255, .55); background: rgba(109, 140, 255, .10); }

/* ---------------- 布局 ---------------- */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px; padding: 14px; height: calc(100% - 63px);
}

.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  overflow: hidden; min-height: 0;
}

.stage-panel { display: flex; flex-direction: column; }

.stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, .035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, .035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, .035) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  overflow: hidden;
  cursor: grab;
}
.stage.grabbing { cursor: grabbing; }

#pic {
  max-width: 92%; max-height: 92%;
  image-rendering: auto;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
}

.empty { text-align: center; color: var(--fg3); padding: 24px; }
.empty h2 { margin: 0 0 8px; font-size: 15px; font-weight: 500; color: var(--fg2); }
.empty p { margin: 0; font-size: 12.5px; }

.tag {
  position: absolute; top: 12px; left: 12px; max-width: 60%;
  font-size: 12px; color: var(--fg2); padding: 5px 10px; border-radius: 8px;
  background: rgba(8, 10, 18, .72); border: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag:empty { display: none; }

.badge {
  position: absolute; right: 12px; bottom: 12px;
  font-size: 11.5px; color: var(--fg2); padding: 4px 9px; border-radius: 8px;
  background: rgba(8, 10, 18, .72); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.badge:empty { display: none; }

/* ---------------- 工具条 ---------------- */
.toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--line);
  background: rgba(8, 10, 18, .45);
}

.btn {
  min-width: 34px; height: 32px; padding: 0 12px;
  font: inherit; font-size: 12.5px; color: var(--fg);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line); border-radius: 9px;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.btn:disabled { opacity: .35; cursor: default; }

.sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.spacer { flex: 1; }

.zoom {
  font-size: 12px; color: var(--fg2); min-width: 48px; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 列表 ---------------- */
.rail { display: flex; flex-direction: column; }

.rail-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--fg2);
}

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 10px var(--ok);
}

.rail-list { flex: 1; overflow-y: auto; padding: 8px; }

.rail-list::-webkit-scrollbar { width: 8px; }
.rail-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18); border-radius: 99px;
  border: 2px solid transparent; background-clip: padding-box;
}

.row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent;
}
.row:hover { background: rgba(255, 255, 255, .06); }
.row.on {
  background: linear-gradient(90deg, rgba(109, 140, 255, .22), rgba(157, 123, 255, .12));
  border-color: rgba(109, 140, 255, .45);
}

.thumb {
  width: 52px; height: 52px; flex: none; border-radius: 9px;
  background: #0a0d16; border: 1px solid var(--line);
  object-fit: contain;
}

.row-info { min-width: 0; flex: 1; }
.row-name {
  font-size: 12.8px; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-meta { font-size: 11px; color: var(--fg3); margin-top: 2px; }

.rail-note {
  padding: 10px 14px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--fg3);
}

.folder-sel {
  flex: 1; min-width: 0; padding: 6px 9px;
  font: inherit; font-size: 12.5px; color: var(--fg);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line); border-radius: 9px;
  outline: none; cursor: pointer;
}
.folder-sel:focus { border-color: rgba(109, 140, 255, .55); }
.folder-sel option { background: #121728; color: var(--fg); }

.more {
  margin: 0 12px 8px; padding: 8px; width: calc(100% - 24px);
  font: inherit; font-size: 12.5px; color: var(--fg2);
  background: rgba(255, 255, 255, .06);
  border: 1px dashed var(--line); border-radius: 9px; cursor: pointer;
}
.more:hover { background: rgba(255, 255, 255, .11); color: var(--fg); }

.thumb { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img { max-width: 100%; max-height: 100%; display: block; }
.thumb-ph {
  font-size: 10px; letter-spacing: .5px; color: var(--fg3);
  background: linear-gradient(135deg, rgba(109, 140, 255, .16), rgba(157, 123, 255, .10));
  border-style: dashed;
}

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  padding: 9px 18px; border-radius: 999px; font-size: 12.5px;
  background: rgba(12, 16, 26, .92); border: 1px solid var(--line);
  color: var(--fg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(251, 113, 133, .5); color: #ffd6dd; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 240px; }
  .search { width: 120px; }
}

.home {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  font-size: 12.5px; color: var(--fg2); text-decoration: none;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s;
}
.home:hover { background: rgba(109, 140, 255, .22); color: var(--fg); border-color: rgba(109, 140, 255, .5); }

.rail-tip[hidden] { display: none; }
.rail-tip {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 10px 0; padding: 9px 12px; border-radius: 11px;
  font-size: 12.5px; line-height: 1.4; color: #ffe6b8;
  background: linear-gradient(90deg, rgba(255, 176, 64, .22), rgba(255, 130, 48, .12));
  border: 1px solid rgba(255, 176, 64, .55);
  box-shadow: 0 0 0 3px rgba(255, 176, 64, .07) inset;
  animation: tipGlow 2.4s ease-in-out infinite;
}
.rail-tip::before {
  content: "!"; flex: none;
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #2a1600;
  background: #ffb040;
}
@keyframes tipGlow {
  0%, 100% { border-color: rgba(255, 176, 64, .5); }
  50%      { border-color: rgba(255, 190, 90, .95); }
}

/* 顶栏中间的两行自定义文字（联系方式 / 说明） */
.notice {
  flex: 1; min-width: 0; text-align: center; padding: 0 18px; line-height: 1.4;
  color: var(--fg2);
}
.notice b { display: block; font-size: 13px; font-weight: 600; letter-spacing: .2px; }
.notice span { display: block; font-size: 11.5px; opacity: .8; margin-top: 2px; }
