Files
PaperPhone/client/src/style.css
619dev 70982e58b1 init
2026-03-25 14:31:05 +08:00

618 lines
16 KiB
CSS

/* =============================================
PaperPhone — WeChat-Style Design System
============================================= */
/* ── Reset & Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--green: #07C160;
--green-dark: #059D4C;
--green-light: #38D68B;
--bg: #EDEDED;
--bg-dark: #111111;
--surface: #FFFFFF;
--surface-dark: #1C1C1E;
--input-bg: #F2F2F2;
--border: #E0E0E0;
--text: #1A1A1A;
--text-muted: #888888;
--bubble-out: #95EC69;
--bubble-in: #FFFFFF;
--bubble-out-dark: #07C160;
--bubble-in-dark: #2C2C2E;
--topbar: #F7F7F7;
--topbar-dark: #1C1C1E;
--tab: #F7F7F7;
--tab-dark: #111111;
--red: #FA5151;
--shadow: 0 2px 16px rgba(0,0,0,.08);
--radius: 10px;
--radius-sm: 6px;
--safe-top: env(safe-area-inset-top, 0px);
--safe-bottom: env(safe-area-inset-bottom, 0px);
--topbar-h: calc(52px + var(--safe-top));
--tab-h: calc(56px + var(--safe-bottom));
font-size: 16px;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: var(--bg-dark);
--surface: var(--surface-dark);
--topbar: var(--topbar-dark);
--tab: var(--tab-dark);
--border: #2A2A2E;
--text: #F2F2F2;
--text-muted: #6B6B6D;
--input-bg: #2C2C2E;
--bubble-out: var(--bubble-out-dark);
--bubble-in: var(--bubble-in-dark);
}
}
html, body {
height: 100%;
overflow: hidden;
background: var(--bg);
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
color: var(--text);
-webkit-font-smoothing: antialiased;
-webkit-tap-highlight-color: transparent;
}
#app {
height: 100dvh;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* ── Top Bar ──────────────────────────────── */
.topbar {
position: sticky;
top: 0;
z-index: 100;
background: var(--topbar);
display: flex;
align-items: center;
padding: var(--safe-top) 16px 0;
height: var(--topbar-h);
border-bottom: .5px solid var(--border);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
}
.topbar-title {
flex: 1;
text-align: center;
font-size: 17px;
font-weight: 600;
color: var(--text);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.topbar-btn {
background: none;
border: none;
cursor: pointer;
padding: 8px;
color: var(--green);
font-size: 14px;
display: flex;
align-items: center;
gap: 4px;
border-radius: var(--radius-sm);
transition: background .15s;
}
.topbar-btn:hover { background: rgba(0,0,0,.05); }
.topbar-back { min-width: 44px; }
.topbar-action { min-width: 44px; justify-content: flex-end; }
/* ── Bottom Tab Bar ───────────────────────── */
.tabbar {
position: sticky;
bottom: 0;
z-index: 100;
background: var(--tab);
display: flex;
align-items: stretch;
border-top: .5px solid var(--border);
padding-bottom: var(--safe-bottom);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
}
.tab-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 8px 0;
gap: 3px;
cursor: pointer;
transition: color .15s;
color: var(--text-muted);
user-select: none;
}
.tab-item.active { color: var(--green); }
.tab-item svg { width: 24px; height: 24px; fill: currentColor; }
.tab-item span { font-size: 10px; font-weight: 500; }
.tab-dot {
position: absolute;
top: 6px;
right: calc(50% - 18px);
background: var(--red);
color: #fff;
font-size: 10px;
font-weight: 600;
min-width: 18px;
height: 18px;
border-radius: 9px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 4px;
}
.tab-icon-wrap { position: relative; }
/* ── Page Content ─────────────────────────── */
.page {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
}
.page::-webkit-scrollbar { display: none; }
/* ── List Items ───────────────────────────── */
.list-item {
display: flex;
align-items: center;
padding: 12px 16px;
background: var(--surface);
cursor: pointer;
gap: 12px;
transition: background .12s;
position: relative;
}
.list-item:active { background: var(--border); }
.list-item::after {
content: '';
position: absolute;
left: 72px;
right: 0;
bottom: 0;
height: .5px;
background: var(--border);
}
.list-item:last-child::after { display: none; }
/* ── Avatar ───────────────────────────────── */
.avatar {
width: 48px;
height: 48px;
border-radius: 6px;
object-fit: cover;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
font-weight: 600;
color: #fff;
background: var(--green);
}
.avatar-sm { width: 36px; height: 36px; font-size: 14px; border-radius: 4px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; border-radius: 10px; }
/* ── Chat List ────────────────────────────── */
.chat-meta { flex: 1; min-width: 0; }
.chat-row { display: flex; justify-content: space-between; align-items: baseline; }
.chat-name { font-size: 16px; font-weight: 500; }
.chat-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.chat-preview { font-size: 13px; color: var(--text-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 3px; }
.badge {
background: var(--red);
color: #fff;
font-size: 11px;
font-weight: 700;
min-width: 18px;
height: 18px;
border-radius: 9px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 5px;
flex-shrink: 0;
}
/* ── Chat Window ──────────────────────────── */
.chat-window {
display: flex;
flex-direction: column;
height: 100%;
}
.chat-messages {
flex: 1;
overflow-y: auto;
padding: 12px 0;
display: flex;
flex-direction: column;
gap: 4px;
background: var(--bg);
-webkit-overflow-scrolling: touch;
}
.chat-messages::-webkit-scrollbar { display: none; }
/* Message bubbles */
.msg-row {
display: flex;
align-items: flex-end;
padding: 4px 16px;
gap: 8px;
animation: fadeInUp .15s ease-out;
}
.msg-row.out { flex-direction: row-reverse; }
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(6px); }
to { opacity: 1; transform: translateY(0); }
}
.bubble {
max-width: min(70vw, 320px);
padding: 10px 14px;
border-radius: 18px;
font-size: 15px;
line-height: 1.4;
word-break: break-word;
position: relative;
}
.msg-row.in .bubble { background: var(--bubble-in); border-radius: 4px 18px 18px 18px; box-shadow: var(--shadow); }
.msg-row.out .bubble { background: var(--bubble-out); border-radius: 18px 4px 18px 18px; }
.bubble-image { max-width: 200px; border-radius: 12px; display: block; cursor: zoom-in; }
.bubble-voice {
display: flex;
align-items: center;
gap: 8px;
min-width: 80px;
}
.bubble-voice .voice-icon { font-size: 18px; cursor: pointer; }
.bubble-voice .voice-dur { font-size: 13px; color: var(--text-muted); }
.msg-time-label {
text-align: center;
font-size: 12px;
color: var(--text-muted);
padding: 8px 0;
}
/* Input toolbar */
.input-toolbar {
background: var(--surface);
border-top: .5px solid var(--border);
padding: 8px 12px;
padding-bottom: max(8px, var(--safe-bottom));
display: flex;
align-items: flex-end;
gap: 8px;
}
.input-toolbar-btn {
background: none;
border: none;
cursor: pointer;
padding: 8px;
color: var(--text-muted);
font-size: 22px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: color .15s, background .15s;
}
.input-toolbar-btn:hover { color: var(--green); }
.input-toolbar-btn:active { background: var(--border); }
#chat-input {
flex: 1;
min-height: 36px;
max-height: 120px;
padding: 8px 12px;
background: var(--input-bg);
border: none;
border-radius: 18px;
font-size: 15px;
font-family: inherit;
color: var(--text);
resize: none;
outline: none;
line-height: 1.4;
overflow-y: auto;
}
#chat-input::placeholder { color: var(--text-muted); }
.send-btn {
background: var(--green);
color: #fff;
border: none;
border-radius: 50%;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
flex-shrink: 0;
font-size: 18px;
transition: background .15s, transform .1s;
}
.send-btn:hover { background: var(--green-dark); }
.send-btn:active { transform: scale(.92); }
/* ── Voice recording overlay ──────────────── */
.voice-overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,.7);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 999;
backdrop-filter: blur(8px);
}
.voice-pulse {
width: 90px;
height: 90px;
border-radius: 50%;
background: var(--green);
display: flex;
align-items: center;
justify-content: center;
font-size: 36px;
animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(7,193,96,.4); }
50% { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(7,193,96,0); }
}
.voice-overlay p { color: #fff; margin-top: 18px; font-size: 15px; }
/* ── Search bar ───────────────────────────── */
.search-wrap {
background: var(--topbar);
padding: 8px 16px;
border-bottom: .5px solid var(--border);
}
.search-input {
width: 100%;
padding: 9px 14px;
background: var(--input-bg);
border: none;
border-radius: 10px;
font-size: 14px;
font-family: inherit;
color: var(--text);
outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
/* ── Section Header ───────────────────────── */
.section-header {
padding: 8px 16px;
font-size: 13px;
color: var(--text-muted);
background: var(--bg);
}
/* ── Profile Page ─────────────────────────── */
.profile-card {
background: var(--surface);
display: flex;
align-items: center;
gap: 16px;
padding: 20px 16px;
margin-bottom: 8px;
}
.profile-info { flex: 1; }
.profile-name { font-size: 20px; font-weight: 600; }
.profile-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
/* ── Settings List ────────────────────────── */
.settings-group {
background: var(--surface);
border-radius: var(--radius);
margin: 0 0 8px;
overflow: hidden;
}
.settings-item {
display: flex;
align-items: center;
padding: 14px 16px;
gap: 12px;
cursor: pointer;
position: relative;
transition: background .12s;
}
.settings-item:active { background: var(--border); }
.settings-item::after {
content: '';
position: absolute;
left: 50px;
right: 0;
bottom: 0;
height: .5px;
background: var(--border);
}
.settings-item:last-child::after { display: none; }
.settings-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.settings-label { flex: 1; font-size: 15px; }
.settings-value { font-size: 14px; color: var(--text-muted); }
.settings-chevron { color: var(--text-muted); font-size: 18px; }
/* ── Auth Screen ──────────────────────────── */
.auth-screen {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100dvh;
padding: 32px 24px;
background: linear-gradient(160deg, #0a2c1a 0%, #111 60%);
gap: 24px;
}
.auth-logo {
width: 88px;
height: 88px;
border-radius: 22px;
background: var(--green);
display: flex;
align-items: center;
justify-content: center;
font-size: 42px;
box-shadow: 0 0 40px rgba(7,193,96,.35);
animation: pop .4s cubic-bezier(.2,1.6,.4,1);
}
@keyframes pop {
from { transform: scale(.6); opacity: 0; }
to { transform: scale(1); opacity: 1; }
}
.auth-title { font-size: 28px; font-weight: 700; color: #fff; letter-spacing: -.5px; }
.auth-sub { font-size: 14px; color: rgba(255,255,255,.5); text-align: center; }
.auth-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.auth-input {
padding: 14px 16px;
border-radius: 12px;
border: 1.5px solid transparent;
background: rgba(255,255,255,.08);
color: #fff;
font-size: 16px;
font-family: inherit;
outline: none;
transition: border-color .2s, background .2s;
}
.auth-input::placeholder { color: rgba(255,255,255,.35); }
.auth-input:focus { border-color: var(--green); background: rgba(255,255,255,.12); }
.auth-btn {
padding: 15px;
border-radius: 12px;
border: none;
background: var(--green);
color: #fff;
font-size: 16px;
font-weight: 600;
font-family: inherit;
cursor: pointer;
transition: background .2s, transform .1s;
margin-top: 4px;
}
.auth-btn:hover { background: var(--green-dark); }
.auth-btn:active { transform: scale(.97); }
.auth-toggle { color: rgba(255,255,255,.55); font-size: 14px; cursor: pointer; text-align: center; }
.auth-toggle span { color: var(--green); }
.auth-error { color: #FF6B6B; font-size: 13px; text-align: center; min-height: 18px; }
/* ── Toast ────────────────────────────────── */
.toast {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: rgba(0,0,0,.75);
color: #fff;
padding: 10px 20px;
border-radius: 8px;
font-size: 14px;
z-index: 9999;
pointer-events: none;
animation: toastIn .2s ease-out;
}
@keyframes toastIn {
from { opacity: 0; transform: translate(-50%,-50%) scale(.9); }
to { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
/* ── Typing indicator ─────────────────────── */
.typing-indicator { display: flex; gap: 4px; align-items: center; padding: 8px 16px; }
.typing-dot {
width: 7px; height: 7px;
border-radius: 50%;
background: var(--text-muted);
animation: typingDot 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot {
0%, 80%, 100% { transform: scale(1); opacity: .4; }
40% { transform: scale(1.3); opacity: 1; }
}
/* ── Skeleton loadings ────────────────────── */
.skeleton {
background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
background-size: 200% 100%;
animation: shimmer 1.5s infinite;
border-radius: 4px;
}
@keyframes shimmer {
from { background-position: 200% 0; }
to { background-position: -200% 0; }
}
/* ── Scrollable contacts alpha index ─────── */
.alpha-list { list-style: none; }
.alpha-section-header {
padding: 4px 16px;
font-size: 13px;
font-weight: 600;
color: var(--text-muted);
background: var(--bg);
position: sticky;
top: 0;
}
/* ── Image viewer ─────────────────────────── */
.img-viewer {
position: fixed;
inset: 0;
background: #000;
z-index: 9000;
display: flex;
align-items: center;
justify-content: center;
}
.img-viewer img { max-width: 100%; max-height: 100%; }
.img-viewer-close {
position: absolute;
top: max(20px, var(--safe-top));
right: 20px;
color: #fff;
font-size: 28px;
cursor: pointer;
}
/* ── Discover page ────────────────────────── */
.discover-item {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 16px;
background: var(--surface);
cursor: pointer;
}
.discover-icon {
width: 36px;
height: 36px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
}
/* ── Utils ────────────────────────────────── */
.flex-1 { flex: 1; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.p-16 { padding: 16px; }
.hidden { display: none !important; }