:root {
  --bg: #eef3fb;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --line: #dbe5f0;
  --text: #152033;
  --muted: #64748b;
  --blue: #2563eb;
  --teal: #14b8a6;
  --amber: #f59e0b;
  --red: #e11d48;
  --shadow: 0 28px 70px rgba(37, 99, 235, 0.10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(37, 99, 235, 0.14), transparent 18%),
    radial-gradient(circle at 88% 16%, rgba(20, 184, 166, 0.16), transparent 18%),
    linear-gradient(180deg, #f8fbff, #ebf1f8);
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.sidebar,
.content-card,
.toolbar,
.stats-panel {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 18px;
  border-radius: 28px;
}

.sidebar.compact {
  align-self: start;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  font-size: 24px;
  font-weight: 800;
}

.brand h1, .section-title { margin: 0; }
.brand h1 { font-size: 22px; }
.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.side-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.section-title {
  margin-bottom: 12px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connect-form,
.connect-form label {
  display: grid;
  gap: 8px;
}

.connect-form label { margin-bottom: 12px; }
.connect-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: rgba(248, 250, 252, 0.95);
  font-size: 14px;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button {
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

button:hover { transform: translateY(-1px); }

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  min-height: 42px;
  padding: 0 14px;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #3b82f6);
}

.secondary-btn {
  color: #083344;
  background: linear-gradient(135deg, #99f6e4, #5eead4);
}

.ghost-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
}

.danger-btn {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, var(--red));
}

.danger-btn.soft {
  color: #991b1b;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.file-row {
  display: grid;
  align-items: center;
  gap: 12px;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 18px;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border-radius: 24px;
}

.stat-card {
  padding: 14px 16px;
  border-radius: 18px;
  color: #fff;
}

.stat-card span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  opacity: 0.88;
}

.stat-card strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.stat-card.cpu { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.stat-card.ram { background: linear-gradient(135deg, #0f766e, #2dd4bf); }
.stat-card.disk { background: linear-gradient(135deg, #b45309, #f59e0b); }

.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 24px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.crumb {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  cursor: pointer;
}

.path-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.content-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 28px;
}

.list-head,
.file-row {
  grid-template-columns: 56px minmax(220px, 2.2fr) 0.9fr 0.8fr 1.2fr;
}

.list-head {
  display: grid;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.file-list {
  overflow: auto;
}

.file-row {
  padding: 14px 18px;
  border-bottom: 1px solid #edf2f7;
  background: transparent;
}

.file-row:hover {
  background: rgba(37, 99, 235, 0.05);
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.row-check {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.10);
  color: var(--blue);
  font-size: 18px;
}

.file-row.dir {
  cursor: pointer;
}

.name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted { color: var(--muted); }

.empty-copy {
  color: var(--muted);
  line-height: 1.7;
}

.info-strip {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.05);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.info-strip strong {
  color: var(--text);
}

.empty-copy.big {
  padding: 48px 24px;
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  padding: 12px 16px;
  border-radius: 16px;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 12px;
  }

  .stats-panel,
  .inline-grid,
  .toolbar,
  .toolbar-actions,
  .list-head,
  .file-row {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar-actions {
    justify-content: stretch;
  }

  .list-head { display: none; }

  .file-row {
    gap: 6px;
  }
}
