kakera / static /style.css
Cizencoder's picture
feat(ui): rebuild layout to ARCA-style 3-column app
115d373
Raw
History Blame Contribute Delete
15.7 kB
/* ============================================================
* Kakera (欠片) — clean gray + white app layout (ARCA-inspired)
* Three-column workspace: gallery / viewport / controls.
* Two view modes toggled in the top bar: Channels and Segmentation.
* ============================================================ */
:root {
/* Neutral ramp */
--bg: #FFFFFF;
--bg-1: #FAFAFA;
--bg-2: #F4F4F5;
--bg-3: #ECECEE;
/* Ink ramp */
--ink-900: #18181B;
--ink-700: #3F3F46;
--ink-500: #71717A;
--ink-400: #A1A1AA;
--ink-300: #D4D4D8;
/* Hairline */
--line: #E4E4E7;
--line-strong: #D4D4D8;
/* Accent — single, used for active state only */
--accent: #18181B; /* near-black for active/selected */
--accent-soft: #3F3F46;
--focus-ring: rgba(24, 24, 27, 0.18);
/* Type */
--font-sans: "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, sans-serif;
--font-jp: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
--font-mono: "JetBrains Mono", ui-monospace, monospace;
/* Scale */
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 24px;
--space-6: 32px;
--space-7: 48px;
/* Layout */
--topbar-h: 56px;
--bottom-h: 48px;
--side-w: 280px;
/* Radius / motion */
--radius-sm: 4px;
--radius-md: 6px;
--radius-lg: 10px;
--ease: cubic-bezier(0.2, 0.6, 0.2, 1);
--t-fast: 120ms;
--t-base: 180ms;
}
/* ------------------------------------------------------------ */
/* Reset / base */
/* ------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
background: var(--bg);
color: var(--ink-900);
height: 100%;
}
body {
font-family: var(--font-sans);
font-feature-settings: "ss01", "cv11";
font-size: 14px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
overflow: hidden;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
button {
font: inherit;
color: inherit;
border: 0;
background: transparent;
cursor: pointer;
}
fieldset { border: 0; padding: 0; margin: 0; }
legend { padding: 0; }
a { color: var(--ink-900); text-decoration: none; }
/* Utilities */
.jp { font-family: var(--font-jp); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-500); }
.small { font-size: 12px; }
.visually-hidden {
position: absolute;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}
[hidden] { display: none !important; }
.kbd {
display: inline-block;
padding: 2px 6px;
background: var(--bg-2);
border: 1px solid var(--line);
border-radius: var(--radius-sm);
font-family: var(--font-mono);
font-size: 0.85em;
color: var(--ink-700);
}
.link-like, .link-btn {
color: var(--ink-900);
text-decoration: underline;
text-underline-offset: 3px;
text-decoration-thickness: 1px;
background: transparent;
padding: 0;
border: 0;
font: inherit;
cursor: pointer;
transition: color var(--t-base) var(--ease);
}
.link-like:hover, .link-btn:hover { color: var(--ink-500); }
.noscript-banner {
background: var(--ink-900);
color: var(--bg);
padding: var(--space-3) var(--space-5);
text-align: center;
font-size: 0.95rem;
}
/* ------------------------------------------------------------ */
/* Top bar */
/* ------------------------------------------------------------ */
.topbar {
height: var(--topbar-h);
border-bottom: 1px solid var(--line);
background: var(--bg);
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
padding: 0 var(--space-5);
gap: var(--space-5);
position: sticky;
top: 0;
z-index: 10;
}
.brand {
display: flex;
align-items: center;
gap: var(--space-2);
font-size: 15px;
font-weight: 600;
letter-spacing: -0.01em;
}
.brand-mark {
font-size: 22px;
line-height: 1;
color: var(--ink-900);
}
.brand-name { color: var(--ink-900); }
.brand-jp { font-weight: 500; color: var(--ink-500); margin-left: 2px; font-size: 14px; }
.mode-switch {
display: inline-flex;
background: var(--bg-2);
border: 1px solid var(--line);
border-radius: var(--radius-md);
padding: 2px;
gap: 2px;
}
.mode-btn {
padding: 6px 14px;
font-size: 13px;
font-weight: 500;
color: var(--ink-500);
border-radius: 4px;
transition: background-color var(--t-base) var(--ease),
color var(--t-base) var(--ease);
}
.mode-btn:hover { color: var(--ink-900); }
.mode-btn.is-active {
background: var(--bg);
color: var(--ink-900);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.topbar-right {
display: flex;
justify-content: flex-end;
align-items: center;
gap: var(--space-4);
}
.loaded-label {
font-family: var(--font-mono);
font-size: 12px;
color: var(--ink-500);
}
/* ------------------------------------------------------------ */
/* Workspace */
/* ------------------------------------------------------------ */
.workspace {
display: grid;
grid-template-columns: var(--side-w) 1fr var(--side-w);
height: calc(100vh - var(--topbar-h) - var(--bottom-h));
overflow: hidden;
}
.sidebar {
background: var(--bg-1);
padding: var(--space-5);
overflow-y: auto;
display: flex;
flex-direction: column;
gap: var(--space-4);
}
.sidebar-left { border-right: 1px solid var(--line); }
.sidebar-right { border-left: 1px solid var(--line); }
.sidebar-title {
font-size: 11px;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--ink-500);
margin-bottom: var(--space-1);
}
.sidebar-subtitle {
font-size: 11px;
font-weight: 500;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--ink-400);
margin-top: var(--space-3);
}
/* ------------------------------------------------------------ */
/* Dropzone */
/* ------------------------------------------------------------ */
.dropzone {
background: var(--bg);
border: 1px dashed var(--line-strong);
border-radius: var(--radius-md);
padding: var(--space-5) var(--space-4);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--space-1);
min-height: 100px;
text-align: center;
cursor: pointer;
transition: border-color var(--t-base) var(--ease),
background-color var(--t-base) var(--ease);
outline: none;
}
.dropzone:hover,
.dropzone:focus-visible { border-color: var(--ink-700); }
.dropzone.drag-over {
border-color: var(--ink-900);
background: var(--bg-2);
}
.dropzone-primary { font-size: 13px; font-weight: 500; }
.dropzone-sub { font-size: 12px; color: var(--ink-500); }
.dropzone-file { margin-top: var(--space-2); color: var(--ink-900); word-break: break-all; }
/* ------------------------------------------------------------ */
/* Sample gallery */
/* ------------------------------------------------------------ */
.sample-gallery {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: var(--space-3);
}
.sample-card {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1);
padding: 4px;
border: 1px solid var(--line);
background: var(--bg);
border-radius: var(--radius-md);
cursor: pointer;
transition: border-color var(--t-base) var(--ease),
transform var(--t-fast) var(--ease);
}
.sample-card:hover {
border-color: var(--ink-700);
}
.sample-card[aria-pressed="true"] {
border-color: var(--ink-900);
box-shadow: 0 0 0 1px var(--ink-900);
}
.sample-card img {
width: 100%;
aspect-ratio: 1;
object-fit: cover;
border-radius: var(--radius-sm);
background: var(--bg-2);
}
.sample-card .sample-label {
font-size: 11px;
color: var(--ink-700);
text-align: center;
line-height: 1.25;
padding: 2px 0;
}
/* ------------------------------------------------------------ */
/* Viewport (main) */
/* ------------------------------------------------------------ */
.viewport {
background: var(--bg);
overflow: auto;
padding: var(--space-6);
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
}
.empty-state {
margin: auto;
text-align: center;
color: var(--ink-500);
display: flex;
flex-direction: column;
gap: var(--space-2);
}
.empty-headline {
font-size: 18px;
font-weight: 500;
color: var(--ink-700);
}
.empty-sub { font-size: 13px; }
/* Segmentation view */
.view-segmentation {
display: flex;
flex-direction: column;
gap: var(--space-5);
width: 100%;
max-width: 720px;
}
.seg-overlay { display: flex; justify-content: center; }
.seg-canvas-wrap {
background: var(--bg-2);
border: 1px solid var(--line);
border-radius: var(--radius-md);
width: 100%;
max-width: 560px;
aspect-ratio: 1;
}
.seg-canvas-wrap canvas {
width: 100%;
height: 100%;
border-radius: var(--radius-md);
display: block;
}
.seg-thumbs {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--space-4);
}
.seg-thumb {
margin: 0;
display: flex;
flex-direction: column;
gap: var(--space-2);
}
.seg-thumb img {
width: 100%;
aspect-ratio: 1;
object-fit: cover;
border-radius: var(--radius-sm);
background: var(--bg-2);
border: 1px solid var(--line);
}
.seg-thumb figcaption {
font-size: 11px;
color: var(--ink-500);
letter-spacing: 0.04em;
text-transform: uppercase;
text-align: center;
}
/* Channels view (9-up) */
.view-channels { width: 100%; max-width: 820px; }
.tensor-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: var(--space-4);
}
.channel-tile {
display: flex;
flex-direction: column;
gap: var(--space-2);
}
.channel-tile img {
width: 100%;
aspect-ratio: 1;
object-fit: cover;
border-radius: var(--radius-sm);
background: var(--bg-2);
border: 1px solid var(--line);
transition: opacity var(--t-base) var(--ease);
}
.channel-tile.is-disabled img { opacity: 0.35; }
.channel-tile .channel-name {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: var(--space-2);
font-size: 12px;
color: var(--ink-700);
}
.channel-tile .channel-idx {
font-family: var(--font-mono);
color: var(--ink-400);
font-size: 10px;
}
.channel-tile .disabled-tag {
font-size: 10px;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--ink-900);
font-weight: 500;
}
/* ------------------------------------------------------------ */
/* Right sidebar controls */
/* ------------------------------------------------------------ */
.control-group {
border-top: 1px solid var(--line);
padding-top: var(--space-4);
}
.control-group:first-of-type {
border-top: 0;
padding-top: 0;
}
.control-group legend {
font-size: 11px;
font-weight: 600;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--ink-500);
margin-bottom: var(--space-3);
}
.control-cluster-label {
font-size: 10px;
color: var(--ink-400);
letter-spacing: 0.06em;
text-transform: uppercase;
margin: var(--space-3) 0 var(--space-2);
}
.control-cluster-label:first-child { margin-top: 0; }
.toggle-row {
display: flex;
gap: var(--space-3);
}
.toggle-list {
display: flex;
flex-direction: column;
gap: var(--space-2);
}
.toggle {
display: inline-flex;
align-items: center;
gap: var(--space-2);
font-size: 13px;
cursor: pointer;
user-select: none;
color: var(--ink-900);
}
.toggle input[type="checkbox"] {
width: 14px;
height: 14px;
margin: 0;
accent-color: var(--ink-900);
cursor: pointer;
}
.toggle.inline { display: flex; }
.ablation-helper {
display: block;
margin-top: var(--space-3);
padding: var(--space-2) var(--space-3);
background: var(--bg-2);
border-left: 2px solid var(--ink-700);
color: var(--ink-700);
font-size: 12px;
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.control-actions {
margin-top: var(--space-3);
display: flex;
justify-content: flex-end;
}
.slider-row {
display: flex;
align-items: center;
gap: var(--space-3);
}
.slider-row input[type="range"] {
flex: 1;
accent-color: var(--ink-900);
}
/* Run button */
.run-btn {
margin-top: var(--space-2);
width: 100%;
padding: 10px 16px;
background: var(--ink-900);
color: var(--bg);
border-radius: var(--radius-md);
font-size: 13px;
font-weight: 500;
letter-spacing: 0.01em;
transition: background-color var(--t-base) var(--ease),
transform var(--t-fast) var(--ease);
}
.run-btn:hover { background: var(--accent-soft); }
.run-btn:active { transform: translateY(1px); }
.run-btn:disabled { background: var(--ink-300); cursor: not-allowed; }
.run-btn.is-loading::after {
content: "";
display: inline-block;
width: 10px;
height: 10px;
margin-left: var(--space-2);
border-radius: 50%;
border: 2px solid var(--bg);
border-right-color: transparent;
animation: spin 600ms linear infinite;
vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-banner {
margin-top: var(--space-2);
font-size: 12px;
color: var(--ink-900);
background: var(--bg-2);
border-left: 2px solid var(--ink-900);
padding: var(--space-2) var(--space-3);
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
/* ------------------------------------------------------------ */
/* Bottom strip */
/* ------------------------------------------------------------ */
.bottom-strip {
height: var(--bottom-h);
border-top: 1px solid var(--line);
background: var(--bg-1);
display: flex;
align-items: center;
gap: var(--space-6);
padding: 0 var(--space-5);
}
.stat {
display: flex;
align-items: baseline;
gap: var(--space-2);
}
.stat-label {
font-size: 10px;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--ink-500);
}
.stat-value {
font-size: 13px;
color: var(--ink-900);
font-weight: 500;
font-feature-settings: "tnum";
}
.stat.right-aligned {
margin-left: auto;
}
.stat.right-aligned .stat-label {
text-transform: none;
letter-spacing: 0;
font-size: 11px;
}
/* ------------------------------------------------------------ */
/* Responsive */
/* ------------------------------------------------------------ */
@media (max-width: 1100px) {
:root { --side-w: 240px; }
}
@media (max-width: 900px) {
body { overflow: auto; }
.workspace {
grid-template-columns: 1fr;
height: auto;
}
.sidebar {
overflow: visible;
border: 0;
border-bottom: 1px solid var(--line);
}
.sidebar-right { border-bottom: 0; }
.viewport { padding: var(--space-5); }
.seg-thumbs { grid-template-columns: repeat(3, 1fr); }
.tensor-grid { grid-template-columns: repeat(2, 1fr); }
.bottom-strip {
flex-wrap: wrap;
height: auto;
padding: var(--space-3) var(--space-5);
gap: var(--space-4);
}
}
@media (max-width: 560px) {
.topbar {
grid-template-columns: 1fr auto;
gap: var(--space-3);
}
.mode-switch { grid-column: 1 / -1; order: 2; justify-self: stretch; }
.topbar-right { display: none; }
.seg-thumbs { grid-template-columns: 1fr; }
.tensor-grid { grid-template-columns: 1fr; }
}