Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

6.1 KB
Raw Blame
/* cindy-updater UI — strictly grayscale per docs/design-rules/cindy-design-system.md (Ollama-inspired).
   No chromatic colors. No shadows. No gradients.
   Border radius: 12px containers OR 9999px interactive — nothing in between. */

:root {
  color-scheme: light dark;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;

  /* Light mode palette — matches .pen frames Light Mode - Updater - *.
     Surface (#f8f8f6) is the warm off-white from docs/design-rules/cindy-design-system.md §2; we deliberately
     avoid pure #ffffff because (a) the project memory bans #ffffff backgrounds
     and (b) Surface is what carries Ollama's warmth — pure white reads cold. */
  --card-bg: #f8f8f6;
  --card-border: #d7d7d4;
  --text-primary: #262626;
  --text-secondary: #525252;
  --text-button: #404040;
  --chip-bg: #e5e5e5;
  --chip-text: #262626;
  --btn-bg: #ffffff;
  /* btn-bg uses Card #ffffff intentionally even though the no-pure-white
     memory rule disfavors it — buttons need the one-step lift off the
     Surface bg to read as buttons, mirroring xdt-maker's existing White Pill
     pattern in renderer/styles/globals.css (login-card-bg, etc.). */
  --btn-border: #d4d4d4;
  --btn-text: #404040;
  --progress-track: #d7d7d4;
  --progress-fill: #525252;

  /* Failed-state narrow exception (docs/design-rules/cindy-design-system.md §2 Toast/ConfirmDialog scope) */
  --chip-failed-bg: #fee2e2;
  --chip-failed-border: #ef4444;
  --chip-failed-text: #b91c1c;
  --error-bar-bg: #fef2f2;
  --error-bar-border: #fecaca;
  --error-bar-text: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark Surface — matches xdt-maker main content area
       (renderer/styles/globals.css `--content-area: 60 2% 12%`). */
    --card-bg: #1f1f1e;
    --card-border: #3c3c3a;
    --text-primary: #d4d4d4;
    --text-secondary: #a3a3a3;
    --text-button: #d4d4d4;
    --chip-bg: #3c3c3a;
    --chip-text: #d4d4d4;
    --btn-bg: #2c2c2a;
    --btn-border: #3c3c3a;
    --btn-text: #d4d4d4;
    --progress-track: #3c3c3a;
    --progress-fill: #a3a3a3;

    --chip-failed-bg: #3a1a1a;
    --chip-failed-border: #ef4444;
    --chip-failed-text: #fca5a5;
    --error-bar-bg: #2a1414;
    --error-bar-border: #7f1d1d;
    --error-bar-text: #fca5a5;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  /* Window is opaque (tauri.conf.json `transparent: false`). Both html and
     body match card-bg so any sub-pixel rendering gap stays the same color
     instead of revealing desktop or default OS backdrop. Win11 auto-rounds
     the outer corners of decoration-less windows for us — no CSS radius
     needed (and adding one would re-create the "transparent corner leak"
     this fix is meant to undo). */
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 14px;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

body {
  display: flex;
}

.card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: none;
  outline: none;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: default;
}

.title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.chip.phase-failed {
  background: var(--chip-failed-bg);
  color: var(--chip-failed-text);
  border: 1px solid var(--chip-failed-border);
  /* The 1px border eats 2px of inner space; trim padding to keep the
     vertical rhythm identical to the borderless chips. */
  padding: 3px 11px;
}

.message {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-secondary);
  /* Use only as much vertical space as one line — the spacer below absorbs
     the rest so footer stays pinned. */
  min-height: 20px;
}

.spacer {
  flex: 1;
}

.progress-track {
  height: 6px;
  border-radius: 9999px;
  background: var(--progress-track);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--progress-fill);
  width: 0%;
  transition: width 200ms ease;
}
/* Snap instantly when moving backwards (e.g. 100% extract → 0% replace).
   JS toggles this class for one frame around backward width updates. */
.progress-fill.no-transition {
  transition: none;
}

/* Indeterminate phases (waiting / launching): a 30%-wide bar slides L→R
   and back, matching the .pen "30% fill biased left" sketch but animated
   so the user sees motion. */
.progress-fill[data-state="indeterminate"] {
  width: 30%;
  animation: indeterminate-slide 1.4s linear infinite;
  transition: none;
}

@keyframes indeterminate-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(370%);
  }
}

.error-bar {
  padding: 8px 12px;
  background: var(--error-bar-bg);
  border: 1px solid var(--error-bar-border);
  border-radius: 12px;
}

.error-text {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--error-bar-text);
  word-break: break-all;
}

.footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 24px;
  border-radius: 9999px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--btn-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease;
}
.btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--btn-bg) 92%, var(--text-primary));
}
.btn:active:not(:disabled) {
  background: color-mix(
    in srgb,
    color-mix(in srgb, var(--btn-bg) 92%, var(--text-primary)) 90%,
    var(--text-primary)
  );
}
.btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.5);
  outline-offset: 1px;
}

.btn:disabled {
  cursor: default;
  opacity: 0.6;
}