:root {
  --bg: #f4f6f6;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --ink: #16211f;
  --ink-2: #34433f;
  --muted: #6b7975;
  --muted-2: #93a09c;
  --line: #e2e8e6;
  --line-strong: #cfd9d6;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-soft: #e6f5f2;
  --warn: #b45309;
  --warn-soft: #fff5e6;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --blue: #2563eb;
  --shadow-sm: 0 1px 2px rgba(22, 33, 31, .04), 0 1px 3px rgba(22, 33, 31, .05);
  --shadow-md: 0 12px 30px rgba(22, 33, 31, .08), 0 2px 8px rgba(22, 33, 31, .04);
  --shadow-lg: 0 24px 70px rgba(22, 33, 31, .16);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.hidden { display: none !important; }
body.modal-open { overflow: hidden; }
body.modal-open .bottom-nav { display: none !important; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--muted-2);
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }

/* ---------- login ---------- */
.login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: #f3f7f6;
}
.login-art { position: absolute; inset: 0; overflow: hidden; }
.login-art .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .85;
}
.orb-a {
  width: 520px; height: 520px;
  right: -140px; top: -160px;
  background: radial-gradient(circle at 35% 35%, #d9f5ef, #eef8f5 60%, transparent 72%);
}
.orb-b {
  width: 460px; height: 460px;
  left: -160px; bottom: -180px;
  background: radial-gradient(circle at 60% 40%, #e7eefc, #f5f7fb 60%, transparent 72%);
}
.grain {
  position: absolute; inset: 0;
  opacity: .22;
  background-image: radial-gradient(rgba(15, 118, 110, .08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 65%);
}
.login-card {
  position: relative;
  width: min(420px, 100%);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-lg);
  border-radius: 26px;
  padding: 34px 32px 26px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  flex: 0 0 auto;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-mark.big { width: 54px; height: 54px; border-radius: 17px; margin-bottom: 18px; }
.brand-mark.big svg { width: 32px; height: 32px; }
.login-card h1 { font-size: 32px; line-height: 1.15; letter-spacing: -.03em; margin: 0 0 8px; }
.login-sub { color: var(--muted); margin: 0 0 26px; font-size: 14px; }
.login-form label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  height: 50px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 13px;
  padding: 0 48px 0 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(15, 118, 110, .1); }
.input-wrap .icon-btn { position: absolute; right: 6px; top: 6px; }
.login-form .btn { margin-top: 16px; height: 50px; }
.login-foot { margin: 18px 0 0; font-size: 11px; color: var(--muted-2); text-align: center; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: 9px; padding: 9px 11px; font-size: 12px; margin: 12px 0 0; }

/* ---------- shell ---------- */
.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 22px 14px 18px;
  border-right: 1px solid var(--line);
  background: rgba(250, 252, 251, .8);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand strong { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 10px; color: var(--muted-2); margin-top: 2px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  border: 0; background: transparent;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  text-align: left;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: #eef4f2; color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.sidebar-foot {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.sidebar-foot strong { display: block; font-size: 11px; }
.sidebar-foot small { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 2px; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex: 0 0 auto; }
.conn-dot.ok { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, .12); }
.conn-dot.bad { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .12); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 66px;
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: rgba(244, 246, 246, .84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 230, .7);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-title { font-size: 16px; margin: 0; letter-spacing: -.01em; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.mobile-brand { display: none; align-items: center; gap: 9px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  width: min(320px, 32vw);
  height: 38px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .8);
  border-radius: 11px;
  padding: 0 11px;
  color: var(--muted-2);
  transition: border-color .15s, box-shadow .15s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .08); background: #fff; }
.search-box svg { width: 17px; height: 17px; flex: 0 0 auto; }
.search-box input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 13px; min-width: 0; }
.view { padding: 26px 28px 80px; width: 100%; max-width: 1240px; margin: 0 auto; }
.bottom-nav { display: none; }

/* ---------- common ---------- */
.btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
  border-radius: 10px;
  height: 38px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: transform .08s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(15, 118, 110, .18); }
.btn.primary:hover { background: #0b635c; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #991b1b; }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.sm { height: 32px; padding: 0 10px; font-size: 11.5px; border-radius: 9px; }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 38px; height: 38px;
  display: inline-grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-head h2 { font-size: 15px; margin: 0; letter-spacing: -.01em; }
.section-head .muted { font-size: 11.5px; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-head h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.035em; }
.page-head p { margin: 0; font-size: 13px; color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .55);
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
}
.empty svg { width: 38px; height: 38px; color: var(--muted-2); margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 15px; }
.empty p { margin: 0; font-size: 12.5px; }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
}
.stat-card .label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 650; }
.stat-card .label svg { width: 15px; height: 15px; color: var(--accent); }
.stat-card .value { font-size: 26px; font-weight: 750; letter-spacing: -.04em; margin: 9px 0 2px; }
.stat-card .sub { font-size: 10.5px; color: var(--muted-2); }

/* ---------- recent ---------- */
.recent-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.recent-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.recent-card:hover { border-color: #c8d6d1; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.recent-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.recent-title { min-width: 0; }
.recent-title h3 { font-size: 15px; margin: 5px 0 3px; letter-spacing: -.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-title .path { font-size: 10.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 650; }
.recent-files { margin: 13px 0 11px; display: flex; flex-direction: column; gap: 5px; }
.recent-file { display: flex; gap: 8px; align-items: center; min-width: 0; font-size: 11.5px; color: var(--ink-2); }
.recent-file svg { width: 14px; height: 14px; color: var(--muted-2); flex: 0 0 auto; }
.recent-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted-2); font-size: 10.5px; border-top: 1px solid var(--line); padding-top: 10px; }
.recent-actions { display: flex; gap: 7px; margin-top: 11px; }

/* ---------- browse ---------- */
.browse-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.crumb { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 5px 6px; border-radius: 7px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb:hover { background: #fff; color: var(--ink); }
.crumb.current { color: var(--ink); font-weight: 700; }
.crumb-sep { color: var(--muted-2); font-size: 11px; }
.list-tools { display: flex; align-items: center; gap: 8px; }
.list-shell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.file-head, .file-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 78px 96px 132px;
  gap: 10px;
  align-items: center;
}
.file-head {
  padding: 10px 14px;
  background: #fbfcfc;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.file-row {
  padding: 11px 14px;
  border-bottom: 1px solid #eef2f0;
  min-height: 60px;
  transition: background .12s;
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #fbfdfc; }
.file-row.selected { background: var(--accent-soft); }
.check { display: grid; place-items: center; width: 22px; height: 22px; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.file-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--muted);
  flex: 0 0 auto;
}
.file-icon.folder { background: #eef7f4; color: var(--accent); border-color: #d9ece6; }
.file-icon svg { width: 18px; height: 18px; }
.file-name-btn { border: 0; background: transparent; padding: 0; text-align: left; min-width: 0; width: 100%; }
.file-name { font-size: 12.8px; font-weight: 650; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name-btn:hover .file-name { color: var(--accent); }
.file-sub { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-type, .file-size { font-size: 11.5px; color: var(--muted); }
.file-actions { display: flex; justify-content: flex-end; gap: 4px; }
.file-actions .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.file-actions .icon-btn svg { width: 16px; height: 16px; }
.file-actions .icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; border-radius: 6px; font-size: 10px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.high { background: #e8f7ef; color: #047857; border-color: #c6efdc; }
.chip.medium { background: #eef4ff; color: #1d4ed8; border-color: #d7e3ff; }
.chip.low { background: var(--warn-soft); color: var(--warn); border-color: #f5dfbd; }
.chip.manual { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }

/* ---------- batch bar ---------- */
.batch-bar {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex; align-items: center; gap: 8px;
  background: rgba(22, 33, 31, .94);
  color: #fff;
  border-radius: 14px;
  padding: 8px 9px 8px 14px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  max-width: calc(100vw - 24px);
}
.batch-bar .count { font-size: 12px; font-weight: 650; margin-right: 3px; white-space: nowrap; }
.batch-bar .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: #fff; }
.batch-bar .btn:hover { background: rgba(255,255,255,.18); }
.batch-bar .btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: #062c26; }
.batch-bar .icon-btn { color: #d1d5db; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 14px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 14px; margin: 0 0 4px; letter-spacing: -.01em; }
.panel .panel-sub { font-size: 11.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field label { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  padding: 9px 11px;
  outline: none;
  font-size: 12px;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.field.full { grid-column: 1 / -1; }
.alias-list, .log-list { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.alias-item, .log-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  min-width: 0;
}
.alias-item .text, .log-item .text { min-width: 0; }
.alias-item strong, .log-item strong { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alias-item small, .log-item small { display: block; font-size: 10px; color: var(--muted-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-item .old { color: var(--muted-2); text-decoration: line-through; }
.log-item .new { color: var(--ink); }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.status-line .dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; }

/* ---------- modal ---------- */
.modal-root { position: fixed; inset: 0; z-index: 80; }
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 21, .38);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fade .16s ease-out;
}
.modal {
  width: min(520px, 100%);
  max-height: min(86dvh, 760px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop .18s ease-out;
}
.modal.wide { width: min(860px, 100%); }
.modal-head { flex: 0 0 auto; }
.modal-body { flex: 1 1 auto; min-height: 0; }
.modal-foot { flex: 0 0 auto; }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 20px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; margin: 0 0 4px; letter-spacing: -.02em; }
.modal-head p { margin: 0; font-size: 11.5px; color: var(--muted); }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfc; }
.modal-close { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-close svg { width: 18px; height: 18px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.preview-summary { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.check-line { display: flex; align-items: center; gap: 7px; margin: -4px 0 12px; color: var(--muted); font-size: 11px; cursor: pointer; }
.check-line input { width: 14px; height: 14px; accent-color: var(--accent); }
.diff-list { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.diff-row { display: grid; grid-template-columns: 22px minmax(0,1fr) minmax(0,1.15fr) 88px; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #eef2f0; font-size: 11.5px; }
.diff-row:last-child { border-bottom: 0; }
.diff-row.low { background: #fffdf8; }
.diff-row .idx { color: var(--muted-2); font-size: 9.5px; text-align: right; }
.diff-old { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.diff-new { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.diff-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.diff-reason { font-size: 9px; color: var(--muted-2); text-align: right; }
.diff-head { display: grid; grid-template-columns: 22px minmax(0,1fr) minmax(0,1.15fr) 88px; gap: 10px; padding: 8px 12px; background: #fbfcfc; border-bottom: 1px solid var(--line); font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }

.progress-wrap { padding: 8px 0 4px; }
.progress-bar { height: 9px; border-radius: 99px; background: #e8efed; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .35s ease; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 9px; font-size: 11px; color: var(--muted); }
.job-log { margin-top: 14px; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.job-line { display: flex; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #eef2f0; font-size: 10.5px; align-items: center; }
.job-line:last-child { border-bottom: 0; }
.job-line .ok { color: #047857; font-weight: 700; }
.job-line .fail { color: var(--danger); font-weight: 700; }
.job-line .path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- toast ---------- */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 24px)); }
.toast {
  display: flex; align-items: center; gap: 9px;
  background: #16211f; color: #fff;
  border-radius: 11px; padding: 10px 13px;
  font-size: 12px; box-shadow: var(--shadow-lg);
  animation: toastin .2s ease-out;
}
.toast.ok { background: #064e3b; }
.toast.err { background: #7f1d1d; }
.toast svg { width: 16px; height: 16px; flex: 0 0 auto; }
@keyframes toastin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- skeleton ---------- */
.skeleton { background: linear-gradient(90deg, #eef2f0 25%, #f6f8f7 37%, #eef2f0 63%); background-size: 400% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.loading-line { height: 13px; margin: 10px 0; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { height: 60px; padding: 0 16px; }
  .mobile-brand { display: flex; }
  .page-title { display: none; }
  .search-box { width: min(250px, 36vw); }
  .view { padding: 20px 16px 96px; }
  .recent-list { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-item {
    border: 0; background: transparent; color: var(--muted-2);
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 0 4px; border-radius: 10px; font-size: 9.5px; font-weight: 650;
  }
  .bottom-item svg { width: 20px; height: 20px; }
  .bottom-item.active { color: var(--accent); background: var(--accent-soft); }
  .batch-bar { bottom: calc(74px + env(safe-area-inset-bottom)); }
}

@media (max-width: 720px) {
  .topbar { gap: 10px; }
  .topbar-right { gap: 2px; }
  .search-box { width: auto; flex: 1; min-width: 0; }
  .topbar-right .icon-btn { width: 34px; }
  .view { padding: 16px 12px 92px; }
  .page-head { align-items: start; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .page-head h1 { font-size: 24px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-card { padding: 13px 13px 12px; }
  .stat-card .value { font-size: 22px; }
  .recent-card { padding: 14px; }
  .recent-top { flex-direction: column; gap: 9px; }
  .recent-actions { width: 100%; }
  .recent-actions .btn { flex: 1; }
  .browse-toolbar { align-items: start; flex-direction: column; }
  .list-tools { width: 100%; justify-content: space-between; }
  .file-head { display: none; }
  .file-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 12px;
    align-items: start;
  }
  .file-main { align-items: start; }
  .file-type, .file-size { display: none; }
  .file-actions { align-self: center; }
  .file-sub { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .file-name { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; }
  .modal.wide { width: 100%; }
  .modal-head { padding: 16px 16px 12px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .diff-head { display: none; }
  .diff-row { grid-template-columns: 1fr; gap: 3px; padding: 11px 12px; }
  .diff-row .idx { display: none; }
  .diff-meta { flex-direction: row; align-items: center; justify-content: space-between; }
  .diff-reason { text-align: left; }
  .toast-root { right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 12px; max-width: none; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
}
