:root, [data-theme="dark"] {
--bg: #1C1917;
--bg-card: #292524;
--border: #44403C;
--text: #FAFAF9;
--text-muted: #A8A29E;
--text-secondary: #D6D3D1;
--accent: #CA8A04;
--accent-hover: #EAB308;
--result-bg: rgba(202, 138, 4, 0.05);
--error-bg: #451A1A;
--error-border: #7F1D1D;
--error-text: #FCA5A5;
--toast-bg: #292524;
--toast-border: #44403C;
--toggle-bg: rgba(255, 255, 255, 0.06);
--toggle-hover: rgba(255, 255, 255, 0.12);
--toggle-active: rgba(202, 138, 4, 0.2);
}
[data-theme="warm"] {
--bg: #1A1412;
--bg-card: #2A1F1A;
--border: #4A3828;
--text: #F5E6D3;
--text-muted: #B89A7A;
--text-secondary: #D4B896;
--accent: #D4943A;
--accent-hover: #E8A94E;
--result-bg: rgba(212, 148, 58, 0.08);
--error-bg: #3A1818;
--error-border: #6B2020;
--error-text: #F0A0A0;
--toast-bg: #2A1F1A;
--toast-border: #4A3828;
--toggle-bg: rgba(255, 230, 200, 0.06);
--toggle-hover: rgba(255, 230, 200, 0.12);
--toggle-active: rgba(212, 148, 58, 0.2);
}
[data-theme="system"] {
--bg: #1C1917;
--bg-card: #292524;
--border: #44403C;
--text: #FAFAF9;
--text-muted: #A8A29E;
--text-secondary: #D6D3D1;
--accent: #CA8A04;
--accent-hover: #EAB308;
--result-bg: rgba(202, 138, 4, 0.05);
--error-bg: #451A1A;
--error-border: #7F1D1D;
--error-text: #FCA5A5;
--toast-bg: #292524;
--toast-border: #44403C;
--toggle-bg: rgba(255, 255, 255, 0.06);
--toggle-hover: rgba(255, 255, 255, 0.12);
--toggle-active: rgba(202, 138, 4, 0.2);
}
@media (prefers-color-scheme: light) {
[data-theme="system"] {
--bg: #FAFAF9;
--bg-card: #FFFFFF;
--border: #D6D3D1;
--text: #1C1917;
--text-muted: #78716C;
--text-secondary: #44403C;
--accent: #B45309;
--accent-hover: #D97706;
--result-bg: rgba(180, 83, 9, 0.06);
--error-bg: #FEF2F2;
--error-border: #FECACA;
--error-text: #991B1B;
--toast-bg: #FFFFFF;
--toast-border: #D6D3D1;
--toggle-bg: rgba(0, 0, 0, 0.04);
--toggle-hover: rgba(0, 0, 0, 0.08);
--toggle-active: rgba(180, 83, 9, 0.12);
}
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
scroll-behavior: smooth;
}
body {
background: var(--bg);
color: var(--text);
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
line-height: 1.6;
font-size: 1rem;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
transition: background 0.3s, color 0.3s;
}
#board {
max-width: 720px;
margin: 0 auto;
padding: 2rem 1.5rem;
}
#board-header {
display: flex;
align-items: baseline;
justify-content: space-between;
padding-bottom: 1.5rem;
margin-bottom: 2rem;
border-bottom: 1px solid var(--border);
}
#board-title {
font-size: 1.4rem;
font-weight: 700;
color: var(--text);
}
#step-count {
font-size: 0.85rem;
color: var(--text-muted);
white-space: nowrap;
}
.step {
margin-bottom: 2.5rem;
}
.step-header {
display: flex;
align-items: baseline;
gap: 0.5rem;
margin-bottom: 1rem;
}
.step-number {
color: var(--text-muted);
font-size: 0.85rem;
font-weight: 500;
}
.step-title {
font-size: 1.1rem;
font-weight: 600;
color: var(--text);
}
.equation-card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 8px;
margin-bottom: 0.75rem;
display: flex;
align-items: center;
padding: 1rem 1rem;
transition: background 0.3s, border-color 0.3s;
}
.equation-content {
flex: 1;
text-align: center;
overflow-x: auto;
padding: 0.5rem 0;
}
.equation-number {
flex-shrink: 0;
padding-left: 1rem;
font-family: KaTeX_Main, "Times New Roman", serif;
font-size: 1rem;
color: var(--text-muted);
user-select: none;
}
.equation-card .katex-display {
margin: 0;
}
.note {
color: var(--text-muted);
font-size: 0.9rem;
font-style: italic;
padding-left: 1rem;
border-left: 2px solid var(--border);
padding-top: 0.4rem;
padding-bottom: 0.4rem;
}
.note:first-of-type {
margin-top: 0.75rem;
}
.note:last-of-type {
margin-bottom: 0.5rem;
}
.note + .note {
border-top: none;
margin-top: 0;
}
.prose {
color: var(--text-secondary);
margin-bottom: 2rem;
}
.divider {
border: none;
border-top: 1px solid var(--border);
margin: 2.5rem 0;
}
.result {
border-left: 3px solid var(--accent);
background: var(--result-bg);
padding: 1.5rem;
border-radius: 8px;
margin-bottom: 2.5rem;
}
.result .step-title {
color: var(--accent-hover);
}
.error-card {
background: var(--error-bg);
border: 1px solid var(--error-border);
border-radius: 8px;
padding: 1rem;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
font-size: 0.85rem;
color: var(--error-text);
overflow-x: auto;
margin-bottom: 0.75rem;
}
#send-btn {
position: fixed;
background: var(--accent);
color: var(--bg);
font-weight: 600;
border-radius: 6px;
padding: 0.5rem 1rem;
cursor: pointer;
z-index: 100;
font-size: 0.85rem;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
user-select: none;
transition: background 0.15s;
}
#send-btn:hover {
background: var(--accent-hover);
}
#send-btn.hidden {
display: none;
}
#toast {
position: fixed;
bottom: 2rem;
left: 50%;
transform: translateX(-50%);
background: var(--toast-bg);
border: 1px solid var(--toast-border);
color: var(--text);
padding: 0.5rem 1.5rem;
border-radius: 6px;
font-size: 0.85rem;
opacity: 0;
transition: opacity 0.3s;
z-index: 200;
pointer-events: none;
}
#toast.hidden {
display: none;
}
#theme-toggle {
position: fixed;
right: 1rem;
top: 50%;
transform: translateY(-50%);
display: flex;
flex-direction: column;
gap: 2px;
background: var(--toggle-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 4px;
z-index: 50;
transition: background 0.3s, border-color 0.3s;
}
#theme-toggle button {
width: 28px;
height: 28px;
border: none;
border-radius: 6px;
background: transparent;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s;
padding: 0;
}
#theme-toggle button:hover {
background: var(--toggle-hover);
}
#theme-toggle button.active {
background: var(--toggle-active);
}
#theme-toggle button svg {
width: 16px;
height: 16px;
fill: var(--text-muted);
transition: fill 0.3s;
}
#theme-toggle button.active svg {
fill: var(--accent);
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.step.new {
animation: fadeIn 200ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
.step.new {
animation: none;
}
body {
transition: none;
}
}
@media (max-width: 600px) {
#board {
padding: 1.25rem 1rem;
}
.equation-card {
padding: 1rem;
}
.result {
padding: 1rem;
}
#board-title {
font-size: 1.2rem;
}
#theme-toggle {
right: 0.5rem;
}
}
.katex {
color: var(--text);
}
.cb-chat-toggle {
margin-left: auto;
background: none;
border: none;
cursor: pointer;
padding: 4px 8px;
border-radius: 6px;
color: var(--text-muted);
transition: color 0.2s, background 0.2s;
position: relative;
display: flex;
align-items: center;
gap: 4px;
}
.cb-chat-toggle:hover {
color: var(--accent);
background: var(--toggle-active);
}
.cb-chat-toggle svg {
width: 18px;
height: 18px;
}
.cb-chat-badge {
position: absolute;
top: -2px;
right: 2px;
background: var(--accent);
color: var(--bg);
font-size: 10px;
font-weight: 700;
min-width: 16px;
height: 16px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 4px;
}
.cb-chat-thread {
display: none;
border-top: 1px solid var(--border);
}
.cb-chat-thread.open {
display: block;
max-height: 600px;
overflow-y: auto;
}
.cb-chat-messages {
padding: 12px 16px;
display: flex;
flex-direction: column;
gap: 8px;
}
.cb-chat-msg {
max-width: 85%;
padding: 8px 12px;
border-radius: 12px;
font-size: 0.9em;
line-height: 1.5;
word-wrap: break-word;
}
.cb-chat-msg.user {
align-self: flex-end;
background: var(--bg-card);
border: 1px solid var(--border);
color: var(--text);
}
.cb-chat-msg.assistant {
align-self: stretch;
max-width: 100%;
background: transparent;
border: none;
border-left: 2px solid var(--accent);
border-radius: 0;
padding: 12px 16px;
color: var(--text);
}
.cb-chat-msg .katex { font-size: 1em; }
.reply-content {
display: flex;
flex-direction: column;
gap: 10px;
}
.reply-prose {
margin: 0;
line-height: 1.6;
font-size: 0.92em;
color: var(--text);
}
.reply-equation {
margin: 4px 0;
padding: 0.75rem 1rem;
font-size: 0.95em;
}
.reply-equation .equation-number {
font-size: 0.9rem;
}
.cb-chat-context {
font-size: 0.8em;
color: var(--text-muted);
margin-bottom: 4px;
font-style: italic;
}
.cb-chat-time {
font-size: 0.7em;
color: var(--text-muted);
margin-top: 2px;
}
.cb-chat-input-row {
display: flex;
gap: 8px;
padding: 8px 16px 12px;
border-top: 1px solid var(--border);
}
.cb-chat-input {
flex: 1;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 8px 12px;
color: var(--text);
font-size: 0.9em;
font-family: inherit;
outline: none;
transition: border-color 0.2s;
}
.cb-chat-input:focus {
border-color: var(--accent);
}
.cb-chat-input::placeholder {
color: var(--text-muted);
}
.cb-chat-send {
background: var(--accent);
color: var(--bg);
border: none;
border-radius: 8px;
padding: 8px 16px;
font-weight: 600;
cursor: pointer;
font-size: 0.85em;
transition: opacity 0.2s;
}
.cb-chat-send:hover {
opacity: 0.85;
}
.cb-chat-send:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.cb-ask-btn {
background: var(--toggle-active);
color: var(--accent);
border: 1px solid var(--accent);
border-radius: 6px;
padding: 6px 12px;
cursor: pointer;
font-size: 0.85em;
font-weight: 500;
transition: background 0.2s;
}
.cb-ask-btn:hover {
background: var(--result-bg);
}