LineChatbot / static /style.css
raystermomo's picture
Deploy romance chat to Hugging Face Spaces
6cd1906
Raw
History Blame Contribute Delete
9.39 kB
/* =====================================================================
LINE-inspired Chat UI for Streamlit
Loaded by core/ui.py and injected via st.markdown(unsafe_allow_html=True)
===================================================================== */
/* ---------- Streamlit chrome cleanup ---------- */
#MainMenu, header[data-testid="stHeader"], footer { visibility: hidden; }
[data-testid="stToolbar"] { display: none !important; }
[data-testid="stDecoration"] { display: none !important; }
/* ---------- Wallpaper (LINE default-ish blue) ---------- */
.stApp {
background:
radial-gradient(circle at 20% 10%, rgba(255,255,255,0.08), transparent 40%),
radial-gradient(circle at 80% 90%, rgba(255,255,255,0.06), transparent 45%),
linear-gradient(180deg, #88a9c9 0%, #7799bb 100%);
background-attachment: fixed;
font-family: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
"Yu Gothic", Meiryo, "Helvetica Neue", Arial, sans-serif;
}
/* Centered phone-like column */
.block-container {
padding-top: 0.5rem;
padding-bottom: 6.5rem;
max-width: 720px;
}
/* ---------- Top header (sticky, LINE-style white bar) ---------- */
.line-header {
position: sticky;
top: 0;
z-index: 50;
background: linear-gradient(180deg, #ffffff 0%, #f6f7f9 100%);
color: #1c1c1e;
padding: 12px 18px;
border-radius: 14px;
margin: 4px 0 14px 0;
font-weight: 700;
text-align: center;
font-size: 16px;
letter-spacing: 0.02em;
box-shadow: 0 2px 6px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04) inset;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
}
.line-header::before {
content: "";
width: 8px;
height: 8px;
border-radius: 50%;
background: #06c755; /* LINE green status dot */
box-shadow: 0 0 0 3px rgba(6,199,85,0.18);
flex-shrink: 0;
}
/* ---------- Conversation rows ---------- */
.chat-row {
display: flex;
margin: 6px 0;
align-items: flex-end;
gap: 6px;
animation: bubble-in 0.18s ease-out;
}
.chat-row.user { justify-content: flex-end; }
.chat-row.assistant { justify-content: flex-start; }
@keyframes bubble-in {
from { opacity: 0; transform: translateY(4px); }
to { opacity: 1; transform: translateY(0); }
}
/* ---------- Bubbles ---------- */
.bubble {
position: relative;
max-width: 70%;
padding: 10px 14px;
border-radius: 18px;
font-size: 15px;
line-height: 1.55;
word-wrap: break-word;
overflow-wrap: anywhere;
box-shadow: 0 1px 1.5px rgba(0,0,0,0.08);
}
/* USER (right, LINE green) */
.bubble.user {
background: #8de055;
color: #102a06;
border-bottom-right-radius: 4px;
}
.bubble.user::after {
content: "";
position: absolute;
right: -6px;
bottom: 0;
width: 12px;
height: 14px;
background: #8de055;
clip-path: polygon(0 0, 100% 100%, 0 100%);
border-bottom-left-radius: 2px;
}
/* ASSISTANT (left, white) */
.bubble.assistant {
background: #ffffff;
color: #1c1c1e;
border-bottom-left-radius: 4px;
}
.bubble.assistant::after {
content: "";
position: absolute;
left: -6px;
bottom: 0;
width: 12px;
height: 14px;
background: #ffffff;
clip-path: polygon(100% 0, 100% 100%, 0 100%);
border-bottom-right-radius: 2px;
}
.bubble a { color: #1769aa; text-decoration: underline; }
/* ---------- Avatar ---------- */
.avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: linear-gradient(135deg, #ffd1dc 0%, #ffb6c1 50%, #ff8fa3 100%);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
font-weight: 700;
flex-shrink: 0;
border: 2px solid #ffffff;
box-shadow: 0 1px 2px rgba(0,0,0,0.18);
text-transform: uppercase;
user-select: none;
}
.avatar-spacer { width: 40px; flex-shrink: 0; }
.assistant-block {
display: flex;
flex-direction: column;
max-width: calc(100% - 52px);
}
.partner-name {
font-size: 11.5px;
color: #ffffff;
margin: 2px 0 4px 6px;
opacity: 0.95;
font-weight: 500;
text-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
/* ---------- System notice pill ---------- */
.system-note {
text-align: center;
color: #ffffff;
font-size: 12px;
margin: 14px auto;
background: rgba(0,0,0,0.22);
padding: 5px 14px;
border-radius: 14px;
width: fit-content;
backdrop-filter: blur(2px);
}
/* ---------- Typing indicator ---------- */
.bubble.typing {
display: flex;
gap: 5px;
padding: 14px 18px;
align-items: center;
}
.bubble.typing span {
width: 7px;
height: 7px;
background: #b3b3b3;
border-radius: 50%;
display: inline-block;
animation: typing-bounce 1.3s infinite ease-in-out;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.18s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typing-bounce {
0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
30% { transform: translateY(-5px); opacity: 1; }
}
/* =====================================================================
Streamlit widget restyling — make it FEEL like LINE
===================================================================== */
/* Sidebar look (used on setup screen) */
[data-testid="stSidebar"] {
background: #ffffff;
border-right: 1px solid rgba(0,0,0,0.06);
}
/* Headings */
.stApp h1, .stApp h2, .stApp h3, .stApp h4 {
color: #ffffff;
text-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
/* Setup-screen subheaders should still pop on the blue bg */
.stApp .stSubheader, .stApp [data-testid="stMarkdownContainer"] h3 {
color: #ffffff;
}
/* Caption text */
.stApp [data-testid="stCaptionContainer"],
.stApp .stCaption {
color: rgba(255,255,255,0.85);
}
/* Text inputs / textareas — white pill cards */
.stTextInput > div > div > input,
.stTextArea textarea {
background: #ffffff !important;
border: 1px solid rgba(0,0,0,0.08) !important;
border-radius: 12px !important;
padding: 10px 14px !important;
font-size: 15px !important;
color: #1c1c1e !important;
box-shadow: 0 1px 2px rgba(0,0,0,0.06) !important;
transition: border-color 0.15s, box-shadow 0.15s;
}
.stTextInput > div > div > input:focus,
.stTextArea textarea:focus {
border-color: #06c755 !important;
box-shadow: 0 0 0 3px rgba(6,199,85,0.18) !important;
outline: none !important;
}
/* Input labels */
.stTextInput label, .stTextArea label, .stFileUploader label {
color: #ffffff !important;
font-weight: 500 !important;
}
/* File uploader card */
[data-testid="stFileUploader"] section {
background: rgba(255,255,255,0.95) !important;
border: 1.5px dashed rgba(6,199,85,0.5) !important;
border-radius: 12px !important;
}
/* Buttons — LINE green primary */
.stButton > button {
background: #ffffff;
color: #1c1c1e;
border: 1px solid rgba(0,0,0,0.1);
border-radius: 999px;
padding: 0.55rem 1.4rem;
font-weight: 600;
font-size: 14.5px;
box-shadow: 0 1px 2px rgba(0,0,0,0.08);
transition: transform 0.05s, box-shadow 0.15s, background 0.15s;
}
.stButton > button:hover {
background: #f5f5f5;
box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}
.stButton > button:active { transform: translateY(1px); }
.stButton > button[kind="primary"],
.stButton > button[data-testid="baseButton-primary"] {
background: #06c755 !important;
color: #ffffff !important;
border: none !important;
box-shadow: 0 2px 6px rgba(6,199,85,0.35) !important;
}
.stButton > button[kind="primary"]:hover {
background: #05b34c !important;
}
/* Divider */
hr, [data-testid="stDivider"] {
border-color: rgba(255,255,255,0.25) !important;
opacity: 0.6;
}
/* Alerts */
.stAlert {
border-radius: 12px !important;
box-shadow: 0 1px 2px rgba(0,0,0,0.08) !important;
}
/* ---------- Chat input at the bottom — make it a white LINE bar ---------- */
[data-testid="stChatInput"] {
background: rgba(247, 247, 247, 0.96) !important;
border-top: 1px solid rgba(0,0,0,0.08) !important;
backdrop-filter: blur(8px);
padding: 8px 12px !important;
}
[data-testid="stChatInput"] textarea {
background: #ffffff !important;
border: 1px solid rgba(0,0,0,0.1) !important;
border-radius: 22px !important;
padding: 10px 16px !important;
font-size: 15px !important;
color: #1c1c1e !important;
}
[data-testid="stChatInput"] textarea:focus {
border-color: #06c755 !important;
box-shadow: 0 0 0 2px rgba(6,199,85,0.2) !important;
outline: none !important;
}
[data-testid="stChatInput"] button {
background: #06c755 !important;
border-radius: 50% !important;
color: #ffffff !important;
}
[data-testid="stChatInput"] button:hover { background: #05b34c !important; }
[data-testid="stChatInput"] button svg { fill: #ffffff !important; }
/* Spinner color tweak */
.stSpinner > div { border-top-color: #06c755 !important; }
/* ---------- Mobile tweaks ---------- */
@media (max-width: 480px) {
.block-container { padding-left: 0.6rem; padding-right: 0.6rem; }
.bubble { max-width: 78%; font-size: 14.5px; }
.avatar, .avatar-spacer { width: 36px; height: 36px; }
.assistant-block { max-width: calc(100% - 46px); }
}