:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e5eaf2;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: #eff6ff;
  --danger: #dc2626;
  --ok: #16a34a;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
}
* { box-sizing: border-box; }
.is-hidden { display: none !important; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, .file-btn, .btn-primary {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
}
button:hover, .file-btn:hover { background: var(--accent-2); }
button.ghost, .ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
}
button.ghost:hover { background: #f8fafc; }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}
input:focus, select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.muted { color: var(--muted); }

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 420px at 15% 0%, #dbeafe 0%, transparent 55%),
    linear-gradient(180deg, #eef2ff 0%, #f8fafc 45%, #f4f6fa 100%);
}
.login-card {
  width: min(380px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0; font-size: 22px; color: var(--text); }
.login-card label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.login-err { color: var(--danger); margin: 0; }

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.brand { font-weight: 700; letter-spacing: .02em; color: #0f172a; }
.topnav { display: flex; gap: 8px; flex: 1; }
.topnav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
}
.topnav a.active, .topnav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.topnav a.disabled { opacity: .45; pointer-events: none; }
.topnav a span {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
}
.top-user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }

.layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 56px); }
.sidebar {
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-title { font-size: 12px; color: var(--muted); margin-top: 8px; }
.folder-tree { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.folder-tree li {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
}
.folder-tree li:hover { background: #f8fafc; }
.folder-tree li.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.folder-tree .cnt { color: var(--muted); font-size: 12px; }
.storage-hint { font-size: 12px; margin-top: auto; }

.main { padding: 16px 20px 32px; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}
.filters, .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.file-btn { display: inline-flex; align-items: center; }

.subfolders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.subfolders .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.subfolders .card:hover { border-color: #bfdbfe; background: #f8fbff; }
.subfolders .card strong { display: block; margin-bottom: 6px; }
.batch-bar {
  display: flex; gap: 8px; align-items: center;
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 10px; padding: 8px 12px; margin-bottom: 12px;
}

.asset-list.list {
  display: grid; gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
.asset-row {
  display: grid;
  grid-template-columns: 36px 72px 1fr 90px 120px 120px 100px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.asset-row.head { background: #f8fafc; color: var(--muted); font-size: 12px; }
.asset-row:last-child { border-bottom: 0; }
.thumb {
  width: 56px; height: 56px; object-fit: cover;
  border-radius: 8px; background: #f1f5f9; border: 1px solid var(--line);
}
.name-cell { min-width: 0; }
.name-cell .title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name-cell .meta { color: var(--muted); font-size: 12px; }

.asset-list.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.grid-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.grid-card .preview {
  aspect-ratio: 1;
  background: #f8fafc;
  display: grid;
  place-items: center;
}
.grid-card img, .grid-card video { width: 100%; height: 100%; object-fit: cover; }
.grid-card .body { padding: 10px; }
.grid-card .title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pager {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  margin-top: 14px; color: var(--muted);
}
.placeholder { padding: 48px 24px; }
.empty {
  padding: 48px 16px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 12px; background: #fff;
}
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #eff6ff; color: #1d4ed8; font-size: 12px; margin-right: 4px;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: 280px; }
  .asset-row { grid-template-columns: 28px 56px 1fr; }
  .asset-row .hide-sm { display: none; }
}
