示例工程 42-startup-and-memory

42-startup-and-memory/app/src/styles/app.css

css · 5.3 KB

.app {
  min-height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

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

.logo {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #0f172a;
  color: #ffffff;
  font-size: 14px;
}

.brand h1 {
  margin: 0;
  font-size: 15px;
}

.header-side {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pill {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 0.97fr);
  gap: 12px;
  padding: 14px 20px 20px;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.pad {
  padding: 11px 13px;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.card h2 {
  margin: 0;
  font-size: 12.5px;
}

.small {
  font-size: 10.5px;
}

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

.btn {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 10.5px;
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-fg);
}

.btn.mini {
  height: 22px;
  padding: 0 7px;
  font-size: 9.5px;
}

.btn:hover {
  border-color: var(--primary);
}

.actions {
  display: flex;
  gap: 5px;
}

.actions.wrap {
  flex-wrap: wrap;
  margin-top: 8px;
}

.total {
  margin-bottom: 7px;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
}

.stages {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 62px;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 9.8px;
}

.stage:last-child {
  border-bottom: none;
}

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

.bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #93c5fd, #2563eb);
}

.stage b {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
}

.lazy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  background: var(--panel);
  font-size: 10px;
}

.lazy-row span {
  color: var(--muted);
}

.lazy-row b {
  font-family: var(--font-mono);
  font-weight: 500;
}

.lazy-row .btn {
  margin-left: auto;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}

.metrics div {
  display: flex;
  flex-direction: column;
}

.metrics span {
  color: var(--muted);
  font-size: 9px;
}

.metrics b {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}

.chart {
  margin-top: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--panel);
}

.spark {
  display: block;
  width: 100%;
  height: 84px;
}

.heap-file {
  min-height: 13px;
  margin-top: 4px;
}

.process-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5px;
}

.process-table th,
.process-table td {
  padding: 4px 5px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.process-table th:first-child,
.process-table td:first-child {
  text-align: left;
}

.process-table th {
  color: var(--muted);
  font-weight: 600;
}

.throttle-facts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.throttle-facts li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
}

.throttle-facts li:last-child {
  border-bottom: none;
}

.throttle-facts span {
  color: var(--muted);
}

.throttle-facts b {
  font-family: var(--font-mono);
  font-weight: 500;
}

.hint {
  margin: 7px 0 0;
  line-height: 1.6;
}

.bullets {
  margin: 0;
  padding-left: 16px;
  font-size: 10px;
  line-height: 1.7;
}

.activity {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 150px;
  overflow: auto;
}

.event-row {
  display: grid;
  grid-template-columns: 56px 60px minmax(0, 1fr);
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
  font-size: 9.5px;
}

.event-row:last-child {
  border-bottom: none;
}

.event-row .kind {
  color: var(--primary);
}

body[data-shot="startup"] .startup-card {
  border-color: #bfdbfe;
}

body[data-shot="memory"] .memory-card {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body[data-shot="throttle"] .throttle-card {
  border-color: #fcd34d;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

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