You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.5 KiB
CSS

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/* style.css */
/* 全局样式和基础布局 */
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
background-color: #f4f5f7;
color: #172b4d;
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
}
.container {
width: 100%;
max-width: 1200px;
background-color: #ffffff;
padding: 24px 48px;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
box-sizing: border-box;
}
h1 {
color: #091e42;
text-align: center;
}
p {
text-align: center;
color: #5e6c84;
margin-bottom: 24px;
}
/* 文本输入框样式 */
textarea#text-input {
width: 100%;
padding: 12px;
border: 2px solid #dfe1e6;
border-radius: 4px;
font-size: 14px;
box-sizing: border-box;
resize: vertical; /* 允许用户垂直调整大小 */
transition:
border-color 0.2s,
box-shadow 0.2s;
}
textarea#text-input:focus {
outline: none;
border-color: #4c9aff;
box-shadow: 0 0 0 2px rgba(76, 154, 255, 0.3);
}
/* 按钮样式 */
button#generate-btn {
display: block;
width: 100%;
padding: 12px;
margin: 20px 0;
background-color: #0052cc;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.2s;
}
button#generate-btn:hover {
background-color: #0065ff;
}
button#generate-btn:active {
background-color: #0747a6;
}
/* 二维码容器和项目样式 */
#qrcode-container {
margin-top: 24px;
display: flex;
flex-direction: column; /* 垂直排列 */
align-items: stretch; /* 让子项目qrcode-item在交叉轴上填满容器 */
gap: 30px; /* 二维码之间的间距 */
}
.qrcode-item {
width: 100%; /* 明确宽度为100% */
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center; /* 容器内的内容标签和canvas居中 */
padding: 15px;
background-color: #fafbfc;
border: 1px solid #dfe1e6;
border-radius: 4px;
}
.qrcode-label {
font-size: 14px;
font-weight: bold;
color: #5e6c84;
margin-bottom: 10px;
}
/*
让 canvas 宽度自适应其父容器qrcode-item并保持宽高比。
*/
.qrcode-item canvas {
width: 100%;
height: auto;
display: block; /* 移除 canvas 作为内联元素可能产生的额外空间 */
background-color: white;
padding: 10px;
border: 1px solid #ccc;
box-sizing: border-box;
}