feat(phase-4): visual polish — font stack, shadow system, transitions, micro-interactions

Phase 4: Visual Polish

4.1 Font Stack Upgrade:
- Add --font-display token for headings
- Replace all hardcoded font-family: monospace with var(--font-mono)
- Replace hardcoded 'Segoe UI' stack with var(--font-body)

4.2 Shadow Elevation System:
- Add --shadow-2xl, --shadow-card/dropdown/modal/toast/header/dark-lg tokens
- Replace hardcoded shadows in header, menu, banner, shared, recipe-modal,
  progress-panel, import-modal, alphabet-bar with semantic tokens
- Add dark theme shadow overrides with increased opacity

4.3 Transitions & Micro-interactions:
- Replace transition: all with specified properties (performance)
- Use --transition-fast/base/slow tokens instead of hardcoded 0.2s/0.3s
- Add :active scale feedback to modal buttons
- Enhance card hover with box-shadow + border-color lift

4.4 Dark Theme Refinement:
- Elevated shadow opacity for dark theme visibility

4.5 Density:
- Standardize container padding with --space-2 token

21 files changed
This commit is contained in:
Will Miao
2026-06-09 14:07:36 +08:00
parent 826f06255a
commit 5797ce9408
21 changed files with 84 additions and 49 deletions

View File

@@ -107,7 +107,7 @@
background: var(--lora-accent);
color: white;
transform: scale(1.1);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
box-shadow: var(--shadow-md);
}
.letter-chip.active {

View File

@@ -102,7 +102,7 @@
color: white;
border-color: var(--lora-accent);
transform: translateY(-1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
box-shadow: var(--shadow-md);
}
/* Tertiary Action Button */

View File

@@ -19,7 +19,7 @@
border: 1px solid var(--lora-border);
border-radius: var(--border-radius-base);
backdrop-filter: blur(16px);
transition: transform 160ms ease-out;
transition: transform var(--transition-fast) ease-out, box-shadow var(--transition-fast) ease-out, border-color var(--transition-fast) ease-out;
aspect-ratio: 896/1152; /* Preserve aspect ratio */
max-width: 260px; /* Base size */
min-width: 200px; /* Prevent cards from becoming too narrow */
@@ -33,7 +33,8 @@
.model-card:hover {
transform: translateY(-2px);
background: oklch(100% 0 0 / 0.6);
box-shadow: var(--shadow-md);
border-color: var(--lora-accent);
}
.model-card:focus-visible {

View File

@@ -7,7 +7,7 @@
height: 48px;
/* Reduced height */
width: 100%;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
box-shadow: var(--shadow-md);
/* Slightly stronger shadow */
}
@@ -134,14 +134,14 @@
background: var(--input-bg, var(--card-bg));
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm, 6px);
transition: all 0.2s ease;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
transition: border-color var(--transition-base), box-shadow var(--transition-base);
box-shadow: var(--shadow-header);
overflow: hidden;
}
.header-search .search-container:focus-within {
border-color: var(--lora-accent);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--lora-accent);
box-shadow: var(--shadow-header), 0 0 0 1px var(--lora-accent);
}
.header-search input {
@@ -183,7 +183,7 @@
color: var(--text-muted);
cursor: pointer;
border-radius: var(--border-radius-xs, 4px);
transition: all 0.2s ease;
transition: background-color var(--transition-base), color var(--transition-base);
}
.header-search .search-options-toggle {
@@ -271,7 +271,7 @@
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
transition: background-color var(--transition-base), color var(--transition-base), transform var(--transition-base);
position: relative;
}
@@ -343,7 +343,7 @@
background-color: var(--lora-error);
border-radius: 50%;
border: 2px solid var(--card-bg);
transition: all 0.2s ease;
transition: opacity var(--transition-base);
pointer-events: none;
opacity: 0;
}
@@ -364,7 +364,7 @@
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
transition: background-color var(--transition-base), color var(--transition-base);
flex-shrink: 0;
}
@@ -392,7 +392,7 @@
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm, 6px);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
box-shadow: var(--shadow-toast);
padding: 0.5rem;
min-width: 160px;
z-index: var(--z-dropdown, 200);
@@ -412,7 +412,7 @@
border-radius: var(--border-radius-xs, 4px);
color: var(--text-color);
cursor: pointer;
transition: all 0.2s ease;
transition: background-color var(--transition-base), color var(--transition-base);
font-size: 0.9rem;
white-space: nowrap;
}

View File

@@ -757,7 +757,7 @@
position: relative;
border-radius: var(--border-radius-sm);
overflow: hidden;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
box-shadow: var(--shadow-md);
transition: transform 0.2s ease;
}

View File

@@ -62,7 +62,7 @@
}
.model-description-content code {
font-family: monospace;
font-family: var(--font-mono);
font-size: 0.9em;
background: rgba(0, 0, 0, 0.05);
padding: 0.1em 0.3em;

View File

@@ -203,7 +203,7 @@
}
.file-path {
font-family: monospace;
font-family: var(--font-mono);
font-size: 0.9em;
}
@@ -291,7 +291,7 @@
opacity: 0;
visibility: hidden;
transform: translateY(10px);
transition: all 0.3s ease;
transition: opacity var(--transition-slow), visibility var(--transition-slow), transform var(--transition-slow);
z-index: 10;
}
@@ -347,7 +347,7 @@
cursor: pointer;
padding: 2px 5px;
border-radius: var(--border-radius-xs);
transition: all 0.2s ease;
transition: opacity var(--transition-base), background-color var(--transition-base);
margin-left: var(--space-1);
}
@@ -430,7 +430,7 @@
}
.size-wrapper span {
font-family: monospace;
font-family: var(--font-mono);
font-size: 0.9em;
opacity: 0.9;
}

View File

@@ -297,7 +297,7 @@
.metadata-prompt {
color: var(--text-color);
font-family: monospace;
font-family: var(--font-mono);
font-size: 0.85em;
white-space: pre-wrap;
}

View File

@@ -5,7 +5,7 @@
border-radius: var(--border-radius-xs);
padding: 4px 0;
min-width: 180px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
box-shadow: var(--shadow-dropdown);
z-index: 1000;
display: none;
backdrop-filter: blur(10px);
@@ -77,7 +77,7 @@
border-radius: var(--border-radius-xs);
padding: 0;
min-width: 200px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
box-shadow: var(--shadow-dropdown);
z-index: 1001;
backdrop-filter: blur(10px);
}
@@ -110,7 +110,7 @@
border: 1px solid var(--border-color);
border-radius: var(--border-radius-base);
padding: 16px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
box-shadow: var(--shadow-modal);
z-index: var(--z-modal);
width: 300px;
display: none;
@@ -188,7 +188,7 @@
max-width: 350px;
max-height: 400px;
overflow-y: auto;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
box-shadow: var(--shadow-dropdown);
z-index: var(--z-overlay);
display: none;
backdrop-filter: blur(10px);

View File

@@ -75,7 +75,14 @@ body.modal-open {
font-weight: 500;
font-size: 0.95em;
min-width: 100px;
transition: background-color 0.2s, opacity 0.2s;
transition: background-color var(--transition-base), opacity var(--transition-base), transform var(--transition-fast);
}
.cancel-btn:active,
.delete-btn:active,
.exclude-btn:active,
.confirm-btn:active {
transform: scale(0.98);
}
.cancel-btn {
@@ -128,7 +135,7 @@ body.modal-open {
font-size: 1.5em;
cursor: pointer;
opacity: 0.7;
transition: opacity 0.2s;
transition: opacity var(--transition-base);
z-index: 10;
}

View File

@@ -51,7 +51,7 @@
background: var(--lora-surface);
padding: 2px 6px;
border-radius: 3px;
font-family: monospace;
font-family: var(--font-mono);
border: 1px solid var(--lora-border);
}

View File

@@ -404,7 +404,7 @@
.path-display {
padding: var(--space-1);
color: var(--text-color);
font-family: monospace;
font-family: var(--font-mono);
font-size: 0.9em;
line-height: 1.4;
white-space: pre-wrap;
@@ -678,7 +678,7 @@
border-radius: var(--border-radius-xs);
background: var(--bg-color);
color: var(--text-color);
font-family: monospace;
font-family: var(--font-mono);
font-size: 0.9em;
resize: vertical;
line-height: 1.5;

View File

@@ -582,7 +582,7 @@
}
.priority-tags-example code {
font-family: var(--code-font, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace);
font-family: var(--font-mono);
background-color: rgba(var(--lora-accent-rgb, 79, 70, 229), 0.12);
padding: 2px 6px;
border-radius: var(--border-radius-xs);
@@ -932,7 +932,7 @@ input:checked + .toggle-slider:before {
border-radius: var(--border-radius-xs);
padding: var(--space-1);
margin-top: 8px;
font-family: monospace;
font-family: var(--font-mono);
font-size: 0.9em;
color: var(--lora-accent);
display: none;
@@ -1146,7 +1146,7 @@ input:checked + .toggle-slider:before {
color: white;
padding: 2px 6px;
border-radius: 3px;
font-family: monospace;
font-family: var(--font-mono);
font-size: 1em;
font-weight: 500;
}
@@ -1175,7 +1175,7 @@ input:checked + .toggle-slider:before {
background-color: var(--lora-surface);
color: var(--text-color);
font-size: 0.95em;
font-family: monospace;
font-family: var(--font-mono);
height: 24px;
transition: border-color 0.2s;
}
@@ -1277,7 +1277,7 @@ input:checked + .toggle-slider:before {
border-radius: 6px;
font-size: 14px;
font-weight: normal;
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
font-family: var(--font-body);
white-space: normal;
max-width: 220px;
width: max-content;

View File

@@ -123,7 +123,7 @@
}
.version-number {
font-family: monospace;
font-family: var(--font-mono);
font-weight: 600;
}
@@ -136,7 +136,7 @@
font-size: 0.85em;
opacity: 0.7;
margin-top: 4px;
font-family: monospace;
font-family: var(--font-mono);
color: var(--text-color);
}
@@ -332,7 +332,7 @@
background: rgba(0, 0, 0, 0.05);
padding: 2px 4px;
border-radius: 3px;
font-family: monospace;
font-family: var(--font-mono);
font-size: 0.9em;
}

View File

@@ -7,7 +7,7 @@
background: var(--lora-surface);
border: 1px solid var(--lora-border);
border-radius: var(--border-radius-sm);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
box-shadow: var(--shadow-toast);
z-index: calc(var(--z-modal) - 1);
transition: transform 0.3s ease, opacity 0.3s ease;
opacity: 0;

View File

@@ -176,7 +176,7 @@
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
box-shadow: var(--shadow-dropdown);
padding: 10px 14px;
max-width: 400px;
z-index: 10;
@@ -797,7 +797,7 @@
.recipe-lora-item:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
box-shadow: var(--shadow-header);
border-color: var(--lora-accent);
}
@@ -995,7 +995,7 @@
padding: 8px 12px;
border-radius: var(--border-radius-xs);
border: 1px solid var(--border-color);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
box-shadow: var(--shadow-header);
z-index: var(--z-overlay);
width: max-content;
max-width: 200px;
@@ -1049,7 +1049,7 @@
background: rgba(0, 0, 0, 0.1);
padding: 2px 4px;
border-radius: 3px;
font-family: monospace;
font-family: var(--font-mono);
font-size: 0.9em;
}
@@ -1251,7 +1251,7 @@
padding: 8px 12px;
border-radius: var(--border-radius-xs);
border: 1px solid var(--border-color);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
box-shadow: var(--shadow-header);
z-index: var(--z-overlay);
width: max-content;
max-width: 200px;

View File

@@ -71,7 +71,7 @@
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
flex-shrink: 0;
}
@@ -103,7 +103,7 @@
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.2s ease;
transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
flex-shrink: 0;
position: relative;
}

View File

@@ -78,7 +78,7 @@
color: var(--text-color);
white-space: normal;
word-break: break-all;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
box-shadow: var(--shadow-header);
z-index: 100; /* Higher z-index to ensure it's above other elements */
min-width: 300px;
max-width: 300px;
@@ -107,7 +107,7 @@
color: var(--text-color);
white-space: normal;
word-break: break-all;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
box-shadow: var(--shadow-header);
z-index: 100; /* Higher z-index to ensure it's above other elements */
min-width: 200px;
max-width: 300px;

View File

@@ -10,7 +10,7 @@
.container {
max-width: 1400px;
margin: 0 auto;
padding: 0 15px;
padding: 0 var(--space-2);
position: relative;
z-index: var(--z-base);
}

View File

@@ -12,9 +12,17 @@
--shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 3px 5px rgba(0, 0, 0, 0.08);
--shadow-xl: 0 4px 16px rgba(0, 0, 0, 0.15);
--shadow-2xl: 0 8px 32px rgba(0, 0, 0, 0.12);
--shadow-focus: 0 0 0 1px var(--color-accent);
--shadow-glow: 0 2px 6px var(--color-info-glow);
--shadow-card: var(--shadow-sm);
--shadow-dropdown: var(--shadow-md);
--shadow-modal: var(--shadow-lg);
--shadow-toast: var(--shadow-xl);
--shadow-header: 0 2px 8px rgba(0, 0, 0, 0.08);
--shadow-dark-lg: 0 4px 24px rgba(0, 0, 0, 0.4);
--transition-fast: 150ms ease;
--transition-base: 200ms ease;
--transition-slow: 300ms ease;
@@ -23,3 +31,19 @@
--border-width-thin: 1px;
--border-width-thick: 2px;
}
[data-theme="dark"] {
--shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
--shadow-md: 0 2px 4px rgba(0, 0, 0, 0.35);
--shadow-lg: 0 3px 5px rgba(0, 0, 0, 0.3);
--shadow-xl: 0 4px 16px rgba(0, 0, 0, 0.45);
--shadow-2xl: 0 8px 32px rgba(0, 0, 0, 0.35);
--shadow-card: var(--shadow-sm);
--shadow-dropdown: var(--shadow-md);
--shadow-modal: var(--shadow-lg);
--shadow-toast: var(--shadow-xl);
--shadow-header: 0 2px 8px rgba(0, 0, 0, 0.3);
--shadow-dark-lg: 0 4px 24px rgba(0, 0, 0, 0.6);
}

View File

@@ -1,4 +1,5 @@
:root {
--font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
--font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
--font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;
@@ -8,6 +9,8 @@
--text-md: 0.95rem;
--text-lg: 1.1rem;
--text-xl: 1.25rem;
--text-2xl: 1.5rem;
--text-3xl: 2rem;
--leading-tight: 1.2;
--leading-normal: 1.4;