/* 定义颜色变量 */ :root { --ion-color-primary: #3880ff; --ion-color-light: #ffffff; --ion-color-medium: #555555; --ion-color-primary-dark: #2f6fad; /* 更深的主色调,用于 hover 状态 */ } /* 生日输入项样式 */ .datetime-input-item { display: flex; align-items: center; /* 垂直居中对齐 */ justify-content: space-between; /* 左右分布 */ width: 100%; /* 确保整个容器占据全部宽度 */ } .datetime-container { margin-left: auto; /* 强制日期选择器靠右 */ display: flex; align-items: center; } /* 错误信息样式 */ .datetime-error { color: red; margin-top: 4px; } /* 文件输入项样式 */ .file-input-item { display: flex; align-items: center; /* 垂直居中对齐 */ justify-content: space-between; /* 左右分布 */ width: 100%; /* 确保整个容器占据全部宽度 */ } .file-input-container { display: flex; align-items: center; width: 100%; /* 确保容器占据全部宽度 */ } .button-wrapper { margin-left: auto; /* 强制按钮靠右 */ } .custom-file-button-wrapper { position: relative; } .custom-file-button { padding: 12px 24px; background-color: var(--ion-color-primary); color: var(--ion-color-light); border: none; border-radius: 4px; font-size: 16px; cursor: pointer; text-align: center; transition: background-color 0.3s ease; /* 添加过渡效果 */ &:hover { background-color: var(--ion-color-primary-dark); /* 使用预先定义的深色变量 */ } &:active { background-color: var(--ion-color-primary-darker); /* 更深的颜色表示按下状态 */ } &:focus { outline: none; box-shadow: 0 0 8px rgba(0, 0, 0, 0.2); } &.disabled { opacity: 0.5; cursor: not-allowed; } } .custom-file-label { margin-top: 8px; color: var(--ion-color-medium); font-size: 14px; text-align: right; /* 对齐到右侧 */ } .avatar-label { font-size: 1.3em; /* 增大字体大小 */ margin-right: 16px; /* 给标签添加一些右边距 */ } /* 图片预览样式 */ .preview-image-container { margin-top: 8px; } .preview-image { max-width: 100%; border-radius: 8px; }