Files
marqdo/ext/web/templates/starter/static/theme.css
T
cflmyandCursor 8041a2274c Add ext/web with table-driven pages and polished admin CRUD.
Ship the web L1/plugin stack (bind tables, variable-named db.init, live render) and tighten the admin UI with sidebar, toolbar, forms, and activity log.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 11:42:17 +08:00

510 lines
8.4 KiB
CSS

/* Marqdo Web default theme — semantic / classless shell.
Content kinds: prose, cards, table. No purple/cream-terracotta AI defaults. */
:root {
--ink: #1c1917;
--ink-muted: #57534e;
--paper: #fafaf9;
--panel: #ffffff;
--line: #e7e5e4;
--accent: #0f766e;
--accent-hover: #0d9488;
--side-w: 14rem;
--radius: 6px;
--font-display: "Source Serif 4", "Noto Serif SC", Georgia, serif;
--font-ui: "IBM Plex Sans", "Noto Sans SC", "Segoe UI", sans-serif;
--font-mono: "IBM Plex Mono", ui-monospace, monospace;
--space: 1.25rem;
--max-prose: 42rem;
}
* {
box-sizing: border-box;
}
html {
font-size: 16px;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
min-height: 100vh;
display: grid;
grid-template-rows: auto 1fr auto;
grid-template-columns: 1fr;
background: var(--paper);
color: var(--ink);
font-family: var(--font-ui);
line-height: 1.55;
}
body.has-sidebar {
grid-template-columns: var(--side-w) 1fr;
grid-template-areas:
"top top"
"side main"
"foot foot";
}
body.no-sidebar {
grid-template-areas:
"top"
"main"
"foot";
}
/* —— Shell —— */
header.topnav {
grid-area: top;
background: var(--panel);
border-bottom: 1px solid var(--line);
padding: 0.85rem var(--space);
position: sticky;
top: 0;
z-index: 10;
}
aside.side {
grid-area: side;
background: #f5f5f4;
border-right: 1px solid var(--line);
padding: var(--space) 1rem;
min-height: 0;
}
main.main {
grid-area: main;
padding: calc(var(--space) * 1.25) var(--space) calc(var(--space) * 2);
min-width: 0;
}
footer.foot {
grid-area: foot;
border-top: 1px solid var(--line);
padding: 0.85rem var(--space);
color: var(--ink-muted);
font-size: 0.9rem;
background: var(--panel);
}
/* —— Nav links —— */
ul.nav,
ul.side-nav,
ul.foot-nav {
list-style: none;
margin: 0;
padding: 0;
display: flex;
gap: 0.35rem 1.15rem;
flex-wrap: wrap;
align-items: center;
}
ul.side-nav {
flex-direction: column;
align-items: stretch;
gap: 0.2rem;
}
aside.side .side-label {
display: block;
font-size: 0.72rem;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--ink-muted);
margin: 0 0 0.65rem;
font-family: var(--font-ui);
}
ul.nav a,
ul.side-nav a,
ul.foot-nav a {
color: var(--ink);
text-decoration: none;
font-weight: 500;
border-radius: var(--radius);
padding: 0.35rem 0.45rem;
}
ul.side-nav a {
display: block;
padding: 0.45rem 0.6rem;
}
ul.nav a:hover,
ul.side-nav a:hover,
ul.foot-nav a:hover {
color: var(--accent);
background: rgba(15, 118, 110, 0.08);
}
ul.side-nav a[aria-current="page"],
ul.nav a[aria-current="page"] {
color: var(--accent);
background: rgba(15, 118, 110, 0.12);
}
/* —— Prose (intro / raw main HTML) —— */
.main-intro,
.content.prose {
max-width: var(--max-prose);
font-family: var(--font-display);
font-size: 1.125rem;
}
.main-intro h1,
.content.prose h1 {
font-size: 2rem;
line-height: 1.2;
margin: 0 0 0.75rem;
letter-spacing: -0.02em;
}
.main-intro p,
.content.prose p {
margin: 0 0 1rem;
color: var(--ink-muted);
}
/* Bound field hooks from `|绑定css样式|` */
.card-title {
font-family: var(--font-display);
}
.card-body {
color: var(--ink-muted);
}
.content.cards {
display: grid;
gap: 1rem;
margin-top: 1.25rem;
grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}
.content.cards article {
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
padding: 1rem 1.1rem;
box-shadow: 0 1px 0 rgba(28, 25, 23, 0.04);
}
.content.cards article h2 {
font-family: var(--font-display);
font-size: 1.2rem;
margin: 0 0 0.45rem;
line-height: 1.3;
}
.content.cards article p {
margin: 0;
color: var(--ink-muted);
font-size: 0.95rem;
}
.content.cards article .meta {
margin-top: 0.65rem;
font-size: 0.8rem;
color: var(--ink-muted);
font-family: var(--font-mono);
}
/* —— Table layout —— */
.content.table-wrap {
margin-top: 1.25rem;
overflow-x: auto;
border: 1px solid var(--line);
border-radius: var(--radius);
background: var(--panel);
}
.content.table-wrap table {
width: 100%;
border-collapse: collapse;
font-size: 0.95rem;
}
.content.table-wrap th,
.content.table-wrap td {
padding: 0.55rem 0.75rem;
text-align: left;
border-bottom: 1px solid var(--line);
}
.content.table-wrap th {
background: #f5f5f4;
font-weight: 600;
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--ink-muted);
}
.content.table-wrap tr:last-child td {
border-bottom: 0;
}
/* —— Simple list —— */
.content.list {
margin: 1.25rem 0 0;
padding: 0;
list-style: none;
max-width: var(--max-prose);
}
.content.list li {
padding: 0.65rem 0;
border-bottom: 1px solid var(--line);
font-family: var(--font-display);
}
/* —— Admin panel —— */
.admin-page {
max-width: 56rem;
}
.admin-bar {
display: flex;
flex-wrap: wrap;
align-items: flex-end;
justify-content: space-between;
gap: 1rem;
margin-bottom: 1.25rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--line);
}
.admin-crumbs {
margin: 0 0 0.25rem;
font-size: 0.8rem;
color: var(--ink-muted);
}
.admin-crumbs a {
color: var(--ink-muted);
text-decoration: none;
}
.admin-crumbs a:hover {
color: var(--accent);
}
.admin-bar h1 {
margin: 0;
font-family: var(--font-display);
font-size: 1.65rem;
letter-spacing: -0.02em;
}
.admin-actions {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
.admin-lead {
margin: 0 0 1rem;
color: var(--ink-muted);
}
.admin-empty {
color: var(--ink-muted);
padding: 1.5rem 0;
}
.admin-cards {
display: grid;
gap: 1rem;
grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.admin-card {
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
padding: 1rem 1.1rem;
}
.admin-card h2 {
margin: 0 0 0.35rem;
font-size: 1.15rem;
font-family: var(--font-display);
}
.admin-meta {
margin: 0 0 0.85rem;
font-size: 0.85rem;
color: var(--ink-muted);
font-family: var(--font-mono);
}
.admin-card-actions {
display: flex;
gap: 0.45rem;
}
.btn,
button.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0.4rem 0.85rem;
border-radius: var(--radius);
border: 1px solid var(--accent);
background: var(--accent);
color: #fff;
font: inherit;
font-size: 0.9rem;
text-decoration: none;
cursor: pointer;
}
.btn:hover,
button.btn:hover {
background: var(--accent-hover);
border-color: var(--accent-hover);
color: #fff;
}
.btn-ghost {
background: transparent;
color: var(--ink);
border-color: var(--line);
}
.btn-ghost:hover {
background: #f5f5f4;
color: var(--ink);
border-color: var(--line);
}
.btn-danger {
background: #fff;
color: #b91c1c;
border-color: #fecaca;
}
.btn-danger:hover {
background: #fef2f2;
color: #991b1b;
border-color: #fecaca;
}
.btn-small {
padding: 0.25rem 0.55rem;
font-size: 0.8rem;
}
.col-actions {
white-space: nowrap;
width: 1%;
}
.inline-form {
display: inline;
margin: 0;
}
.admin-table th.col-actions {
text-align: right;
}
.admin-table td.col-actions {
text-align: right;
}
.admin-form {
max-width: 28rem;
}
.admin-form-fields {
display: grid;
gap: 0.9rem;
}
.admin-field {
display: grid;
gap: 0.35rem;
}
.admin-field span {
font-size: 0.85rem;
font-weight: 600;
color: var(--ink-muted);
}
.admin-field input,
.admin-field textarea {
width: 100%;
padding: 0.5rem 0.65rem;
border: 1px solid var(--line);
border-radius: var(--radius);
font: inherit;
background: var(--panel);
color: var(--ink);
}
.admin-field input:focus,
.admin-field textarea:focus {
outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
border-color: var(--accent);
}
.admin-form-footer {
display: flex;
gap: 0.5rem;
margin-top: 1.25rem;
}
.log-action {
font-family: var(--font-mono);
font-size: 0.85rem;
}
.log-create {
color: #0f766e;
}
.log-update {
color: #a16207;
}
.log-delete {
color: #b91c1c;
}
aside.side .side-label {
margin-bottom: 0.5rem;
}
a {
color: var(--accent);
}
a:hover {
color: var(--accent-hover);
}
@media (max-width: 720px) {
body.has-sidebar {
grid-template-columns: 1fr;
grid-template-areas:
"top"
"side"
"main"
"foot";
}
aside.side {
border-right: 0;
border-bottom: 1px solid var(--line);
}
ul.side-nav {
flex-direction: row;
flex-wrap: wrap;
}
}