privatedrop/web/styles.css
2026-06-19 12:39:49 +08:00

516 lines
8.4 KiB
CSS

:root {
color-scheme: light;
--bg: #eef2f5;
--surface: #ffffff;
--surface-subtle: #f7f9fb;
--ink: #111827;
--muted: #64748b;
--line: #d8e0e8;
--line-strong: #c6d1dc;
--primary: #0f766e;
--primary-strong: #115e59;
--primary-soft: #e3f5f2;
--blue: #2563eb;
--blue-soft: #eaf1ff;
--ok: #166534;
--ok-soft: #eaf7ee;
--warn: #9a5b00;
--warn-soft: #fff4dc;
--bad: #a33838;
--bad-soft: #fff0f0;
--shadow: 0 16px 40px rgba(28, 45, 64, 0.08);
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 220px),
var(--bg);
color: var(--ink);
font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
button,
input,
select,
textarea {
font: inherit;
}
button {
min-height: 44px;
border: 1px solid var(--primary);
border-radius: 8px;
background: var(--primary);
color: #fff;
cursor: pointer;
padding: 0 16px;
font-weight: 700;
transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
button:hover {
background: var(--primary-strong);
border-color: var(--primary-strong);
}
button.secondary,
.activity button.secondary {
background: #fff;
color: var(--primary-strong);
border-color: var(--line-strong);
}
button.secondary:hover,
.activity button.secondary:hover {
border-color: var(--primary);
background: var(--primary-soft);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
outline: 3px solid rgba(37, 99, 235, 0.22);
outline-offset: 2px;
}
button:disabled {
cursor: not-allowed;
opacity: 0.48;
}
.app-shell {
width: min(1240px, calc(100% - 36px));
margin: 0 auto;
padding: 24px 0 36px;
}
.topbar,
.identity-bar,
.peer-panel,
.send-panel,
.activity-panel {
background: rgba(255, 255, 255, 0.92);
border: 1px solid rgba(216, 224, 232, 0.92);
border-radius: 8px;
box-shadow: var(--shadow);
}
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 20px;
margin-bottom: 12px;
padding: 18px 20px;
}
.brand-block {
display: grid;
gap: 4px;
}
.product-kicker {
color: var(--primary-strong);
font-size: 12px;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
h1,
h2 {
margin: 0;
letter-spacing: 0;
line-height: 1.2;
}
h1 {
font-size: 28px;
}
h2 {
font-size: 15px;
}
.top-meta {
display: flex;
align-items: center;
justify-content: flex-end;
flex-wrap: wrap;
gap: 10px;
min-width: 0;
}
.server-line {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
color: var(--muted);
}
.server-line span {
font-size: 12px;
font-weight: 700;
}
.server-line code {
display: inline-block;
max-width: min(460px, 52vw);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
border: 1px solid var(--line);
border-radius: 999px;
background: var(--surface-subtle);
color: #334155;
padding: 5px 10px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
}
.identity-bar {
display: grid;
grid-template-columns: auto minmax(220px, 320px) auto;
align-items: end;
gap: 12px;
margin-bottom: 16px;
padding: 14px 16px;
}
.identity-code,
.nickname-field {
display: grid;
gap: 5px;
}
.identity-code span,
.nickname-field span,
.target-row label,
.composer label {
color: var(--muted);
font-size: 12px;
font-weight: 700;
}
.identity-code strong {
display: inline-flex;
align-items: center;
min-height: 44px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--primary-soft);
padding: 0 14px;
color: var(--primary-strong);
font: 800 20px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.identity-actions {
display: flex;
gap: 8px;
}
input,
select,
textarea {
width: 100%;
min-height: 44px;
border: 1px solid var(--line-strong);
border-radius: 8px;
background: #fff;
color: var(--ink);
padding: 9px 12px;
}
textarea {
min-height: 92px;
max-height: 170px;
resize: vertical;
}
.state {
border: 1px solid var(--line);
border-radius: 999px;
background: var(--surface-subtle);
color: var(--muted);
padding: 6px 12px;
white-space: nowrap;
font-size: 13px;
font-weight: 700;
}
.state.online {
border-color: #b8dfc8;
background: var(--ok-soft);
color: var(--ok);
}
.state.offline {
border-color: #efc4c4;
background: var(--bad-soft);
color: var(--bad);
}
.workspace {
display: grid;
grid-template-columns: minmax(220px, 270px) minmax(360px, 1fr) minmax(420px, 520px);
gap: 16px;
align-items: start;
}
.peer-panel,
.send-panel,
.activity-panel {
min-height: 420px;
padding: 16px;
}
.peer-panel header,
.activity-panel header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 14px;
}
#peerCount {
border-radius: 999px;
background: var(--blue-soft);
color: var(--blue);
min-width: 30px;
padding: 3px 9px;
text-align: center;
font-size: 12px;
font-weight: 800;
}
.peer-list,
.activity-list {
display: grid;
gap: 8px;
}
.peer {
border: 1px solid var(--line);
border-radius: 8px;
padding: 11px 12px;
cursor: pointer;
background: #fff;
transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.peer:hover {
border-color: var(--primary);
box-shadow: 0 8px 24px rgba(15, 118, 110, 0.08);
}
.peer.selected {
border-color: var(--primary);
background: var(--primary-soft);
}
.peer strong {
display: block;
overflow-wrap: anywhere;
}
.peer code {
color: var(--muted);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
}
.target-row,
.composer,
.file-box {
display: grid;
gap: 9px;
margin-bottom: 16px;
}
.file-box {
border-top: 1px solid var(--line);
padding-top: 16px;
}
progress {
width: 100%;
height: 10px;
accent-color: var(--primary);
}
.activity {
display: grid;
grid-template-columns: minmax(0, 1fr) auto auto auto;
align-items: center;
gap: 10px;
min-height: 44px;
border: 1px solid var(--line);
border-radius: 8px;
padding: 8px 10px;
background: #fff;
}
.activity-main {
display: flex;
align-items: baseline;
gap: 8px;
min-width: 0;
}
.activity-title,
.activity-detail {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.activity-title {
flex: 0 1 auto;
max-width: 46%;
font-size: 13px;
font-weight: 800;
}
.activity-detail {
flex: 1;
color: var(--muted);
font-size: 12px;
}
.activity-status {
border-radius: 999px;
background: var(--surface-subtle);
color: var(--muted);
padding: 4px 8px;
font-size: 12px;
font-weight: 800;
white-space: nowrap;
}
.activity-time {
color: var(--muted);
font-size: 12px;
white-space: nowrap;
}
.activity .actions {
display: flex;
gap: 6px;
}
.activity button {
min-height: 32px;
border-radius: 7px;
padding: 0 10px;
font-size: 12px;
}
.activity-progress {
grid-column: 1 / -1;
height: 5px;
}
.activity.info {
border-color: #c8d6f3;
background: #fbfdff;
}
.activity.warn {
border-color: #ecd8a5;
background: var(--warn-soft);
}
.activity.ok {
border-color: #b8dfc8;
background: var(--ok-soft);
}
.activity.ok .activity-status {
background: #d8f1e1;
color: var(--ok);
}
.activity.bad {
border-color: #efc4c4;
background: var(--bad-soft);
}
.activity.bad .activity-status {
background: #f8dada;
color: var(--bad);
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
transition-duration: 0.01ms !important;
}
}
@media (max-width: 1080px) {
.workspace {
grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
}
.activity-panel {
grid-column: 1 / -1;
}
}
@media (max-width: 760px) {
.app-shell {
width: min(100% - 20px, 1240px);
padding-top: 10px;
}
.topbar,
.identity-bar {
align-items: flex-start;
grid-template-columns: 1fr;
}
.topbar,
.top-meta,
.identity-actions {
flex-direction: column;
align-items: stretch;
}
.workspace {
grid-template-columns: 1fr;
}
.peer-panel,
.send-panel,
.activity-panel {
min-height: auto;
}
.server-line code {
max-width: 100%;
}
.activity {
grid-template-columns: minmax(0, 1fr) auto;
}
.activity-time {
display: none;
}
.activity .actions {
grid-column: 1 / -1;
}
}