privatedrop/web/styles.css
2026-06-19 13:31:43 +08:00

616 lines
10 KiB
CSS

:root {
color-scheme: light;
--bg: #f5f7fb;
--bg-2: #e9f0f7;
--surface: #ffffff;
--surface-soft: #f8fafc;
--ink: #111827;
--muted: #667085;
--line: #d9e2ec;
--line-strong: #c8d3df;
--primary: #176b87;
--primary-strong: #0f5369;
--primary-soft: #e7f4f7;
--blue: #2f6fed;
--blue-soft: #eaf1ff;
--ok: #166534;
--ok-soft: #eaf7ee;
--warn: #995f00;
--warn-soft: #fff5df;
--bad: #a33838;
--bad-soft: #fff0f0;
--shadow-sm: 0 8px 24px rgba(31, 45, 61, 0.08);
--shadow-lg: 0 24px 80px rgba(31, 45, 61, 0.16);
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100vh;
overflow-x: hidden;
background:
radial-gradient(circle at top left, rgba(47, 111, 237, 0.12), transparent 34vw),
radial-gradient(circle at bottom right, rgba(23, 107, 135, 0.12), transparent 30vw),
linear-gradient(180deg, var(--bg), var(--bg-2));
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(--line-strong);
border-radius: 8px;
background: var(--surface);
color: var(--ink);
cursor: pointer;
padding: 0 14px;
font-weight: 700;
transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}
button:hover {
border-color: var(--primary);
background: var(--primary-soft);
color: var(--primary-strong);
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
outline: 3px solid rgba(47, 111, 237, 0.22);
outline-offset: 2px;
}
button:disabled {
cursor: not-allowed;
opacity: 0.48;
}
.app-shell {
position: relative;
min-height: 100dvh;
width: min(1200px, calc(100% - 32px));
margin: 0 auto;
padding: 22px 0 34px;
}
.topbar {
display: grid;
grid-template-columns: minmax(180px, 1fr) auto auto;
align-items: center;
gap: 16px;
min-height: 64px;
}
.brand-block {
display: flex;
align-items: center;
gap: 12px;
}
.brand-mark {
width: 48px;
height: 48px;
border-radius: 15px;
box-shadow: 0 10px 28px rgba(23, 107, 135, 0.24);
}
.brand-copy {
display: grid;
gap: 2px;
}
.product-kicker {
color: var(--primary-strong);
font-size: 12px;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
h1,
h2 {
margin: 0;
line-height: 1.2;
letter-spacing: 0;
}
h1 {
font-size: clamp(24px, 4vw, 34px);
}
h2 {
font-size: 15px;
}
.utility-nav {
display: flex;
align-items: center;
justify-content: flex-end;
flex-wrap: wrap;
gap: 8px;
}
.panel-toggle {
min-height: 40px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.82);
backdrop-filter: blur(12px);
padding: 0 13px;
font-size: 13px;
box-shadow: 0 6px 20px rgba(31, 45, 61, 0.06);
}
.panel-toggle[aria-expanded="true"] {
border-color: var(--primary);
background: var(--primary);
color: #fff;
}
#peerCount {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 22px;
margin-left: 4px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.65);
padding: 1px 6px;
font-size: 12px;
}
.state {
justify-self: end;
border: 1px solid var(--line-strong);
border-radius: 999px;
background: rgba(255, 255, 255, 0.82);
color: var(--muted);
padding: 8px 12px;
white-space: nowrap;
font-size: 13px;
font-weight: 800;
}
.state.online {
border-color: #b8dfc8;
background: var(--ok-soft);
color: var(--ok);
}
.state.offline {
border-color: #efc4c4;
background: var(--bad-soft);
color: var(--bad);
}
.drop-stage {
display: grid;
place-items: center;
min-height: calc(100dvh - 132px);
padding: 28px 0;
}
.selected-peer {
align-self: end;
margin-bottom: 16px;
border: 1px solid rgba(200, 211, 223, 0.9);
border-radius: 999px;
background: rgba(255, 255, 255, 0.74);
color: #334155;
padding: 8px 14px;
font-size: 13px;
font-weight: 800;
box-shadow: var(--shadow-sm);
}
.drop-zone {
position: relative;
display: grid;
place-items: center;
gap: 10px;
width: min(520px, 78vw);
aspect-ratio: 1;
border: 1px solid rgba(200, 211, 223, 0.95);
border-radius: 50%;
background:
linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88)),
var(--surface);
color: var(--ink);
box-shadow: var(--shadow-lg);
text-align: center;
padding: 52px;
}
.drop-zone:hover,
.drop-zone.drag-over {
border-color: var(--primary);
background: linear-gradient(180deg, #ffffff, var(--primary-soft));
}
.drop-zone:disabled {
opacity: 0.82;
}
.drop-ring {
position: absolute;
inset: 10%;
border: 1px dashed rgba(23, 107, 135, 0.28);
border-radius: 50%;
pointer-events: none;
}
.drop-icon {
display: grid;
place-items: center;
width: 78px;
height: 78px;
border-radius: 50%;
background: var(--blue-soft);
color: var(--blue);
}
.drop-icon svg {
width: 38px;
height: 38px;
}
.drop-zone #dropHint {
max-width: 290px;
color: var(--muted);
font-size: clamp(16px, 2.2vw, 20px);
font-weight: 800;
}
#fileInput {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
clip-path: inset(50%);
white-space: nowrap;
}
#uploadProgress {
width: min(360px, 70vw);
height: 9px;
margin-top: 18px;
accent-color: var(--primary);
}
.panel-dock {
position: fixed;
z-index: 20;
top: 92px;
right: max(18px, calc((100vw - 1200px) / 2));
display: grid;
gap: 10px;
width: min(420px, calc(100vw - 28px));
pointer-events: none;
}
.dock-panel {
pointer-events: auto;
border: 1px solid rgba(217, 226, 236, 0.95);
border-radius: 8px;
background: rgba(255, 255, 255, 0.96);
box-shadow: var(--shadow-lg);
padding: 16px;
backdrop-filter: blur(16px);
}
.dock-panel[hidden] {
display: none;
}
.dock-panel header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 12px;
}
.panel-note {
color: var(--muted);
font-size: 12px;
}
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: 96px;
max-height: 180px;
resize: vertical;
}
.peer-list,
.activity-list {
display: grid;
gap: 8px;
}
.peer-list {
margin-top: 10px;
}
.peer {
display: grid;
width: 100%;
min-height: 58px;
border: 1px solid var(--line);
border-radius: 8px;
background: #fff;
padding: 10px 12px;
text-align: left;
}
.peer strong {
overflow-wrap: anywhere;
}
.peer code {
color: var(--muted);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
}
.peer.selected {
border-color: var(--primary);
background: var(--primary-soft);
}
.text-panel {
display: grid;
gap: 10px;
}
.text-panel header {
margin-bottom: 2px;
}
.identity-card,
.nickname-field {
display: grid;
gap: 6px;
margin-bottom: 12px;
}
.identity-card span,
.nickname-field span {
color: var(--muted);
font-size: 12px;
font-weight: 800;
}
.identity-card strong {
display: inline-flex;
align-items: center;
min-height: 48px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--primary-soft);
padding: 0 14px;
color: var(--primary-strong);
font: 900 22px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.identity-actions {
display: flex;
gap: 8px;
}
.server-address {
display: block;
overflow-wrap: anywhere;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--surface-soft);
padding: 12px;
color: #334155;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.small-button,
.activity button {
min-height: 34px;
padding: 0 10px;
font-size: 12px;
}
.secondary,
.activity button.secondary {
background: #fff;
color: var(--primary-strong);
}
.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-soft);
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-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: 820px) {
.app-shell {
width: min(100% - 20px, 1200px);
padding-top: 12px;
}
.topbar {
grid-template-columns: 1fr;
}
.utility-nav,
.state {
justify-self: stretch;
}
.utility-nav {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.panel-toggle {
width: 100%;
padding: 0 10px;
}
.drop-stage {
min-height: auto;
padding: 36px 0 20px;
}
.drop-zone {
width: min(440px, 86vw);
padding: 34px;
}
.panel-dock {
position: static;
width: 100%;
margin-top: 12px;
}
.activity {
grid-template-columns: minmax(0, 1fr) auto;
}
.activity-time {
display: none;
}
.activity .actions {
grid-column: 1 / -1;
}
}
@media (max-width: 520px) {
.utility-nav {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.drop-icon {
width: 64px;
height: 64px;
}
}