/* Cutline.ai 工作台 — 设计令牌与 App 端同源(石墨黑 · 电光蓝 · 克制动效) */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0c0d10; --bg2: #0a0b0e;
  --panel: #141519; --panel2: #1a1c22; --raise: #21242b;
  --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.13);
  --fg: #e9ebef; --dim: #a6acb5; --faint: #7c828c;
  --acc: #0a7cff; --acc2: #3a97ff;
  --good: #34c06e; --warn: #eaa53d; --bad: #ee5a50;
  --ring: rgba(10,124,255,.42);
  --r: 16px; --r2: 13px; --r3: 10px; --rpill: 999px;
  --sh-sm: 0 1px 2px rgba(0,0,0,.30), 0 1px 1px rgba(0,0,0,.16);
  --sh-md: 0 8px 26px rgba(0,0,0,.40), 0 2px 7px rgba(0,0,0,.24);
  --sh-lg: 0 24px 60px rgba(0,0,0,.55), 0 8px 20px rgba(0,0,0,.34);
  --ease: cubic-bezier(.22,.61,.36,1);
  --snap: cubic-bezier(.22,1,.36,1);
  --mono: "SF Mono", ui-monospace, "Cascadia Code", Consolas, "Noto Sans Mono CJK SC", monospace;
}
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acc2); text-decoration: none; }
::selection { background: rgba(10,124,255,.32); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2e36; border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #353a44; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px; height: 56px;
  background: rgba(12,13,16,.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand img { height: 18px; display: block; }
.brand-tag {
  font-style: normal; font-size: 10px; font-weight: 600; letter-spacing: .18em;
  color: var(--faint); border: 1px solid var(--line2); border-radius: var(--rpill);
  padding: 2px 9px 2px 10px; transform: translateY(1px);
}
.tabs { display: flex; gap: 2px; flex: 1; }
.tabs a {
  color: var(--dim); padding: 7px 14px; border-radius: var(--rpill);
  transition: color .18s var(--ease), background .18s var(--ease);
}
.tabs a:hover { color: var(--fg); }
.tabs a.active { color: var(--fg); background: var(--panel2); }
.top-right { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 13px; }

main { padding: 26px 22px 60px; max-width: 1480px; margin: 0 auto; }

/* ---------- 面包屑 / 工具条 ---------- */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin-bottom: 18px; color: var(--dim); min-height: 34px;
}
.crumbs a { color: var(--dim); transition: color .15s; }
.crumbs a:hover { color: var(--fg); }
.crumbs .sep { opacity: .4; }
.crumbs .cur { color: var(--fg); font-weight: 600; font-size: 16px; }
.crumbs .note { color: var(--faint); font-size: 12px; margin-left: 6px; }
.toolbar { display: flex; gap: 8px; margin-left: auto; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line2); background: var(--panel2); color: var(--fg);
  padding: 7px 15px; border-radius: var(--r3); cursor: pointer; font-size: 13px;
  line-height: 1.5; display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .18s var(--ease), background .18s var(--ease),
              transform .12s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { border-color: rgba(255,255,255,.22); background: var(--raise); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn.primary {
  background: linear-gradient(180deg, #1a86ff, #0a7cff);
  border-color: rgba(10,124,255,.7); color: #fff; font-weight: 500;
}
.btn.primary:hover { background: linear-gradient(180deg, #2b90ff, #1a86ff); box-shadow: 0 4px 18px rgba(10,124,255,.35); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: rgba(238,90,80,.5); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { color: var(--fg); background: var(--panel2); border-color: transparent; }
.btn.wide { width: 100%; justify-content: center; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

/* ---------- 网格与卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }

.dcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2);
  padding: 16px; cursor: pointer;
  transition: border-color .18s var(--ease), transform .18s var(--snap), box-shadow .18s var(--ease);
}
.dcard:hover { border-color: var(--line2); transform: translateY(-2px); box-shadow: var(--sh-md); }
.dcard .dname { font-weight: 600; margin-bottom: 7px; word-break: break-all; letter-spacing: .01em; }
.dcard .dmeta { color: var(--dim); font-size: 12px; }

.fcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2);
  overflow: hidden; position: relative;
  transition: border-color .18s var(--ease), transform .18s var(--snap), box-shadow .18s var(--ease);
}
.fcard:hover { border-color: var(--line2); transform: translateY(-2px); box-shadow: var(--sh-md); }
.fcard .thumb {
  aspect-ratio: 16/9; background: #08090b; display: flex; align-items: center;
  justify-content: center; color: var(--faint); font-size: 12px; cursor: pointer;
  overflow: hidden; position: relative;
}
.fcard .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--snap), opacity .3s; }
.fcard:hover .thumb img { transform: scale(1.04); }
.fcard .thumb .playcue {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s var(--ease); background: rgba(0,0,0,.28);
}
.fcard:hover .thumb .playcue { opacity: 1; }
.playcue i {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(12,13,16,.72); border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
}
.playcue i::after {
  content: ""; display: block; margin-left: 3px;
  border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}
.fcard .finfo { padding: 9px 12px 10px; }
.fcard .fname { font-size: 12px; word-break: break-all; max-height: 3em; overflow: hidden; }
.fcard .fmeta { color: var(--faint); font-size: 11px; margin-top: 5px; display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); }
.fcard .menu-btn {
  background: none; border: none; color: var(--faint); cursor: pointer;
  font-size: 16px; padding: 0 5px; border-radius: 6px; line-height: 1.2;
  transition: color .15s, background .15s;
}
.fcard .menu-btn:hover { color: var(--fg); background: var(--raise); }

/* ---------- 徽标 / 状态点 ---------- */
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: var(--rpill);
  background: var(--panel2); color: var(--dim); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 5px; vertical-align: 1px;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.badge.ok { color: var(--good); } .badge.ok .dot { background: var(--good); }
.badge.err { color: var(--bad); } .badge.err .dot { background: var(--bad); }
.badge.acc { color: var(--acc2); } .badge.acc .dot { background: var(--acc2); }
.badge.warn { color: var(--warn); } .badge.warn .dot { background: var(--warn); }

/* ---------- 骨架屏 ---------- */
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel {
  border-radius: var(--r2); border: 1px solid var(--line);
  background: linear-gradient(100deg, var(--panel) 42%, #191b21 50%, var(--panel) 58%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.skel.card { height: 96px; }
.skel.tile { aspect-ratio: 16/12; }

.empty { color: var(--faint); padding: 80px 0; text-align: center; line-height: 2; }
.empty a { color: var(--acc2); }
.section-title {
  color: var(--faint); font-size: 11px; margin: 26px 0 12px;
  letter-spacing: .14em; font-weight: 600;
}

/* ---------- 右键菜单 ---------- */
.menu {
  position: absolute; right: 8px; bottom: 38px; background: var(--raise);
  border: 1px solid var(--line2); border-radius: var(--r3); z-index: 15; min-width: 138px;
  box-shadow: var(--sh-lg); overflow: hidden; padding: 4px;
  animation: pop .16s var(--snap);
}
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.menu div { padding: 8px 12px; cursor: pointer; border-radius: 7px; transition: background .12s; }
.menu div:hover { background: var(--panel2); }
.menu div.danger { color: var(--bad); }

/* ---------- 模态 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(6,7,9,.62); z-index: 50;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.dialog {
  background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r);
  width: 100%; max-width: 500px; padding: 24px; max-height: 90vh; overflow: auto;
  box-shadow: var(--sh-lg); animation: rise .22s var(--snap);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.dialog.player-dialog { max-width: 920px; }
.dialog h3 { margin-bottom: 16px; font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.dialog .row { margin-bottom: 12px; }
.dialog .row label { display: block; color: var(--dim); font-size: 12px; margin-bottom: 6px; }
.dialog .body-text { color: var(--dim); line-height: 1.9; }
.dialog .body-text b { color: var(--fg); font-weight: 600; }
.dialog input, .dialog select, .dialog textarea {
  width: 100%; padding: 10px 13px; background: var(--bg2); color: var(--fg);
  border: 1px solid var(--line2); border-radius: var(--r3); font-size: 14px;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.dialog input:focus, .dialog select:focus, .dialog textarea:focus {
  outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--ring);
}
.dialog .actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 20px; }
.dialog video { width: 100%; max-height: 62vh; background: #000; border-radius: var(--r3); }
.player-status { color: var(--dim); margin: 12px 0 0; font-size: 13px; min-height: 18px; }
.player-title { font-size: 13px; word-break: break-all; margin-bottom: 12px; color: var(--dim); }

.picker-list { max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r3); background: var(--bg2); }
.picker-list div { padding: 10px 13px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .12s; }
.picker-list div:last-child { border-bottom: none; }
.picker-list div:hover { background: var(--panel2); }

/* ---------- 上传 ---------- */
.dropzone {
  border: 1.5px dashed var(--line2); border-radius: var(--r2); padding: 40px 20px;
  text-align: center; color: var(--dim); margin-bottom: 16px; cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--acc); color: var(--fg); background: rgba(10,124,255,.05); }
.dropzone .dz-hint { color: var(--faint); font-size: 12px; margin-top: 6px; }
.upl-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r3); padding: 11px 15px; margin-bottom: 8px; }
.upl-item .bar { height: 4px; background: var(--raise); border-radius: 2px; margin-top: 9px; overflow: hidden; }
.upl-item .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); width: 0; transition: width .25s var(--ease); border-radius: 2px; }
.upl-item.done .bar i { background: var(--good); }
.upl-item.fail .bar i { background: var(--bad); }

/* ---------- 面板 / 行 ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); padding: 18px; margin-bottom: 14px; }
.panel h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.trow { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: none; }
.trow .tname { flex: 1; word-break: break-all; }
.trow .tsub { color: var(--dim); font-size: 12px; margin-top: 4px; line-height: 1.7; }
.trow .tmeta { color: var(--faint); font-size: 12px; white-space: nowrap; font-family: var(--mono); }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; }
.kv b { font-weight: 400; color: var(--dim); }
.kv span { font-family: var(--mono); font-size: 13px; }
.hint-ok { color: var(--good); } .hint-err { color: var(--bad); }

/* ---------- 任务进度 ---------- */
.jprog { height: 4px; background: var(--raise); border-radius: 2px; margin-top: 8px; overflow: hidden; max-width: 420px; }
.jprog i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); border-radius: 2px; transition: width .5s var(--ease); }

/* ---------- 登录 ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(1200px 700px at 50% -10%, rgba(10,124,255,.13), transparent 62%), var(--bg);
}
.login-card {
  width: 360px; background: rgba(20,21,25,.9); border: 1px solid var(--line2);
  border-radius: var(--r); padding: 40px 34px 34px; box-shadow: var(--sh-lg);
  animation: rise .3s var(--snap);
}
.login-card .brand { justify-content: center; margin-bottom: 10px; }
.login-card .brand img { height: 26px; }
.login-sub { text-align: center; color: var(--dim); margin-bottom: 30px; font-size: 13px; letter-spacing: .04em; }
.login-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px; font-size: 14px;
  background: var(--bg2); color: var(--fg); border: 1px solid var(--line2); border-radius: var(--r3);
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--ring); }
.login-msg { color: var(--bad); text-align: center; margin-top: 14px; min-height: 18px; font-size: 13px; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--raise); border: 1px solid var(--line2); color: var(--fg);
  padding: 11px 20px; border-radius: var(--r3); z-index: 99; box-shadow: var(--sh-lg);
  animation: toast-in .25s var(--snap); font-size: 13px;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

select {
  padding: 9px 12px; background: var(--bg2); color: var(--fg);
  border: 1px solid var(--line2); border-radius: var(--r3); font-size: 13px;
}
select:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--ring); }

.settings-form input {
  width: 100%; padding: 10px 13px; margin-bottom: 10px; font-size: 14px;
  background: var(--bg2); color: var(--fg); border: 1px solid var(--line2); border-radius: var(--r3);
  transition: border-color .15s, box-shadow .15s;
}
.settings-form input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--ring); }

@media (max-width: 680px) {
  .topbar { gap: 10px; padding: 0 12px; height: 52px; overflow-x: auto; }
  .brand img { height: 15px; }
  .brand-tag { display: none; }
  .tabs a { padding: 6px 10px; font-size: 13px; }
  .top-right span { display: none; }
  main { padding: 16px 12px 50px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 9px; }
  .crumbs .cur { font-size: 15px; }
}
